/* ווידג'ט השבת הקרובה — מים לים
   כל הערכים כאן ניתנים לדריסה מחלונית העיצוב של אלמנטור,
   או על ידי שינוי המשתנים למטה. */

.mlm-shb {
	--mlm-shb-title-size: 1.5rem;
	--mlm-shb-title-weight: 700;
	--mlm-shb-title-color: inherit;
	--mlm-shb-date-size: 0.95rem;
	--mlm-shb-date-color: inherit;
	--mlm-shb-date-opacity: 0.75;
	--mlm-shb-stat-size: 1rem;
	--mlm-shb-row-gap: 0.35em;

	direction: rtl;
	text-align: right;
	line-height: 1.5;
}

/* ---------------------------------------------------------------------
   תגיות המקטעים
   ---------------------------------------------------------------------
   כל מקטע יכול לצאת כ-H1..H6, כפסקה או כ-DIV, לפי הבחירה בעורך. הבחירה
   נועדה למבנה סמנטי בלבד, ולכן ברירות המחדל של התבנית ושל ערכת אלמנטור
   לכותרות, לפסקאות ולרשימות מנוטרלות כאן — אחרת המראה היה משתנה עם
   התגית. הערכים של הווידג'ט עצמו עוברים במשתנים שנקבעים ליד כל מקטע,
   כך שדיוק הסלקטור נשאר נמוך מזה של פקדי אלמנטור והם ממשיכים לגבור.
   -------------------------------------------------------------------- */

.mlm-shb h1, .mlm-shb h2, .mlm-shb h3,
.mlm-shb h4, .mlm-shb h5, .mlm-shb h6,
.mlm-shb p, .mlm-shb ul, .mlm-shb ol, .mlm-shb li,
.mlm-zm h1, .mlm-zm h2, .mlm-zm h3,
.mlm-zm h4, .mlm-zm h5, .mlm-zm h6,
.mlm-zm p, .mlm-zm ul, .mlm-zm ol, .mlm-zm li {
	margin: var(--mlm-el-m, 0);
	padding: var(--mlm-el-p, 0);
	font-family: inherit;
	font-size: var(--mlm-el-fs, inherit);
	font-weight: var(--mlm-el-fw, inherit);
	line-height: var(--mlm-el-lh, inherit);
	letter-spacing: var(--mlm-el-ls, inherit);
	color: inherit;
	background: none;
	border: 0;
	list-style: none;
	text-transform: none;
}

.mlm-shb__title {
	--mlm-el-fs: var(--mlm-shb-title-size);
	--mlm-el-fw: var(--mlm-shb-title-weight);
	--mlm-el-m: 0 0 0.25em;
	font-size: var(--mlm-shb-title-size);
	font-weight: var(--mlm-shb-title-weight);
	color: var(--mlm-shb-title-color);
	margin: 0 0 0.25em;
}

.mlm-shb__title a {
	color: inherit;
	text-decoration: none;
}

.mlm-shb__title a:hover,
.mlm-shb__title a:focus-visible {
	text-decoration: underline;
}

.mlm-shb__date {
	--mlm-el-fs: var(--mlm-shb-date-size);
	--mlm-el-m: 0 0 0.8em;
	font-size: var(--mlm-shb-date-size);
	color: var(--mlm-shb-date-color);
	opacity: var(--mlm-shb-date-opacity);
	margin: 0 0 0.8em;
}

.mlm-shb__sep {
	margin: 0 0.4em;
}

.mlm-shb__greg {
	unicode-bidi: isolate;
}

.mlm-shb__stats {
	--mlm-el-fs: var(--mlm-shb-stat-size);
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: var(--mlm-shb-stat-size);
}

.mlm-shb__stat-row {
	display: flex;
	align-items: baseline;
	gap: 0.45em;
	margin: 0;
}

.mlm-shb__stat-row + .mlm-shb__stat-row {
	margin-top: var(--mlm-shb-row-gap);
}

.mlm-shb__bullet {
	flex: none;
	line-height: 1;
}

.mlm-shb__join {
	margin: 0 0.1em;
}

/* תווית "בארץ" / "בחוץ לארץ" — מוצגת רק בשבוע שבו הקריאה שונה */
.mlm-shb__scope {
	--mlm-el-fs: 0.75em;
	--mlm-el-fw: 600;
	--mlm-el-m: 0 0 0.15em;
	--mlm-el-ls: 0.04em;
	font-size: 0.75em;
	font-weight: 600;
	letter-spacing: 0.04em;
	opacity: 0.6;
	margin-bottom: 0.15em;
}

.mlm-shb__abroad {
	margin-top: 1em;
	padding-top: 0.9em;
	border-top: 1px solid currentColor;
	border-color: color-mix(in srgb, currentColor 18%, transparent);
}

.mlm-shb__title--abroad {
	--mlm-el-fs: calc(var(--mlm-shb-title-size) * 0.78);
	--mlm-el-m: 0 0 0.45em;
	font-size: calc(var(--mlm-shb-title-size) * 0.78);
	margin-bottom: 0.45em;
}

/* ---- פריסה ---- */

.mlm-shb__body {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1.4em;
}

.mlm-shb--cols-2 .mlm-shb__body {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mlm-shb__col {
	min-width: 0;
}

/* ---- זמני כניסת ויציאת שבת ---- */

/* טור הזמנים הוא מכולה אנכית, כדי שפקד היישור יוכל לקבוע את רוחב
   בלוק הזמנים ואת מיקומו: start/center/end מכווצים אותו לרוחב
   התוכן וממקמים אותו, ו-stretch מותח אותו לרוחב מלא. */
.mlm-shb__col--times {
	display: flex;
	flex-direction: column;
}

.mlm-shb__times {
	font-size: var(--mlm-shb-times-size, 0.95em);
	/* ברירת המחדל: רוחב מלא, כמו קודם */
	align-self: stretch;
	max-width: 100%;
}

.mlm-shb__where {
	display: inline-flex;
	align-items: baseline;
	gap: 0.3em;
	white-space: nowrap;
}

.mlm-shb__candle { flex: none; line-height: 1 }
.mlm-shb__city  { font-weight: 600 }

/* צמד תווית+שעה אינו נשבר באמצע */
.mlm-shb__time { white-space: nowrap }
.mlm-shb__dash { margin: 0 0.15em }
.mlm-shb__pipe { margin: 0 0.3em; opacity: 0.45 }

.mlm-shb__t {
	unicode-bidi: isolate;
	font-variant-numeric: tabular-nums;
	font-weight: 600;
}

/* --- א. מיושרת לשני הצדדים (ברירת מחדל) ---
 *
 * העיר בקצה אחד, הזמנים בקצה השני. התוויות זהות בכל שורה והספרות
 * ברוחב קבוע, ולכן הדחיפה לקצה יוצרת עמודות ישרות בלי טבלה.
 *
 * השבירה מדורגת ונובעת מ-flex עצמו, בלי נקודות שבירה:
 *   1. אין מקום לזמנים לצד העיר  ← כל בלוק הזמנים יורד שורה
 *   2. אין מקום לשני הזמנים יחד  ← היציאה יורדת מתחת לכניסה
 * הזמנים מוגדרים flex-shrink:0 — בלי זה הדפדפן היה מכווץ אותם
 * במקום להוריד אותם, והמדרגה הראשונה לא הייתה קורית.
 */
.mlm-shb__times--table .mlm-shb__times-row {
	display: flex;
	flex-wrap: wrap;
	/* קבוע. השורות תמיד נדחפות לקצוות של בלוק הזמנים — משם מגיע
	   היישור בעמודות. מה שפקד היישור קובע הוא רוחב הבלוק עצמו
	   ומיקומו, ולא מה שקורה בתוכו. */
	justify-content: space-between;
	align-items: baseline;
	gap: 0.15em 0.9em;
}

.mlm-shb__times--table .mlm-shb__times-row + .mlm-shb__times-row {
	margin-top: var(--mlm-shb-times-gap, 0.4em);
}

.mlm-shb__times--table .mlm-shb__where {
	flex: 0 0 auto;
}

.mlm-shb__times--table .mlm-shb__times-values {
	flex: 0 0 auto;
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: flex-end;
	gap: 0.1em 0.55em;
}

.mlm-shb__times--table .mlm-shb__time,
.mlm-shb__times--table .mlm-shb__pair {
	flex: 0 0 auto;
}

/* --- ב. שורה אחת רציפה --- */
.mlm-shb__times--inline .mlm-shb__times-row {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.35em;
}

.mlm-shb__times--inline .mlm-shb__times-row + .mlm-shb__times-row {
	margin-top: var(--mlm-shb-times-gap, 0.35em);
}

.mlm-shb__times--inline .mlm-shb__times-values {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.15em;
}

/* --- ג. שתי שורות: העיר למעלה, השעות מתחת --- */
.mlm-shb__times--two .mlm-shb__times-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	row-gap: 0.1em;
}

.mlm-shb__times--two .mlm-shb__times-row + .mlm-shb__times-row {
	margin-top: var(--mlm-shb-times-gap, 0.7em);
}

.mlm-shb__times--two .mlm-shb__times-values {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.15em 0.7em;
}

.mlm-shb__times--two .mlm-shb__pipe { display: none }

/* הקו המפריד נע יחד עם היציאה, כדי שלא יישאר תלוי בסוף השורה */
.mlm-shb__pair {
	display: inline-flex;
	align-items: baseline;
	gap: 0.3em;
	white-space: nowrap;
}

/* ---- כפתור לדף הזמנים ---- */

.mlm-shb__btn-wrap {
	margin-top: 0.9em;
}

.mlm-shb__btn {
	display: inline-block;
	padding: 0.5em 1.1em;
	border-radius: 4px;
	border: 1px solid currentColor;
	font-size: 0.9em;
	font-weight: 600;
	text-decoration: none;
	color: inherit;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.mlm-shb__btn:hover,
.mlm-shb__btn:focus-visible {
	background-color: currentColor;
}

.mlm-shb__btn:hover span,
.mlm-shb__btn:focus-visible {
	color: inherit;
}

/* ---- ייחוס ל-Hebcal ---- */

.mlm-shb__credit {
	margin-top: 0.7em;
	font-size: 0.72em;
	opacity: 0.55;
}

.mlm-shb__credit a {
	color: inherit;
	text-decoration: underline;
}

/* ---- קישור תחתון ---- */

.mlm-shb__cta {
	margin-top: 1em;
}

.mlm-shb__cta a {
	display: inline-block;
	font-weight: 600;
	text-decoration: none;
	color: inherit;
}

.mlm-shb__cta a:hover,
.mlm-shb__cta a:focus-visible {
	text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
	.mlm-shb__btn { transition: none; }
}


/* =====================================================================
   טבלת זמני שבת
   ================================================================== */

.mlm-zm {
	direction: rtl;
}

.mlm-zm__head {
	margin-bottom: 0.9em;
}

.mlm-zm__parasha {
	--mlm-el-fs: 1.35em;
	--mlm-el-fw: 700;
	--mlm-el-lh: 1.25;
	font-size: 1.35em;
	font-weight: 700;
	line-height: 1.25;
}

.mlm-zm__date {
	--mlm-el-fs: 0.95em;
	font-size: 0.95em;
	opacity: 0.75;
}

.mlm-zm__sep { margin: 0 0.4em }
.mlm-zm__greg { unicode-bidi: isolate }

/* בורר השבת */
.mlm-zm__picker {
	display: flex;
	align-items: center;
	gap: 0.5em;
	margin-bottom: 1em;
	font-size: 0.95em;
	flex-wrap: wrap;
}

.mlm-zm__picker select {
	max-width: 100%;
}

/* טבלה רחבה גוללת בתוך עצמה ולא מרחיבה את העמוד */
.mlm-zm__scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.mlm-zm__table {
	border-collapse: collapse;
	width: 100%;
	font-variant-numeric: tabular-nums;
}

.mlm-zm__table th,
.mlm-zm__table td {
	padding: 0.5em 0.9em;
	text-align: start;
	border-bottom: 1px solid currentColor;
	border-color: color-mix(in srgb, currentColor 15%, transparent);
	vertical-align: baseline;
}

.mlm-zm__table thead th {
	font-weight: 700;
	font-size: 0.88em;
	letter-spacing: 0.02em;
	border-bottom-width: 2px;
}

.mlm-zm__table tbody th {
	font-weight: 600;
	white-space: nowrap;
}

.mlm-zm__table tbody tr:last-child th,
.mlm-zm__table tbody tr:last-child td {
	border-bottom: 0;
}

.mlm-zm__t {
	unicode-bidi: isolate;
	font-variant-numeric: tabular-nums;
}

.mlm-zm__credit {
	margin-top: 0.8em;
	font-size: 0.72em;
	opacity: 0.55;
}

.mlm-zm__credit a {
	color: inherit;
	text-decoration: underline;
}

.mlm-zm__updated { white-space: nowrap }

.mlm-zm--empty p {
	--mlm-el-fs: 0.95em;
	margin: 0;
	opacity: 0.7;
	font-size: 0.95em;
}
