/**
 * Shared High-Contrast Accessibility Overrides
 * Loaded by all Pflanzenschützer child themes (ernesto-pf, ernesto-pfs, ernesto-pfsr).
 *
 * The parent theme's accessibility.css handles generic elements and sets
 * body.high-contrast token overrides (--color-primary: #0000ff, --bg-surface:
 * #fef8e3, etc.). This file fills the gaps that are common across all child
 * themes: missing token overrides and the hero-slider treatment.
 *
 * High contrast is OPT-IN via the accessibility toolbar only (body.high-contrast).
 * We intentionally do NOT mirror these rules under @media (prefers-contrast: high):
 * auto-applying the high-contrast palette/layout from the OS "Increase contrast"
 * preference forced every such visitor into accessibility mode, which is not the
 * desired default. Windows forced-colors mode is still respected (section 3).
 *
 * Theme-specific classes (hp-*, pfsr-*, etc.) are handled in each
 * child theme's own child.css.
 */


/* ── 1. Missing token overrides ──────────────────────────────────────────── */
/*
 * The parent accessibility.css does not override --color-secondary.
 * All child themes use it for pill/badge backgrounds. Set it to the
 * high-contrast navy so any var(--color-secondary) usage becomes legible.
 * --ps-accent aliases --color-primary (already #0000ff in HC), so it
 * cascades correctly for ernesto-pf; the declaration here is a safety net.
 */
body.high-contrast {
	--color-secondary: #000066;
	--ps-accent:       #0000ff;   /* already resolves via --color-primary; belt-and-braces */
}


/* ── 2. Hero slider — high contrast ───────────────────────────────────────── */
/*
 * The slider KEEPS WORKING as a slider — sliding, arrows, dots and autoplay
 * are all preserved. Only the per-slide text overlay is restyled: instead of
 * large hero text sitting directly on the image (which is illegible without a
 * heavy gradient), the content becomes a compact, opaque "card" panel that
 * mirrors .ernesto-card content from tiles.css — cream surface, navy heading
 * and lead, blue CTA. This guarantees AA contrast over any background image
 * without changing the slider's behaviour.
 */

/* Drop the darkening/lightening gradient — the opaque panel carries the contrast */
body.high-contrast .ernesto-hero-slider .slide-image::after,
body.high-contrast .ernesto-hero-slider .slide-text-light .slide-image::after,
body.high-contrast .ernesto-hero-slider .slide-text-dark  .slide-image::after {
	display: none !important;
}

/* Content overlay → opaque card panel (matches .ernesto-card__body) */
body.high-contrast .ernesto-hero-slider .slide-content {
	max-width:     min(46ch, 90%)    !important;
	margin:        0 auto            !important;
	padding:       1.25rem 1.5rem    !important;
	background:    #fef8e3           !important;  /* --bg-surface in HC */
	color:         #000066           !important;
	border:        2px solid #000066 !important;
	border-radius: 6px               !important;
	text-align:    left              !important;
	text-shadow:   none              !important;
}

/* Title → .ernesto-card__title look (navy, compact, no hero shadow) */
body.high-contrast .ernesto-hero-slider .slide-title,
body.high-contrast .ernesto-hero-slider .slide-text-light .slide-title,
body.high-contrast .ernesto-hero-slider .slide-text-dark  .slide-title {
	font-family:    var(--font-heading, inherit) !important;
	font-size:      clamp(1rem, 1.6vw, 1.25rem)  !important;  /* --ernesto-tile-title */
	font-weight:    700                          !important;
	line-height:    1.35                         !important;
	letter-spacing: -0.01em                      !important;
	color:          #000066                      !important;
	text-shadow:    none                         !important;
	margin:         0 0 0.4rem                   !important;
}

/* Description → .ernesto-card__lead look */
body.high-contrast .ernesto-hero-slider .slide-description,
body.high-contrast .ernesto-hero-slider .slide-text-light .slide-description,
body.high-contrast .ernesto-hero-slider .slide-text-dark  .slide-description {
	font-size:    1rem        !important;
	line-height:  1.5         !important;
	color:        #000066     !important;
	text-shadow:  none        !important;
	max-width:    none        !important;
	margin:       0 0 0.75rem !important;
}

/* CTA button — solid blue, white bold text (matches HC button spec) */
body.high-contrast .ernesto-hero-slider .slide-button,
body.high-contrast .ernesto-hero-slider .slide-button.button {
	display:          inline-block      !important;
	background-color: #0000ff           !important;
	color:            #ffffff           !important;
	border:           2px solid #0000ff !important;
	border-radius:    0                 !important;
	text-shadow:      none              !important;
}

body.high-contrast .ernesto-hero-slider .slide-button:hover,
body.high-contrast .ernesto-hero-slider .slide-button.button:hover {
	background-color: #0000cc !important;
	border-color:     #0000cc !important;
}


/* ── 3. Forced-colors (Windows High Contrast Mode) ───────────────────────── */
/*
 * Windows WHCM replaces all colours with system keywords.
 * Ensure interactive elements use the correct system colours so they remain
 * distinguishable; the browser handles most things automatically.
 */
@media (forced-colors: active) {
	.ernesto-hero-slider .slide-button,
	.ernesto-hero-slider .slide-button.button {
		forced-color-adjust: none;
		background-color:    ButtonFace;
		color:               ButtonText;
		border:              2px solid ButtonText;
	}

	.ernesto-hero-slider .slider-arrow {
		forced-color-adjust: none;
		background:          ButtonFace;
		color:               ButtonText;
		border:              1px solid ButtonText;
	}
}
