/* ============================================================
   APAC Maresme — Base: reset, typography, focus, motion, utilities
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html {
	-webkit-text-size-adjust: 100%;
	/* Keep in-page anchors AND keyboard focus clear of the sticky header
	   (WCAG 2.2 · 2.4.11 Focus Not Obscured) and above the floating a11y button. */
	scroll-padding-top: 92px;
	scroll-padding-bottom: 88px;
}
@media (max-height: 520px) {
	html { scroll-padding-top: 12px; }
}

body {
	margin: 0;
	background: var(--c-paper);
	color: var(--c-tinta);
	font-family: var(--font-reading);
	font-size: var(--fs-body);
	line-height: var(--lh-reading);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

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

h1, h2, h3, h4 { font-family: var(--font-ui); font-weight: 600; line-height: var(--lh-heading); color: var(--c-tinta); }

a { color: var(--c-petroli); text-underline-offset: 3px; }
a:hover { color: var(--c-petroli-fosc); }

p { margin: 0 0 1.1em; }

/* ── Visible focus everywhere; never removed ──────── */
:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 3px; border-radius: 4px; }
/* Keep mouse users tidy but ALWAYS show focus for keyboard */
:focus:not(:focus-visible) { outline: none; }

::selection { background: var(--c-primari-clar); }

/* ── Reduced motion: transitions only when allowed ── */
.apac-fade { transition: none; }
@media (prefers-reduced-motion: no-preference) {
	.apac-fade { transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease; }
	html { scroll-behavior: smooth; }
}

/* ── Skip link: hidden until focused ──────────────── */
.apac-skip {
	position: absolute;
	left: -9999px;
	top: var(--sp-1);
	z-index: 100;
	background: var(--c-petroli-fosc);
	color: #fff;
	padding: 12px 18px;
	border-radius: var(--r-field);
	font-family: var(--font-ui);
	font-weight: 600;
	text-decoration: none;
}
.apac-skip:focus { left: var(--sp-1); color: #fff; }

/* ── Layout helpers ───────────────────────────────── */
.apac-shell { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--sp-3); }
.apac-site-main { flex: 1 0 auto; }

/* ── Screen-reader-only ───────────────────────────── */
.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
	height: 1px; width: 1px; margin: -1px; padding: 0; overflow: hidden; position: absolute; word-wrap: normal !important;
}
.screen-reader-text:focus {
	background: #fff; clip: auto; clip-path: none; color: var(--c-petroli-fosc);
	height: auto; width: auto; padding: 12px 18px; border-radius: var(--r-field);
	left: var(--sp-1); top: var(--sp-1); z-index: 100; text-decoration: none;
}

/* ── Material Symbols Rounded ─────────────────────── */
.material-symbols-rounded {
	font-family: "Material Symbols Rounded";
	font-weight: normal; font-style: normal;
	font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
	line-height: 1; letter-spacing: normal; text-transform: none;
	display: inline-block; white-space: nowrap; word-wrap: normal;
	direction: ltr; user-select: none; -webkit-font-feature-settings: "liga";
	-webkit-font-smoothing: antialiased;
}
.ms-fill { font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24; }

/* ── Accent (handwritten) label ───────────────────── */
.apac-accent { font-family: var(--font-accent); font-weight: 600; color: var(--c-terracota); }

/* ── Buttons & pills (shared) ─────────────────────── */
.apac-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 48px; padding: 0 24px;
	font-family: var(--font-ui); font-weight: 600; font-size: 17px;
	border: none; border-radius: var(--r-btn); cursor: pointer; text-decoration: none;
}
.apac-btn--primary { background: var(--c-petroli); color: #fff; }
.apac-btn--cta { background: var(--c-terracota); color: #fff; }
.apac-btn--secondary { background: var(--c-targeta); color: var(--c-petroli-fosc); border: 2px solid var(--c-petroli); }
.apac-btn--ghost { background: transparent; color: var(--c-petroli-fosc); border: 2px solid var(--c-petroli); }
.apac-btn:hover { filter: brightness(.96); }

.apac-pill {
	display: inline-flex; align-items: center; gap: 7px;
	padding: 6px 13px; border-radius: var(--r-pill);
	font-family: var(--font-ui); font-weight: 700; font-size: 13px;
}
.apac-pill--teal { background: var(--c-primari-clar); color: var(--c-petroli-fosc); }
.apac-pill--terracota { background: var(--c-accent-clar); color: var(--c-terracota-fosc); }
