/* --------------------------------------------------- Jewish Calendar slide ---
   Epic onfiremobile-uzi53, bead .4. Loaded after styles.css; every class is
   .ns-jcal*. Sizes are clamp()/vmin only, no media queries: the same markup
   holds on a 1280x720 Raspberry Pi panel and a 4K TV. Palette follows the
   catalog gradient #1E3A8A -> #D4A017: deep night blue, candle gold.

   Hebrew: generous line-height and block padding on every Hebrew element so
   niqqud and the tall Frank Ruhl ascenders are never clipped. The only Hebrew
   element that can truncate is a holiday row's Hebrew title (ellipsis, with
   block padding so marks still clear the line box). Fonts are loaded before paint by
   jewishCalendarPrepare; the stacks end in DejaVu, the only Hebrew face the
   kiosk image installs. */

.ns-jcal {
    --jcal-gold: #D4A017;
    --jcal-gold-soft: #F3DE9C;
    --jcal-ink: #F7F3E8;
    --jcal-muted: rgba(247, 243, 232, 0.62);
    --jcal-faint: rgba(247, 243, 232, 0.42);
    --jcal-line: rgba(212, 160, 23, 0.22);
    --jcal-serif: 'Frank Ruhl Libre', 'Noto Serif Hebrew', 'DejaVu Serif', 'David', 'Times New Roman', serif;
    --jcal-sans: 'Heebo', 'Noto Sans Hebrew', 'DejaVu Sans', 'Arial Hebrew', Arial, sans-serif;
    background:
        radial-gradient(90% 70% at 100% 100%, rgba(212, 160, 23, 0.20) 0%, rgba(212, 160, 23, 0) 60%),
        radial-gradient(110% 90% at 0% 0%, rgba(30, 58, 138, 0.85) 0%, rgba(30, 58, 138, 0) 70%),
        linear-gradient(160deg, #0E1A45 0%, #0A1230 55%, #080C1F 100%);
    color: var(--jcal-ink);
    font-family: var(--jcal-sans);
    padding: clamp(20px, 4.2vmin, 72px) clamp(24px, 5.2vmin, 96px);
    gap: clamp(12px, 2.6vmin, 44px);
}

/* --- header ------------------------------------------------------------- */
.ns-jcal-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1em;
    flex: 0 0 auto;
    padding-bottom: clamp(8px, 1.6vmin, 26px);
    border-bottom: 1px solid var(--jcal-line);
    font-size: clamp(15px, 2.6vmin, 44px);
    line-height: 1.3;
}
.ns-jcal-place {
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--jcal-gold-soft);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ns-jcal-sched {
    margin-left: 0.9em;
    font-weight: 400;
    font-size: 0.72em;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--jcal-faint);
}
.ns-jcal-greg {
    font-weight: 400;
    color: var(--jcal-muted);
    white-space: nowrap;
}

/* --- layout ------------------------------------------------------------- */
.ns-jcal-main {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
    gap: clamp(16px, 4vmin, 72px);
}
.ns-jcal-single .ns-jcal-main { grid-template-columns: minmax(0, 1fr); }
.ns-jcal-col {
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 2.4vmin, 40px);
    min-width: 0;
    min-height: 0;
}
.ns-jcal-hero { justify-content: center; }
.ns-jcal-single .ns-jcal-hero { align-items: center; text-align: center; }
.ns-jcal-side { justify-content: center; }

/* --- Hebrew date -------------------------------------------------------- */
.ns-jcal-date { display: flex; flex-direction: column; gap: clamp(4px, 0.8vmin, 14px); }
.ns-jcal-he-date {
    font-family: var(--jcal-serif);
    font-weight: 700;
    font-size: clamp(44px, 12.5vmin, 230px);
    line-height: 1.32;
    padding-block: 0.04em 0.08em;
    color: var(--jcal-gold-soft);
    text-shadow: 0 0.04em 0.4em rgba(212, 160, 23, 0.25);
    unicode-bidi: isolate;
    white-space: nowrap;
}
.ns-jcal-hero .ns-jcal-he-date { text-align: right; }
.ns-jcal-single .ns-jcal-hero .ns-jcal-he-date { text-align: center; }
.ns-jcal-translit {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4em 0.9em;
    font-size: clamp(17px, 3.4vmin, 58px);
    font-weight: 400;
    color: var(--jcal-ink);
    letter-spacing: 0.01em;
}
.ns-jcal-hero .ns-jcal-translit { justify-content: flex-end; }
.ns-jcal-single .ns-jcal-hero .ns-jcal-translit { justify-content: center; }
.ns-jcal-since {
    font-size: 0.56em;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--jcal-gold);
    padding: 0.28em 0.8em;
    border: 1px solid rgba(212, 160, 23, 0.45);
    border-radius: 999px;
}
.ns-jcal-updating {
    font-size: clamp(20px, 4vmin, 64px);
    color: var(--jcal-muted);
}

/* --- parashah ----------------------------------------------------------- */
.ns-jcal-parashah {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    gap: clamp(2px, 0.5vmin, 10px);
    padding-top: clamp(10px, 2vmin, 34px);
    border-top: 1px solid var(--jcal-line);
}
.ns-jcal-single .ns-jcal-parashah { align-items: center; text-align: center; }
.ns-jcal-eyebrow {
    font-size: clamp(11px, 1.7vmin, 28px);
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--jcal-gold);
}
.ns-jcal-par-he {
    font-family: var(--jcal-serif);
    font-weight: 500;
    font-size: clamp(28px, 6.6vmin, 120px);
    line-height: 1.34;
    padding-block: 0.02em 0.06em;
    color: var(--jcal-ink);
    unicode-bidi: isolate;
}
.ns-jcal-par-en {
    font-size: clamp(15px, 2.8vmin, 48px);
    color: var(--jcal-muted);
}

/* --- cards: Shabbat panel, no location, holidays ------------------------ */
.ns-jcal-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.065) 0%, rgba(255, 255, 255, 0.035) 100%);
    border: 1px solid var(--jcal-line);
    border-radius: clamp(14px, 2.2vmin, 36px);
    padding: clamp(12px, 2.4vmin, 42px) clamp(16px, 3vmin, 52px);
    min-width: 0;
}
.ns-jcal-panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.2em 0.8em;
}
.ns-jcal-panel-title {
    font-size: clamp(20px, 4.2vmin, 72px);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.005em;
    color: var(--jcal-ink);
}
.ns-jcal-state-in_progress .ns-jcal-panel-title { color: var(--jcal-gold-soft); }
.ns-jcal-panel-he {
    font-family: var(--jcal-serif);
    font-weight: 500;
    font-size: clamp(18px, 3.6vmin, 62px);
    line-height: 1.35;
    color: var(--jcal-gold);
}
.ns-jcal-panel-sub {
    margin-top: 0.5em;
    font-size: clamp(14px, 2.3vmin, 38px);
    line-height: 1.45;
    color: var(--jcal-muted);
}
.ns-jcal-countdown {
    margin-top: 0.2em;
    font-size: clamp(13px, 2.2vmin, 36px);
    font-weight: 600;
    color: var(--jcal-gold);
}
.ns-jcal-rows {
    margin-top: clamp(8px, 1.6vmin, 26px);
    display: flex;
    flex-direction: column;
    gap: clamp(4px, 0.9vmin, 16px);
}
.ns-jcal-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1em;
    font-size: clamp(16px, 3vmin, 52px);
    line-height: 1.3;
}
.ns-jcal-label { color: var(--jcal-muted); min-width: 0; }
.ns-jcal-memo { color: var(--jcal-faint); }
.ns-jcal-val { white-space: nowrap; color: var(--jcal-muted); }
.ns-jcal-time {
    font-weight: 600;
    color: var(--jcal-ink);
    font-variant-numeric: tabular-nums;
    unicode-bidi: isolate;
}
.ns-jcal-fast {
    margin-top: clamp(8px, 1.4vmin, 24px);
    padding-top: clamp(8px, 1.4vmin, 24px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: clamp(14px, 2.4vmin, 40px);
}
.ns-jcal-noloc .ns-jcal-panel-title { font-size: clamp(18px, 3.4vmin, 58px); color: var(--jcal-gold-soft); }

.ns-jcal-hols { display: flex; flex-direction: column; min-height: 0; }
.ns-jcal-hol-list {
    list-style: none;
    margin: clamp(6px, 1.2vmin, 20px) 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: clamp(4px, 1vmin, 18px);
}
.ns-jcal-hol {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr);
    align-items: baseline;
    gap: 0.9em;
    font-size: clamp(14px, 2.4vmin, 40px);
    line-height: 1.38;
}
.ns-jcal-hol-when {
    color: var(--jcal-faint);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ns-jcal-hol-name {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.7em;
    min-width: 0;
}
.ns-jcal-hol-en {
    color: var(--jcal-ink);
    unicode-bidi: isolate;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ns-jcal-hol-yomtov .ns-jcal-hol-en { color: var(--jcal-gold-soft); font-weight: 600; }
.ns-jcal-hol-he {
    font-family: var(--jcal-serif);
    font-weight: 500;
    color: var(--jcal-muted);
    unicode-bidi: isolate;
    white-space: nowrap;
    /* A long Hebrew title (Israel's "Yom HaAliyah School Observance") must not
       squeeze its English name to nothing: both halves share the row. */
    flex: 0 1 auto;
    min-width: 0;
    max-width: 48%;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-block: 0.08em;
}

/* --- zmanim ------------------------------------------------------------- */
.ns-jcal-zmanim {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    gap: clamp(6px, 1.2vmin, 22px);
    padding-top: clamp(8px, 1.6vmin, 26px);
    border-top: 1px solid var(--jcal-line);
}
.ns-jcal-z {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15em;
    text-align: center;
}
.ns-jcal-z-label {
    font-size: clamp(9px, 1.45vmin, 24px);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--jcal-faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.ns-jcal-z .ns-jcal-time { font-size: clamp(13px, 2.3vmin, 40px); }

/* --- footer ------------------------------------------------------------- */
.ns-jcal-foot {
    flex: 0 0 auto;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1em;
    font-size: clamp(10px, 1.5vmin, 24px);
    color: var(--jcal-faint);
}
.ns-jcal-stale { color: var(--jcal-muted); }
.ns-jcal-stale .ns-jcal-time { font-weight: inherit; color: inherit; }
.ns-jcal-attr { margin-left: auto; text-align: right; }

/* --- degraded ----------------------------------------------------------- */
.ns-jcal-degraded .ns-jcal-msg {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.6em;
}
.ns-jcal-msg-title {
    font-family: var(--jcal-serif);
    font-weight: 500;
    font-size: clamp(22px, 4.6vmin, 80px);
    color: var(--jcal-gold-soft);
    max-width: 80%;
    line-height: 1.3;
}
.ns-jcal-msg-sub {
    font-size: clamp(14px, 2.3vmin, 38px);
    color: var(--jcal-muted);
}
