/**
 * Base: reset, document defaults, typography, focus, accessibility utilities.
 *
 * @package LCA
 */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--lca-sand);
	color: var(--lca-ink);
	font-family: var(--lca-font-sans);
	font-size: var(--lca-fs-base);
	line-height: var(--lca-lh-body);
	-webkit-font-smoothing: antialiased;
}

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

input,
button,
textarea,
select {
	font: inherit;
	color: inherit;
}

/* ---- Headings ---- */

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 0.5em;
	color: var(--lca-ink);
	text-wrap: balance;
}

h1,
h2,
h3 {
	font-family: var(--lca-font-serif);
	font-weight: 600;
}

h1 {
	font-size: var(--lca-fs-h1);
	line-height: var(--lca-lh-tight);
}

h2 {
	font-size: var(--lca-fs-h2);
	line-height: 1.18;
}

h3 {
	font-size: var(--lca-fs-h3);
	line-height: 1.25;
}

h4 {
	font-family: var(--lca-font-sans);
	font-size: var(--lca-fs-h4);
	font-weight: 700;
	line-height: 1.35;
}

p {
	margin: 0 0 1em;
	color: var(--lca-body);
	text-wrap: pretty;
}

p:last-child {
	margin-bottom: 0;
}

/* ---- Links ---- */

a {
	color: var(--lca-navy);
	text-decoration: none;
	transition: color var(--lca-transition);
}

a:hover {
	color: var(--lca-terracotta);
}

/* Links inside running text keep an underline — colour alone is not a
   sufficient affordance (WCAG 1.4.1). Navigation, buttons and the flight
   direction toggles are exempt because their role is unambiguous from
   position and shape. */
/* Scoped to running text, and only running text. The previous selector
   matched every descendant link, at a specificity no component could
   outrank, so buttons and section links came out underlined too. */
.lca-prose :is(p, li, td, th, dd, figcaption, blockquote) > a:not(.lca-btn):not(.wp-block-button__link),
.entry-content :is(p, li, td, th, dd, figcaption, blockquote) > a:not(.lca-btn):not(.wp-block-button__link) {
	text-decoration: underline;
	text-underline-offset: 2px;
	text-decoration-thickness: 1px;
}

.lca-prose :is(p, li, td, th, dd, figcaption, blockquote) > a:not(.lca-btn):not(.wp-block-button__link):hover,
.entry-content :is(p, li, td, th, dd, figcaption, blockquote) > a:not(.lca-btn):not(.wp-block-button__link):hover {
	text-decoration-thickness: 2px;
}

::selection {
	background: #fbc02d;
	color: var(--lca-navy);
}

/* ---- Focus ----
   The handoff defined no focus appearance at all. This is the WCAG 2.4.7
   contract for the whole site: a visible ring on every interactive element,
   never removed. */

:focus-visible {
	outline: var(--lca-focus-width) solid var(--lca-focus-color);
	outline-offset: var(--lca-focus-offset);
	border-radius: 2px;
}

/* On navy grounds the terracotta ring is too close in luminance, so the ring
   goes white there. */
.lca-utility :focus-visible,
.lca-footer :focus-visible,
.has-navy-background-color :focus-visible {
	outline-color: #fff;
}

/* ---- Accessibility utilities ---- */

.lca-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.lca-skip-link {
	position: absolute;
	top: -100px;
	left: var(--lca-gutter);
	z-index: 999;
	padding: 12px 20px;
	background: var(--lca-white);
	color: var(--lca-navy);
	font-weight: 700;
	border: 2px solid var(--lca-terracotta);
	border-radius: var(--lca-radius-btn);
	transition: top var(--lca-transition);
}

.lca-skip-link:focus {
	top: 8px;
}

@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;
	}
}

/* ---- Print ---- */

@media print {
	.lca-utility,
	.lca-navtoggle,
	.lca-nav,
	.lca-header__cta,
	.lca-footer__partners {
		display: none;
	}

	body {
		background: #fff;
		color: #000;
	}
}

/* Migrated copy quotes bare URLs like www.aduanas-mexico.com.mx as plain
   text. An unbroken string that long does not fit a 358px phone column and
   pushed the page sideways, so long words wrap rather than overflow. */
.entry-content :is( p, li, dd, dt, td, th, blockquote, figcaption, h1, h2, h3, h4, h5, h6 ) {
	overflow-wrap: break-word;
}
