/* =========================================================
   CALBRA SOURCING — guide page components
   Long-form article furniture built on the same tokens as the
   rest of the site: rounded panels, oxblood ink, clay accent.
   ========================================================= */

:root {
  /* warm neutral for "not included" marks — a red would break the
     three-colour palette and overstate what a cross means here */
  --neutral-mark: #a4968a;
}

/* ---------- guide hero ----------
   Full-bleed photograph with the copy on top. The photo is lifted
   rather than darkened: a warm paper veil sits over it so the
   image reads as soft background texture and the type stays dark.
   Lives outside .wrap; only .guide-hero__inner is constrained. */
.guide-hero {
  position: relative;
  min-height: clamp(540px, 84vh, 840px);
  display: flex; align-items: center;
  padding-block: clamp(3rem, 8vw, 5.5rem);
  text-align: center;
  overflow: hidden;
  background: var(--paper);
}

.guide-hero__bg { position: absolute; inset: 0; z-index: 0; }
.guide-hero__bg img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 58%;
  filter: brightness(1.08) saturate(.92);
}
.guide-hero__bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(246,242,236,.78) 0%, rgba(246,242,236,.66) 45%, rgba(246,242,236,.9) 100%),
    linear-gradient(120deg, rgba(201,162,95,.1), rgba(139,94,60,.08));
}

.guide-hero__inner { position: relative; z-index: 2; width: 100%; }
.guide-hero h1 { max-width: 17ch; margin-inline: auto; color: var(--ink); }
.guide-hero .lead {
  margin: 1.4rem auto 0; max-width: 62ch;
  font-size: 1.1rem; color: var(--muted);
}

.guide-meta {
  display: flex; flex-wrap: wrap; gap: .5rem;
  justify-content: center;
  margin-top: 1.8rem;
}
.guide-meta span {
  display: inline-flex; align-items: center; gap: .45rem;
  background: rgba(255,253,250,.72);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: .45rem .95rem; font-size: .84rem;
  color: var(--muted);
  backdrop-filter: blur(4px);
}
.guide-meta svg { color: var(--clay); flex: 0 0 auto; }

/* the three headline facts, centred under the copy */
.hero-facts {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: clamp(1.4rem, 5vw, 4rem);
  margin-top: clamp(2.2rem, 5vw, 3.4rem);
  padding-top: clamp(1.6rem, 3vw, 2.4rem);
  border-top: 1px solid var(--line);
  max-width: 780px; margin-inline: auto;
}
.hero-facts__item { color: var(--ink); }
.hero-facts__item b {
  display: block; font-size: clamp(1.35rem, 2.8vw, 2.1rem);
  font-weight: 600; letter-spacing: -.02em; line-height: 1.1;
}
.hero-facts__item span { font-size: .85rem; color: var(--muted); }

@media (max-width: 700px) {
  .guide-hero { min-height: clamp(500px, 76vh, 700px); }
  .hero-facts { gap: 1.3rem 2rem; }
  .hero-facts__item { min-width: 132px; }
}

/* ---------- contents ---------- */
.toc {
  background: var(--ink); color: var(--paper);
  border-radius: var(--r-xl);
  padding: clamp(1.5rem, 3vw, 2.2rem);
}
.toc h2 { font-size: 1.15rem; margin-bottom: 1.2rem; }
.toc ol {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: .1rem 2rem;
  counter-reset: toc;
}
.toc li { counter-increment: toc; }
.toc a {
  display: flex; gap: .8rem; align-items: baseline;
  padding: .6rem 0; font-size: .95rem;
  color: rgba(246,242,236,.82);
  border-bottom: 1px solid var(--line-dark, rgba(246,242,236,.12));
  transition: color .2s ease, padding-left .2s ease;
}
.toc a::before {
  content: "0" counter(toc);
  font-size: .76rem; color: var(--gold); flex: 0 0 auto;
}
.toc a:hover { color: #fff; padding-left: .3rem; }

@media (max-width: 700px) { .toc ol { grid-template-columns: 1fr; } }

/* ---------- article prose ---------- */
.prose { max-width: 68ch; }
.prose > * + * { margin-top: 1.1rem; }
.prose h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); margin-top: 0; }
.prose h3 { font-size: 1.18rem; margin-top: 2rem; }
.prose p { color: var(--muted); font-size: 1rem; line-height: 1.72; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul { margin: 0; padding-left: 0; list-style: none; display: grid; gap: .7rem; }
.prose ul li {
  position: relative; padding-left: 1.5rem;
  color: var(--muted); font-size: .98rem; line-height: 1.6;
}
.prose ul li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: 7px; height: 7px; border-radius: 50%; background: var(--clay);
}
.prose a { color: var(--clay); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- callout ---------- */
.callout {
  border-left: 3px solid var(--clay);
  background: var(--alt);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 1.2rem 1.4rem;
  margin-top: 1.6rem;
}
.panel .callout { background: var(--paper); }
.callout h3 { font-size: 1rem; margin: 0 0 .4rem; }
.callout p { font-size: .92rem; color: var(--muted); margin: 0; line-height: 1.65; }

/* ---------- two-column split ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1rem, 3vw, 2rem); }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }

/* A partial top rule curves away at the corners on a rounded card,
   so the distinction is carried by fill and heading colour instead. */
.split-card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 0;
  overflow: hidden;
}

/* header strip carries the verdict, so the body stays plain white */
.split-card__head {
  display: flex; align-items: center; gap: .75rem;
  padding: 1.05rem 1.35rem;
  background: var(--alt);
  border-bottom: 1px solid var(--line);
}
.split-card__head h3 { font-size: 1.02rem; margin: 0; }
.split-card--yes .split-card__head {
  background: var(--clay-tint);
  border-bottom-color: #e2cdb8;
}
.split-card--yes .split-card__head h3 { color: var(--clay-deep); }

.split-card__badge {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; flex: 0 0 auto;
  color: #fff;
}
.split-card--yes .split-card__badge { background: var(--clay); }
.split-card--no  .split-card__badge { background: var(--neutral-mark); }

.split-card__body { padding: 1.25rem 1.35rem 1.4rem; }
.split-card__body ul { display: grid; gap: .75rem; }

/* ticks for what you gain, crosses for what you don't */
.split-card__body ul li { padding-left: 2rem; }
.split-card__body ul li::before {
  content: "";
  position: absolute; left: 0; top: .12em;
  width: 20px; height: 20px; border-radius: 50%;
  background-repeat: no-repeat; background-position: center;
  background-size: 12px 12px;
}
.split-card--yes .split-card__body ul li::before {
  background-color: var(--clay);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.4 9.6 17 19 7.6'/%3E%3C/svg%3E");
}
.split-card--no .split-card__body ul li::before {
  background-color: var(--neutral-mark);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 7 17 17M17 7 7 17'/%3E%3C/svg%3E");
}

/* optional footer note under a column */
.split-card__note {
  margin-top: auto;
  padding: .9rem 1.35rem 1.1rem;
  border-top: 1px solid var(--line);
  font-size: .82rem; color: var(--muted); line-height: 1.5;
}

/* ---------- checklist ---------- */
.checklist { display: grid; gap: .8rem; counter-reset: chk; }
.check {
  display: grid; grid-template-columns: 34px 1fr; gap: 1rem;
  background: var(--paper); border-radius: var(--r-lg);
  padding: 1.1rem 1.2rem;
  counter-increment: chk;
}
.check::before {
  content: counter(chk);
  width: 34px; height: 34px; border-radius: var(--r-sm);
  background: var(--ink); color: var(--gold);
  display: grid; place-items: center;
  font-size: .84rem; font-weight: 600;
}
.check h3 { font-size: 1rem; margin-bottom: .25rem; }
.check p { font-size: .91rem; color: var(--muted); margin: 0; line-height: 1.6; }

/* ---------- comparison table ---------- */
.compare-wrap { overflow: hidden; border-radius: var(--r-lg); }
.compare {
  width: 100%; border-collapse: collapse;
  font-size: .93rem; background: var(--paper);
}
.compare th, .compare td {
  padding: .95rem 1rem; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.compare thead th {
  background: var(--ink); color: var(--paper);
  font-weight: 600; font-size: .88rem; letter-spacing: -.01em;
  border-bottom: 0;
}
.compare thead th:first-child { background: var(--ink-soft); }
.compare tbody th {
  font-weight: 600; color: var(--ink); width: 26%;
  background: var(--alt);
}
.compare td { color: var(--muted); }
.compare .is-key { color: var(--ink); font-weight: 500; }
.compare tbody tr:last-child th,
.compare tbody tr:last-child td { border-bottom: 0; }

/* stacked layout on narrow screens */
@media (max-width: 720px) {
  .compare thead { display: none; }
  .compare, .compare tbody, .compare tr, .compare th, .compare td { display: block; width: 100%; }
  .compare tbody tr {
    background: var(--paper); border-radius: var(--r-lg);
    margin-bottom: .8rem; overflow: hidden;
    border: 1px solid var(--line);
  }
  .compare tbody th { background: var(--alt); width: 100%; }
  .compare td { border-bottom: 1px solid var(--line); }
  .compare td::before {
    content: attr(data-label);
    display: block; font-size: .74rem; letter-spacing: .06em;
    text-transform: uppercase; color: var(--clay);
    margin-bottom: .25rem; font-weight: 600;
  }
  .compare tbody tr:last-child { margin-bottom: 0; }
}

/* ---------- full-bleed photo band ---------- */
.photo-band {
  position: relative; width: 100%;
  height: clamp(280px, 44vh, 480px);
  overflow: hidden; background: var(--alt);
}
.photo-band img { width: 100%; height: 100%; object-fit: cover; object-position: center 55%; }
.photo-band::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, rgba(139,94,60,.16), rgba(37,5,5,.08));
}
/* the clip reveal rounds to --r-xl by default, which left a full-bleed
   band with curved corners running off the screen edge */
.photo-band[data-reveal="clip"] { clip-path: inset(10% 0 10% 0); }
.photo-band[data-reveal="clip"].is-in { clip-path: inset(0 0 0 0); }

/* ---------- terminology cards ----------
   Three side-by-side cards rather than stacked text blocks. The
   first is filled because it is the arrangement being sold; the
   third is dashed to read as a caution without adding a new colour. */
.terms-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(.9rem, 2vw, 1.4rem);
}

.term-card {
  display: flex; flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1.6rem 1.5rem 1.4rem;
}
.term-card__ico {
  width: 44px; height: 44px; border-radius: var(--r-md);
  background: var(--alt); color: var(--ink);
  display: grid; place-items: center; margin-bottom: 1.1rem;
}
.term-card h3 { font-size: 1.15rem; margin-bottom: .5rem; }
.term-card__def {
  font-size: 1rem; font-weight: 500; color: var(--ink);
  line-height: 1.45; margin-bottom: .7rem;
}
.term-card__body {
  font-size: .9rem; color: var(--muted); line-height: 1.62;
  margin: 0 0 1.3rem;
}
.term-card__tag {
  margin-top: auto;
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .78rem; font-weight: 500; line-height: 1.35;
  padding-top: 1rem; border-top: 1px solid var(--line);
  color: var(--clay-deep);
}
.term-card__tag svg { flex: 0 0 auto; }

/* the arrangement this page is actually about */
.term-card--key {
  background: var(--ink); border-color: var(--ink); color: var(--paper);
}
.term-card--key h3 { color: var(--paper); }
.term-card--key .term-card__ico { background: rgba(246,242,236,.12); color: var(--gold); }
.term-card--key .term-card__def { color: var(--paper); }
.term-card--key .term-card__body { color: rgba(246,242,236,.72); }
.term-card--key .term-card__tag { color: var(--gold); border-top-color: rgba(246,242,236,.18); }

/* the one to be careful with */

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

/* =========================================================
   RHYTHM COMPONENTS
   The first version was eight identical white panels in a row.
   These exist to break that up: dark bands, photography,
   split layouts and pull quotes alternating down the page.
   ========================================================= */

/* ---------- dark section ---------- */
.section--dark {
  background: radial-gradient(100% 80% at 50% 0%, #43201a 0%, var(--ink) 45%, #170303 100%);
  color: var(--paper);
}
.section--dark h2, .section--dark h3 { color: var(--paper); }
.section--dark p { color: var(--muted-dark); }
.section--dark .prose p { color: var(--muted-dark); }
.section--dark .prose strong { color: var(--paper); }
.section--dark .prose ul li { color: var(--muted-dark); }
.section--dark .prose ul li::before { background: var(--gold); }

/* ---------- key facts ("the short version") ---------- */
.short-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(.8rem, 2vw, 1.4rem); }
.short-card {
  background: rgba(246,242,236,.06);
  border: 1px solid rgba(246,242,236,.14);
  border-radius: var(--r-lg);
  padding: 1.4rem 1.3rem;
}
.short-card__ico { color: var(--gold); margin-bottom: .9rem; }
.short-card h3 { font-size: 1rem; margin-bottom: .4rem; color: var(--paper); }
.short-card p { font-size: .88rem; line-height: 1.6; color: rgba(246,242,236,.7); }

@media (max-width: 900px) { .short-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .short-grid { grid-template-columns: 1fr; } }

/* ---------- text + photo split ---------- */
.media-split {
  display: grid; grid-template-columns: 1.05fr .95fr;
  gap: clamp(1.6rem, 4vw, 3.5rem); align-items: center;
}
.media-split--flip .media-split__figure { order: -1; }
.media-split__figure {
  position: relative; border-radius: var(--r-xl); overflow: hidden;
  aspect-ratio: 4 / 5; background: var(--alt); box-shadow: var(--shadow-md);
}
.media-split__figure img { width: 100%; height: 100%; object-fit: cover; }
.media-split__figure::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(140deg, rgba(139,94,60,.14), rgba(37,5,5,.06));
}

@media (max-width: 860px) {
  .media-split { grid-template-columns: 1fr; }
  .media-split--flip .media-split__figure { order: 0; }
  .media-split__figure { aspect-ratio: 16 / 10; }
}

/* ---------- contrast pair (this vs that) ---------- */
.versus { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1.2rem; align-items: stretch; }
.versus__card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1.5rem 1.4rem;
}
.versus__card h3 { display: flex; align-items: center; gap: .55rem; }
.versus__card h3::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%;
  background: var(--clay); flex: 0 0 auto;
}
.versus__card--strong { border-color: var(--ink); }
.versus__card--strong h3::before { background: var(--gold); }
.versus__card--strong { background: var(--ink); color: var(--paper); }
.versus__card h3 { font-size: 1.05rem; margin-bottom: .7rem; }
.versus__card--strong h3 { color: var(--paper); }
.versus__card p { font-size: .92rem; color: var(--muted); line-height: 1.62; margin: 0; }
.versus__card--strong p { color: rgba(246,242,236,.78); }
.versus__mid {
  display: grid; place-items: center;
  font-size: .78rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--clay); font-weight: 600;
}
@media (max-width: 760px) {
  .versus { grid-template-columns: 1fr; }
  .versus__mid { padding: .2rem 0; }
}

/* ---------- illustrative money split ---------- */
.money { margin-top: 1.8rem; }
.money__bar {
  display: flex; height: 62px; border-radius: var(--r-md);
  overflow: hidden; border: 1px solid rgba(246,242,236,.16);
}
.money__seg {
  display: grid; place-items: center; text-align: center;
  font-size: .84rem; font-weight: 500; padding: 0 .6rem;
}
.money__seg--you { flex: 4; background: var(--gold); color: var(--ink); }
.money__seg--margin { flex: 1; background: rgba(246,242,236,.12); color: var(--paper); }
.money__note { font-size: .78rem; color: rgba(246,242,236,.55); margin-top: .7rem; }

.money__cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.6rem; }
.money__card {
  background: rgba(246,242,236,.06); border: 1px solid rgba(246,242,236,.14);
  border-radius: var(--r-lg); padding: 1.2rem 1.2rem;
}
.money__card h3 { font-size: .98rem; margin-bottom: .35rem; color: var(--paper); }
.money__card p { font-size: .86rem; color: rgba(246,242,236,.7); line-height: 1.55; margin: 0; }
@media (max-width: 760px) { .money__cards { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .money__seg { font-size: .74rem; } }

/* ---------- pull quote ---------- */
.quote {
  background: var(--clay); color: #fff;
  border-radius: var(--r-xl);
  padding: clamp(2rem, 5vw, 3.4rem);
  text-align: center;
}
.quote p {
  font-size: clamp(1.3rem, 2.8vw, 1.95rem);
  font-weight: 500; letter-spacing: -.02em; line-height: 1.32;
  max-width: 26ch; margin: 0 auto; color: #fff;
}
.quote span {
  display: block; margin-top: 1.2rem;
  font-size: .84rem; color: rgba(255,255,255,.72);
}

/* ---------- checklist: two columns on wide screens ---------- */
@media (min-width: 900px) {
  .checklist { grid-template-columns: 1fr 1fr; gap: 1rem; }
}
.check { background: var(--surface); }
/* inside a white panel the cards need a step down, or they vanish */
.panel .check { background: var(--paper); }
.section--dark .check {
  background: rgba(246,242,236,.06);
  border: 1px solid rgba(246,242,236,.14);
}
.section--dark .check h3 { color: var(--paper); }
.section--dark .check p { color: rgba(246,242,236,.7); }
.section--dark .check::before { background: var(--gold); color: var(--ink); }

/* ---------- jump nav (inside the dark summary band) ---------- */
.jump {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  margin-top: clamp(1.8rem, 3vw, 2.6rem);
  padding-top: clamp(1.4rem, 3vw, 2rem);
  border-top: 1px solid rgba(246,242,236,.14);
}
.jump__label {
  font-size: .74rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold); margin-right: .5rem;
}
.jump a {
  font-size: .86rem; color: rgba(246,242,236,.78);
  border: 1px solid rgba(246,242,236,.2);
  border-radius: var(--r-pill); padding: .45rem .95rem;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.jump a:hover { background: var(--gold); border-color: var(--gold); color: var(--ink); }
@media (max-width: 520px) {
  .jump__label { width: 100%; margin-bottom: .2rem; }
  .jump a { font-size: .82rem; padding: .4rem .8rem; }
}

/* ---------- buttons inside prose ----------
   .prose a sets a clay underline for body links; without this a
   button dropped into prose renders as brown underlined text on a
   dark fill, which is what made "Read the guide" unreadable. */
.prose a.btn { text-decoration: none; }
.prose a.btn--dark  { color: var(--paper); }
.prose a.btn--clay  { color: #fff; }
.prose a.btn--gold  { color: var(--ink); }
.prose a.btn--light { color: var(--ink); }
.prose a.btn--outline { color: var(--ink); }
.prose a.btn--outline:hover { color: var(--ink); }
.section--dark .prose a.btn--outline { color: var(--paper); border-color: rgba(246,242,236,.4); }

.btn-row { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.4rem; }

/* ---------- terminology card tags ----------
   The tag is pushed to the bottom, so a one-line tag and a two-line
   tag put their divider at different heights. Reserving two lines
   keeps the rules level across the row. */
.term-card__tag { min-height: 3.1em; align-items: flex-start; }
.term-card__tag svg { margin-top: .18em; }


/* =========================================================
   CROSS-CARD ROW ALIGNMENT
   A divider pushed down with margin-top:auto lands wherever the
   text above it ends, so rules sat at different heights across a
   row. Subgrid makes every card share the same row track, which
   lines the dividers up regardless of how the copy wraps.
   ========================================================= */
@supports (grid-template-rows: subgrid) {
  .terms-grid { grid-template-rows: auto auto auto 1fr auto; }
  .terms-grid .term-card {
    grid-row: span 5;
    grid-template-rows: subgrid;
    display: grid;
  }
  .term-card__tag { min-height: 0; }

  .split { grid-template-rows: auto 1fr auto; }
  .split .split-card {
    grid-row: span 3;
    grid-template-rows: subgrid;
    display: grid;
  }
}

/* fallback for engines without subgrid: reserve two lines */
@supports not (grid-template-rows: subgrid) {
  .term-card__tag { min-height: 4em; }
}

/* =========================================================
   TERMINOLOGY CARDS — one consistent accent
   Previously one card was ink-filled and two were light, which
   read as an unfinished row. All three now share the same
   treatment; the distinction is carried by the tag, and the
   caution card keeps a dashed edge rather than its own colour.
   ========================================================= */
.term-card,
.term-card--key,
.term-card--caution {
  background: var(--ink);
  border: 1px solid var(--ink);
  color: var(--paper);
}
.term-card h3 { color: var(--paper); }
.term-card__ico { background: rgba(246,242,236,.12); color: var(--gold); }
.term-card__def { color: var(--paper); }
.term-card__body { color: rgba(246,242,236,.72); }
.term-card__tag { color: var(--gold); border-top-color: rgba(246,242,236,.18); }

.term-card--caution { border-style: solid; border-color: var(--ink); }

/* =========================================================
   CTA BAND
   These started life as decorative pull quotes. A full-width
   clay band that asks for nothing is wasted space, so the
   statement now carries a button.
   ========================================================= */
.quote .btn { margin-top: 1.7rem; }
.quote .btn--light { background: var(--surface); color: var(--ink); }
.quote .btn--light:hover { background: #fff; }
.quote span { margin-top: 1rem; }

/* ---------- legal documents ----------
   Full container width, matching the other sections. */
.doc { max-width: none; }
.doc a.btn { text-decoration: none; }
.doc .btn-row a { text-decoration: none; }

/* ---------- "before you decide" feature row ---------- */
.mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(.8rem, 2vw, 1.2rem); margin: 1.8rem 0; }
.mini {
  background: var(--alt); border-radius: var(--r-lg);
  padding: 1.2rem 1.2rem;
}
.mini__ico { color: var(--clay); margin-bottom: .8rem; }
.mini h3 { font-size: .98rem; margin-bottom: .3rem; }
.mini p { font-size: .86rem; color: var(--muted); line-height: 1.55; margin: 0; }
@media (max-width: 780px) { .mini-grid { grid-template-columns: 1fr; } }

/* =========================================================
   MOBILE REFINEMENTS
   Photography was rendering small and boxed-in on narrow
   screens, and body copy sat a shade too light over the hero
   photograph to read comfortably.
   ========================================================= */
@media (max-width: 860px) {
  /* photographs take the full width of the container and gain height */
  .media-split { gap: 1.6rem; }
  .media-split__figure {
    aspect-ratio: 4 / 3;
    width: 100%;
  }
  .media-split__figure img { object-position: center 50%; }
}

@media (max-width: 620px) {
  .media-split__figure { aspect-ratio: 3 / 2.4; }
  .photo-band { height: clamp(240px, 34vh, 320px); }
  .photo-band img { object-position: center 60%; }
}

/* ---- readability on small screens ---- */
@media (max-width: 780px) {
  .prose p { font-size: 1.02rem; line-height: 1.78; }
  .prose ul li { font-size: 1rem; line-height: 1.68; }
  .prose h3 { font-size: 1.14rem; }
  .lead { font-size: 1.05rem; line-height: 1.68; }

  .split-card__body ul li { font-size: .99rem; }
  .check p { font-size: .96rem; line-height: 1.66; }
  .term-card__body { font-size: .95rem; line-height: 1.65; }
  .short-card p { font-size: .93rem; line-height: 1.65; }
  .mini p { font-size: .92rem; }
  .callout p { font-size: .96rem; line-height: 1.7; }
  .doc p, .doc li { font-size: 1rem; line-height: 1.78; }
}

/* The guide hero prints dark type over a photograph. On a phone the
   image fills more of the frame, so the veil is thickened and the
   copy darkened rather than left at muted grey. */
@media (max-width: 780px) {
  .guide-hero__bg::after {
    background:
      linear-gradient(180deg, rgba(246,242,236,.88) 0%, rgba(246,242,236,.82) 45%, rgba(246,242,236,.94) 100%),
      linear-gradient(120deg, rgba(201,162,95,.08), rgba(139,94,60,.06));
  }
  .guide-hero .lead { color: #574d45; font-size: 1.06rem; line-height: 1.65; }
  .guide-meta span { background: rgba(255,253,250,.9); color: #574d45; }
  .hero-facts__item span { font-size: .88rem; color: #574d45; }
  .hero-facts { gap: 1.6rem 2rem; }
}

/* =========================================================
   MOBILE BREATHING ROOM — components
   Matching the spacing floor raised in base.css.
   ========================================================= */
@media (max-width: 780px) {
  /* body rhythm */
  .prose > * + * { margin-top: 1.35rem; }
  .prose h3 { margin-top: 2.4rem; }
  .prose ul { gap: .95rem; }

  /* card grids */
  .split { gap: 1.4rem; }
  .terms-grid { gap: 1.3rem; }
  .short-grid { gap: 1.2rem; }
  .checklist { gap: 1.1rem; }
  .mini-grid { gap: 1.1rem; margin: 2.2rem 0; }

  /* card interiors */
  .split-card__head { padding: 1.15rem 1.3rem; }
  .split-card__body { padding: 1.4rem 1.3rem 1.5rem; }
  .split-card__body ul { gap: .95rem; }
  .split-card__note { padding: 1rem 1.3rem 1.2rem; }
  .check { padding: 1.3rem 1.3rem; }
  .term-card { padding: 1.6rem 1.4rem 1.4rem; }
  .short-card { padding: 1.5rem 1.4rem; }
  .callout { padding: 1.4rem 1.4rem; margin-top: 2.2rem; }

  /* the money block was the tightest thing on the page */
  .money { margin-top: 2.4rem; }
  .money__bar { height: 76px; }
  .money__seg { font-size: .82rem; line-height: 1.3; }
  .money__note { margin-top: 1.1rem; line-height: 1.6; }
  .money__cards { gap: 1.1rem; margin-top: 2rem; }
  .money__card { padding: 1.4rem 1.3rem; }

  /* long-form pages */
  .guide-meta { margin-top: 2.2rem; gap: .6rem; }
  .hero-facts { margin-top: 2.8rem; padding-top: 2rem; }
  .faq-panel { padding: 2rem 1.3rem; }
  .faq-list { gap: 1rem; }
  .quote { padding: 2.4rem 1.5rem; }
  .doc h2 { margin: 2.8rem 0 .7rem; }
}

@media (max-width: 520px) {
  .money__bar { height: 88px; }
  .money__seg { font-size: .76rem; padding: 0 .5rem; }
}

/* =========================================================
   PROPERTY GALLERY
   ========================================================= */
.gallery-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(.9rem, 2vw, 1.3rem); margin-top: 2rem;
}
/* An author-level `display` beats the browser's own [hidden] rule, so the
   attribute did nothing and every card rendered. This puts it back. */
.gallery-card[hidden] { display: none; }

.gallery-card {
  display: flex; flex-direction: column; text-align: left;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden; padding: 0;
  font-family: inherit; cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease, border-color .2s ease;
}
.gallery-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--clay); }
.gallery-card:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }

.gallery-card__media {
  display: block; position: relative;
  aspect-ratio: 4 / 3; background: var(--alt);
  overflow: hidden;
}
.gallery-card__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s cubic-bezier(.16,1,.3,1);
}
.gallery-card:hover .gallery-card__media img { transform: scale(1.04); }

.gallery-card__pending {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: .84rem; color: var(--muted);
  background: repeating-linear-gradient(45deg, var(--alt), var(--alt) 10px, #e9e0d3 10px, #e9e0d3 20px);
}
.gallery-card.is-pending { cursor: default; }
.gallery-card.is-pending:hover { transform: none; box-shadow: none; border-color: var(--line); }

.gallery-card__body { padding: 1rem 1.1rem 1.15rem; display: grid; gap: .2rem; }
.gallery-card__name { font-size: .97rem; font-weight: 500; color: var(--ink); line-height: 1.35; }
.gallery-card__count { font-size: .8rem; color: var(--muted); }

@media (max-width: 900px) { .gallery-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .gallery-grid { grid-template-columns: 1fr; } }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 130;
  background: rgba(20,3,3,.94);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  gap: clamp(.5rem, 2vw, 1.5rem);
  padding: clamp(3.5rem, 8vw, 5rem) clamp(.6rem, 3vw, 2.5rem);
  opacity: 0; visibility: hidden;
  transition: opacity .28s ease, visibility .28s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }

.lightbox__stage {
  display: flex; flex-direction: column; align-items: center; gap: .9rem;
  min-width: 0; max-height: 100%;
}
.lightbox__stage img {
  max-width: 100%; max-height: 76vh;
  border-radius: var(--r-lg); object-fit: contain;
}
.lightbox__stage figcaption { font-size: .85rem; color: rgba(246,242,236,.7); text-align: center; }

.lightbox__nav, .lightbox__close {
  background: rgba(246,242,236,.1);
  border: 1px solid rgba(246,242,236,.22);
  color: var(--paper); border-radius: 50%;
  width: 46px; height: 46px; display: grid; place-items: center;
  cursor: pointer; flex: 0 0 auto;
  transition: background .2s ease, border-color .2s ease;
}
.lightbox__nav:hover, .lightbox__close:hover { background: rgba(246,242,236,.2); border-color: var(--paper); }
.lightbox__nav:focus-visible, .lightbox__close:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.lightbox__close {
  position: absolute; top: clamp(.8rem, 3vw, 1.6rem); right: clamp(.8rem, 3vw, 1.6rem);
  z-index: 2;
}

@media (prefers-reduced-motion: reduce) {
  .lightbox, .gallery-card, .gallery-card__media img { transition: none; }
}

/* ---------- gallery: rotating covers ---------- */
.gallery-card__media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .9s ease, transform .5s cubic-bezier(.16,1,.3,1);
}
.gallery-card__media img.is-on { opacity: 1; }
.gallery-card:hover .gallery-card__media img.is-on { transform: scale(1.04); }

.gallery-more { margin-top: 1.6rem; display: flex; justify-content: center; }
.gallery-more:empty { display: none; }   /* no stray gap once expanded */
@media (max-width: 560px) { .gallery-more .btn { width: 100%; } }

/* ---------- lightbox thumbnail rail ---------- */
.lightbox__rail {
  grid-column: 1 / -1;
  display: flex; gap: .5rem;
  overflow-x: auto; overscroll-behavior-x: contain;
  padding: .2rem .2rem .4rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(246,242,236,.35) transparent;
}
.lightbox__rail::-webkit-scrollbar { height: 6px; }
.lightbox__rail::-webkit-scrollbar-thumb { background: rgba(246,242,236,.3); border-radius: 3px; }
.lightbox__rail button {
  flex: 0 0 auto; padding: 0; cursor: pointer;
  width: 78px; height: 56px; border-radius: var(--r-sm);
  overflow: hidden; background: none;
  border: 2px solid transparent; opacity: .55;
  transition: opacity .2s ease, border-color .2s ease;
}
.lightbox__rail button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lightbox__rail button:hover { opacity: .85; }
.lightbox__rail button.is-current { opacity: 1; border-color: var(--gold); }
.lightbox__rail button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .gallery-card__media img { transition: none; }
}

/* =========================================================
   LIGHTBOX LAYOUT — explicit placement
   The thumbnail rail spans every column, and it sits between the
   figure and the next button in the DOM. With auto-placement that
   pushed "next" onto a third row, so it dropped below the image on
   the left. Pinning each child to its own cell makes the layout
   independent of DOM order.
   ========================================================= */
.lightbox__nav--prev { grid-column: 1; grid-row: 1; }
.lightbox__stage     { grid-column: 2; grid-row: 1; }
.lightbox__nav--next { grid-column: 3; grid-row: 1; }
.lightbox__rail      { grid-column: 1 / -1; grid-row: 2; }

@media (max-width: 620px) {
  .lightbox {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    padding-inline: 0;
  }
  .lightbox__stage { grid-column: 1; grid-row: 1; }
  .lightbox__rail  { grid-column: 1; grid-row: 2; padding-inline: .8rem; }

  /* centred against the left and right edges, not stacked at the foot */
  .lightbox__nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    bottom: auto; width: 42px; height: 42px;
    background: rgba(20,3,3,.55);
    backdrop-filter: blur(4px);
  }
  .lightbox__nav--prev { left: 10px; right: auto; }
  .lightbox__nav--next { right: 10px; left: auto; }

  .lightbox__rail button { width: 62px; height: 46px; }
  .lightbox__stage img { max-height: 62vh; }
}
