/* ==========================================================================
   Golu Guide – 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 index.html and all 180 article pages.

   1. Tokens          7. Lead image + tagline    13. Library (index page)
   2. Base            8. Intro + section heads   14. CTA band
   3. Layout          9. Gallery + media         15. Footer
   4. Buttons        10. Article card + prose    16. Lightbox
   5. Header / nav   11. Related articles        17. Utilities + motion
   6. Hero           12. Breadcrumbs / byline
   ========================================================================== */

/* 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(--accent);
  color: var(--white);
  font-weight: 700;
  font-size: 1rem;
}
.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. Lead image + tagline -------------------------------------------------- */
.lead-media { position: relative; z-index: 1; margin-top: calc(-1 * clamp(1rem, 3vw, 2rem)); }
.lead-media .media__frame { aspect-ratio: 16 / 9; }

.tagline {
  max-width: 820px;
  margin: clamp(2.5rem, 6vw, 4rem) auto 0;
  padding-inline: var(--gutter);
  text-align: center;
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-weight: 600;
  line-height: 1.5;
  color: var(--accent);
}

/* 8. 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; }
}

/* 9. Gallery + media ------------------------------------------------------- */
.media {
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.media__frame { display: block; overflow: hidden; background: var(--mist); }
.media__frame img { width: 100%; height: 100%; object-fit: cover; }
.media figcaption { padding: 0.85rem 1.1rem 1rem; font-size: 0.92rem; line-height: 1.55; color: var(--muted); }

.gallery-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 900px) {
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.gallery-grid .media__frame { aspect-ratio: 4 / 3; }

.zoom-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.zoom-button img { transition: transform 0.4s; }
.zoom-button:hover img { transform: scale(1.03); }

/* 10. 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); }

/* 11. 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; }

/* 12. 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; }

/* 13. 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); }

/* 14. 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); }

/* 15. 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; }

/* 16. Lightbox ------------------------------------------------------------- */
.lightbox[hidden] { display: none; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(34, 45, 57, 0.92);
}
.lightbox__inner { display: grid; gap: 0.75rem; width: min(1200px, 96vw); }
.lightbox__bar { display: flex; justify-content: flex-end; gap: 0.5rem; }
.lightbox__bar .btn { padding: 0.5rem 1rem; }
.lightbox img {
  width: 100%;
  max-height: 82vh;
  object-fit: contain;
  background: var(--white);
  border-radius: var(--radius);
}

/* 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; }
}
