:root {
  --red: #bd1e11;
  --deep-red: #851108;
  --saffron: #f08a24;
  --ink: #17120f;
  --muted: #6b625d;
  --cream: #fffaf4;
  --paper: #ffffff;
  --line: #ead9cf;
  --teal: #0f6674;
  --shadow: 0 18px 50px rgba(70, 31, 15, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: "Nirmala UI", "Mangal", "Segoe UI", Arial, sans-serif;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  padding: 8px clamp(16px, 3.2vw, 48px);
  background: rgba(255, 250, 244, 0.94);
  border-bottom: 1px solid rgba(189, 30, 17, 0.14);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  max-width: min(34vw, 300px);
  color: var(--red);
  font-size: clamp(1rem, 1.8vw, 1.45rem);
  font-weight: 900;
  line-height: 2.1;
  text-decoration: none;
  white-space: nowrap;
}

.brand span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.primary-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

.primary-nav a,
.nav-dropdown > button {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font: 700 0.88rem/1 "Segoe UI", Arial, sans-serif;
  text-decoration: none;
  cursor: pointer;
}

.primary-nav a:hover,
.nav-dropdown > button:hover,
.primary-nav a:focus-visible,
.nav-dropdown > button:focus-visible {
  color: var(--red);
  background: rgba(189, 30, 17, 0.08);
  outline: none;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown > button::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  min-width: 210px;
  padding: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu,
.nav-dropdown.is-open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  justify-content: flex-start;
  width: 100%;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 3px 0;
  background: var(--red);
}

.hero {
  position: relative;
  min-height: calc(100vh - 62px);
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(360px, 1fr);
  align-items: center;
  gap: clamp(18px, 5vw, 86px);
  overflow: hidden;
  padding: clamp(18px, 2.8vw, 36px) clamp(18px, 7vw, 112px);
  background:
    linear-gradient(90deg, rgba(255, 251, 244, 0.92) 0%, rgba(255, 246, 232, 0.72) 48%, rgba(255, 235, 204, 0.88) 100%),
    repeating-linear-gradient(135deg, rgba(189, 30, 17, 0.045) 0 1px, transparent 1px 18px),
    #fff8ee;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(189, 30, 17, 0.08) 100%);
  pointer-events: none;
}

.hero-visual,
.hero-content {
  position: relative;
  z-index: 1;
}

.hero-visual {
  display: flex;
  align-items: end;
  justify-content: center;
  min-height: clamp(430px, 72vh, 660px);
}

.hero-visual img {
  width: min(100%, 540px);
  height: auto;
  max-height: none;
  object-fit: contain;
  filter: drop-shadow(0 30px 34px rgba(91, 38, 16, 0.24));
}

.hero-content {
  max-width: 760px;
  text-align: center;
}

.hero-logo {
  width: clamp(104px, 12vw, 146px);
  height: auto;
  margin: 0 auto clamp(14px, 2vw, 22px);
  mix-blend-mode: multiply;
}

.hero-prayer {
  margin: 0 0 clamp(12px, 1.7vw, 18px);
  color: var(--deep-red);
  font-size: clamp(1.2rem, 1.9vw, 1.9rem);
  font-weight: 900;
  line-height: 1.15;
}

.hero h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.25rem, 4.65vw, 4.95rem);
  font-weight: 900;
  line-height: 1.12;
}

.hero-mandal {
  margin: clamp(18px, 2.3vw, 28px) auto 0;
  color: var(--red);
  font-size: clamp(1.18rem, 2.25vw, 2.2rem);
  font-weight: 900;
  line-height: 1.35;
}

.hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2vw, 28px);
  margin: clamp(14px, 1.9vw, 22px) auto 0;
  color: var(--ink);
  font-size: clamp(1rem, 1.55vw, 1.45rem);
  font-weight: 800;
  line-height: 1.4;
}

.hero-meta span {
  width: 1px;
  height: 1.4em;
  background: rgba(133, 17, 8, 0.45);
}

.social-rail {
  position: fixed;
  top: 50%;
  right: clamp(14px, 2.2vw, 34px);
  z-index: 15;
  display: grid;
  gap: 24px;
  transform: translateY(-50%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 220ms ease, visibility 220ms ease, transform 220ms ease;
}

.social-rail.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%);
}

.social-rail.is-scrolling {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-46%);
}

.social-rail a {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  color: #4c5666;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(76, 86, 102, 0.06);
  border-radius: 50%;
  box-shadow: 0 9px 18px rgba(38, 44, 56, 0.14);
  text-decoration: none;
  transition: color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.social-rail a:hover,
.social-rail a:focus-visible {
  color: var(--red);
  box-shadow: 0 12px 24px rgba(38, 44, 56, 0.2);
  outline: none;
  transform: translateY(-2px);
}

.social-rail svg {
  width: 31px;
  height: 31px;
  fill: currentColor;
}

.section {
  scroll-margin-top: 100px;
  padding: clamp(56px, 8vw, 100px) clamp(20px, 7vw, 110px);
}

.section h1,
.section h2 {
  margin: 0;
  color: var(--deep-red);
  font-size: clamp(2rem, 4.2vw, 4.2rem);
  line-height: 1.08;
}

.section p {
  /* max-width: 760px; */
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  line-height: 1.7;
}

.section-kicker {
  margin-bottom: 12px;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mandal-section {
  background: linear-gradient(180deg, #fffaf4 0%, #fff1e2 100%);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 16px;
  margin-top: 34px;
}

.info-grid article {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 116px;
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(70, 31, 15, 0.06);
}

.info-grid span {
  display: block;
  margin-bottom: 10px;
  color: var(--red);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.info-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 1.05rem;
  line-height: 1.35;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 440px);
  gap: clamp(28px, 6vw, 72px);
  align-items: start;
  background: var(--paper);
}

.split-section.accent {
  background: #fff7ec;
}

.events-section {
  background: #f8fbfb;
}

.events-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 30px;
}

.events-list article {
  min-height: 132px;
  padding: 20px;
  background: var(--paper);
  border: 1px solid #d6e5e8;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 102, 116, 0.08);
}

.events-list span {
  display: block;
  margin-bottom: 10px;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.events-list strong {
  font-size: 1.06rem;
  line-height: 1.4;
}

.feature-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  padding: 16px 18px;
  background: var(--cream);
  border-left: 4px solid var(--saffron);
  border-radius: 8px;
  font-weight: 700;
  box-shadow: 0 10px 26px rgba(70, 31, 15, 0.06);
}

.donation-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  background: var(--deep-red);
  color: var(--paper);
}

.donation-section h2,
.donation-section p,
.donation-section .section-kicker {
  color: var(--paper);
}

.donation-section p {
  opacity: 0.86;
}

.primary-button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  color: var(--deep-red);
  background: var(--paper);
  border: 0;
  border-radius: 8px;
  font: 800 1rem/1 "Segoe UI", Arial, sans-serif;
  text-decoration: none;
  cursor: pointer;
}

.primary-button:hover,
.primary-button:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.donation-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.donation-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.donation-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 8, 7, 0.62);
  backdrop-filter: blur(4px);
}

.donation-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(90vh, 760px);
  overflow: auto;
  padding: clamp(22px, 3.4vw, 34px);
  background: var(--paper);
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(18, 8, 6, 0.24);
}

.donation-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--cream);
  color: var(--deep-red);
  font-size: 1.4rem;
  cursor: pointer;
}

.donation-modal__header h3 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: clamp(1.2rem, 2.2vw, 1.7rem);
}

.donation-modal__content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.donation-modal__card {
  padding: 20px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.donation-modal__card h4 {
  margin: 0 0 14px;
  color: var(--red);
  font-size: 1.05rem;
}

.donation-detail {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(189, 30, 17, 0.12);
}

.donation-detail:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.donation-detail span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.donation-detail strong {
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.5;
}

.donation-qr-placeholder {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed rgba(189, 30, 17, 0.28);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
}

.donation-qr-placeholder p {
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
  font-weight: 800;
}

.gallery-intro {
  margin-top: 14px;
  max-width: 760px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.photo-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 20px;
}

.photo-tab {
  padding: 10px 16px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 800 0.95rem/1 "Segoe UI", Arial, sans-serif;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.photo-tab:hover,
.photo-tab:focus-visible {
  color: var(--red);
  border-color: rgba(189, 30, 17, 0.3);
  transform: translateY(-1px);
  outline: none;
}

.photo-tab.is-active {
  color: var(--paper);
  background: var(--red);
  border-color: var(--red);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 30px;
}

.dynamic-photo-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.photo-card {
  padding: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(70, 31, 15, 0.06);
}

.photo-card img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  background: var(--paper);
  border-radius: 8px;
}

.photo-card figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
}

.gallery-loading,
.gallery-empty {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.terms-section {
  background: #f8fbfb;
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: clamp(28px, 6vw, 72px);
  align-items: start;
  background: var(--paper);
}

.contact-panel {
  padding: 22px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.contact-panel p {
  margin: 0 0 12px;
  font-size: 1rem;
}

.contact-panel p:last-child {
  margin-bottom: 0;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 26px 20px;
  color: var(--muted);
  background: var(--paper);
  border-top: 1px solid var(--line);
  text-align: center;
}

.site-footer img {
  width: 64px;
  height: 48px;
  object-fit: contain;
}

.site-footer p {
  margin: 0;
  font-size: 0.94rem;
}

@media (max-width: 1080px) {
  .site-header {
    min-height: 60px;
  }

  .menu-toggle {
    display: grid;
  }

  .primary-nav {
    position: absolute;
    top: 100%;
    right: 18px;
    left: 18px;
    display: none;
    align-items: stretch;
    padding: 10px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
  }

  .primary-nav.is-open {
    display: grid;
  }

  .primary-nav a,
  .nav-dropdown > button {
    justify-content: space-between;
    width: 100%;
    min-height: 46px;
  }

  .dropdown-menu {
    position: static;
    display: none;
    min-width: 0;
    margin: 2px 0 8px 12px;
    border: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav-dropdown.is-open .dropdown-menu {
    display: grid;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: 22px;
  }

  .hero-content {
    order: 2;
    margin: 0 auto;
  }

  .hero-visual {
    order: 1;
    min-height: 360px;
  }

  .hero-visual img {
    width: min(88vw, 430px);
  }

  .split-section,
  .photo-grid,
  .events-list,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .donation-section {
    align-items: flex-start;
    flex-direction: column;
  }

  .photo-grid img {
    height: auto;
    max-height: 420px;
  }

  .social-rail {
    right: 12px;
    gap: 14px;
  }

  .social-rail a {
    width: 52px;
    height: 52px;
  }

  .social-rail svg {
    width: 25px;
    height: 25px;
  }
}

@media (max-width: 560px) {
  .info-grid {
    grid-template-columns: 1fr;
  }
  .site-header {
    padding: 10px 14px;
  }

  .brand {
    max-width: calc(100vw - 86px);
    font-size: clamp(1rem, 5vw, 1.3rem);
  }

  .section {
    padding: 46px 18px;
  }

  .hero {
    padding: 24px 18px 32px;
  }

  .hero-visual {
    min-height: 300px;
  }

  .hero-logo {
    width: 118px;
    margin-bottom: 16px;
  }

  .social-rail {
    top: auto;
    right: 10px;
    bottom: 18px;
    gap: 10px;
    transform: none;
  }

  .social-rail.is-visible {
    transform: none;
  }

  .social-rail.is-scrolling {
    transform: translateY(8px);
  }

  .social-rail a {
    width: 46px;
    height: 46px;
  }

  .social-rail svg {
    width: 22px;
    height: 22px;
  }

  .hero-meta {
    align-items: center;
    flex-direction: column;
    gap: 4px;
  }

  .hero-meta span {
    width: 56px;
    height: 1px;
  }

  .site-footer {
    align-items: center;
    flex-direction: column;
  }
}
