/* =========================================================
   GravelwoodCo — Design System v1
   Derived directly from the real brand lockup (02_data/brand/
   gwsmall.png, gwbig.png) — colors sampled from the actual
   pixel values, not invented. See week1_build_summary.md for
   the sampling method.
   ========================================================= */

:root {
  /* --- Brand colors (sampled from gwsmall.png) --- */
  --forest: #1a271e;        /* ring / wordmark / pine silhouette — rgb(26,39,30) */
  --cream: #fbf8ef;         /* badge interior background — rgb(251,248,239) */
  --orange: #b96e39;        /* sun accent — rgb(185,110,57) */

  /* --- Derived tints/shades (NOT sampled — computed for UI states,
     kept close to the sampled hues so nothing introduces an
     off-brand color) --- */
  --forest-light: #2f4536;  /* hover/active on dark surfaces */
  --forest-mist: #eef1ec;   /* faint green-tinted panel background */
  --cream-deep: #f1ead9;    /* alternating section stripe */
  --orange-deep: #935829;   /* WCAG-safe orange for text/buttons on light backgrounds (5.4–5.7:1) */
  --orange-darker: #784822; /* hover/active state for orange-deep text & buttons (7.6:1) */
  --orange-tint: #d68e58;   /* WCAG-safe orange for text on the dark forest background (5.8:1) */
  --muted: #5c6259;         /* secondary text on light backgrounds (5.9:1 on cream) */
  --muted-on-dark: #a8afa1; /* secondary text on the dark forest background (6.9:1) */
  --white: #ffffff;
  --border: #e4ddc9;

  /* NOTE on --orange (#b96e39): this is the color sampled directly from
     the sun accent in gwsmall.png. At ~3.7–3.9:1 contrast it doesn't
     meet WCAG AA (4.5:1) for small text on cream/white, so it's used
     here only for non-text/decorative accents (borders, the FAQ +/-
     glyph, nav-link underlines) where the 3:1 UI-component threshold
     applies — never for body copy or button labels. Actual readable
     text uses --orange-deep (light backgrounds) or --orange-tint (the
     dark forest background) instead, both derived from it and checked
     against WCAG AA. See week1_build_summary.md for the exact ratios. */

  /* --- Type scale --- */
  --font-head: 'Oswald', 'Arial Narrow', Impact, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* --- Spacing scale --- */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;

  --radius: 6px;
  --max-width: 1120px;
}

/* --- Reset / base --- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--forest);
  background: var(--cream);
  line-height: 1.6;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.15;
  margin: 0 0 var(--space-2);
  color: var(--forest);
}

h1 { font-size: clamp(2rem, 5vw + 1rem, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3vw + 1rem, 2.25rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 var(--space-2); }

.eyebrow {
  font-family: var(--font-head);
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--orange-deep);
  font-weight: 500;
  margin: 0 0 var(--space-1);
}
/* on the dark forest section (flat, known-color background) the
   dark-background-safe orange tint holds AA fine */
.section-forest .eyebrow {
  color: var(--orange-tint);
}
/* the hero sits over a variable photo, not a flat color — orange-tint
   would need ~0.92 scrim alpha to hold 4.5:1 against the photo's
   brightest pixels (see hero_fix_notes.md), which defeats the point of
   showing the photo at all, so use cream (matches .lede) instead */
.hero .eyebrow {
  color: var(--cream);
}

a { color: var(--orange-deep); text-decoration-thickness: 1.5px; }
a:hover { color: var(--orange-darker); }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.95rem;
  padding: 0.85em 1.6em;
  border-radius: var(--radius);
  text-decoration: none;
  border: 2px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-primary {
  background: var(--orange-deep);
  color: var(--white);
}
.btn-primary:hover { background: var(--orange-darker); color: var(--white); }
.btn-outline {
  background: transparent;
  color: var(--forest);
  border-color: var(--forest);
}
.btn-outline:hover { background: var(--forest); color: var(--cream); }
.btn-outline-light {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}
.btn-outline-light:hover { background: var(--white); color: var(--forest); }

.btn-row { display: flex; gap: var(--space-2); flex-wrap: wrap; }

.external::after {
  content: "\2197"; /* ↗ */
  display: inline-block;
  margin-left: 0.35em;
  font-size: 0.85em;
}

/* =========================================================
   Header / Nav
   ========================================================= */
.site-header {
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  padding-top: var(--space-1);
  padding-bottom: var(--space-1);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--forest);
}
.brand img { width: 44px; height: 44px; }
.brand-word {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1;
}
.brand-tagline {
  display: block;
  font-family: var(--font-body);
  font-size: 0.55rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.15rem;
}

.nav-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  margin: 0;
  padding: 0;
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.9rem;
}
.nav-links a {
  color: var(--forest);
  text-decoration: none;
  padding: 0.4rem 0.1rem;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  border-bottom-color: var(--orange);
  color: var(--forest);
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  background: var(--forest) url('../img/hero-mountains.jpg') center 30% / cover no-repeat;
  color: var(--white);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  /* stops (0.66/0.76/0.88) are set so real hero text still clears WCAG AA
     even against the photo's brightest pixel (sun-glare near-white) —
     see hero_fix_notes.md for the computed contrast table */
  background: linear-gradient(180deg, rgba(26,39,30,0.66) 0%, rgba(26,39,30,0.76) 50%, rgba(26,39,30,0.88) 100%);
}
.hero .container {
  position: relative;
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
  max-width: 760px;
}
.hero h1 { color: var(--white); }
.hero p.lede {
  font-size: 1.15rem;
  max-width: 46ch;
  color: var(--cream);
}
@media (max-width: 640px) {
  .hero { background-image: url('../img/hero-mountains-mobile.jpg'); }
  .hero .container { padding-top: var(--space-5); padding-bottom: var(--space-5); }
}

/* =========================================================
   Sections / cards
   ========================================================= */
section { padding: var(--space-5) 0; }
.section-alt { background: var(--cream-deep); }
.section-forest { background: var(--forest); color: var(--cream); }
.section-forest h2 { color: var(--cream); }
.section-forest a:not(.btn) { color: var(--orange-tint); }
.section-forest a:not(.btn):hover { color: var(--cream); }

.section-head { max-width: 60ch; margin: 0 0 var(--space-4); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

.grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 860px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
}
.card h3 { margin-top: 0; }
.card .eyebrow { margin-bottom: 0.4rem; }

/* =========================================================
   FAQ accordion — native <details>/<summary>, zero JS
   ========================================================= */
.faq-group { margin-bottom: var(--space-4); }
.faq-group h2 { margin-bottom: var(--space-2); }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  margin-bottom: var(--space-1);
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-head);
  font-weight: 500;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.4rem;
  line-height: 1;
  color: var(--orange);
  flex-shrink: 0;
}
.faq-item[open] summary::after { content: "\2212"; } /* − */
.faq-item .faq-answer {
  padding: 0 var(--space-3) var(--space-3);
  color: var(--forest);
}
.faq-item .faq-answer p:last-child { margin-bottom: 0; }

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  background: var(--forest);
  color: var(--cream);
  padding: var(--space-4) 0 var(--space-3);
  font-size: 0.9rem;
}
.site-footer a { color: var(--cream); }
.site-footer a:hover { color: var(--orange-tint); }
.footer-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
  margin-bottom: var(--space-3);
}
@media (min-width: 640px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}
.footer-brand { display: flex; align-items: center; gap: 0.6rem; margin-bottom: var(--space-1); }
.footer-brand img { width: 36px; height: 36px; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 0.4rem; }
.footer-legal {
  border-top: 1px solid rgba(251,248,239,0.15);
  padding-top: var(--space-2);
  font-size: 0.8rem;
  color: var(--muted-on-dark);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  justify-content: space-between;
}
.footer-legal a { color: var(--cream); }

/* =========================================================
   Shop page — product card grid (real Etsy catalog)
   ========================================================= */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.shop-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
}
@media (min-width: 560px) {
  .shop-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 860px) {
  .shop-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1100px) {
  .shop-grid { grid-template-columns: repeat(4, 1fr); }
}
.shop-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.shop-card-media {
  display: block;
  aspect-ratio: 1 / 1;
  background: var(--forest-mist);
}
.shop-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.shop-card-body {
  padding: var(--space-2) var(--space-3) var(--space-3);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.shop-card-title {
  font-family: var(--font-body);
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 0.4rem;
  color: var(--forest);
}
.shop-card-price {
  font-family: var(--font-head);
  font-size: 1.1rem;
  color: var(--orange-deep);
  margin: 0 0 var(--space-2);
}
.shop-card-cta {
  margin-top: auto;
  text-align: center;
  font-size: 0.8rem;
  padding: 0.6em 1em;
}

/* =========================================================
   Simple content pages (FAQ / Terms intro blocks)
   ========================================================= */
.page-hero {
  background: var(--forest-mist);
  border-bottom: 1px solid var(--border);
  padding: var(--space-4) 0;
}
.page-hero .eyebrow { color: var(--orange-deep); }
.prose { max-width: 72ch; }
.prose h2 { margin-top: var(--space-4); }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li { margin-bottom: 0.4em; }
.callout {
  background: var(--cream-deep);
  border-left: 4px solid var(--orange);
  padding: var(--space-2) var(--space-3);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: var(--space-3) 0;
}
