/* Astroloje v3 "diya-lit" design layer. Opt-in: applies only under body.v3.
   Themes: Haldi (light, default) and Sandhya (dusk, body.dark-mode). Scoped so untouched pages are unaffected. */

body.v3 {
  --v3-kesari: #E8710A;
  --v3-kumkum: #B3261E;
  --v3-brass: #B8860B;
  --v3-marigold: #F5A524;
  --v3-glow: rgba(232, 113, 10, 0.18);
  --v3-shadow: rgba(120, 70, 20, 0.14);
  --font-display: 'Tiro Devanagari Hindi', 'Noto Serif', Georgia, serif;
  --font-primary: 'Inter', 'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --bg-primary: #FBF3E2;
  --bg-secondary: #FFF9EC;
  --bg-elevated: #FFF9EC;
  --bg-subtle: #F6E9CF;
  --text-primary: #3A2A1C;
  --text-secondary: #62503C;
  --text-tertiary: #62503C;
  --border: #E7D3AA;
  --border-light: #E7D3AA;
  --color-link: #9C3B0B;
  background: var(--bg-primary);
  color: var(--text-primary);
}

body.v3.dark-mode {
  --v3-glow: rgba(255, 154, 46, 0.22);
  --v3-shadow: rgba(0, 0, 0, 0.45);
  --bg-primary: #1E1410;
  --bg-secondary: #26190F;
  --bg-elevated: #2A1D16;
  --bg-subtle: #33241B;
  --text-primary: #F6E8CF;
  --text-secondary: #D9C6A4;
  --text-tertiary: #D9C6A4;
  --border: #4A3526;
  --border-light: #4A3526;
  --color-link: #FFB366;
  --bg-primary-dark: #1E1410;
  --bg-secondary-dark: #26190F;
  --bg-elevated-dark: #2A1D16;
  --bg-subtle-dark: #33241B;
}

body.v3 :lang(hi),
body.v3 [lang="hi"] { font-family: 'Noto Sans Devanagari', var(--font-primary); line-height: 1.75; }

/* ---- Festival hero ---- */
.fest-hero {
  position: relative;
  display: grid;
  align-items: end;
  min-height: clamp(440px, 48vw, 600px);
  border-radius: 20px;
  overflow: hidden;
  color: #FFF3D6;
  background: #1E1745;
  box-shadow: 0 18px 48px var(--v3-shadow);
  isolation: isolate;
}
.fest-hero__art { position: absolute; inset: 0; z-index: -2; }
.fest-hero__art img { width: 100%; height: 100%; object-fit: cover; object-position: 100% 38%; display: block; }
.fest-hero__veil {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(18, 11, 38, 0.9) 0%, rgba(18, 11, 38, 0.72) 30%, rgba(18, 11, 38, 0.25) 46%, rgba(18, 11, 38, 0) 56%);
}
.fest-hero__copy { max-width: min(460px, 100%); padding: clamp(20px, 4vw, 48px); }
.fest-hero__subtitle { max-width: 360px; }
.fest-hero + .seo-section { margin-top: 44px; }
@media (min-width: 901px) {
  .fest-hero { width: min(1120px, calc(100vw - 48px)); left: 50%; transform: translateX(-50%); }
}
.fest-hero__kicker { font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase; color: #FFD76A; margin: 0 0 6px; }
.fest-hero__native { font-family: var(--font-display); font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1.15; margin: 0; color: #FFE9A8; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45); }
.fest-hero__h1 { font-family: var(--font-display); font-size: clamp(1.35rem, 3vw, 1.9rem); font-weight: 400; margin: 4px 0 8px; color: #FFF3D6; }
.fest-hero__subtitle { font-size: 0.9375rem; line-height: 1.5; margin: 0 0 12px; color: #F3E3C4; }
.fest-hero__feeling { font-size: 1.0625rem; font-style: italic; margin: 0 0 2px; color: #FFE9A8; }
.fest-hero__feeling--hi { font-style: normal; margin-bottom: 14px; }
.fest-hero__facts { display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 0 18px; }
.fest-hero__count, .fest-hero__date {
  display: flex; flex-direction: column; padding: 8px 14px; border-radius: 12px;
  background: rgba(255, 233, 168, 0.12); border: 1px solid rgba(255, 215, 106, 0.45); backdrop-filter: blur(6px);
}
.fest-hero__count-num { font-family: var(--font-display); font-size: 2rem; line-height: 1; color: #FFD76A; font-variant-numeric: tabular-nums; }
.fest-hero__count-text, .fest-hero__date-label { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: #F3E3C4; }
.fest-hero__date-value { font-size: 1rem; font-weight: 600; color: #FFF3D6; }
.fest-hero__actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---- Buttons (tactile) ---- */
.fest-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 20px;
  border-radius: 12px; font-weight: 600; font-size: 0.9375rem; text-decoration: none; cursor: pointer;
  transition: transform 0.14s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.14s, filter 0.14s;
}
.fest-btn--brass {
  color: #2B1A06; background: linear-gradient(180deg, #FFD76A 0%, #F5A524 55%, #E8710A 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 1px 0 #8A5E0B, 0 8px 18px rgba(232, 113, 10, 0.35);
}
.fest-btn--brass:hover { transform: translateY(-1px); filter: brightness(1.05); }
.fest-btn--brass:active { transform: translateY(1px) scale(0.98); box-shadow: inset 0 2px 4px rgba(120, 60, 0, 0.35); }
.fest-btn--ghost { color: #FFF3D6; background: rgba(255, 243, 214, 0.08); border: 1px solid rgba(255, 215, 106, 0.55); }
.fest-btn--ghost:hover { background: rgba(255, 243, 214, 0.16); }
.fest-btn--ghost:active { transform: translateY(1px) scale(0.98); }
.fest-btn:focus-visible, .fest-tabs button:focus-visible { outline: 3px solid #FFD76A; outline-offset: 3px; }

/* ---- Emotional layer ---- */
.fest-tabs { display: inline-flex; gap: 4px; padding: 4px; margin: 6px 0 16px; border-radius: 999px; background: var(--bg-subtle); border: 1px solid var(--border); }
.fest-tabs[hidden] { display: none; }
.fest-tabs button {
  min-height: 40px; padding: 6px 16px; border: 0; border-radius: 999px; background: transparent; color: var(--text-secondary);
  display: inline-flex; align-items: center; line-height: 1.2; font: inherit; font-weight: 600; cursor: pointer; transition: background 0.14s, color 0.14s, transform 0.14s;
}
.fest-tabs button[aria-selected="true"] { background: linear-gradient(180deg, #FFD76A, #F5A524); color: #2B1A06; box-shadow: 0 2px 6px var(--v3-shadow); }
.fest-tabs button:active { transform: scale(0.97); }
.fest-panel[hidden] { display: none; }
.fest-panel + .fest-panel { margin-top: 20px; }
.fest-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.fest-card {
  background: var(--bg-elevated); border: 1px solid var(--border); border-top: 3px solid var(--v3-brass);
  border-radius: 14px; padding: 20px; box-shadow: 0 8px 24px var(--v3-shadow);
}
.fest-card h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.2rem; margin: 0 0 8px; color: var(--text-primary); }
.fest-card p { margin: 0 0 12px; line-height: 1.7; color: var(--text-secondary); }
.fest-card--sankalp { background: linear-gradient(180deg, var(--bg-elevated), var(--bg-subtle)); border-top-color: var(--v3-kumkum); }
.fest-card--sankalp .fest-btn { margin-top: 4px; }
.fest-note { margin-top: 14px; font-size: 0.8125rem; color: var(--text-secondary); }

/* ---- Existing sections, re-skinned under v3 ---- */
body.v3-festival .seo-section__title {
  font-family: var(--font-display); font-weight: 400; border-bottom: 0; position: relative; padding-bottom: 16px; color: var(--text-primary);
}
body.v3-festival .seo-section__title::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 144px; height: 10px;
  background: radial-gradient(circle at 5px 5px, var(--v3-marigold) 3.2px, transparent 3.7px) 0 0 / 16px 10px repeat-x;
}
body.v3-festival .seo-stat-card, body.v3-festival .seo-life-card, body.v3-festival .seo-summary-card, body.v3-festival .seo-related-card {
  background: var(--bg-elevated); border-color: var(--border); box-shadow: 0 6px 18px var(--v3-shadow);
}
body.v3-festival .seo-stat-card--accent { background: var(--bg-subtle); }

/* ---- Motion (decorative only; off for reduced motion) ---- */
@keyframes festRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .fest-hero__copy > * { animation: festRise 0.6s both cubic-bezier(0.2, 0.8, 0.2, 1); }
  .fest-hero__copy > *:nth-child(2) { animation-delay: 0.06s; }
  .fest-hero__copy > *:nth-child(3) { animation-delay: 0.12s; }
  .fest-hero__copy > *:nth-child(4) { animation-delay: 0.18s; }
  .fest-hero__copy > *:nth-child(5) { animation-delay: 0.24s; }
  .fest-hero__copy > *:nth-child(n+6) { animation-delay: 0.3s; }
}

/* ---- Phones: both deities in a portrait crop on top, text below a short overlap ---- */
@media (max-width: 640px) {
  .fest-hero { display: block; min-height: 0; border-radius: 16px; }
  .fest-hero__art { bottom: auto; height: 420px; }
  .fest-hero__art img { object-position: 60% 16%; }
  .fest-hero__veil { background: linear-gradient(0deg, rgba(18, 11, 38, 1) 0%, rgba(18, 11, 38, 0.97) 34%, rgba(18, 11, 38, 0) 60%); }
  .fest-hero__copy { max-width: 100%; padding: 418px 18px 22px; }
  .fest-hero__subtitle, .fest-hero__tithi { display: none; }
  .fest-hero__native { font-size: 2.6rem; }
  .fest-hero__facts { flex-wrap: nowrap; margin: 8px 0 14px; }
  .fest-hero__count { flex: 0 0 auto; }
  .fest-hero__date { flex: 1 1 auto; min-width: 0; }
  .fest-hero__actions .fest-btn { flex: 1 1 100%; }
}
.fest-note a { color: var(--color-link); }

/* ---- Light-toned art (Holi): pastel sky on the left, so the copy goes dark on a cream veil ---- */
.fest-hero--light { color: #3A2A1C; background: #FBF3E2; }
.fest-hero--light .fest-hero__veil { background: linear-gradient(90deg, rgba(255, 247, 232, 0.94) 0%, rgba(255, 247, 232, 0.8) 32%, rgba(255, 247, 232, 0.25) 48%, rgba(255, 247, 232, 0) 58%); }
.fest-hero--light .fest-hero__kicker { color: #9C3B0B; }
.fest-hero--light .fest-hero__native { color: #B3261E; text-shadow: none; }
.fest-hero--light .fest-hero__h1, .fest-hero--light .fest-hero__date-value { color: #3A2A1C; }
.fest-hero--light .fest-hero__subtitle, .fest-hero--light .fest-hero__count-text, .fest-hero--light .fest-hero__date-label { color: #62503C; }
.fest-hero--light .fest-hero__feeling { color: #7A3410; }
.fest-hero--light .fest-hero__count-num { color: #B3261E; }
.fest-hero--light .fest-hero__count, .fest-hero--light .fest-hero__date { background: rgba(255, 255, 255, 0.6); border-color: rgba(184, 134, 11, 0.5); }
.fest-hero--light .fest-btn--ghost { color: #3A2A1C; background: rgba(255, 255, 255, 0.55); border-color: rgba(156, 59, 11, 0.5); }
@media (max-width: 640px) {
  .fest-hero--light .fest-hero__veil { background: linear-gradient(0deg, rgba(255, 247, 232, 1) 0%, rgba(255, 247, 232, 0.96) 38%, rgba(255, 247, 232, 0) 62%); }
}

/* ---- Language switch (real links: EN | हिन्दी | Hinglish) ---- */
.lang-switch { display: inline-flex; gap: 4px; padding: 4px; margin: 0 0 14px; border-radius: 999px; background: var(--bg-subtle, #F6E9CF); border: 1px solid var(--border, #E7D3AA); }
.lang-switch a { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 16px; border-radius: 999px; color: var(--text-secondary, #62503C); font-weight: 600; font-size: 0.9375rem; text-decoration: none; }
.lang-switch a[aria-current="page"] { background: linear-gradient(180deg, #FFD76A, #F5A524); color: #2B1A06; box-shadow: 0 2px 6px var(--v3-shadow, rgba(120, 70, 20, 0.14)); }
.lang-switch a:focus-visible { outline: 3px solid #E8710A; outline-offset: 2px; }
body.v3 .seo-summary-card a, body.v3 .fest-note a { color: var(--color-link); text-decoration: underline; }

/* ---- Shell: header actions and footer under the v3 layer ---- */
body.v3 .seo-nav__login-btn { border-radius: 12px !important; min-height: 36px; display: inline-flex; align-items: center; font-weight: 700; transition: transform 0.14s, box-shadow 0.14s, filter 0.14s; }
body.v3 #seo-nav-login-btn { background: transparent !important; color: var(--color-link) !important; border: 1px solid var(--v3-brass); }
body.v3 #seo-nav-login-btn + .seo-nav__login-btn { background: linear-gradient(180deg, #FFD76A 0%, #F5A524 55%, #E8710A 100%) !important; color: #2B1A06 !important; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 1px 0 #8A5E0B, 0 6px 14px rgba(232, 113, 10, 0.3); }
body.v3 .seo-nav__login-btn:hover { opacity: 1; filter: brightness(1.05); }
body.v3 .seo-nav__login-btn:active { transform: translateY(1px) scale(0.98); }
body.v3 .seo-footer { border-top: 0; position: relative; padding-top: 14px; }
body.v3 .seo-footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 10px; background: radial-gradient(circle at 5px 5px, var(--v3-marigold) 3.2px, transparent 3.7px) 0 0 / 16px 10px repeat-x; opacity: 0.85; }
body.v3 .seo-footer__brand { font-family: var(--font-display); font-weight: 400; font-size: 1.3rem; }

/* ---- Existing page banners: Sandhya dusk instead of purple (family heroes with medallion art come in Phase 2) ---- */
body.v3 .seo-hero {
  --color-hero-start: #2B2350;
  --color-hero-end: #7A2E2A;
  --color-focus: #FFD76A;
  background: radial-gradient(ellipse at 85% 0%, rgba(245, 165, 36, 0.28), transparent 55%), linear-gradient(135deg, #2B2350 0%, #5A2340 60%, #8A2F22 100%);
  color: #FFF3D6;
  border-radius: 20px;
  box-shadow: 0 14px 36px var(--v3-shadow);
}
body.v3 .seo-hero__h1 { font-family: var(--font-display); font-weight: 400; color: #FFE9A8; }
/* tool pages keep their light, open heading (public-tools.css); only restate it above the dusk banner rule */
body.v3 .public-tool-page .seo-hero, body.v3 .tool-hub .seo-hero { background: transparent; color: var(--text-primary); border-radius: 0; box-shadow: none; }
body.v3 .public-tool-page .seo-hero__h1, body.v3 .tool-hub .seo-hero__h1 { color: var(--text-primary); }

/* Long banner intros read better left-aligned on a phone (seen on /horoscope on a real device) */
@media (max-width: 640px) {
  body.v3 .seo-hero__intro { text-align: left; }
  body.v3 .seo-hero__h1 { text-align: center; }
}
