:root {
  --blue: #1b3a8c;
  --blue-deep: #0f2557;
  --blue-soft: #e8eefb;
  --blue-mist: #f3f6fd;
  --gold: #c49a3a;
  --gold-deep: #9c7726;
  --gold-light: #ecd9a0;
  --gold-pale: #fbf5e4;
  --cream: #fffdf8;
  --ink: #1c2333;
  --muted: #5b6478;
  --line: #e3e7f0;
  --danger: #b42318;
  --ok: #1d7a46;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 37, 87, 0.06), 0 6px 24px rgba(15, 37, 87, 0.07);
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --caps: Cinzel, Georgia, serif;
  --hebrew: 'Frank Ruhl Libre', 'David', serif;
  --sans: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 120px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--cream);
  font-variant-numeric: lining-nums;
}
img, video, iframe { max-width: 100%; display: block; }
a { color: var(--blue); }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
[lang='he'] { font-family: var(--hebrew); }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 0 0 var(--gold-light);
}
.header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: 12px; padding-top: 10px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--blue-deep); min-width: 0; flex: 1; }
.brand-logo { width: 46px; height: 46px; flex: none; }
.brand-logo svg, .footer-logo svg, .hero-logo svg { width: 100%; height: 100%; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 1.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-hebrew { color: var(--gold-deep); font-size: 0.95rem; font-weight: 500; align-self: flex-start; }
.lang-toggle {
  flex: none;
  border: 1.5px solid var(--gold);
  background: var(--gold-pale);
  color: var(--blue-deep);
  font-weight: 700;
  letter-spacing: 0.06em;
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
}
.lang-toggle:hover { background: var(--gold-light); }
.site-nav { order: 3; width: 100%; display: flex; gap: 4px; overflow-x: auto; padding: 6px 0 8px; margin: 0 -8px; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
  flex: none;
  text-decoration: none;
  color: var(--blue);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 6px 12px;
  border-radius: 999px;
}
.site-nav a:hover { background: var(--blue-soft); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 400px at 50% -10%, #ffffff 0%, transparent 70%),
    linear-gradient(180deg, #eef3fd 0%, var(--cream) 100%);
  border-bottom: 1px solid var(--line);
}
.hero::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--blue-deep), var(--blue) 40%, var(--gold) 50%, var(--blue) 60%, var(--blue-deep));
  opacity: 0.9;
}
.hero-inner { display: grid; gap: 28px; padding-top: 36px; padding-bottom: 44px; align-items: center; }
.hero-id { text-align: center; }
.hero-logo { display: block; width: 148px; height: 148px; margin: 0 auto 14px; filter: drop-shadow(0 6px 18px rgba(15, 37, 87, 0.18)); }
.hero h1 { font-family: var(--serif); font-weight: 700; font-size: 2.35rem; line-height: 1.05; color: var(--blue-deep); margin: 0; }
.hero-hebrew { font-size: 1.5rem; color: var(--gold-deep); margin: 6px 0 4px; }
.hero-tag { font-family: var(--caps); font-size: 0.78rem; letter-spacing: 0.18em; color: var(--blue); text-transform: uppercase; margin: 8px 0 4px; }
.hero-address { color: var(--muted); margin: 0; }
.hero-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

.shabbat-card {
  background: #fff;
  border: 1px solid var(--gold-light);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.shabbat-card-head {
  background: linear-gradient(135deg, var(--blue-deep), var(--blue));
  color: #fff;
  text-align: center;
  padding: 16px 18px 14px;
  border-bottom: 3px solid var(--gold);
}
.shabbat-card-head .eyebrow { color: var(--gold-light); }
.shabbat-card-head h2 { font-family: var(--serif); font-size: 1.9rem; margin: 2px 0 0; line-height: 1.1; }
.shabbat-card-head p { margin: 4px 0 0; opacity: 0.9; }
.key-times { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.key-time { text-align: center; padding: 16px 10px; border-right: 1px solid var(--line); }
.key-time:last-child { border-right: 0; }
.key-time .t { font-family: var(--serif); font-weight: 700; font-size: 2rem; color: var(--blue-deep); line-height: 1; }
.key-time .l { font-size: 0.88rem; color: var(--muted); margin-top: 6px; }
.shabbat-card .highlight { margin: 0 14px 14px; }
.shabbat-card-empty { padding: 22px; text-align: center; color: var(--muted); }

.eyebrow { font-family: var(--caps); font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-deep); font-weight: 700; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 11px 20px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  background: var(--blue);
  color: #fff;
  transition: background 0.15s, transform 0.05s;
  min-height: 44px;
}
.btn:hover { background: var(--blue-deep); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-gold { background: linear-gradient(180deg, #d6b25c, var(--gold)); color: var(--blue-deep); }
.btn-gold:hover { background: var(--gold); }
.btn-ghost { background: transparent; color: var(--blue); border: 1.5px solid var(--blue); }
.btn-ghost:hover { background: var(--blue-soft); }
.btn-danger { background: transparent; color: var(--danger); border: 1.5px solid #f0c4bf; }
.btn-danger:hover { background: #fdeceb; }
.btn-sm { padding: 6px 14px; min-height: 36px; font-size: 0.92rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- sections ---------- */
.section { padding: 52px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-alt { background: var(--blue-mist); }
.section-head { text-align: center; margin-bottom: 28px; }
.section-head h2 { font-family: var(--serif); font-weight: 700; font-size: 2.2rem; color: var(--blue-deep); margin: 4px 0 0; line-height: 1.1; }
.section-head p { color: var(--muted); margin: 6px 0 0; }
.ornament { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 10px; color: var(--gold); }
.ornament::before, .ornament::after { content: ''; height: 1px; width: 56px; background: linear-gradient(90deg, transparent, var(--gold)); }
.ornament::after { transform: scaleX(-1); }
.ornament span { width: 7px; height: 7px; background: var(--gold); transform: rotate(45deg); }
.empty { text-align: center; color: var(--muted); padding: 28px 16px; background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); }

/* ---------- schedule ---------- */
.schedule-title { text-align: center; margin-bottom: 18px; }
.schedule-title h3 { font-family: var(--serif); font-size: 1.85rem; color: var(--blue-deep); margin: 0; line-height: 1.15; }
.schedule-title p { margin: 4px 0 0; color: var(--gold-deep); font-weight: 600; }
.highlight {
  text-align: center;
  background: linear-gradient(180deg, #fdf6df, var(--gold-pale));
  border: 1px solid var(--gold-light);
  color: var(--blue-deep);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.3rem;
  padding: 10px 16px;
  border-radius: 12px;
  margin: 0 auto 22px;
  max-width: 640px;
  white-space: pre-line;
}
.schedule-groups { display: grid; gap: 22px; }
.schedule-group h4 {
  font-family: var(--caps);
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.schedule-group h4::after { content: ''; flex: 1; height: 1px; background: var(--gold-light); }
.cards { display: grid; gap: 14px; }
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.sched-card-head {
  background: var(--blue);
  color: #fff;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.2rem;
  padding: 8px 16px;
  border-bottom: 2px solid var(--gold);
}
.sched-rows { list-style: none; margin: 0; padding: 6px 16px 10px; }
.sched-row { display: flex; align-items: baseline; gap: 8px; padding: 7px 0; border-bottom: 1px dotted #d5dbe8; }
.sched-row:last-child { border-bottom: 0; }
.sched-row .label { flex: 1; min-width: 0; }
.sched-row .label small { display: block; color: var(--muted); font-size: 0.88rem; }
.sched-row .time { font-weight: 700; color: var(--blue-deep); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 1.05rem; }
.sched-note { padding: 0 16px 14px; color: var(--ink); white-space: pre-line; }
.sched-note:first-child { padding-top: 12px; }
.schedule-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 24px; }
.viewing-past {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
  background: var(--gold-pale); border: 1px solid var(--gold-light); border-radius: 12px; padding: 10px 14px; margin-bottom: 18px;
}
.flyer-only { text-align: center; }
.flyer-only img { margin: 0 auto; border-radius: 12px; box-shadow: var(--shadow); max-height: 80vh; width: auto; }
.past { margin-top: 30px; }
.past summary { cursor: pointer; font-weight: 700; color: var(--blue); text-align: center; list-style: none; }
.past summary::-webkit-details-marker { display: none; }
.past summary::after { content: ' ▾'; }
.past[open] summary::after { content: ' ▴'; }
.past-list { list-style: none; padding: 0; margin: 14px auto 0; max-width: 640px; display: grid; gap: 8px; }
.past-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.past-list .meta { min-width: 0; }
.past-list .meta strong { display: block; }
.past-list .meta span { color: var(--muted); font-size: 0.92rem; }

/* ---------- announcements ---------- */
.ann-list { display: grid; gap: 14px; max-width: 760px; margin: 0 auto; }
.ann { padding: 18px 20px; border-left: 4px solid var(--gold); }
.ann time { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.ann h3 { font-family: var(--serif); font-size: 1.45rem; color: var(--blue-deep); margin: 2px 0 6px; line-height: 1.2; }
.ann .body { white-space: pre-line; overflow-wrap: anywhere; }
.more-row { text-align: center; margin-top: 18px; }

/* ---------- videos ---------- */
.video-grid { display: grid; gap: 18px; }
.video-card .player { position: relative; aspect-ratio: 16 / 9; background: var(--blue-deep); }
.video-card .player video, .video-card .player iframe, .video-card .player img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.video-card .player video { object-fit: contain; background: #000; }
.yt-play { position: absolute; inset: 0; border: 0; padding: 0; background: none; cursor: pointer; width: 100%; }
.yt-play::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 68px; height: 48px; transform: translate(-50%, -50%);
  border-radius: 14px; background: rgba(15, 37, 87, 0.85) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ecd9a0' d='M8 5v14l11-7z'/%3E%3C/svg%3E") center / 30px no-repeat;
  box-shadow: 0 0 0 2px var(--gold);
}
.yt-play:hover::after { background-color: var(--blue); }
.video-info { padding: 14px 16px 16px; }
.video-info h3 { font-family: var(--serif); font-size: 1.3rem; color: var(--blue-deep); margin: 0; line-height: 1.2; }
.video-info .meta { color: var(--gold-deep); font-weight: 600; font-size: 0.92rem; margin-top: 2px; }
.video-info p { margin: 8px 0 0; color: var(--muted); white-space: pre-line; }

/* ---------- visit ---------- */
.visit-grid { display: grid; gap: 18px; align-items: stretch; }
.visit-card { padding: 22px; }
.visit-card h3 { font-family: var(--serif); font-size: 1.5rem; color: var(--blue-deep); margin: 0 0 6px; }
.visit-card address { font-style: normal; font-size: 1.1rem; margin-bottom: 16px; }
.map { min-height: 280px; border: 0; width: 100%; height: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- footer ---------- */
.site-footer { background: var(--blue-deep); color: #dfe6f7; padding-top: 34px; border-top: 4px solid var(--gold); }
.footer-row { display: flex; flex-wrap: wrap; gap: 22px; justify-content: space-between; align-items: center; }
.footer-brand { display: flex; gap: 14px; align-items: center; }
.footer-logo { width: 64px; height: 64px; flex: none; }
.footer-name { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; color: #fff; }
.footer-hebrew { color: var(--gold-light); text-align: left; }
.footer-tag { font-size: 0.9rem; opacity: 0.85; }
.footer-address { font-style: normal; line-height: 1.6; }
.footer-bottom { display: flex; justify-content: space-between; gap: 12px; padding-top: 18px; padding-bottom: 22px; margin-top: 24px; border-top: 1px solid rgba(255, 255, 255, 0.12); font-size: 0.88rem; opacity: 0.85; }
.admin-link { color: var(--gold-light); }

/* ---------- admin ---------- */
.admin { padding: 30px 0 60px; }
.admin h1 { font-family: var(--serif); color: var(--blue-deep); font-size: 2rem; margin: 0; }
.admin-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.login-card { max-width: 380px; margin: 30px auto; padding: 26px; text-align: center; }
.login-card .hero-logo { width: 96px; height: 96px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; border-bottom: 2px solid var(--line); margin-bottom: 20px; }
.tabs button {
  flex: none; border: 0; background: none; padding: 10px 14px; font-weight: 700; color: var(--muted); cursor: pointer;
  border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.tabs button[aria-selected='true'] { color: var(--blue); border-color: var(--gold); }
.panel { padding: 18px; margin-bottom: 18px; }
.panel h2 { font-family: var(--serif); color: var(--blue-deep); font-size: 1.5rem; margin: 0 0 12px; }
.panel h3 { margin: 18px 0 8px; font-size: 1rem; color: var(--blue-deep); }
.field { display: grid; gap: 4px; margin-bottom: 12px; }
.field > span { font-weight: 600; font-size: 0.92rem; color: var(--muted); }
input[type='text'], input[type='password'], input[type='date'], input[type='url'], textarea, select {
  width: 100%; border: 1.5px solid #cfd6e6; border-radius: 10px; padding: 10px 12px; background: #fff; min-height: 44px;
}
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(196, 154, 58, 0.45); outline-offset: 1px; border-color: var(--gold); }
textarea { min-height: 110px; resize: vertical; }
input[type='file'] { width: 100%; padding: 10px; border: 1.5px dashed #cfd6e6; border-radius: 10px; background: var(--blue-mist); }
.radio-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.radio-row label { display: flex; gap: 6px; align-items: center; font-weight: 600; }
.notice { border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; font-size: 0.95rem; }
.notice-warn { background: #fff7e6; border: 1px solid #f3d48c; color: #6b4a00; }
.notice-error { background: #fdeceb; border: 1px solid #f0c4bf; color: var(--danger); }
.notice-ok { background: #e9f7ef; border: 1px solid #b6e2c6; color: var(--ok); }
.notice ul { margin: 6px 0 0; padding-left: 20px; }
.status { font-size: 0.95rem; color: var(--muted); }
.progress { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 8px 0; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--blue), var(--gold)); width: 0; transition: width 0.2s; }
.admin-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.admin-list li { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; }
.admin-list .meta { min-width: 0; flex: 1; }
.admin-list .meta strong { display: block; overflow-wrap: anywhere; }
.admin-list .meta span { color: var(--muted); font-size: 0.9rem; }
.badge { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; vertical-align: middle; margin-left: 6px; }
.badge-draft { background: #fff3d6; color: #7a5600; }
.badge-live { background: #e3f4ea; color: var(--ok); }
.two-lang { display: grid; gap: 12px; }
.lang-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--blue-mist); }
.lang-box > strong { display: block; margin-bottom: 8px; color: var(--blue); }

.editor { display: grid; gap: 18px; }
.editor-flyer img { border-radius: 10px; border: 1px solid var(--line); width: 100%; }
.editor-flyer details summary { cursor: pointer; font-weight: 700; color: var(--blue); margin-bottom: 8px; }
.ed-section { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; margin-bottom: 12px; }
.ed-section-head { display: grid; gap: 8px; grid-template-columns: 1fr; margin-bottom: 8px; }
.ed-item { display: grid; gap: 6px; grid-template-columns: 96px 1fr auto; align-items: start; padding: 8px 0; border-top: 1px dotted var(--line); }
.ed-item .labels { display: grid; gap: 6px; }
.ed-item input { min-height: 38px; padding: 7px 10px; }
.icon-btn { border: 0; background: none; color: var(--danger); font-size: 1.3rem; line-height: 1; padding: 8px; cursor: pointer; border-radius: 8px; }
.icon-btn:hover { background: #fdeceb; }
.link-btn { border: 0; background: none; padding: 2px 0; color: var(--blue); font-size: 0.85rem; font-weight: 600; cursor: pointer; text-align: left; grid-column: 1 / -1; }
.link-btn:hover { text-decoration: underline; }
.mini {font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.sticky-actions { position: sticky; bottom: 0; background: rgba(255, 253, 248, 0.97); border-top: 1px solid var(--line); padding: 12px 0; margin-top: 8px; z-index: 5; }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 100;
  background: var(--blue-deep); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow);
  border-left: 4px solid var(--gold); max-width: calc(100% - 32px);
}

/* ---------- larger screens ---------- */
@media (min-width: 720px) {
  .hero h1 { font-size: 3rem; }
  .hero-logo { width: 176px; height: 176px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .video-grid { grid-template-columns: repeat(2, 1fr); }
  .two-lang { grid-template-columns: 1fr 1fr; }
  .ed-section-head { grid-template-columns: 160px 1fr 1fr; }
  .ed-item { grid-template-columns: 110px 1fr auto; }
  .ed-item .labels { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 960px) {
  html { scroll-padding-top: 80px; }
  .header-row { flex-wrap: nowrap; padding-bottom: 10px; }
  .site-nav { order: 0; width: auto; margin: 0; padding: 0; }
  .hero-inner { grid-template-columns: 1fr 1fr; padding-top: 56px; padding-bottom: 64px; }
  .hero-id { text-align: left; }
  .hero-logo { margin-left: 0; }
  .hero-actions { justify-content: flex-start; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .video-grid { grid-template-columns: repeat(3, 1fr); }
  .visit-grid { grid-template-columns: 1fr 1.4fr; }
  .editor { grid-template-columns: 340px 1fr; align-items: start; }
  .editor-flyer { position: sticky; top: 90px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
