/* =========================================================
   Sivapooja.com — Divine Temple Design System
   Palette:
     --ink          #21080c  deep temple maroon (base background)
     --panel        #3a1018  burgundy panel
     --panel-2      #3a1018  burgundy card surface
     --panel-elev   #4a1520  elevated burgundy surface
     --gold         #d9a441  antique gold — sacred accents, rules, highlights
     --gold-lt      #e4b458  refined antique gold highlight
     --bronze       #a98555  muted bronze — subtle borders, kickers
     --saffron      #e68428  auspicious saffron accent — focal CTAs, bindu
     --kumkum       #e68428  auspicious saffron accent
     --ivory        #f7f0e2  warm ivory text (primary)
     --ivory-dim    #cfbfad  soft warm ivory muted text (secondary)
   Typography:
     Display: 'Cinzel', serif (monumental temple stone)
     Quote:   'Cormorant Garamond', serif (sacred classical invocation)
     Body:    'Catamaran', 'Noto Sans Tamil', sans-serif (balanced bilingual)
   ========================================================= */

:root {
  --ink: #21080c;
  --panel: #3a1018;
  --panel-2: #3a1018;
  --panel-elev: #4a1520;
  --gold: #d9a441;
  --gold-lt: #e4b458;
  --bronze: #a98555;
  --saffron: #e68428;
  --kumkum: #e68428;
  --ivory: #f7f0e2;
  --ivory-dim: #cfbfad;
  --line: rgba(217, 164, 65, 0.22);
  --line-subtle: rgba(217, 164, 65, 0.12);
  --line-strong: rgba(217, 164, 65, 0.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  color: var(--ivory);
  font-family: 'Catamaran', 'Noto Sans Tamil', sans-serif;
  font-weight: 400;
  overflow-x: hidden;
  background-color: var(--ink);
  background-image:
    radial-gradient(55% 45% at 50% 0%, rgba(217, 164, 65, 0.08), transparent 70%),
    radial-gradient(75% 55% at 100% 100%, rgba(58, 16, 24, 0.4), transparent 60%),
    linear-gradient(175deg, #21080c 0%, #1a0508 50%, #120305 100%);
  background-attachment: fixed;
}

::selection {
  background: var(--gold);
  color: #21080c;
}

.font-display { font-family: 'Cinzel', serif; letter-spacing: 0.025em; }
.font-quote { font-family: 'Cormorant Garamond', serif; }

.text-gold { color: var(--gold); }
.text-gold-lt { color: var(--gold-lt); }
.text-saffron { color: var(--saffron); }
.text-kumkum { color: var(--saffron); }
.text-bronze { color: var(--bronze); }
.text-dim { color: var(--ivory-dim); }
.bg-panel { background: var(--panel); }
.bg-panel-2 { background: var(--panel-2); }
.border-gold { border-color: var(--line); }

/* Tamil text receives generous line-height for authentic Tamil glyph clarity */
.tamil {
  font-family: 'Catamaran', 'Noto Sans Tamil', sans-serif;
  line-height: 1.85;
}

/* ---------- Custom Scrollbar ---------- */
::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--gold), var(--bronze));
  border-radius: 5px;
}

/* ---------- Gopuram tier divider ---------- */
.gopuram-divider {
  width: 100%;
  height: 32px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2.5px;
  opacity: 0.85;
  filter: drop-shadow(0 0 6px rgba(217, 164, 65, 0.35));
}
.gopuram-divider span {
  display: block;
  width: 9px;
  background: linear-gradient(180deg, var(--gold-lt), var(--panel));
  border-top: 1px solid var(--gold-lt);
  border-radius: 1px 1px 0 0;
}
.gopuram-divider span:nth-child(1) { height: 6px; }
.gopuram-divider span:nth-child(2) { height: 10px; }
.gopuram-divider span:nth-child(3) { height: 14px; }
.gopuram-divider span:nth-child(4) { height: 19px; }
.gopuram-divider span:nth-child(5) { height: 25px; }
.gopuram-divider span:nth-child(6) { height: 32px; }
.gopuram-divider span:nth-child(7) { height: 25px; }
.gopuram-divider span:nth-child(8) { height: 19px; }
.gopuram-divider span:nth-child(9) { height: 14px; }
.gopuram-divider span:nth-child(10) { height: 10px; }
.gopuram-divider span:nth-child(11) { height: 6px; }

/* ---------- Kolam dot rule ---------- */
.kolam-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.kolam-rule::before,
.kolam-rule::after {
  content: "";
  height: 1px;
  width: 100%;
  max-width: 110px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.kolam-rule .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--saffron);
  box-shadow: 0 0 10px rgba(230, 132, 40, 0.75), 0 0 3px rgba(217, 164, 65, 0.5);
}

/* ---------- Hero: sanctum glow ---------- */
.sanctum {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(60% 50% at 50% 32%, rgba(217, 164, 65, 0.12), transparent 72%),
    radial-gradient(90% 65% at 50% 100%, rgba(58, 16, 24, 0.45), transparent 60%),
    var(--ink);
}

.sanctum-rays {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.4;
  background:
    repeating-conic-gradient(from 0deg at 50% 34%,
      rgba(217, 164, 65, 0.05) 0deg 2deg,
      transparent 2deg 12deg);
  animation: rotateRays 140s linear infinite;
  mix-blend-mode: screen;
}
@keyframes rotateRays { to { transform: rotate(360deg); } }

/* ---------- Sacred Lingam: calm glow without shape distortion ---------- */
.lingam-glow {
  filter: drop-shadow(0 0 26px rgba(245,158,11,0.46));
  animation: lingam-aura 6.5s ease-in-out infinite;
  transition: filter 0.5s ease;
}
.lingam-glow:hover {
  filter: drop-shadow(0 0 38px rgba(245,158,11,0.62));
}
@keyframes lingam-aura {
  0%,100% { filter: drop-shadow(0 0 22px rgba(245,158,11,0.38)); }
  50% { filter: drop-shadow(0 0 32px rgba(245,158,11,0.55)); }
}

.sacred-line {
  text-shadow:
    0 0 20px rgba(228, 180, 88, 0.45),
    0 0 40px rgba(217, 164, 65, 0.25);
}

/* Subtle particle embers */
.ember {
  position: absolute;
  bottom: -10px;
  border-radius: 50%;
  background: var(--gold-lt);
  opacity: 0;
  box-shadow: 0 0 6px rgba(217, 164, 65, 0.65);
  animation: rise linear infinite;
}
@keyframes rise {
  0% { opacity: 0; transform: translateY(0) scale(0.6); }
  10% { opacity: 0.75; }
  90% { opacity: 0.2; }
  100% { opacity: 0; transform: translateY(-600px) scale(1); }
}

/* ---------- Logo: circular frame with antique gold rim ---------- */
.logo-ring {
  border-radius: 50%;
  box-shadow:
    0 0 0 2px rgba(217, 164, 65, 0.55),
    0 0 14px rgba(217, 164, 65, 0.35),
    0 4px 12px rgba(0, 0, 0, 0.5);
  animation: logoFloat 4.5s ease-in-out infinite;
}
@keyframes logoFloat {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* ---------- Temple Cards: Burgundy Panels with Antique Gold Trims ---------- */
.temple-card {
  background:
    linear-gradient(180deg, rgba(58, 16, 24, 0.88) 0%, rgba(33, 8, 12, 0.94) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  position: relative;
  border-radius: 14px;
  box-shadow:
    0 1px 0 rgba(228, 180, 88, 0.12) inset,
    0 -1px 0 rgba(0, 0, 0, 0.3) inset,
    0 16px 36px -16px rgba(0, 0, 0, 0.75),
    0 3px 10px rgba(0, 0, 0, 0.4);
  transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s ease, border-color .3s ease;
}
.temple-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(90deg, transparent, var(--saffron) 20%, var(--gold) 50%, var(--saffron) 80%, transparent);
  opacity: 0.8;
  animation: borderGlow 4s ease-in-out infinite;
}
@keyframes borderGlow {
  0%,100% { opacity: 0.45; filter: brightness(1); }
  50% { opacity: 0.9; filter: brightness(1.2); }
}
.temple-card:hover {
  transform: translateY(-4px);
  border-color: rgba(217, 164, 65, 0.48);
  box-shadow:
    0 1px 0 rgba(228, 180, 88, 0.2) inset,
    0 22px 46px -18px rgba(0, 0, 0, 0.85),
    0 6px 16px rgba(0, 0, 0, 0.5),
    0 0 32px rgba(217, 164, 65, 0.12);
}

/* Mouse-driven 3D tilt */
.tilt {
  transform-style: preserve-3d;
  will-change: transform;
}
.tilt:hover {
  box-shadow:
    0 1px 0 rgba(228, 180, 88, 0.22) inset,
    0 26px 50px -18px rgba(0, 0, 0, 0.85),
    0 6px 18px rgba(0, 0, 0, 0.5),
    0 0 36px rgba(217, 164, 65, 0.15);
}

@media (prefers-reduced-motion: reduce) {
  .tilt { transform: none !important; }
  .temple-card::before, .logo-ring, .lingam-glow { animation: none !important; }
}

/* Gallery card frame */
.arch-frame {
  border-radius: 12px;
}

/* ---------- Buttons ---------- */
.btn-gold {
  background: linear-gradient(160deg, #e4b458, #d9a441 55%, #b58026);
  color: #21080c;
  font-weight: 700;
  transition: transform .22s ease, box-shadow .22s ease, filter .22s ease;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 -2px 0 rgba(0, 0, 0, 0.25) inset,
    0 8px 22px rgba(217, 164, 65, 0.3);
}
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 -2px 0 rgba(0, 0, 0, 0.25) inset, 0 12px 28px rgba(217, 164, 65, 0.45);
  filter: brightness(1.05);
}
.btn-gold:active { transform: translateY(0); }

.btn-saffron {
  background: linear-gradient(160deg, #f0953a, #e68428 55%, #c66610);
  color: #21080c;
  font-weight: 700;
  transition: transform .22s ease, box-shadow .22s ease, filter .22s ease;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 -2px 0 rgba(0, 0, 0, 0.25) inset,
    0 8px 22px rgba(230, 132, 40, 0.35);
}
.btn-saffron:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.45) inset, 0 -2px 0 rgba(0, 0, 0, 0.25) inset, 0 12px 28px rgba(230, 132, 40, 0.5);
  filter: brightness(1.06);
}
.btn-saffron:active { transform: translateY(0); }

.btn-outline {
  border: 1px solid var(--gold);
  color: var(--gold-lt);
  background: rgba(217, 164, 65, 0.06);
  transition: background .22s ease, color .22s ease, transform .22s ease, box-shadow .22s ease;
}
.btn-outline:hover {
  background: rgba(217, 164, 65, 0.16);
  color: var(--ivory);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(217, 164, 65, 0.18);
}

.btn-whatsapp {
  background: linear-gradient(160deg, #25d366, #128c43);
  color: #ffffff;
  border: 1px solid #1ba851;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 8px 20px rgba(18, 140, 67, 0.35);
  transition: transform .2s ease, box-shadow .2s ease;
}
.btn-whatsapp:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 12px 28px rgba(18, 140, 67, 0.5);
}

/* ---------- Navigation ---------- */
.nav-link {
  position: relative;
  color: var(--ivory-dim);
  transition: color .2s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -4px;
  height: 1px;
  background: linear-gradient(90deg, var(--saffron), var(--gold-lt));
  box-shadow: 0 0 6px rgba(217, 164, 65, 0.5);
  transition: right .22s ease;
}
.nav-link:hover { color: var(--gold-lt); }
.nav-link:hover::after { right: 0; }

/* ---------- Scroll Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1);
}
.reveal.in { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .lingam-glow, .sanctum-rays, .ember { animation: none !important; }
}

/* ---------- Numbered Homam Steps ---------- */
.step-num {
  font-family: 'Cinzel', serif;
  color: #21080c;
  border: 1px solid var(--gold-lt);
  background: linear-gradient(160deg, var(--gold-lt), var(--gold));
  box-shadow: 0 0 12px rgba(217, 164, 65, 0.35);
}

/* ---------- Floating Contact Rail ---------- */
.contact-rail {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rail-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  transition: transform .2s ease, box-shadow .2s ease;
  animation: railFloat 3.6s ease-in-out infinite;
}
.rail-btn:nth-child(2) { animation-delay: .4s; }
@keyframes railFloat {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.rail-btn:hover { transform: scale(1.08); }

@media (max-width: 640px) {
  .contact-rail { right: 12px; bottom: 14px; gap: 8px; }
  .rail-btn { width: 44px; height: 44px; }
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(18, 4, 7, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox.open { display: flex; }

/* ---------- Admin & Form Controls ---------- */
.admin-shell {
  min-height: 100svh;
  background:
    radial-gradient(55% 45% at 50% 0%, rgba(217, 164, 65, 0.10), transparent 65%),
    radial-gradient(80% 60% at 100% 100%, rgba(58, 16, 24, 0.35), transparent 60%),
    linear-gradient(175deg, #21080c 0%, #1a0508 55%, #120305 100%);
}
.input-field {
  background: rgba(42, 11, 17, 0.8);
  border: 1px solid var(--line);
  color: var(--ivory);
  backdrop-filter: blur(8px);
}
.input-field:focus {
  outline: none;
  border-color: var(--gold-lt);
  box-shadow: 0 0 0 3px rgba(217, 164, 65, 0.2);
}

/* ---------- Category Segmented Filter Buttons (Poojas page) ---------- */
.category-pill {
  border: 1px solid var(--line);
  color: var(--ivory-dim);
  background: rgba(42, 11, 17, 0.6);
  font-weight: 500;
  cursor: pointer;
  min-height: 38px;
}
.category-pill:hover {
  border-color: var(--gold);
  color: var(--ivory);
  background: rgba(58, 16, 24, 0.85);
}
.category-pill.active {
  border-color: var(--gold-lt);
  background: rgba(217, 164, 65, 0.16);
  color: var(--gold-lt);
  box-shadow: 0 0 12px rgba(217, 164, 65, 0.2);
}

/* ---------- Accessibility & Focus Visibility ---------- */
:focus-visible {
  outline: 2px solid var(--gold-lt);
  outline-offset: 3px;
}
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 1000;
  background: linear-gradient(160deg, var(--gold-lt), var(--gold));
  color: #21080c;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  transition: top 0.2s ease;
  text-decoration: none;
}
.skip-link:focus {
  top: 16px;
  outline: 3px solid #fff;
}

/* ---------- Gallery Skeleton Loading State ---------- */
.skeleton-card {
  position: relative;
  overflow: hidden;
  background: rgba(58, 16, 24, 0.65);
  border: 1px solid var(--line);
  border-radius: 14px;
  min-height: 290px;
}
.skeleton-shimmer {
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(217, 164, 65, 0.12), transparent);
  animation: shimmer 1.8s infinite;
}
@keyframes shimmer {
  100% { transform: translateX(100%); }
}

/* ---------- Upload Progress Bar ---------- */
.upload-progress-track {
  width: 100%;
  height: 8px;
  background: rgba(33, 8, 12, 0.85);
  border: 1px solid var(--line);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}
.upload-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--saffron), var(--gold-lt));
  box-shadow: 0 0 10px rgba(217, 164, 65, 0.7);
  transition: width 0.2s ease;
}

/* ---------- Lightbox Controls & Live Count ---------- */
.lightbox-btn {
  background: rgba(58, 16, 24, 0.85);
  border: 1px solid var(--line);
  color: var(--ivory);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.lightbox-btn:hover {
  background: var(--gold);
  color: #21080c;
  border-color: var(--gold-lt);
  transform: scale(1.05);
}
.lightbox-btn:disabled {
  opacity: 0.35;
  pointer-events: none;
}
