/* 
  Modern Premium CSS 
  Theme: Saffron, Gold, Dark/Light Mode
*/

:root {
  /* Colors - Light Theme */
  --primary: #d35400;
  /* Deep Saffron */
  --primary-light: #e67e22;
  --secondary: #f1c40f;
  /* Gold */
  --bg-body: #ffffff;
  --bg-subtle: #f9fafb;
  --bg-card: #ffffff;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --glass-bg: rgba(255, 255, 255, 0.8);

  /* Layout */
  --container-width: 1200px;
  --nav-height: 80px;
  --nav-height-desktop: 80px;
  --nav-height-mobile: 90px;
  --top-bar-height: 40px;
  --radius-sm: 0.5rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;

  /* Fonts */
  --font-body: 'Raleway', sans-serif;
  --font-heading: 'Raleway', sans-serif;
}

[data-theme="dark"] {
  --bg-body: #111827;
  --bg-subtle: #1f2937;
  --bg-card: #374151;
  --text-main: #f9fafb;
  --text-muted: #d1d5db;
  --border: #374151;
  --glass-bg: rgba(17, 24, 39, 0.8);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 140px;
  /* Fix anchor link overlap */
  overflow-x: hidden;
}

:root {
  color-scheme: light;
}

[data-theme="dark"] {
  color-scheme: dark;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  width: 100%;
}

body.menu-open {
  overflow: hidden;
  height: 100vh;
}

/* Fix Chrome Autofill Background color */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px var(--bg-subtle) inset !important;
  -webkit-text-fill-color: var(--text-main) !important;
  transition: background-color 5000s ease-in-out 0s;
}

img {
  max-width: 100%;
  display: block;
  height: auto;
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* Utilities */
.container {
  width: 90%;
  max-width: var(--container-width);
  margin: 0 auto;
}

.section {
  padding: 4rem 0;
}

#about.section {
  padding-bottom: 1.5rem;
}

#events.section {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  background-color: #E8F3E8 !important;
  transition: background-color 0.3s ease;
}

/* Kainkaryam section text overrides for light background */
#events.section .section-title,
#events.section h2 {
  color: var(--text-main);
}

#events.section .section-subtitle {
  color: var(--text-muted);
}

#services.section {
  padding-top: 1.5rem;
  background: #F4A261 !important;
  transition: background 0.3s ease;
}

/* Anugraham section text overrides for F4A261 background */
#services.section .section-title,
#services.section h2 {
  color: #222;
}

#services.section .section-subtitle {
  color: #444;
}

.bg-subtle {
  background-color: var(--bg-subtle);
  transition: background-color 0.3s ease;
}

.bg-dark {
  background-color: #3B2F2F;
  color: #fff;
}

.center-text {
  text-align: center;
}

.light-text {
  color: #fff;
}

.announcement-bar {
  width: 100%;
  overflow: hidden;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  position: relative;
  z-index: 2;
  margin-top: 0;
}

.announcement-track {
  display: inline-block;
  white-space: nowrap;
  transform: translateX(0);
  animation: none;
  will-change: transform;
}

.announcement-track span {
  color: var(--primary);
  font-weight: 500;
  font-size: 17px;
}

/* Typography */
h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.light-text .section-subtitle {
  color: #ccc;
}

.logo-img {
  height: 50px;
  width: auto;
  margin-right: 0.75rem;
  background: #ffffff;
  padding: 4px;
  border-radius: 4px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Global Image Modal */
.image-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  padding-top: 50px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.9);
  animation: fadeIn 0.3s;
}

.image-modal-content {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 600px;
  /* Slightly smaller for better focus */
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  background: #ffffff;
  /* White background to make black sketch visible */
  padding: 20px;
  /* Padding for framing */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  animation: zoomIn 0.3s;
}

.image-modal-caption {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  text-align: center;
  color: #ccc;
  padding: 10px 0;
  height: 150px;
}

.image-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: var(--text-muted);
  font-size: 1.5rem;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: var(--bg-subtle);
}

.image-modal-close:hover,
.image-modal-close:focus {
  color: var(--primary);
  background-color: var(--border);
  text-decoration: none;
  cursor: pointer;
}

@keyframes zoomIn {
  from {
    transform: scale(0)
  }

  to {
    transform: scale(1)
  }
}

@keyframes fadeIn {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  min-height: 80px;
  z-index: 1000;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s ease;
}

.nav-content {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-heading);
}

.logo-icon {
  color: var(--primary);
  font-size: 1.8rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

/* Prevent pre-hydration navbar text flash when JS rewrites menu labels */
.js .nav-links.nav-hydrating {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.js .nav-links.nav-ready {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.nav-item {
  position: relative;
}

.nav-link,
.top-link,
.nav-link.top-link {
  font-weight: 500;
  font-size: 1rem;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.dropdown-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  line-height: 1;
  color: var(--text-muted);
  transition: transform 0.25s ease, color 0.2s ease;
  margin-left: 2px;
  pointer-events: none;
}

.nav-item:hover .dropdown-caret,
.nav-item.open .dropdown-caret {
  transform: rotate(180deg);
  color: var(--primary);
}

.dropdown-menu {
  position: absolute;
  left: 0;
  top: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  min-width: 220px;
  display: none;
  flex-direction: column;
  z-index: 1000;
  padding: 0.5rem 0;
}

.nav-item:hover>.dropdown-menu,
.nav-item.open>.dropdown-menu {
  display: flex;
}

.dropdown-item {
  padding: 0.55rem 1rem;
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.95rem;
  transition: background 0.2s, color 0.2s;
}

.dropdown-item:hover {
  background: var(--bg-subtle);
}

.login-dropdown .dropdown-menu {
  right: 0;
  left: auto;
}

/* Hidden by default; shown inside media queries */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--text-main);
  line-height: 0;
}

/* Icon state: show hamburger, hide × by default */
.mobile-menu-btn .close-icon {
  display: none;
  font-size: 1.4rem;
  line-height: 1;
}

.mobile-menu-btn.is-open .hamburger-icon {
  display: none;
}

.mobile-menu-btn.is-open .close-icon {
  display: block;
}

@media (max-width: 991px) {

  /* ── Off-canvas drawer: hamburger shows, nav slides in from right ── */
  .nav-content {
    padding-right: 56px;
  }

  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1001;
    padding: 6px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(6px);
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    color: var(--text-main);
  }

  [data-theme="dark"] .mobile-menu-btn {
    background: rgba(17, 24, 39, 0.85);
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    right: 0;
    bottom: auto;
    height: auto;
    max-height: calc(100vh - var(--nav-height) - 0.5rem);
    background: var(--bg-card);
    width: min(360px, 100%);
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    padding: 0.35rem 1.25rem 0.35rem;
    transform: translateX(110%);
    transition: transform 0.3s ease, visibility 0.3s;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-link.toggle-indicator {
    width: 100%;
    justify-content: flex-start;
    gap: 0.55rem;
  }

  .nav-link.toggle-indicator .dropdown-caret {
    color: var(--primary);
    font-size: 1rem;
  }

  .dropdown-menu {
    position: static;
    border: 0;
    box-shadow: none;
    padding: 0;
    display: none;
  }

  .nav-item.open>.dropdown-menu {
    display: flex;
  }
}


.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: var(--primary);
  transition: width 0.3s;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.icon-btn {
  font-size: 1.2rem;
  padding: 0.5rem;
  color: var(--text-main);
  border-radius: 50%;
  transition: background 0.2s;
}

.icon-btn:hover {
  background-color: var(--bg-subtle);
}

/* Hero */
/* Hero Grid Layout */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  align-items: center;
  padding-top: var(--nav-height-desktop);
  /* Sit flush below fixed navbar */
  height: clamp(360px, 58vh, 430px);
  min-height: 360px;
  max-height: 430px;
  overflow: hidden;
}

.hero-slide {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  height: 100%;
  /* 👈 FIX */
  position: relative;
  background-size: cover;
  background-position: center 30%;
  /* 👈 BETTER CROPPING */
  background-repeat: no-repeat;
  /* 👈 ADD */
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  z-index: 0;
  pointer-events: none;
  filter: brightness(1.15);

  display: flex;
  align-items: center;
  /* 👈 FIX (was flex-start) */
  color: #fff;
}

.hero-slide.active {
  opacity: 1;
  z-index: 1;
  pointer-events: auto;
}

/* Sahasra / portrait image — anchor top so head is never cropped on desktop */
.hero-slide--portrait {
  background-size: cover;
  background-position: center top;
}

@media (max-width: 768px) {
  .hero-slide--portrait {
    background-position: center top;
  }
}

/* Acharya slide — acharya stands on the left, anchor to left on mobile */
.hero-slide--acharya {
  background-position: center center;
}

@media (max-width: 768px) {
  .hero-slide--acharya {
    background-position: 15% center;
  }
}

/* Overlay via pseudo-element */
.hero-slide::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.1));
  z-index: -1;
}

/* Centered bottom CTA button */
.hero-center-btn {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.hero-center-desc {
  position: absolute;
  left: 50%;
  bottom: 6.1rem;
  transform: translateX(-50%);
  z-index: 2;
  width: min(90vw, 760px);
  text-align: center;
}

.hero-center-desc .hero-desc {
  margin: 0;
  color: #f3f4f6;
  font-size: 1.05rem;
  line-height: 1.45;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
}

.hero-center-btn .btn {
  padding: 0.9rem 2rem;
  font-size: 1rem;
  white-space: nowrap;
}

/* Acharya accordion button */
.hero-accordion-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.hero-accordion-btn .btn-caret {
  font-size: 1.1rem;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.hero-accordion-btn[aria-expanded="true"] .btn-caret {
  transform: rotate(180deg);
}

/* Quote panel */
.hero-quote-panel {
  position: absolute;
  bottom: 5.2rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 640px);
  z-index: 3;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.35s ease;
}

.hero-quote-panel.open {
  max-height: 220px;
  opacity: 1;
}

.hero-quote-body {
  margin: 0;
  padding: 1.1rem 1.4rem;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: #f3f4f6;
  text-align: left;
}

.hero-quote-body p {
  margin: 0 0 0.55rem;
  font-size: clamp(0.9rem, 2.2vw, 1.05rem);
  font-style: italic;
  line-height: 1.55;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.hero-quote-body footer {
  font-size: 0.8rem;
  color: var(--primary);
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.02em;
}

@media (max-width: 768px) {
  .hero-quote-panel {
    bottom: 5.8rem;
    width: min(96vw, 420px);
  }

  .hero-quote-body p {
    font-size: 0.88rem;
  }
}

/* Ensure slide content behaves like original hero content */
.hero-slide .container {
  width: 90%;
  max-width: 1140px;
  /* 👈 FIX */
  margin: 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* ── Hero Slider Navigation Arrows ── */
.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(255, 255, 255, 0.13);
  border: 2px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  outline: none;
  padding: 0;
}

.hero-arrow:hover:not(.hero-arrow--disabled),
.hero-arrow:focus-visible:not(.hero-arrow--disabled) {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.75);
  transform: translateY(-50%) scale(1.1);
}

.hero-arrow--disabled {
  opacity: 0.25;
  cursor: not-allowed;
  pointer-events: none;
}

.hero-arrow-prev {
  left: 1.5rem;
}

.hero-arrow-next {
  right: 1.5rem;
}

.hero-arrow i {
  font-size: 1.5rem;
  line-height: 1;
  display: block;
}

@keyframes bgZoom {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.1);
  }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 500px;
  margin-top: auto;
  margin-bottom: 6.25rem;
}

/* Split layout for Acharya Slide */
.hero-content-split {
  max-width: 1000px;
  /* Wider container */
  display: flex;
  align-items: center;
  gap: 3rem;
}

.hero-text {
  flex: 1;
}

.hero-person-img {
  flex: 0 0 300px;
  /* Fixed width for image container */
  max-width: 300px;
}

.hero-person-img img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  /* Strong shadow for depth */
  border: 4px solid rgba(255, 255, 255, 0.2);
}

/* Mobile adjustments for split layout */
@media (max-width: 768px) {
  .hero-content-split {
    flex-direction: column-reverse;
    /* Image on top? or text on top? Text top is usually better for context */
    align-items: flex-start;
    gap: 2rem;
  }

  .hero-person-img {
    flex: none;
    max-width: 200px;
    /* Smaller on mobile */
    margin-bottom: 1rem;
  }
}

.hero-subtitle-wrapper {
  position: relative;
  z-index: 2;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.hero-subtitle {
  display: inline-block;
  background: rgba(211, 84, 0, 0.2);
  backdrop-filter: blur(5px);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  border: 1px solid rgba(211, 84, 0, 0.5);
  font-family: var(--font-body);
  letter-spacing: 1px;
}

.hero-title {
  font-size: 4rem;
  margin-bottom: 1rem;
  text-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.hero-desc {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  color: #e5e7eb;
}

.hero-btns {
  display: flex;
  gap: 1rem;
}

/* Components */
.btn {
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: inline-block;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-secondary {
  background: var(--secondary);
  color: #000;
}

.btn-outline {
  border: 2px solid var(--btn-outline-border, rgba(255, 255, 255, 0.9));
  color: var(--btn-outline-color, rgba(255, 255, 255, 0.9));
  background: transparent;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.btn-outline:hover {
  background: var(--btn-outline-hover-bg, #fff);
  color: var(--btn-outline-hover-color, #000);
}

.btn-block {
  display: block;
  width: 100%;
  text-align: center;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: stretch;
}

/* Full-width two-column layout for redesigned about section */
/* Centered single-column about layout */
.about-centered {
  max-width: 820px;
  margin: 0 auto;
}

/* About section — soft ivory-saffron gradient */
#about.section {
  background: linear-gradient(160deg, #fffaf4 0%, #fef3e2 55%, #fdf6ee 100%);
  position: relative;
}

#about.section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(ellipse at 80% 20%, rgba(211, 84, 0, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 10% 80%, rgba(230, 126, 34, 0.05) 0%, transparent 55%);
  pointer-events: none;
}

[data-theme="dark"] #about.section {
  background: linear-gradient(160deg, #1e1508 0%, #231a09 55%, #1c1407 100%);
}

[data-theme="dark"] #about.section::before {
  background-image: radial-gradient(ellipse at 80% 20%, rgba(211, 84, 0, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 10% 80%, rgba(230, 126, 34, 0.08) 0%, transparent 55%);
}

.about-main-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Date & Location strip */
.about-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.75rem;
  margin-top: 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-subtle, #f9f6f1);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.about-meta-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
}

.about-meta-item i {
  color: var(--primary);
  font-size: 1rem;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .about-meta {
    flex-direction: column;
    gap: 0.6rem;
  }
}

/* Enhanced Section Typography */
.section-title {
  font-size: 3rem;
  /* Increased size */
  color: var(--primary);
  margin-bottom: 1.5rem;
  /* Better spacing */
  position: relative;
}

/* Decorative Divider */
.section-title::after {
  content: '';
  display: block;
  width: 80px;
  height: 4px;
  background: var(--secondary);
  margin: 1rem auto 0 auto;
  /* 👈 This centers it */
  border-radius: 2px;
}

/* Center divider for centered text */
.center-text .section-title::after {
  margin-left: auto;
  margin-right: auto;
}

.section-lead {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-style: italic;
  color: var(--primary-light);
  line-height: 1.6;
  margin-bottom: 2rem;
  border-left: 4px solid var(--border);
  padding-left: 1.5rem;
}

.about-img-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  height: 100%;
  padding: 0.75rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: visible;
  /* Allow badge to pop out */
}

.about-img-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 100%;
  flex: 0 0 auto;
  object-fit: contain;
  object-position: center;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  /* Softer, deeper shadow */
  transition: transform 0.3s ease;
}

.about-img:hover {
  transform: translateY(-5px);
}

.stats-list {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
}

.stats-list li {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stats-list i {
  font-size: 2rem;
  color: var(--secondary);
  background: rgba(241, 196, 15, 0.1);
  padding: 0.8rem;
  border-radius: 50%;
}

.about-right-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.5rem;
  text-align: left;
  min-height: 100%;
}

.about-right-split {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.about-right-image {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
}

.about-right-details {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
}

.about-title {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.title-icon {
  font-size: 1.5rem;
  margin-top: 0.4rem;
  line-height: 1;
}

.title-text h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  color: var(--primary);
}

.title-text h2:last-child::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background: var(--secondary);
  margin-top: 6px;
  border-radius: 2px;
}

.about-right-image img {
  width: 220px;
  border-radius: 16px;
  opacity: 1;
}

[data-theme="dark"] .about-right-image img {
  opacity: 1;
  filter: brightness(1.2) contrast(1.1);
}

[data-theme="dark"] .about-right-image {
  background: rgba(255, 255, 255, 0.05);
  padding: 10px;
  border-radius: 16px;
}

.about-left-cta {
  margin-top: 1rem;
  padding-top: 0;
}

.about-points {
  list-style-type: disc !important;
  padding-left: 1.5rem;
}

.about-points li {
  display: list-item;
  margin-bottom: 0.4rem;
  color: #3d2b1f;
  font-size: 0.97rem;
  line-height: 1.6;
}

[data-theme="dark"] .about-points li {
  color: #e8d5b7;
}

.about-description {
  display: flex;
  flex-direction: column;
  color: var(--text-main);
  line-height: 1.75;
}

.about-description p {
  margin-bottom: 0.75rem;
  color: #3d2b1f;
  font-size: 1.01rem;
}

.about-description ul,
.custom-bullets {
  list-style-type: disc !important;
  padding-left: 1.5rem;
}

.about-description li,
.custom-bullets li {
  display: list-item;
  margin-bottom: 0.55rem;
  color: #4a3220;
  font-size: 0.97rem;
}

[data-theme="dark"] .about-description p,
[data-theme="dark"] .about-description li,
[data-theme="dark"] .custom-bullets li {
  color: #e8d5b7;
}

.about-cta-bottom {
  margin-top: auto;
  padding-top: 1rem;
  text-align: left;
}

.about-cta-bottom .btn {
  padding: 0.8rem 1.5rem;
}

.about-cta {
  margin-top: 1rem;
}

.om-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0.5rem 0 0.6rem;
  color: var(--primary);
  letter-spacing: -0.01em;
}

.highlight-line {
  font-weight: 600;
  margin-top: 0.5rem;
  color: #5c3d1e;
}

[data-theme="dark"] .highlight-line {
  color: #f0c98a;
}

.custom-bullets {
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}

.custom-bullets li {
  margin-bottom: 0.5rem;
}


@media (max-width: 768px) {
  .about-right-split {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .about-right-image {
    align-self: center;
  }

  .about-right-image img {
    width: min(220px, 100%);
    max-width: 100%;
  }

  .about-right-details,
  .about-description,
  .title-text {
    width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .about-img {
    height: auto;
    flex: 0 0 auto;
  }

  .about-left-cta {
    margin-top: 1rem;
    padding-top: 0;
    text-align: center;
  }

  .about-cta-bottom {
    margin-top: 1rem;
    padding-top: 0;
    text-align: center;
  }
}

/* ═══════════════════════════════════════════════════
   INVITATION-STYLE ABOUT SECTION
   ═══════════════════════════════════════════════════ */

/* Pulse animation for high-priority CTA */
@keyframes invite-pulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(var(--primary-rgb, 180, 80, 10), 0.45);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(var(--primary-rgb, 180, 80, 10), 0);
  }
}

@keyframes invite-badge-pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.75;
  }
}

.invitation-wrapper {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
  max-width: 1160px;
  margin: 0 auto;
}

/* ── Left Panel ── */
.invite-left {
  flex: 0 0 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
}

.invite-heading {
  width: 100%;
}

.invite-supertitle {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-style: italic;
  color: var(--primary);
  margin-bottom: 0.3rem;
  line-height: 1.4;
}

.invite-deity-name {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
  margin: 0 0 0.35rem;
}

.invite-deity-sub {
  font-size: 0.875rem;
  color: var(--text-muted, #6b5744);
  font-style: italic;
  line-height: 1.55;
}

[data-theme="dark"] .invite-deity-name {
  color: #f0c98a;
}

[data-theme="dark"] .invite-supertitle {
  color: #e8c87a;
}

[data-theme="dark"] .invite-deity-sub {
  color: #c4a97a;
}

/* Deity image */
.invite-img-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}

.invite-deity-img {
  width: 100%;
  max-width: 280px;
  height: auto;
  border-radius: 16px;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(160, 80, 10, 0.28));
  transition: transform 0.3s ease;
}

.invite-deity-img:hover {
  transform: scale(1.02);
}

/* Event details strip */
.invite-event-details {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.9rem 1rem;
  background: rgba(255, 248, 238, 0.85);
  border-radius: 10px;
  border-left: 3px solid var(--primary);
}

[data-theme="dark"] .invite-event-details {
  background: rgba(255, 255, 255, 0.06);
  border-left-color: #f0c98a;
}

.invite-detail-item {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.88rem;
  color: var(--text-main);
  text-align: left;
}

.invite-detail-item i {
  color: var(--primary);
  font-size: 0.95rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.invite-detail-item a {
  color: var(--primary);
  text-decoration: none;
}

.invite-detail-item a:hover {
  text-decoration: underline;
}

[data-theme="dark"] .invite-detail-item {
  color: #e8d5b7;
}

[data-theme="dark"] .invite-detail-item i {
  color: #f0c98a;
}

[data-theme="dark"] .invite-detail-item a {
  color: #f0c98a;
}

/* ── Support CTA ── */
.invite-support {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

/* Primary CTA — prominent, pulsing */
.invite-support-main-btn {
  width: 100%;
  text-align: center;
  justify-content: center;
  font-size: 1.05rem;
  padding: 0.85rem 1.75rem;
  animation: invite-pulse 2.6s ease-in-out infinite;
  letter-spacing: 0.01em;
}

.invite-support-divider {
  font-size: 0.75rem;
  color: var(--text-muted, #8a6a50);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
  position: relative;
}

.invite-support-divider::before,
.invite-support-divider::after {
  content: '';
  display: inline-block;
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.4;
  vertical-align: middle;
  margin: 0 0.5rem;
}

[data-theme="dark"] .invite-support-divider {
  color: #c4a97a;
}

/* Zeffy + QR side-by-side on desktop */
.invite-support-alt {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.invite-zeffy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  padding: 0.55rem 1.1rem;
  border: 1.5px solid var(--primary);
  border-radius: 7px;
  transition: background 0.2s, color 0.2s, transform 0.15s;
  white-space: nowrap;
}

.invite-zeffy-btn:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}

[data-theme="dark"] .invite-zeffy-btn {
  color: #f0c98a;
  border-color: #f0c98a;
}

[data-theme="dark"] .invite-zeffy-btn:hover {
  background: #f0c98a;
  color: #1a0f00;
}

.invite-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.invite-qr-img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  border-radius: 8px;
  padding: 5px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.invite-qr-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted, #6b5744);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

[data-theme="dark"] .invite-qr-label {
  color: #c4a97a;
}

/* ── Right Panel ── */
.invite-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Key-moment callout banner */
.invite-key-moment {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 1.1rem;
  background: linear-gradient(135deg, #fff3df 0%, #fde8c0 100%);
  border-radius: 10px;
  border-left: 4px solid var(--primary);
  font-size: 0.9rem;
  color: #5c3610;
  font-weight: 500;
  line-height: 1.45;
}

.invite-key-moment i {
  color: var(--primary);
  font-size: 1.15rem;
  flex-shrink: 0;
}

.invite-key-moment strong {
  color: var(--primary);
}

[data-theme="dark"] .invite-key-moment {
  background: linear-gradient(135deg, #2a1a05 0%, #3a2208 100%);
  border-left-color: #f0c98a;
  color: #e8d5b7;
}

[data-theme="dark"] .invite-key-moment i,
[data-theme="dark"] .invite-key-moment strong {
  color: #f0c98a;
}

/* Schedule title */
.invite-schedule-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0;
}

.invite-schedule-title::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background: var(--secondary, #e6a817);
  margin: 0.4rem auto 0;
  border-radius: 2px;
}

[data-theme="dark"] .invite-schedule-title {
  color: #f0c98a;
}

/* Schedule container */
.invite-schedule {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Day rows */
.invite-day {
  padding: 0.8rem 0.75rem;
  border-bottom: 1px solid rgba(180, 120, 50, 0.15);
  border-radius: 8px;
  transition: background 0.18s;
}

.invite-day:hover {
  background: rgba(255, 248, 238, 0.7);
}

.invite-day:first-child {
  padding-top: 0.4rem;
}

.invite-day:last-child {
  border-bottom: none;
}

/* Grand Consecration day — visually distinct */
.invite-day--grand {
  background: linear-gradient(135deg, #fff8ef 0%, #fdefd8 100%);
  border: 1.5px solid rgba(var(--primary-rgb, 180, 80, 10), 0.28);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  margin-top: 0.25rem;
}

.invite-day--grand:hover {
  background: linear-gradient(135deg, #fef3e2 0%, #fde8c5 100%);
}

[data-theme="dark"] .invite-day:hover {
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .invite-day--grand {
  background: linear-gradient(135deg, #2a1a05 0%, #3a2208 100%);
  border-color: rgba(240, 201, 138, 0.35);
}

[data-theme="dark"] .invite-day--grand:hover {
  background: linear-gradient(135deg, #301e06 0%, #42280a 100%);
}

.invite-day-name {
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

[data-theme="dark"] .invite-day-name {
  color: #f0c98a;
}

.invite-day-badge {
  font-family: 'Raleway', sans-serif;
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #fff;
  background: var(--primary);
  padding: 0.2em 0.75em;
  border-radius: 20px;
  animation: invite-badge-pulse 2s ease-in-out infinite;
}

.invite-day-events {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.invite-event {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 0.2rem 0.65rem;
  font-size: 0.9rem;
  line-height: 1.5;
  padding: 0.25rem 0.3rem;
  border-radius: 5px;
  transition: background 0.15s;
}

.invite-event:hover {
  background: rgba(180, 80, 10, 0.05);
}

.invite-time {
  font-weight: 600;
  color: #7a4f2e;
  font-size: 0.84rem;
}

.invite-ritual {
  color: #3d2b1f;
}

[data-theme="dark"] .invite-time {
  color: #d4a96a;
}

[data-theme="dark"] .invite-ritual {
  color: #e8d5b7;
}

/* Prana Pratista focal card */
.invite-pratista-moment {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, var(--primary, #c05a0a) 0%, #e07820 100%);
  border-radius: 10px;
  margin-top: 0.35rem;
  box-shadow: 0 4px 16px rgba(180, 80, 10, 0.3);
}

.invite-pratista-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}

.invite-pratista-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.invite-pratista-time {
  font-family: 'Raleway', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.invite-pratista-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
}

/* Dress Code */
.invite-dresscode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.1rem;
  padding: 0.65rem 1rem;
  background: rgba(255, 248, 238, 0.7);
  border-radius: 8px;
  font-size: 0.86rem;
}

[data-theme="dark"] .invite-dresscode {
  background: rgba(255, 255, 255, 0.05);
}

.invite-dresscode-title {
  font-weight: 700;
  color: var(--primary);
  width: 100%;
  margin-bottom: 0.1rem;
  font-size: 0.88rem;
}

[data-theme="dark"] .invite-dresscode-title {
  color: #f0c98a;
}

.invite-dresscode span:not(.invite-dresscode-title) {
  color: #4a3220;
}

[data-theme="dark"] .invite-dresscode span:not(.invite-dresscode-title) {
  color: #e8d5b7;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .invitation-wrapper {
    flex-direction: column;
    gap: 2rem;
  }

  .invite-left {
    flex: none;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
  }

  .invite-deity-img {
    max-width: 240px;
  }

  .invite-key-moment {
    font-size: 0.85rem;
  }
}

@media (max-width: 600px) {
  .invite-support-alt {
    flex-direction: column;
    gap: 0.75rem;
  }

  .invite-zeffy-btn {
    width: 100%;
    justify-content: center;
  }

  .invite-support-main-btn {
    font-size: 1rem;
  }
}

@media (max-width: 560px) {
  .invite-event {
    grid-template-columns: 1fr;
    gap: 0.05rem;
  }

  .invite-time {
    font-size: 0.78rem;
  }

  .invite-deity-name {
    font-size: 1.35rem;
  }

  .invite-schedule-title {
    font-size: 1.25rem;
  }

  .invite-day-name {
    font-size: 0.92rem;
  }

  .invite-key-moment {
    font-size: 0.82rem;
    padding: 0.6rem 0.85rem;
  }

  .invite-pratista-name {
    font-size: 1.1rem;
  }
}

/* Cards */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s ease, border-color 0.3s ease;
  border: 1px solid var(--border);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.card-content {
  padding: 1.5rem;
}

#events .card-content {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

#events .card-title {
  display: none;
}

#events .card-tags,
#events .donation-pills {
  display: none;
}

.card-meta {
  font-size: 0.85rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-title {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.card-text {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Services Scroller - Enhanced with Images */
.services-scroller {
  display: flex;
  overflow-x: auto;
  gap: 1.5rem;
  padding: 1rem 0 2rem;
  /* Extra padding for shadow */
  scroll-snap-type: x mandatory;
}

.service-card {
  /* min-width: 320px; Removed for grid layout */
  background: var(--bg-card);
  border-radius: var(--radius-md);
  scroll-snap-align: center;
  border: 1px solid var(--border);
  /* Keep border for structure */
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s, box-shadow 0.3s;
}

/* Value Cards for About Page - Interactive Overlay Style */
.value-card {
  padding: 0;
  overflow: hidden;
  height: 400px;
  /* Fixed height for overlay effect */
  position: relative;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: none;
}

.value-img-wrapper {
  height: 100%;
  width: 100%;
  position: absolute;
  inset: 0;
  z-index: 0;
}

.value-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.value-card:hover .value-img-wrapper img {
  transform: scale(1.15);
}

/* Gradient Overlay & Content */
.value-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 2.5rem 1.8rem;
  z-index: 2; /* Ensure it's above the image */
  transform: translateY(0);
  /* Always visible for readability */
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.5) 50%, rgba(0, 0, 0, 0.2) 100%);
  transition: transform 0.5s ease-out, background 0.4s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  /* Align bottom */
  align-items: center;
  /* Center horizontally */
  text-align: center;
  height: 100%;
  pointer-events: none;
}

.value-card-content h3 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--primary) !important;
  /* Match Our Core Values heading */
  margin-bottom: 0.8rem;
  position: relative;
  display: inline-block;
  font-weight: 700;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 1), 0 0 8px rgba(0, 0, 0, 1);
  /* Stronger shadow for visibility on images */
  transform: translateY(0);
  transition: transform 0.4s ease;
}

.value-card-content p {
  color: #FFFFFF !important;
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 600; /* Slightly bolder for readability */
  text-shadow: 0 2px 10px rgba(0, 0, 0, 1), 0 0 5px rgba(0, 0, 0, 1);
  /* Added shadow for readability */
  opacity: 1 !important;
  transform: translateY(0) !important;
  transition: opacity 0.4s ease 0.1s, transform 0.4s ease 0.1s;
  /* Delay for cascade effect */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.value-card:hover .value-card-content p {
  opacity: 1;
  transform: translateY(0);
}

/* Decorative Accent */
.value-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
  z-index: 2;
}

.value-card:hover::after {
  transform: scaleX(1);

  position: relative;
  display: flex;
  flex-direction: column;
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.service-img-wrapper {
  height: 200px;
  overflow: hidden;
  position: relative;
}

.service-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.service-card:hover .service-img {
  transform: scale(1.1);
}

.service-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.service-icon-overlay {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.9);
  padding: 0.5rem;
  border-radius: 50%;
  color: var(--primary);
  font-size: 1.2rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .service-icon-overlay {
  background: rgba(0, 0, 0, 0.8);
}

.hidden-scrollbar::-webkit-scrollbar {
  display: none;
}

.hidden-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Gallery Masonry */
#gallery .gallery-masonry {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}

#gallery .gallery-item {
  height: 220px;
  overflow: hidden;
  border-radius: 12px;
}

#gallery .gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#gallery .gallery-item:nth-child(n+6) {
  display: none;
}

#gallery .gallery-item:nth-child(2n) {
  grid-row: auto;
}

.gallery-masonry {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  grid-auto-rows: 200px;
  gap: 1rem;
}

.gallery-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

.gallery-item:nth-child(2n) {
  grid-row: span 2;
}

/* Donation */
.donation-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.donation-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.donation-pills span {
  background: rgba(211, 84, 0, 0.1);
  color: var(--primary);
  padding: 0.3rem 0.8rem;
  border-radius: 2rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.donation-form-card {
  background: var(--bg-subtle);
  padding: 2rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.form-group {
  position: relative;
  margin-bottom: 1.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

/* Label default position */
.form-group label {
  position: absolute;
  left: 0.8rem;
  top: 0.8rem;
  color: var(--text-muted);
  transition: all 0.2s ease;
  pointer-events: none;
  background: transparent;
  z-index: 2;
}

.form-group textarea {
  min-height: 3.5rem;
  resize: vertical;
  width: 100%;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);

  color: var(--text-main);
  font-size: 1rem;
  outline: none;
  position: relative;
  z-index: 1;
}

/* Floating label behavior for textarea (matches inputs) */
.form-group textarea:focus+label,
.form-group textarea:not(:placeholder-shown)+label {
  top: -0.6rem;
  font-size: 0.8rem;
  color: var(--primary);
}

/* Floating behavior */
.form-group input:focus+label,
.form-group input:not(:placeholder-shown)+label,
.form-group textarea:focus+label,
.form-group textarea:not(:placeholder-shown)+label,
.form-group select:focus+label,
.form-group select:valid+label {
  top: -0.6rem;
  font-size: 0.8rem;
  color: var(--primary);
  background: var(--bg-subtle);
  padding: 0 0.35rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 1rem;
}

/* Contact Container */
.contact-container {
  padding-bottom: 4rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.contact-card {
  background: var(--bg-card);
  padding: 2rem;
  text-align: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.contact-card i {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 1rem;
  display: block;
}

/* Detailed Footer */
.footer {
  background: #6A4E42;
  color: #222;
  padding: 4rem 0 0;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.footer-content {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.footer-brand p {
  color: #444;
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 1rem 0 1.5rem;
  max-width: 300px;
}

.footer-logo {
  font-size: 1.5rem;
  color: #111;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-social {
  display: flex;
  gap: 1rem;
}

.footer-social a {
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s;
  color: #222;
}

.footer-social a:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-3px);
}

.footer-col h4 {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  color: #111;
  font-weight: 600;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.footer-links a {
  color: #444;
  font-size: 0.95rem;
  transition: color 0.3s, padding-left 0.3s;
}

.footer-links a:hover {
  color: #111;
  padding-left: 5px;
}

.footer-contact li {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  color: #444;
  font-size: 0.95rem;
}

.footer-contact i {
  color: #222;
  font-size: 1.1rem;
}

.footer-bottom {
  text-align: center;
  padding: 1.5rem;
  color: #444;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-bottom-links {
  display: flex;
  gap: 1.5rem;
}

.footer-bottom-links a {
  color: #444;
}

.footer-bottom-links a:hover {
  color: #111;
}

/* Updated Responsive Footer */
@media (max-width: 900px) {
  .footer-content {
    grid-template-columns: 1fr 1fr;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .hero {
    padding-top: var(--nav-height-mobile);
    /* Top bar hidden on mobile — only nav clearance needed */
    height: clamp(500px, 72vh, 550px);
    min-height: 500px;
    max-height: 550px;
  }

  body.has-top-bar .hero {
    padding-top: var(--nav-height-mobile);
    /* Override desktop has-top-bar rule: top bar is hidden on mobile */
  }

  .hero-slide {
    padding-bottom: 4rem;
    align-items: flex-start;
  }

  .hero-arrow {
    width: 40px;
    height: 40px;
  }

  .hero-arrow i {
    font-size: 1.2rem;
  }

  .hero-arrow-prev {
    left: 0.6rem;
  }

  .hero-arrow-next {
    right: 0.6rem;
  }

  .hero-subtitle-wrapper {
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
  }

  .hero-subtitle {
    font-size: 0.8rem;
    padding: 0.35rem 0.85rem;
    letter-spacing: 0.4px;
    max-width: 100%;
    white-space: normal;
    line-height: 1.4;
  }

  .hero-content {
    margin-top: auto;
    margin-bottom: 5.75rem;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .hero-desc {
    font-size: 1rem;
  }

  .hero-center-desc {
    width: min(92vw, 520px);
    bottom: 5.6rem;
  }

  .hero-center-desc .hero-desc {
    font-size: 0.95rem;
    line-height: 1.4;
  }

  .nav-content {
    padding-right: 56px;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    right: 0;
    bottom: auto;
    height: auto;
    max-height: calc(100vh - var(--nav-height) - 0.5rem);
    background: var(--bg-card);
    width: min(360px, 100%);
    max-width: 100%;
    display: flex;
    flex-direction: column;
    padding: 0.35rem 1.25rem 0.35rem;
    transform: translateX(110%);
    transition: transform 0.3s ease, visibility 0.3s;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1001;
    padding: 6px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(6px);
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    color: var(--text-main);
  }

  [data-theme="dark"] .mobile-menu-btn {
    background: rgba(17, 24, 39, 0.85);
  }

  .nav-links .nav-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.55rem;
    width: 100%;
    padding: 0.72rem 0.2rem;
    font-size: 1.08rem;
    font-weight: 600;
    color: var(--text-main);
    border-bottom: 0;
  }

  .nav-links .nav-item:last-of-type .nav-link {
    border-bottom: 0;
  }

  .nav-links #theme-toggle {
    display: none;
  }

  .nav-links .nav-link::after {
    display: none;
  }

  .nav-links .nav-item {
    margin-bottom: 0;
  }

  .nav-links .dropdown-menu {
    display: flex;
    flex-direction: column;
    margin-top: 0.15rem;
    margin-left: 0;
    padding-left: 0;
    border-top: 0;
    border-left: 0;
    margin-bottom: 0.45rem;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transition: max-height 0.28s ease, opacity 0.22s ease;
  }

  .nav-links .nav-item:hover>.dropdown-menu {
    max-height: 0;
    opacity: 0;
  }

  .nav-links .nav-item.open>.dropdown-menu {
    max-height: 520px;
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links .nav-item.dropdown>.nav-link {
    cursor: pointer;
    position: relative;
    padding-right: 0.2rem;
  }

  .dropdown-item {
    padding: 0.46rem 0.35rem;
    font-size: 0.96rem;
    color: var(--text-main);
    margin-left: 0;
    border-radius: 8px;
  }

  .dropdown-item:hover {
    background: var(--bg-subtle);
  }

  .nav-links .toggle-indicator::after {
    content: none;
  }

  .nav-links .nav-link.toggle-indicator .dropdown-caret {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    color: var(--primary);
    font-size: 1rem;
  }

  .nav-item.open>.nav-link.toggle-indicator .dropdown-caret {
    transform: rotate(180deg);
  }

  /* Compact vertical spacing for mobile menu options */
  .nav-links {
    gap: 0 !important;
    row-gap: 0 !important;
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
  }

  .nav-links .nav-item {
    margin: 0 !important;
    padding: 0 !important;
  }

  .nav-links .nav-link {
    padding-top: 0.44rem !important;
    padding-bottom: 0.44rem !important;
    min-height: 0 !important;
    height: auto !important;
    line-height: 1.2;
  }

  .nav-links .dropdown-menu {
    margin-top: 0.05rem !important;
    margin-bottom: 0.12rem !important;
    gap: 0 !important;
  }

  .nav-links .dropdown-item {
    margin: 0 !important;
    padding-top: 0.32rem !important;
    padding-bottom: 0.32rem !important;
    min-height: 0 !important;
    line-height: 1.2;
  }


  .about-grid,
  .donation-layout {
    grid-template-columns: 1fr;
    flex-direction: column;
    gap: 2rem;
    text-align: center;
  }

  .footer-content {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .about-badge {
    right: 50%;
    transform: translateX(50%);
    bottom: -30px;
  }

  .footer-links {
    flex-direction: column;
    gap: 1rem;
  }
}

/* Event Card Enhanced */
.event-card-enhanced {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  overflow: hidden;
  border-radius: var(--radius-md);
  transition: transform 0.3s, box-shadow 0.3s;
}

.event-card-enhanced:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.event-card-img {
  height: 220px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.event-card-desc-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.75rem 0.9rem;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.35;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.42) 52%, rgba(0, 0, 0, 0) 100%);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(1px);
  backdrop-filter: blur(1px);
}

.card-title-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--primary);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  z-index: 2;
  letter-spacing: 0.01em;
}

.card-title-badge i {
  font-size: 0.75rem;
}

.event-card-enhanced:hover .card-title-badge {
  transform: translateY(-2px);
  transition: transform 0.2s ease;
}

.event-card-overlay {
  position: absolute;
  top: 1rem;
  left: 1rem;
}

.event-date-badge {
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 0.4rem 1rem;
  border-radius: 2rem;
  font-size: 0.85rem;
  backdrop-filter: blur(5px);
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.2);
}



/* Scroll Top Button */
.scroll-top-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--primary);
  color: #fff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  border: none;
}

.scroll-top-btn.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top-btn:hover {
  background: var(--primary-light);
  transform: translateY(-5px);
}

/* Action Buttons Section */
.action-buttons {
  position: static;
  padding: 0;
  pointer-events: none;
}

.actions-wrapper {
  position: static;
}

.hero-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 50px;
  height: 50px;
  min-height: unset;
  padding: 0;
  text-decoration: none;
  border-radius: 50%;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.15);
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
  pointer-events: auto;
}

.contact-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9999;
}

.support-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
}

.hero-action-btn i {
  font-size: 1.25rem;
  line-height: 1;
}

.hero-action-whatsapp {
  background: #25d366;
  color: #ffffff;
  transition: background-color 0.3s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.hero-action-whatsapp .whatsapp-icon {
  width: 22px;
  height: 22px;
  min-width: 22px;
  display: block;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}

.hero-action-whatsapp span {
  line-height: 1.1;
}

.hero-action-whatsapp:hover {
  background: #1ebe5d;
}

.hero-action-support {
  background: linear-gradient(135deg, #d35400 0%, #e67e22 100%);
  color: #fff;
}

.hero-action-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.22);
  filter: brightness(1.02);
}

.hero-action-btn:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.95);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .hero-action-btn {
    width: 44px;
    height: 44px;
  }

  .contact-btn,
  .support-btn {
    bottom: 14px;
  }

  .contact-btn {
    left: 10px;
  }

  .support-btn {
    right: 10px;
  }

  .hero-action-btn i {
    font-size: 1.1rem;
  }

  .hero-action-whatsapp .whatsapp-icon {
    width: 20px;
    height: 20px;
    min-width: 20px;
  }

  .hero-center-btn {
    bottom: 2rem;
  }
}

/* Contact Page Specifics */
.page-hero {
  height: 50vh;
  min-height: 500px;
  background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('../img/temple/temple.webp');
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
  margin-top: -80px;
  padding-top: 140px;
}

.page-hero .hero-subtitle {
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.contact-layout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  margin-top: 4rem;
}

@media (max-width: 900px) {
  .contact-layout-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.map-container {
  width: 100%;
  height: 400px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 2rem;
  border: 1px solid var(--border);
}

.map-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.info-card {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  /* Removed height: 100% to prevent footer overlap */
}

.info-item {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.info-icon {
  width: 50px;
  height: 50px;
  background: var(--bg-subtle);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.5rem;
  flex-shrink: 0;
}

/* Top Bar */
.top-bar {
  display: none;
  background-color: #1a1a1a;
  color: #fff;
  padding: 0.5rem 0;
  font-size: 0.85rem;
  z-index: 1001;
  /* Above navbar */
  position: fixed;
  top: 0;
  width: 100%;
}

.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-bar-left,
.top-bar-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.top-bar span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.top-bar i {
  color: var(--primary);
}

/* Responsive Top Bar & Navbar Offset */
@media (min-width: 992px) {
  .top-bar {
    display: block;
    height: 40px;
  }

  body.has-top-bar nav {
    top: 40px;
  }

  body.has-top-bar .page-hero {
    margin-top: -120px;
    /* 80px nav + 40px topbar */
    padding-top: 250px;
    /* 140px + 40px topbar */
  }

  body.has-top-bar .hero {
    padding-top: calc(var(--nav-height-desktop) + var(--top-bar-height));
    /* 80px nav + 40px top-bar = 120px */
    height: clamp(410px, 62vh, 470px);
    min-height: 640px;
    max-height: 470px;
  }

  body.has-top-bar .hero-slide {
    padding-bottom: 4rem;
    /* Bottom spacing */
  }
}

/* Nav Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-login-nav,
.btn-register-nav {
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5rem 1.25rem;
  border-radius: 20px;
  transition: all 0.3s;
}

.btn-login-nav {
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-login-nav:hover {
  background: var(--primary);
  color: white;
}

.btn-register-nav {
  background: var(--primary);
  color: white;
  border: 1px solid var(--primary);
}

.btn-register-nav:hover {
  background: var(--primary-dark);
}

.desktop-only {
  display: flex;
}

.mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .desktop-only {
    display: none;
  }

  .mobile-only {
    display: block;
  }

  .nav-actions {
    gap: 0.5rem;
  }
}

/* Acharya Teaser Card */
.acharya-teaser {
  margin-top: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(230, 126, 34, 0.08) 0%, rgba(255, 255, 255, 0) 100%);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  position: relative;
  transition: all 0.3s ease;
}

.acharya-teaser:hover {
  transform: translateX(5px);
  background: linear-gradient(135deg, rgba(230, 126, 34, 0.12) 0%, rgba(255, 255, 255, 0) 100%);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.acharya-teaser h4 {
  color: var(--primary);
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.acharya-teaser p {
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.8rem;
}

.acharya-teaser-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
  transition: all 0.3s ease;
}

.acharya-teaser-link:hover {
  color: var(--primary);
  gap: 0.8rem;
}

.read-more-wrapper {
  margin-top: 4rem;
  /* Increased Margin for separation */
  display: flex;
  justify-content: flex-start;
}

.btn-long-arrow {
  padding-right: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}


.btn-long-arrow:hover {
  gap: 1rem;
}

/* --- Mobile Friendliness & Footer Updates --- */

/* Move inline footer styles to CSS */
.footer-bottom .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

@media (max-width: 768px) {

  /* Stack footer bottom links and copyright */
  .footer-bottom .container {
    flex-direction: column-reverse;
    gap: 1rem;
    text-align: center;
  }

  .footer-bottom-links {
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
  }

  /* Prevent iOS zoom on inputs */
  .form-group input,
  .form-group select,
  .form-group textarea,
  input,
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Adjust Hero Title for very small screens */
  .hero-title {
    font-size: 2.2rem;
    /* Was 2.5rem */
    word-wrap: break-word;
  }

  /* Ensure container doesn't touch edges too much */
  .container {
    width: 92%;
  }

  /* Buttons full width on small mobile */
  .hero-btns {
    flex-direction: column;
    width: 100%;
  }

  .hero-btns .btn {
    display: block;
    width: 100%;
    text-align: center;
  }

  /* Modal/Dialog Specifics if any */
  .gallery-overlay i {
    font-size: 2rem;
    /* Larger touch target */
  }
}

/* Hero Text Enhancements */
.hero-title {
  color: #ffffff !important;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8) !important;
}

.hero-subtitle {
  color: #ffffff !important;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8) !important;
}

/* Donate Page Styles */
.causes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.cause-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.cause-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.cause-img {
  height: 200px;
  width: 100%;
  object-fit: cover;
}

.cause-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  text-align: center;
}

.cause-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
  color: var(--primary);
}

.cause-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.payment-section {
  padding: 4rem 0;
  background-color: var(--bg-subtle);
}

.payment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

@media (max-width: 900px) {
  .payment-grid {
    grid-template-columns: 1fr;
  }
}

/* Donate page: ensure visible outline buttons in light theme */
[data-theme="light"] .cause-card .btn-outline {
  border: 2px solid var(--primary);
  color: var(--primary);
  background: transparent;
}

[data-theme="dark"] .btn-outline {
  border: 2px solid #7d7c7c !important;
  color: var(--primary);
  background: transparent;
}

[data-theme="light"] .cause-card .btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

/* Theme-aware styling for Checkout Total Amount */
#form-total-amount {
  background: var(--bg-subtle);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem;
  cursor: not-allowed;
  transition: background-color 0.18s, color 0.18s, border-color 0.18s;
}

/* If an inline style must remain, use this to override it */
#form-total-amount.override-theme {
  background: var(--bg-subtle) !important;
  color: var(--text-main) !important;
  border-color: var(--border) !important;
}

.form-input {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-main);
  color: var(--text-main);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(211, 84, 0, 0.2);
}

[data-theme="dark"] .form-input {
  background-color: var(--bg-subtle);
  border-color: #4b5563;
}

[data-theme="dark"] .form-input:focus {
  border-color: var(--primary);
  background-color: var(--bg-body);
}

/*Enhance hero text visibility*/
.page-hero {
  position: relative;
  color: #ffffff;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  /* adjust 0.45–0.65 if needed */
}

.page-hero .container {
  position: relative;
  z-index: 1;
}

@media (max-width: 768px) {
  .page-hero {
    height: 45vh;
    min-height: 250px;
    margin-top: -80px;
    /* match fixed nav min-height so hero correctly slides behind it */
    padding-top: 110px;
    /* clears 80px nav + 30px breathing room before flex-center kicks in */
  }

  .page-hero .hero-title {
    font-size: 1.6rem;
    margin-bottom: 0.25rem;
  }

  .page-hero .hero-subtitle {
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    margin-top: 1.5rem;
  }
}

/* For very small screens (iPhone SE ~375px) keep the hero compact but fully visible */
@media (max-width: 480px) {
  .page-hero {
    height: 40vh;
    min-height: 230px;
    padding-top: 100px;
  }
}

/* ── Section Title — Mobile ── */
@media (max-width: 768px) {
  .section-title {
    font-size: 1.65rem;
    line-height: 1.25;
    margin-bottom: 0.85rem;
    letter-spacing: -0.01em;
  }

  .section-title::after {
    width: 48px;
    height: 3px;
    margin-top: 0.6rem;
  }

  .section-lead {
    font-size: 1.05rem;
    padding-left: 1rem;
    margin-bottom: 1.25rem;
  }

  .section-subtitle {
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
  }

  /* Reduce top gap between page-hero and the first content section */
  .page-hero+.section {
    padding-top: 1.75rem;
    padding-bottom: 1.5rem;
  }

  /* Tighten gap between main content section and acharya section */
  .acharya-section {
    padding-top: 1.25rem;
  }
}

/* --- TWO-COLOR THEME OVERRIDES --- */

/* 1. Alternating background styling starting from Program Schedule onwards (About, Events, Services, Gallery) */
#about.section, #about-intro, #mission, #sahasra {
  background-color: #EADBC8 !important;
  color: #3E2723 !important;
}
#about.section h1, #about.section h2, #about.section h3, #about.section h4, #about.section h5, #about.section h6, #about.section .section-title, #about.section p, #about.section span, #about.section i,
#about-intro h1, #about-intro h2, #about-intro h3, #about-intro h4, #about-intro h5, #about-intro h6, #about-intro .section-title, #about-intro p, #about-intro span, #about-intro i,
#mission h1, #mission h2, #mission h3, #mission h4, #mission h5, #mission h6, #mission .section-title, #mission p, #mission span, #mission i,
#sahasra h1, #sahasra h2, #sahasra h3, #sahasra h4, #sahasra h5, #sahasra h6, #sahasra .section-title, #sahasra p, #sahasra span, #sahasra i {
  color: inherit;
}

#donation-options {
  background-color: #EADBC8 !important;
}

/* Restore original saffron colors for invitation-specific elements */
#about .invite-deity-name,
#about .invite-supertitle,
#about .invite-schedule-title,
#about .invite-day-name,
#about .invite-detail-item i,
#about .invite-detail-item a,
#about .invite-zeffy-btn {
  color: var(--primary) !important;
}
#about .invite-deity-sub,
#about .invite-qr-label,
#about .invite-support-divider {
  color: var(--text-muted) !important;
}
#about .invite-time {
  color: #7a4f2e !important;
}
#about .invite-ritual {
  color: #3d2b1f !important;
}
#about .invite-detail-item {
  color: var(--text-main) !important;
}
#about .invite-day-badge {
  color: #fff !important;
  background: var(--primary) !important;
}

#events.section, #acharya, #alayam, #board {
  background-color: #5D4037 !important;
  color: #FFFFFF !important;
}
#events.section h1, #events.section h2, #events.section h3, #events.section h4, #events.section h5, #events.section h6, #events.section .section-title, #events.section p, #events.section span, #events.section i,
#acharya h1, #acharya h2, #acharya h3, #acharya h4, #acharya h5, #acharya h6, #acharya .section-title, #acharya p, #acharya span, #acharya i,
#alayam h1, #alayam h2, #alayam h3, #alayam h4, #alayam h5, #alayam h6, #alayam .section-title, #alayam p, #alayam span, #alayam i,
#board h1, #board h2, #board h3, #board h4, #board h5, #board h6, #board .section-title, #board p, #board span, #board i {
  color: inherit;
}

#services.section {
  background-color: #EADBC8 !important;
  color: #3E2723 !important;
}
#services.section h1, #services.section h2, #services.section h3, #services.section h4, #services.section h5, #services.section h6, #services.section .section-title, #services.section p, #services.section span, #services.section i {
  color: inherit;
}

#gallery.section {
  background-color: #5D4037 !important;
  color: #FFFFFF !important;
}
#gallery.section h1, #gallery.section h2, #gallery.section h3, #gallery.section h4, #gallery.section h5, #gallery.section h6, #gallery.section .section-title, #gallery.section p, #gallery.section span, #gallery.section i {
  color: inherit;
}

/* 2. Cards */
.event-card-enhanced, .service-card, .info-card, .cause-card, .value-card, .contact-card, .grid-cards > div, .card {
  background-color: #FFFFFF !important;
  color: #333333 !important;
  border: 1px solid #D7C4A9 !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05) !important;
}

.event-card-enhanced h1, .event-card-enhanced h2, .event-card-enhanced h3, .event-card-enhanced h4, .event-card-enhanced h5, .event-card-enhanced p, .event-card-enhanced span, .event-card-enhanced i,
.service-card h1, .service-card h2, .service-card h3, .service-card p, .service-card span, .service-card i,
.info-card h1, .info-card h2, .info-card h3, .info-card p, .info-card span, .info-card i,
.cause-card h1, .cause-card h2, .cause-card h3, .cause-card p, .cause-card span, .cause-card i,
.value-card h1, .value-card h2, .value-card span, .value-card i,
.contact-card h1, .contact-card h2, .contact-card h3, .contact-card p, .contact-card span, .contact-card i,
.grid-cards > div h1, .grid-cards > div h2, .grid-cards > div span, .grid-cards > div i,
.card h1, .card h2, .card span, .card i {
  color: #333333 !important;
}

/* 3. Buttons */
.btn-primary, .btn {
  background-color: #F4A261 !important;
  color: #FFFFFF !important;
  border: none !important;
}
.btn-primary:hover, .btn:hover {
  background-color: #E76F51 !important;
}

/* Restore original deep saffron for hero "Support Now" button */
.hero-center-btn .btn,
.hero-center-btn .btn-primary,
#adopt-saligrama-btn {
  background-color: #d35400 !important;
  color: #FFFFFF !important;
}
.hero-center-btn .btn:hover,
.hero-center-btn .btn-primary:hover,
#adopt-saligrama-btn:hover {
  background-color: #b84500 !important;
}

/* 4. Footer Tweaks */
.footer {
  background-color: #3E2723 !important;
}
.footer p, .footer h4, .footer li, .footer i, .footer .footer-logo, .footer span {
  color: #EADBC8 !important;
}
.footer a {
  color: #F4A261 !important;
}
.footer a:hover {
  color: #FFD1AA !important; /* Lighter shade of Orange */
}

/* Text visibility overrides for Theme / Nav conflicts */
[data-theme="dark"] #about.section,
[data-theme="dark"] #services.section {
  color: #3E2723 !important;
}
[data-theme="dark"] #events.section,
[data-theme="dark"] #gallery.section {
  color: #FFFFFF !important;
}
[data-theme="dark"] .card *, [data-theme="dark"] .event-card-enhanced *, [data-theme="dark"] .service-card * {
  color: #333333 !important;
}
[data-theme="dark"] .footer * {
  color: #EADBC8 !important;
}
[data-theme="dark"] .footer a {
  color: #F4A261 !important;
}

/* Restore original deep saffron for invitation "Support Now" button */
.invite-support-main-btn,
#invite-support-now-btn {
  background-color: #d35400 !important;
  color: #FFFFFF !important;
}
.invite-support-main-btn:hover,
#invite-support-now-btn:hover {
  background-color: #b84500 !important;
}

/* Restore "View Details" card button to outlined saffron style */
.btn-outline {
  background-color: transparent !important;
  color: var(--primary) !important;
  border: 1px solid var(--border) !important;
}
.btn-outline:hover {
  background-color: #d35400 !important;
  color: #FFFFFF !important;
}

/* Force saffron color for Core Values labels and improve visibility on images */
.value-card-content h3 {
  color: #d35400 !important;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8), 0 0 20px rgba(0,0,0,0.4) !important;
  font-weight: 800 !important;
}

/* Force white color and visibility for Core Values descriptive text */
.value-card-content p {
  color: #FFFFFF !important;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.9), 0 0 5px rgba(0, 0, 0, 0.5) !important;
  font-weight: 500 !important;
  line-height: 1.6 !important;
}