/* Astro for Beginners - article pages stylesheet
   Astro for Beginners official brand: Midnight Navy bg, Starlight Gold, Moon White. */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #081B3A;          /* Midnight Navy */
  --bg-elev: #0B1026;     /* Deep Space */
  --fg: #F7F7F5;          /* Moon White */
  --muted: #9AA7BD;
  --line: rgba(247,247,245,0.14);
  --gold: #D4AF37;        /* Starlight Gold */
  --gold-deep: #B8902E;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Inter", -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

article h1, article h2, article h3, .index-hero h1, .index-card h3 { font-family: var(--font-display); }

a { color: var(--gold); text-decoration: none; transition: opacity .15s; }
a:hover { opacity: .75; }

/* Top nav.
   Three-column grid so the brand sits flush left, the links column lives in
   the dead-centre of the viewport, and a balancing empty column on the
   right keeps the centre actually centred regardless of brand width. */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8,27,58,0.92);   /* Midnight Navy header */
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 14px 24px;
  font-size: 13px;
}
.topnav .brand { grid-column: 1; justify-self: start; }
.topnav .links { grid-column: 2; justify-self: center; }
/* Brand: top-left, gold, identical sizing to the SPA's .nav-logo. Logo
   icon sits to the LEFT of the brand text using inline-flex + gap so the
   image and the wordmark stay aligned at any viewport width. */
.topnav .brand {
  color: var(--gold);
  font-family: var(--font-display);   /* Cormorant Garamond wordmark */
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.topnav .brand-img {
  width: 36px;
  height: 36px;
  display: block;
  flex-shrink: 0;
}
.topnav .links { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.topnav .links a {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.15em;
  font-weight: 500;
}
.topnav .links a:hover { color: var(--fg); opacity: 1; }
.topnav .links a.active { color: var(--fg); }
.topnav .back { color: var(--muted); text-transform: uppercase; letter-spacing: 0.14em; font-size: 11px; }
.topnav .back:hover { color: var(--fg); opacity: 1; }

/* Article container */
article {
  max-width: 720px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}
article header { margin-bottom: 48px; }
article header .kicker {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gold);
  margin-bottom: 18px;
}
article h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin-bottom: 22px;
}
article header .lede {
  font-size: 21px;
  line-height: 1.5;
  color: var(--fg);
  font-weight: 300;
  margin-bottom: 24px;
}
article header .meta {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

article h2 {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin: 50px 0 18px;
}
article h3 {
  font-size: 18px;
  font-weight: 500;
  margin: 32px 0 12px;
  color: var(--fg);
}
article p { margin-bottom: 18px; color: rgba(255,255,255,0.88); }
article p strong { color: var(--fg); font-weight: 600; }
article ul, article ol { margin: 0 0 22px 22px; }
article li { margin-bottom: 8px; color: rgba(255,255,255,0.88); }

article .callout {
  background: var(--bg-elev);
  border-left: 3px solid var(--gold);
  padding: 18px 22px;
  margin: 28px 0;
  font-size: 15px;
  color: rgba(255,255,255,0.85);
}
article .callout strong { color: var(--gold); }

article .cta {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  padding: 28px;
  margin: 40px 0 8px;
  border-radius: 4px;
}
article .cta .cta-kicker {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gold);
  margin-bottom: 10px;
}

/* Footer */
footer.article-foot {
  border-top: 1px solid var(--line);
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}
footer.article-foot a { margin: 0 10px; }

/* Index/grid page */
.index-hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: 80px 24px 40px;
}
.index-hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 18px;
}
.index-hero .lede {
  max-width: 640px;
  font-size: 18px;
  color: rgba(255,255,255,0.8);
  font-weight: 300;
  line-height: 1.55;
}
.index-grid {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 24px 100px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.index-card {
  display: block;
  background: var(--bg);
  padding: 28px;
  text-decoration: none;
  color: inherit;
  transition: background .2s, transform .2s;
}
.index-card:hover {
  background: var(--bg-elev);
  opacity: 1;
  transform: translateY(-2px);
}
.index-card .num {
  display: block;
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.index-card h3 {
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.25;
  margin-bottom: 10px;
  color: var(--fg);
}
.index-card p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 14px;
}
.index-card .meta {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

/* Hamburger mobile nav */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  min-width: 44px;
  min-height: 44px;
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  align-items: center;
  justify-content: center;
  grid-column: 3;
  justify-self: end;
}
.hamburger-btn svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}
.nav-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(8,27,58,0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 200;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
}
.nav-overlay.open { display: flex; }
.nav-overlay a {
  color: var(--fg);
  text-transform: uppercase;
  font-size: 16px;
  letter-spacing: 0.2em;
  font-weight: 500;
  text-decoration: none;
  padding: 12px 20px;
}
.nav-overlay .close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--fg);
  font-size: 28px;
  cursor: pointer;
  padding: 10px;
  min-width: 44px;
  min-height: 44px;
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  article { padding: 32px 18px 60px; }
  article h1 { font-size: 2rem; word-break: break-word; overflow-wrap: break-word; }
  article header .lede { font-size: 18px; }
  .index-hero { padding: 48px 18px 32px; }
  .index-grid {
    padding: 24px 18px 60px;
    background: none;
    border: none;
    gap: 16px;
  }
  .index-card {
    border: 1px solid var(--line);
    border-radius: 4px;
  }
  .topnav {
    padding: 12px 16px;
    grid-template-columns: 1fr auto;
  }
  .topnav .links { display: none; }
  .hamburger-btn { display: flex; }

  /* Blockquotes: full width on mobile */
  article blockquote,
  article .callout {
    margin-left: 0;
    margin-right: 0;
    padding: 16px 18px;
  }

  /* Editor's pick callout: distinct styling */
  article .callout {
    border-left-width: 3px;
    background: rgba(11, 16, 38, 0.8);
    border-radius: 0 4px 4px 0;
  }

  /* Section spacing */
  article h2 { margin: 40px 0 16px; font-size: 22px; }
  article h3 { margin: 28px 0 10px; font-size: 17px; }

  /* Tap targets */
  .topnav .back {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 8px 0;
  }
  footer.article-foot a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 8px 4px;
  }
}
