/* ==========================================================================
   SHREE SIDDHIVINAYAK GANAPATI TEMPLE - LUXURY DESIGN SYSTEM (MOBILE-FIRST)
   Palette: Pristine White, Warm Gold, Deep Charcoal
   Aesthetics: Luxury Editorial + Indian Heritage + Spiritual Calm
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700;800;900&family=Noto+Serif+Devanagari:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Rozha+One&display=swap');

:root {
  /* Safe Area Insets for Modern Mobile Notches & Bars */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  /* Core Colors */
  --color-bg-white: #FFFFFF;
  --color-bg-ivory: #FDFBF7;
  --color-bg-pearl: #F8F5EE;
  --color-bg-warm-light: #F4EFE6;
  --color-bg-sand: #EFE9DC;

  /* Metallic Gold Spectrum */
  --gold-primary: #C59341;
  --gold-deep: #9D722A;
  --gold-dark: #7A571D;
  --gold-bright: #DFB76C;
  --gold-light: #ECD39E;
  --gold-subtle: #F6EDD9;
  --gold-glow: rgba(197, 147, 65, 0.28);
  --gold-border: rgba(197, 147, 65, 0.24);
  --gold-border-solid: #DFBD78;
  --gold-gradient: linear-gradient(135deg, #E6C57F 0%, #C59341 50%, #9D722A 100%);
  --gold-gradient-hover: linear-gradient(135deg, #ECCF8D 0%, #D4A352 50%, #AD7E30 100%);
  --gold-gradient-soft: linear-gradient(180deg, rgba(223, 183, 108, 0.12) 0%, rgba(197, 147, 65, 0.02) 100%);

  /* Charcoal & Typography Colors */
  --text-primary: #171614;
  --text-secondary: #4A463F;
  --text-muted: #7D786E;
  --text-light: #A39D91;
  --text-inverse: #FFFFFF;

  /* Sacred Accents */
  --sacred-red: #9B1C1C;
  --sacred-saffron: #C86116;

  /* Borders & Dividers */
  --border-light: #EBE5D8;
  --border-gold-subtle: rgba(197, 147, 65, 0.2);
  --border-card: rgba(197, 147, 65, 0.16);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(23, 22, 20, 0.04);
  --shadow-md: 0 6px 20px rgba(23, 22, 20, 0.06);
  --shadow-lg: 0 14px 36px rgba(23, 22, 20, 0.08);
  --shadow-xl: 0 24px 60px rgba(23, 22, 20, 0.11);
  --shadow-gold: 0 8px 30px rgba(197, 147, 65, 0.24);
  --shadow-gold-sm: 0 4px 14px rgba(197, 147, 65, 0.18);

  /* Typography Fonts */
  --font-serif: 'Playfair Display', 'Cinzel', Georgia, serif;
  --font-display: 'Cinzel', 'Playfair Display', serif;
  --font-sanskrit: 'Noto Serif Devanagari', 'Rozha One', serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 30px;
  --radius-full: 9999px;
  --radius-arch: 240px 240px 20px 20px;
  --radius-arch-sm: 120px 120px 16px 16px;

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-base: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.6s cubic-bezier(0.16, 1, 0.3, 1);

  /* Max Widths */
  --container-max: 1240px;
  --container-wide: 1360px;
  --container-narrow: 920px;
}

/* ==========================================================================
   RESET & MOBILE-SAFE BASE
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  width: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg-white);
  color: var(--text-primary);
  line-height: 1.65;
  overflow-x: clip;
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  position: relative;
}

/* Selection Color */
::selection {
  background-color: var(--gold-subtle);
  color: var(--gold-deep);
}

img, svg, picture, video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
  touch-action: manipulation;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  outline: none;
  touch-action: manipulation;
}

/* Prevent auto-zoom on iOS Safari by enforcing min 16px */
input, select, textarea {
  font-size: 16px;
}

button {
  cursor: pointer;
  user-select: none;
}

ul, ol {
  list-style: none;
}

/* ==========================================================================
   TYPOGRAPHY SYSTEM
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.01em;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.heading-display {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5.5vw, 4.2rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
}

.heading-xl {
  font-size: clamp(1.65rem, 3.8vw, 3rem);
  font-weight: 600;
  line-height: 1.2;
}

.heading-lg {
  font-size: clamp(1.4rem, 2.8vw, 2.2rem);
  font-weight: 600;
  line-height: 1.25;
}

.heading-md {
  font-size: clamp(1.15rem, 2vw, 1.65rem);
  font-weight: 600;
  line-height: 1.3;
}

.heading-sm {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
}

/* Text Modifiers */
.text-gold {
  color: var(--gold-primary);
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.text-gold-solid {
  color: var(--gold-primary);
}

.text-muted {
  color: var(--text-muted);
}

.text-secondary {
  color: var(--text-secondary);
}

/* Sanskrit Label */
.sanskrit-invoke {
  font-family: var(--font-sanskrit);
  color: var(--gold-primary);
  font-size: clamp(0.85rem, 2.2vw, 1.05rem);
  letter-spacing: 0.12em;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  line-height: 1.4;
}

.sanskrit-invoke::before,
.sanskrit-invoke::after {
  content: "";
  display: inline-block;
  width: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-primary));
}

.sanskrit-invoke::after {
  background: linear-gradient(90deg, var(--gold-primary), transparent);
}

.section-label {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gold-deep);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.section-label::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 13px;
  background: var(--gold-gradient);
  border-radius: 2px;
}

/* ==========================================================================
   CONTAINER & LAYOUT
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(16px, 4vw, 28px);
  padding-right: clamp(16px, 4vw, 28px);
  position: relative;
  z-index: 1;
}

.container-wide {
  max-width: var(--container-wide);
}

.container-narrow {
  max-width: var(--container-narrow);
}

.section-padding {
  padding-top: clamp(3.5rem, 7vw, 6.5rem);
  padding-bottom: clamp(3.5rem, 7vw, 6.5rem);
}

.section-padding-sm {
  padding-top: clamp(2.2rem, 4.5vw, 4rem);
  padding-bottom: clamp(2.2rem, 4.5vw, 4rem);
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto clamp(2rem, 4vw, 3.5rem);
}

.section-header p {
  color: var(--text-secondary);
  font-size: clamp(0.92rem, 1.25vw, 1.05rem);
  margin-top: 10px;
  line-height: 1.6;
}

/* Flex & Grid Helpers */
.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-sm { gap: 10px; }
.gap-md { gap: 20px; }
.gap-lg { gap: 36px; }

/* ==========================================================================
   BUTTONS & CTAS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 26px;
  min-height: 48px;
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  touch-action: manipulation;
}

.btn svg {
  transition: transform var(--transition-base);
  flex-shrink: 0;
}

.btn:hover svg {
  transform: translateX(4px);
}

/* Primary Gold Button */
.btn-primary {
  background: var(--gold-gradient);
  color: #FFFFFF;
  box-shadow: var(--shadow-gold-sm);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: skewX(-20deg);
  transition: left 0.75s ease;
}

.btn-primary:hover {
  background: var(--gold-gradient-hover);
  box-shadow: var(--shadow-gold);
  transform: translateY(-2px);
}

.btn-primary:hover::before {
  left: 150%;
}

.btn-primary:active {
  transform: translateY(0);
}

/* Secondary Button / Outline */
.btn-secondary {
  background: rgba(255, 255, 255, 0.94);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  border-color: var(--gold-primary);
  color: var(--gold-deep);
  background: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline-gold {
  background: transparent;
  color: var(--gold-deep);
  border: 1px solid var(--gold-border-solid);
}

.btn-outline-gold:hover {
  background: var(--gold-gradient);
  color: #FFFFFF;
  border-color: transparent;
  box-shadow: var(--shadow-gold-sm);
  transform: translateY(-2px);
}

/* Text Link CTA */
.link-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--gold-deep);
  letter-spacing: 0.02em;
  transition: all var(--transition-fast);
  padding: 4px 0;
}

.link-cta svg {
  transition: transform var(--transition-fast);
}

.link-cta:hover {
  color: var(--gold-primary);
}

.link-cta:hover svg {
  transform: translateX(4px);
}

/* Small Circle Icon Button (44px touch friendly) */
.btn-circle {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.btn-circle:hover {
  border-color: var(--gold-primary);
  color: var(--gold-deep);
  box-shadow: var(--shadow-gold-sm);
  transform: scale(1.06);
}

/* ==========================================================================
   ORNAMENTAL ELEMENTS & MOTIFS
   ========================================================================== */

.ornament-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 1.2rem auto;
  color: var(--gold-primary);
  max-width: 280px;
}

.ornament-divider::before,
.ornament-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-border-solid), transparent);
}

.lotus-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-primary);
  flex-shrink: 0;
}

/* Sanctum Arch Frame */
.arch-frame {
  position: relative;
  border-radius: var(--radius-arch);
  padding: 8px;
  background: linear-gradient(180deg, #E6C57F 0%, rgba(197, 147, 65, 0.4) 60%, rgba(157, 114, 42, 0.2) 100%);
  box-shadow: 0 16px 44px rgba(197, 147, 65, 0.16), 0 6px 20px rgba(0, 0, 0, 0.06);
}

.arch-frame-inner {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius-arch) - 5px);
  background: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.arch-frame-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.arch-frame:hover .arch-frame-inner img {
  transform: scale(1.03);
}

/* Divine Badge */
.gold-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid var(--gold-border-solid);
  box-shadow: var(--shadow-gold-sm);
  color: var(--gold-deep);
  text-align: center;
  padding: 4px;
}

.gold-badge .badge-label {
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gold-primary);
}

.gold-badge .badge-year {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold-deep);
  line-height: 1.1;
}

/* ==========================================================================
   ANIMATIONS & TRANSITIONS
   ========================================================================== */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulseGold {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(197, 147, 65, 0.35);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(197, 147, 65, 0);
  }
}

@keyframes floatGentle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger reveals */
.stagger-1 { transition-delay: 0.06s; }
.stagger-2 { transition-delay: 0.12s; }
.stagger-3 { transition-delay: 0.18s; }
.stagger-4 { transition-delay: 0.24s; }

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }
}
