/* =========================================================
   GAade — Premium Plum & Gold Design System
   File: style.css
   ========================================================= */

/* 1. DESIGN TOKENS */
:root {
  color-scheme: dark;

  --bg: #0B0511;
  --bg-soft: #12081A;
  --card: #180D22;
  --card-hover: #21122D;

  --gold: #E9BC63;
  --gold-light: #F8DFA6;
  --rose: #B3316B;
  --cream: #F7F0E4;

  --text: #F7F0E4;
  --text-light: #C8B9CD;
  --muted: #9988A2;

  --border: rgba(233, 188, 99, 0.20);
  --border-strong: rgba(233, 188, 99, 0.42);

  --shadow-card: 0 12px 35px rgba(0, 0, 0, 0.24);
  --shadow-gold: 0 5px 22px rgba(233, 188, 99, 0.12);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --content-width: 1120px;
  --header-height: 78px;

  --font-kn: "Anek Kannada", sans-serif;
  --font-brand: "Caveat", cursive;

  --ease: 180ms ease;
}

/* 2. RESET AND BASE */

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

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: clip;
  background:
    radial-gradient(
      ellipse at 50% -15%,
      rgba(179, 49, 107, 0.15),
      transparent 48%
    ),
    var(--bg);
  color: var(--text);
  font-family: var(--font-kn);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

a {
  color: var(--gold-light);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

img,
video,
canvas,
svg {
  max-width: 100%;
}

img {
  height: auto;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--gold);
  color: var(--bg);
}

/* 3. HEADER */

.main-header {
  position: sticky;
  z-index: 100;
  top: 0;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  align-items: center;
  width: 100%;
  min-height: var(--header-height);
  padding: 10px max(16px, env(safe-area-inset-right))
    10px max(16px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--border);
  background: rgba(11, 5, 17, 0.94);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14);
}

@supports (backdrop-filter: blur(12px)) {
  .main-header {
    background: rgba(11, 5, 17, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
}

.menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--gold);
  font-size: 23px;
  cursor: pointer;
  transition:
    background var(--ease),
    border-color var(--ease);
}

.menu-btn:hover {
  border-color: var(--gold);
  background: var(--card-hover);
}

.header-center-title {
  min-width: 0;
  text-align: center;
}

.header-center-title h1 {
  margin: 0;
  color: var(--gold);
  font-size: clamp(1.65rem, 4vw, 2.15rem);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.tagline {
  margin-top: 2px;
  color: var(--text-light);
  font-size: 0.85rem;
  line-height: 1.45;
}

/* 4. NAVIGATION DRAWER */

.drawer-overlay {
  position: fixed;
  z-index: 199;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 220ms ease,
    visibility 220ms ease;
}

.drawer-overlay.open,
.drawer-overlay.active,
.drawer-overlay.show {
  opacity: 1;
  visibility: visible;
}

.nav-drawer {
  position: fixed;
  z-index: 200;
  inset-block: 0;
  inset-inline-start: 0;
  width: min(320px, 88vw);
  height: 100vh;
  height: 100dvh;
  padding: 26px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-inline-end: 1px solid var(--border);
  background: var(--bg-soft);
  box-shadow: 16px 0 45px rgba(0, 0, 0, 0.3);
  transform: translateX(-105%);
  visibility: hidden;
  transition:
    transform 240ms ease,
    visibility 240ms ease;
}

.nav-drawer.open,
.nav-drawer.active,
.nav-drawer.show {
  transform: translateX(0);
  visibility: visible;
}

.nav-drawer h2 {
  margin: 0 0 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--gold);
  font-size: 1.3rem;
}

.nav-link {
  display: flex;
  align-items: center;
  min-height: 48px;
  margin-bottom: 8px;
  padding: 10px 13px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  transition:
    background var(--ease),
    border-color var(--ease);
}

.nav-link:hover,
.nav-link:focus-visible {
  border-color: var(--border);
  background: var(--card);
}

/* 5. MAIN CONTENT */

.main-content-wrapper {
  width: min(100% - 32px, var(--content-width));
  min-height: 60vh;
  margin-inline: auto;
  padding-block: 24px 40px;
}

.view-panel {
  display: none;
  width: 100%;
  min-width: 0;
}

.view-panel.active {
  display: block;
  animation: view-enter 220ms ease both;
}

@keyframes view-enter {
  from {
    opacity: 0.75;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 6. SCROLL MODE AND SEARCH */

.scroll-mode-selector {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 20px;
}

.mode-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 44px;
  padding: 8px 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--text-light);
  cursor: pointer;
  transition:
    background var(--ease),
    color var(--ease),
    border-color var(--ease);
}

.mode-btn.active {
  border-color: var(--gold);
  background: rgba(233, 188, 99, 0.12);
  color: var(--gold);
}

.search-wrapper {
  width: 100%;
  max-width: 700px;
  min-height: 58px;
  margin: 0 auto 24px;
}

.search-wrapper input {
  display: block;
  width: 100%;
  min-height: 54px;
  padding: 13px 17px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
  transition:
    border-color var(--ease),
    box-shadow var(--ease);
}

.search-wrapper input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.search-wrapper input:focus {
  border-color: var(--gold);
  outline: none;
  box-shadow: 0 0 0 3px rgba(233, 188, 99, 0.12);
}

/* 7. PROVERB GRID */

.proverbs-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 18px;
  width: 100%;
  min-width: 0;
}

.proverbs-grid.vertical-mode {
  grid-template-columns: minmax(0, 1fr);
}

.proverbs-grid.horizontal-mode {
  display: flex;
  align-items: stretch;
  gap: 16px;
  padding: 4px 2px 16px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
}

.proverbs-grid.horizontal-mode > * {
  flex: 0 0 min(86%, 360px);
  min-width: 0;
  scroll-snap-align: start;
}

/* Common selectors for proverb cards generated by JavaScript.
   Keep these generic so existing card HTML remains usable. */

.proverb-card,
.proverb-item,
.gaade-card,
.card {
  min-width: 0;
  overflow-wrap: anywhere;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.025),
      transparent 60%
    ),
    var(--card);
  box-shadow: var(--shadow-card);
  transition:
    border-color var(--ease),
    background var(--ease),
    box-shadow var(--ease);
}

.proverb-card:hover,
.proverb-item:hover,
.gaade-card:hover,
.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card), var(--shadow-gold);
}

.proverb-card h2,
.proverb-card h3,
.proverb-item h2,
.proverb-item h3,
.gaade-card h2,
.gaade-card h3 {
  color: var(--gold-light);
  line-height: 1.55;
}

.proverb-card p,
.proverb-item p,
.gaade-card p {
  color: var(--text-light);
  line-height: 1.8;
}

.proverb-card button,
.proverb-item button,
.gaade-card button {
  max-width: 100%;
}

/* 8. LOADING AND EMPTY STATES */

#loader {
  display: block;
  min-height: 84px;
  padding: 24px 14px;
  color: var(--text-light);
  text-align: center;
}

#loader:empty {
  display: none;
}

.empty-state,
.no-results,
.error-message {
  padding: 26px 18px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--text-light);
  text-align: center;
}

/* 9. COMMON BUTTONS */

.theme-trigger-btn,
.subscription-panel button,
.privacy-consent button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 18px;
  border: 1px solid var(--gold);
  border-radius: 12px;
  background: var(--gold);
  color: #1B0D18;
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
  cursor: pointer;
  transition:
    background var(--ease),
    border-color var(--ease),
    transform var(--ease);
}

.theme-trigger-btn:hover,
.subscription-panel button:hover,
.privacy-consent button:hover {
  border-color: var(--gold-light);
  background: var(--gold-light);
}

.theme-trigger-btn:active,
.subscription-panel button:active,
.privacy-consent button:active {
  transform: translateY(1px);
}

#loadMoreBtn {
  max-width: 100%;
}

/* 10. PREFACE, QUIZ, BADGE AND CONTACT */

.inner-view-card,
.quiz-card,
.badge-display {
  width: 100%;
  min-width: 0;
  padding: clamp(18px, 4vw, 30px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-card);
}

.inner-view-card h2,
.quiz-card h2,
.badge-display h2 {
  color: var(--gold);
  line-height: 1.5;
}

.inner-view-card p,
.quiz-card p,
.badge-display p {
  overflow-wrap: anywhere;
}

.dedication-img-card {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 180px;
  margin-block: 20px;
  padding: 20px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  color: var(--text-light);
  text-align: center;
}

.quiz-header-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--gold);
  font-weight: 700;
}

#quiz-options-wrapper {
  display: grid;
  gap: 12px;
}

#quiz-options-wrapper button {
  width: 100%;
  min-height: 48px;
  padding: 12px 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-soft);
  color: var(--text);
  text-align: start;
  cursor: pointer;
}

#quiz-options-wrapper button:hover {
  border-color: var(--gold);
  background: var(--card-hover);
}

.badge-display {
  text-align: center;
}

.badge-icon {
  margin-bottom: 8px;
  font-size: clamp(3rem, 12vw, 5rem);
  line-height: 1.3;
}

.contact-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  color: var(--gold-light);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.contact-item span {
  color: var(--text-light);
  font-weight: 400;
}

.donation-box {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-soft);
}

/* 11. BRANDING BANNER */

.branding-banner {
  width: 100%;
  min-width: 0;
  margin-top: 30px;
}

.smart-banner {
  position: relative;
  min-height: 150px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(
      circle at 15% 50%,
      rgba(233, 188, 99, 0.12),
      transparent 38%
    ),
    linear-gradient(125deg, #180D22, #28102A);
}

.banner-wrap {
  width: 100%;
  min-height: 150px;
  padding: 20px;
}

.banner-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 108px;
}

.left-area,
.center-area,
.right-area {
  min-width: 0;
  text-align: center;
}

.main-logo {
  color: var(--gold);
  font-size: clamp(1.5rem, 5vw, 2.3rem);
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.sub-logo,
.brand-tag {
  color: var(--text-light);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  overflow-wrap: anywhere;
}

.brand-tag {
  color: var(--gold);
}

.typewriter {
  min-height: 30px;
  margin-top: 6px;
  color: var(--cream);
  overflow-wrap: anywhere;
}

.cursor {
  color: var(--gold);
}

.right-area {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.banner-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: rgba(11, 5, 17, 0.45);
  color: var(--gold-light);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.banner-btn:hover {
  background: rgba(233, 188, 99, 0.12);
}

/* 12. RSS TICKER */

#rss-ticker-container {
  width: 100%;
  min-height: 42px;
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}

#rss-ticker {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 7px 16px;
  color: var(--gold-light);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* 13. FOOTER */

.fixed-footer {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 76px;
  padding: 16px 18px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: #09040D;
  color: var(--text-light);
  text-align: center;
}

.fixed-footer p {
  margin: 0 0 4px;
  font-size: 0.86rem;
}

.gold-url-footer {
  color: var(--gold);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

/* 14. NEWSLETTER SUBSCRIPTION */

.subscription-panel {
  width: min(100% - 32px, 760px);
  margin: 24px auto;
  padding: clamp(18px, 4vw, 28px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(
      ellipse at top right,
      rgba(179, 49, 107, 0.12),
      transparent 55%
    ),
    var(--card);
  box-shadow: var(--shadow-card);
}

.subscription-panel h2 {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: clamp(1.35rem, 4vw, 1.8rem);
  line-height: 1.45;
}

.subscription-panel > p,
.push-consent-row p {
  color: var(--text-light);
}

#newsletterForm {
  display: grid;
  gap: 11px;
  margin-top: 18px;
}

#newsletterForm label {
  color: var(--cream);
  font-weight: 700;
}

#newsletterEmail {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
}

#newsletterEmail:focus {
  border-color: var(--gold);
  outline: 2px solid rgba(233, 188, 99, 0.15);
}

.consent-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.94rem;
  font-weight: 400 !important;
}

.consent-choice input {
  flex: 0 0 19px;
  width: 19px;
  height: 19px;
  margin-top: 4px;
  accent-color: var(--gold);
}

#newsletterForm button,
#enablePushButton {
  width: 100%;
}

#newsletterStatus {
  min-height: 24px;
  margin: 0;
  color: var(--gold-light);
  overflow-wrap: anywhere;
}

.push-consent-row {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.push-consent-row p {
  margin-top: 0;
}

/* 15. PRIVACY CONSENT PANEL */

.privacy-consent {
  position: fixed;
  z-index: 500;
  inset-inline: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  width: auto;
  max-width: 720px;
  max-height: min(80vh, 560px);
  max-height: min(80dvh, 560px);
  margin-inline: auto;
  padding: 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: #160B20;
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.5);
}

.privacy-consent h2 {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 1.15rem;
  line-height: 1.5;
}

.privacy-consent p {
  margin: 0;
  color: var(--text-light);
  font-size: 0.94rem;
}

.privacy-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.privacy-consent-actions button {
  flex: 1 1 145px;
  min-width: 0;
  padding-inline: 12px;
  font-size: 0.9rem;
}

#essentialOnlyButton {
  border-color: var(--border-strong);
  background: var(--bg-soft);
  color: var(--cream);
}

#essentialOnlyButton:hover {
  border-color: var(--gold);
  background: var(--card-hover);
}

#openSubscriptionButton {
  border-color: var(--rose);
  background: var(--rose);
  color: #fff;
}

/* 16. RESPONSIVE LAYOUT */

@media (min-width: 600px) {
  .main-content-wrapper {
    width: min(100% - 48px, var(--content-width));
    padding-top: 32px;
  }

  .proverbs-grid.vertical-mode {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .banner-inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  }

  .left-area {
    text-align: start;
  }

  .center-area,
  .right-area {
    grid-column: 1 / -1;
  }

  .right-area {
    justify-content: flex-start;
  }
}

@media (min-width: 900px) {
  .proverbs-grid.vertical-mode {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
  }

  .banner-inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto;
    gap: 24px;
  }

  .left-area,
  .center-area {
    text-align: start;
  }

  .center-area,
  .right-area {
    grid-column: auto;
  }

  .right-area {
    justify-content: flex-end;
  }

  .privacy-consent {
    inset-inline-start: auto;
    right: 20px;
    bottom: calc(20px + env(safe-area-inset-bottom));
    margin-inline: 0;
  }
}

@media (max-width: 420px) {
  :root {
    --header-height: 72px;
  }

  .main-content-wrapper {
    width: calc(100% - 22px);
    padding-top: 18px;
  }

  .main-header {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    padding-inline: 11px;
  }

  .menu-btn {
    width: 40px;
    height: 40px;
  }

  .tagline {
    font-size: 0.78rem;
  }

  .subscription-panel {
    width: calc(100% - 22px);
  }

  .banner-wrap {
    padding: 16px;
  }
}

/* 17. REDUCED MOTION ACCESSIBILITY */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 18. PRINT */

@media print {
  body {
    background: #fff;
    color: #111;
  }

  .main-header,
  .nav-drawer,
  .drawer-overlay,
  .scroll-mode-selector,
  .search-wrapper,
  .branding-banner,
  #rss-ticker-container,
  .fixed-footer,
  .privacy-consent,
  .subscription-panel {
    display: none !important;
  }

  .main-content-wrapper {
    width: 100%;
    padding: 0;
  }

  .view-panel {
    display: none !important;
  }

  #home-view.view-panel.active,
  #favorites-view.view-panel.active {
    display: block !important;
  }

  .proverb-card,
  .proverb-item,
  .gaade-card,
  .card {
    break-inside: avoid;
    box-shadow: none;
  }
}