/* Alekscreen display — themeable, tuned for a 1080p TV.
   Sizes use vh/vw so it scales to any screen; --fs is the admin font-scale. */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root { --fs: 1; }

/* ---------- themes ---------- */
body {
  /* midnight (default): deep navy + gold */
  --bg-0: #0b1020;
  --bg-1: #101832;
  --glow-a: #1c2952;
  --glow-b: #14204a;
  --card: rgba(23, 33, 64, 0.72);
  --card-edge: rgba(212, 175, 55, 0.28);
  --card-top: rgba(232, 207, 133, 0.18);
  --gold: #d4af37;
  --gold-soft: #e8cf85;
  --ink: #f2ecdc;
  --ink-dim: #a9b0c7;
  --accent: #7fa8ff;
  --zebra: rgba(255, 255, 255, 0.025);
  --next-bg: rgba(212, 175, 55, 0.14);
  --shadow: 0 1vh 3vh rgba(0, 0, 0, 0.35);
  --banner-bg: linear-gradient(90deg, rgba(212,175,55,0.22), rgba(212,175,55,0.08));
}

body[data-theme="royal"] {
  --bg-0: #0c1533;
  --bg-1: #14245c;
  --glow-a: #23409c;
  --glow-b: #1a2f75;
  --card: rgba(26, 42, 92, 0.72);
  --card-edge: rgba(158, 185, 255, 0.30);
  --card-top: rgba(198, 216, 255, 0.20);
  --gold: #e3c56b;
  --gold-soft: #f0dda2;
  --ink: #f4f2ea;
  --ink-dim: #aebadb;
  --accent: #9db9ff;
  --zebra: rgba(255, 255, 255, 0.03);
  --next-bg: rgba(227, 197, 107, 0.16);
  --banner-bg: linear-gradient(90deg, rgba(157,185,255,0.22), rgba(157,185,255,0.07));
}

body[data-theme="burgundy"] {
  --bg-0: #180810;
  --bg-1: #2a0f1c;
  --glow-a: #571d33;
  --glow-b: #3d1425;
  --card: rgba(62, 22, 38, 0.72);
  --card-edge: rgba(217, 176, 76, 0.30);
  --card-top: rgba(240, 216, 150, 0.16);
  --gold: #d9b04c;
  --gold-soft: #ecd394;
  --ink: #f6ecdd;
  --ink-dim: #c2a4ab;
  --accent: #e8909f;
  --zebra: rgba(255, 255, 255, 0.025);
  --next-bg: rgba(217, 176, 76, 0.15);
  --banner-bg: linear-gradient(90deg, rgba(217,176,76,0.24), rgba(217,176,76,0.08));
}

body[data-theme="ivory"] {
  --bg-0: #efe8d6;
  --bg-1: #f7f2e5;
  --glow-a: #fffdf4;
  --glow-b: #ece1c6;
  --card: rgba(255, 253, 247, 0.85);
  --card-edge: rgba(150, 122, 40, 0.35);
  --card-top: rgba(255, 255, 255, 0.9);
  --gold: #96741c;
  --gold-soft: #7d6015;
  --ink: #232a45;
  --ink-dim: #6d7186;
  --accent: #35508f;
  --zebra: rgba(35, 42, 69, 0.035);
  --next-bg: rgba(150, 116, 28, 0.12);
  --shadow: 0 0.8vh 2.4vh rgba(80, 60, 20, 0.14);
  --banner-bg: linear-gradient(90deg, rgba(150,116,28,0.16), rgba(150,116,28,0.05));
}

body[data-theme="luach"] {
  /* classic printed luach: parchment, gold frames, black serif Hebrew */
  --bg-0: #ece5d3;
  --bg-1: #f8f4ea;
  --glow-a: #fffdf6;
  --glow-b: #e3dbc5;
  --card: #fdfbf4;
  --card-edge: rgba(163, 130, 42, 0.6);
  --card-top: rgba(255, 255, 255, 0.85);
  --gold: #a3822a;
  --gold-soft: #8a6d1d;
  --ink: #17140f;
  --ink-dim: #6f6a5c;
  --accent: #17140f;
  --zebra: rgba(90, 70, 20, 0.045);
  --next-bg: rgba(163, 130, 42, 0.15);
  --shadow: 0 0.6vh 2vh rgba(100, 80, 30, 0.13);
  --banner-bg: linear-gradient(90deg, rgba(163,130,42,0.16), rgba(163,130,42,0.05));
}

:root {
  --serif: "Cormorant Garamond", "Frank Ruhl Libre", Georgia, serif;
  --hebrew: "Frank Ruhl Libre", "Heebo", "David Libre", serif;
  --sans: "Heebo", "Segoe UI", Arial, sans-serif;
}

html, body { height: 100%; overflow: hidden; cursor: none; }

body {
  background:
    radial-gradient(120vw 80vh at 50% -20%, var(--glow-a) 0%, transparent 60%),
    radial-gradient(80vw 60vh at 100% 110%, var(--glow-b) 0%, transparent 55%),
    linear-gradient(170deg, var(--bg-1), var(--bg-0) 70%);
  color: var(--ink);
  font-family: var(--sans);
}

#screen {
  height: 100vh;
  display: grid;
  grid-template-rows: 17.5vh 1fr auto;
  gap: 1.2vh;
  padding: 1.2vh 1.2vw 0;
}
#screen.no-ticker { grid-template-rows: 17.5vh 1fr; }

/* ---------- header ---------- */
#header {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  /* bottom padding keeps the gold hairline clear of the letterhead address */
  padding: 0 1.6vw 1vh;
}
#header::after {
  /* gold hairline with a centered diamond ornament */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 18%, var(--gold) 82%, transparent);
  opacity: 0.55;
}
#header .ornament {
  position: absolute;
  bottom: -0.85vh;
  left: 50%;
  transform: translateX(-50%);
  color: var(--gold);
  font-size: 1.5vh;
  background: transparent;
  line-height: 1;
}

.head-side { align-self: center; }
.head-clock { text-align: left; }
#clock {
  font-family: var(--serif);
  font-size: calc(6.2vh * var(--fs));
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
#seconds-row { font-size: calc(1.7vh * var(--fs)); color: var(--gold); letter-spacing: 0.3em; font-variant-numeric: tabular-nums; }

/* ---------- letterhead ---------- */
.letterhead {
  text-align: center;
  align-self: start;
  padding-top: 0.4vh;
  min-width: 0;
}
.letterhead-img {
  max-height: 14.5vh;
  max-width: 46vw;
  object-fit: contain;
}
/* On dark themes, a black letterhead image is inverted to parchment tones
   (light themes — ivory, luach — show it as-is) */
body:not([data-theme="ivory"]):not([data-theme="luach"]) .letterhead-img.invert {
  filter: invert(0.92) sepia(0.35) saturate(1.6) hue-rotate(5deg);
}

.arch-svg { width: 44vw; height: 8.2vh; display: block; margin: 0 auto; }
.arch-text {
  font-family: var(--hebrew);
  font-weight: 700;
  font-size: 64px; /* viewBox units — scales with the SVG */
  fill: var(--gold-soft);
  letter-spacing: 2px;
}
.lh-line2 {
  font-family: var(--hebrew);
  font-weight: 700;
  font-size: calc(2.6vh * var(--fs));
  color: var(--ink);
  direction: rtl;
  margin-top: 0.2vh;
}
.lh-line2::before, .lh-line2::after { content: "❦"; color: var(--gold); font-size: 0.75em; margin: 0 0.8vw; font-weight: 400; }
.lh-line3 {
  font-family: var(--hebrew);
  font-size: calc(2vh * var(--fs));
  color: var(--ink-dim);
  direction: rtl;
  margin-top: 0.1vh;
}
.lh-line3::before, .lh-line3::after { content: "—"; color: var(--card-edge); margin: 0 0.8vw; }
.lh-address {
  font-family: var(--sans);
  font-size: calc(1.6vh * var(--fs));
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  margin-top: 0.2vh;
}

.head-right { text-align: right; }
.date-he { font-family: var(--hebrew); font-size: calc(3vh * var(--fs)); color: var(--gold-soft); direction: rtl; }
.parsha { font-family: var(--serif); font-size: calc(2.2vh * var(--fs)); color: var(--accent); }

/* ---------- main grid ---------- */
#main {
  display: grid;
  grid-template-columns: 24vw 1fr 24vw;
  gap: 1.2vw;
  min-height: 0;
}
#main.no-left { grid-template-columns: 1fr 24vw; }
#main.no-right { grid-template-columns: 24vw 1fr; }
#main.no-left.no-right { grid-template-columns: 1fr; }
#main.no-left .col-a { display: none; }
#main.no-right .col-b { display: none; }

.center-col, .col-a, .col-b { display: flex; flex-direction: column; gap: 1.2vh; min-height: 0; overflow: hidden; }
/* Cards stay in place and share the column; when a card's CONTENT is too
   long, only the list inside it auto-scrolls (data-autoscroll) — the card
   and its title never move */
.col-a > .card, .col-b > .card, .center-col > .card { flex: 1 1 auto; min-height: 0; }
.col-a .card, .col-b .card, .center-col .card { display: flex; flex-direction: column; }
.col-a .card h2, .col-b .card h2, .center-col .card h2 { flex: 0 0 auto; }
.card .time-list, .card .limud-list, .card .sec-items { flex: 1; min-height: 0; overflow: hidden; }

/* ---------- web / pdf sections (live site or PDF inside a card) ----------
   direction:ltr — the media box holds only an iframe; in the RTL luach layout
   an oversized (zoomed-out) iframe would otherwise overflow leftward and the
   scaled page would land outside the panel */
.section-card .sec-web { flex: 1; overflow: hidden; border-radius: 1vh; min-height: 0; direction: ltr; }
.section-card .sec-web iframe {
  width: 100%; height: 100%; border: 0; display: block; background: #fff;
}

/* events list scrolls by itself when long */
.events-card { display: flex; flex-direction: column; }
.event-list { flex: 1; overflow: hidden; min-height: 0; }

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-radius: 1.6vh;
  padding: 1.6vh 1.4vw;
  box-shadow: var(--shadow), inset 0 1px 0 var(--card-top);
  overflow: hidden;
  min-height: 0;
}

.card h2 {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 0.9vh;
  margin-bottom: 1vh;
}
.card h2::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent 65%);
  opacity: 0.5;
}
.card h2 .he { font-family: var(--hebrew); font-size: calc(2.8vh * var(--fs)); color: var(--gold); direction: rtl; }

/* ---------- zmanim / shabbos lists ---------- */
.zmanim-card { display: flex; flex-direction: column; }
.zmanim-card ul { flex: 1; display: flex; flex-direction: column; justify-content: space-evenly; }

.time-list { list-style: none; }
.time-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6vw;
  padding: 0.4vh 0.5vw;
  font-size: calc(2.05vh * var(--fs));
  white-space: nowrap;
  border-radius: 0.7vh;
}
.time-list li:nth-child(even) { background: var(--zebra); }
.time-list .n { color: var(--ink); overflow: hidden; text-overflow: ellipsis; font-family: var(--hebrew); }
/* plaintext bidi: clock times stay LTR, Hebrew dates stay RTL, on every theme */
.time-list .t { font-variant-numeric: tabular-nums; color: var(--gold-soft); font-weight: 500; unicode-bidi: plaintext; }

/* passed zmanim fade; the next zman glows */
.time-list li.past { opacity: 0.45; }
.time-list li.next {
  background: var(--next-bg);
  box-shadow: inset 0.3vw 0 0 var(--gold);
  opacity: 1;
}
.time-list li.next .t { color: var(--gold); font-weight: 700; }

/* ---------- editable sections (each its own card, placeable in any column) ---------- */
.sec-items { list-style: none; column-gap: 2vw; }
.sec-items.two-col { columns: 2; }
.sec-items li {
  display: flex;
  justify-content: space-between;
  break-inside: avoid;
  font-size: calc(2.3vh * var(--fs));
  padding: 0.4vh 0.4vw;
  border-radius: 0.7vh;
  font-family: var(--hebrew);
}
.sec-items li:nth-child(even) { background: var(--zebra); }
/* header line inside a times list — e.g. חול / שבת / יום טוב */
.sec-items li.times-header {
  display: block;
  text-align: center;
  color: var(--gold);
  font-weight: 700;
  font-size: calc(2.3vh * var(--fs));
  border-bottom: 1px solid var(--card-edge);
  background: none !important;
  padding: 0.7vh 0 0.3vh;
  break-after: avoid;
}

/* simchas-type section: one mazel tov per line, mixed Hebrew/English safe */
.sec-simchas li { unicode-bidi: plaintext; }
/* sponsorship-type section: centered dedication lines */
.sec-sponsors li { justify-content: center; text-align: center; unicode-bidi: plaintext; }

/* sponsorship board: big headers, sponsorship blocks (what / by whom /
   dedication), hairline separators like a printed parnes board */
.sponsor-board { flex: 1; min-height: 0; overflow: hidden; direction: rtl; font-family: var(--hebrew); }
.sponsor-board .sp-header {
  text-align: center;
  font-weight: 700;
  color: var(--gold);
  font-size: calc(2.7vh * var(--fs));
  padding: 0.8vh 0 0.5vh;
  border-bottom: 1px solid var(--card-edge);
}
.sponsor-board .sp-header:not(:first-child) { margin-top: 0.8vh; }
.sponsor-board .sp-item {
  text-align: center;
  padding: 0.6vh 0.4vw;
  border-bottom: 1px solid var(--zebra);
}
.sponsor-board .sp-title { font-weight: 700; font-size: calc(2.2vh * var(--fs)); }
.sponsor-board .sp-names { font-size: calc(1.85vh * var(--fs)); color: var(--ink-dim); unicode-bidi: plaintext; }
.sponsor-board .sp-ded { font-size: calc(1.7vh * var(--fs)); color: var(--gold-soft); unicode-bidi: plaintext; }

/* featured sponsor — one sponsor alone, big, for its date range */
.sponsor-solo {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.2vh;
  direction: rtl;
  font-family: var(--hebrew);
}
.sponsor-solo .ss-text { font-size: calc(3.6vh * var(--fs)); font-weight: 700; color: var(--gold); unicode-bidi: plaintext; }
.sponsor-solo .ss-sub { font-size: calc(2.3vh * var(--fs)); color: var(--ink); unicode-bidi: plaintext; }

/* per-section smaller panel titles (settings in the panel dialog) */
.card.title-small h2 .he { font-size: calc(2.1vh * var(--fs)); }
.card.title-tiny h2 .he { font-size: calc(1.6vh * var(--fs)); }
.card.title-small h2, .card.title-tiny h2 { padding-bottom: 0.5vh; margin-bottom: 0.6vh; }
body[data-theme="luach"] .card.title-small h2 .he { font-size: calc(2.3vh * var(--fs)); }
body[data-theme="luach"] .card.title-tiny h2 .he { font-size: calc(1.8vh * var(--fs)); }

/* donors board — replica of the קרן הבנין fundraiser screen (dark slate
   gradient, gold header, light pill rows), in the display's own font */
.section-card.donor-card {
  background: linear-gradient(135deg, #3d4a4f 0%, #2d3a3f 50%, #4a5558 100%);
  border-color: rgba(0, 0, 0, 0.35);
  padding: 1vh 0.8vw;
}
.donor-board { flex: 1; min-height: 0; display: flex; gap: 1vw; direction: rtl; }
.db-side {
  flex: 0 0 27%; position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center;
  padding-top: 2vh; text-align: center; font-family: var(--hebrew);
}
.db-logo {
  position: absolute; bottom: 1vh; left: 50%; transform: translateX(-50%);
  width: 75%; opacity: 0.5; z-index: 0;
}
.db-t1 {
  font-size: calc(4.4vh * var(--fs)); font-style: italic; font-weight: 700;
  color: #d4c5a0; position: relative; z-index: 1; margin-bottom: 0.6vh;
}
.db-t2 {
  font-size: calc(3.2vh * var(--fs)); color: #c9b37a; line-height: 1.3;
  position: relative; z-index: 1;
}
.db-t3 {
  font-size: calc(2.8vh * var(--fs)); color: #c9b37a; font-style: italic;
  position: relative; z-index: 1; margin-top: 0.6vh;
}
.db-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.db-cols {
  display: flex; align-items: center; gap: 0.6vw; flex: none;
  background: rgba(0, 0, 0, 0.3); border-radius: 0.9vh;
  padding: 0.9vh 1vw; margin-bottom: 0.8vh;
  color: #f5d67a; font-weight: 700; font-family: var(--hebrew);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}
.db-cols .c1 { flex: 1; font-size: calc(2.6vh * var(--fs)); }
.db-cols .c2 { width: 5.8em; text-align: center; white-space: nowrap; font-size: calc(1.8vh * var(--fs)); }
.donor-scroll { flex: 1; min-height: 0; overflow: hidden; }
.donor-list { list-style: none; will-change: transform; }
.donor-list li {
  display: flex; align-items: center; gap: 0.5vw;
  background: rgba(200, 200, 200, 0.95); border-radius: 99vh;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  padding: 0.6vh 1vw; margin: 0.8vh 0.2vw;
  font-family: var(--hebrew); font-size: calc(2.1vh * var(--fs));
}
.donor-list .dn {
  flex: 1; min-width: 0; font-weight: 700; color: #1a1a1a;
  unicode-bidi: plaintext; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
}
.donor-list .dprog { display: flex; align-items: center; gap: 0.4vw; flex: none; direction: ltr; }
.donor-list .dbar {
  width: 5vw; height: 1.6vh; border-radius: 1vh; overflow: hidden;
  background: #cfcfcf;
}
.donor-list .dbar i {
  display: block; height: 100%; border-radius: 1vh;
  background: linear-gradient(90deg, #f5a623 0%, #e09000 100%);
}
.donor-list .dbar i.full { background: linear-gradient(90deg, #5fd47a 0%, #2d8a4e 100%); }
.donor-list .dpct {
  width: 2.5em; text-align: center; font-weight: 800; color: #111;
  font-variant-numeric: tabular-nums;
}
.donor-list .damt {
  width: 5.6em; text-align: center; font-weight: 800; color: #111;
  font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate;
  font-size: 0.75em;
}
.sec-items .v { color: var(--gold-soft); font-variant-numeric: tabular-nums; font-weight: 500; }

/* text-type section */
.section-card .sec-rich {
  flex: 1; min-height: 0; overflow: hidden;
  padding: 0.4vh 1vw;
  font-size: calc(2.3vh * var(--fs)); line-height: 1.5;
  font-family: var(--hebrew); unicode-bidi: plaintext; direction: rtl;
}
.section-card .sec-rich h1, .section-card .sec-rich h2, .section-card .sec-rich h3 { color: var(--gold); margin: 0.6vh 0; }
.section-card .sec-rich ul, .section-card .sec-rich ol { padding-inline-start: 2vw; }

/* image-type section */
.section-card .sec-image { flex: 1; min-height: 0; }
.section-card .sec-image img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ---------- events ---------- */
.events-card { flex: 1; }
.event-list { list-style: none; }
.event-list li { display: flex; gap: 0.9vw; align-items: baseline; padding: 0.6vh 0; font-size: calc(2.1vh * var(--fs)); }
.event-list .d {
  min-width: 8.2vw;
  text-align: center;
  color: var(--accent);
  border: 1px solid var(--card-edge);
  border-radius: 999px;
  padding: 0.15vh 0.7vw;
  font-size: calc(1.65vh * var(--fs));
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  unicode-bidi: plaintext;
}
.event-list .tt { color: var(--ink); }
.event-list .tm { color: var(--gold-soft); margin-inline-start: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.event-list .desc { color: var(--ink-dim); font-size: calc(1.7vh * var(--fs)); }

/* ---------- holiday banner ---------- */
.holiday-banner {
  background: var(--banner-bg);
  border: 1px solid var(--gold);
  border-radius: 1.2vh;
  text-align: center;
  padding: 1vh;
  font-family: var(--hebrew);
  font-size: calc(3vh * var(--fs));
  color: var(--gold-soft);
}
.hidden { display: none !important; }

/* ---------- limudim ---------- */
.limud-list { list-style: none; }
.limud-list li { padding: 0.55vh 0.4vw; font-size: calc(2vh * var(--fs)); display: flex; justify-content: space-between; gap: 1vw; border-radius: 0.7vh; font-family: var(--hebrew); }
.limud-list li:nth-child(even) { background: var(--zebra); }
.limud-list .l { color: var(--ink-dim); white-space: nowrap; }
.limud-list .txt { color: var(--ink); text-align: right; font-family: var(--hebrew); }

/* ---------- simchas ---------- */
.simcha-card { flex: 1; display: flex; flex-direction: column; }
.simcha-card::before {
  /* inner decorative frame */
  content: "";
  position: absolute;
  inset: 0.9vh;
  border: 1px solid var(--card-edge);
  border-radius: 1.1vh;
  pointer-events: none;
}
/* all simchas as a centered list (loop-scrolls when long): the person big,
   the occasion smaller beneath */
.simcha-list {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  list-style: none;
  text-align: center;
  font-family: var(--serif);
  padding: 0 1vw;
  direction: rtl;
}
.simcha-list li { padding: 1vh 0; unicode-bidi: plaintext; }
.simcha-list li + li { border-top: 1px solid var(--card-edge); }
.simcha-list .s1 {
  font-size: calc(2.6vh * var(--fs));
  color: var(--gold-soft);
  font-weight: 600;
  line-height: 1.3;
}
.simcha-list .s2 {
  font-size: calc(1.9vh * var(--fs));
  color: var(--ink);
  opacity: 0.85;
  line-height: 1.35;
  margin-top: 0.3vh;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(1vh); } to { opacity: 1; } }

/* ---------- Luach Classic theme: structure ---------- */
body[data-theme="luach"] {
  background:
    radial-gradient(45vw 40vh at 12% 18%, rgba(120,110,95,0.10), transparent 60%),
    radial-gradient(50vw 45vh at 85% 75%, rgba(120,110,95,0.09), transparent 60%),
    radial-gradient(35vw 30vh at 70% 15%, rgba(140,130,110,0.07), transparent 60%),
    linear-gradient(170deg, var(--bg-1), var(--bg-0) 75%);
}
body[data-theme="luach"] #main { direction: rtl; }
body[data-theme="luach"] .card {
  border: 1px solid var(--card-edge);
  box-shadow: var(--shadow), inset 0 0 0 0.45vh var(--card), inset 0 0 0 calc(0.45vh + 1px) var(--card-edge);
  padding-top: 2vh;
}
body[data-theme="luach"] .card h2 { justify-content: center; }
body[data-theme="luach"] .card h2 .en { display: none; }
body[data-theme="luach"] .card h2 .he { font-size: calc(3.2vh * var(--fs)); font-weight: 700; }
body[data-theme="luach"] .card h2::after {
  left: 15%; right: 15%;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
body[data-theme="luach"] .time-list li,
body[data-theme="luach"] .sec-items li,
body[data-theme="luach"] .limud-list li { font-family: var(--hebrew); }
body[data-theme="luach"] .time-list .t,
body[data-theme="luach"] .sec-items .v { color: var(--ink); font-weight: 700; }
body[data-theme="luach"] .arch-text { fill: var(--ink); }
body[data-theme="luach"] .lh-line2 { color: var(--ink); }
body[data-theme="luach"] #clock { font-weight: 700; }
body[data-theme="luach"] .head-right { display: flex; flex-direction: column; align-items: flex-end; }
body[data-theme="luach"] .parsha {
  order: -1;
  font-family: var(--hebrew);
  font-size: calc(4vh * var(--fs));
  font-weight: 700;
  color: var(--ink);
  direction: rtl;
}
body[data-theme="luach"] .date-he { font-size: calc(2.2vh * var(--fs)); color: var(--ink); }
#clock-date { font-size: calc(2vh * var(--fs)); color: var(--ink-dim); font-weight: 500; letter-spacing: 0.06em; }

/* small note under a section line (e.g. which minyan/room) */
.sec-items .note { display: block; font-size: 0.6em; color: var(--ink-dim); font-weight: 400; line-height: 1.3; }

/* keep clock times reading left-to-right inside the RTL layout
   (.t and .d use unicode-bidi: plaintext globally, which handles both
    Hebrew dates and English times correctly) */
body[data-theme="luach"] .sec-items .v,
body[data-theme="luach"] .limud-list .txt,
body[data-theme="luach"] .event-list .tm { direction: ltr; unicode-bidi: isolate; }
body[data-theme="luach"] .event-list li { direction: ltr; }

/* ---------- ticker ---------- */
#ticker-wrap {
  display: flex;
  align-items: center;
  gap: 1vw;
  min-height: 6vh;
  padding: 0.4vh 0;
  border-top: 1px solid var(--card-edge);
  overflow: hidden;
}
.ticker-label { color: var(--gold); font-size: calc(2.2vh * var(--fs)); }
.ticker {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
}
#ticker-text {
  display: inline-block;
  padding-left: 100%;
  font-size: calc(2.6vh * var(--fs));
  color: var(--ink);
  animation: scroll linear infinite;
  animation-duration: 40s;
  unicode-bidi: plaintext; /* mixed Hebrew/English announcements keep word order */
}
@keyframes scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}
