/* ═══════════════════════════════════════
   Single Project Detail Page
═══════════════════════════════════════ */

.sp-dd-page {
  background: var(--dovetail-bg);
  color: var(--dovetail-dark);
  /* The scope panel breaks out to 100vw, which includes the scrollbar
     width — clip stops that causing a horizontal scrollbar */
  overflow-x: clip;
}

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

/* ── Hero ── */
.sp-dd-hero {
  position: relative;
  min-height: 88vh;
  background: var(--dovetail-dark);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: flex-end;
}

.sp-dd-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0.35) 55%,
    rgba(0, 0, 0, 0.08) 100%
  );
  z-index: 1;
}

.sp-dd-hero-content {
  position: relative;
  z-index: 2;
  padding-bottom: 64px;
}

.sp-dd-price {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--dovetail-white);
  font-family: "Cal Sans", sans-serif;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.sp-dd-hero-content h1 {
  margin: 0 0 18px !important;
  color: var(--dovetail-white) !important;
  font-family: "Cal Sans", sans-serif !important;
  font-size: clamp(40px, 5.5vw, 84px) !important;
  line-height: 0.97 !important;
  font-weight: 600 !important;
  font-style: normal !important;
}

.sp-dd-hero-address {
  margin: 0 0 28px !important;
  color: rgba(255, 255, 255, 0.85) !important;
  font-family: "Old Standard TT", serif !important;
  font-size: clamp(28px, 3vw, 36px) !important;
  font-style: italic !important;
  line-height: 1.3 !important;
  letter-spacing: 0.01em !important;
}

.sp-dd-hero-meta {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 32px;
}

.sp-dd-hero-meta-item {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding-right: 20px;
  margin-right: 20px;
  border-right: 1px solid rgba(255, 255, 255, 0.25);
}

.sp-dd-hero-meta-item:last-child {
  border-right: none;
  padding-right: 0;
  margin-right: 0;
}

.sp-dd-hero-meta-item svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  opacity: 0.9;
}

.sp-dd-hero-meta-item strong {
  font-weight: 400;
  color: var(--dovetail-white);
}

.sp-dd-hero-desc {
  margin: 0 0 28px !important;
  color: rgba(255, 255, 255, 0.8) !important;
  font-size: 16px !important;
  line-height: 1.7 !important;
  max-width: 640px;
}

.sp-dd-hero-back {
  display: inline-flex !important;
  align-items: center;
  gap: 9px;
  padding: 12px 24px;
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  color: var(--dovetail-white) !important;
  text-decoration: none !important;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.sp-dd-hero-back svg {
  width: 15px;
  height: 15px;
  transition: transform 0.2s ease;
}

.sp-dd-hero-back:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.8) !important;
}

.sp-dd-hero-back:hover svg {
  transform: translateX(-3px);
}

/* ── Body wrapper ── */
.sp-dd-body {
  padding-top: 72px;
  padding-bottom: 0px;
}

/* ── Stats bar ── */
.sp-dd-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border: 1px solid var(--dovetail-border);
  background: var(--dovetail-white);
  margin-bottom: 72px;
}

.sp-dd-stat {
  flex: 1 1 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 32px 24px;
  border-right: 1px solid var(--dovetail-border);
  text-align: center;
}

.sp-dd-stat:last-child {
  border-right: none;
}

.sp-dd-stat svg {
  width: 26px;
  height: 26px;
  color: var(--dovetail-taupe);
  margin-bottom: 2px;
}

.sp-dd-stat-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--dovetail-dark);
  line-height: 1;
  font-family: var(--font-heading, serif);
}

.sp-dd-stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--dovetail-taupe);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── Tabs ── */
.sp-dd-tabs {
  margin-bottom: 80px;
}

.sp-dd-tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--dovetail-border);
  margin-bottom: 52px;
}

.sp-dd-tab-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 15px 32px !important;
  background: transparent !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  margin-bottom: -2px !important;
  box-shadow: none !important;
  font-family: var(--font-body, sans-serif) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  color: var(--dovetail-text-muted) !important;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease !important;
  outline: none !important;
}

.sp-dd-tab-btn svg {
  width: 16px !important;
  height: 16px !important;
  flex-shrink: 0;
  stroke: currentColor !important;
}

.sp-dd-tab-btn:hover,
.sp-dd-tab-btn:focus {
  background: transparent !important;
  box-shadow: none !important;
  color: var(--dovetail-dark) !important;
  border-bottom-color: var(--dovetail-taupe) !important;
}

.sp-dd-tab-btn.active {
  background: transparent !important;
  box-shadow: none !important;
  color: var(--dovetail-dark) !important;
  border-bottom: 2px solid var(--dovetail-dark) !important;
}

/* a11y: visible keyboard focus (base rule sets outline:none) */
.sp-dd-tab-btn:focus-visible {
  outline: 2px solid var(--dovetail-accent) !important;
  outline-offset: 3px !important;
}

.sp-dd-tab-count {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 20px !important;
  height: 20px !important;
  background: var(--dovetail-border) !important;
  color: var(--dovetail-dark) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  border-radius: 50% !important;
  line-height: 1 !important;
}

.sp-dd-tab-btn.active .sp-dd-tab-count {
  background: var(--dovetail-dark) !important;
  color: var(--dovetail-white) !important;
}

.sp-dd-tab-panel {
  display: none;
}

.sp-dd-tab-panel.active {
  display: block;
}

/* ── Two-column layout ── */
.sp-dd-main-row {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 64px;
  margin-bottom: 80px;
  align-items: start;
}

/* ── Section titles ── */
.sp-dd-section {
  margin-bottom: 72px;
}

.sp-dd-section-title {
  margin: 0 0 32px !important;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--dovetail-border);
  color: var(--dovetail-dark) !important;
  font-size: clamp(22px, 2.2vw, 34px) !important;
  font-weight: 500 !important;
  font-style: normal !important;
  line-height: 1.1 !important;
}

/* ── Description ── */
.sp-dd-desc {
  font-size: 17px !important;
  line-height: 1.8 !important;
  color: var(--dovetail-dark-700) !important;
  margin: 0 !important;
}

.sp-dd-content {
  font-size: 16px;
  line-height: 1.8;
  color: var(--dovetail-dark-700);
}

.sp-dd-content p {
  margin-bottom: 1.4em;
}

/* ── Project Info — open editorial spec column (right col) ──
   No box: the metadata reads as a monograph colophon, framed by
   hairlines and rhythm rather than a bordered card. */
.sp-dd-details-card {
  position: sticky;
  top: 100px;
}

/* Header row: section label + status marker on one tidy metadata line */
.sp-dd-details-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 22px;
}

.sp-dd-details-title {
  margin: 0 !important;
  font-family: var(--font-body, "Roboto", sans-serif) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  font-style: normal !important;
  line-height: 1 !important;
  color: var(--dovetail-dark) !important;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

/* Stacked facts: a tiny tracked label over a clean value, hairline-split.
   The editorial alternative to a right-aligned spec-sheet row. */
.sp-dd-facts {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--dovetail-border);
}

.sp-dd-fact {
  padding: 16px 0;
}

.sp-dd-fact + .sp-dd-fact {
  border-top: 1px solid var(--dovetail-taupe-100);
}

.sp-dd-fact dt {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dovetail-text-muted);
}

.sp-dd-fact dd {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--dovetail-dark);
}

/* When the sidebar has nothing to show, the content spans full width */
.sp-dd-main-row > .sp-dd-col-left:only-child {
  grid-column: 1 / -1;
}

/* ── Editorial story sections (Scope of Work / The Challenge) ──
   Shared header pattern: gold dash + small-caps eyebrow + serif title.
   Replaces the old boxed look with open, magazine-style spacing. */
.sp-dd-story-head {
  margin-bottom: 28px;
}

.sp-dd-story-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  color: var(--dovetail-text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.sp-dd-story-eyebrow::before {
  content: "";
  width: 36px;
  height: 2px;
  background: var(--dovetail-accent);
  flex-shrink: 0;
}

.sp-dd-story-title {
  margin: 0 !important;
  color: var(--dovetail-dark) !important;
  font-size: clamp(26px, 2.4vw, 38px) !important;
  font-weight: 500 !important;
  font-style: normal !important;
  line-height: 1.1 !important;
}

/* ── Scope of Work — full-bleed feature panel ──
   Dark forest-green block with the project's own gallery image,
   spanning the entire viewport width edge to edge. */

/* Breakout: the section sits inside the centered .sp-dd-container,
   so shifting by 50% - 50vw lands its left edge on the viewport edge */
.sp-dd-scope-bleed {
  width: 100vw;
  margin-left: calc(50% - 50vw);
}

.sp-dd-scope-panel {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  background: var(--dovetail-green-950);
  overflow: hidden;
  min-height: 460px;
}

.sp-dd-scope-panel--noimg {
  grid-template-columns: 1fr;
}

.sp-dd-scope-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* Left padding tracks the container margin on wide screens so the
     text lines up with the rest of the page content */
  padding: 72px clamp(26px, 5vw, 90px) 72px max(26px, calc((100vw - 1400px) / 2 + 10px));
}

/* On-dark overrides for the shared editorial header */
.sp-dd-scope-panel .sp-dd-story-head {
  margin-bottom: 22px;
}

.sp-dd-scope-panel .sp-dd-story-eyebrow {
  color: var(--dovetail-green-200);
}

/* No leading dash on the Scope eyebrow — the label sits flush-left,
   aligned with the title and body below it. */
.sp-dd-scope-panel .sp-dd-story-eyebrow::before {
  display: none;
}

.sp-dd-scope-panel .sp-dd-story-title {
  color: var(--dovetail-white) !important;
}

/* Scope text — light on the green panel */
.sp-dd-scope-text {
  margin: 0 !important;
  max-width: 560px;
  color: var(--dovetail-dark-100) !important;
  font-size: clamp(16px, 1.4vw, 19px) !important;
  font-weight: 400 !important;
  line-height: 1.8 !important;
}

/* Image column — full bleed */
.sp-dd-scope-img {
  position: relative;
  min-height: 300px;
}

.sp-dd-scope-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Challenge body — readable measure, generous leading */
.sp-dd-story-content {
  max-width: 720px;
  color: var(--dovetail-dark-700);
  font-size: 16.5px;
  line-height: 1.85;
}

.sp-dd-story-content p {
  margin: 0 0 20px;
}

.sp-dd-story-content p:last-child {
  margin-bottom: 0;
}

/* Lede — first paragraph slightly larger, draws the eye in */
.sp-dd-story-content > p:first-child {
  font-size: 19px;
  line-height: 1.7;
  color: var(--dovetail-dark);
}

/* ── The Challenge — editorial chapter ──
   An open two-column spread anchored by a vertical "spine" rule.
   Left: a sticky two-voice title lockup (Cal Sans setup word + Old
   Standard TT italic hero word). Right: a lede-led story that hangs
   off the spine, opened by a serif drop cap. No box — the structure
   and the hairlines do the framing. */
.sp-dd-chal {
  border-top: 1px solid var(--dovetail-border);
  border-bottom: 1px solid var(--dovetail-border);
  padding: clamp(52px, 6vw, 88px) 0;
}

.sp-dd-chal-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) 1.6fr;
  gap: clamp(36px, 6vw, 104px);
  align-items: start;
}

/* Title column stays in view while the story scrolls */
.sp-dd-chal-head {
  position: sticky;
  top: 110px;
}

/* The title is the anchor: a confident display lockup that fills the
   column so the left side reads as composed, not empty. */
.sp-dd-chal-title {
  margin: 10px 0 0 !important;
  line-height: 0.92 !important;
}

.sp-dd-chal-cal {
  display: block;
  font-family: "Cal Sans", sans-serif;
  font-style: normal;
  font-weight: 600;
  font-size: clamp(24px, 2.1vw, 34px);
  letter-spacing: 0.005em;
  color: var(--dovetail-dark);
}

.sp-dd-chal-ott {
  display: block;
  margin-top: 2px;
  font-family: "Old Standard TT", serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(46px, 5.2vw, 80px);
  line-height: 0.9;
  letter-spacing: -0.01em;
  color: var(--dovetail-accent-strong);
}

/* Story column — hangs off the vertical spine, capped to a readable
   measure so the line length stays in the 65–75ch band. */
.sp-dd-chal-body {
  position: relative;
  max-width: 68ch;
  border-left: 1px solid var(--dovetail-border);
  padding-left: clamp(32px, 4.5vw, 80px);
}

/* A short scarce-green node sits at the top of the spine — the one
   accent moment, aligned to the start of the story. */
.sp-dd-chal-body::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 0;
  width: 2px;
  height: 64px;
  background: var(--dovetail-accent);
}

/* Lede — the opening paragraph is set larger and in full ink to draw
   the eye in past the drop cap. */
.sp-dd-chal-body > p:first-child {
  font-size: clamp(18px, 1.5vw, 21px);
  line-height: 1.7;
  color: var(--dovetail-dark);
}

/* Drop cap on the opening paragraph */
.sp-dd-chal-body > p:first-child::first-letter {
  float: left;
  font-family: "Old Standard TT", serif;
  font-style: normal;
  font-weight: 400;
  font-size: clamp(58px, 6vw, 88px);
  line-height: 0.7;
  padding: 6px 14px 0 0;
  color: var(--dovetail-accent-strong);
}

/* ── Entrance reveal (progressive enhancement) ──
   Content is fully visible by default; JS adds .sp-reveal to opt in,
   so no-JS and reduced-motion users never see a hidden section. */
.sp-dd-chal.sp-reveal .sp-dd-chal-head,
.sp-dd-chal.sp-reveal .sp-dd-chal-body {
  opacity: 0;
  transform: translateY(20px);
}

.sp-dd-chal.sp-reveal.is-in .sp-dd-chal-head,
.sp-dd-chal.sp-reveal.is-in .sp-dd-chal-body {
  opacity: 1;
  transform: none;
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.sp-dd-chal.sp-reveal.is-in .sp-dd-chal-body {
  transition-delay: 0.12s;
}

@media (prefers-reduced-motion: reduce) {
  .sp-dd-chal.sp-reveal .sp-dd-chal-head,
  .sp-dd-chal.sp-reveal .sp-dd-chal-body {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ── Per-project testimonial ──
   Outer section: full-viewport-width brand black background.
   Inner .sp-dd-testi-grid: constrained to the same max-width as every
   other container on the page, so it aligns with header/footer/body. */
.sp-dd-testi-block {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-top: 72px;
  background: var(--dovetail-dark);
}

.sp-dd-testi-grid {
  display: grid;
  grid-template-columns: 0.72fr 1fr;
  min-height: 500px;
}

.sp-dd-testi-block--noimg .sp-dd-testi-grid {
  grid-template-columns: 1fr;
}

/* Left: image column */
.sp-dd-testi-img {
  position: relative;
  overflow: hidden;
}

.sp-dd-testi-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Right: content column */
.sp-dd-testi-content {
  padding: 88px 20px 88px 72px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Giant decorative quote mark — behind the text */
.sp-dd-testi-content::before {
  content: '\201C';
  position: absolute;
  top: -52px;
  left: 40px;
  font-family: "Old Standard TT", serif;
  font-size: 340px;
  line-height: 1;
  color: var(--dovetail-accent);
  opacity: 0.08;
  pointer-events: none;
  user-select: none;
}

.sp-dd-testi-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 48px;
  font-family: "Roboto", sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--dovetail-accent);
  position: relative;
  z-index: 1;
}

.sp-dd-testi-eyebrow::before {
  content: '';
  display: inline-block;
  width: 32px;
  height: 1px;
  background: var(--dovetail-accent);
  flex-shrink: 0;
}

.sp-dd-testi-fig {
  margin: 0;
  position: relative;
  z-index: 1;
}

.sp-dd-testi-quote {
  margin: 0 0 44px;
  padding: 0;
  border: none;
  background: none;
}

.sp-dd-testi-quote p {
  margin: 0;
  font-family: "Old Standard TT", serif;
  font-style: italic;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.72;
  color: var(--dovetail-on-dark);
  font-weight: 400;
}

.sp-dd-testi-cite {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 28px;
  border-top: 1px solid rgba(154, 123, 79, 0.25);
}

.sp-dd-testi-author {
  font-family: "Cal Sans", sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--dovetail-on-dark);
  letter-spacing: 0.01em;
}

.sp-dd-testi-role {
  font-family: "Roboto", sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: var(--dovetail-on-dark-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}


@media (max-width: 900px) {
  .sp-dd-testi-grid {
    grid-template-columns: 1fr;
  }

  .sp-dd-testi-block {
    margin-top: 40px;
  }

  .sp-dd-testi-img {
    height: 300px;
    position: relative; /* restore for stacked layout */
  }


  .sp-dd-testi-content {
    padding: 56px 32px;
  }
}

@media (max-width: 640px) {
  .sp-dd-testi-content {
    padding: 48px 18px;
  }

  .sp-dd-testi-quote p {
    font-size: 20px;
  }
}

/* ── Project Info: status marker ──
   A refined inline marker (dot + tracked label), not a chip. */
.sp-dd-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dovetail-dark);
  white-space: nowrap;
}

.sp-dd-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dovetail-accent); /* fallback color */
  flex-shrink: 0;
}

.sp-dd-status-completed   .sp-dd-status-dot { background: var(--dovetail-accent); }
.sp-dd-status-in-progress .sp-dd-status-dot { background: var(--dovetail-taupe); }
.sp-dd-status-coming-soon .sp-dd-status-dot { background: var(--dovetail-dark-300); }
.sp-dd-status-sold        .sp-dd-status-dot { background: var(--dovetail-taupe-700); }

/* ── Project Info: architect credit ──
   Separated from the facts by a hairline, like a magazine byline. */
.sp-dd-architect {
  padding-top: 24px;
  border-top: 1px solid var(--dovetail-border);
}

.sp-dd-architect-label {
  display: block;
  margin-bottom: 10px;
  color: var(--dovetail-text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sp-dd-architect-name {
  display: block;
  margin: 0 0 16px;
  color: var(--dovetail-dark);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.3;
}

.sp-dd-architect-socials {
  display: flex;
  gap: 8px;
}

.sp-dd-architect-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--dovetail-border);
  border-radius: 50%;
  color: var(--dovetail-dark) !important;
  font-size: 14px;
  text-decoration: none !important;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.sp-dd-architect-socials a:hover {
  background: var(--dovetail-dark);
  border-color: var(--dovetail-dark);
  color: var(--dovetail-green-200) !important;
  transform: translateY(-2px);
}

/* ── Skeleton shimmer ── */
@keyframes sp-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

.sp-dd-skeleton {
  background: linear-gradient(90deg, #e8e4de 25%, #f4f1ec 50%, #e8e4de 75%);
  background-size: 200% 100%;
  animation: sp-shimmer 1.4s ease-in-out infinite;
}

.sp-dd-skeleton img {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.sp-dd-gallery-item:not(.sp-dd-skeleton) img {
  opacity: 1;
}

/* ── Gallery ── */
.sp-dd-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 360px;
  gap: 12px;
}

.sp-dd-gallery-item {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--dovetail-border);
  margin: 0;
  height: 100%;
}

/* First gallery image spans 2 columns, taller row */
.sp-dd-gallery-item:first-child {
  grid-column: span 2;
  grid-row: span 1;
}

.sp-dd-gallery-item a {
  display: block;
  width: 100%;
  height: 100%;
}

/* a11y: visible keyboard focus on gallery triggers (inset so it shows over the image) */
.sp-dd-gallery-item a:focus-visible {
  outline: 3px solid var(--dovetail-accent);
  outline-offset: -3px;
}

.sp-dd-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
  display: block;
}

.sp-dd-gallery-item:hover img {
  transform: scale(1.06);
}

.sp-dd-gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}

.sp-dd-gallery-overlay svg {
  width: 40px;
  height: 40px;
  color: var(--dovetail-white);
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s ease;
}

.sp-dd-gallery-item:hover .sp-dd-gallery-overlay {
  background: rgba(0, 0, 0, 0.45);
}

.sp-dd-gallery-item:hover .sp-dd-gallery-overlay svg {
  opacity: 1;
  transform: scale(1);
}

/* ── Map ── */
.sp-dd-map-wrap {
  width: 100%;
  height: 480px;
  border: 1px solid var(--dovetail-border);
  overflow: hidden;
}

.sp-dd-map {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ── CTA Banner ── */
.sp-dd-cta {
  background: var(--dovetail-taupe-100);
  text-align: center;
  padding: 100px 24px;
}

.sp-dd-cta-eyebrow {
  margin: 0 0 20px !important;
  font-family: "Cal Sans", sans-serif !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  letter-spacing: 0.15em !important;
  text-transform: uppercase !important;
  color: var(--dovetail-text-muted) !important;
}

.sp-dd-cta-heading {
  margin: 0 0 44px !important;
  font-size: clamp(38px, 5vw, 68px) !important;
  line-height: 1.1 !important;
  color: var(--dovetail-dark) !important;
  font-family: "Cal Sans", sans-serif !important;
  font-style: normal !important;
  font-weight: 600 !important;
}

.sp-dd-cta-heading em {
  font-family: "Old Standard TT", serif !important;
  font-style: italic !important;
  font-weight: 400 !important;
}

.sp-dd-cta-btns {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.sp-dd-cta-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 15px 36px;
  font-size: 13px !important;
  font-weight: 500 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  text-decoration: none !important;
  transition: all 0.25s ease !important;
}

.sp-dd-cta-btn--primary {
  background: var(--dovetail-dark) !important;
  color: var(--dovetail-white) !important;
  border: 1px solid var(--dovetail-dark) !important;
}

.sp-dd-cta-btn--primary:hover {
  background: var(--dovetail-dark-700) !important;
  border-color: var(--dovetail-dark-700) !important;
}

.sp-dd-cta-btn--outline {
  background: transparent !important;
  color: var(--dovetail-dark) !important;
  border: 1px solid var(--dovetail-dark) !important;
}

.sp-dd-cta-btn--outline:hover {
  background: var(--dovetail-dark) !important;
  color: var(--dovetail-white) !important;
}

@media (max-width: 767px) {
  .sp-dd-cta {
    padding: 72px 24px;
  }

  .sp-dd-cta-btns {
    flex-direction: column;
    align-items: stretch;
    max-width: 320px;
    margin: 0 auto;
  }
}

/* ── Lightbox ── */
.sp-lb {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sp-lb[hidden] {
  display: none;
}

.sp-lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.94);
  cursor: zoom-out;
}

.sp-lb-stage {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 60px 100px;
  box-sizing: border-box;
}

.sp-lb-img-wrap {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sp-lb-img {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  object-fit: contain;
  display: block;
  transition: opacity 0.25s ease;
  user-select: none;
}

.sp-lb-img.sp-lb-loading {
  opacity: 0.2;
}

/* Close button */
.sp-lb-close {
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 3;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 50% !important;
  cursor: pointer;
  transition: background 0.2s ease !important;
  padding: 0 !important;
}

.sp-lb-close:hover {
  background: rgba(255, 255, 255, 0.22) !important;
}

.sp-lb-close svg {
  width: 20px;
  height: 20px;
  stroke: var(--dovetail-white);
}

/* Prev / Next arrows */
.sp-lb-prev,
.sp-lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 50% !important;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease !important;
  padding: 0 !important;
}

.sp-lb-prev { left: 20px; }
.sp-lb-next { right: 20px; }

.sp-lb-prev:hover { background: rgba(255,255,255,0.22) !important; transform: translateY(-50%) translateX(-2px); }
.sp-lb-next:hover { background: rgba(255,255,255,0.22) !important; transform: translateY(-50%) translateX(2px); }

.sp-lb-prev svg,
.sp-lb-next svg {
  width: 22px;
  height: 22px;
  stroke: var(--dovetail-white);
}

/* a11y: visible keyboard focus on lightbox controls (white ring on the dark backdrop) */
.sp-lb-close:focus-visible,
.sp-lb-prev:focus-visible,
.sp-lb-next:focus-visible {
  outline: 2px solid var(--dovetail-white) !important;
  outline-offset: 2px;
}

/* Counter */
.sp-lb-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-family: var(--font-body, sans-serif);
  letter-spacing: 0.1em;
}

@media (max-width: 767px) {
  .sp-lb-stage {
    padding: 56px 16px 48px;
  }

  .sp-lb-prev { left: 8px; }
  .sp-lb-next { right: 8px; }

  .sp-lb-prev,
  .sp-lb-next {
    width: 40px;
    height: 40px;
  }
}

/* ── Back link ── */
.sp-dd-back {
  padding-top: 48px;
  border-top: 1px solid var(--dovetail-border);
}

.sp-dd-back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--dovetail-dark) !important;
  text-decoration: none !important;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: gap 0.2s ease;
}

.sp-dd-back-link svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.sp-dd-back-link:hover {
  gap: 14px;
}

.sp-dd-back-link:hover svg {
  transform: translateX(-4px);
}

/* ═══════════════════════════════
   Responsive
═══════════════════════════════ */

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

  .sp-dd-main-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  /* Stacked below the article: a top rule separates the open column
     from the content above it, since it's no longer a contained card. */
  .sp-dd-details-card {
    position: static;
    margin-top: 8px;
    padding-top: 40px;
    border-top: 1px solid var(--dovetail-border);
  }

  .sp-dd-gallery {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 280px;
  }

  .sp-dd-gallery-item:first-child {
    grid-column: span 2;
  }

  .sp-dd-stat {
    flex: 1 1 140px;
    padding: 24px 16px;
  }

  .sp-dd-stat-value {
    font-size: 24px;
  }
}

/* Tablet tabs */
@media (max-width: 1024px) {
  .sp-dd-tab-btn {
    padding: 14px 22px;
    font-size: 13px;
  }
}

/* Mobile: 767px */
@media (max-width: 767px) {
  .sp-dd-tab-nav {
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sp-dd-tab-btn {
    padding: 12px 16px;
    font-size: 12px;
    white-space: nowrap;
    gap: 7px;
  }

  .sp-dd-tabs {
    margin-bottom: 48px;
  }

  .sp-dd-tab-nav {
    margin-bottom: 36px;
  }

  .sp-dd-container {
    padding-left: 18px;
    padding-right: 18px;
  }

  .sp-dd-hero {
    min-height: 60vh;
  }

  .sp-dd-hero-content {
    padding-bottom: 40px;
  }

  .sp-dd-body {
    padding-top: 48px;
    padding-bottom: 0px;
  }

  .sp-dd-stats {
    flex-wrap: wrap;
    margin-bottom: 48px;
  }

  .sp-dd-stat {
    flex: 1 1 calc(50% - 1px);
    border-bottom: 1px solid var(--dovetail-border);
    padding: 20px 12px;
  }

  /* Remove right border on even items */
  .sp-dd-stat:nth-child(even) {
    border-right: none;
  }

  .sp-dd-stat-value {
    font-size: 22px;
  }

  .sp-dd-section {
    margin-bottom: 32px;
  }

  .sp-dd-col-left .sp-dd-section:last-child {
    margin-bottom: 0;
  }

  .sp-dd-gallery {
    grid-template-columns: 1fr;
    grid-auto-rows: 260px;
  }

  .sp-dd-gallery-item:first-child {
    grid-column: span 1;
  }

  .sp-dd-map-wrap {
    height: 320px;
  }

  .sp-dd-details-card {
    padding-top: 32px;
  }

  .sp-dd-architect-name {
    font-size: 19px;
  }

  .sp-dd-story-head {
    margin-bottom: 20px;
  }

  .sp-dd-scope-panel {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .sp-dd-scope-content {
    padding: 36px 26px;
  }

  .sp-dd-scope-img {
    min-height: 240px;
  }

  .sp-dd-scope-text {
    font-size: 15.5px !important;
  }

  .sp-dd-story-content {
    font-size: 15.5px;
  }

  .sp-dd-story-content > p:first-child {
    font-size: 17px;
  }

  .sp-dd-chal {
    padding: 44px 0;
  }

  .sp-dd-chal-grid {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .sp-dd-chal-head {
    position: static;
  }

  /* Stacked: the spine and its accent node fall away */
  .sp-dd-chal-body {
    border-left: none;
    padding-left: 0;
  }

  .sp-dd-chal-body::before {
    display: none;
  }

  .sp-dd-chal-body > p:first-child::first-letter {
    font-size: 52px;
    padding: 5px 10px 0 0;
  }

}
