/* Lactalis Canada accessibility fixes (WCAG 2.1 AA). Seventyeight Digital, 2026-11.
   Loaded after the theme CSS. Mouse users see no change except the items marked VISIBLE (agreed with the client). */

/* Visible keyboard focus everywhere (2.4.7). Dark ring with a white halo shows on light and mid backgrounds;
   inverted on the dark blue header, menus and footer. :focus-visible only, so mouse clicks look as before. */
:focus-visible {
	outline: 3px solid #0a0a0a !important;
	outline-offset: 2px !important;
	box-shadow: 0 0 0 2px #fff !important;
}
#header :focus-visible,
.dropdown-menu :focus-visible,
#footer :focus-visible,
#searchModal :focus-visible,
.lcm-overlay :focus-visible {
	outline-color: #fff !important;
	box-shadow: 0 0 0 2px #0a0a0a !important;
}

/* Skip link: shown above the fixed header when focused (2.4.1, 2.4.7). */
.visually-hidden-focusable:focus,
.visually-hidden-focusable:focus-within {
	position: fixed !important;
	top: 8px;
	left: 8px;
	z-index: 100000;
	width: auto !important;
	height: auto !important;
	clip: auto !important;
	overflow: visible;
	margin: 0 !important;
	padding: 10px 16px !important;
	background: #fff;
	color: #0a0a0a;
	font-weight: 700;
	text-decoration: underline;
}
main:focus {
	outline: none;
}

/* A <button> that looks like the text or icon it replaced. */
.lactalis-plain-button {
	background: none;
	border: 0;
	padding: 0;
	color: inherit;
	cursor: pointer;
}

/* Careers recruitment warning: the close button only as wide as its "x" (44px minimum), so the focus ring hugs it,
   in the top right corner of the panel (the panel is a flex column, so the theme's float: right had no effect).
   It stays in the flow above the heading, so it never covers the title. VISIBLE (operator request 2026-11-30). */
#recruitmentModal button.close {
	width: max-content;
	min-width: 44px;
	min-height: 44px;
	align-self: flex-end;
	justify-content: center;
	align-items: center;
	margin: -20px -20px 0 0;
}

/* Bootstrap video popups (From Your Story to Ours, DEI, ESG): the close "x" sat level with the middle of the title, so
   on phones, where long titles wrap to 3-4 lines, it dropped 40-80px down the side, and the title squeezed it to
   22-27px wide. Now level with the title's first line (top right corner) and 44px square, the "x" itself the same
   size and in the same place across. Desktop (one-line titles) looks the same. VISIBLE on phones (operator 2026-11-30). */
.modal-header .btn-close {
	box-sizing: border-box;
	width: 44px;
	height: 44px;
	padding: 0;
	flex-shrink: 0;
	align-self: flex-start;
	margin: -1px -12px -1px auto;
}

/* Mobile menu search box (below 992px): the link's 1rem side padding left less room than the magnifying glass inside
   the 52px box, so the icon sat 4px right of centre (English; French had no padding and was centred). Centred in both.
   Cosmetic, not an accessibility fix. VISIBLE (operator request 2026-11-30). */
@media (max-width: 991.98px) {
	.search-nav-item #btnShowSearch {
		padding-left: 0;
		padding-right: 0;
		text-align: center;
	}
}

/* Pause/play buttons for autoplaying videos (2.2.2). 44px target. VISIBLE (decision D1). */
.lactalis-video-wrap {
	position: relative;
}
.lactalis-toggle,
.ratio > .lactalis-toggle {
	position: absolute;
	top: auto;
	left: auto;
	right: 16px;
	bottom: 16px;
	z-index: 5;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 2px solid #fff;
	background: rgba(10, 10, 10, 0.7);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	cursor: pointer;
}
.lactalis-toggle[hidden] {
	display: none;
}
.lactalis-toggle:hover {
	background: rgba(10, 10, 10, 0.9);
}
.lactalis-toggle svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

/* Contrast (1.4.3). VISIBLE (decision D2): the smallest darker shade of the same colour that passes. */
.NewsDate,
.storyDate {
	color: #737373; /* was #a1a2a3 (2.56:1), now 4.7:1 on white */
}
h2#Enrich {
	color: #2590cc; /* was #2a9ddf (2.71:1), now 3.2:1 on #f3f3f4 (large text) */
}
#lcmOverlay .lcm-btn {
	background: #0077a8; /* was #00adef (2.55:1); 5.0:1. Its text shrinks to 15px on phones, so it needs 4.5:1 there */
}
#lcmOverlay .lcm-btn:hover,
#lcmOverlay .lcm-btn:focus {
	background: #006b97;
}
.positionblock.posSalaried {
	background-color: #5b93d8; /* was #68a6f1 (2.53:1), now 3.1:1 with the white title */
}
/* Careers job tiles on narrow screens: the white title ran over the photo of the people (down to 1.5:1). The tile
   now grows so the title sits above the photo (250px tall, anchored at the bottom). VISIBLE: taller tiles below
   768px. */
@media (max-width: 767.98px) {
	.positionblock.posSalaried,
	.positionblock.posStudent {
		height: auto !important;
		min-height: 300px;
		padding-top: 24px;
		padding-bottom: 262px;
		justify-content: flex-start !important;
	}
}

/* White menu over banner photos and videos (1.4.3). VISIBLE (decision D4, extended by the operator on 2026-11-27 to
   meet contrast on every page): while the header is transparent (desktop widths, before scrolling), a 60% dark shade
   sits behind the menu and fades out below it. Measured over every banner and 12 frames of each video: 5.7:1 or
   better without the text shadow. Not on templates whose header is already solid blue (search, 404, press releases,
   no-banner pages). Below 992px (English) and 1200px (French) the theme's header is solid blue already. */
@media (min-width: 1200px) {
	body:not(.search):not(.error404):not(.single-press-release):not(.page-template-page-nosidebar-nobanner-php) nav#header:not(.scrolled) {
		background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.6) 70%, rgba(0, 0, 0, 0) 100%);
	}
}
@media (min-width: 992px) and (max-width: 1199px) {
	html[lang="en-CA"] body:not(.search):not(.error404):not(.single-press-release):not(.page-template-page-nosidebar-nobanner-php) nav#header:not(.scrolled) {
		background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.6) 70%, rgba(0, 0, 0, 0) 100%);
	}
}

/* Brand and award pages, and stories without a banner photo, have no banner at all: the white menu and logo were on a
   white page (1:1) and the page title sat under the header. Solid blue header, as on press releases, and room for
   it above the content (1.4.3). VISIBLE. */
body.single-brand nav#header,
body.single-award nav#header,
body.single-story:has(.story-banner[src=""]) nav#header {
	background-color: #153b84;
	background-image: none !important;
}
body.single-brand #main,
body.single-award #main,
body.single-story:has(.story-banner[src=""]) #main {
	padding-top: 110px;
}
@media (max-width: 991.98px) {
	body.single-brand #main,
	body.single-award #main,
	body.single-story:has(.story-banner[src=""]) #main {
		padding-top: 80px;
	}
}
/* Stories without a banner photo: the empty banner image kept 65% of the screen height blank above the title on
   phones, and on desktop the content panel's overlap (-100px) put the category label under the header. No image,
   no overlap. VISIBLE (operator request 2026-11-28). */
.story-banner[src=""] {
	display: none;
}
body.single-story:has(.story-banner[src=""]) .content-overlay-banner {
	margin-top: 0;
}

/* White page titles over bright banner photos and the Careers video (1.4.3): the theme's 1px text shadow made a little
   larger and softer so the letters keep a dark edge on bright areas. Only on the templates where the title measured
   below 3:1. (Replaced the 75% brand-blue backing, operator request 2026-11-30.) VISIBLE. */
.page-template-page-our-brands-php #banner-title,
.page-template-page-consumer-brands-php #banner-title,
.page-template-page-our-commitment-impact-php #banner-title,
.page-template-page-esg-php #banner-title,
.page-template-page-our-community-php #banner-title,
.page-template-page-section-panels-php #banner-title,
.page-template-page-careers-php #banner-title {
	text-shadow: 2px 2px 3px #000;
}

/* Careers intro heading on narrow screens: the long (French) heading wraps onto the product photo below it (1.6:1).
   White backing at 85%: 7.7:1 or better over any photo. VISIBLE below 768px. */
@media (max-width: 767.98px) {
	.page-template-page-careers-php #homeSectionTwo h2 {
		background-color: rgba(255, 255, 255, 0.85);
		border-radius: 6px;
		padding: 0.15em 0.3em !important;
	}
}

/* Under 375px: white words that are wider than their dark backing run onto white (1.1:1) or off the screen (1.4.10).
   Milk-drop value headings (About Us, Careers: "COMMITMENT", "ENGAGEMENT") and the half-width panel lists (Fast facts:
   "consommation", "Tablespreads"). Slightly smaller text (still large text) and a smaller list indent. VISIBLE < 375px. */
@media (max-width: 374.98px) {
	.milk-drop-caption + .position-absolute h3 {
		font-size: 28px;
	}
	.halfWidthItem .SectionContent > ul {
		padding-left: 40px;
	}
	.halfWidthItem .SectionContent > ul > li {
		font-size: 28px;
	}
}

/* Reflow (1.4.10): on narrow screens (and at 400% zoom) long single words in large headings, buttons and text ran past
   the screen edge or off their backing, mostly French ("consommateurs", "Approvisionnement", "développement"), the
   "Accessibility" title, e-mail addresses and web addresses. lactalis-a11y.js (fitText) lowers the size of such large
   text just enough to fit (not below 24px); a word breaks only when it still cannot fit (.lactalis-break). Text that
   fits is unchanged. Banner titles are kept within the screen. VISIBLE below 576px, only where a word did not fit. */
@media (max-width: 575.98px) {
	#main .lactalis-break {
		overflow-wrap: anywhere;
	}
	#banner-title {
		max-width: calc(100% - 24px);
		margin-left: auto;
		margin-right: auto;
	}
}

/* Brand flip cards also turn over for keyboard users (2.1.1), as they do on mouse hover. */
.card.flipcard:focus-within .flipfacecontainer {
	transform: rotateY(180deg);
}

/* Sideways-scrolling "Our functions" row: visible focus when it is a keyboard stop (2.1.1). */
#OurFunctions[tabindex="0"]:focus-visible {
	outline-offset: -3px !important;
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		scroll-behavior: auto !important;
	}
}
