/* ═══════════════════════════════════════
   Projects Archive Page
═══════════════════════════════════════ */

.ap-dd-page {
  background: var(--dovetail-bg);
  color: var(--dovetail-dark);
}

.ap-dd-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding-left: 0;
  padding-right: 0;
}

/* ── Hero banner ── */
.ap-dd-hero {
  min-height: 58vh;
  background: var(--dovetail-green-800);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.ap-dd-hero h1 {
  margin: 0 !important;
  color: var(--dovetail-white) !important;
  font-size: clamp(36px, 6vw, 64px) !important;
  line-height: 0.95 !important;
  font-weight: 400 !important;
  font-style: normal !important;
}

.ap-dd-hero-line1 {
  display: block;
  font-family: "Cal Sans", sans-serif !important;
  font-weight: 400 !important;
}

.ap-dd-hero-line2 {
  font-size: clamp(26px, 3vw, 36px) !important;
  display: block;
  font-family: "Old Standard TT", serif !important;
  font-style: italic !important;
  font-weight: 400 !important;
  margin-top: -50px;
}

/* ── Toolbar (Search & View Switcher) ── */
.ap-dd-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 48px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(31, 30, 27, 0.12);
}

.ap-dd-search-wrap {
  position: relative;
  flex: 1;
  max-width: 520px;
  display: flex;
  align-items: center;
  height: 48px;
}

.ap-dd-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  stroke: var(--dovetail-dark, #1f1e1b);
  opacity: 0.55;
  pointer-events: none;
  z-index: 5;
}

.ap-dd-search-input {
  width: 100%;
  height: 100%;
  padding: 0 44px 0 48px !important;
  font-family: "Roboto", sans-serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--dovetail-dark, #1f1e1b);
  background: var(--dovetail-white, #ffffff);
  border: 1px solid rgba(31, 30, 27, 0.2) !important;
  border-radius: 0 !important;
  outline: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  box-sizing: border-box;
}

.ap-dd-search-input::placeholder {
  color: rgba(31, 30, 27, 0.45);
  font-weight: 300;
}

.ap-dd-search-input:focus {
  border-color: var(--dovetail-dark, #1f1e1b) !important;
  box-shadow: 0 4px 16px rgba(31, 30, 27, 0.1);
}

.ap-dd-search-clear {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: rgba(31, 30, 27, 0.5);
  cursor: pointer;
  padding: 4px 8px;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: color 0.2s ease;
}

.ap-dd-search-clear:hover {
  color: var(--dovetail-dark, #1f1e1b);
}

/* View Switcher Segmented Control */
.ap-dd-view-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--dovetail-white, #ffffff);
  border: 1px solid rgba(31, 30, 27, 0.2);
  padding: 4px;
  height: 48px;
  box-sizing: border-box;
}

.ap-dd-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  height: 100%;
  background: transparent;
  border: none;
  border-radius: 0;
  font-family: "Roboto", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(31, 30, 27, 0.55);
  cursor: pointer;
  transition: all 0.25s ease;
}

.ap-dd-view-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  flex-shrink: 0;
}

.ap-dd-view-btn:hover {
  color: var(--dovetail-dark, #1f1e1b);
  background: rgba(0, 0, 0, 0.04);
}

.ap-dd-view-btn.active {
  background: var(--dovetail-dark, #1f1e1b);
  color: var(--dovetail-white, #ffffff) !important;
}

.ap-dd-view-btn.active svg {
  stroke: var(--dovetail-white, #ffffff);
}

/* ── List View Layout ── */
.ap-dd-grid.ap-dd-grid--list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.ap-dd-grid.ap-dd-grid--list .ap-dd-card,
.ap-dd-grid.ap-dd-grid--list .ap-dd-card--hero {
  min-height: 280px;
  grid-column: auto;
}

.ap-dd-grid.ap-dd-grid--list .ap-dd-card-link {
  flex-direction: row;
  align-items: center;
  background: var(--dovetail-white, #fff);
  border: 1px solid var(--dovetail-border, #e5e5e5);
}

.ap-dd-grid.ap-dd-grid--list .ap-dd-card-bg {
  position: relative;
  width: 42%;
  height: 100%;
  min-height: 280px;
  flex-shrink: 0;
}

.ap-dd-grid.ap-dd-grid--list .ap-dd-card-overlay {
  display: none;
}

.ap-dd-grid.ap-dd-grid--list .ap-dd-card-content {
  padding: 32px 40px;
  max-width: 100%;
}

.ap-dd-grid.ap-dd-grid--list .ap-dd-card-content h3 {
  color: var(--dovetail-dark) !important;
  font-size: clamp(22px, 2.5vw, 36px) !important;
}

.ap-dd-grid.ap-dd-grid--list .ap-dd-desc {
  color: var(--dovetail-text-muted, #555) !important;
}

.ap-dd-grid.ap-dd-grid--list .ap-dd-btn {
  background: var(--dovetail-dark);
  color: var(--dovetail-white) !important;
  border-color: var(--dovetail-dark);
}

.ap-dd-grid.ap-dd-grid--list .ap-dd-card-link:hover .ap-dd-card-content h3 {
  color: var(--dovetail-green-800, #2c4033) !important;
}

.ap-dd-grid.ap-dd-grid--list .ap-dd-card-link:hover .ap-dd-btn {
  background: var(--dovetail-green-800, #2c4033);
  border-color: var(--dovetail-green-800, #2c4033);
  color: var(--dovetail-white) !important;
}

/* ── Grid section ── */
.ap-dd-list-section {
  padding: 60px 0 90px;
}

/* ── Status sections (Current / Completed) ── */
.ap-dd-status-section + .ap-dd-status-section {
  margin-top: 80px;
}

.ap-dd-section-head {
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(31, 30, 27, 0.12);
}

.ap-dd-section-eyebrow {
  display: block;
  font-family: "Roboto", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dovetail-green-800, #2c4033);
  margin-bottom: 8px;
}

.ap-dd-section-heading {
  margin: 0 !important;
  font-family: "Cal Sans", sans-serif !important;
  font-size: clamp(28px, 3.5vw, 44px) !important;
  font-weight: 400 !important;
  font-style: normal !important;
  line-height: 1.05 !important;
  color: var(--dovetail-dark, #1f1e1b) !important;
}

.ap-dd-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* No matching projects found — hidden by default, shown only when a search query returns zero results */
.ap-dd-no-projects {
  display: none;
  text-align: center;
  padding: 64px 20px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--dovetail-dark-500);
}

/* ── Card ── */
.ap-dd-card {
  position: relative;
  width: 100%;
  min-height: 480px;
  overflow: hidden;
}

/* Whole card is the link */
.ap-dd-card-link {
  display: flex;
  align-items: flex-end;
  width: 100%;
  height: 100%;
  min-height: inherit;
  text-decoration: none !important;
  position: relative;
}

/* First card spans full row */
.ap-dd-card--hero {
  grid-column: 1 / -1;
  min-height: 620px;
}

/* ── Background image ── */
.ap-dd-card-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.ap-dd-card-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.5s ease;
}

.ap-dd-card-link:hover .ap-dd-card-bg img {
  transform: scale(1.05);
}

/* ── Overlay ── */
.ap-dd-card-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.78),
    rgba(0, 0, 0, 0.22),
    rgba(0, 0, 0, 0.04)
  );
  transition: background 0.35s ease;
}

/* Darker overlay + golden title on hover */
.ap-dd-card-link:hover .ap-dd-card-overlay {
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.88),
    rgba(0, 0, 0, 0.45),
    rgba(0, 0, 0, 0.15)
  );
}

/* ── Card content ── */
.ap-dd-card-content {
  position: relative;
  z-index: 2;
  padding: 44px;
  max-width: 780px;
  width: 100%;
}

.ap-dd-card--hero .ap-dd-card-content {
  max-width: 860px;
}

.ap-dd-card-content h3 {
  margin: 0 0 12px !important;
  color: var(--dovetail-white) !important;
  font-size: clamp(26px, 3vw, 52px) !important;
  line-height: 1.05 !important;
  font-weight: 500 !important;
  font-style: normal !important;
  transition: color 0.25s ease !important;
}

.ap-dd-card--hero .ap-dd-card-content h3 {
  font-size: clamp(36px, 4.5vw, 72px) !important;
}

/* Golden title on hover */
.ap-dd-card-link:hover .ap-dd-card-content h3 {
  color: var(--dovetail-green-200) !important;
}

/* Meta block: short description — keeps the gap before the button consistent */
.ap-dd-meta {
  margin: 0 0 26px;
}

.ap-dd-meta > p {
  margin: 0 !important;
}

.ap-dd-desc {
  color: rgba(255, 255, 255, 0.72) !important;
  font-size: 15px !important;
  line-height: 1.55 !important;
  max-width: 560px;
}

.ap-dd-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 13px 28px;
  background: var(--dovetail-white);
  color: var(--dovetail-dark) !important;
  text-decoration: none !important;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--dovetail-white);
  transition: background 0.25s ease, color 0.25s ease;
}

.ap-dd-card-link:hover .ap-dd-btn {
  background: transparent;
  color: var(--dovetail-white) !important;
}

.ap-dd-no-projects {
  grid-column: 1 / -1;
  font-size: 18px;
  color: var(--dovetail-dark);
}

/* ── Tablet: 1024px ── */
@media (max-width: 1024px) {
  .ap-dd-container {
    padding-left: 24px;
    padding-right: 24px;
  }

  .ap-dd-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .ap-dd-card {
    min-height: 400px;
  }

  .ap-dd-card--hero {
    min-height: 520px;
  }

  .ap-dd-card-content {
    padding: 32px;
  }
}

/* ── Mobile: 767px ── */
@media (max-width: 767px) {
  .ap-dd-container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .ap-dd-hero {
    min-height: 48vh;
  }
  .ap-dd-hero-line2 {
    margin-top: -28px;
  }

  .ap-dd-list-section {
    padding: 56px 0;
  }

  .ap-dd-status-section + .ap-dd-status-section {
    margin-top: 56px;
  }

  .ap-dd-section-head {
    margin-bottom: 20px;
    padding-bottom: 14px;
  }

  .ap-dd-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .ap-dd-card,
  .ap-dd-card--hero {
    min-height: 360px;
  }

  .ap-dd-card-content,
  .ap-dd-card--hero .ap-dd-card-content {
    padding: 24px;
    max-width: 100%;
  }

  .ap-dd-desc {
    font-size: 13.5px !important;
  }

  .ap-dd-meta {
    margin-bottom: 20px;
  }

  .ap-dd-btn {
    padding: 11px 22px;
    font-size: 13px;
  }

  /* Toolbar & List View on mobile */
  .ap-dd-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 28px;
    padding-bottom: 16px;
  }

  .ap-dd-search-wrap {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    height: 44px;
  }

  .ap-dd-search-input {
    height: 44px;
    padding: 0 28px 0 34px !important;
    font-size: 12px;
  }

  .ap-dd-search-icon {
    left: 10px;
    width: 14px;
    height: 14px;
  }

  .ap-dd-view-switcher {
    flex-shrink: 0;
    height: 44px;
    padding: 3px;
    gap: 2px;
    box-sizing: border-box;
  }

  .ap-dd-view-btn {
    padding: 0 8px;
    height: 100%;
    font-size: 10px;
    gap: 4px;
  }

  .ap-dd-view-btn svg {
    width: 14px;
    height: 14px;
  }

  /* Mobile List View: Compact Side-by-Side Row Layout */
  .ap-dd-grid.ap-dd-grid--list .ap-dd-card,
  .ap-dd-grid.ap-dd-grid--list .ap-dd-card--hero {
    min-height: 110px;
    height: auto;
  }

  .ap-dd-grid.ap-dd-grid--list .ap-dd-card-link {
    flex-direction: row !important;
    align-items: center !important;
    min-height: 110px;
    padding: 10px;
    gap: 14px;
    background: var(--dovetail-white, #ffffff);
    border: 1px solid var(--dovetail-border, #e5e5e5);
  }

  .ap-dd-grid.ap-dd-grid--list .ap-dd-card-bg {
    position: relative;
    width: 100px !important;
    height: 100px !important;
    min-height: 100px !important;
    flex-shrink: 0;
    overflow: hidden;
  }

  .ap-dd-grid.ap-dd-grid--list .ap-dd-card-content {
    padding: 0 !important;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .ap-dd-grid.ap-dd-grid--list .ap-dd-card-content h3 {
    font-size: 15px !important;
    margin: 0 0 2px 0 !important;
    line-height: 1.25 !important;
    color: var(--dovetail-dark, #1f1e1b) !important;
  }

  .ap-dd-grid.ap-dd-grid--list .ap-dd-meta {
    margin-bottom: 4px !important;
  }

  .ap-dd-grid.ap-dd-grid--list .ap-dd-desc {
    font-size: 12px !important;
    line-height: 1.35 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: rgba(31, 30, 27, 0.65) !important;
  }

  .ap-dd-grid.ap-dd-grid--list .ap-dd-btn {
    padding: 6px 12px;
    font-size: 10px;
    align-self: flex-start;
  }
}
