/* ============================================================
   Maa Durga Shiksha Seva Sansthan — site stylesheet
   ============================================================ */

:root {
  /* Colour */
  --indigo-900: #16223F;
  --indigo-800: #1D2C4E;
  --indigo-700: #27396A;
  --marigold-500: #E3A038;
  --marigold-400: #EDB65C;
  --maroon-600: #8A3230;
  --ivory-50: #FBF7ED;
  --ivory-100: #F5EFDF;
  --sand-200: #EAE0C8;
  --sand-300: #DCCEA8;
  --ink-900: #201D18;
  --ink-700: #45413A;
  --ink-500: #6B665C;
  --white: #FFFFFF;

  /* Type */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Work Sans", "Segoe UI", sans-serif;

  /* Layout */
  --max-width: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius-sm: 6px;
  --radius-md: 14px;

  --shadow-soft: 0 18px 40px -22px rgba(22, 34, 63, 0.35);
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--ivory-50);
  color: var(--ink-900);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.6em;
  color: var(--indigo-900);
}

h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 500; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.35rem; }

p { margin: 0 0 1.1em; color: var(--ink-700); max-width: 62ch; }

a { color: inherit; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }

.eyebrow-plain {
  display: inline-block;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--maroon-600);
  margin-bottom: 0.6rem;
}

.lede {
  font-size: 1.15rem;
  color: var(--ink-700);
  max-width: 60ch;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

:focus-visible {
  outline: 3px solid var(--marigold-500);
  outline-offset: 3px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0.85rem 1.7rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--marigold-500);
  color: var(--indigo-900);
}
.btn-primary:hover { background: var(--marigold-400); }

.btn-outline {
  background: transparent;
  border-color: rgba(255,255,255,0.55);
  color: var(--white);
}
.btn-outline:hover { background: rgba(255,255,255,0.12); }

.btn-dark {
  background: var(--indigo-900);
  color: var(--white);
}
.btn-dark:hover { background: var(--indigo-700); }

.btn-line {
  background: transparent;
  border-color: var(--indigo-900);
  color: var(--indigo-900);
}
.btn-line:hover { background: var(--indigo-900); color: var(--white); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 247, 237, 0.92);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--sand-200);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--indigo-900);
}
.brand-mark {
  width: 42px; height: 42px; flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
}
.brand-text span {
  font-size: 0.72rem;
  color: var(--ink-500);
  letter-spacing: 0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.9rem;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-links a {
  text-decoration: none;
  color: var(--ink-700);
  font-size: 0.97rem;
  font-weight: 500;
  position: relative;
  padding: 0.3rem 0;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--indigo-900); }
.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: var(--marigold-500);
}

.nav-cta { display: flex; align-items: center; gap: 0.8rem; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
}
.nav-toggle svg { width: 28px; height: 28px; color: var(--indigo-900); }

@media (max-width: 940px) {
  .nav-links {
    position: fixed;
    inset: 0 0 0 auto;
    height: 100vh;
    width: min(78vw, 340px);
    background: var(--ivory-50);
    flex-direction: column;
    align-items: flex-start;
    padding: 6rem 2rem 2rem;
    gap: 1.4rem;
    transform: translateX(100%);
    transition: transform .32s ease;
    box-shadow: -18px 0 40px -20px rgba(22,34,63,0.3);
  }
  .nav-links.is-open { transform: translateX(0); }
  .nav-links a { font-size: 1.1rem; }
  .nav-toggle { display: block; z-index: 110; }
  .nav-cta .btn-primary { display: none; }
}
@media (min-width: 941px) {
  .nav-cta .btn-line { display: none; }
}

.nav-scrim {
  display: none;
  position: fixed; inset: 0;
  background: rgba(22,34,63,0.35);
  z-index: 99;
}
.nav-scrim.is-open { display: block; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--indigo-900) 0%, var(--indigo-800) 100%);
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding-top: clamp(3.5rem, 8vw, 6rem);
  padding-bottom: clamp(3.5rem, 8vw, 6rem);
}
.hero-est {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--marigold-400);
  border: 1px solid rgba(237,182,92,0.45);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1.4rem;
}
.hero h1 { color: var(--white); }
.hero .lede { color: rgba(255,255,255,0.82); font-size: 1.2rem; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.8rem; }
.hero-art { position: relative; }
.hero-art svg { width: 100%; height: auto; }
.hero-art img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  display: block;
}

@media (max-width: 860px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 320px; margin: 0 auto; }
}

/* ---------- Page header (interior pages) ---------- */
.page-header {
  background: var(--indigo-900);
  color: var(--white);
  padding: clamp(3rem, 6vw, 4.5rem) 0 clamp(2.5rem, 5vw, 3.5rem);
}
.page-header .eyebrow-plain { color: var(--marigold-400); }
.page-header h1 { color: var(--white); margin-bottom: 0.5rem; }
.page-header .lede { color: rgba(255,255,255,0.82); }
.breadcrumb {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 1.2rem;
}
.breadcrumb a { color: rgba(255,255,255,0.85); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ---------- Section helpers ---------- */
.section-head {
  max-width: 46rem;
  margin-bottom: 2.8rem;
}
.section-alt { background: var(--ivory-100); }
.section-dark { background: var(--indigo-900); color: var(--white); }
.section-dark h2, .section-dark h3 { color: var(--white); }
.section-dark p { color: rgba(255,255,255,0.78); }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
@media (max-width: 860px) {
  .two-col { grid-template-columns: 1fr; }
}
.two-col.reverse .col-media { order: 2; }
@media (max-width: 860px) {
  .two-col.reverse .col-media { order: -1; }
}

.media-frame {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--sand-200);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}
.media-frame svg { width: 62%; height: 62%; }
.media-frame.tall { aspect-ratio: 3/4; }
.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Secondary/companion photo strip used on initiative + education pages */
.media-duo {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.media-duo .media-frame.secondary { aspect-ratio: 16/7; }

.photo-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  margin-top: 2.5rem;
}
.photo-row .media-frame { aspect-ratio: 4/3; }
@media (max-width: 760px) {
  .photo-row { grid-template-columns: 1fr; }
}

.activity-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin-top: 2.5rem;
}
.activity-strip .media-frame { aspect-ratio: 16/10; }
@media (max-width: 760px) {
  .activity-strip { grid-template-columns: 1fr; }
}

/* ---------- Bento work grid ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.3rem;
}
.work-card {
  grid-column: span 3;
  background: var(--white);
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-md);
  padding: 2.1rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  transition: border-color .2s ease, transform .2s ease;
}
.work-card:hover { border-color: var(--marigold-500); transform: translateY(-3px); }
.work-card.span-wide { grid-column: span 4; }
.work-card.span-narrow { grid-column: span 2; }
.work-card .icon { width: 46px; height: 46px; color: var(--maroon-600); }
.work-card h3 { margin-bottom: 0.2rem; }
.work-card p { margin-bottom: 0.4rem; font-size: 0.98rem; }
.work-card .card-link { font-size: 0.92rem; font-weight: 600; color: var(--indigo-900); }

@media (max-width: 760px) {
  .work-grid { grid-template-columns: 1fr; }
  .work-card, .work-card.span-wide, .work-card.span-narrow { grid-column: span 1; }
}

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  padding-left: 2.2rem;
  border-left: 2px solid var(--sand-300);
  max-width: 44rem;
}
.timeline-item { position: relative; padding-bottom: 2.4rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -2.42rem;
  top: 0.35rem;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--marigold-500);
  border: 2px solid var(--indigo-900);
}
.timeline-year {
  font-family: var(--font-display);
  color: var(--maroon-600);
  font-size: 1.15rem;
  margin-bottom: 0.2rem;
  display: block;
}

/* ---------- Focus points list ---------- */
.focus-list {
  list-style: none;
  padding: 0; margin: 1.2rem 0 0;
  display: grid;
  gap: 0.75rem;
}
.focus-list li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  color: var(--ink-700);
  font-size: 0.98rem;
}
.focus-list svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 0.15rem; color: var(--maroon-600); }

/* ---------- Flow (why our work matters) ---------- */
.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 2rem;
}
.flow-step {
  background: var(--white);
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-sm);
  padding: 1rem 1.4rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--indigo-900);
}
.flow-arrow { color: var(--maroon-600); font-size: 1.3rem; }

/* ---------- Impact statements ---------- */
.impact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.6rem;
  margin-top: 2.5rem;
}
.impact-item {
  border-top: 3px solid var(--marigold-500);
  padding-top: 1rem;
}
.impact-item p { color: rgba(255,255,255,0.85); margin: 0; font-size: 0.98rem; }

/* ---------- Gallery ---------- */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2.2rem;
}
.filter-btn {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--white);
  border: 1px solid var(--sand-300);
  color: var(--ink-700);
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.filter-btn:hover { border-color: var(--maroon-600); }
.filter-btn.is-active {
  background: var(--indigo-900);
  border-color: var(--indigo-900);
  color: var(--white);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.2rem;
}
.gallery-item {
  border: none;
  padding: 0;
  cursor: pointer;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--sand-200);
  text-align: left;
  display: block;
}
.gallery-thumb {
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.gallery-thumb svg { width: 46%; height: 46%; }
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-caption {
  padding: 0.9rem 1.1rem 1.1rem;
  font-size: 0.9rem;
  color: var(--ink-700);
}
.gallery-caption strong { display: block; color: var(--indigo-900); font-size: 0.96rem; margin-bottom: 0.15rem; }

.lightbox {
  position: fixed; inset: 0;
  background: rgba(22,20,16,0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 2rem;
}
.lightbox.is-open { display: flex; }
.lightbox-inner {
  background: var(--ivory-50);
  border-radius: var(--radius-md);
  max-width: 640px;
  width: 100%;
  overflow: hidden;
}
.lightbox-media {
  aspect-ratio: 4/3;
  background: var(--sand-200);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.lightbox-media svg { width: 44%; height: 44%; }
.lightbox-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.lightbox-text { padding: 1.4rem 1.6rem 1.7rem; }
.lightbox-text h3 { margin-bottom: 0.3rem; }
.lightbox-text p { margin: 0; }
.lightbox-close {
  position: absolute;
  top: 1.4rem; right: 1.6rem;
  background: rgba(255,255,255,0.12);
  border: none;
  border-radius: 50%;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.lightbox-close svg { width: 20px; height: 20px; color: var(--white); }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 3.5rem);
}
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

.contact-card {
  background: var(--white);
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-md);
  padding: 2rem;
}
.contact-line {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--sand-200);
  text-decoration: none;
  color: var(--ink-900);
}
.contact-line:last-child { border-bottom: none; }
.contact-line svg { width: 22px; height: 22px; color: var(--maroon-600); flex-shrink: 0; }
.contact-line span { font-size: 0.98rem; }
.contact-line strong { display: block; font-size: 0.8rem; color: var(--ink-500); font-weight: 500; }

.contact-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.6rem; }

.form-field { margin-bottom: 1.2rem; }
.form-field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--indigo-900);
  margin-bottom: 0.4rem;
}
.form-field input, .form-field textarea {
  width: 100%;
  border: 1.5px solid var(--sand-300);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  font-family: var(--font-body);
  font-size: 0.98rem;
  background: var(--ivory-50);
  color: var(--ink-900);
}
.form-field input:focus, .form-field textarea:focus {
  outline: none;
  border-color: var(--maroon-600);
}
.form-note {
  font-size: 0.85rem;
  color: var(--ink-500);
  margin-top: 0.8rem;
}
.form-success {
  display: none;
  background: var(--ivory-100);
  border: 1px solid var(--marigold-500);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  font-size: 0.95rem;
  color: var(--indigo-900);
  margin-top: 1rem;
}
.form-success.is-visible { display: block; }

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--marigold-500);
  color: var(--indigo-900);
  text-align: center;
}
.cta-band h2 { color: var(--indigo-900); }
.cta-band .lede { color: rgba(22,34,63,0.8); margin-left: auto; margin-right: auto; }
.cta-band .hero-actions { justify-content: center; }
.cta-band .btn-outline { border-color: var(--indigo-900); color: var(--indigo-900); }
.cta-band .btn-outline:hover { background: rgba(22,34,63,0.08); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--indigo-900);
  color: rgba(255,255,255,0.82);
  padding: 3.5rem 0 1.6rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 2.5rem;
  padding-bottom: 2.4rem;
  border-bottom: 1px solid rgba(255,255,255,0.14);
}
@media (max-width: 800px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-brand { display: flex; gap: 0.7rem; margin-bottom: 1rem; }
.footer-brand svg { width: 38px; height: 38px; flex-shrink: 0; }
.footer-brand strong { display: block; font-family: var(--font-display); color: var(--white); font-size: 1.05rem; }
.footer-brand span { font-size: 0.78rem; color: rgba(255,255,255,0.6); }
.footer-col h4 {
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.footer-col a { color: rgba(255,255,255,0.78); text-decoration: none; font-size: 0.93rem; }
.footer-col a:hover { color: var(--marigold-400); }
.footer-col p { font-size: 0.93rem; color: rgba(255,255,255,0.78); margin-bottom: 0.5rem; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
  padding-top: 1.4rem;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.55);
}

/* ---------- Reveal on load (single orchestrated moment) ---------- */
.reveal-on-load {
  opacity: 0;
  transform: translateY(14px);
  animation: revealUp 0.7s ease forwards;
}
@keyframes revealUp {
  to { opacity: 1; transform: translateY(0); }
}
