/* ------------------------------------------------------------------
   File: building-project.css
   Template: page-building-project.php ("Building Project")

   SYSTEM: continuous bands, not floating cards.
   Full-bleed sections butt directly against each other and the change of
   background color is the ONLY separation device — no gaps between
   sections, no card shadows, no radius on section edges. Everything sits
   on one 1120px measure, so the page keeps a single left and right edge
   the whole way down.

   Surfaces are the /vision brand tones (cream paper, forest, brown,
   sage). Deliberately no pure white: white panels floating on a mid-tone
   field are what made the previous pass feel clashy.

   Type has three roles:
     - Gotham (brand)           display figures and headings
     - Source Serif Pro italic  editorial month markers
     - monospace                drafting annotations: labels, dates, dims
   The mono role comes from the campaign's own artwork, which is graph
   paper with hand-lettered annotations.
   ------------------------------------------------------------------ */

.bp-page {
  --bp-paper: #f6e8d5;
  --bp-sand: #ecdcc2;
  --bp-ink: #1f2420;
  --bp-forest: #3c4439;
  --bp-sage: #7e8c84;
  --bp-brown: #574738;

  /* Bands run full-bleed and stay square; everything sitting ON them —
     media, controls, modals — takes the 2026 system radius. */
  --bp-radius: 16px;

  /* Progress media sits on a fixed tile, so one photo is the same size as one
     of three. Items wrap into a grid as more are added. */
  --bp-tile: 280px;

  --bp-measure: 1120px;
  --bp-gutter: 24px;
  --bp-band-y: 88px;

  --bp-rule: rgba(87, 71, 56, 0.25);
  /* Secondary text. Flips on the accent band — brown on dark green is
     effectively invisible. */
  --bp-muted: #574738;

  /* Accent band tone — set from the ACF picker via .bp-accent-* below. */
  --bp-accent: #3c4439;
  --bp-on-accent: #f6e8d5;

  background-color: var(--bp-paper);
  color: var(--bp-ink);
}

.bp-page.bp-accent-forest { --bp-accent: #3c4439; --bp-on-accent: #f6e8d5; }
.bp-page.bp-accent-brown  { --bp-accent: #574738; --bp-on-accent: #f6e8d5; }
.bp-page.bp-accent-sage   { --bp-accent: #7e8c84; --bp-on-accent: #1f2420; }

/* --- Bands ---------------------------------------------------------- */
/* No margins anywhere — bands touch. All spacing lives inside. */

.bp-band {
  padding: var(--bp-band-y) var(--bp-gutter);
  margin: 0;
}

.bp-band--paper {
  background-color: var(--bp-paper);
  color: var(--bp-ink);
}

.bp-band--sand {
  background-color: var(--bp-sand);
  color: var(--bp-ink);
}

/* Two same-tone bands in a row read as one section, so the seam between them
   shouldn't pay for two lots of padding. */
.bp-band--paper + .bp-band--paper,
.bp-band--sand + .bp-band--sand {
  padding-top: 0;
}

.bp-band--accent + .bp-band--accent {
  padding-top: calc(var(--bp-band-y) / 2);
}

.bp-band--accent {
  background-color: var(--bp-accent);
  color: var(--bp-on-accent);
  --bp-muted: rgba(246, 232, 213, 0.75);
  --bp-rule: rgba(246, 232, 213, 0.28);
}

/* Light Green accent keeps dark secondary text. */
.bp-page.bp-accent-sage .bp-band--accent {
  --bp-muted: rgba(31, 36, 32, 0.75);
  --bp-rule: rgba(31, 36, 32, 0.28);
}

.bp-measure {
  max-width: var(--bp-measure);
  margin-inline: auto;
}

/* Graph paper, echoing the campaign's own artwork. Carried by the light
   bands; the accent band is a flat field by contrast. */
.bp-grid {
  background-image:
    linear-gradient(to right, rgba(87, 71, 56, 0.09) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(87, 71, 56, 0.09) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* --- Shared type ---------------------------------------------------- */

.bp-page h2,
.bp-page h3 {
  text-transform: none;
}

/* Drafting annotation: every label, date and caption on the page. */
.bp-note {
  font-family: 'Gotham', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0;
}

.bp-heading {
  font-family: 'Gotham', sans-serif;
  font-size: clamp(1.75rem, 3.6vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0;
}

/* --- Hero ----------------------------------------------------------- */
/* Hero treatment comes from region.css / vision.css so the page still
   reads as part of /vision. Squared off so the band below meets it
   with no seam. */

.bp-hero .page-hero-image {
  border-radius: 0;
  margin-bottom: 0;
}

/* --- Fundraising ----------------------------------------------------- */
/* Deliberately the plainest thing on the page: a centred headline carrying the
   amount still to raise, one thick bar, and the raised / goal figures under it.
   This mirrors the bar the campaign has been using, restated in the page's
   palette and sitting flat on the grid rather than in a floating card. */

.bp-goal__panel {
  max-width: 720px;
  margin-inline: auto;
  text-align: center;
}

.bp-goal__label {
  font-family: 'Gotham', sans-serif;
  font-size: clamp(1.25rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--bp-ink);
  margin: 0 0 20px;
}

.bp-goal__bar {
  position: relative;
  height: 28px;
  background-color: #dccebc;
  border-radius: 999px;
  overflow: hidden;
}

.bp-goal__fill {
  height: 100%;
  background-color: var(--bp-forest);
  border-radius: 999px;
  transition: width 0.6s ease-in-out;
}

.bp-goal__figures {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  font-family: 'Gotham', sans-serif;
  font-size: clamp(0.875rem, 1.6vw, 1rem);
  font-weight: 600;
  color: var(--bp-ink);
}

.bp-goal__note {
  font-family: 'Gotham', sans-serif;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--bp-muted);
  margin: 24px 0 0;
}

.bp-action {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  padding: 15px 28px;
  background-color: var(--bp-forest);
  color: var(--bp-paper);
  font-family: 'Gotham', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 999px;
  transition: background-color 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.bp-action:hover,
.bp-action:focus-visible {
  background-color: var(--bp-brown);
  color: var(--bp-paper);
  text-decoration: none;
  transform: translateY(-2px);
}

/* --- Update: one spread, no panels ---------------------------------- */
/* Image and copy sit directly on the band. Previously each was in its
   own white card, so the space between them read as a gap with the
   background showing through instead of as a column gutter. */

.bp-update__spread {
  display: grid;
  grid-template-columns: minmax(0, 42fr) minmax(0, 58fr);
  gap: 56px;
  align-items: start;
}

.bp-update__spread--right .bp-update__photo {
  order: 2;
}

.bp-update__photo img {
  display: block;
  width: 100%;
  height: auto;
  /* Never cropped — usually poster graphics with type baked in. */
  object-fit: contain;
  border-radius: var(--bp-radius);
}

.bp-update__date {
  color: var(--bp-muted);
  margin-bottom: 12px;
}

.bp-update__title {
  font-family: 'Gotham', sans-serif;
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 0.98;
  margin: 0 0 24px;
}

.bp-update__body {
  max-width: 60ch;
}

.bp-update__body p:last-child {
  margin-bottom: 0;
}

.bp-update__body ul,
.bp-update__body ol {
  padding-left: 1.25rem;
}

/* --- Why / What / How ----------------------------------------------- */
/* On the accent band, so the cream graph-paper artwork carries itself. */

.bp-choices__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: start;
  gap: 20px;
  margin-top: 28px;
}

.bp-choice {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  overflow: hidden;
  border-radius: var(--bp-radius);
  text-align: left;
}

/* Natural height, no forced ratio: these are finished artworks and a fixed
   ratio was slicing the top and bottom off them. */
.bp-choice img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.4s ease;
}

.bp-choice:hover img,
.bp-choice:focus-visible img {
  transform: scale(1.03);
}

.bp-choice__veil {
  position: absolute;
  inset: 0;
  border-radius: var(--bp-radius);
  display: flex;
  align-items: flex-end;
  padding: 24px;
  background: linear-gradient(to top, rgba(31, 36, 32, 0.85) 0%, rgba(31, 36, 32, 0) 55%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bp-choice:hover .bp-choice__veil,
.bp-choice:focus-visible .bp-choice__veil {
  opacity: 1;
}

.bp-choice__more {
  font-family: 'Gotham', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bp-paper);
}

/* Touch has no hover — keep the affordance permanently legible. */
@media (hover: none) {
  .bp-choice__veil { opacity: 1; }
}

.bp-modal .modal-content {
  border-radius: var(--bp-radius);
  overflow: hidden;
  border: 0;
}

/* Bootstrap gives .modal-header a smaller inner radius than
   .modal-content, leaving light arcs in the header's top corners. */
.bp-modal .modal-header {
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
  background-color: var(--bp-forest);
}

.bp-modal .modal-title {
  font-family: 'Gotham', sans-serif;
  font-size: 0.8125rem !important;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #f6e8d5;
}

/* --- Progress: a continuous log ------------------------------------- */
/* A ruled timeline rather than a stack of cards: one hairline runs the
   length of the log and each entry hangs off it. */

.bp-log {
  margin-top: 32px;
}

/* Vertical timeline: one line runs down the rail, a dot marks each entry. */
.bp-entry {
  position: relative;
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 40px;
  padding: 40px 0;
}

/* The connector. Centred on the dot (left 5px + 2px wide = centre 6px). */
.bp-entry::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--bp-rule);
}

/* Start at the first titled dot and stop at the last, rather than
   overrunning the ends of the list. The template assigns these classes;
   entries outside that span, or logs with fewer than two titles, get no
   connector. */
.bp-entry--rail-start::before { top: 52px; }

.bp-entry--rail-end::before {
  bottom: auto;
  height: 52px;
}

.bp-entry--no-rail::before { display: none; }

.bp-entry__marker {
  position: relative;
  padding-left: 32px;
}

.bp-entry__month {
  font-family: 'Source Serif Pro', serif;
  font-style: italic;
  font-size: 1.5rem;
  line-height: 1.1;
  color: var(--bp-muted);
  margin: 0;
}

/* Station tick, matching the dimension line's vocabulary. */
.bp-entry__marker::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--bp-ink);
}

/* No title, no station. */
.bp-entry--untitled .bp-entry__marker::before { display: none; }

/* No titles anywhere in the log: drop the title column and center the
   content block (sized to a full row of tiles) in the measure. Copy stays
   left-aligned within it. */
.bp-log--untitled .bp-entry {
  grid-template-columns: minmax(0, calc(var(--bp-tile) * 3 + 32px));
  justify-content: center;
}

.bp-log--untitled .bp-entry__marker { display: none; }

.bp-entry__media + .bp-entry__media {
  margin-top: 16px;
}

.bp-entry__video {
  overflow: hidden;
  border-radius: var(--bp-radius);
  max-width: calc(var(--bp-tile) * 2 + 16px);
}

.bp-entry__images {
  display: grid;
  grid-template-columns: repeat(auto-fill, var(--bp-tile));
  align-items: start;
  gap: 16px;
}

/* Square tiles. Progress shots are photographs, which crop acceptably; the
   grid stays even whatever mix of portrait and landscape gets uploaded.
   Poster-style graphics with type baked in do NOT belong here — put those in
   the update section, which contains rather than crops. */
.bp-entry__images img {
  display: block;
  width: 100%;
  /* height:auto is required — wp_get_attachment_image emits width/height
     attributes, and with both dimensions definite aspect-ratio is ignored. */
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--bp-radius);
}

.bp-entry__body {
  margin-top: 20px;
  max-width: 62ch;
}

.bp-entry__body p:last-child {
  margin-bottom: 0;
}

/* --- Footer Instagram ------------------------------------------------ */
/* Suppressed here the same way it is across /vision. page-vision.php does
   this with jQuery on document.ready, which paints the feed and then hides
   it; doing it in CSS means it never renders. footer.php always outputs
   this block when the Instagram feed ID option is set, and the page-builder
   layout uses different classes, so this only ever matches the footer's. */
.page-template-page-building-project .instagram-feed {
  display: none;
}

/* --- Quality floor --------------------------------------------------- */

.bp-page a:focus-visible,
.bp-page button:focus-visible {
  outline: 3px solid var(--bp-brown);
  outline-offset: 3px;
}

.bp-band--accent a:focus-visible,
.bp-band--accent button:focus-visible {
  outline-color: var(--bp-paper);
}

@media (prefers-reduced-motion: reduce) {
  .bp-page *,
  .bp-page *::before,
  .bp-page *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* --- Tablet ---------------------------------------------------------- */

@media (max-width: 1024px) {
  .bp-page { --bp-band-y: 64px; }

  .bp-update__spread { gap: 36px; }

  .bp-entry {
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 28px;
  }
}

/* --- Mobile ---------------------------------------------------------- */

@media (max-width: 768px) {
  .bp-page {
    --bp-band-y: 48px;
    --bp-gutter: 20px;
  }

  .bp-goal__bar { height: 22px; }

  /* Stack the figures rather than letting them collide at narrow widths. */
  .bp-goal__figures {
    flex-direction: column;
    gap: 4px;
  }

  /* Stack; photo always leads regardless of the side setting. */
  .bp-update__spread {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .bp-update__spread--right .bp-update__photo { order: 0; }

  .bp-choices__grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }



  .bp-page { --bp-radius: 12px; }

  /* Month becomes a header above the media instead of a side rail. */
  .bp-entry {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 28px 0 28px 28px;
  }

  .bp-entry--rail-start::before { top: 40px; }
  .bp-entry--rail-end::before { height: 40px; }

  /* Dot sits in the entry's left indent, not the marker's. */
  .bp-entry__marker { padding-left: 0; }

  .bp-entry__marker::before {
    left: -28px;
    top: 4px;
  }

  /* No dots to indent for. */
  .bp-log--untitled .bp-entry { padding-left: 0; }

  /* Same system, scaled down — media stays small on phones too. */
  .bp-page { --bp-tile: 150px; }
}
