/* Browser zoom and WCAG reflow hardening. No viewport zoom restrictions or visual scaling. */
html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body,
main,
header,
footer,
.wrap { max-width: 100%; }

main,
footer,
.edvx-home-hero,
.edvx-gateway,
.edvx-home-profile,
.edvx-home-how,
.edvx-home-why,
.edvx-home-final,
.edvx-mvp,
.edvx-employers,
.edv-account,
.edv-quiz { overflow-wrap: break-word; }

img,
svg,
video,
canvas,
iframe {
	max-width: 100%;
	height: auto;
}

/* Preserve both intrinsic logo SVG ratios when the theme switches to its compact header. */
.logo-wrapper a { min-width: 0; }
.logo-wrapper a img {
	flex: 0 0 auto;
	height: auto;
	object-fit: contain;
}
.logo-wrapper a img + img { align-self: flex-start; }

.container,
.container-fluid,
.row,
[class*="col-"] { min-width: 0; }

h1, h2, h3, h4, h5, h6,
p, li, label, legend, summary,
a, button, input, select, textarea,
th, td { overflow-wrap: break-word; }

.btn,
button,
input,
select,
textarea { max-width: 100%; }

.btn {
	height: auto;
	min-height: 44px;
	padding-block: .8rem;
	line-height: 1.25;
	white-space: normal;
	text-align: center;
}

/* Remove equal-height assumptions from text-bearing cards and panels. */
.edvx-gateway__card,
.edvx-gateway__card span,
.edvx-journey-grid li,
.edvx-service-card h3,
.edvx-service-card > p:not(.edvx-price),
.edvx-service-card > small,
.edvx-offer-card,
.edvx-b2b--university .edvx-offer-card,
.edvx-sector-grid > div,
.edvx-route-join-talent .edvx-mvp__hero,
.edvx-route-for-students .edvx-mvp__hero,
.edvx-b2b--employer .edvx-employers__hero,
.edvx-b2b--university .edvx-employers__hero {
	min-height: 0;
}

.edvx-gateway__grid,
.edvx-home-why__grid,
.edvx-home-solutions__grid,
.edvx-home-how ol,
.edvx-journey-grid,
.edvx-route-grid,
.edvx-sector-grid,
.edvx-form-grid,
.edvx-check-grid,
.edv-pair,
.edv-choices,
.edv-filter-grid { min-width: 0; }

.edvx-gateway__grid > *,
.edvx-home-why__grid > *,
.edvx-home-how li,
.edvx-journey-grid > *,
.edvx-route-grid > *,
.edvx-sector-grid > *,
.edvx-form-grid > *,
.edvx-check-grid > *,
.edv-pair > *,
.edv-choices > *,
.edv-filter-grid > * { min-width: 0; }

/* Academic Matching and account surfaces. */
.edv-quiz,
.edv-account,
.edv-modal__dialog,
.edv-modal__body,
.edv-result-tabs,
.edv-filters,
.edv-filter-grid { max-width: 100%; }

.edv-quiz :is(input, select, textarea),
.edv-account :is(input, select, textarea) { max-width: 100%; }

/* The legacy result card combines a fixed visual column with width:100% content. */
.edv-quiz .result { min-width: 0; }
.edv-quiz .result--content {
	flex: 1 1 auto;
	width: auto;
	min-width: 0;
}

/* Keep long institution names out of the logged-in favourite control. */
.edv-quiz .result--content > h3:first-of-type { padding-inline-end: 2.75rem; }

.edv-facts-list li,
.edv-list li,
.edv-modal__head,
.edv-modal__foot { flex-wrap: wrap; }

.edv-facts-list li span { flex: 1 1 7rem; }
.edv-result-tabs { overscroll-behavior-inline: contain; }
.edv-result-tabs .nav-link { min-height: 44px; }
.edv-bac { table-layout: fixed; }
.edv-bac th,
.edv-bac td { min-width: 0; overflow-wrap: anywhere; }
.edv-bac input { max-width: 100%; }
.edv-modal__body { overscroll-behavior: contain; }

/* WordPress/Edviatec administration reflow. */
.wp-admin .wrap,
.wp-admin .form-table,
.wp-admin .widefat,
.wp-admin .edv-columns,
.wp-admin .edv-lang,
.wp-admin .edv-cards { max-width: 100%; }

.wp-admin .form-table input:not([type="checkbox"]):not([type="radio"]),
.wp-admin .form-table select,
.wp-admin .form-table textarea { max-width: 100%; }

.wp-admin .widefat { table-layout: auto; }
.wp-admin .widefat th,
.wp-admin .widefat td {
	overflow-wrap: normal;
	word-break: normal;
}
.wp-admin .edv-actions { white-space: normal; }

/* Zoom reduces the effective CSS viewport, so switch composition before content collides. */
@media (max-width: 1199px) {
	header { position: relative; }
	header > .container > .d-flex {
		align-items: flex-start;
		gap: .75rem;
		min-width: 0;
	}
	header .logo-wrapper {
		flex: 0 1 230px;
		min-width: 0;
		max-width: calc(100% - 56px);
	}
	header .logo-wrapper a {
		align-items: flex-start;
		width: 100%;
		max-width: 230px;
	}
	header .logo-wrapper a img {
		flex: 0 1 auto;
		width: auto;
		max-width: 66px;
		max-height: 48px;
	}
	header .logo-wrapper a img + img {
		width: auto;
		max-width: 104px;
		margin-left: clamp(1rem, 4vw, 2.5rem);
	}
	#menu-toggle { flex: 0 0 44px; }
	.menu-wrapper { overflow-y: auto; overscroll-behavior: contain; }
	.menu-wrapper ul:not(.dropdown-menu) a { height: auto; line-height: 1.35; padding-block: .8rem; }
	.menu-wrapper > .dropdown,
	.menu-wrapper > .btn { max-width: 100%; }
	.edvx-hero-actions,
	.edvx-home-hero__actions,
	.edvx-form-footer { flex-wrap: wrap; }
	.btn + a,
	.language-fr .btn + a { margin-left: 0; }
}

@media (max-width: 767px) {
	.container,
	.container-fluid { padding-inline: max(.75rem, env(safe-area-inset-left)); }
	.edvx-gateway__grid,
	.edvx-home-why__grid,
	.edvx-home-solutions__grid,
	.edvx-home-how ol,
	.edvx-journey-grid,
	.edvx-route-grid,
	.edvx-sector-grid,
	.edvx-form-grid,
	.edvx-check-grid,
	.edv-pair,
	.edv-choices,
	.edv-filter-grid { grid-template-columns: minmax(0, 1fr); }
	.edvx-hero-actions,
	.edvx-home-hero__actions,
	.edvx-form-footer,
	.edv-nav { align-items: stretch; flex-direction: column; }
	.edvx-hero-actions > *,
	.edvx-home-hero__actions > *,
	.edvx-form-footer > *,
	.edv-nav > * { width: 100%; margin-inline: 0 !important; }
	.edvx-hero-panel,
	.edvx-summary-card,
	.edvx-profile-form,
	.edvx-employer-form,
	.edvx-form-message { width: 100%; }
	.edv-grade .average-grade-input,
	.edv-opt-group,
	.edv-toggle { max-width: 100%; flex-wrap: wrap; }
	.edv-bac { display: block; overflow-x: auto; table-layout: auto; }
	.edv-quiz .result--image {
		flex: 0 0 auto;
		min-width: 4.5rem;
		padding-right: 1rem;
	}
	.edv-modal { align-items: stretch; padding: .5rem; }
	.edv-modal__dialog,
	.edv-modal__dialog form { max-height: calc(100vh - 1rem); }
	.wp-admin .edv-columns,
	.wp-admin .edv-lang,
	.wp-admin .edv-cards { grid-template-columns: minmax(0, 1fr); }
	.wp-admin .widefat {
		display: block;
		overflow-x: auto;
		overscroll-behavior-inline: contain;
		-webkit-overflow-scrolling: touch;
	}
}

/* The compact (menu-button) header is used up to 1199px, but the theme only gives it compact spacing up to
   768px. Without this, 769-1199px (phone landscape, "Request Desktop Website", tablets) keeps the desktop
   40px top padding and no bottom padding, so the logo sits on the next section. Same values as the theme. */
@media (min-width: 769px) and (max-width: 1199px) {
	header { padding-top: 35px; padding-bottom: 20px; }
}

@media (max-width: 430px) {
	header { padding-top: 20px; padding-bottom: 16px; }
	header .logo-wrapper a img { max-width: 58px; max-height: 42px; }
	header .logo-wrapper a img + img { max-width: 96px; margin-left: 1rem; }
	.edvx-mvp__hero h1,
	.edvx-employers h1,
	.edvx-home-hero h1 { font-size: clamp(2rem, 12vw, 3rem); line-height: 1.04; }
	.edvx-profile-form,
	.edvx-employer-form,
	.edvx-form-message,
	.edvx-offer-card,
	.edvx-service-card { padding-inline: 1rem; }
	.edv-modal__head,
	.edv-modal__body,
	.edv-modal__foot { padding-inline: .75rem; }
}

@media (max-width: 375px) {
	.logo-wrapper a img + img {
		max-width: 5.5rem;
		margin-left: .875rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.edv-result-tabs { scroll-behavior: auto; }
}

/* Visual audit 17 Nov 2026 -------------------------------------------------------------------------- */
/* Package titles: long French words ("Accompagnement") broke mid-word in narrow cards (320px, 992-1024px).
   Cap the size relative to the card width; wide cards keep their current 35px/38px. */
.edvx-service-card { container-type: inline-size; }
.edvx-service-card h3 { -webkit-hyphens: manual; hyphens: manual; }
@supports (font-size: 1cqi) {
	.edvx-service-card h3 { font-size: min(35px, 11.5cqi); }
}
@media (min-width: 992px) {
	@supports (font-size: 1cqi) {
		.edvx-service-card h3 { font-size: min(38px, 11.5cqi); }
	}
}

/* Footer links: a wrapped label inherited the 40px line height per line. Same 40px rhythm for one-line
   links (21.6px + 2 x 9px); wrapped labels now read as one item. */
footer .menu li { line-height: 1.35; padding-block: 9px; }

/* Menu button: 641-768px kept the theme's 26 x 26px hit area. Same 44 x 44px area as the other compact
   widths; the drawn icon keeps its position and size. */
@media (min-width: 641px) and (max-width: 768px) {
	#menu-toggle { width: 44px; height: 44px; margin-right: -9px; padding: 9px; }
	#menu-toggle span { left: 9px; width: 26px; }
}
