/* ═══════════════════════════════════════════════════════════════════════
   Land Of Devotion — Indian Festivals Deep Dive
   Design: Warm, scholarly, accessible. Anti-exoticizing.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --color-saffron: #d4843a;
  --color-saffron-light: #fdf0e0;
  --color-vermillion: #c44536;
  --color-indigo: #2d3a64;
  --color-indigo-light: #e8eaf2;
  --color-gold: #b8860b;
  --color-gold-light: #fef9e7;
  --color-green: #4a7c59;
  --color-green-light: #edf5ef;
  --color-slate: #4a4a4a;
  --color-cream: #faf7f2;
  --color-white: #ffffff;
  --color-gray-100: #f5f5f5;
  --color-gray-200: #e5e5e5;
  --color-gray-400: #999;
  --color-gray-600: #666;
  --color-gray-800: #333;

  --font-heading: 'Georgia', 'Times New Roman', serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Courier New', monospace;

  --max-width: 960px;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  --shadow-hover: 0 4px 12px rgba(0,0,0,.12);
}

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

html {
  font-size: 17px;
  line-height: 1.7;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  color: var(--color-slate);
  background: var(--color-cream);
}

/* ═══════════ TYPOGRAPHY ═══════════ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-indigo);
  line-height: 1.3;
  margin: 1.5em 0 .5em;
}
h1 { font-size: 2.2rem; }
h2 { font-size: 1.7rem; border-bottom: 2px solid var(--color-gray-200); padding-bottom:.3em; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; color: var(--color-gray-600); }

p { margin: 0 0 1em; }
a { color: var(--color-vermillion); text-decoration: none; }
a:hover { text-decoration: underline; }

blockquote {
  border-left: 4px solid var(--color-saffron);
  margin: 1.2em 0;
  padding: .6em 1.2em;
  background: var(--color-saffron-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--color-gray-800);
}
blockquote p:last-child { margin-bottom:0; }

code {
  font-family: var(--font-mono);
  background: var(--color-gray-100);
  padding: .1em .3em;
  border-radius: 3px;
  font-size: .9em;
}

/* ═══════════ LAYOUT ═══════════ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.2rem;
}

/* ═══════════ HEADER / NAV ═══════════ */
.site-header {
  background: var(--color-indigo);
  color: var(--color-white);
  padding: 1.2rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}
.site-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--color-white);
  text-decoration: none;
}
.site-title:hover { text-decoration: none; opacity: .9; }
.site-title span { color: var(--color-saffron); }

.site-nav { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.site-nav a {
  color: rgba(255,255,255,.8);
  font-size: .9rem;
  text-decoration: none;
  transition: color .2s;
}
.site-nav a:hover, .site-nav a.active { color: var(--color-saffron); }

/* ═══════════ HERO ═══════════ */
.hero {
  background: linear-gradient(135deg, var(--color-indigo) 0%, #1a2350 100%);
  color: var(--color-white);
  padding: 3rem 0;
  text-align: center;
}
.hero h1 { color: var(--color-white); font-size: 2.6rem; margin-top:0; border:none; }
.hero p { font-size: 1.15rem; max-width: 700px; margin: 1rem auto 0; opacity: .9; }

/* ═══════════ FESTIVAL GRID ═══════════ */
.festival-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.festival-card {
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
  display: flex;
  flex-direction: column;
}
.festival-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.festival-card-header {
  padding: 1.2rem 1.2rem .6rem;
  border-bottom: 3px solid var(--color-saffron-light);
}
.festival-card-header h3 {
  margin: 0 0 .2rem;
  font-size: 1.2rem;
}
.festival-card-header .local-name {
  font-size: .85rem;
  color: var(--color-gray-400);
  font-style: italic;
}
.festival-card-body {
  padding: .6rem 1.2rem 1.2rem;
  flex: 1;
  font-size: .9rem;
  color: var(--color-gray-600);
}
.festival-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .8rem;
}
.tag {
  font-size: .75rem;
  padding: .15em .6em;
  border-radius: 99px;
  background: var(--color-indigo-light);
  color: var(--color-indigo);
  white-space: nowrap;
}
.tag.hindu { background: #fff3e0; color: #e65100; }
.tag.muslim { background: #e8f5e9; color: #2e7d32; }
.tag.sikh { background: #fce4ec; color: #c62828; }
.tag.jain { background: #e0f7fa; color: #00838f; }
.tag.buddhist { background: #fff8e1; color: #f9a825; }
.tag.christian { background: #e8eaf6; color: #283593; }
.tag.secular { background: #f3e5f5; color: #6a1b9a; }
.tag.adivasi { background: #efebe9; color: #4e342e; }

/* ═══════════ FESTIVAL PAGE ═══════════ */
.festival-hero {
  background: var(--color-indigo);
  color: var(--color-white);
  padding: 2.5rem 0;
}
.festival-hero h1 {
  color: var(--color-white);
  font-size: 2.4rem;
  margin: 0;
  border: none;
}
.festival-hero .subtitle {
  font-size: 1.05rem;
  opacity: .85;
  margin-top: .4rem;
}
.festival-hero .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1rem;
  font-size: .9rem;
  opacity: .8;
}

.content-section {
  background: var(--color-white);
  padding: 2rem;
  margin: 1.5rem 0;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius);
}
.content-section h2 { margin-top: 0; }
.content-section h3 { color: var(--color-vermillion); }

.callout {
  background: var(--color-gold-light);
  border-left: 4px solid var(--color-gold);
  padding: 1rem 1.2rem;
  margin: 1.2em 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .95rem;
}

.fun-fact {
  background: var(--color-green-light);
  border-left: 4px solid var(--color-green);
  padding: 1rem 1.2rem;
  margin: 1.2em 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.fun-fact::before { content: "🎭  "; }

.artwork-ref {
  background: var(--color-gray-100);
  padding: .8rem 1rem;
  margin: .8em 0;
  border-radius: var(--radius);
  font-size: .9rem;
}
.artwork-ref::before { content: "🎨  "; }
.artwork-ref a { font-size: .85rem; }

.source-block {
  background: #fefefe;
  border: 1px dashed var(--color-gray-400);
  padding: 1rem 1.2rem;
  margin: 1em 0;
  border-radius: var(--radius);
  font-size: .9rem;
}
.source-block h4 { margin-top:0; color: var(--color-gray-600); }

.disputed {
  background: #fff8f0;
  border: 1px solid var(--color-saffron);
  padding: .8rem 1rem;
  margin: 1em 0;
  border-radius: var(--radius);
  font-size: .9rem;
}
.disputed::before { content: "⚠️  Disputed: "; font-weight: bold; color: var(--color-saffron); }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: .9rem;
}
th, td {
  padding: .6rem .8rem;
  border: 1px solid var(--color-gray-200);
  text-align: left;
}
th { background: var(--color-indigo-light); color: var(--color-indigo); font-weight: 600; }
tr:nth-child(even) { background: var(--color-gray-100); }

/* ═══════════ ABOUT PAGE ═══════════ */
.about-intro { font-size: 1.1rem; line-height: 1.8; }
.ethics-list { list-style: none; padding: 0; }
.ethics-list li {
  padding: .6rem 0 .6rem 2rem;
  position: relative;
  border-bottom: 1px solid var(--color-gray-200);
}
.ethics-list li::before {
  content: "✦";
  position: absolute;
  left: 0;
  color: var(--color-gold);
}

/* ═══════════ FOOTER ═══════════ */
.site-footer {
  background: var(--color-indigo);
  color: rgba(255,255,255,.7);
  padding: 2rem 0;
  margin-top: 3rem;
  text-align: center;
  font-size: .85rem;
}
.site-footer a { color: var(--color-saffron); }
.site-footer .footer-links { display:flex; justify-content:center; gap:1.5rem; flex-wrap:wrap; margin:1rem 0; }

/* ═══════════ BREADCRUMB ═══════════ */
.breadcrumb {
  font-size: .85rem;
  color: var(--color-gray-400);
  margin-bottom: 1rem;
}
.breadcrumb a { color: var(--color-gray-600); }

/* ═══════════ SEARCH ═══════════ */
.search-bar {
  margin: 1.5rem 0;
  display: flex;
  gap: .5rem;
}
.search-bar input {
  flex: 1;
  padding: .6rem 1rem;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font-body);
}
.search-bar input:focus { outline: 2px solid var(--color-saffron); border-color: transparent; }

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 700px) {
  html { font-size: 15px; }
  .festival-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.8rem; }
  .festival-hero h1 { font-size: 1.7rem; }
  .site-header .container { flex-direction: column; align-items: flex-start; }
  .content-section { padding: 1.2rem; }
  table { font-size: .8rem; }
}
/* ═══════════ DARK MODE ═══════════ */
@media (prefers-color-scheme: dark) {
  :root {
    --color-cream: #1a1a2e;
    --color-white: #16213e;
    --color-slate: #c8c8d0;
    --color-indigo: #8892b0;
    --color-indigo-light: #1a1a30;
    --color-saffron-light: #2a2018;
    --color-gold-light: #2a2418;
    --color-green-light: #1a2a1e;
    --color-gray-100: #1e1e30;
    --color-gray-200: #2a2a3e;
    --color-gray-400: #888;
    --color-gray-600: #aaa;
    --color-gray-800: #ddd;
    --shadow: 0 1px 3px rgba(0,0,0,.3);
    --shadow-hover: 0 4px 12px rgba(0,0,0,.4);
  }
  body { background: var(--color-cream); }
  .site-header { background: #0f0f23; }
  .hero { background: linear-gradient(135deg, #0f0f23 0%, #1a1a35 100%); }
  .festival-hero { background: #0f0f23; }
  .festival-card { background: #1a1a32; border-color: #2a2a3e; }
  .content-section { background: #1a1a32; border-color: #2a2a3e; }
  blockquote { background: #1a1a28; }
  table th { background: #1e1e35; }
  table tr:nth-child(even) { background: #1a1a28; }
  .callout { background: #1a1a28; }
  .fun-fact { background: #1a281e; }
  .source-block { background: #1a1a25; }
  .disputed { background: #281e18; }
  .artwork-ref { background: #1e1e2a; }
  input[type="text"], input[type="email"], textarea { background: #1a1a32; color: #ddd; border-color: #2a2a3e; }
}

/* ═══════════ GLOSSARY TOOLTIPS ═══════════ */
.glossary {
  border-bottom: 1px dotted var(--color-saffron);
  cursor: help;
  position: relative;
}
.glossary::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-indigo);
  color: #fff;
  padding: .4em .8em;
  border-radius: var(--radius);
  font-size: .82rem;
  font-style: normal;
  font-weight: normal;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  max-width: 280px;
  white-space: normal;
  text-align: center;
  line-height: 1.4;
}
.glossary:hover::after, .glossary:focus::after {
  opacity: 1;
}

/* ═══════════ RELATED FESTIVALS ═══════════ */
.related-festivals {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .8rem;
  margin-top: 1rem;
}
.related-festival-link {
  display: block;
  padding: .6rem .8rem;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius);
  font-size: .9rem;
  text-decoration: none;
  color: var(--color-indigo);
  background: var(--color-white);
  transition: border-color .2s, box-shadow .2s;
}
.related-festival-link:hover {
  border-color: var(--color-saffron);
  box-shadow: var(--shadow-hover);
  text-decoration: none;
}
.related-festival-link small {
  display: block;
  color: var(--color-gray-400);
  font-size: .8rem;
  margin-top: .1em;
}

/* ═══════════ READING TIME ═══════════ */
.reading-time {
  font-size: .85rem;
  color: var(--color-gray-400);
  font-style: italic;
}

/* ═══════════ DARK MODE TOGGLE BUTTON ═══════════ */
#dark-toggle {
  background: none;
  border: 1px solid rgba(255,255,255,.3);
  color: rgba(255,255,255,.8);
  padding: .3em .7em;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: .85rem;
  font-family: var(--font-body);
  margin-left: .5rem;
  transition: border-color .2s;
}
#dark-toggle:hover { border-color: var(--color-saffron); color: var(--color-saffron); }

/* ═══════════ FORM STYLES ═══════════ */
input[type="text"], input[type="email"], textarea, select {
  width: 100%;
  max-width: 500px;
  padding: .6rem .8rem;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: .95rem;
  margin: .3em 0 .8em;
  background: var(--color-white);
  color: var(--color-slate);
}
textarea { min-height: 120px; }
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--color-saffron);
  border-color: transparent;
}
.btn {
  display: inline-block;
  padding: .6rem 1.5rem;
  background: var(--color-indigo);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 1rem;
  text-decoration: none;
  transition: background .2s;
}
.btn:hover { background: var(--color-saffron); text-decoration: none; }

/* ═══════════ FOOD SECTION ═══════════ */
.food-table { width:100%; border-collapse:collapse; font-size:.9rem; margin:1em 0; }
.food-table td, .food-table th { padding:.5em .7em; border:1px solid var(--color-gray-200); vertical-align:top; }
.food-table td:first-child { font-weight:600; white-space:nowrap; color:var(--color-vermillion); }
.food-note { font-size:.85rem; color:var(--color-gray-400); font-style:italic; margin:.5em 0; }
.diet-tag { display:inline-block; font-size:.7rem; padding:.1em .5em; border-radius:99px; margin-right:.3em; }
.diet-tag.veg { background:#e8f5e9; color:#2e7d32; }
.diet-tag.nonveg { background:#fce4ec; color:#c62828; }
.diet-tag.fasting { background:#fff8e1; color:#f9a825; }
.diet-tag.contains-nuts { background:#f3e5f5; color:#6a1b9a; }
.diet-tag.gluten { background:#e3f2fd; color:#1565c0; }

.recipe-link { font-size:.85rem; display:inline-block; margin:.2em 0; }
.recipe-link a { color:var(--color-green); }
.disclaimer-box {
  background:var(--color-gray-100);
  border:1px dashed var(--color-gray-400);
  padding:.8rem 1rem;
  margin-top:1.5rem;
  border-radius:var(--radius);
  font-size:.82rem;
  color:var(--color-gray-600);
  line-height:1.6;
}
.disclaimer-box strong { color:var(--color-gray-800); }

/* ═══════════ ATTIRE SECTION ═══════════ */
.attire-table { width:100%; border-collapse:collapse; font-size:.9rem; margin:1em 0; }
.attire-table td, .attire-table th { padding:.5em .7em; border:1px solid var(--color-gray-200); vertical-align:top; }
.attire-table td:first-child { font-weight:600; white-space:nowrap; color:var(--color-indigo); }
.attire-note { font-size:.85rem; color:var(--color-gray-400); font-style:italic; margin:.5em 0; }
.fabric-tag { display:inline-block; font-size:.7rem; padding:.1em .5em; border-radius:99px; margin-right:.3em; }
.fabric-tag.silk { background:#fce4ec; color:#c62828; }
.fabric-tag.cotton { background:#e8f5e9; color:#2e7d32; }
.fabric-tag.gold { background:#fff8e1; color:#f9a825; }
.fabric-tag.wool { background:#e3f2fd; color:#1565c0; }
.fabric-tag.jewelry { background:#f3e5f5; color:#6a1b9a; }
.attire-ref { background:var(--color-gray-100); padding:.8rem 1rem; margin:.8em 0; border-radius:var(--radius); font-size:.9rem; }
.attire-ref::before { content:"👗  "; }
.attire-ref a { font-size:.85rem; }
.attire-evolution { background:var(--color-saffron-light); border-left:4px solid var(--color-saffron); padding:.8rem 1rem; margin:1em 0; border-radius:0 var(--radius) var(--radius) 0; font-size:.9rem; }

/* ═══════════ FORCE DARK MODE (toggle override) ═══════════ */
html.force-dark {
  --color-cream: #1a1a2e;
  --color-white: #16213e;
  --color-slate: #c8c8d0;
  --color-indigo: #8892b0;
  --color-indigo-light: #1a1a30;
  --color-saffron-light: #2a2018;
  --color-gold-light: #2a2418;
  --color-green-light: #1a2a1e;
  --color-gray-100: #1e1e30;
  --color-gray-200: #2a2a3e;
  --color-gray-400: #888;
  --color-gray-600: #aaa;
  --color-gray-800: #ddd;
  --shadow: 0 1px 3px rgba(0,0,0,.3);
  --shadow-hover: 0 4px 12px rgba(0,0,0,.4);
}
html.force-dark body { background: var(--color-cream); }
html.force-dark .site-header { background: #0f0f23; }
html.force-dark .hero { background: linear-gradient(135deg, #0f0f23 0%, #1a1a35 100%); }
html.force-dark .festival-hero { background: #0f0f23; }
html.force-dark .festival-card { background: #1a1a32; border-color: #2a2a3e; }
html.force-dark .content-section { background: #1a1a32; border-color: #2a2a3e; }
html.force-dark blockquote { background: #1a1a28; }
html.force-dark table th { background: #1e1e35; }
html.force-dark table tr:nth-child(even) { background: #1a1a28; }
html.force-dark .callout { background: #1a1a28; }
html.force-dark .fun-fact { background: #1a281e; }
html.force-dark .source-block { background: #1a1a25; }
html.force-dark .disputed { background: #281e18; }
html.force-dark .artwork-ref { background: #1e1e2a; }
html.force-dark input[type="text"], html.force-dark input[type="email"], html.force-dark textarea { background: #1a1a32; color: #ddd; border-color: #2a2a3e; }

/* ═══════════ PRINT BUTTON ═══════════ */
.print-btn {
  display: inline-block;
  margin-left: .5rem;
  padding: .2em .7em;
  font-size: .85rem;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius);
  background: var(--color-white);
  color: var(--color-gray-600);
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color .2s;
}
.print-btn:hover { border-color: var(--color-saffron); color: var(--color-saffron); }

/* ═══════════ BACK TO TOP ═══════════ */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--color-indigo);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  opacity: 0;
  transition: opacity .3s;
  z-index: 50;
  box-shadow: var(--shadow-hover);
}
.back-to-top.visible { opacity: 1; }
.back-to-top:hover { background: var(--color-saffron); }

@media print {
  .site-header, .site-footer, .hero, .back-to-top, #dark-toggle { display: none; }
  body { font-size: 11pt; background: #fff; color: #000; line-height: 1.5; }
  .container { max-width: 100%; padding: 0; }
  .content-section { break-inside: avoid; border: 1px solid #ccc; background: #fff; margin: .5cm 0; padding: .5cm; }
  .festival-hero { background: #fff; color: #000; padding: 1cm 0; text-align: left; }
  .festival-hero h1 { color: #000; font-size: 18pt; }
  .festival-card { break-inside: avoid; border: 1px solid #ccc; }
  table { font-size: 9pt; }
  th, td { padding: .2em .4em; }
  a { color: #000; text-decoration: underline; }
  a::after { content: " (" attr(href) ")"; font-size: 8pt; color: #666; }
  a[href^="#"]::after, a[href^="/"]::after { content: ""; }
  .fun-fact, .callout, .artwork-ref, .source-block { background: #f9f9f9; border-left: 2px solid #ccc; }
  blockquote { border-left: 3px solid #999; background: #f9f9f9; font-style: italic; }
  .tag { border: 1px solid #999; }
  .festival-grid { display: block; }
  .festival-card { margin-bottom: .3cm; }
  .breadcrumb { font-size: 8pt; }
  h1 { font-size: 16pt; margin: .3cm 0; }
  h2 { font-size: 13pt; border-bottom: 1px solid #ccc; }
  h3 { font-size: 11pt; }
  @page { margin: 1.5cm; }
}
