/* ============================================================
 *  בורר תאריך עברי — "תאריך פינוי" בטופס העלאת דירה
 *  זהב #E8C676 הוא צבע כפתור השליחה של הטופס; משתמשים בו כאן
 *  כדי שהלוח ייראה חלק מהטופס ולא כמו רכיב מושתל.
 * ============================================================ */

.irm-hd-input {
	cursor: pointer;
}

.irm-hd-note {
	display: block;
	margin-top: 6px;
	font-size: 13px;
	line-height: 1.5;
	color: #6b7280;
}

.irm-hd-backdrop {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: transparent;
}

.irm-hd {
	position: fixed;
	z-index: 100001;
	width: 320px;
	max-width: calc( 100vw - 16px );
	padding: 12px;
	box-sizing: border-box;
	direction: rtl;
	text-align: right;
	font-family: inherit;
	color: #1f2937;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	box-shadow: 0 18px 40px rgba( 17, 24, 39, .18 );
}

.irm-hd * {
	box-sizing: border-box;
}

/* --- כותרת וניווט --- */

.irm-hd__head {
	display: flex;
	align-items: center;
	gap: 2px;
	margin-bottom: 10px;
}

.irm-hd__nav {
	flex: 0 0 auto;
	width: 28px;
	height: 28px;
	padding: 0;
	font-size: 16px;
	line-height: 1;
	color: #4b5563;
	background: transparent;
	border: 0;
	border-radius: 8px;
	cursor: pointer;
	transition: background-color .15s, color .15s;
}

.irm-hd__nav:hover,
.irm-hd__nav:focus-visible {
	color: #111827;
	background: #f3f4f6;
	outline: none;
}

.irm-hd__title {
	flex: 1 1 auto;
	min-width: 0;
	text-align: center;
}

.irm-hd__he {
	display: block;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	color: #111827;
}

.irm-hd__gr {
	display: block;
	font-size: 11px;
	line-height: 1.4;
	color: #9ca3af;
}

/* --- ימי השבוע --- */

.irm-hd__dow {
	display: grid;
	grid-template-columns: repeat( 7, 1fr );
	margin-bottom: 4px;
}

.irm-hd__dow span {
	padding: 4px 0;
	font-size: 12px;
	font-weight: 600;
	text-align: center;
	color: #9ca3af;
}

.irm-hd__dow span.is-shabbat {
	color: #b08828;
}

/* --- רשת הימים --- */

.irm-hd__grid {
	display: grid;
	grid-template-columns: repeat( 7, 1fr );
	gap: 2px;
}

.irm-hd__pad {
	display: block;
}

.irm-hd__day {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1px;
	min-height: 40px;
	padding: 3px 0;
	background: transparent;
	border: 1px solid transparent;
	border-radius: 9px;
	cursor: pointer;
	transition: background-color .12s, border-color .12s, color .12s;
}

.irm-hd__d-he {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.1;
	color: #1f2937;
}

.irm-hd__d-gr {
	font-size: 10px;
	line-height: 1.1;
	color: #9ca3af;
}

.irm-hd__day:hover {
	background: #faf3e2;
}

.irm-hd__day.is-shabbat .irm-hd__d-he {
	color: #8a6a1d;
}

/* ראש חודש — סימון עדין, בלי להתחרות בבחירה */
.irm-hd__day.is-rosh::after {
	content: '';
	display: block;
	width: 4px;
	height: 4px;
	margin-top: 1px;
	border-radius: 50%;
	background: #e8c676;
}

.irm-hd__day.is-today {
	border-color: #e8c676;
}

.irm-hd__day.is-focus {
	border-color: #b08828;
}

.irm-hd__day.is-picked,
.irm-hd__day.is-picked:hover {
	background: #e8c676;
	border-color: #d3ac5c;
}

.irm-hd__day.is-picked .irm-hd__d-he {
	color: #111827;
}

.irm-hd__day.is-picked .irm-hd__d-gr {
	color: #6b5620;
}

.irm-hd__day.is-picked.is-rosh::after {
	background: #6b5620;
}

.irm-hd__day:focus-visible {
	outline: 2px solid #b08828;
	outline-offset: 1px;
}

/* --- תחתית --- */

.irm-hd__foot {
	display: flex;
	gap: 8px;
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid #f3f4f6;
}

.irm-hd__foot-btn {
	flex: 1 1 0;
	padding: 8px 0;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	color: #4b5563;
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 9px;
	cursor: pointer;
	transition: background-color .15s, color .15s;
}

.irm-hd__foot-btn:hover,
.irm-hd__foot-btn:focus-visible {
	color: #111827;
	background: #f3f4f6;
	outline: none;
}

/* --- מובייל: גיליון קופץ במרכז המסך --- */

@media ( max-width: 600px ) {

	.irm-hd-backdrop {
		background: rgba( 17, 24, 39, .45 );
	}

	body.irm-hd-open {
		overflow: hidden;
	}

	/*
	 * כפתור הנגישות של אלמנטור יושב ב-shadow DOM על z-index 2147483645
	 * (המקסימום), ובמובייל הוא נופל בדיוק על אמצע הלוח. אי אפשר לעקוף
	 * אותו בערימה, ולכן מסתירים אותו לזמן שהלוח פתוח — התנהגות רגילה
	 * של מודאל, והוא חוזר ברגע שסוגרים.
	 */
	body.irm-hd-open #ea11y-root,
	body.irm-hd-open .joinchat {
		visibility: hidden;
	}

	.irm-hd.is-sheet {
		top: 50%;
		left: 50%;
		width: 340px;
		max-width: calc( 100vw - 24px );
		padding: 16px;
		transform: translate( -50%, -50% );
		border-radius: 18px;
	}

	.irm-hd.is-sheet .irm-hd__day {
		min-height: 46px;
	}

	.irm-hd.is-sheet .irm-hd__nav {
		width: 34px;
		height: 34px;
	}

	.irm-hd.is-sheet .irm-hd__foot-btn {
		padding: 11px 0;
	}
}

/* העמוד האנגלי (16.9.2026): הכלל הבסיסי קובע direction: rtl בכוח, ולכן
   dir="ltr" שה-JS שם על הפאנל לא הספיק לבדו. */
.irm-hd[dir="ltr"] {
	direction: ltr;
	text-align: left;
}
