/**
 * base.css — Styles de base : reset complémentaire + éléments HTML.
 *
 * @package Sabandco2026
 */

@layer base {

	/* -------------------------------------------------------------------------
	 * Reset complémentaire
	 * ---------------------------------------------------------------------- */

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

	/* -------------------------------------------------------------------------
	 * Document
	 * ---------------------------------------------------------------------- */

	html {
		scroll-behavior: smooth;
	}

	@media (prefers-reduced-motion: reduce) {
		html {
			scroll-behavior: auto;
		}
	}

	body {
		font-family: var(--font-body);
		font-weight: var(--font-weight-light);
		color: var(--color-text);
		background-color: var(--color-surface);
		-webkit-font-smoothing: antialiased;
		-moz-osx-font-smoothing: grayscale;
	}

	/* -------------------------------------------------------------------------
	 * Typographie
	 * ---------------------------------------------------------------------- */

	h1, h2, h3, h4, h5, h6 {
		font-family: var(--font-heading);
		font-weight: var(--font-weight-bold);
		line-height: var(--line-height-tight);
		/*
		 * --bs-heading-color vaut `inherit` dans :root (Bootstrap vendor layer) :
		 * les titres héritent alors la couleur de leur zone parente.
		 * Résultat : .text-white, [data-bs-theme="dark"] et toute zone foncée
		 * s'appliquent aux titres via l'héritage CSS normal, sans !important.
		 * En mode sombre, bridge.css force --bs-heading-color: var(--color-text)
		 * pour que les titres soient lisibles sur fond sombre.
		 */
		color: var(--bs-heading-color);
	}

	p {
		line-height: var(--line-height-normal);
	}

	/* -------------------------------------------------------------------------
	 * Liens
	 * ---------------------------------------------------------------------- */

	/*
	 * Les couleurs des liens (repos et survol) sont gérées via les variables
	 * Bootstrap --bs-link-color et --bs-link-hover-color, mappées dans bridge.css
	 * depuis nos tokens. Bootstrap vendor lit ces variables directement sur `a`.
	 * On ne pose donc pas color en dur ici — cela éviterait de court-circuiter
	 * les composants Bootstrap (.nav-link, .dropdown-item, .page-link…) qui
	 * surchargent --bs-link-color dans @layer vendor.
	 */
	a {
		text-underline-offset: 0.2em;
		transition: color var(--transition-fast);
	}

	/* Focus visible — anneau double (WCAG 2.4.7 / 1.4.11).
	 * outline transparent → converti en couleur système par Windows High Contrast.
	 * box-shadow double : couche interne = séparateur blanc, couche externe = #111. */
	:focus-visible {
		outline: 2px solid transparent;
		outline-offset: 2px;
		box-shadow: var(--focus-ring);
	}

	/* -------------------------------------------------------------------------
	 * Images
	 * ---------------------------------------------------------------------- */

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

	/* -------------------------------------------------------------------------
	 * Lien d'évitement (accessibilité)
	 * ---------------------------------------------------------------------- */

	.skip-link {
		position: absolute;
		top: -100%;
		left: 1rem;
		padding: var(--space-sm) var(--space-md);
		background: var(--color-primary);
		color: var(--color-on-primary);
		font-weight: var(--font-weight-semibold);
		text-decoration: none;
		border-radius: var(--radius-md);
		z-index: var(--z-toast);
		transition: top var(--transition-fast);
	}

	.skip-link:focus {
		top: 1rem;
	}

	/* -------------------------------------------------------------------------
	 * WordPress — classes utilitaires injectées par l'éditeur
	 * ---------------------------------------------------------------------- */

	.alignleft  { float: left;  margin-right: var(--space-md); margin-bottom: var(--space-sm); }
	.alignright { float: right; margin-left:  var(--space-md); margin-bottom: var(--space-sm); }
	.aligncenter {
		display: block;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: var(--space-sm);
	}
	.alignfull  { width: 100vw; margin-left: calc(50% - 50vw); }
	.alignwide  { width: 100%;  max-width: none; }

	/* -------------------------------------------------------------------------
	 * Icône SVG (sprite)
	 * ---------------------------------------------------------------------- */

	.icon {
		display: inline-block;
		width:  1em;
		height: 1em;
		vertical-align: -0.125em;
		fill: currentColor;
	}
}
