/* Prapatti Online — Design System
   Palette: Cream #FDFAF4 | Ink #1C1410 | Gold #8B6914
   Fonts: Crimson Pro (serif) + DM Sans (sans)
*/

/* ── Reset & Base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 18px; scroll-behavior: smooth; }
html.font-lg { font-size: 20px; }
html.font-xl { font-size: 23px; }

body {
  background-color: #F5F1E8;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  color: #1C1410;
  font-family: 'DM Sans', sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: #8B6914; text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── Site Banner ──────────────────────────────────────── */
.site-banner {
  background: #f5edda;
  border-bottom: 1px solid #e8e0cc;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 1rem 1.25rem;
}

.banner-side {
  height: 120px;
  width: auto;
  object-fit: contain;
}

.banner-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.banner-thiruvadis {
  height: 80px;
  width: auto;
  object-fit: contain;
}

.banner-namah {
  font-family: 'Crimson Pro', serif;
  font-size: 1.2rem;
  color: #8B6914;
  letter-spacing: 0.03em;
}

@media (max-width: 680px) {
  .banner-side { height: 70px; }
  .banner-thiruvadis { height: 50px; }
  .banner-namah { font-size: 0.95rem; }
  .site-banner { gap: 1rem; padding: 0.75rem 1rem; }
}

/* ── Topbar ───────────────────────────────────────────── */
.topbar {
  background: #8B1914;
  color: #FDFAF4;
  text-align: center;
  padding: 0.4rem 1rem;
  font-family: 'Crimson Pro', serif;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

/* ── Nav ──────────────────────────────────────────────── */
.navbar, .nav-bar {
  background: #FDFAF4;
  border-bottom: 1px solid #e8e0cc;
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.6rem 1.25rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  max-width: 100%;
}

.nav-emblem { display: none; }

.nav-brand {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.1rem;
}

.nav-brand-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
}

.nav-subtitle {
  font-size: 0.7rem;
  color: #7a6a50;
}

.nav-title {
  font-family: 'Samarkan', 'Crimson Pro', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: #1C1410;
  white-space: nowrap;
  letter-spacing: 0.05em;
}

.nav-links {
  grid-column: 1;
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  align-items: center;
}

.nav-link {
  color: #1C1410;
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: background 0.15s;
}

.nav-link:hover, .nav-link.active {
  background: #f0e8d0;
  color: #8B6914;
  text-decoration: none;
}

.nav-right {
  grid-column: 3;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: flex-end;
}

.font-toggle {
  display: flex;
  gap: 2px;
}

.font-btn {
  background: none;
  border: 1px solid #c8bfa0;
  border-radius: 3px;
  padding: 0.15rem 0.4rem;
  font-size: 0.78rem;
  cursor: pointer;
  color: #5a4a35;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
}

.font-btn:hover, .font-btn.active {
  background: #8B6914;
  border-color: #8B6914;
  color: #fff;
}

.nav-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.nav-search input {
  border: 1px solid #c8bfa0;
  border-radius: 4px;
  padding: 0.3rem 0.7rem;
  font-size: 0.85rem;
  background: #fff;
  width: 200px;
  font-family: 'DM Sans', sans-serif;
}

.nav-search input:focus {
  outline: none;
  border-color: #8B6914;
}

/* ── Hero ─────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #f5edda 0%, #FDFAF4 100%);
  border-bottom: 1px solid #e8e0cc;
  padding: 3rem 0 2.5rem;
  text-align: center;
}

.hero-shloka {
  font-family: 'Crimson Pro', serif;
  font-size: 1.5rem;
  color: #8B6914;
  line-height: 1.8;
  margin-bottom: 1rem;
  font-style: italic;
}

.hero-title {
  font-family: 'Crimson Pro', serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: #1C1410;
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  color: #5a4a35;
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.script-selector {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.script-btn {
  background: none;
  border: 1px solid #c8bfa0;
  border-radius: 20px;
  padding: 0.25rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
  color: #5a4a35;
  transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
}

.script-btn:hover, .script-btn.active {
  background: #8B6914;
  border-color: #8B6914;
  color: #fff;
}

/* ── Event Banner ─────────────────────────────────────── */
.event-banner {
  background: #8B1914;
  color: #fff;
  text-align: center;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
}

.event-banner a { color: #ffd580; }
.event-banner a:hover { color: #fff; }

/* ── Welcome Strip ────────────────────────────────────── */
.welcome-strip {
  padding: 2rem 0;
  border-bottom: 1px solid #e8e0cc;
}

.welcome-strip p {
  font-family: 'Crimson Pro', serif;
  font-size: 1.1rem;
  color: #3a2e1e;
  line-height: 1.8;
}

/* ── Section Headings ─────────────────────────────────── */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.section-title {
  font-family: 'Crimson Pro', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1C1410;
}

.section-link {
  font-size: 0.85rem;
  color: #8B6914;
}

/* ── Major Works Grid ─────────────────────────────────── */
.works-section {
  padding: 2.5rem 0;
  border-bottom: 1px solid #e8e0cc;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.work-card {
  background: #fff;
  border: 1px solid #e8e0cc;
  border-radius: 8px;
  padding: 1.25rem 1rem;
  text-align: center;
  color: #1C1410;
  transition: box-shadow 0.2s, border-color 0.2s;
  display: block;
}

.work-card:hover {
  box-shadow: 0 4px 16px rgba(139,105,20,0.12);
  border-color: #8B6914;
  text-decoration: none;
}

.work-icon {
  font-family: 'Crimson Pro', serif;
  font-size: 1.8rem;
  color: #8B6914;
  margin-bottom: 0.5rem;
}

.work-name {
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.work-author {
  font-size: 0.78rem;
  color: #7a6a50;
  margin-bottom: 0.5rem;
}

.work-scripts {
  display: flex;
  justify-content: center;
  gap: 3px;
  flex-wrap: wrap;
}

.script-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e8e0cc;
  display: inline-block;
}

.script-dot.has { background: #8B6914; }

/* ── Updates Table ────────────────────────────────────── */
.updates-section {
  padding: 2.5rem 0;
  border-bottom: 1px solid #e8e0cc;
}

.table-responsive { overflow-x: auto; }

.updates-table, .stotra-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.updates-table th, .stotra-table th {
  background: #f0e8d0;
  color: #1C1410;
  font-weight: 600;
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 2px solid #c8bfa0;
  white-space: nowrap;
}

.updates-table td, .stotra-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #ede5d0;
  vertical-align: middle;
}

.updates-table tr:hover td, .stotra-table tr:hover td {
  background: #faf5e8;
}

.update-date { color: #7a6a50; white-space: nowrap; font-size: 0.82rem; }
.update-desc { color: #1C1410; }

.script-cell { text-align: center; padding: 0.4rem 0.3rem; }

.script-link {
  color: #8B6914;
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 3px;
  transition: background 0.15s;
}

.script-link:hover {
  background: #f0e8d0;
  text-decoration: none;
}

.script-th {
  text-align: center;
  font-size: 0.75rem;
  padding: 0.5rem 0.3rem;
}

/* ── Page Content ─────────────────────────────────────── */
.page-content {
  padding: 2.5rem 0 4rem;
}

.page-title {
  font-family: 'Crimson Pro', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: #1C1410;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e8e0cc;
}

/* ── Guestbook Strip ──────────────────────────────────── */
.guestbook-strip {
  background: #f5edda;
  padding: 2.5rem 0;
  border-bottom: 1px solid #e8e0cc;
  text-align: center;
}

.guestbook-strip blockquote {
  font-family: 'Crimson Pro', serif;
  font-size: 1.2rem;
  font-style: italic;
  color: #3a2e1e;
  margin-bottom: 1rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Donate Strip ─────────────────────────────────────── */
.donate-strip {
  padding: 2.5rem 0;
  border-bottom: 1px solid #e8e0cc;
  text-align: center;
}

.donate-strip h2 {
  font-family: 'Crimson Pro', serif;
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.donate-strip p {
  color: #5a4a35;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.donate-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.55rem 1.4rem;
  border-radius: 5px;
  font-size: 0.9rem;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
}

.btn-gold {
  background: #8B6914;
  color: #fff;
}

.btn-gold:hover {
  background: #7a5c10;
  color: #fff;
  text-decoration: none;
}

.btn-outline {
  background: none;
  border: 1px solid #8B6914;
  color: #8B6914;
}

.btn-outline:hover {
  background: #8B6914;
  color: #fff;
  text-decoration: none;
}

/* ── Footer ───────────────────────────────────────────── */
.footer, .site-footer {
  background: #8B1914;
  color: #c8bfa0;
  padding: 2rem 0;
  font-size: 0.85rem;
}

.footer-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  color: #c8bfa0;
  font-size: 0.85rem;
}

.footer-links a:hover { color: #fff; text-decoration: underline; }

.footer-contact-link {
  text-decoration: underline !important;
  color: #c8bfa0;
}

.footer-copy { color: #8a7a60; font-size: 0.8rem; text-align: center; }

/* ── Category / Stotras Pages ─────────────────────────── */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
  justify-items: center;
}

.category-card { text-align: center; width: 100%; }

.category-card {
  background: #fff;
  border: 1px solid #e8e0cc;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  display: block;
  color: #1C1410;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.category-card:hover {
  box-shadow: 0 3px 12px rgba(139,105,20,0.1);
  border-color: #8B6914;
  text-decoration: none;
}

.category-card h3 {
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.category-card .count {
  font-size: 0.78rem;
  color: #7a6a50;
}

/* ── Mobile Nav Toggle ────────────────────────────────── */
.nav-mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}

.nav-mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #1C1410;
  border-radius: 2px;
}

/* ── Search Results ───────────────────────────────────── */
.nav-search { position: relative; }

#search-results {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  width: 340px;
  background: #fff;
  border: 1px solid #e8e0cc;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  z-index: 200;
  max-height: 400px;
  overflow-y: auto;
}

.search-result-item {
  display: block;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid #f0e8d0;
  color: #1C1410;
  text-decoration: none;
}

.search-result-item:hover { background: #faf5e8; }

.search-result-title {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.search-result-sub {
  display: block;
  font-size: 0.75rem;
  color: #7a6a50;
}

.search-highlight-row td { background: #fef9c3 !important; }

.search-noresult {
  padding: 0.75rem 0.9rem;
  font-size: 0.85rem;
  color: #7a6a50;
}

/* ── Updates Accordion ────────────────────────────────── */
.updates-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.update-item {
  border: 1px solid #e8e0cc;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.update-header {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: #1C1410;
  transition: background 0.15s;
}

.update-header:hover { background: #faf5e8; }

.update-date-badge {
  font-size: 0.75rem;
  color: #fff;
  background: #8B6914;
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: center;
}

.update-desc-text {
  flex: 1;
  line-height: 1.5;
}

.update-chevron {
  flex-shrink: 0;
  font-size: 1rem;
  color: #8B6914;
  transition: transform 0.2s;
  align-self: center;
}

.update-header.open .update-chevron { transform: rotate(180deg); }

.update-links-panel {
  display: none;
  padding: 0.6rem 1rem 0.85rem;
  gap: 0.5rem;
  flex-wrap: wrap;
  border-top: 1px solid #f0e8d0;
}

.update-links-panel.open { display: flex; }

.update-script-btn {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border: 1px solid #8B6914;
  border-radius: 20px;
  font-size: 0.78rem;
  color: #8B6914;
  background: #fff;
  transition: all 0.15s;
  text-decoration: none;
}

.update-script-btn:hover {
  background: #8B6914;
  color: #fff;
  text-decoration: none;
}

/* ── Footer Brand ─────────────────────────────────────── */
.footer-brand {
  text-align: center;
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  border-top: 1px solid #e8e0cc;
  margin-top: 1rem;
}

.footer-brand span {
  font-family: 'Crimson Pro', serif;
  color: #7a6a50;
  font-size: 0.9rem;
}

.footer-brand span:first-child {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1C1410;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 900px) {
  .works-grid { grid-template-columns: repeat(2, 1fr); }
  .categories-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-search input { width: 130px; }
  .navbar, .nav-bar { grid-template-columns: 1fr auto 1fr; gap: 0.5rem; }
}

@media (max-width: 680px) {
  /* Nav: stack to brand top, links below, hide search */
  .navbar, .nav-bar {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    padding: 0.5rem 0.75rem;
    gap: 0.25rem;
  }
  .nav-brand { grid-column: 1; grid-row: 1; justify-content: center; }
  .nav-links { grid-column: 1; grid-row: 2; justify-content: center; flex-wrap: wrap; }
  .nav-search { display: none; }
  .nav-link { padding: 0.25rem 0.4rem; font-size: 0.8rem; }
  .nav-title { font-size: 1.3rem; }

  /* Banner */
  .banner-side { height: 60px; }
  .banner-thiruvadis { height: 45px; }
  .banner-namah { font-size: 0.85rem; }
  .site-banner { gap: 0.75rem; padding: 0.6rem 0.75rem; }

  /* Grids */
  .works-grid { grid-template-columns: repeat(2, 1fr); }
  .categories-grid { grid-template-columns: 1fr 1fr; }

  /* Updates accordion */
  .update-date-badge { font-size: 0.7rem; }
  .update-header { font-size: 0.85rem; padding: 0.7rem 0.75rem; }

  /* Stotra table — horizontal scroll */
  .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .stotra-table { font-size: 0.78rem; min-width: 600px; }

  /* Footer */
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; gap: 0.75rem; }
  .section-head { flex-direction: column; gap: 0.25rem; }
}
