/* =========================================================
   בית חב"ד נהריה – one-page site
   Palette tokens (change here to fine-tune to the logo)
   ========================================================= */
:root {
  --navy: #690020;
  --navy-deep: #42000f;
  --royal: #9a1f3d;
  --gold: #c9972c;
  --gold-light: #e8c873;
  --gold-wash: #f6ecd2;
  --paper: #ffffff;
  --mist: #f7f7f7;
  --ink: #2a1a1e;
  --muted: #6b5358;
  --line: #ecd9dd;

  --font-display: "Fredoka", "Assistant", Arial, sans-serif;
  --font-body: "Fredoka", "Segoe UI", Arial, sans-serif;

  --radius-s: 6px;
  --radius-m: 14px;
  --wrap: 1180px;
  --zoom: 1;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; font-size: calc(100% * var(--zoom)); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }

strong, b { font-weight: 600; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--royal); }
a:hover { color: var(--navy); }
button { font: inherit; cursor: pointer; }

.wrap { width: min(var(--wrap), 100% - 2.5rem); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; top: -100px; right: 1rem; background: var(--gold); color: var(--navy-deep); padding: .5rem 1rem; z-index: 999; border-radius: var(--radius-s); }
.skip-link:focus { top: .5rem; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.97);
  border-bottom: 3px solid var(--gold);
  backdrop-filter: blur(6px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-block: .6rem; }
.logo img { height: 64px; width: auto; }

.main-nav > ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: .25rem; }
.main-nav a {
  display: block; padding: .5rem .8rem; text-decoration: none;
  color: var(--navy); font-weight: 500; border-radius: var(--radius-s);
}
.main-nav a:hover { background: var(--mist); }


.nav-toggle { display: none; background: none; border: 0; padding: .5rem; }
.nav-toggle .bar { display: block; width: 26px; height: 3px; background: var(--navy); margin: 5px 0; border-radius: 2px; }

/* ---------- Hero ---------- */
.hero { position: relative; height: 720px; display: grid; overflow: hidden; background: var(--navy); }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(66,0,15,.88) 0%, rgba(66,0,15,.35) 45%, rgba(66,0,15,0) 75%);
}
.hero-text { position: relative; z-index: 1; align-self: end; width: min(var(--wrap), 100% - 2.5rem); margin: 0 auto; padding-bottom: 2.5rem; color: #fff; }
.hero-text h1 {
  font-family: var(--font-display); font-weight: 600; margin: 0;
  font-size: clamp(2.6rem, 7vw, 5rem); line-height: 1; letter-spacing: -.01em;
}
.hero-text p {
  margin: .8rem 0 0; font-family: var(--font-display); font-size: clamp(1.25rem, 2.6vw, 1.9rem); color: var(--gold-light);
  display: inline-block; border-top: 2px solid var(--gold); padding-top: .4rem;
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section-title {
  font-family: var(--font-display); font-weight: 600; color: var(--navy);
  font-size: clamp(1.9rem, 3.6vw, 2.6rem); line-height: 1.15; margin: 0 0 1.75rem;
  padding-inline-start: .9rem; border-inline-start: 5px solid var(--gold);
}
.section-title.light { color: #fff; }
.lead { font-size: 1.2rem; margin: .4rem 0; }

/* Institutions */
.institutions { background: var(--mist); }
.inst-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; }
.inst-card {
  width: 100%; height: 100%; text-align: start; padding: 0; border: 0; background: #fff;
  border-radius: var(--radius-m); overflow: hidden; display: flex; flex-direction: column;
  border-bottom: 4px solid transparent; transition: border-color .2s, transform .2s;
}
.inst-card:hover, .inst-card:focus-visible { border-bottom-color: var(--gold); transform: translateY(-3px); }
.inst-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--line); }
.inst-name { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; color: var(--navy); padding: .8rem 1rem 0; }
.inst-more { color: var(--royal); font-weight: 500; padding: .1rem 1rem 1rem; font-size: .95rem; margin-top: auto; }

/* Synagogue */
.syn-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.syn-photo { margin: 0 0 1.25rem; border-radius: var(--radius-m); overflow: hidden; }
.syn-photo img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.rabbi { margin-top: 1rem; padding: .8rem 1rem; background: var(--gold-wash); border-radius: var(--radius-s); font-weight: 500; }

/* The memorable piece: a shul "zmanim" board */
.zmanim {
  background: var(--navy);
  background-image: radial-gradient(circle at 100% 0%, rgba(201,151,44,.18), transparent 55%);
  color: #fff; border-radius: var(--radius-m);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 2px solid var(--gold);
  box-shadow: inset 0 0 0 6px var(--navy), inset 0 0 0 7px rgba(232,200,115,.45);
}
.zmanim-title {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(1.8rem, 3.4vw, 2.4rem);
  color: var(--gold-light); text-align: center; margin: 0 0 1rem;
}
.zmanim-sub {
  font-family: var(--font-display); font-size: 1.3rem; color: var(--gold-light); margin: 1.5rem 0 .4rem;
  display: flex; align-items: center; gap: .8rem;
}
.zmanim-sub::after { content: ""; flex: 1; height: 1px; background: rgba(232,200,115,.45); }
.zmanim-list { margin: 0; }
.zmanim-list > div {
  display: grid; grid-template-columns: 9.5rem 1fr; gap: 1rem; padding: .6rem 0;
  border-bottom: 1px dashed rgba(255,255,255,.18);
}
.zmanim-list > div:last-child { border-bottom: 0; }
.zmanim-list dt { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; }
.zmanim-list dd { margin: 0; color: #e7ecf7; }
.zmanim a { color: var(--gold-light); }

/* Judaica */
.judaica { background: var(--paper); border-top: 1px solid var(--line); }
.judaica-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.meitav { width:100%; max-width: 300px; margin: 0 0 1.25rem; }
.hours-card { background: var(--mist); border-radius: var(--radius-m); padding: 1.75rem; border-top: 4px solid var(--gold); }
.hours-card h3 { font-family: var(--font-display); color: var(--navy); margin: 0 0 .6rem; font-size: 1.4rem; }
.hours { list-style: none; margin: 0 0 1rem; padding: 0; }
.hours li { padding: .45rem 0; border-bottom: 1px solid var(--line); font-weight: 500; }
.hours-card p { margin: .35rem 0; }

/* Contact */
.contact { background: var(--navy); color: #fff; }
.contact-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; }
.contact .info-block { background: rgba(255,255,255,.06); border: 1px solid rgba(232,200,115,.35); border-radius: var(--radius-m); padding: 1.5rem; margin: 0; }
.info-head { font-size: 1.25rem; color: var(--gold-light); margin-bottom: .5rem !important; }

.contact a { color: var(--gold-light); }
.info-block { margin-bottom: 1.25rem; }
.info-block p { margin: .2rem 0; }
.motto { font-family: var(--font-display); font-size: 1.7rem; color: var(--gold-light); margin: 1.75rem 0 0; }


.btn-gold, .btn-ghost {
  border-radius: 999px; padding: .7rem 2rem; font-weight: 600; border: 2px solid var(--gold);
}
.btn-gold { background: var(--gold); color: var(--navy-deep); }
.btn-gold:hover { background: var(--gold-light); }
.btn-ghost { background: transparent; color: #fff; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-deep); color: #cfd7ea; padding-block: 2.5rem 6rem; text-align: center; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: .9rem; }
.footer-logo { height: 70px; width: auto; background: #fff; padding: .4rem .8rem; border-radius: var(--radius-s); }
.footer-motto { font-family: var(--font-display); font-size: 1.4rem; color: var(--gold-light); margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.5rem; align-items: center; }
.footer-links a { color: #fff; text-decoration: none; padding: .2rem 0; border-bottom: 1px solid transparent; }
.footer-links a:hover { border-bottom-color: var(--gold); }
.fb-icon { display: inline-flex; color: var(--gold-light) !important; }
.copy { margin: 0; font-size: .92rem; }
.copy a { color: inherit; text-decoration: none; font-weight: 400; }
.copy a:hover { text-decoration: underline; }

/* ---------- Accessibility widget ---------- */
.a11y { position: fixed; bottom: 1.25rem; left: 1.25rem; z-index: 80; }
.a11y-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 2px solid #fff; padding: 8px;
  background: var(--navy); box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
.a11y-btn img { width: 100%; height: 100%; object-fit: contain; filter: brightness(0) invert(1); }
.a11y-panel {
  position: absolute; bottom: 56px; left: 0; width: 230px; background: #fff; color: var(--ink);
  border-radius: var(--radius-m); box-shadow: 0 14px 40px rgba(0,0,0,.25); padding: .8rem; border-top: 4px solid var(--gold);
}
.a11y-panel[hidden] { display: none; }
.a11y-title { margin: 0 0 .5rem; font-weight: 600; color: var(--navy); font-family: var(--font-display); font-size: 1.15rem; }
.a11y-panel button {
  display: block; width: 100%; text-align: start; padding: .5rem .7rem; margin-bottom: .25rem;
  background: var(--mist); border: 1px solid transparent; border-radius: var(--radius-s); color: var(--navy); font-weight: 500;
}
.a11y-panel button:hover { border-color: var(--royal); }
.a11y-panel button[aria-pressed="true"] { background: var(--gold-wash); border-color: var(--gold); }

/* ---------- Cookie bar ---------- */
.cookie {
  position: fixed; bottom: 1rem; right: 1rem; left: 6rem; max-width: 620px; margin-inline-start: auto; z-index: 70;
  background: var(--navy-deep); color: #fff; padding: 1rem 1.25rem; border-radius: var(--radius-m);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  border: 1px solid rgba(232,200,115,.4);
}
.cookie[hidden] { display: none; }
.cookie p { margin: 0; }
.cookie-actions { display: flex; gap: .5rem; }
.cookie .btn-gold, .cookie .btn-ghost { padding: .45rem 1.3rem; }

/* ---------- Modal ---------- */
.modal { border: 0; padding: 0; background: transparent; max-width: min(820px, 100% - 1.5rem); width: 100%; max-height: 90vh; }
.modal::backdrop { background: rgba(66,0,15,.72); }
.modal-box {
  background: #fff; border-radius: var(--radius-m); border-top: 5px solid var(--gold);
  max-height: 90vh; overflow-y: auto; padding: clamp(1.5rem, 4vw, 2.5rem); position: relative;
}
.modal[open] .modal-box { animation: pop .22s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.modal-close {
  position: sticky; top: 0; float: left; margin: -.5rem -.5rem 0 0;
  width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--mist); color: var(--navy);
  font-size: 1.7rem; line-height: 1; z-index: 2;
}
.modal-close:hover { background: var(--gold-wash); }
.modal-body h2 { font-family: var(--font-display); color: var(--navy); font-size: clamp(1.7rem, 3.4vw, 2.3rem); margin: 0 0 1rem; line-height: 1.2; }
.modal-body h3 { font-family: var(--font-display); color: var(--navy); font-size: 1.2rem; margin: 1.4rem 0 .4rem; }
.modal-body p { margin: 0 0 .7rem; }
.modal-body ol, .modal-body ul { padding-inline-start: 1.5rem; }
.modal-body li { margin-bottom: .35rem; }
.modal-body ol.zero-pad { list-style: decimal-leading-zero; padding-inline-start: 2.2rem; }
.modal-img { width: 100%; max-height: 360px; object-fit: cover; border-radius: var(--radius-s); margin-bottom: 1.25rem; }
.modal-img.full { max-height: none; object-fit: contain; }
.sub-em { font-style: normal; font-weight: 600; color: var(--royal); }
.modal-body[dir="ltr"] { text-align: left; }
.modal-body[dir="ltr"] .modal-close { float: right; }

.inst-nav { display: flex; justify-content: space-between; gap: .5rem; margin-top: 1.75rem; padding-top: 1rem; border-top: 1px solid var(--line); flex-wrap: wrap; }
.inst-nav button { border: 1.5px solid var(--navy); background: #fff; color: var(--navy); border-radius: 999px; padding: .45rem 1.2rem; font-weight: 500; }
.inst-nav button:hover { background: var(--navy); color: #fff; }
.inst-nav .spacer { flex: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero { height: 560px; }
  .nav-toggle { display: block; }
  .main-nav {
    position: absolute; top: 100%; right: 0; left: 0; background: #fff; border-bottom: 3px solid var(--gold);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .main-nav.open { max-height: 80vh; overflow-y: auto; }
  .main-nav > ul { flex-direction: column; align-items: stretch; padding: .6rem 1.25rem 1rem; }
  .main-nav a { padding: .7rem .5rem; }
  .syn-grid, .judaica-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .hero { height: 440px; }
  .logo img { height: 50px; }
  .zmanim-list > div { grid-template-columns: 1fr; gap: .1rem; }
  .cookie { left: 1rem; bottom: 5.5rem; }
}

/* ---------- Accessibility modes ---------- */
body.hc { --navy: #000; --navy-deep: #000; --royal: #ffff00; --gold: #ffff00; --gold-light: #ffff00; --gold-wash: #000; --paper: #000; --mist: #000; --ink: #fff; --muted: #fff; --line: #fff; }
body.hc, body.hc .site-header, body.hc .inst-card, body.hc .contact .info-block, body.hc .modal-box, body.hc .main-nav, body.hc .a11y-panel, body.hc .hours-card { background: #000 !important; color: #fff !important; }
body.hc a, body.hc .inst-name, body.hc .section-title, body.hc h2, body.hc h3, body.hc .main-nav a, body.hc .field span, body.hc .a11y-panel button, body.hc .modal-close, body.hc .inst-nav button { color: #ffff00 !important; }
body.hc .btn-gold { background: #ffff00 !important; color: #000 !important; }
body.hc .field input, body.hc .field textarea { background: #000; color: #fff; border-color: #fff; }
body.hc .hero::after { background: rgba(0,0,0,.65); }
body.hc .inst-card, body.hc .hours-card, body.hc .zmanim, body.hc .a11y-panel button, body.hc .inst-nav button { border: 2px solid #fff; }
body.hc .nav-toggle .bar { background: #ffff00; }
body.hc .footer-logo { background: #fff; }

body.kbd *:focus { outline: 4px solid #ff6a00 !important; outline-offset: 3px !important; box-shadow: 0 0 0 7px rgba(255,106,0,.25) !important; }
body.kbd a, body.kbd button { text-decoration: underline; }
