/* לוח זמנים · נווה גדיד — עיצוב למסך טלוויזיה 16:9, כל המידות ביחידות vh/vw.
   הפלטה והמוטיבים (נבט, דקל) לקוחים מהלוגו. */
:root {
  --green-900: #12281f;
  --green-800: #1b3a2d;
  --green-700: #244a39;
  --green-600: #305c48;   /* הירוק של הלוגו */
  --teal: #70c6b0;
  --teal-deep: #4ba891;
  --sand: #ddc077;
  --sand-deep: #c9a95a;
  --olive: #a8b655;
  --lime: #c6da6e;
  --terracotta: #ce996e;
  --cream: #fafaf7;
  --cream-dim: rgba(250, 250, 247, 0.62);
  --card: rgba(250, 250, 247, 0.06);
  --card-border: rgba(250, 250, 247, 0.12);

  --font: 'Assistant', 'Segoe UI', Arial, sans-serif;
  --font-title: 'Suez One', 'Frank Ruhl Libre', 'Assistant', serif;
  --font-clock: var(--font);   /* השעון באותו גופן כמו שאר המספרים בלוח (שעות התפילה, הטיקר) */
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  background: var(--green-800); color: var(--cream);
  font-family: var(--font); cursor: none; -webkit-font-smoothing: antialiased;
}
body {
  background:
    radial-gradient(90% 70% at 50% -10%, rgba(112, 198, 176, 0.22) 0%, rgba(112, 198, 176, 0) 60%),
    linear-gradient(180deg, var(--green-700) 0%, var(--green-800) 55%, var(--green-900) 100%);
}

/* ---------- נוף ברקע ---------- */
.scenery { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; }
.scenery .hill-1 { fill: var(--olive); opacity: 0.10; }
.scenery .hill-2 { fill: var(--lime);  opacity: 0.08; }
.scenery .hill-3 { fill: var(--teal);  opacity: 0.08; }

.board {
  position: relative; z-index: 1; height: 100vh; width: 100vw;
  display: grid; grid-template-rows: 20vh 1fr 7.6vh;
  padding: 0 2vw 1.6vh; gap: 1.2vh;
}

/* ---------- כותרת ---------- */
.top {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 2vh 0 0.8vh; position: relative;
}
.top::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, rgba(221,192,119,0) 0%, rgba(221,192,119,0.55) 20%, rgba(221,192,119,0.55) 80%, rgba(221,192,119,0) 100%);
}
.date-block { line-height: 1.12; }
.heb-date { font-family: var(--font-title); font-size: 5.4vh; color: var(--sand); letter-spacing: 0.01em; }
.greg-date { font-size: 2.6vh; color: var(--cream-dim); margin-top: 0.5vh; font-weight: 600; }
.day-info { font-size: 2.7vh; margin-top: 0.5vh; color: var(--teal); font-weight: 600; }
.day-info span + span::before { content: ' · '; color: var(--sand); }

/* גומחה בהירה שיורדת מקצה המסך והלוגו השלם עליה */
.logo-niche {
  align-self: start; margin-top: -2vh; position: relative; z-index: 2;
  background: var(--cream); border-radius: 0 0 3.4vh 3.4vh; padding: 1.3vh 1.6vw 1.1vh;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1.4vh 3vh rgba(0,0,0,0.35), inset 0 -0.5vh 0 var(--sand);
}
.logo-niche .logo-img { height: 16.2vh; width: auto; display: block; }

.clock-block { display: flex; justify-content: flex-start; direction: ltr; }
.clock {
  font-family: var(--font-clock); font-weight: 700; font-size: 10vh; line-height: 1; color: var(--cream);
  font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: baseline; direction: ltr; letter-spacing: 0.01em;
}
.clock .d { display: inline-block; width: 0.6em; text-align: center; }
.clock .c { display: inline-block; width: 0.32em; text-align: center; color: var(--sand); transform: translateY(-0.05em); }
.clock .sec { font-size: 0.44em; color: var(--teal); margin-left: 0.2em; }
.clock .sec .d { width: 0.62em; }

/* ---------- עמודות ---------- */
.columns { display: grid; grid-template-columns: 1fr 1.08fr 1fr; gap: 1.5vw; min-height: 0; }
.card {
  position: relative; background: var(--card); border: 1px solid var(--card-border); border-radius: 2vh;
  padding: 1.5vh 1.5vw 1.4vh; display: flex; flex-direction: column; min-height: 0; overflow: hidden;
  box-shadow: 0 1.2vh 3vh rgba(0,0,0,0.18);
}
.card::before {
  content: ''; position: absolute; top: 0; left: 12%; right: 12%; height: 0.4vh;
  background: linear-gradient(90deg, rgba(221,192,119,0), var(--sand) 30%, var(--sand) 70%, rgba(221,192,119,0));
  border-radius: 0 0 1vh 1vh;
}
.card h2, .page-title {
  margin: 0.6vh 0 0; font-family: var(--font-title); font-weight: 400; font-size: 3.7vh;
  color: var(--sand); text-align: center; letter-spacing: 0.01em; min-height: 4.4vh; flex: none;
}
/* הנבט עם הסלסולים מתחתית הלוגו, כקישוט מתחת לכותרת */
.orn { display: block; width: 13vw; height: 1.73vw; margin: 0.1vh auto 0.5vh; color: var(--sand); opacity: 0.9; flex: none; }
.card-sub { text-align: center; color: var(--teal); font-size: 2.35vh; font-weight: 600; min-height: 3vh; margin-bottom: 0.6vh; flex: none; }

/* שורות תפילה: הכל בשמנת מלאה, זמנים משתנים בטורקיז, הזמן הבא מודגש */
.rows { display: flex; flex-direction: column; justify-content: space-evenly; flex: 1; min-height: 0; gap: 0.2vh; }
.row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1vw;
  font-size: 3.2vh; padding: 0.55vh 1vw; border-radius: 1vh; line-height: 1.3; color: var(--cream);
  transition: background 0.4s ease;
}
.row .label { font-weight: 600; }
.row .time { font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; letter-spacing: 0.02em; white-space: nowrap; }
.row .time.txt { font-weight: 600; font-size: 0.8em; direction: rtl; opacity: 0.9; }
.row.zman .label { font-weight: 500; }
.row.zman .time { color: var(--teal); }
.row.shiur { font-size: 2.6vh; }
.row.shiur .label { font-weight: 500; }
.row.shiur .time { font-weight: 600; }
.row.emph .label, .row.emph .time { color: var(--sand); }
.row.next { background: rgba(112, 198, 176, 0.16); box-shadow: inset 0.35vw 0 0 var(--teal); }
.row.next .time { color: var(--teal); }
.rows.roomy .row { font-size: 3.7vh; }
.rows.roomy .row .time { font-size: 4vh; }
.rows.compact .row { font-size: 2.75vh; padding: 0.35vh 1vw; }
.rows.compact .row.shiur { font-size: 2.3vh; }

/* ---------- עמודים מתחלפים בתוך כרטיס (שבת/חגים, תמונות/שומרים/כוננות) ---------- */
.pages { position: relative; flex: 1; min-height: 0; }
.page {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  opacity: 0; transition: opacity 0.9s ease; pointer-events: none;
}
.page.on { opacity: 1; }
/* פס התקדמות דק עם מונה עמודים: כמה זמן נשאר עד שהעמוד מתחלף, ואיזה עמוד מוצג */
.page-progress { flex: none; display: flex; align-items: center; gap: 0.7vw; margin-top: 0.9vh; }
.page-progress[hidden] { display: none; }
.page-progress .track { flex: 1; height: 0.5vh; border-radius: 1vh; background: rgba(250,250,247,0.12); overflow: hidden; }
.page-progress .fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--teal-deep), var(--teal)); border-radius: 1vh; }
.page-progress .count { font-size: 1.75vh; color: var(--cream-dim); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* תמונה מהוואטסאפ: ממלאת את הכרטיס עד הקצוות */
.middle-card .page.image { top: -1.5vh; left: -1.5vw; right: -1.5vw; bottom: 0; background: var(--green-900); }
.middle-card .page.image img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* "שיויתי" — כשאין תמונות ואין שומרים: בלי מסגרת כרטיס */
.middle-card.verse { background: transparent; border-color: transparent; box-shadow: none; }
.middle-card.verse::before { display: none; }
.verse-wrap {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.4vh; text-align: center;
}
.verse-wrap::before {
  content: ''; position: absolute; inset: 8% 0; z-index: -1;
  background: radial-gradient(50% 50% at 50% 50%, rgba(112,198,176,0.18), rgba(112,198,176,0) 70%);
}
.verse-big { font-family: var(--font-title); font-size: 11vh; line-height: 1.2; color: var(--sand); text-shadow: 0 0.8vh 2.4vh rgba(0,0,0,0.45); }
.verse-rest { font-family: var(--font-title); font-size: 7.4vh; line-height: 1.25; color: var(--cream); text-shadow: 0 0.6vh 2vh rgba(0,0,0,0.45); }
.orn.big { width: 18vw; height: 2.4vw; opacity: 0.95; margin: 0; }
.orn.flip { transform: scaleY(-1); }

.shomrim { display: flex; flex-direction: column; justify-content: space-evenly; flex: 1; min-height: 0; margin-top: 0.6vh; }
.shomrim.dense .entry { font-size: 2.9vh; padding: 0.45vh 1vw; }
.shomrim .entry {
  display: flex; align-items: center; gap: 1.2vw; font-size: 3.3vh; padding: 0.7vh 1vw; border-radius: 1vh;
  background: rgba(250,250,247,0.05);
}
.shomrim .entry .slot { font-weight: 700; color: var(--sand); font-variant-numeric: tabular-nums; direction: ltr; white-space: nowrap; min-width: 8vw; text-align: right; }
.shomrim .entry .who { font-weight: 600; }
.shomrim .entry.plain { justify-content: center; font-weight: 600; }

.duty { display: flex; flex-direction: column; justify-content: space-evenly; flex: 1; min-height: 0; padding: 0.5vh 0.5vw; }
.duty .line { display: flex; justify-content: space-between; align-items: baseline; gap: 1vw; font-size: 2.55vh; line-height: 1.35; padding: 0.15vh 0.6vw; }
.duty .line .txt { font-weight: 600; }
.duty .line .phone { font-weight: 700; color: var(--sand); direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; white-space: nowrap; }
.duty .line:only-child, .duty .line:last-child:not(:has(.phone)) { justify-content: center; }
.duty .gap { height: 0.6vh; }

/* הודעת טקסט מהוואטסאפ: כותרת (אם יש, בסגנון page-title הקיים) ואחריה שורות בסגנון .duty .line;
   השורה הראשונה מודגשת. בלי כותרת – .centered ממרכז את גוש השורות בעמוד. */
.notice { display: flex; flex-direction: column; justify-content: space-evenly; flex: 1; min-height: 0; padding: 0.5vh 0.5vw; }
.notice .line { display: flex; justify-content: space-between; align-items: baseline; gap: 1vw; font-size: 3.3vh; line-height: 1.35; padding: 0.15vh 0.6vw; }
.notice .line .txt { font-weight: 600; color: var(--cream); }
.notice .line .phone { font-weight: 700; color: var(--sand); direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; white-space: nowrap; }
.notice .line.first .txt { font-weight: 800; color: var(--sand); font-size: 1.05em; }
.notice .line:only-child, .notice .line:last-child:not(:has(.phone)) { justify-content: center; }
.notice .gap { height: 0.6vh; }
.notice.compact .line { font-size: 2.55vh; padding: 0.1vh 0.6vw; }
.notice.centered { justify-content: center; gap: 1.2vh; }
.notice.centered .line { justify-content: center; text-align: center; }

/* ---------- טיקר זמני היום ---------- */
.ticker {
  position: relative; overflow: hidden; display: flex; align-items: stretch;
  background: linear-gradient(180deg, var(--sand) 0%, var(--sand-deep) 100%);
  color: var(--green-900); border-radius: 1.4vh; font-size: 3.3vh; font-weight: 700;
  box-shadow: 0 0.8vh 2vh rgba(0,0,0,0.25);
}
/* תווית קבועה בצד ימין עם הדקל מהלוגו; הטקסט הגולל נעלם מאחוריה */
.ticker-badge {
  display: flex; align-items: center; gap: 0.7vw; padding: 0 1.2vw 0 1.4vw; position: relative; z-index: 2;
  background: var(--green-600); color: var(--sand); font-family: var(--font-title); font-weight: 400; font-size: 2.9vh; white-space: nowrap;
  box-shadow: -0.4vw 0 1.2vw rgba(0,0,0,0.25);
}
.ticker-badge svg { width: 3.8vh; height: 2.95vh; color: var(--lime); }
.ticker-viewport { flex: 1; min-width: 0; position: relative; overflow: hidden; display: flex; align-items: center; }
.ticker-track { white-space: nowrap; will-change: transform; width: max-content; text-align: start; }
.ticker-track.scrolling { animation: ticker linear infinite; }
.ticker-track .z { padding: 0 0.6vw; }
.ticker-track .z .l { font-weight: 600; opacity: 0.85; }
.ticker-track .z .t { font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; display: inline-block; margin-right: 0.5vw; }
.ticker-track .sep { color: var(--green-600); padding: 0 0.5vw; opacity: 0.7; }
/* בעברית הטקסט זז משמאל לימין; העותק השני נכנס בדיוק במקום הראשון - לולאה בלי הפסקה */
@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(var(--ticker-half)); }
}

/* ---------- סטטוס ---------- */
.status {
  position: fixed; left: 1vw; top: 0.6vh; font-size: 1.8vh; color: var(--cream-dim);
  background: rgba(0,0,0,0.35); padding: 0.3vh 0.8vw; border-radius: 0.6vh; z-index: 20;
}
.status.warn { color: var(--sand); }
.stale-banner { grid-column: 1 / -1; text-align: center; font-size: 4vh; color: var(--sand); padding: 4vh; font-family: var(--font-title); }
