/* Three homepage directions, sharing the site's existing content and navigation. */
.template-switcher { position: fixed; z-index: 1500; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 5px; padding: 7px; background: #fff; border: 1px solid #ded7d0; border-radius: 14px; box-shadow: 0 8px 40px #0003; white-space: nowrap; }
.template-switcher a { padding: 10px 16px; border-radius: 9px; color: #513b33; font-size: 14px; font-weight: 600; }
.template-switcher a[aria-current="page"] { background: #531f28; color: white; }
.heritage-photo { width: calc(100% + 76px); max-width: none; height: 220px; object-fit: cover; margin: -38px -38px 28px; }
.teaching-card { overflow: hidden; }
.home-page .teaching-card .icon { display: none; }
.footer { padding-bottom: 85px; }
/* Royal Temple */
.template-royal { background: #fffaf1; }
.template-royal .site-header { background: #32151b; border-bottom: 1px solid #b9925766; }
.template-royal .brand strong, .template-royal .nav-links > a, .template-royal .dropdown-toggle { color: #fff0d8; }
.template-royal .brand small { color: #d2bda6; }
.template-royal .language-switcher { background: transparent; color: #eed4ae; border-color: #b9925777; }
.template-royal .top-strip { background: #241015; color: #d9b779; }
.template-royal .nav-cta { background: #bc9254; color: #241015 !important; border-color: #bc9254; }
.template-royal .hero { background: radial-gradient(ellipse at 70% 30%,#722b35,transparent 65%),#32151b; padding: 64px 0 80px; }
.template-royal .hero-pattern { opacity: .12; }
.template-royal .hero-grid { grid-template-columns: 1fr 1.08fr; gap: 65px; }
.template-royal .hero h1 { color: #fff2db; font-size: clamp(62px,6.9vw,96px); }
.template-royal .hero h1 span { color: #ddb675; }
.template-royal .eyebrow { color: #e2bd81; }
.template-royal .hero-copy > p { color: #ddc7be; }
.template-royal .btn-primary { background: #d6af70; color: #32151b; }
.template-royal .btn-secondary { background: transparent; color: #f8e5c8; border-color: #b9925780; }
.template-royal .hero-notes { border-color: #b9925755; }
.template-royal .hero-notes strong { color: #ebc98f; }
.template-royal .hero-notes span { color: #ceb6ab; }
.template-royal .hero-card { border-radius: 240px 240px 12px 12px; background: #2c1016; padding: 12px 12px 24px; box-shadow: 0 0 0 9px #b9925710,0 0 0 10px #b9925750; }
.template-royal .portrait-placeholder { border-radius: 230px 230px 5px 5px; aspect-ratio: 1 / 1.05; }
.template-royal .hero-card h2 { font-size: 22px; }
.template-royal .mantra-band { background: #241015; border-color: #ae834b; padding: 30px 0; }
.template-royal .teaching-card { background: #fffaf1; border-color: #d8c29d; border-radius: 4px; }
.template-royal .teaching-card.featured { background: #431a23; }
.template-royal .gallery-section { background: #f5ead8; }
.template-royal .section-kicker::before { content: '✦'; margin-right: 10px; }
/* Modern Elegance */
.template-modern { --maroon: #263b32; --saffron: #b94b22; --muted: #66716b; background: #fff; }
.template-modern .top-strip { background: #263b32; }
.template-modern .site-header { background: #ffffffed; }
.template-modern .hero { background: #f4f5ef; padding: 65px 0; }
.template-modern .hero-pattern, .template-modern .mandala { display: none; }
.template-modern .hero-grid { grid-template-columns: 1fr 1.1fr; gap: 70px; }
.template-modern .hero h1 { font-size: clamp(60px,6.5vw,88px); font-weight: 500; }
.template-modern .hero h1 span { color: #b94b22; }
.template-modern .hero-copy > p { color: #66716b; }
.template-modern .hero-card { border: 0; border-radius: 4px; background: transparent; padding: 0; box-shadow: none; text-align: left; }
.template-modern .portrait-placeholder { width: 100%; aspect-ratio: 4 / 4.4; border: 0; border-radius: 180px 180px 4px 4px; margin-bottom: 18px; box-shadow: none; }
.template-modern .hero-card h2 { color: #263b32; padding: 0; font-size: 21px; max-width: none; }
.template-modern .hero-card p { color: #66716b; max-width: none; border-top: 1px solid #263b3220; font-weight: 400; }
.template-modern .hero-notes { border-color: #263b3220; }
.template-modern .btn { border-radius: 3px; }
.template-modern .btn-primary { background: #b94b22; }
.template-modern .mantra-band { background: white; border: 0; border-bottom: 1px solid #263b3220; padding: 45px 0; }
.template-modern .mantra-band p { color: #263b32; }
.template-modern .mantra-band span { color: #66716b; }
.template-modern .values-grid article { background: #f4f5ef; border: 0; border-radius: 3px; }
.template-modern .teachings { background: #f4f5ef; }
.template-modern .teaching-card { background: white; border-radius: 3px; border: 0; box-shadow: none; }
.template-modern .teaching-card.featured { background: #263b32; transform: none; }
.template-modern .gallery-item { border-radius: 3px; }
.template-modern .seva-box { background: #263b32; border-radius: 3px; }
/* Immersive Devotion */
.template-immersive { background: var(--theme-base); color: #eee5dc; --maroon: #f4dec0; --muted: #b9b0aa; --saffron: #e5ac63; }
.template-immersive .top-strip { background: var(--theme-top); color: #dbb780; }
.template-immersive .site-header { background: var(--theme-header); border-color: #ffffff16; }
.template-immersive .brand strong, .template-immersive .nav-links > a, .template-immersive .dropdown-toggle { color: #eee5dc; }
.template-immersive .brand small { color: #b9b0aa; }
.template-immersive .nav-cta { background: transparent; border-color: #dbb780; }
.template-immersive .language-switcher { background: transparent; color: #dbb780; border-color: #dbb78055; }
.template-immersive .hero { min-height: 740px; padding: 40px 0 160px; background: var(--theme-base); display: flex; align-items: center; }
.template-immersive .hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg,rgb(var(--theme-overlay)) 0%,rgb(var(--theme-overlay) / .91) 28%,rgb(var(--theme-overlay) / .2) 75%),linear-gradient(0deg,var(--theme-base),transparent 45%),url('./assets/images/shri-ji-maharaj.jpg') center 28% / cover; }
.template-immersive .hero-grid { grid-template-columns: 1.12fr .88fr; }
.template-immersive .hero-pattern { display: none; }
.template-immersive .hero h1 { color: #fff4e6; font-size: clamp(65px,7.2vw,100px); }
.template-immersive .hero h1 span { color: #e7b778; }
.template-immersive .eyebrow { color: #e7b778; }
.template-immersive .hero-copy > p { color: #d4c8bc; text-shadow: 0 2px 10px #000; }
.template-immersive .hero-card { align-self: end; margin-bottom: -100px; margin-top: 340px; background: rgb(var(--theme-overlay) / .69); backdrop-filter: blur(16px); border-radius: 10px; border-color: #d0ac6b55; box-shadow: none; padding: 24px; }
.template-immersive .hero-card .portrait-placeholder, .template-immersive .hero-card .mandala { display: none; }
.template-immersive .hero-card h2 { font-size: 22px; }
.template-immersive .hero-notes { border-color: #ffffff35; }
.template-immersive .hero-notes strong { color: #e7b778; }
.template-immersive .hero-notes span { color: #c7b8ac; }
.template-immersive .btn-primary { background: #d7a465; color: var(--theme-base); }
.template-immersive .btn-secondary { color: #fff0dc; background: #ffffff08; border-color: #ffffff50; }
.template-immersive .mantra-band { background: var(--theme-band); border-color: #c39d66; }
.template-immersive .values-grid article, .template-immersive .teaching-card, .template-immersive .event-item { background: var(--theme-card); border-color: #ffffff18; }
.template-immersive .lead { color: #d7c9bc; }
.template-immersive .teachings, .template-immersive .events, .template-immersive .gallery-section { background: var(--theme-section); }
.template-immersive .teaching-card.featured { background: var(--theme-featured); }
.template-immersive .event-date { background: var(--theme-date); }
.template-immersive .contact-form, .template-immersive .contact-grid { background: var(--theme-card); border-color: #ffffff20; }
.template-immersive .contact-form input, .template-immersive .contact-form textarea { background: var(--theme-section); color: white; border-color: #ffffff30; }
.template-immersive .contact-details > div { background: var(--theme-band); }
.template-immersive .seva-box { background: linear-gradient(110deg,var(--theme-highlight),var(--theme-service)); }
.template-immersive .section-kicker { color: #e5ac63; }
.template-immersive .schedule { background: var(--theme-card); }
.template-immersive .footer { background: var(--theme-footer); }
.template-immersive .dropdown-menu { background: var(--theme-card); }
.template-immersive .dropdown-menu a { color: #eee5dc; }
.template-immersive .dropdown-menu a:hover { background: var(--theme-highlight); }
@media (prefers-reduced-motion: no-preference) {
  .template-immersive .hero-copy { animation: devotion-enter .9s ease-out both; }
  .template-immersive .hero-card { animation: devotion-enter 1.2s ease-out both; }
  @keyframes devotion-enter { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
}
@media (max-width: 920px) {
  .template-royal .hero-grid, .template-modern .hero-grid, .template-immersive .hero-grid { grid-template-columns: 1fr; }
  .template-royal .nav-links { background: #32151b; }
  .template-immersive .nav-links { background: var(--theme-nav); }
  .template-royal .menu-toggle span, .template-immersive .menu-toggle span { background: #e8c797; }
  .template-modern .hero-card { width: min(500px,100%); }
  .template-immersive .hero { min-height: 940px; padding: 30px 0 45px; }
  .template-immersive .hero::before { background: linear-gradient(0deg,var(--theme-base) 0%,rgb(var(--theme-overlay) / .69) 45%,rgb(var(--theme-overlay) / .38)),url('./assets/images/shri-ji-maharaj.jpg') 60% top / cover; }
  .template-immersive .hero-copy { text-align: left; }
  .template-immersive .hero-card { margin: 10px auto 0; }
  .template-immersive .hero-actions, .template-immersive .hero-notes { justify-content: flex-start; }
}
@media (max-width: 640px) {
  .template-switcher { bottom: 10px; gap: 2px; padding: 5px; max-width: calc(100% - 16px); }
  .template-switcher a { font-size: 12px; padding: 10px; }
  .template-royal .hero h1, .template-modern .hero h1, .template-immersive .hero h1 { font-size: clamp(47px,12vw,65px); }
  .template-royal .hero, .template-modern .hero { padding: 50px 0; }
  .template-royal .hero-card { width: calc(100% - 28px); }
  .template-immersive .hero { min-height: 900px; }
  .template-immersive .hero-notes { gap: 16px; }
}

/* Shared immersive palettes; saffron is the default in the page markup. */
.template-immersive {
  --theme-base: #171617; --theme-top: #0e1010; --theme-header: #151617f5;
  --theme-overlay: 17 19 21; --theme-nav: #151617; --theme-band: #202322;
  --theme-card: #242626; --theme-section: #171a19; --theme-featured: #343b34;
  --theme-date: #37362f; --theme-highlight: #383c32; --theme-service: #242c28; --theme-footer: #101212;
}
.template-immersive[data-theme="maroon"] {
  --theme-base: #280f18; --theme-top: #19090f; --theme-header: #240d16f5;
  --theme-overlay: 33 11 20; --theme-nav: #240d16; --theme-band: #381522;
  --theme-card: #401a29; --theme-section: #30121e; --theme-featured: #61263b;
  --theme-date: #532033; --theme-highlight: #65283c; --theme-service: #391522; --theme-footer: #1c0a12;
}
.template-immersive[data-theme="saffron"] {
  --theme-base: #29170e; --theme-top: #190e08; --theme-header: #28170ff5;
  --theme-overlay: 35 19 10; --theme-nav: #28170f; --theme-band: #3b2415;
  --theme-card: #402719; --theme-section: #301c10; --theme-featured: #66391b;
  --theme-date: #58351b; --theme-highlight: #74451f; --theme-service: #422713; --theme-footer: #1c1009;
}
.theme-picker { display: flex; align-items: center; gap: 7px; order: 2; flex-shrink: 0; }
.template-immersive .brand { margin-right: auto; }
.template-immersive .nav-links { order: 1; gap: 14px; }
.template-immersive .menu-toggle { order: 3; flex-shrink: 0; }
.template-immersive .navbar { gap: 14px; }
@media (min-width: 921px) and (max-width: 1250px) {
  .template-immersive .navbar { flex-wrap: wrap; padding: 12px 0; }
  .template-immersive .nav-links { order: 3; width: 100%; justify-content: center; }
}
@media (max-width: 640px) {
      .template-immersive .navbar { gap: 7px; }
  .template-immersive .brand { gap: 5px; min-width: 0; }
  .template-immersive .brand-mark { width: 42px; }
  .template-immersive .brand strong { font-size: 22px; }
  .template-immersive .brand small { font-size: 10px; letter-spacing: 0; }
  .template-immersive .menu-toggle { width: 34px; }
}

/* Color swatches keep theme selection compact and keyboard accessible. */
.theme-picker { gap: 2px; }
.theme-swatch { width: 36px; height: 44px; padding: 0; display: grid; place-items: center; border: 0; background: transparent; cursor: pointer; border-radius: 8px; }
.theme-swatch::before { content: ''; width: 22px; height: 22px; border-radius: 50%; background: var(--swatch-color); border: 1px solid #ffffff80; box-shadow: 0 0 0 2px transparent; transition: box-shadow .2s ease; }
.theme-swatch:hover::before { box-shadow: 0 0 0 2px #ffffff60; }
.theme-swatch[aria-pressed="true"]::before { box-shadow: 0 0 0 2px var(--theme-nav), 0 0 0 4px #e7b778; }
@media (max-width: 640px) {
  .theme-picker { gap: 0; }
  .theme-swatch { width: 30px; }
  .theme-swatch::before { width: 18px; height: 18px; }
}

/* Match light button labels to the active immersive palette. */
.template-immersive .btn-light { color: var(--theme-featured); }

/* Shared immersive styling for the tradition, biography and gallery pages. */
.template-immersive { --border: #ffffff24; }
.template-immersive .inner-hero {
  padding: 55px 0 65px;
  background: radial-gradient(ellipse at 85% 15%, #d7a46518, transparent 55%), linear-gradient(120deg, var(--theme-nav), var(--theme-featured));
  border-bottom: 1px solid #d7a46540;
}
.template-immersive .inner-hero h1 { color: #fff0dc; }
.template-immersive .inner-hero p { color: #d7c9bc; }
.template-immersive .prose p, .template-immersive .prose li { color: #d7c9bc; }
.template-immersive .prose h3 { color: #e7b778; }
.template-immersive .side-card,
.template-immersive .institution-grid article,
.template-immersive .guru-item,
.template-immersive .lineage-strip,
.template-immersive .chip-grid span,
.template-immersive .asset-gallery-item,
.template-immersive .gallery-empty { background: var(--theme-card); border-color: var(--border); }
.template-immersive .side-card { top: 145px; }
.template-immersive .side-card ul { color: #d7c9bc; }
.template-immersive .mantra-card,
.template-immersive .guru-item.current,
.template-immersive .quote-section { background: linear-gradient(120deg, var(--theme-featured), var(--theme-service)); }
.template-immersive .guru-item > span { background: var(--theme-date); color: #ffe0a3; }
.template-immersive .guru-item.current > span { background: #d7a465; color: var(--theme-base); }
.template-immersive .guru-photo,
.template-immersive .guru-item.current .guru-photo { background: var(--theme-section); border-color: #d7a46565; }
.template-immersive .gallery-page-section { background: var(--theme-section); }
.template-immersive .temple-arch { background: var(--theme-card); border-color: #d7a46565; }
.template-immersive .footer { padding-bottom: 0; }
@media (max-width: 640px) {
  .template-immersive .inner-hero { padding: 35px 0 45px; }
  .template-immersive .inner-hero h1 { font-size: clamp(40px, 11vw, 60px); overflow-wrap: break-word; }
}

/* Keep text inset from filled panels and allow paired rows to wrap safely. */
.template-immersive .schedule {
  border: 1px solid var(--border);
  border-radius: 12px;
}
.template-immersive .schedule > div {
  padding: 16px 22px;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: 24px;
  row-gap: 6px;
}
.template-immersive .schedule > div:last-child { border-bottom: 0; }
.template-immersive .schedule > div > span { flex: 1 1 150px; }
.template-immersive .schedule > div > strong { text-align: end; max-width: 100%; }
.template-immersive .contact-details > div { padding: 16px 20px; gap: 6px; border-radius: 0 8px 8px 0; }
.template-immersive .contact-details span,
.template-immersive .contact-details a { overflow-wrap: anywhere; }
.template-immersive :is(.split, .darshan-grid, .contact-grid, .article-layout, .event-list, .values-grid, .institution-grid) > * { min-width: 0; }
.template-immersive :is(.event-details, .side-card, .institution-grid article, .values-grid article) { overflow-wrap: break-word; }
.template-immersive .side-card li + li { margin-top: 8px; }
@media (max-width: 640px) {
  .template-immersive .schedule > div { padding: 14px 16px; column-gap: 16px; }
  .template-immersive .schedule > div > span { flex-basis: 130px; }
  .template-immersive .values-grid.three { grid-template-columns: 1fr; }
  .template-immersive .contact-form { padding: 24px 20px; }
  .template-immersive .side-card { padding: 24px; }
}
@media (max-width: 380px) {
  .template-immersive .schedule > div { flex-direction: column; gap: 4px; }
  .template-immersive .schedule > div > span { flex-basis: auto; }
  .template-immersive .schedule > div > strong { text-align: start; }
}

/* Match content screens to the homepage's selected background and accents. */
.template-immersive.inner-page .inner-hero {
  background: radial-gradient(ellipse at 85% 15%, #d7a46512, transparent 55%), linear-gradient(120deg, var(--theme-base), var(--theme-band));
}
.template-immersive.inner-page .mantra-card {
  background: var(--theme-band);
  border: 1px solid var(--border);
  color: #ffe8aa;
}
.template-immersive.inner-page .prose h2,
.template-immersive.inner-page .side-card h3 { color: #f4dec0; }
.template-immersive.inner-page .chip-grid span,
.template-immersive.inner-page .lineage-strip { color: #f4dec0; }

/* Deep dark blue: navy surfaces with the shared warm gold accents. */
.template-immersive[data-theme="blue"] {
  --theme-base: #0c1426; --theme-top: #080e1b; --theme-header: #0d172bf5;
  --theme-overlay: 8 16 33; --theme-nav: #0d172b; --theme-band: #14223a;
  --theme-card: #192a45; --theme-section: #101d33; --theme-featured: #203d70;
  --theme-date: #22385b; --theme-highlight: #2a4c7a; --theme-service: #142945; --theme-footer: #080f1f;
}
/* Fit four swatches beside the brand and menu on narrow screens. */
@media (max-width: 640px) {
  .theme-swatch { width: 26px; }
  .theme-swatch::before { width: 16px; height: 16px; }
}
@media (max-width: 360px) {
  .template-immersive .navbar > .brand .brand-mark { display: none; }
}
