/* ==========================================================================
   Bharat Sevashram Sangha Prayagraj — Core Stylesheet
   ========================================================================== */

:root {
  /* Colour palette — warm, earthy, spiritual */
  --color-bg: #FAF6EF;
  --color-bg-alt: #F3ECDF;
  --color-surface: #FFFFFF;
  --color-text: #2B2622;
  --color-text-muted: #5C5347;
  --color-border: #E4DAC7;

  --color-primary: #7A2E2E;        /* deep maroon */
  --color-primary-dark: #5E2222;
  --color-accent: #B5651D;         /* saffron / earthy orange */
  --color-accent-dark: #954F14;
  --color-secondary: #2F5233;      /* deep forest green */

  --color-link: var(--color-primary);
  --color-focus: #B5651D;

  --font-heading: Georgia, "Times New Roman", "Noto Serif", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 3px rgba(43, 38, 34, 0.08);
  --shadow-md: 0 6px 20px rgba(43, 38, 34, 0.10);
  --shadow-lg: 0 12px 36px rgba(43, 38, 34, 0.14);

  --container-width: 1240px;
  --header-height: 78px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-link); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--color-primary-dark);
  line-height: 1.25;
  margin: 0 0 0.6em;
  font-weight: 700;
}
h1 { font-size: clamp(2rem, 4vw + 1rem, 3rem); }
h2 { font-size: clamp(1.5rem, 2vw + 1rem, 2.2rem); }
h3 { font-size: clamp(1.15rem, 1vw + 1rem, 1.5rem); }
p { margin: 0 0 1em; color: var(--color-text); }
.text-muted { color: var(--color-text-muted); }

/* Visible focus for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 12px 20px;
  z-index: 2000;
  border-radius: 0 0 8px 0;
}
.skip-link:focus {
  left: 0;
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}
.section { padding: 96px 0; }
.section-alt { background: var(--color-bg-alt); }
.section-header {
  max-width: 720px;
  margin: 0 auto 40px;
  text-align: center;
}
.section-header .eyebrow {
  display: inline-block;
  color: var(--color-accent-dark);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  margin-bottom: 10px;
}
.grid {
  display: grid;
  gap: 28px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 32px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  border: 2px solid transparent;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  text-decoration: none;
  font-size: 0.98rem;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary {
  background: #A85C18; /* accent, darkened slightly to meet WCAG AA contrast with white text */
  color: #fff;
  border-color: #A85C18;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--color-accent-dark); border-color: var(--color-accent-dark); box-shadow: var(--shadow-md); }
.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-secondary:hover { background: var(--color-primary); color: #fff; }
.btn-light {
  background: #fff;
  color: var(--color-primary);
  border-color: #fff;
}
.btn-light:hover { background: transparent; color: #fff; }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(250, 246, 239, 0.96);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--color-border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand img { width: 48px; height: 48px; flex-shrink: 0; }
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.brand-text .brand-name {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-primary-dark);
  font-size: 1.05rem;
}
.brand-text .brand-loc {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.main-nav { display: flex; }
.main-nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
}
.main-nav a {
  display: inline-block;
  padding: 10px 14px;
  color: var(--color-text);
  font-weight: 600;
  border-radius: var(--radius-sm);
  font-size: 0.96rem;
}
.main-nav a:hover,
.main-nav a:focus-visible {
  background: var(--color-bg-alt);
  color: var(--color-primary);
  text-decoration: none;
}
.main-nav a[aria-current="page"] {
  color: var(--color-primary);
  background: var(--color-bg-alt);
}

.header-actions { display: flex; align-items: center; gap: 12px; }
.header-actions .btn { padding: 10px 20px; font-size: 0.92rem; }

.nav-toggle {
  display: none;
  background: transparent;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.nav-toggle .bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-primary-dark);
  margin: 4px 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
  padding: 14px 0;
  font-size: 0.86rem;
  color: var(--color-text-muted);
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
}
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 6px; color: var(--color-border); }
.breadcrumbs a { color: var(--color-text-muted); font-weight: 600; }
.breadcrumbs [aria-current="page"] { color: var(--color-primary); font-weight: 700; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 88px 0 96px;
  background: linear-gradient(160deg, #F3ECDF 0%, #FAF6EF 55%, #F3ECDF 100%);
  overflow: hidden;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.hero-eyebrow {
  display: inline-block;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  color: var(--color-accent-dark);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 18px;
}
.hero h1 { margin-bottom: 18px; }
.hero-lead {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  max-width: 46ch;
  margin-bottom: 28px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-media {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
}
.hero-media img { width: 100%; height: 100%; object-fit: cover; }

.page-hero {
  padding: 56px 0;
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
}
.page-hero .eyebrow {
  color: var(--color-accent-dark);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.82rem;
}
.page-hero p { max-width: 65ch; color: var(--color-text-muted); font-size: 1.05rem; }

/* ---------- Cards ---------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  display: flex;
  flex-direction: column;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.card-media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--color-bg-alt); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 28px; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { margin-bottom: 8px; }
.card-body p { flex: 1; }
.card-tag {
  display: inline-block;
  align-self: flex-start;
  background: var(--color-bg-alt);
  color: var(--color-secondary);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

/* Feature list */
.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

.star-rating {
  color: var(--color-accent);
  font-size: 1.1rem;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

/* ---------- Alternate homepage section layout (avoids repeating the same card grid) ---------- */
.facility-highlight {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.facility-highlight-media img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  aspect-ratio: 4/3;
  object-fit: cover;
  width: 100%;
}
.facility-highlight-list {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.facility-highlight-list li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.facility-highlight-list .facility-highlight-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--color-bg-alt);
  color: var(--color-accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}
.facility-highlight-list h3 { margin-bottom: 2px; font-size: 1.05rem; }
.facility-highlight-list p { margin-bottom: 0; }
.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--color-bg-alt);
  color: var(--color-accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  font-size: 1.4rem;
}

.notice-box {
  background: #FFF7E8;
  border: 1px solid #EBD8A6;
  color: #6B4E12;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  margin: 18px 0;
}

/* ---------- Two-column content ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.split-media img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
}
.split.reverse .split-media { order: 2; }

/* ---------- Gallery ---------- */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 32px;
}
.gallery-filters button {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 600;
  color: var(--color-text-muted);
}
.gallery-filters button[aria-pressed="true"] {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.gallery-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 4/3;
  border: 1px solid var(--color-border);
  background: #fff;
  padding: 0;
  display: block;
  width: 100%;
  text-align: left;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.gallery-item:hover img { transform: scale(1.06); }
.gallery-item .gallery-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.65), rgba(0,0,0,0));
  color: #fff;
  font-size: 0.8rem;
  padding: 22px 12px 8px;
  text-align: left;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 12, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox-content {
  position: relative;
  max-width: min(90vw, 1000px);
  max-height: 86vh;
  width: 100%;
}
.lightbox-content img {
  width: 100%;
  height: auto;
  max-height: 78vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: #111;
}
.lightbox-caption {
  color: #f4ede0;
  text-align: center;
  margin-top: 12px;
  font-size: 0.92rem;
}
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { background: rgba(255,255,255,0.24); }
.lightbox-close, .lightbox-prev, .lightbox-next { line-height: 1; }
.lightbox-close { top: -54px; right: 0; }
.lightbox-prev { left: -56px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: -56px; top: 50%; transform: translateY(-50%); }

/* ---------- Map ---------- */
.map-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
}
.map-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Forms ---------- */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 0.92rem;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: #fff;
  color: var(--color-text);
}
.form-group textarea { resize: vertical; min-height: 120px; }
.form-error {
  color: #A1332B;
  font-size: 0.84rem;
  margin-top: 6px;
  display: none;
}
.form-group.invalid input,
.form-group.invalid textarea,
.form-group.invalid select { border-color: #A1332B; }
.form-group.invalid .form-error { display: block; }
.form-status {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  display: none;
  font-weight: 600;
}
.form-status.success { display: block; background: #E7F2E4; color: #2F5233; border: 1px solid #BFDCB8; }

/* ---------- Footer ---------- */
.site-footer {
  background: #2B2622;
  color: #E7DFD1;
  padding: 56px 0 24px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.3fr 1fr;
  gap: 36px;
  margin-bottom: 36px;
}
.footer-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.footer-brand img { width: 42px; height: 42px; }
.footer-brand span { font-family: var(--font-heading); font-size: 1.05rem; color: #fff; }
.site-footer .footer-heading {
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 14px;
}
.site-footer a { color: #C9BFAC; }
.site-footer a:hover { color: #fff; }
.site-footer li { margin-bottom: 10px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.82rem;
  color: #A79C86;
}

/* ---------- CTA banner ---------- */
.cta-banner {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  padding: 56px 0;
  text-align: center;
  border-radius: var(--radius-lg);
}
.cta-banner h2 { color: #fff; }
.cta-banner p { color: #F0E2D6; max-width: 56ch; margin: 0 auto 24px; }
.cta-banner .hero-cta { justify-content: center; }

/* ---------- 404 ---------- */
.error-page {
  padding: 100px 0;
  text-align: center;
}
.error-page .code {
  font-family: var(--font-heading);
  font-size: 6rem;
  color: var(--color-accent);
  line-height: 1;
  margin-bottom: 10px;
}

/* ---------- Floating WhatsApp button ---------- */
.whatsapp-float {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1500;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.whatsapp-float:hover,
.whatsapp-float:focus-visible {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 14px 34px rgba(37, 211, 102, 0.45);
}
.whatsapp-float svg { width: 30px; height: 30px; display: block; }

/* ---------- Legal pages ---------- */
.legal-content {
  max-width: 80ch;
  margin: 0 auto;
}
.legal-content h2 { margin-top: 2em; }
.legal-content h2:first-child { margin-top: 0; }
.legal-content ul { list-style: disc; padding-left: 1.4em; margin-bottom: 1em; }
.legal-content li { margin-bottom: 0.5em; color: var(--color-text); }
.legal-content .legal-updated { color: var(--color-text-muted); font-size: 0.92rem; margin-bottom: 2em; }

/* ---------- Blog ---------- */
.article-content {
  max-width: 76ch;
  margin: 0 auto;
}
.article-content h2 { margin-top: 2em; }
.article-content h2:first-child { margin-top: 0; }
.article-content h3 { margin-top: 1.6em; font-size: 1.15rem; }
.article-content ul { list-style: disc; padding-left: 1.4em; margin-bottom: 1em; }
.article-content li { margin-bottom: 0.5em; color: var(--color-text); }
.article-content p { margin-bottom: 1.2em; }
.article-content .article-lead { font-size: 1.1rem; color: var(--color-text-muted); }
.article-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  margin: 2em 0;
}
.article-meta {
  color: var(--color-text-muted);
  font-size: 0.92rem;
  margin-bottom: 1.5em;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}
.blog-card-excerpt { color: var(--color-text-muted); margin: 10px 0 14px; }

/* Utility */
.mt-0 { margin-top: 0; }
.text-center { text-align: center; }
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
