/* ==========================================================================
   Durga Puja guides – shared theme stylesheet
   Same design system as the Happy Deepawali theme (red accent, Poppins,
   white header, light festive hero, red CTA band, column footer).
   Used by the home page, 13 topic pages and 260 article pages.

     1. Tokens
     2. Base
     3. Layout
     4. Buttons
     5. Header / nav
     6. Hero
     7. Intro + section heads
     8. Article card + prose
     9. Related articles
     10. Breadcrumbs / byline
     11. Library (index page)
     12. CTA band
     13. Footer
     14. Article extras (content blocks used inside the guides)
     15. Topic cards (home + topic pages)
     16. Related-articles widget slot
     17. Utilities + motion
   ========================================================================== */

/* 1. Tokens ------------------------------------------------------------------- */
:root {
  --accent: #e13f4f;
  --accent-dark: #c02f3e;
  --ink: #222d39;
  --text: #535b69;
  --muted: #7a8190;
  --line: #ece8ea;
  --blush: #fef5f6;
  --mist: #f6f5fa;
  --cream: #fff8ef;
  --white: #ffffff;
  --gold: #f5a416;

  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Tamil", sans-serif;

  --container: 1180px;
  --measure: 720px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --section-y: clamp(3rem, 7vw, 5.5rem);
  --radius: 10px;
  --radius-lg: 18px;
  --shadow: 0 10px 30px rgba(34, 45, 57, 0.08);
  --header-h: 72px;
}

/* 2. Base --------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0 0 0.75rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.35rem); }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }

img { max-width: 100%; height: auto; display: block; }
figure { margin: 0; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

/* 3. Layout ------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--section-y); }
.section--mist { background: var(--mist); }

/* 4. Buttons ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.4rem;
  border: 2px solid transparent;
  border-radius: 999px;
  font: 600 0.95rem/1.2 var(--font);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn--primary { background: var(--accent); color: var(--white); }
.btn--primary:hover { background: var(--accent-dark); color: var(--white); }
.btn--ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn--ghost:hover { background: var(--ink); color: var(--white); }
.btn--light { background: var(--white); color: var(--accent); }
.btn--light:hover { background: var(--ink); color: var(--white); }

/* 5. Header / nav ------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 1rem;
}

.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); }
.brand:hover { color: var(--accent); }
.brand__mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--blush);
  border: 1px solid #f7d4d8;
  font-size: 1.3rem;
  line-height: 1;
}
.brand__name { font-weight: 700; font-size: 1.05rem; }

.menu { margin: 0; padding: 0; list-style: none; }
.menu ul { margin: 0; padding: 0; list-style: none; }
.menu > li > a,
.menu > li > .menu__parent {
  display: block;
  padding: 0.5rem 0;
  border: 0;
  background: none;
  font: 500 0.95rem var(--font);
  color: var(--ink);
  cursor: pointer;
}
.menu a:hover,
.menu__parent:hover { color: var(--accent); }
.menu .is-current > a,
.menu .is-current > .menu__parent { color: var(--accent); }

.submenu a {
  display: block;
  padding: 0.45rem 1.1rem;
  font-size: 0.92rem;
  color: var(--text);
}

@media (min-width: 1100px) {
  .nav-toggle { display: none; }
  .menu { display: flex; align-items: center; gap: 1.6rem; }
  .menu li { position: relative; }

  .has-sub > .menu__parent::after {
    content: "";
    display: inline-block;
    width: 0.4em;
    height: 0.4em;
    margin-left: 0.45em;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-0.2em) rotate(45deg);
  }

  .submenu {
    position: absolute;
    top: 100%;
    right: -1.1rem;
    min-width: 230px;
    padding: 0.5rem 0;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
  }
  .has-sub:hover > .submenu,
  .has-sub:focus-within > .submenu {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
}

@media (max-width: 1099.98px) {
  .nav-toggle {
    position: relative;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    cursor: pointer;
  }
  .nav-toggle__bar,
  .nav-toggle__bar::before,
  .nav-toggle__bar::after {
    position: absolute;
    left: 10px;
    width: 24px;
    height: 2px;
    background: var(--ink);
    transition: transform 0.2s;
  }
  .nav-toggle__bar { top: 21px; }
  .nav-toggle__bar::before,
  .nav-toggle__bar::after { content: ""; left: 0; }
  .nav-toggle__bar::before { top: -7px; }
  .nav-toggle__bar::after { top: 7px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar::before { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar::after { transform: translateY(-7px) rotate(-45deg); }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    padding: 0.5rem var(--gutter) 1.5rem;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  .js .site-nav:not(.is-open) { display: none; }

  .menu > li { border-bottom: 1px solid var(--line); }
  .menu > li > a,
  .menu > li > .menu__parent { padding: 0.8rem 0; width: 100%; text-align: left; }
  .submenu { padding: 0 0 0.6rem 1rem; }
  .submenu a { padding: 0.35rem 0; }
}

/* 6. Hero --------------------------------------------------------------------- */
.hero {
  position: relative;
  padding-block: clamp(3rem, 8vw, 5.5rem) clamp(2.5rem, 6vw, 4rem);
  background: linear-gradient(160deg, var(--cream) 0%, var(--white) 55%, var(--blush) 100%);
}
.hero__inner > * { max-width: 860px; }
.hero__title {
  font-size: clamp(2.1rem, 5vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}
.hero__lede { font-size: 1.1rem; max-width: 66ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

/* Library hero: title on one line, red sub line (matches Deepawali hero) */
.hero__title-sub { display: block; font-weight: 500; color: var(--accent); }

/* 7. Intro + section heads ---------------------------------------------------- */
.section-head {
  max-width: 780px;
  margin: 0 auto clamp(2rem, 5vw, 3rem);
  text-align: center;
}
.section-head p { font-size: 1.05rem; }
.intro .section-head { margin-bottom: 0; }
@media (max-width: 640px) {
  .section-head p { text-align: left; }
}

/* 8. Article card + prose ----------------------------------------------------- */
.article-card {
  max-width: 860px;
  margin-inline: auto;
  padding: clamp(1.5rem, 5vw, 3.5rem);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.article-card__head { margin-bottom: 1.75rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.article-card__head h2 { margin: 0; }

.prose { max-width: var(--measure); font-size: 1.05rem; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: clamp(1.3rem, 2.4vw, 1.6rem); margin: 2.25rem 0 0.75rem; }
.prose h3 { font-size: 1.12rem; margin: 1.75rem 0 0.5rem; }
.prose strong { color: var(--ink); }
.prose ul,
.prose ol { margin: 0 0 1.25rem; padding-left: 1.4rem; }
.prose li { margin-bottom: 0.4rem; }
.prose li::marker { color: var(--accent); }

/* 9. Related articles --------------------------------------------------------- */
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.link-tile {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  height: 100%;
  padding: 1.1rem 1.25rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.45;
  transition: border-color 0.2s, color 0.2s;
}
.link-tile:hover { border-color: var(--accent); color: var(--accent); }
.link-tile__num {
  flex: none;
  min-width: 2rem;
  font-weight: 700;
  color: var(--accent);
}
.section-foot { margin-top: 2rem; text-align: center; }

/* 10. Breadcrumbs / byline ---------------------------------------------------- */
.crumbs { margin-bottom: 1.25rem; font-size: 0.9rem; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }
.crumbs li + li::before { content: "/"; margin-right: 0.4rem; color: var(--muted); }
.crumbs a { color: var(--text); font-weight: 500; }
.crumbs a:hover { color: var(--accent); }
.crumbs [aria-current] { color: var(--accent); font-weight: 600; }

.byline { margin-top: 1rem; font-size: 0.95rem; color: var(--muted); }
.byline strong { color: var(--ink); font-weight: 600; }

/* 11. Library (index page) ---------------------------------------------------- */
.library-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
}
.library-jump a {
  display: inline-block;
  padding: 0.45rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
}
.library-jump a:hover { border-color: var(--accent); color: var(--accent); }

.wave + .wave { border-top: 1px solid var(--line); }
.wave:nth-of-type(even) { background: var(--mist); }
.wave__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 2rem; margin-bottom: 1.75rem; }
.wave__head h2 { margin: 0; }
.wave__head p { margin: 0; color: var(--muted); }

/* 12. CTA band ---------------------------------------------------------------- */
.cta { background: var(--accent); padding-block: clamp(2.5rem, 5vw, 3.5rem); }
.cta__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.cta h2 { margin: 0; max-width: 26ch; color: var(--white); font-weight: 600; font-size: clamp(1.5rem, 3.2vw, 2.25rem); }

/* 13. Footer ------------------------------------------------------------------ */
.site-footer { padding-top: clamp(3rem, 6vw, 4.5rem); background: var(--white); font-size: 0.95rem; }
.footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 2rem;
}
.footer-about { grid-column: span 2; max-width: 420px; }
@media (max-width: 640px) { .footer-about { grid-column: auto; } }
.footer-about .brand { margin-bottom: 1rem; }
.footer-col__title { margin-bottom: 1.1rem; font-size: 1.05rem; font-weight: 600; color: #3f4244; }
.footer-col ul { margin: 0; padding: 0; list-style: none; }
.footer-col li + li { margin-top: 0.35rem; }
.footer-col a { color: var(--text); }
.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--line);
  color: #000;
  font-weight: 500;
}
.footer-bottom p { margin: 0; }


/* 14. Article extras (content blocks used inside the guides) ------------------ */
.prose section + section { margin-top: 0.5rem; }
.prose a { font-weight: 600; text-decoration: underline; text-decoration-color: #f3b3ba; text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose blockquote { margin: 1.5rem 0; padding: 1rem 1.25rem; border-left: 4px solid var(--accent); background: var(--blush); border-radius: 0 var(--radius) var(--radius) 0; }
.prose .quick,
.prose .note,
.prose .warning { margin: 0 0 1.75rem; padding: 1.1rem 1.25rem; border-radius: var(--radius); border: 1px solid var(--line); }
.prose .quick { background: var(--cream); border-left: 4px solid var(--gold); }
.prose .note { background: #f1f9f4; border-left: 4px solid #2f9e62; }
.prose .warning { background: var(--blush); border-left: 4px solid var(--accent); }

.table-wrap { overflow-x: auto; margin: 1.5rem 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.97rem; }
.prose th { background: var(--mist); color: var(--ink); text-align: left; font-weight: 600; }
.prose th,
.prose td { padding: 0.7rem 0.85rem; border: 1px solid var(--line); vertical-align: top; }

.faq-list { display: grid; gap: 0.9rem; }
.faq-item { padding: 1.1rem 1.25rem; background: var(--mist); border-radius: var(--radius); }
.faq-item h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }

/* 15. Topic cards (home + topic pages) ---------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.topic-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.4rem 1.5rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--text);
  transition: border-color 0.2s;
}
.topic-card:hover { border-color: var(--accent); color: var(--text); }
.topic-card__title { margin: 0 0 0.5rem; font-size: 1.15rem; line-height: 1.35; color: var(--ink); }
.topic-card:hover .topic-card__title { color: var(--accent); }
.topic-card__text { margin: 0; font-size: 0.95rem; line-height: 1.65; }
.topic-card__meta { margin-top: auto; padding-top: 1rem; font-size: 0.88rem; font-weight: 600; color: var(--accent); }

.note-card { max-width: 860px; margin-inline: auto; padding: clamp(1.5rem, 4vw, 2.25rem); border-left: 4px solid var(--gold); background: var(--cream); border-radius: var(--radius-lg); }
.note-card h2 { font-size: 1.35rem; }

/* 16. Related-articles widget slot ------------------------------------------ */
.related-slot { padding-bottom: var(--section-y); }
.related-slot:has(> #related-articles-root:empty) { display: none; }

/* 17. Utilities + motion ------------------------------------------------------ */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 200;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--white);
  border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; color: var(--white); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after { transition: none !important; animation: none !important; }
}

/* Home page: 2027 date table inside the note card */
.note-card .prose { max-width: none; font-size: 1rem; }
.note-card .prose table { background: var(--white); }
