/* ==========================================================================
   Root Variables - ISKCON Inspired Palette & Shared Values
   ========================================================================== */
:root {
  /* Colors */
  --color-saffron: #f48031;
  --color-saffron-dark: #d2651e;
  --color-krishna-blue: #1c3d5a;
  --color-krishna-blue-dark: #0f2438;
  --color-krishna-blue-light: #2c5a85;
  --color-temple-cream: #fbf8f1;
  --color-soft-gold: #e5c158;
  --color-leaf-green: #4b8045;
  --color-lotus-pink: #df8093;
  
  --color-white: #ffffff;
  --color-black: #111111;
  --color-text: #2c3e50;
  --color-text-light: #5a6c7d;
  --color-error: #e74c3c;

  /* Typography */
  --font-primary: 'Outfit', sans-serif;
  --font-secondary: 'Lora', serif; /* Used for quotes and spiritual teaching emphasis */

  /* Spacing */
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
  --space-xxl: 8rem;

  /* RNG Bound Variables (these may be updated inline by JS) */
  --rng-bg-image: url('../images/bg_mandala_1.webp');
  --rng-border-radius: 0px;
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  color: var(--color-text);
  background-color: var(--color-temple-cream);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-sm);
  color: var(--color-krishna-blue);
}

p {
  margin-bottom: var(--space-md);
  font-size: 1.125rem;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

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

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: rgba(251, 248, 241, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(28, 61, 90, 0.1);
  transition: all 0.3s ease;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  max-width: 1440px;
  margin: 0 auto;
}

.site-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-saffron);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: var(--space-md);
}

.main-nav a {
  font-weight: 500;
  color: var(--color-krishna-blue);
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 1px;
  position: relative;
}

.main-nav a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--color-saffron);
  transition: width 0.3s ease;
}

.main-nav a:hover::after, .main-nav a.active::after {
  width: 100%;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-krishna-blue);
  cursor: pointer;
}

/* ==========================================================================
   Security Page (Code Entry)
   ========================================================================== */
.security-body {
  background: var(--color-krishna-blue);
  background-image: radial-gradient(circle at center, var(--color-krishna-blue-light) 0%, var(--color-krishna-blue-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  color: var(--color-temple-cream);
  overflow: hidden;
  position: relative;
}

/* Subtle spiritual animation background */
.security-bg-animation {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150vw;
  height: 150vw;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(
    from 0deg,
    rgba(229, 193, 88, 0.05) 0deg 10deg,
    transparent 10deg 20deg
  );
  animation: slowSpin 120s linear infinite;
  z-index: 0;
}

.security-container {
  position: relative;
  z-index: 10;
  text-align: center;
  background: rgba(15, 36, 56, 0.6);
  backdrop-filter: blur(20px);
  padding: var(--space-xl);
  border-radius: 20px;
  border: 1px solid rgba(229, 193, 88, 0.2);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  max-width: 500px;
  width: 90%;
  animation: fadeIn 1s ease-out;
}

.security-container h1 {
  color: var(--color-soft-gold);
  margin-bottom: var(--space-sm);
  font-size: 2.5rem;
}

.security-container p {
  color: rgba(251, 248, 241, 0.8);
  margin-bottom: var(--space-lg);
  font-size: 1rem;
}

.password-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.password-input {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1.2rem;
  border: 2px solid rgba(229, 193, 88, 0.3);
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-temple-cream);
  border-radius: 8px;
  outline: none;
  transition: all 0.3s ease;
  text-align: center;
  letter-spacing: 2px;
}

.password-input:focus {
  border-color: var(--color-soft-gold);
  background: rgba(255, 255, 255, 0.1);
}

.btn-primary {
  padding: 1rem 2rem;
  background-color: var(--color-saffron);
  color: var(--color-white);
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background-color: var(--color-saffron-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(244, 128, 49, 0.3);
}

.auth-error {
  color: var(--color-lotus-pink);
  margin-top: var(--space-sm);
  font-size: 0.9rem;
  min-height: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.auth-error.visible {
  opacity: 1;
}

/* ==========================================================================
   Page Wrappers & Layout Sections
   ========================================================================== */
.page-wrapper {
  padding-top: 80px; /* Offset for sticky header */
  min-height: calc(100vh - 300px);
}

.section {
  padding: var(--space-xl) 0;
  position: relative;
}

.page-hero {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  color: var(--color-white);
  text-align: center;
}

.page-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(to bottom, rgba(28, 61, 90, 0.3), rgba(15, 36, 56, 0.8));
  z-index: 1;
}

.page-hero img {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
}

.page-hero .container {
  position: relative;
  z-index: 2;
}

.page-hero h1 {
  color: var(--color-white);
  font-size: 4rem;
  margin-bottom: var(--space-sm);
  text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.page-hero p {
  font-size: 1.5rem;
  max-width: 800px;
  margin: 0 auto;
  text-shadow: 0 2px 5px rgba(0,0,0,0.5);
  color: var(--color-temple-cream);
}


/* ==========================================================================
   Random Generative Design (RNG) System
   ========================================================================== */
/* These classes are applied dynamically by main.js to `.rng-section` elements */

/* Layout & Order RNG */
.rng-reverse { flex-direction: row-reverse !important; }
.rng-stack { flex-direction: column !important; }
.rng-grid { display: grid !important; grid-template-columns: 1fr 1fr; gap: var(--space-lg); }

/* Shape RNG (Applied to inner content blocks or images) */
.rng-shape-organic-1 { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
.rng-shape-organic-2 { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
.rng-shape-arch { border-radius: 50% 50% 0 0 / 20% 20% 0 0; }
.rng-shape-leaf { border-radius: 0 50% 0 50%; }

/* Background Motif RNG */
.rng-bg-saffron { background-color: rgba(244, 128, 49, 0.05); }
.rng-bg-blue { background-color: rgba(28, 61, 90, 0.05); }
.rng-bg-cream { background-color: var(--color-temple-cream); }
.rng-bg-gradient { background: linear-gradient(135deg, rgba(244, 128, 49, 0.05), rgba(28, 61, 90, 0.05)); }
.rng-bg-mandala {
  position: relative;
}
.rng-bg-mandala::after {
  content: '';
  position: absolute;
  top: 0; right: 0; width: 100%; height: 100%;
  background-image: var(--rng-bg-image);
  background-size: cover;
  background-position: center;
  opacity: 0.1;
  z-index: -1;
  pointer-events: none;
}

/* Typography RNG */
.rng-font-serif h2, .rng-font-serif h3 { font-family: var(--font-secondary); font-style: italic; }
.rng-font-large h2 { font-size: 3.5rem; }
.rng-font-colored h2 { color: var(--color-saffron); }

/* ==========================================================================
   Components & Common Elements
   ========================================================================== */

/* Split Section (Image + Text) */
.split-section {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.split-section .content {
  flex: 1;
}

.split-section .image-wrap {
  flex: 1;
  position: relative;
}

.split-section .image-wrap img {
  width: 100%;
  height: auto;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  transition: border-radius 1s ease; /* For RNG transitions */
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.card {
  background: var(--color-white);
  padding: var(--space-lg);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 4px;
  background: var(--color-saffron);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.card:hover::before {
  transform: scaleX(1);
}

.card h3 {
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
}

/* Counters */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  text-align: center;
}

.stat-item {
  padding: var(--space-md);
}

.stat-number {
  font-size: 4rem;
  font-weight: 800;
  color: var(--color-soft-gold);
  line-height: 1;
  margin-bottom: 0.5rem;
  font-family: var(--font-secondary);
}

.stat-label {
  font-size: 1.1rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-krishna-blue);
  letter-spacing: 1px;
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-sm);
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  aspect-ratio: 1 / 1;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(28, 61, 90, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: var(--space-md);
  text-align: center;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-overlay p {
  color: var(--color-white);
  margin: 0;
  font-weight: 500;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay p {
  transform: translateY(0);
}

/* Contact Form */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xxl);
}

.contact-form {
  background: var(--color-white);
  padding: var(--space-xl);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.05);
}

.form-group {
  margin-bottom: var(--space-md);
}

.form-control {
  width: 100%;
  padding: 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-family: var(--font-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #f9f9f9;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-saffron);
  background: var(--color-white);
  box-shadow: 0 0 0 4px rgba(244, 128, 49, 0.1);
}

textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

.contact-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.info-item {
  margin-bottom: var(--space-lg);
}

.info-item h4 {
  color: var(--color-soft-gold);
  margin-bottom: 0.5rem;
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: var(--space-md);
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  background: var(--color-krishna-blue);
  color: var(--color-white);
  border-radius: 50%;
  font-weight: bold;
  transition: all 0.3s ease;
}

.social-links a:hover {
  background: var(--color-saffron);
  transform: translateY(-3px);
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slowSpin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background-color: var(--color-krishna-blue-dark);
  color: rgba(255, 255, 255, 0.7);
  padding: var(--space-xl) 0 var(--space-md);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.footer-brand h3 {
  color: var(--color-white);
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.footer-brand p {
  max-width: 400px;
}

.footer-links h4 {
  color: var(--color-soft-gold);
  margin-bottom: 1.5rem;
  letter-spacing: 1px;
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.8rem;
}

.footer-links a:hover {
  color: var(--color-saffron);
}

.footer-bottom {
  text-align: center;
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
}

.footer-bottom strong {
  color: var(--color-white);
}

.footer-bottom a {
  color: var(--color-saffron);
}

.footer-bottom a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 992px) {
  .split-section, .rng-grid, .contact-grid {
    flex-direction: column !important;
    display: flex !important;
  }
  .page-hero h1 {
    font-size: 3rem;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }
  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background: var(--color-krishna-blue);
    padding: 80px var(--space-md) var(--space-md);
    transition: right 0.3s ease;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
  }
  .main-nav.active {
    right: 0;
  }
  .main-nav ul {
    flex-direction: column;
    gap: var(--space-md);
  }
  .main-nav a {
    color: var(--color-white);
    font-size: 1.2rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}
