/* ==========================================================================
   Rivosus Ranch - site.css
   Public landing page components. Depends on base.css.
   ========================================================================== */

/* ---------- 1. Hero ------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100vh;   /* fallback for browsers without small-viewport units */
  min-height: 100svh;  /* avoids the mobile URL-bar jump */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 8%, #14452A 0%, var(--pine-800) 42%, var(--pine-900) 100%);
  color: var(--parchment-100);
  padding: clamp(7rem, 14vh, 11rem) var(--gutter) 0;
}

/* Faint contour lines, like a survey sheet held to the light */
.hero__contours {
  position: absolute;
  inset: -10% -5%;
  opacity: 0.16;
  pointer-events: none;
  mix-blend-mode: soft-light;
}

/* Drifting light through the canopy */
.hero__glow {
  position: absolute;
  top: -20%;
  left: 50%;
  width: 90vmax;
  height: 90vmax;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(196, 214, 176, 0.14) 0%, transparent 62%);
  pointer-events: none;
  animation: heroGlow 22s ease-in-out infinite alternate;
}
@keyframes heroGlow {
  from { transform: translateX(-52%) scale(1); opacity: .75; }
  to   { transform: translateX(-46%) scale(1.14); opacity: 1; }
}

/* The padding-bottom reserves the lower band of the hero for the stonework,
   so the type is never forced to sit on top of the chimney. */
.hero__inner {
  position: relative;
  z-index: 3;
  max-width: 1000px;
  margin-inline: auto;
  padding-bottom: clamp(13rem, 36vh, 26rem);
}

.hero__seal {
  width: clamp(72px, 9vw, 104px);
  height: auto;
  margin: 0 auto clamp(1.75rem, 3vw, 2.75rem);
  /* The seal ships as dark pine ink; invert it to sit on the dark ground. */
  filter: brightness(0) invert(1) opacity(.9);
}

.hero__title {
  font-family: var(--font-display);
  font-size: var(--t-hero);
  font-weight: 300;
  line-height: 0.9;
  letter-spacing: -0.025em;
  margin: 0;
}
.hero__title em {
  display: block;
  font-style: normal;
  font-size: 0.24em;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--sage-300);
  margin-top: 1.9rem;
  text-transform: uppercase;
}

.hero__lede {
  max-width: 44ch;
  margin: clamp(1.75rem, 3vw, 2.5rem) auto 0;
  font-size: clamp(1.0625rem, 0.98rem + 0.45vw, 1.3125rem);
  line-height: 1.68;
  color: var(--sage-200);
  font-weight: 300;
}

/* The stonework elevation, standing on the floor of the hero.
   Sourced from "bluejay land logo.png" - a measured drawing of the wall
   that still stands on the property. */
.hero__stonework {
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: min(1280px, 112vw);
  min-width: 680px;
  /* `transform` centres the drawing; the independent `translate` property is
     left free so JS can drive parallax without fighting the entrance. */
  transform: translateX(-50%);
  translate: 0 0;
  z-index: 2;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 62%, rgba(0,0,0,.72) 86%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 62%, rgba(0,0,0,.72) 86%, transparent 100%);
  filter: drop-shadow(0 26px 40px rgba(0, 0, 0, 0.55));
  opacity: 0;
  animation: stoneRise 2.2s var(--ease) 0.35s forwards;
}
/* Once the entrance has played, hand the element over to the parallax. */
.hero__stonework.is-settled { animation: none; opacity: 0.97; }

@keyframes stoneRise {
  from { opacity: 0; translate: 0 44px; }
  to   { opacity: 0.97; translate: 0 0; }
}

/* Forest floor beneath the wall */
.hero__floor {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 34%;
  background: linear-gradient(to bottom, transparent, rgba(7,30,19,.72) 52%, var(--pine-900) 88%);
  z-index: 2;
  pointer-events: none;
}

.hero__scroll {
  position: absolute;
  bottom: clamp(1.5rem, 3vh, 2.5rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  font-size: var(--t-label);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--sage-300);
  text-decoration: none;
}
.hero__scroll-line {
  width: 1px;
  height: 46px;
  background: linear-gradient(to bottom, var(--sage-300), transparent);
  animation: scrollPulse 2.6s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { transform: scaleY(1); opacity: .9; transform-origin: top; }
  50%      { transform: scaleY(0.45); opacity: .4; transform-origin: top; }
}

@media (max-width: 720px) {
  .hero__inner { padding-bottom: clamp(9rem, 26vh, 14rem); }
  .hero__stonework { min-width: 560px; opacity: .9; }
}

/* At phone widths the tracking on the location line is wide enough to force
   a wrap mid-phrase. Tighten it rather than let "CALIFORNIA" drop. */
@media (max-width: 540px) {
  .hero__title em {
    font-size: 0.21em;
    letter-spacing: 0.24em;
    text-indent: 0.24em;
    margin-top: 1.5rem;
  }
}

/* ---------- 2. Statement / intro ------------------------------------------ */

.statement {
  text-align: center;
  max-width: 30ch;
  margin-inline: auto;
}
.statement__body {
  max-width: 62ch;
  margin: clamp(1.75rem, 3vw, 2.5rem) auto 0;
  text-align: left;
}

/* ---------- 3. Fact row ---------------------------------------------------- */

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  border-top: 1px solid var(--rule);
  margin-top: clamp(2.5rem, 4vw, 3.5rem);
}
.section--pine .facts { border-color: var(--rule-light); }

.fact {
  padding: clamp(1.5rem, 2.5vw, 2.25rem) clamp(1.25rem, 2vw, 2rem);
  border-right: 1px solid var(--rule);
}
/* The outer edges stay flush with the wrap; only the inner ones clear the
   divider rules. */
.fact:first-child { padding-left: 0; }
.fact:last-child { border-right: 0; padding-right: 0; }
.section--pine .fact { border-color: var(--rule-light); }

.fact__value {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 1.6rem + 2.4vw, 3.5rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.02em;
  display: block;
}
.fact__unit {
  font-size: 0.3em;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-family: var(--font-body);
  margin-left: 0.55rem;
  vertical-align: 0.3em;
  color: var(--stone-600);
}
.section--pine .fact__unit { color: var(--sage-300); }

.fact__label {
  margin-top: 0.9rem;
  font-size: var(--t-sm);
  line-height: 1.55;
  color: var(--fg-muted);
  text-wrap: pretty;
}
.section--pine .fact__label { color: var(--sage-200); }

@media (max-width: 640px) {
  .fact {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    padding: 1.75rem 0;
  }
  .section--pine .fact { border-color: var(--rule-light); }
  .fact:last-child { border-bottom: 0; }
}

/* ---------- 4. Plate groupings --------------------------------------------- */
/* `.split`, `.plate` and their modifiers now live in base.css, because the
   portal uses them too and does not load this file. */

/* Paired plates, then and now */
.plates-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}
@media (max-width: 760px) { .plates-pair { grid-template-columns: 1fr; gap: 2.5rem; } }

/* ---------- 5b. Gallery --------------------------------------------------- */
/* Grid of clickable image thumbnails with lightbox integration. */

/* Uniform cells rather than per-item aspect ratios: the set runs 0.83 to 2.60,
   and letting each tile size itself leaves ragged rows. */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  grid-auto-rows: clamp(165px, 17vw, 225px);
  grid-auto-flow: dense;
  gap: clamp(0.75rem, 1.6vw, 1.25rem);
}

/* The 1200x462 magazine banner and the 667x800 group photograph are the two
   outliers; spanning them keeps the crop off their subjects. */
.gallery-item--wide { grid-column: span 2; }
.gallery-item--tall { grid-row: span 2; }

@media (max-width: 560px) {
  .gallery-item--wide { grid-column: span 1; }
  .gallery-item--tall { grid-row: span 1; }
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--parchment-200);
  margin: 0;
  box-shadow: var(--shadow-plate);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s var(--ease);
}

.gallery-item--clickable {
  cursor: zoom-in;
}

.gallery-item--clickable:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px -8px rgba(26, 24, 19, 0.3);
}

.gallery-item--clickable:hover img {
  transform: scale(1.045);
}

.gallery-item figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(7, 30, 19, 0.92), transparent);
  color: var(--parchment-100);
  padding: 1rem 0.9rem 0.85rem;
  font-size: var(--t-sm);
  text-align: center;
  opacity: 0;
  transition: opacity .4s var(--ease);
}

.gallery-item:hover figcaption {
  opacity: 1;
}

/* The captions carry the dates, so they cannot be hover-only where there is
   no hover. */
@media (hover: none) {
  .gallery-item figcaption { opacity: 1; }
}

@media (max-width: 720px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    grid-auto-rows: clamp(130px, 34vw, 175px);
    gap: 0.6rem;
  }
}

/* Scattered photo callouts: a print set into the narrative column. */
.photo-callout {
  margin: 1.75rem 0 0;
  max-width: 32rem;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--parchment-200);
  box-shadow: var(--shadow-plate);
  cursor: zoom-in;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}

.photo-callout:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px -8px rgba(7, 30, 19, 0.45);
}

.photo-callout img {
  width: 100%;
  height: auto;
  display: block;
}

.photo-callout figcaption {
  padding: 0.7rem 1rem 0.8rem;
  font-size: var(--t-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone-600);
}

/* ---------- 6. Timeline ---------------------------------------------------- */

.timeline { position: relative; margin-top: clamp(3rem, 6vw, 5rem); }
.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75rem;
  bottom: 0.75rem;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--rule-light) 8%, var(--rule-light) 92%, transparent);
}

.era {
  position: relative;
  padding-left: clamp(2rem, 5vw, 4.5rem);
  padding-block: clamp(1.75rem, 3.5vw, 3rem);
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr);
  gap: clamp(1rem, 4vw, 3.5rem);
  align-items: start;
}
.era::before {
  content: "";
  position: absolute;
  left: -4px;
  top: calc(clamp(1.75rem, 3.5vw, 3rem) + 0.7rem);
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--brass-500);
  box-shadow: 0 0 0 5px var(--pine-800);
}
.era + .era { border-top: 1px solid var(--rule-light); }

.era__years {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.75rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--parchment-100);
}
.era__name {
  display: block;
  margin-top: 0.85rem;
  font-family: var(--font-body);
  font-size: var(--t-label);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass-400);
  font-weight: 500;
}
.era__body { color: var(--sage-200); font-size: var(--t-sm); line-height: 1.75; }

@media (max-width: 820px) {
  .era { grid-template-columns: 1fr; gap: 1.1rem; }
}

/* ---------- 7. Locality band ----------------------------------------------- */

/* A relational diagram, not a map: it states position without drawing
   boundaries. Blue Jay to the west, Agua Fria to the east. */
.locality {
  --loc-gap: 1rem;
  --loc-dot: 16px;
  margin-top: clamp(2rem, 4vw, 3rem);
  padding: clamp(1.5rem, 3vw, 2.25rem) 0 0;
  border-top: 1px solid var(--rule);
}
.locality__track {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  position: relative;
  gap: var(--loc-gap);
}
/* The outer dots sit at the centres of the first and last columns, so the
   rule has to stop there rather than at an arbitrary inset. */
.locality__track::before {
  content: "";
  position: absolute;
  left: calc((100% - 2 * var(--loc-gap)) / 6);
  right: calc((100% - 2 * var(--loc-gap)) / 6);
  top: calc(var(--loc-dot) / 2);
  height: 1px;
  background: repeating-linear-gradient(to right, var(--stone-400) 0 6px, transparent 6px 12px);
}
.locality__node { text-align: center; position: relative; }

/* A fixed box holds the dot so the two sizes still share one centre line and
   the names below all start at the same height. */
.locality__dot {
  display: grid;
  place-items: center;
  width: var(--loc-dot);
  height: var(--loc-dot);
  margin: 0 auto 1.15rem;
  position: relative;
  z-index: 2;
}
.locality__dot::after {
  content: "";
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 1px solid var(--stone-500);
  background: var(--parchment-100);
}
.locality__node--focus .locality__dot::after {
  width: 15px; height: 15px;
  background: var(--pine-700);
  border-color: var(--pine-700);
  box-shadow: 0 0 0 5px rgba(14, 59, 36, 0.14);
}
/* Fixed line box: the focus name is larger but must not shift its own meta
   line out of step with the other two. */
.locality__name {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 0.95rem + 0.6vw, 1.5rem);
  line-height: 2.25rem;
  color: var(--stone-700);
}
.locality__node--focus .locality__name {
  color: var(--pine-700);
  font-size: clamp(1.3rem, 1rem + 0.9vw, 1.85rem);
}
.locality__meta {
  display: block;
  margin-top: 0.4rem;
  font-size: var(--t-label);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--stone-600);
}

.bearings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0;
  margin-top: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--rule);
}
.bearing {
  padding: 1.5rem clamp(1.25rem, 2vw, 2rem);
  border-right: 1px solid var(--rule);
}
/* The outer edges align with the heading above rather than sitting indented. */
.bearing:first-child { padding-left: 0; }
.bearing:last-child { border-right: 0; padding-right: 0; }
.bearing__key {
  font-size: var(--t-label);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--stone-600);
  margin-bottom: 0.65rem;
}
.bearing__val {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.05rem + 0.35vw, 1.4rem);
  line-height: 1.35;
  color: var(--ink-900);
  text-wrap: balance;
}

@media (max-width: 640px) {
  .bearing {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    padding-left: 0;
    padding-right: 0;
  }
  .bearing:last-child { border-bottom: 0; }
  .locality__track { grid-template-columns: 1fr; gap: 2rem; }
  .locality__track::before {
    left: 50%; right: auto; top: 5%; bottom: 5%;
    width: 1px; height: auto;
    background: repeating-linear-gradient(to bottom, var(--stone-400) 0 6px, transparent 6px 12px);
  }
}

/* ---------- 8. Pull quote --------------------------------------------------- */

.pullquote {
  max-width: 24ch;
  margin-inline: auto;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 1.2rem + 2.2vw, 3.25rem);
  font-weight: 300;
  line-height: 1.16;
  letter-spacing: -0.015em;
}
.pullquote__attr {
  display: block;
  margin-top: 2rem;
  font-family: var(--font-body);
  font-size: var(--t-label);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--stone-600);
}
.section--pine .pullquote__attr { color: var(--sage-300); }

/* ---------- 9. Enquiry ------------------------------------------------------ */

.enquiry { text-align: center; }
.enquiry__seal {
  width: 96px;
  margin: 0 auto clamp(2rem, 4vw, 3rem);
  opacity: 0.9;
}
.enquiry__actions {
  margin-top: clamp(2rem, 4vw, 3rem);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}
.enquiry__note {
  margin-top: clamp(2rem, 4vw, 3rem);
  font-size: var(--t-sm);
  /* This block sits on pine, not parchment - stone would be too dark here. */
  color: var(--sage-300);
  max-width: 48ch;
  margin-inline: auto;
}
