/* =========================================================================
   Aging Well Post — "Large-Print Gazette" design system
   Accessible-first, dignified print-gazette feel for an older readership.
   Palette: deep forest-teal / warm honey-gold / soft ivory / charcoal ink.
   Contrast has been checked, not guessed — see notes below each token.
   ========================================================================= */

:root{
  /* Core palette */
  --forest:      #2B4A43; /* primary / headers / footer bg */
  --forest-deep: #1F3733; /* darker forest for hover + dark surfaces */
  --gold:        #C99A3E; /* accent, CTA fills, borders, badges */
  --gold-deep:   #A87E2E; /* hover state for gold fills */
  --gold-ink:    #8A6423; /* gold used AS TEXT (links) — darkened for AA contrast
                              on ivory: contrast ratio ~5:1, passes WCAG AA */
  --ivory:       #FAF6EE; /* page background */
  --paper:       #FFFFFF; /* card / panel background */
  --ink:         #2A2724; /* body text (charcoal) — ~13.8:1 on ivory, AAA */
  --ink-soft:    #55504A; /* secondary / muted text */
  --line:        #E4DAC5; /* hairline borders, dividers */
  --ok:          #2F6F4E;
  --error:       #8A2E2E;

  /* Type */
  --font-serif: Georgia, 'Iowan Old Style', 'Palatino Linotype', serif;
  --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;

  /* Misc */
  --radius: 10px;
  --shadow: 0 2px 14px rgba(43,74,67,0.10);
  --maxw: 1100px;
  --maxw-read: 760px;
}

/* Dark-mode awareness: this design is intentionally a single, dignified
   light "printed page" theme (deliberate choice for an older readership —
   consistent, high-contrast, no surprise inversions). We still declare an
   explicit background on body per accessibility/artifact conventions so a
   viewer's OS dark mode never leaves unstyled gaps. */
@media (prefers-color-scheme: dark){
  :root{ color-scheme: light; }
}

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

html{
  font-size: 112.5%; /* ~18px root, per the large-print reading brief */
  -webkit-text-size-adjust: 100%;
}

body{
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1rem;      /* ~18px */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a{ color: var(--gold-ink); text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
a:hover{ color: var(--forest); }
a:focus-visible, button:focus-visible, input:focus-visible{
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

h1, h2, h3, h4, h5{
  font-family: var(--font-serif);
  color: var(--forest);
  line-height: 1.25;
  margin: 0 0 1rem;
}
h1{ font-size: 2.3rem; }
h2{ font-size: 1.7rem; }
h3{ font-size: 1.3rem; }

p{ margin: 0 0 1.15rem; }

ul, ol{ padding-left: 1.4rem; }
li{ margin-bottom: .5rem; }

.visually-hidden{
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* =========================================================================
   Buttons — generous tap targets throughout (min 48px tall)
   ========================================================================= */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  padding: .9rem 1.85rem;
  min-height: 48px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .08s ease;
}
.btn:active{ transform: translateY(1px); }

.btn-primary{ background: var(--gold); color: var(--ink); border-color: var(--gold); }
.btn-primary:hover{ background: var(--gold-deep); border-color: var(--gold-deep); color: var(--ink); }

.btn-secondary{ background: transparent; color: #fff; border-color: #fff; }
.btn-secondary:hover{ background: rgba(255,255,255,.15); color: #fff; }

.btn-ghost{ background: transparent; color: var(--forest); border-color: var(--forest); }
.btn-ghost:hover{ background: var(--forest); color: #fff; }

/* =========================================================================
   Header: topbar + masthead + nav
   ========================================================================= */
.topbar{
  background: var(--forest-deep);
  color: #E7DFC8;
  font-family: var(--font-sans);
  font-size: .82rem;
  letter-spacing: .03em;
}
.topbar-inner{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: .55rem 1.25rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .4rem;
}

.masthead{
  background: var(--ivory);
  text-align: center;
  padding: 2.25rem 1.25rem 1.6rem;
  border-bottom: 1px solid var(--line);
}
.masthead-brand{
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
}
.masthead-icon{ display: block; border-radius: 50%; }
.masthead-name{
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 2.6rem;
  color: var(--forest);
  letter-spacing: .01em;
}
.masthead-tagline{
  font-family: var(--font-sans);
  color: var(--ink-soft);
  margin: .6rem 0 0;
  font-size: 1.05rem;
  letter-spacing: .01em;
}

.site-nav{ background: var(--forest); }
.nav-inner{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-toggle{
  display: none;
  align-items: center;
  gap: .5rem;
  background: none;
  border: none;
  color: #fff;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  padding: .8rem;
  min-height: 48px;
  cursor: pointer;
}
.nav-toggle-bar{ display: block; width: 22px; height: 2px; background: #fff; margin: 4px 0; }

.nav-menu{ display: flex; flex-wrap: wrap; }
.nav-menu a{
  display: flex;
  align-items: center;
  color: #fff;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: .98rem;
  text-decoration: none;
  padding: 0 1.05rem;
  min-height: 52px;
  border-bottom: 3px solid transparent;
}
.nav-menu a:hover, .nav-menu a:focus-visible{ border-bottom-color: var(--gold); outline: none; }

@media (max-width: 720px){
  .nav-toggle{ display: inline-flex; }
  .nav-menu{
    display: none;
    flex-direction: column;
    width: 100%;
    padding-bottom: .5rem;
  }
  .nav-menu.is-open{ display: flex; }
  .nav-menu a{ min-height: 48px; border-bottom: none; border-left: 3px solid transparent; padding-left: 1.25rem; }
  .nav-menu a:hover, .nav-menu a:focus-visible{ border-left-color: var(--gold); }
  .masthead-name{ font-size: 2.1rem; }
}

/* =========================================================================
   Hero
   ========================================================================= */
.hero{
  background: linear-gradient(155deg, var(--forest) 0%, var(--forest-deep) 100%);
  color: #fff;
  padding: 3.25rem 1.25rem 3.75rem;
  text-align: center;
}
.hero-inner{ max-width: 780px; margin: 0 auto; }
.hero h1{
  color: #fff;
  font-size: 2.5rem;
  margin: 0 0 1.1rem;
}
.hero-lede{
  font-size: 1.2rem;
  line-height: 1.65;
  color: #EDE6D6;
  max-width: 640px;
  margin: 0 auto 2rem;
}
.hero-actions{ display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

@media (max-width: 560px){
  .hero h1{ font-size: 2rem; }
}

/* =========================================================================
   Generic page section rhythm
   ========================================================================= */
.section{ max-width: var(--maxw); margin: 0 auto; padding: 3rem 1.25rem; }
.section-narrow{ max-width: var(--maxw-read); margin: 0 auto; padding: 3rem 1.25rem; }
.section-heading{ text-align: center; margin-bottom: 2rem; }
.section-heading h2{ font-size: 1.9rem; }
.section-heading p{
  font-family: var(--font-sans);
  color: var(--ink-soft);
  max-width: 640px;
  margin: .6rem auto 0;
  font-size: 1.02rem;
}

/* =========================================================================
   Callout — pull-quote styled "reader tip" box
   ========================================================================= */
.callout{
  background: var(--paper);
  border-left: 6px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
  box-shadow: var(--shadow);
}
.callout-label{
  display: block;
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .78rem;
  font-weight: 700;
  color: var(--gold-ink);
  margin-bottom: .55rem;
}
.callout p{ font-size: 1.08rem; margin-bottom: 0; }
.callout p + p{ margin-top: .75rem; }

/* Notice variant — used for plainer legal/informational boxes */
.callout--notice{ border-left-color: var(--forest); }
.callout--notice .callout-label{ color: var(--forest); }

/* =========================================================================
   Topics grid — homepage evergreen category cards (not products/articles)
   ========================================================================= */
.topics-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0 0;
}
.topic-card{
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  text-align: center;
}
.topic-card h3{ font-size: 1.12rem; margin: 0 0 .4rem; }
.topic-card p{ font-family: var(--font-sans); font-size: .95rem; color: var(--ink-soft); margin: 0; }

/* =========================================================================
   Product grid / card
   ========================================================================= */
.product-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.75rem;
  margin: 0;
  min-height: 0; /* intentionally empty until the next build pass */
}
.product-card{
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.product-card-image{
  width: 100%;
  border-radius: calc(var(--radius) - 4px);
  margin-bottom: 1rem;
  background: var(--ivory);
}
.product-card-eyebrow{
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .74rem;
  font-weight: 700;
  color: var(--gold-ink);
  margin-bottom: .35rem;
}
.product-card-title{ font-size: 1.2rem; margin: 0 0 .5rem; }
.product-card-excerpt{ font-size: .98rem; color: var(--ink-soft); flex: 1 0 auto; }
.product-card .btn{ margin-top: 1rem; align-self: flex-start; }

/* =========================================================================
   Article grid / card
   ========================================================================= */
.article-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.75rem;
  margin: 0;
  min-height: 0; /* intentionally empty until the next build pass */
}
.article-card{
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.article-card-image{
  width: 100%;
  border-radius: calc(var(--radius) - 4px);
  margin-bottom: 1rem;
  background: var(--ivory);
}
.article-card-category{
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .74rem;
  font-weight: 700;
  color: var(--forest);
  margin-bottom: .35rem;
}
.article-card-title{ font-size: 1.2rem; margin: 0 0 .5rem; }
.article-card-excerpt{ font-size: .98rem; color: var(--ink-soft); flex: 1 0 auto; }
.article-card-meta{
  font-family: var(--font-sans);
  font-size: .85rem;
  color: var(--ink-soft);
  margin-top: 1rem;
  border-top: 1px solid var(--line);
  padding-top: .75rem;
}

/* =========================================================================
   Newsletter signup
   ========================================================================= */
.newsletter{
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2.25rem 2rem;
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
  box-shadow: var(--shadow);
}
.newsletter h2{ margin-top: 0; }
.newsletter p{ color: var(--ink-soft); }
.newsletter-form{
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1.4rem;
}
.newsletter-form input[type="email"]{
  flex: 1 1 260px;
  padding: .9rem 1.1rem;
  min-height: 48px;
  border: 2px solid var(--line);
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--ink);
  background: var(--ivory);
}
.newsletter-form input[type="email"]:focus-visible{
  outline: 3px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--forest);
}
.newsletter-hp{ position: absolute; left: -9999px; }
.newsletter-msg{
  margin-top: 1rem;
  font-family: var(--font-sans);
  font-size: .95rem;
  min-height: 1.3em;
}

/* =========================================================================
   Legal / long-form page content
   ========================================================================= */
.page-content{ max-width: var(--maxw-read); margin: 0 auto; padding: 2.5rem 1.25rem 4.5rem; }
.page-kicker{
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--gold-ink);
  font-size: .85rem;
  font-weight: 700;
  margin-bottom: .75rem;
}
.page-content h1{ font-size: 2.1rem; margin-bottom: .75rem; }
.page-meta{
  font-family: var(--font-sans);
  color: var(--ink-soft);
  font-size: .92rem;
  margin: 0 0 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}
.page-content h2{ margin-top: 2.25rem; }
.fineprint{ font-size: .95rem; color: var(--ink-soft); font-style: italic; }
.mono{ font-family: 'Courier New', monospace; font-size: .92em; }

.refs{
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-sans);
  font-size: .88rem;
  color: var(--ink-soft);
}

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer{ background: var(--forest-deep); color: #E7DFC8; padding: 3rem 1.25rem 1.5rem; margin-top: 3rem; }
.footer-inner{
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
}
.footer-name{ font-family: var(--font-serif); font-size: 1.5rem; font-weight: 700; color: #fff; }
.footer-tag{ margin-top: .6rem; font-size: .95rem; color: #C9C0AC; max-width: 320px; }
.footer-col h5{
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .8rem;
  color: var(--gold);
  margin: 0 0 .9rem;
}
.footer-col a{
  display: block;
  color: #E7DFC8;
  text-decoration: none;
  padding: .4rem 0;
  font-family: var(--font-sans);
  font-size: .95rem;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.footer-col a:hover{ color: var(--gold); text-decoration: underline; }
.footer-legal{
  max-width: var(--maxw);
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,.14);
  font-size: .8rem;
  color: #A79E89;
  font-family: var(--font-sans);
  letter-spacing: .01em;
}
@media (max-width: 720px){
  .footer-inner{ grid-template-columns: 1fr; }
}

/* =========================================================================
   Cookie consent banner
   ========================================================================= */
.cookie-banner{
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--forest-deep);
  color: #fff;
  padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 999;
  transform: translateY(110%);
  transition: transform .3s ease;
  box-shadow: 0 -4px 18px rgba(0,0,0,.25);
}
.cookie-banner.show{ transform: translateY(0); }
.cookie-banner-inner{
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.cookie-banner p{ margin: 0; font-family: var(--font-sans); font-size: .92rem; color: #EDE6D6; }
.cookie-banner a{ color: var(--gold); }
.cookie-banner-actions{ display: flex; gap: .75rem; flex-shrink: 0; }
.cookie-banner .btn{ padding: .6rem 1.3rem; min-height: 42px; font-size: .92rem; }

/* =========================================================================
   404
   ========================================================================= */
.not-found{ max-width: var(--maxw-read); margin: 0 auto; padding: 4rem 1.25rem 5rem; text-align: center; }
.not-found .page-kicker{ text-align: center; }
