/* ============================================================
   Essington Institute — home page styles (hero map, focus areas,
   news, close). Shared chrome lives in system.css.
   ============================================================ */

/* ---------------- Hero: the map card fills the viewport below the nav.
   Lockup in the Indian Ocean (mid-left), the finding in the Pacific (mid-right). ---------------- */
.hero { height: 100svh; min-height: 36rem; display: flex; flex-direction: column; padding: var(--tc-nav-h) var(--tc-plate-gap) var(--tc-plate-gap); }
.hero p { margin: 0; }
.hero__map {
  position: relative; flex: 1 1 auto; min-height: 0; margin: 0; border-radius: var(--tc-radius-plate); overflow: hidden; isolation: isolate;
  background: var(--tc-ink-surface); color: var(--cream); box-shadow: var(--tc-shadow-card), 0 60px 120px -60px rgba(30,43,38,0.6);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: clamp(1.5rem, 4vw, 3.5rem) clamp(1.5rem, 4vw, 4rem);
}
.hero__stack { position: relative; z-index: 1; max-width: 46rem; display: flex; flex-direction: column; gap: clamp(1rem, 2.5vh, 1.75rem); }
.hero__canvas { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }
.hero__brand { color: var(--cream); }
.hero__tagline { margin: 0; font-family: var(--sans); font-weight: 600; font-size: clamp(2.2rem, min(4.2vw, 7vh), 4rem); line-height: 1.06; letter-spacing: -0.03em; color: var(--cream); }
.hero__text { max-width: 40em; }
.hero .hero__lede { font-family: var(--sans); font-size: var(--t-body); line-height: 1.55; color: var(--cream); text-wrap: pretty; }
/* The call to action sits in the card's bottom-right corner, apart from the text block. */
.hero__actions { position: absolute; right: clamp(1.5rem, 4vw, 4rem); bottom: clamp(1.5rem, 4vw, 3.5rem); z-index: 1; display: flex; gap: 0.75rem; align-items: center; }
.hero__actions .btn { font-size: 1rem; }
.btn--ghost-dark { background: rgba(244,240,229,0.1); color: var(--cream); border: 1px solid rgba(244,240,229,0.2); box-shadow: none; }
.btn--ghost-dark:hover { background: var(--cream); color: var(--ink); }
.hero .fn-ref { font-size: 0.6em; line-height: 0; vertical-align: super; }
.hero .fn-ref a { color: var(--copper-light); text-decoration: none; font-weight: 600; }

/* Mobile-only fragments (the hero's finding moves into the letter on phones). */
.only-mobile { display: none; }
.message__body .fn-ref { font-size: 0.7em; line-height: 0; vertical-align: super; }
.message__body .fn-ref a { color: var(--copper); text-decoration: none; font-weight: 600; }

/* ---------------- A message: kicker + heading left, the letter right ---------------- */
/* The message sits on the page itself, not a card: plate spacing without a surface. */
.message { background: transparent; box-shadow: none; }
.message__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: clamp(2.5rem, 6vw, 8rem); align-items: start; max-width: none; }
.message__intro { align-self: center; } /* kicker + heading sit at the vertical middle of the letter */
.message__intro h2 { font-family: var(--sans); font-weight: 600; font-size: clamp(2.2rem, 4.6vw, 4.6rem); line-height: 1.02; letter-spacing: -0.03em; margin: 0; }
.message__intro h2 em { font-style: normal; color: var(--copper); }
.message__body { font-family: var(--sans); font-size: clamp(1rem, 1.25vw, 1.2rem); line-height: 1.55; color: var(--ink-soft); padding-top: 0.4rem; }
.message__body p + p { margin-top: 0.8em; }

/* ---------------- Focus areas: pinned; three level columns of cards slide up under the label ---------------- */
.focus { padding-block: 0; }
.focus__stage { position: relative; }
.focus__head { position: relative; z-index: 1; max-width: none; padding-block: var(--tc-plate-pad-y) 0; }
/* Desktop only: the head is absolutely placed in the pinned 100svh stage, and the
   deeper pad is what the cards travel up through. On phones it was 104px of nothing
   above a single kicker line. */
@media (min-width: 901px) { .focus__head { padding-block: clamp(6.5rem, 11vh, 8rem) 0; } }
.focus__head .kicker { margin: 0; }
.focus__count { display: none; }
/* Focus card layout (all sizes): title left with the icon top-right, description beneath,
   every description starting at the same height (the title row reserves two lines). */
.focus__cols .card { margin-bottom: 1.5rem; text-align: left; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title icon" "desc desc";
  column-gap: 1rem; align-content: start; }
.focus__cols .card h3 { grid-area: title; align-self: start; }
.focus__cols .card .card__icon { grid-area: icon; align-self: start; margin: 0.15rem 0 0; width: 32px; height: 32px; }
.focus__cols .card p { grid-area: desc; margin: 0.9rem 0 0; max-width: none; }
.focus__cols { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; align-items: start; padding-block: 3.5rem 0; }
@media (min-width: 1100px) {
  .focus__stage { height: 100svh; }
  .focus__head { position: absolute; top: 0; left: 0; right: 0; }
  .focus__cols { position: absolute; left: var(--gutter); right: var(--gutter); top: 0; padding-top: var(--focus-cols-top, 100svh); will-change: transform; }
}

/* ---------------- News ---------------- */
.news__head { display: flex; justify-content: space-between; align-items: baseline; gap: 2rem; flex-wrap: wrap; }
.news-grid { margin-top: 2.5rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 1.25rem; }
.news-card { display: block; background: var(--paper-light); border-radius: var(--tc-radius-card); padding: var(--tc-card-pad); text-decoration: none; box-shadow: var(--tc-shadow-card); border: 1px solid rgba(255,255,255,0.6); transition: transform 0.25s var(--ease-out); }
.news-card:hover { transform: translateY(-3px); }
.news-card .meta { font-family: var(--sans); font-size: 0.8125rem; color: var(--ink-soft); display: flex; gap: 0.75rem; }
.news-card .meta .tag { color: var(--copper); font-weight: 600; }
.news-card .title { display: block; margin-top: 0.9rem; font-size: 1.4rem; line-height: 1.25; }
.news-card .desc { display: block; margin-top: 0.75rem; font-family: var(--sans); font-size: var(--t-small); color: var(--ink-soft); line-height: 1.5; }
.news-empty { grid-column: 1 / -1; background: var(--paper-light); border-radius: var(--tc-radius-card); padding: var(--tc-card-pad); font-family: var(--sans); font-size: var(--t-small); color: var(--ink-soft); }
.news-empty a { color: var(--ink); font-weight: 600; }

/* ---------------- Close ---------------- */

/* Two columns, like the message: the heading left, the copy and both calls to action right. */
.close__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: clamp(2.5rem, 6vw, 8rem); align-items: start; } /* same centred measure as the news plate above it */
.close h2 { font-size: var(--t-hero); max-width: 10em; }
.close .copy { margin: 0.4rem 0 0; }
/* Two columns, not a wrapping flex row: the buttons sit side by side and their
   captions line up with each other, whatever the column width. */
.close__ctas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; margin-top: 2.25rem; align-items: start; }
.close__cta .btn { font-size: 1rem; }
.close__cta p { margin-top: 0.75rem; font-family: var(--sans); font-size: var(--t-small); color: var(--tc-on-accent-soft); max-width: 18em; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1099px) {
  .message__grid { grid-template-columns: 1fr; row-gap: 1.5rem; }
  .message__intro h2 { font-size: clamp(1.9rem, 7.5vw, 3rem); }
  .focus__cols { grid-template-columns: repeat(2, 1fr); }
  .focus { padding-bottom: clamp(3rem, 6vw, 5rem); }
}
@media (max-width: 640px) {
  .focus__cols { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  /* Phones: the map card runs edge to edge (no paper either side); its rounded corners stay visible top and bottom. */
  .hero { height: auto; min-height: 100svh; padding: var(--tc-nav-h) 0 var(--tc-plate-gap); }
  .hero__map { min-height: 40rem; padding: 2rem 1.5rem 2.5rem; }
  /* Phones: the tagline alone on the map; the finding moves into the letter, no button. */
  .hero__text, .hero__actions { display: none; }
  .hero__tagline br { display: none; }   /* let the line wrap naturally at phone widths */
  .only-mobile { display: block; }
  /* Focus areas: a swipeable, snapping, looping row of cards (js/home-sections.js builds
     the track: the eight cards in alphabetical order with a cloned set either side). */
  .focus__cols { display: flex; grid-template-columns: none; gap: 1rem; overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); padding: 1.5rem var(--gutter) 1.5rem;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; align-items: stretch; }
  .focus__cols::-webkit-scrollbar { display: none; }
  .focus__col { display: contents; }
  /* A scroller clips its overflow, so the card shadow (40px deep) was cut off in a hard
     line under the row. This one fits inside the row's bottom padding. */
  .focus__cols .card { flex: 0 0 min(82vw, 22rem); margin-bottom: 0; scroll-snap-align: start;
    box-shadow: 0 1px 2px rgba(30,43,38,0.08), 0 8px 18px -10px rgba(30,43,38,0.3); }
  /* Where the swipe row is up to: the count, then a thumb that sits at the same
     fraction along its track. Built by js/home-sections.js, which sets --n and --i. */
  .focus__count { display: flex; align-items: center; gap: 1rem; margin: 0; padding: 0 var(--gutter);
    font-family: var(--sans); font-size: var(--t-small); font-weight: 600; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
  .focus__count__track { flex: 1; height: 3px; border-radius: 999px; background: var(--paper-deep); overflow: hidden; }
  .focus__count__thumb { display: block; height: 100%; width: calc(100% / var(--n, 8)); border-radius: 999px; background: var(--copper);
    transform: translateX(calc(var(--i, 0) * 100%)); transition: transform 0.25s var(--ease-out); }
  .focus__head { padding-inline: var(--gutter); }
  .focus { padding-bottom: var(--tc-plate-pad-y); }
}

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

/* Endnotes: the page's sources, one quiet list above the footer. */
.endnotes-plate { padding: 1.5rem var(--tc-plate-gap) 0; }
.endnotes-list { margin: 0; padding: 0 0 0 1.25rem; font-family: var(--sans); font-size: 0.8125rem; line-height: 1.5; color: var(--ink-soft); max-width: 60em; }
.endnotes-list li { scroll-margin-top: 6rem; }
.fn-back { text-decoration: none; margin-left: 0.25em; font-family: var(--sans); }
@media (max-width: 900px) {
  .close__grid { grid-template-columns: 1fr; row-gap: 1.5rem; }
}
/* Phones: two columns left about 160px each, so "Register interest" wrapped and the two
   buttons came out different sizes. The choices stack instead, each button full width. */
@media (max-width: 560px) {
  .close__ctas { grid-template-columns: 1fr; gap: 1.75rem; }
  .close__cta .btn { display: flex; justify-content: center; width: 100%; white-space: nowrap; }
  .close__cta p { max-width: none; }
}
