/* Beis Ahavas Yisroel — modern identity
   Light "Jerusalem stone" palette: warm ivory/cream base · gold (Torah/kedusha) ·
   deep navy reserved for header & footer only. */

:root {
  --navy-900: #0f2138;
  --navy:     #16304f;
  --navy-700: #234a72;
  --gold:      #c19a45;
  --gold-light:#e2c37a;
  --gold-deep: #9c7628;
  --cream:    #f8f2e6;
  --cream-2:  #f0e6d2;
  --parchment:#fcf8f0;
  --warm-white:#fffdf9;
  --ink:      #223247;
  --ink-soft: #55627a;

  --maxw: 1120px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 22px 55px -28px rgba(22, 48, 79, .30);
  --shadow-soft: 0 12px 32px -20px rgba(22, 48, 79, .22);

  --serif: "Frank Ruhl Libre", Georgia, "Times New Roman", serif;
  --sans: "Assistant", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--warm-white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--gold-deep); }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--gold); color: var(--navy-900);
  padding: .6rem 1rem; border-radius: 0 0 8px 0; z-index: 200; font-weight: 700;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(22, 48, 79, .95);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid rgba(226, 195, 122, .30);
}
.header-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .65rem 1.25rem;
}
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.brand-mark { width: 44px; height: 44px; flex: 0 0 auto; filter: drop-shadow(0 2px 6px rgba(0,0,0,.25)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.12; }
.brand-he { font-family: var(--serif); font-weight: 700; font-size: 1.3rem; color: var(--gold-light); letter-spacing: .5px; }
.brand-en { font-family: var(--sans); font-weight: 600; font-size: .7rem; letter-spacing: .22em; text-transform: uppercase; color: rgba(255,255,255,.72); }

.site-nav { display: flex; gap: .3rem; flex-wrap: wrap; }
.site-nav a {
  color: rgba(255,255,255,.82); text-decoration: none; font-weight: 600; font-size: .92rem;
  padding: .45rem .7rem; border-radius: 8px; position: relative; transition: color .2s;
}
.site-nav a::after {
  content: ""; position: absolute; left: .7rem; right: .7rem; bottom: .28rem; height: 2px;
  background: var(--gold-light); transform: scaleX(0); transform-origin: left; transition: transform .22s ease;
}
.site-nav a:hover, .site-nav a:focus-visible { color: var(--gold-light); }
.site-nav a:hover::after, .site-nav a:focus-visible::after { transform: scaleX(1); }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer;
  padding: .5rem; border-radius: 8px;
}
.nav-toggle span { width: 26px; height: 2px; background: var(--gold-light); border-radius: 2px; transition: .25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero (light, warm) ---------- */
.hero {
  position: relative; overflow: hidden; text-align: center; color: var(--ink);
  padding: clamp(2.8rem, 6vw, 4.8rem) 1.25rem clamp(3.6rem, 7vw, 5.2rem);
  background:
    radial-gradient(1000px 460px at 50% -6%, rgba(193,154,69,.20), transparent 62%),
    linear-gradient(180deg, #fdf7ea 0%, #f5ead3 100%);
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0; opacity: .7;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='104' viewBox='0 0 60 104'%3E%3Cg fill='none' stroke='%23c19a45' stroke-opacity='0.13' stroke-width='1'%3E%3Cpath d='M30 8 L52 21 L52 47 L30 60 L8 47 L8 21 Z'/%3E%3Cpath d='M30 8 L30 60 M8 21 L52 47 M52 21 L8 47'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 58px 100px;
  -webkit-mask-image: radial-gradient(120% 82% at 50% 22%, #000 38%, transparent 78%);
          mask-image: radial-gradient(120% 82% at 50% 22%, #000 38%, transparent 78%);
}
.hero-inner { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; }
.hero-emblem {
  width: clamp(112px, 18vw, 152px); height: auto; margin: 0 auto .3rem;
  filter: drop-shadow(0 10px 20px rgba(156,118,40,.30));
}
.hero-eyebrow {
  text-transform: uppercase; letter-spacing: .24em; font-size: .78rem; font-weight: 700;
  color: var(--gold-deep); margin: .2rem 0 .35rem;
}
.hero-eyebrow [lang="he"] { letter-spacing: normal; }
.hero h1 {
  font-family: var(--serif); font-weight: 900;
  font-size: clamp(2.9rem, 9vw, 5rem); line-height: 1.05; margin: .1rem 0 .1rem;
  color: var(--navy);
}
.hero-en-name {
  font-family: var(--serif); font-weight: 500; color: var(--gold-deep);
  font-size: clamp(1.2rem, 3.4vw, 1.7rem); letter-spacing: .04em; margin: 0 0 1rem;
}
.hero-tagline {
  font-size: clamp(1.02rem, 2.2vw, 1.2rem); color: var(--ink-soft);
  max-width: 40ch; margin: 0 auto 1.5rem;
}
.hero-announcement {
  display: flex; align-items: center; gap: .8rem; text-align: left;
  max-width: 560px; margin: 0 auto 1.7rem; padding: 1rem 1.15rem;
  background: rgba(255,255,255,.75); border: 1px solid rgba(193,154,69,.5);
  border-radius: var(--radius); font-size: .97rem; color: var(--ink);
  box-shadow: var(--shadow-soft); backdrop-filter: blur(4px);
}
.hero-announcement strong { color: var(--navy); }
.ann-badge {
  flex: 0 0 auto; align-self: flex-start; margin-top: .1rem;
  background: linear-gradient(180deg, var(--gold-light), var(--gold)); color: var(--navy-900);
  font-weight: 800; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  padding: .28rem .55rem; border-radius: 999px;
}
.hero-actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-block; text-decoration: none; font-weight: 700; letter-spacing: .02em;
  padding: .85rem 1.7rem; border-radius: 999px; transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn-gold {
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  color: var(--navy-900); box-shadow: 0 10px 24px -10px rgba(193,154,69,.7);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -12px rgba(193,154,69,.85); }
.btn-outline { border: 1.5px solid var(--navy); color: var(--navy); }
.btn-outline:hover { transform: translateY(-2px); background: rgba(22,48,79,.06); }

.hero-arches { position: absolute; left: 0; right: 0; bottom: -1px; z-index: 1; line-height: 0; }
.hero-arches svg { width: 100%; height: 46px; display: block; }
.hero-arches path { fill: var(--cream); }

/* ---------- Sections ---------- */
.section { padding: clamp(3rem, 7vw, 5.2rem) 1.25rem; }
.section-inner { max-width: var(--maxw); margin: 0 auto; }
.section-inner.narrow { max-width: 780px; }
.section-inner.center { text-align: center; }
.section-cream { background: var(--cream); }
.section-gold { background: linear-gradient(180deg, #fdf6e6 0%, #f6ecd2 100%); }
.section-navy { background: linear-gradient(180deg, var(--navy) 0%, var(--navy-900) 100%); color: #fff; }

.ornament {
  display: flex; align-items: center; justify-content: center; gap: .9rem;
  color: var(--gold); font-size: .9rem; margin: 0 0 .6rem; letter-spacing: .3em;
}
.ornament span { display: block; width: 52px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.ornament span:last-child { background: linear-gradient(90deg, var(--gold), transparent); }

h2 {
  font-family: var(--serif); font-weight: 700; text-align: center;
  font-size: clamp(1.9rem, 4.4vw, 2.7rem); line-height: 1.15; margin: 0 0 1.6rem;
  color: var(--navy);
}
h2 [lang="he"] { color: var(--gold-deep); }

.lead { text-align: center; font-size: 1.08rem; color: var(--ink-soft); max-width: 60ch; margin: 0 auto 1.6rem; }
.section p { color: var(--ink-soft); }

/* ---------- Vision / statement cards ---------- */
.statement-block { display: grid; gap: 1.1rem; }
.statement-card {
  background: var(--warm-white); border: 1px solid rgba(193,154,69,.28); border-left: 4px solid var(--gold);
  border-radius: var(--radius); padding: 1.5rem 1.7rem; box-shadow: var(--shadow-soft);
}
.statement-label {
  font-family: var(--sans); text-transform: uppercase; letter-spacing: .18em;
  font-size: .78rem; font-weight: 700; color: var(--gold-deep); margin: 0 0 .5rem;
}
.vision-statement {
  font-family: var(--serif); font-size: 1.4rem; line-height: 1.4; color: var(--navy);
  margin: 0; font-weight: 500; font-style: italic;
}
.mission-statement { margin: 0; font-size: 1.03rem; color: var(--ink-soft); }

/* ---------- This-week Luach card ---------- */
.this-week-card {
  max-width: 720px; margin: 0 auto 2.4rem; padding: 1.6rem 1.6rem 1.4rem;
  background:
    radial-gradient(500px 220px at 50% -30%, rgba(193,154,69,.12), transparent 70%),
    linear-gradient(180deg, var(--parchment), #fff);
  border: 1px solid rgba(193,154,69,.45); border-radius: var(--radius);
  box-shadow: var(--shadow); text-align: center; position: relative;
}
.this-week-card::before {
  content: "לוח"; position: absolute; top: .8rem; right: 1.1rem;
  font-family: var(--serif); color: rgba(193,154,69,.4); font-size: 1.1rem; letter-spacing: .1em;
}
.loading-text { color: var(--ink-soft); font-style: italic; margin: .4rem 0; }
.tw-parsha { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; color: var(--navy); margin: .1rem 0 .1rem; }
.tw-hebdate { color: var(--gold-deep); font-weight: 600; margin: 0 0 1.1rem; letter-spacing: .02em; }
.tw-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: .6rem; }
.tw-item {
  padding: .9rem .6rem; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.8); border: 1px solid rgba(193,154,69,.25);
}
.tw-label { text-transform: uppercase; letter-spacing: .12em; font-size: .68rem; font-weight: 700; color: var(--gold-deep); margin-bottom: .3rem; }
.tw-value { font-family: var(--serif); font-size: 1.28rem; font-weight: 700; color: var(--navy); }

/* ---------- Schedule ---------- */
.schedule-subhead {
  font-family: var(--serif); text-align: center; font-size: 1.5rem; color: var(--navy);
  margin: 1.4rem 0 .3rem;
}
.schedule-note { text-align: center; font-style: italic; color: var(--ink-soft); margin: 0 auto 1.4rem; max-width: 52ch; }
.table-wrap { max-width: 820px; margin: 0 auto; overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.schedule-table { width: 100%; border-collapse: collapse; background: #fff; min-width: 460px; }
.schedule-table thead th {
  background: linear-gradient(180deg, var(--navy-700), var(--navy)); color: var(--gold-light);
  font-family: var(--sans); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: .8rem;
  text-align: left; padding: .9rem 1.2rem;
}
.schedule-table td { padding: .95rem 1.2rem; border-top: 1px solid rgba(22,48,79,.09); color: var(--ink); vertical-align: top; }
.schedule-table tbody tr:nth-child(even) { background: var(--cream); }
.schedule-table td:first-child { font-weight: 700; color: var(--navy); }
.schedule-table td:last-child { color: var(--ink-soft); }

/* ---------- CTA cards ---------- */
.cta-card {
  background: var(--warm-white); border: 1px solid rgba(193,154,69,.3); border-radius: var(--radius);
  padding: 1.5rem 1.7rem; box-shadow: var(--shadow-soft); margin-top: 1rem;
}
.cta-card p { margin: .4rem 0; }
.cta-card-gold {
  background: linear-gradient(180deg, #fff, var(--cream));
  border: 1px solid rgba(193,154,69,.5); border-top: 4px solid var(--gold);
}
.cta-card-gold strong { color: var(--navy); }
.contact-line { font-size: 1rem; color: var(--ink) !important; }
.contact-line a { color: var(--gold-deep); font-weight: 700; text-decoration: none; border-bottom: 1px solid rgba(193,154,69,.4); }
.contact-line a:hover { color: var(--navy); }
.ci { opacity: .9; }
.edit-flag-inline { color: var(--ink-soft); }

/* ---------- Donate / placeholder ---------- */
.donate-copy { text-align: center; max-width: 52ch; margin: 0 auto 1.4rem; }
.placeholder-card {
  background: var(--warm-white); border: 1.5px dashed rgba(193,154,69,.65); border-radius: var(--radius);
  padding: 1.8rem 1.5rem; text-align: center; color: var(--ink-soft); max-width: 560px; margin: 0 auto;
}
.placeholder-card p { margin: .35rem 0; }
.placeholder-card strong { color: var(--navy); }
.placeholder-card a { color: var(--gold-deep); font-weight: 700; }
.placeholder-note { font-size: .92rem; }

/* ---------- Photo gallery ---------- */
.gallery {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: .6rem;
}
.gallery-item {
  position: relative; padding: 0; border: 0; cursor: pointer; overflow: hidden;
  border-radius: var(--radius); background: #ddd; aspect-ratio: 3 / 2;
  box-shadow: var(--shadow-soft); display: block;
  border: 1px solid rgba(193,154,69,.35);
}
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .5s ease;
}
.gallery-item:hover img, .gallery-item:focus-visible img { transform: scale(1.06); }
.gallery-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 1.4rem .9rem .7rem; text-align: left;
  font-family: var(--serif); font-size: .98rem; color: #fff;
  background: linear-gradient(180deg, transparent, rgba(15,33,56,.85));
  opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s;
}
.gallery-item:hover .gallery-cap, .gallery-item:focus-visible .gallery-cap { opacity: 1; transform: none; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 300;
  display: none; align-items: center; justify-content: center;
  background: rgba(11, 22, 40, .92); padding: 2rem 1rem;
}
.lightbox.open { display: flex; }
.lightbox-figure { margin: 0; max-width: 1100px; max-height: 100%; display: flex; flex-direction: column; align-items: center; }
.lightbox-img {
  max-width: 100%; max-height: 82vh; border-radius: 10px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.7); border: 1px solid rgba(226,195,122,.4);
}
.lightbox-cap {
  color: var(--gold-light); font-family: var(--serif); font-size: 1.1rem;
  margin-top: 1rem; text-align: center;
}
.lightbox-btn {
  position: absolute; background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(226,195,122,.4);
  cursor: pointer; border-radius: 999px; width: 52px; height: 52px; font-size: 1.8rem; line-height: 1;
  display: flex; align-items: center; justify-content: center; transition: background .2s;
}
.lightbox-btn:hover { background: rgba(226,195,122,.25); }
.lightbox-close { top: 1.2rem; right: 1.2rem; font-size: 2rem; }
.lightbox-prev { left: 1.2rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 1.2rem; top: 50%; transform: translateY(-50%); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 1.8rem; align-items: stretch; }
.contact-info h3 { font-family: var(--serif); color: var(--navy); font-size: 1.35rem; margin: 0 0 .4rem; }
.contact-info address { font-style: normal; color: var(--ink); line-height: 1.8; margin-bottom: 1.4rem; }
.contact-info p { margin: .3rem 0; }
.contact-info a { color: var(--gold-deep); font-weight: 700; text-decoration: none; }
.contact-info a:hover { color: var(--navy); }
.contact-map {
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  border: 1px solid rgba(193,154,69,.4); min-height: 320px;
}
.contact-map iframe { width: 100%; height: 100%; min-height: 320px; border: 0; display: block; }

/* ---------- Footer ---------- */
.site-footer {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-900) 100%);
  color: rgba(255,255,255,.72); text-align: center;
  padding: 2.8rem 1.25rem 2.3rem; border-top: 1px solid rgba(226,195,122,.28);
}
.footer-mark { width: 58px; height: 58px; margin: 0 auto .8rem; opacity: .95; }
.footer-he { font-family: var(--serif); font-size: 1.6rem; color: var(--gold-light); margin: 0 0 .2rem; }
.footer-en { margin: 0 0 .6rem; font-size: .95rem; letter-spacing: .02em; color: rgba(255,255,255,.8); }
.footer-fine { font-size: .82rem; color: rgba(255,255,255,.5); margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; align-items: stretch;
    background: var(--navy); border-bottom: 1px solid rgba(226,195,122,.3);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .site-nav.open { max-height: 420px; }
  .site-nav a { padding: .95rem 1.4rem; border-top: 1px solid rgba(255,255,255,.06); }
  .site-nav a::after { display: none; }
  .contact-grid { grid-template-columns: 1fr; }
  .tw-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .gallery-cap { opacity: 1; transform: none; font-size: .85rem; padding: 1.1rem .7rem .55rem; }
}
@media (max-width: 520px) {
  .gallery { grid-template-columns: 1fr; }
}
