/* ============================================================================
   ASTROVE — STATIC DOCUMENT SHELL
   ----------------------------------------------------------------------------
   The parts every generated document shares: base type, focus, skip link,
   masthead, the site index and the house record. Rendered by
   scripts/lib/static-page.js for product pages, field guides and site pages.

   Each page family sets two variables and nothing else here:
     --shell-field   the masthead ground (a fruit field, the guide abyss...)
     --shell-accent  instrumentation: focus rings, index numerals, ticks
   Built on tokens.css only.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --shell-field: var(--void);
  --shell-accent: var(--nectar);
}

html {
  background: var(--void-deep);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--void-deep);
  color: var(--moon);
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

:where(a, button, input, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--shell-accent);
  outline-offset: 4px;
  border-radius: 2px;
}

[id] { scroll-margin-top: 1.5rem; }

/* ---- skip link ---------------------------------------------------------- */
.shell-skip {
  position: absolute;
  left: var(--gutter-left);
  top: 0.75rem;
  z-index: 10;
  padding: 0.7rem 1rem;
  background: var(--moon);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transform: translateY(-160%);
}
.shell-skip:focus { transform: translateY(0); }

/* ---- masthead ------------------------------------------------------------ */
.shell-masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: max(1rem, var(--safe-top)) var(--gutter-right) 1rem var(--gutter-left);
  background: var(--shell-field);
}
.shell-home { display: block; flex: none; width: 7.2rem; }
.shell-nav { display: flex; gap: clamp(1.2rem, 3vw, 2.2rem); }
.shell-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--moon-soft);
}
.shell-nav a:hover { color: var(--moon); }
.shell-nav a[aria-current="page"] { color: var(--moon); box-shadow: inset 0 -1px 0 var(--shell-accent); }

/* ---- footer: site index + house record ---------------------------------- */
.shell-footer {
  margin-top: clamp(2rem, 6vw, 4rem);
  padding: clamp(2.6rem, 6vw, 4.5rem) var(--gutter-right) max(2.4rem, var(--safe-bottom)) var(--gutter-left);
  border-top: 1px solid var(--line-strong);
  background: var(--void);
}
.shell-index {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem 1.4rem;
  padding-bottom: 2.4rem;
  border-bottom: 1px solid var(--line);
}
.shell-index__head {
  display: flex;
  gap: 0.6rem;
  margin: 0 0 0.9rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--moon);
}
.shell-index__head i { font-style: normal; color: var(--shell-accent); }
.shell-index ul { margin: 0; padding: 0; list-style: none; }
.shell-index a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-size: 0.9rem;
  line-height: 1.3;
  color: var(--moon-soft);
  text-decoration: none;
}
.shell-index a:hover { color: var(--moon); }
.shell-index a[aria-current="page"] { color: var(--moon); text-decoration: underline; text-decoration-color: var(--shell-accent); text-underline-offset: 0.3em; }

.shell-house {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1.6rem;
  padding-top: 2.2rem;
  font-size: 0.86rem;
  color: var(--moon-soft);
}
.shell-house p, .shell-house address { margin: 0; font-style: normal; line-height: 1.55; }
.shell-house__label {
  margin-bottom: 0.45rem !important;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--moon-dim);
}
.shell-house a { text-decoration: none; color: var(--moon); }
.shell-house a:hover { text-decoration: underline; }
.shell-footer__line {
  margin: 2.4rem 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--moon-soft);
}

/* ---- shared call to action ------------------------------------------------ */
.shell-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 3rem;
  padding: 0.95rem 1.75rem;
  border-radius: var(--radius-pill);
  background: var(--nectar);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.shell-cta:hover { background: var(--moon); }
.shell-link {
  color: var(--moon);
  text-decoration: underline;
  text-decoration-color: var(--shell-accent);
  text-underline-offset: 0.3em;
}

@media (min-width: 760px) {
  .shell-index { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .shell-cta, .shell-skip { transition: none; }
}
