/* Yeshivat Keter Torah — Redesign
   Modern, accessible, performant. No frameworks, no WP. */

:root {
  --navy: #0e2a47;
  --navy-deep: #08182a;
  --gold: #c9a13b;
  --gold-soft: #e6c878;
  --cream: #f7f3ea;
  --ink: #1a1a1a;
  --ink-soft: #4a4a4a;
  --line: #e5dfd2;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(8,24,42,.06), 0 1px 3px rgba(8,24,42,.05);
  --shadow-md: 0 6px 24px rgba(8,24,42,.08), 0 2px 6px rgba(8,24,42,.06);
  --shadow-lg: 0 24px 60px rgba(8,24,42,.18);
  --radius: 14px;
  --radius-lg: 22px;
  --max: 1200px;
  --ease: cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Source Sans 3', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--navy); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--gold); }
h1,h2,h3,h4 {
  font-family: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 700; }
h2 { font-size: clamp(1.85rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.4rem; }
.eyebrow {
  font-family: 'Source Sans 3', sans-serif;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .78rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: .9rem;
}
.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247,243,234,.92);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; max-width: var(--max); margin: 0 auto; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 48px; width: 48px; object-fit: contain; background: var(--navy); border-radius: 10px; padding: 4px; box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 2px 8px rgba(10,31,68,.18); border: 1px solid rgba(212,164,55,.35); }
.brand-text { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 1.15rem; color: var(--navy); line-height: 1.05; }
.brand-text small { display: block; font-family: 'Source Sans 3', sans-serif; font-size: .68rem; letter-spacing: .14em; color: var(--gold); text-transform: uppercase; font-weight: 700; }
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: inline-block; padding: 9px 14px; border-radius: 10px;
  font-weight: 500; font-size: .96rem; color: var(--navy);
}
.nav-links a:hover { background: rgba(14,42,71,.06); color: var(--navy); }
.nav-links a.active { background: var(--navy); color: var(--white); }
.nav-cta {
  background: var(--gold); color: var(--white) !important;
  padding: 10px 18px !important; border-radius: 999px;
  font-weight: 600 !important;
}
.nav-cta:hover { background: var(--navy) !important; color: var(--white) !important; }
.menu-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; position: relative; z-index: 110; }
.menu-toggle span { display: block; width: 26px; height: 2px; background: var(--navy); margin: 6px 0; border-radius: 2px; transition: transform .3s var(--ease), opacity .2s var(--ease), background .2s; transform-origin: center; }

@media (max-width: 900px) {
  /* Drop backdrop-filter on mobile so the fixed menu panel isn't clipped
     by the header's containing block. Solid bg keeps the header readable. */
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--cream); }
  .menu-toggle { display: block; }

  /* Full-screen modern overlay menu — navy gradient, editorial type, no bubbles. */
  .nav-links {
    position: fixed; inset: 0;
    flex-direction: column; align-items: stretch; justify-content: flex-start;
    gap: 0; padding: 96px 32px 40px;
    background:
      radial-gradient(120% 80% at 80% 0%, rgba(212,164,55,.18) 0%, transparent 55%),
      linear-gradient(160deg, #0a1f44 0%, #08182a 100%);
    opacity: 0; visibility: hidden; pointer-events: none;
    transform: translateY(-12px);
    transition: opacity .35s var(--ease), transform .4s var(--ease), visibility 0s linear .35s;
    overflow-y: auto;
  }
  .nav-links.open {
    opacity: 1; visibility: visible; pointer-events: auto;
    transform: translateY(0);
    transition: opacity .35s var(--ease), transform .4s var(--ease), visibility 0s linear 0s;
  }
  .nav-links li { width: 100%; }
  .nav-links a {
    display: flex; align-items: center; justify-content: space-between;
    padding: 22px 4px; margin: 0;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.65rem; font-weight: 500; letter-spacing: .005em;
    color: rgba(255,255,255,.92);
    background: transparent; border: 0; border-radius: 0;
    border-bottom: 1px solid rgba(255,255,255,.09);
    transition: color .2s var(--ease), padding .25s var(--ease);
  }
  .nav-links a::after {
    content: '→';
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1rem; font-weight: 400;
    color: rgba(212,164,55,.55);
    transition: transform .25s var(--ease), color .2s;
  }
  .nav-links a:hover { color: var(--gold-soft); padding-left: 10px; background: transparent; }
  .nav-links a:hover::after { color: var(--gold); transform: translateX(4px); }
  .nav-links a.active { color: var(--gold-soft); background: transparent; }
  .nav-links a.active::after { content: '●'; color: var(--gold); font-size: .55rem; }

  /* Stagger the entrance of each item */
  .nav-links li { opacity: 0; transform: translateY(8px); transition: opacity .35s var(--ease), transform .35s var(--ease); }
  .nav-links.open li { opacity: 1; transform: translateY(0); }
  .nav-links.open li:nth-child(1) { transition-delay: .08s; }
  .nav-links.open li:nth-child(2) { transition-delay: .12s; }
  .nav-links.open li:nth-child(3) { transition-delay: .16s; }
  .nav-links.open li:nth-child(4) { transition-delay: .20s; }
  .nav-links.open li:nth-child(5) { transition-delay: .24s; }
  .nav-links.open li:nth-child(6) { transition-delay: .28s; }
  .nav-links.open li:nth-child(7) { transition-delay: .32s; }

  /* Donate CTA — distinct, pulled below the list, no border line */
  .nav-links li:has(.nav-cta) { margin-top: 28px; }
  .nav-links a.nav-cta {
    justify-content: center;
    background: var(--gold) !important; color: var(--white) !important;
    border: 0 !important; border-radius: 999px !important;
    padding: 16px 24px !important;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    box-shadow: 0 10px 30px rgba(212,164,55,.25);
  }
  .nav-links a.nav-cta::after { display: none; }
  .nav-links a.nav-cta:hover { background: var(--white) !important; color: var(--navy) !important; padding: 16px 24px !important; }

  /* Hamburger -> X when open */
  body.menu-open .menu-toggle span { background: var(--white); }
  body.menu-open .menu-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  body.menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
  body.menu-open .menu-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  /* Header stays above the menu so the close button is reachable */
  body.menu-open .site-header { background: transparent; border-bottom-color: transparent; }
  body.menu-open .brand-text { color: var(--white); }
  body.menu-open .brand-text small { color: var(--gold-soft); }
  .site-header { z-index: 100; }
  .nav-links { z-index: 95; }

  /* Lock body scroll when menu open */
  body.menu-open { overflow: hidden; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 13px 26px;
  border-radius: 999px; font-weight: 600; font-size: .98rem;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s;
  border: 0; cursor: pointer; line-height: 1; letter-spacing: .01em;
}
.btn-primary { background: var(--gold); color: var(--white); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--navy); color: var(--white); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary { background: var(--navy); color: var(--white); }
.btn-secondary:hover { background: var(--gold); color: var(--white); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.btn-ghost:hover { background: var(--navy); color: var(--white); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  min-height: 78vh; display: flex; align-items: center;
  color: var(--white);
  padding: 120px 0 100px;
}
.hero-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(8,24,42,.75) 0%, rgba(14,42,71,.55) 60%, rgba(201,161,59,.35) 100%),
              url('/assets/images/hero-building.jpg') center/cover no-repeat;
  z-index: 0;
}
.hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 70% 30%, rgba(201,161,59,.18), transparent 50%);
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { color: var(--white); max-width: 18ch; }
.hero h1 .accent { color: var(--gold-soft); font-style: italic; font-weight: 400; }
.hero-tagline {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(1.1rem, 1.8vw, 1.4rem);
  color: var(--gold-soft);
  margin-bottom: 1.6rem;
}
.hero-lede { max-width: 56ch; font-size: 1.15rem; color: rgba(255,255,255,.92); margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0; margin-top: 60px;
  padding-top: 32px; border-top: 1px solid rgba(255,255,255,.18);
  max-width: 760px;
}
.stat { padding: 4px 24px; border-left: 1px solid rgba(255,255,255,.14); }
.stat:first-child { padding-left: 0; border-left: 0; }
.stat .num { font-family: 'Cormorant Garamond', serif; font-size: clamp(2rem, 4.4vw, 2.6rem); font-weight: 700; color: var(--gold-soft); line-height: 1; white-space: nowrap; }
.stat .label { font-size: .78rem; text-transform: uppercase; letter-spacing: .14em; color: rgba(255,255,255,.82); margin-top: 8px; line-height: 1.35; font-weight: 600; }
@media (max-width: 640px) {
  .hero-stats {
    grid-template-columns: 1fr; gap: 0;
    margin-top: 40px; padding-top: 24px;
    max-width: 360px;
  }
  .stat {
    padding: 16px 0; border-left: 0;
    border-top: 1px solid rgba(255,255,255,.12);
    display: flex; align-items: baseline; gap: 14px;
  }
  .stat:first-child { border-top: 0; padding-top: 4px; }
  .stat .num { font-size: 2rem; }
  .stat .label { margin-top: 0; font-size: .8rem; }
}

/* ---------- Sections ---------- */
section { padding: 100px 0; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 60px; }
.section-head p { color: var(--ink-soft); font-size: 1.1rem; }

/* Mission */
.mission { background: var(--white); position: relative; }
.mission-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 64px; align-items: center; }
.mission-copy p { color: var(--ink-soft); margin-bottom: 1.1em; font-size: 1.08rem; }
.mission-copy p:first-of-type::first-letter {
  font-family: 'Cormorant Garamond', serif;
  float: left; font-size: 4.2rem; line-height: .85; padding: 6px 12px 0 0;
  color: var(--gold); font-weight: 700;
}
.mission-image {
  position: relative; aspect-ratio: 4/5; border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-lg);
}
.mission-image img { width: 100%; height: 100%; object-fit: cover; }
.mission-image::before {
  content: ''; position: absolute; inset: -16px -16px auto auto; width: 140px; height: 140px;
  border: 2px solid var(--gold); border-radius: var(--radius-lg); z-index: -1;
}

@media (max-width: 800px) { .mission-grid { grid-template-columns: 1fr; gap: 40px; } }

/* Pillars */
.pillars { background: var(--cream); }
.pillars-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.pillar {
  background: var(--white); padding: 36px 30px; border-radius: var(--radius);
  box-shadow: var(--shadow-sm); border: 1px solid var(--line);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
.pillar:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--gold-soft); }
.pillar .icon {
  width: 54px; height: 54px; border-radius: 14px;
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px; color: var(--white);
}
.pillar h3 { margin-bottom: 8px; }
.pillar p { color: var(--ink-soft); margin: 0; }
@media (max-width: 800px) { .pillars-grid { grid-template-columns: 1fr; } }

/* Divisions */
.divisions { background: var(--navy); color: var(--white); }
.divisions h2, .divisions .section-head p { color: var(--white); }
.divisions .section-head p { color: rgba(255,255,255,.78); }
.div-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.division-card {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-lg);
  padding: 40px; display: flex; flex-direction: column; gap: 18px;
  transition: transform .25s var(--ease), border-color .25s;
}
.division-card:hover { transform: translateY(-4px); border-color: var(--gold); }
.division-card .logo-bubble {
  width: 90px; height: 90px; border-radius: 50%;
  background: var(--white); display: flex; align-items: center; justify-content: center;
  padding: 14px;
}
.division-card .logo-bubble img { width: 100%; height: 100%; object-fit: contain; }
.division-card h3 { color: var(--white); font-size: 1.6rem; }
.division-card p { color: rgba(255,255,255,.78); margin: 0; }
.division-card .actions { margin-top: auto; display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 800px) { .div-grid { grid-template-columns: 1fr; } }

/* Gallery */
.gallery { background: var(--white); }
.gallery-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.gallery-grid figure {
  margin: 0; aspect-ratio: 1; overflow: hidden; border-radius: 10px; cursor: pointer; position: relative;
  background: var(--cream);
}
.gallery-grid img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s var(--ease), filter .3s;
}
.gallery-grid figure:hover img { transform: scale(1.06); }
.gallery-grid figure::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(8,24,42,.4), transparent 60%);
  opacity: 0; transition: opacity .3s;
}
.gallery-grid figure:hover::after { opacity: 1; }
@media (max-width: 800px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }

/* CTA banner */
.cta-band {
  background: linear-gradient(120deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: var(--white); padding: 70px 0;
  position: relative; overflow: hidden;
}
.cta-band::before {
  content: ''; position: absolute; inset: -20%;
  background: radial-gradient(circle at 80% 50%, rgba(201,161,59,.25), transparent 50%);
}
.cta-band .container { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.cta-band h2 { color: var(--white); margin: 0; max-width: 16ch; }
.cta-band p { color: rgba(255,255,255,.8); margin: 8px 0 0; }

/* Footer */
.site-footer {
  background: var(--navy-deep); color: rgba(255,255,255,.78);
  padding: 70px 0 30px;
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px;
  padding-bottom: 40px; border-bottom: 1px solid rgba(255,255,255,.1);
}
.footer-grid h4 { color: var(--white); font-size: 1.05rem; margin-bottom: 16px; font-family: 'Source Sans 3', sans-serif; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.footer-grid a { color: rgba(255,255,255,.78); display: block; padding: 4px 0; }
.footer-grid a:hover { color: var(--gold-soft); }
.footer-brand img { height: 72px; margin-bottom: 16px; }
.footer-brand p { font-size: .95rem; color: rgba(255,255,255,.65); max-width: 32ch; }
.footer-bottom {
  padding-top: 24px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: .85rem; color: rgba(255,255,255,.5);
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* ---------- Page header (interior pages) ---------- */
.page-hero {
  position: relative; padding: 140px 0 80px; color: var(--white);
  background: linear-gradient(135deg, rgba(8,24,42,.85), rgba(14,42,71,.7)), var(--navy);
  text-align: center;
}
.page-hero.with-image { background: linear-gradient(135deg, rgba(8,24,42,.78), rgba(14,42,71,.55)), var(--navy); }
.page-hero h1 { color: var(--white); margin-bottom: .3em; }
.page-hero p { font-size: 1.15rem; color: rgba(255,255,255,.85); max-width: 60ch; margin: 0 auto; }
.breadcrumb { font-size: .85rem; color: var(--gold-soft); text-transform: uppercase; letter-spacing: .14em; margin-bottom: 16px; }
.breadcrumb a { color: var(--gold-soft); }
.breadcrumb a:hover { color: var(--white); }

/* Prose */
.prose { max-width: 760px; margin: 0 auto; }
.prose p { color: var(--ink-soft); font-size: 1.1rem; margin: 0 0 1.2em; }
.prose h2 { margin-top: 1.8em; }
.prose ul { color: var(--ink-soft); padding-left: 1.4em; }

/* Apply / divisions cards on apply page */
.apply-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; max-width: 980px; margin: 0 auto; }
.apply-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 44px 36px; text-align: center; box-shadow: var(--shadow-md);
  border: 1px solid var(--line); transition: transform .25s var(--ease);
}
.apply-card:hover { transform: translateY(-4px); }
.apply-card .logo-bubble {
  width: 130px; height: 130px; margin: 0 auto 24px;
  display: flex; align-items: center; justify-content: center;
  background: var(--cream); border-radius: 50%;
  padding: 22px;
}
.apply-card .logo-bubble img { max-width: 100%; max-height: 100%; }
.apply-card h3 { font-size: 1.7rem; }
.apply-card p { color: var(--ink-soft); margin-bottom: 24px; }
@media (max-width: 700px) { .apply-grid { grid-template-columns: 1fr; } }

/* Donate cards */
.donate-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.donate-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 36px 28px; text-align: center;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
.donate-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--gold); }
.donate-card .icon {
  width: 64px; height: 64px; margin: 0 auto 18px;
  border-radius: 50%; background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  color: var(--white); display: flex; align-items: center; justify-content: center;
}
.donate-card h3 { font-size: 1.3rem; margin-bottom: 8px; }
.donate-card p { color: var(--ink-soft); font-size: .96rem; margin-bottom: 20px; min-height: 3em; }
.donate-card .copy-line {
  background: var(--cream); padding: 12px 16px; border-radius: 10px;
  font-family: ui-monospace, Menlo, Monaco, monospace; font-size: .92rem;
  color: var(--navy); margin-bottom: 16px; word-break: break-all;
}
@media (max-width: 800px) { .donate-grid { grid-template-columns: 1fr; } }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: stretch; }
.contact-info {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 40px; box-shadow: var(--shadow-sm); border: 1px solid var(--line);
}
.contact-info h3 { margin-bottom: 6px; }
.contact-info .info-row {
  display: flex; gap: 18px; padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.contact-info .info-row:last-child { border: 0; }
.contact-info .info-row .icon {
  flex: none; width: 44px; height: 44px; border-radius: 12px;
  background: var(--cream); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
}
.contact-info .info-row .label { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-soft); margin-bottom: 4px; }
.contact-info .info-row .value { font-size: 1.1rem; color: var(--navy); font-weight: 600; }
.contact-map { border-radius: var(--radius-lg); overflow: hidden; min-height: 380px; box-shadow: var(--shadow-md); border: 1px solid var(--line); }
.contact-map iframe { width: 100%; height: 100%; min-height: 380px; border: 0; display: block; }
@media (max-width: 800px) { .contact-grid { grid-template-columns: 1fr; } }

/* Iframe wrapper */
.iframe-wrap {
  background: var(--white); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-md); border: 1px solid var(--line);
  max-width: 980px; margin: 0 auto;
}
.iframe-wrap iframe { display: block; width: 100%; min-height: 1200px; border: 0; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
