/**
 * Accessibility overrides – fixes from the accessibility audit (WCAG 2.0 AA / IS 5568).
 * Loaded last (see inc/assets/enqueue.php). Every contrast value below was checked
 * against its background (ratio noted in the comment, minimum required: 4.5:1).
 */

/* ── Generic helpers ───────────────────────────────────────────────── */
.form-required-note {
	font-size: 15px;
	line-height: 1.4;
	margin: 0 0 14px 0;
	color: #373636;
}

/* ── 1.4.3 Contrast: links ─────────────────────────────────────────── */
/* Global link colour #EB078C = 4.25:1 → #B0006A = 6.88:1 on white, 6.53:1 on #FBF9F2 */
a {
	color: #B0006A;
}
.brand-pink {
	color: #B0006A; /* was #e91e63 (4.35:1) */
}

/* ── 1.4.3 Contrast: buttons ───────────────────────────────────────── */
/* Hero primary button: #4a4a4a on #e6a88b = 4.36:1 → black = 10.34:1 */
.app-hero .app-btn--primary {
	color: #000;
}
/* Generic primary button: white on #efa891 = 1.97:1 → #373636 ≈ 6:1 */
.app-btn--primary {
	color: #373636;
}
/* Outline button: #efa891 text on white = 1.97:1 → #B8321E = 5.98:1 */
.app-btn--outline {
	color: #B8321E;
	border-color: #B8321E;
}

/* ── 1.4.3 Contrast: press / article cards ─────────────────────────── */
/* Orange date #EA442E = 3.91:1 → #B8321E = 5.98:1 (white) / 5.67:1 (#FBF9F2) */
.app-press-card__date {
	color: #B8321E;
}
.app-club-thankyou--error .app-club-thankyou__title {
	color: #B8321E;
}

/* ── 1.4.3 Contrast: pagination (light teal #84c2bc / #75bab7 ≈ 2:1) ─ */
/* → #245E5A = 7.4:1 on white, 6.0:1 on #F0E5D8; the current page is also underlined   */
.app-pagination__item.active,
.app-articles-pagination__btn.is-active {
	color: #245E5A;
	text-decoration: underline;
	text-underline-offset: 4px;
}
.app-pagination__item--active {
	border-bottom-color: #245E5A;
}

/* ── 1.4.3 Contrast: library game tabs (#aaa = 2.32:1 → #595959 = 7:1) */
.app-games__tabs-group .tabs-btn {
	color: #595959;
}
.app-games__tabs-group .tabs-list li.active .tabs-btn {
	color: #373636;
}

/* ── 1.4.3 Contrast: form error messages ───────────────────────────── */
/* red on #E9A288 (orange forms) = 1.9:1 → #7A0000 = 5.47:1; on white ≈ 13:1 */
.label-error,
.wpcf7-not-valid-tip,
input.error,
textarea.error,
select.error,
input[type="checkbox"].error ~ span {
	color: #7A0000 !important;
}
input.error,
textarea.error,
select.error {
	border-bottom-color: #7A0000 !important;
}
.delete-file {
	color: #B91C1C; /* was #ef4444 (3.76:1) */
}

/* ── Hover states (desktop only, matching responsive.css breakpoints) ─ */
@media (min-width: 992px) {
	.app-press-card:hover .app-press-card__link {
		color: #B8321E; /* "קרא עוד" hover: #EA442E 3.91:1 → 5.98:1 */
	}
	.app-icon-btn:hover {
		color: #B8321E;
	}
	.app-articles-pagination__btn:hover,
	.app-articles-pagination__btn:focus-visible,
	.app-pagination__item a:hover,
	.app-pagination__prev:hover,
	.app-pagination__next:hover {
		color: #245E5A;
	}
}
@media (min-width: 1441px) {
	/* Top menu hover: #efa891 on white = 1.97:1 → #B8321E = 5.98:1 */
	.app-header__nav-link:hover,
	.app-header__nav-item:hover .app-header__nav-link,
	.app-header__nav-item.is-keyboard-open .app-header__nav-link,
	.app-header__mega-link:hover,
	.app-header__mega-link--main:hover {
		color: #B8321E;
	}
}

/* ── 2.4.7 Focus visible ───────────────────────────────────────────── */
.weight-slider:focus-visible {
	outline: 3px solid #000;
	outline-offset: 8px;
	border-radius: 4px;
}
.weight-slider:focus-visible::-webkit-slider-thumb {
	box-shadow: 0 0 0 3px #fff, 0 0 0 6px #000;
}
.weight-slider:focus-visible::-moz-range-thumb {
	box-shadow: 0 0 0 3px #fff, 0 0 0 6px #000;
}
.app-header__nav-link:focus-visible,
.app-header__mega-link:focus-visible,
.app-memory__card:focus-visible,
.app-ttt__cell:focus-visible,
.app-flipbook-card__inner:focus-visible,
.child-date-part:focus-visible,
.search-page-item__link:focus-visible {
	outline: 3px solid #000;
	outline-offset: 2px;
}

/* ── Elements whose tag changed for semantic reasons ───────────────── */
.app-flipbook-card__title {
	display: block;
}
.app-flipbook-card__btn {
	display: flex;
}
.app-contact-subtitle {
	font-weight: 400;
}
.fb-modal__title {
	margin: 0;
}
.fb-modal__pdf-link:focus {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 5;
	background: #fff;
	color: #373636;
	padding: 6px 12px;
	border: 2px solid #000;
	border-radius: 20px;
}

/* ── Children modal: accessible date of birth (replaces input[type=date]) */
.child-row__inputs {
	flex-wrap: wrap;
	gap: 20px 30px;
}
.child-row__group.child-date-group {
	flex: 1 1 100%;
	border: 0;
	padding: 0;
	margin: 0;
	min-width: 0;
}
.child-date-legend {
	font-size: 16px;
	padding: 0;
	margin: 0 0 6px 0;
}
.child-date-selects {
	display: flex;
	gap: 10px;
}
.child-date-part {
	flex: 1;
	min-width: 0;
	height: 37px;
	background: transparent;
	border: none;
	border-bottom: 1px solid #373636;
	font-size: 16px;
	color: #373636;
	padding: 0 2px;
}
.child-row__gender {
	border: 0;
	padding: 0;
	margin: 0;
	min-width: 0;
}

/* ── Search: static pages results (2.4.5) ──────────────────────────── */
.search-pages-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 18px;
}
.search-page-item__link {
	font-size: 20px;
	font-weight: 600;
	color: #373636;
	text-decoration: underline;
}
.search-page-item__desc {
	margin: 4px 0 0 0;
	font-size: 16px;
	line-height: 1.4;
}

/* ── Reduced motion ────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ── Children modal: inline errors (replaces the y-validate labels that broke the row) */
.child-field-error {
	display: block;
	width: 100%;
	color: #7A0000;
	font-size: 14px;
	line-height: 1.3;
	margin: 6px 0 0 0;
	text-align: right;
}
.child-field-error[hidden] {
	display: none;
}
.child-row__group input.is-invalid,
.child-date-part.is-invalid {
	border-bottom-color: #7A0000;
	color: #7A0000;
}
.child-date-selects {
	flex-wrap: nowrap;
	width: 100%;
}
.child-date-part {
	flex: 1 1 0;
	width: 100%;
	cursor: pointer;
	-webkit-appearance: menulist;
	appearance: auto;
}

/* ── tiptipotAlert – on-brand dialog that replaces window.alert() ───── */
.tt-alert-overlay {
	position: fixed;
	inset: 0;
	z-index: 1000000; /* above yBox, so an open modal keeps its data */
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(55, 54, 54, 0.55);
	opacity: 0;
	transition: opacity 0.2s ease;
}
.tt-alert-overlay.is-open {
	opacity: 1;
}
.tt-alert {
	position: relative;
	width: 100%;
	max-width: 360px;
	background: #F0E5D8;
	border-radius: 50px;
	padding: 60px 35px 35px;
	text-align: center;
	color: #373636;
	font-family: "Ploni", sans-serif;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
	transform: translateY(10px);
	transition: transform 0.2s ease;
}
.tt-alert-overlay.is-open .tt-alert {
	transform: translateY(0);
}
.tt-alert__close {
	position: absolute;
	top: 28px;
	left: 30px;
	width: 32px;
	height: 32px;
	background: none;
	border: none;
	padding: 0;
	font-size: 34px;
	line-height: 1;
	color: #373636;
	cursor: pointer;
}
.tt-alert__title {
	margin: 0 0 12px 0;
}
.tt-alert--error .tt-alert__title {
	color: #B8321E; /* 4.81:1 on #F0E5D8 */
}
.tt-alert__text {
	margin: 0 0 25px 0;
}
.tt-alert__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 160px;
	height: 40px;
	padding: 4px 30px 0;
	border: none;
	border-radius: 40px 0 40px 40px;
	background-color: #E5AB95; /* #373636 text = 6.07:1 */
	color: #373636;
	font-size: 18px;
	font-weight: 500;
	font-family: inherit;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}
.tt-alert__btn:hover {
	background-color: #373636;
	color: #fff;
}
.tt-alert__btn:focus-visible,
.tt-alert__close:focus-visible {
	outline: 3px solid #000;
	outline-offset: 3px;
}
