/* =========================================================
   St. John's Telugu Church — Fresh Single-Page Theme
   Palette: blue & white — inspired by the existing portal
   ========================================================= */

:root {
  --c-bg:          #ffffff;
  --c-bg-tint:     #f0f5fb;
  --c-bg-dark:     #0B2038;
  --c-surface:     #ffffff;
  --c-ink:         #1a2332;
  --c-ink-soft:    #4a5568;
  --c-muted:       #718096;
  --c-line:        #e2e8f0;
  --c-primary:     #1e4d8c;
  --c-primary-700: #153a6b;
  --c-primary-300: #5b8dce;
  --c-accent:      #d4a942;
  --c-accent-700:  #b8922e;

  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 24px;

  --shadow-sm: 0 1px 2px rgba(30,77,140,.06), 0 2px 6px rgba(30,77,140,.04);
  --shadow:    0 4px 12px rgba(30,77,140,.1), 0 20px 40px -20px rgba(30,77,140,.2);

  --f-serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --f-sans:  "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --container: 1160px;
  --gutter: clamp(20px, 4vw, 40px);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--f-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--c-ink);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
.skip-link {
  position: absolute; left: -9999px; top: 8px;
  background: var(--c-primary); color: white; padding: 10px 14px; border-radius: 8px; z-index: 100;
}
.skip-link:focus { left: 12px; }

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

/* ---------- Typography ---------- */
.display, h1, h2, h3, h4 { font-family: var(--f-serif); font-weight: 500; letter-spacing: -0.02em; line-height: 1.08; color: var(--c-ink); }
.display { font-size: clamp(2.4rem, 5.4vw, 4.8rem); }
.display em { font-style: italic; color: var(--c-primary); font-weight: 400; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.8rem); margin: 0 0 .5rem; }
h3 { font-size: 1.35rem; margin: 0 0 .5rem; font-weight: 600; letter-spacing: -0.01em; }
.lede { font-size: clamp(1.05rem, 1.4vw, 1.2rem); color: var(--c-ink-soft); max-width: 56ch; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  text-transform: uppercase; letter-spacing: .14em; font-size: .8rem; font-weight: 600;
  color: var(--c-primary); margin-bottom: 18px;
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-accent); box-shadow: 0 0 0 4px rgba(201,169,97,.18); }
.muted { color: var(--c-muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 22px; border-radius: 999px; font-weight: 600; font-size: .98rem;
  transition: transform .15s ease, background .2s ease, color .2s ease, box-shadow .2s ease;
}
.btn-sm { padding: 10px 16px; font-size: .9rem; }
.btn-primary { background: var(--c-primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--c-primary-700); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-ghost { border: 1px solid var(--c-line); color: var(--c-ink); }
.btn-ghost:hover { border-color: var(--c-primary); color: var(--c-primary); }
.btn-link { color: var(--c-primary); padding: 14px 4px; }
.btn-link:hover { color: var(--c-primary-700); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid var(--c-line);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.site-header.scrolled { box-shadow: 0 2px 8px rgba(30,77,140,.08); }
.nav { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  height: 90px; border-radius: 0;
  overflow: visible;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.brand-mark img { height: 90px; width: auto; object-fit: contain; }
.brand-mark svg { width: 22px; height: 22px; fill: currentColor; }
.brand-mark.sm { height: 36px; }
.brand-text { display: none; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--f-serif); font-weight: 600; font-size: 1.15rem; }
.brand-sub { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--c-muted); }

.primary-nav { display: flex; align-items: center; gap: 8px; }
.primary-nav ul {
  list-style: none; margin: 0; padding: 0; display: flex; gap: 4px;
  background: var(--c-bg-tint); border-radius: 999px; padding: 6px;
}
.primary-nav a {
  font-size: .9rem; font-weight: 600; color: var(--c-ink-soft);
  position: relative; padding: 10px 18px; border-radius: 999px;
  transition: background .2s ease, color .2s ease;
}
.primary-nav a::after { display: none; }
.primary-nav a:hover, .primary-nav a.active {
  color: var(--c-primary); background: #ffffff;
  box-shadow: 0 1px 4px rgba(30,77,140,.1);
}

.nav-toggle { display: none; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--c-line); flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--c-ink); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .primary-nav {
    position: absolute; top: 100%; right: var(--gutter); left: var(--gutter);
    background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius);
    flex-direction: column; align-items: stretch; gap: 0; padding: 14px;
    box-shadow: var(--shadow); transform-origin: top right;
    transform: scale(.96) translateY(-6px); opacity: 0; pointer-events: none;
    transition: transform .18s ease, opacity .18s ease;
  }
  .primary-nav.open { transform: none; opacity: 1; pointer-events: auto; }
  .primary-nav ul { flex-direction: column; gap: 4px; }
  .primary-nav ul a { display: block; padding: 12px 10px; border-radius: 8px; }
  .primary-nav ul a:hover { background: var(--c-bg-tint); }
  .primary-nav .btn { margin-top: 8px; justify-content: center; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(60px, 10vw, 120px) 0 clamp(40px, 6vw, 80px);
  background: radial-gradient(120% 80% at 80% 0%, #dbeafe 0%, var(--c-bg) 55%);
  isolation: isolate;
}
.hero-bg { position: absolute; inset: 0; z-index: -1; color: var(--c-primary); }
.hero-glow {
  position: absolute; top: -20%; right: -15%; width: 60vw; height: 60vw; max-width: 720px; max-height: 720px;
  background: radial-gradient(closest-side, rgba(30,77,140,.18), rgba(30,77,140,0) 70%);
  filter: blur(20px);
}
.hero-pattern { position: absolute; inset: 0; width: 100%; height: 100%; }

.hero-inner { position: relative; max-width: 880px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0 36px; }
.verse {
  margin: 28px 0 0; padding: 22px 26px; border-left: 3px solid var(--c-accent);
  background: rgba(255,255,255,.55); border-radius: 0 var(--radius) var(--radius) 0;
  max-width: 640px; backdrop-filter: blur(4px);
}
.verse blockquote { margin: 0; font-family: var(--f-serif); font-style: italic; font-size: 1.15rem; color: var(--c-ink); line-height: 1.5; }
.verse figcaption { margin-top: 8px; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: var(--c-primary); font-weight: 600; }

.hero-meta {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  margin-top: clamp(40px, 6vw, 70px);
  background: var(--c-line); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--c-line);
}
.hero-meta > div { background: var(--c-bg); padding: 22px 20px; display: flex; flex-direction: column; gap: 4px; }
.hero-meta strong { font-family: var(--f-serif); font-size: 1.6rem; color: var(--c-primary); font-weight: 600; }
.hero-meta span { font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: var(--c-muted); }
@media (max-width: 720px) { .hero-meta { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Sections ---------- */
.section { padding: clamp(70px, 9vw, 120px) 0; position: relative; }
.section-tint { background: var(--c-bg-tint); }
.section-dark { background: var(--c-bg-dark); color: #e6e2d8; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-dark .eyebrow { color: var(--c-accent); }
.section-dark .muted { color: #a8b0ac; }

.section-head { max-width: 760px; margin-bottom: 56px; }
.section-head p { color: var(--c-ink-soft); font-size: 1.08rem; margin: 14px 0 0; }
.section-dark .section-head p { color: #c9d4e0; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(40px, 6vw, 80px); align-items: center; }
@media (max-width: 880px) { .about-grid { grid-template-columns: 1fr; } }

.about-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 32px; }
.stat {
  padding: 22px; border-radius: var(--radius); background: var(--c-surface);
  border: 1px solid var(--c-line); box-shadow: var(--shadow-sm);
}
.stat strong { display: block; font-family: var(--f-serif); font-size: 2rem; color: var(--c-primary); font-weight: 600; }
.stat span { font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: var(--c-muted); }

.about-art {
  border-radius: var(--radius-lg); position: relative; overflow: hidden;
  background: var(--c-bg-tint);
  box-shadow: var(--shadow);
  display: grid; place-items: center;
}
.about-art img {
  width: 100%; height: auto; object-fit: contain;
  border-radius: var(--radius-lg);
}
.about-art::after { display: none; }

/* ---------- Mission / Vision cards ---------- */
.mv-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
@media (max-width: 760px) { .mv-grid { grid-template-columns: 1fr; } }
.mv-card {
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-lg);
  padding: 36px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}
.mv-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.mv-card .icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: rgba(47,93,80,.08); color: var(--c-primary);
  display: grid; place-items: center; margin-bottom: 22px;
}
.mv-card .icon svg { width: 26px; height: 26px; }
.mv-card p { color: var(--c-ink-soft); margin: 8px 0 0; }

/* ---------- Activities grid ---------- */
.act-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.act-card {
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius);
  padding: 26px; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
  position: relative;
}
.act-card:hover { transform: translateY(-3px); border-color: var(--c-primary-300); box-shadow: var(--shadow); }
.act-card .icon { width: 42px; height: 42px; border-radius: 10px; background: var(--c-bg-tint); color: var(--c-primary); display: grid; place-items: center; margin-bottom: 16px; }
.act-card .icon svg { width: 22px; height: 22px; }
.act-card h3 { font-size: 1.15rem; margin-bottom: 4px; }
.act-card .time { font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; color: var(--c-accent-700); font-weight: 600; margin-bottom: 10px; }
.act-card p { color: var(--c-ink-soft); margin: 0; font-size: .96rem; }

/* ---------- Leadership ---------- */
.people-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 40px; }
@media (max-width: 880px) { .people-grid { grid-template-columns: 1fr; } }
.person {
  background: #152842; border: 1px solid #1e3a5c; border-radius: var(--radius-lg);
  padding: 30px; transition: transform .2s ease, border-color .2s ease;
}
.person:hover { transform: translateY(-3px); border-color: var(--c-accent); }
.avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, var(--c-accent), var(--c-accent-700));
  color: var(--c-bg-dark); font-family: var(--f-serif); font-weight: 600; font-size: 1.6rem;
  display: grid; place-items: center; margin-bottom: 20px;
}
.person h3 { color: #fff; margin-bottom: 4px; }
.person .role { font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; color: var(--c-accent); font-weight: 600; }
.person p { color: #c9d4e0; margin: 16px 0 0; font-size: .95rem; line-height: 1.6; }

/* ---------- History timeline ---------- */
.timeline { position: relative; margin-top: 50px; padding-left: 28px; }
.timeline::before {
  content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(var(--c-accent), var(--c-line));
  border-radius: 2px;
}
.tl-item { position: relative; padding: 0 0 32px 24px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -24px; top: 6px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--c-bg); border: 3px solid var(--c-accent);
  box-shadow: 0 0 0 4px var(--c-bg);
}
.tl-year { font-family: var(--f-serif); font-size: 1.6rem; color: var(--c-primary); font-weight: 600; }
.tl-title { font-weight: 600; margin: 2px 0 4px; }
.tl-body { color: var(--c-ink-soft); font-size: .98rem; max-width: 60ch; }

/* ---------- Visit ---------- */
.visit-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(30px, 5vw, 60px); align-items: stretch; }
@media (max-width: 880px) { .visit-grid { grid-template-columns: 1fr; } }
.visit-card {
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-lg);
  padding: 36px; box-shadow: var(--shadow-sm);
}
.info-list { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 14px; }
.info-list li { display: flex; gap: 14px; align-items: flex-start; }
.info-list .info-icon {
  flex: 0 0 36px; width: 36px; height: 36px; border-radius: 10px;
  background: var(--c-bg-tint); color: var(--c-primary); display: grid; place-items: center;
}
.info-list .info-icon svg { width: 18px; height: 18px; }
.info-list strong { display: block; font-weight: 600; }
.info-list span { color: var(--c-ink-soft); font-size: .95rem; }
.map-frame {
  border-radius: var(--radius-lg); overflow: hidden; min-height: 320px;
  border: 1px solid var(--c-line); box-shadow: var(--shadow-sm);
}
.map-frame iframe { display: block; width: 100%; height: 100%; min-height: 380px; border: 0; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--c-bg-dark);
  color: #c9d4e0;
  padding: 72px 0 0;
  position: relative;
  overflow: hidden;
}
.site-footer::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent), var(--c-primary));
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr;
  gap: 48px;
  align-items: start;
}
.footer-brand {}
.footer-logo {
  margin-bottom: 16px;
}
.footer-logo img {
  height: 72px; width: auto; opacity: .95;
  filter: brightness(1.1);
}
.footer-name {
  font-family: var(--f-serif); font-size: 1.3rem; color: #fff;
  margin: 0 0 6px; font-weight: 600;
}
.footer-name span { color: var(--c-accent); font-style: italic; font-size: .85em; }
.footer-tagline {
  font-size: .95rem; color: #a0b4c8; margin: 0 0 16px;
  font-style: italic;
}
.footer-address {
  font-size: .88rem; color: #8a9ab0; line-height: 1.6; margin: 0;
}
.footer-links h4,
.footer-worship h4 {
  font-family: var(--f-serif); font-size: 1rem; color: #fff;
  margin: 0 0 18px; font-weight: 600;
  letter-spacing: .02em;
  position: relative;
  padding-bottom: 12px;
}
.footer-links h4::after,
.footer-worship h4::after {
  content: "";
  position: absolute; bottom: 0; left: 0;
  width: 32px; height: 2px;
  background: var(--c-accent);
  border-radius: 2px;
}
.site-footer nav {
  display: flex; flex-direction: column; gap: 10px;
}
.site-footer nav a {
  font-size: .9rem; color: #a0b4c8; padding: 4px 0;
  transition: color .2s ease, padding-left .2s ease;
  border-bottom: none;
}
.site-footer nav a:hover {
  color: #ffffff; padding-left: 6px;
}
.site-footer nav a::before {
  content: "›"; margin-right: 8px; color: var(--c-accent);
  font-weight: 700;
}
.footer-schedule {
  display: flex; flex-direction: column; gap: 14px;
}
.footer-schedule-item {
  padding: 14px 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-sm);
  transition: border-color .2s ease, background .2s ease;
}
.footer-schedule-item:hover {
  border-color: rgba(212,169,66,.3);
  background: rgba(255,255,255,.06);
}
.footer-schedule-item strong {
  display: block; font-size: .88rem; color: #fff;
  margin-bottom: 2px; font-weight: 600;
}
.footer-schedule-item span {
  font-size: .82rem; color: var(--c-accent); font-weight: 600;
  letter-spacing: .03em;
}
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding: 24px 0;
  margin-top: 48px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.footer-bottom .copy {
  font-size: .82rem; color: #6b7f96; margin: 0;
}
@media (max-width: 880px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .footer-inner { grid-template-columns: 1fr; gap: 36px; }
  .footer-bottom { flex-direction: column; gap: 6px; text-align: center; }
}

/* ---------- Reveal-on-scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ========================================
   RESPONSIVE DESIGN — Mobile-first tweaks
   ======================================== */

/* ----- Small phones (< 480px) ----- */
@media (max-width: 480px) {
  body { font-size: 15px; }
  .display { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  .hero-meta { grid-template-columns: 1fr 1fr; }
  .hero-meta > div { padding: 16px 14px; }
  .hero-meta strong { font-size: 1.3rem; }
  .act-grid { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: 1fr; }
  .stat { padding: 16px; }
  .visit-grid { grid-template-columns: 1fr; }
  .mv-grid { grid-template-columns: 1fr; }
  .people-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; text-align: center; }
  .site-footer nav { justify-content: center; }
  .verse { padding: 16px 18px; }
  .brand-name { font-size: 1rem; }
  .brand-sub { font-size: .68rem; }
  .section { padding: clamp(50px, 6vw, 80px) 0; }
  .section-head { margin-bottom: 36px; }
}

/* ----- Tablets (481px – 860px) ----- */
@media (min-width: 481px) and (max-width: 860px) {
  .hero-meta { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
  .about-art { max-height: 360px; aspect-ratio: 16/9; }
  .about-stats { grid-template-columns: repeat(3, 1fr); }
  .people-grid { grid-template-columns: repeat(2, 1fr); }
  .act-grid { grid-template-columns: repeat(2, 1fr); }
  .visit-grid { grid-template-columns: 1fr; }
}

/* ----- Touch device hover fix ----- */
@media (hover: none) {
  .mv-card:hover,
  .act-card:hover,
  .person:hover { transform: none; box-shadow: var(--shadow-sm); }
}

/* ----- Safe area insets for notched devices ----- */
@supports (padding: env(safe-area-inset-bottom)) {
  .site-footer { padding-bottom: calc(30px + env(safe-area-inset-bottom)); }
  .site-header { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
}

/* ----- High-DPI/Retina logo sharpness ----- */
.brand-mark img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* ----- Print styles ----- */
@media print {
  .site-header, .site-footer, .nav-toggle, .hero-bg, .btn { display: none; }
  .section { padding: 20px 0; break-inside: avoid; }
  body { font-size: 12pt; color: #000; background: #fff; }
}
