/*
 * Socle du thème MVMA : réinitialisation courte, rythme typographique,
 * boutons, utilitaires, habillage des blocs du cœur.
 *
 * Les jetons (couleurs, tailles fluides, espacements, rayons, ombres) sont
 * déclarés dans `theme.json` et servis par WordPress en variables
 * `--wp--preset--*` / `--wp--custom--*`. Aucune valeur de marque n'est écrite
 * en dur ici : une couleur changée dans `theme.json` change tout le thème.
 *
 * Les @font-face viennent aussi de `theme.json` (`fontFamilies.fontFace`) :
 * les redéclarer ici servirait deux fois les mêmes fichiers.
 */

/* --- alias courts, lisibles dans le reste de la feuille ----------------- */

:root {
  --mvma-night: var(--wp--preset--color--night-blue, #083d91);
  --mvma-ocean: var(--wp--preset--color--ocean-blue, #1da1f2);
  --mvma-orange: var(--wp--preset--color--travel-orange, #ff8a00);
  --mvma-sand: var(--wp--preset--color--sand, #f4e9d7);
  --mvma-sky: var(--wp--preset--color--sky-blue, #e7f6ff);
  --mvma-ink: var(--wp--preset--color--ink, #1f2937);
  --mvma-muted: var(--wp--preset--color--muted, #6b7280);
  --mvma-white: var(--wp--preset--color--white, #fff);

  --mvma-radius-s: var(--wp--custom--radius--s, 12px);
  --mvma-radius-m: var(--wp--custom--radius--m, 16px);
  --mvma-radius-l: var(--wp--custom--radius--l, 24px);
  --mvma-radius-pill: var(--wp--custom--radius--pill, 999px);

  --mvma-shadow-soft: var(--wp--preset--shadow--soft, 0 4px 16px rgba(8, 61, 145, 0.08));
  --mvma-shadow-card: var(--wp--preset--shadow--card, 0 10px 30px rgba(8, 61, 145, 0.12));
  --mvma-shadow-float: var(--wp--preset--shadow--float, 0 18px 48px rgba(8, 61, 145, 0.18));

  /*
    Palette du composant de vignette du plugin `ved-mvma`.

    Sa feuille lit d'abord ces variables de préréglage et ne retombe sur le
    turquoise du réseau (#0498b4) que si personne ne les définit. Les poser ici
    suffit donc à repeindre la pastille, la bulle mobile et la fenêtre de
    contact aux couleurs de MVMA — sans réécrire une seule déclaration du
    plugin, qui reste servable tel quel sous un autre thème.

    C'est le point d'extension prévu, et le seul qui atteigne TOUT : la feuille
    du plugin redéfinit `--ved-accent` dans la portée de sa fenêtre, et deux
    règles lisent le préréglage directement.
  */
  --wp--preset--color--ved-accent: var(--wp--preset--color--night-blue, #083d91);
  --wp--preset--color--ved-soft: var(--wp--preset--color--sky-blue, #e7f6ff);
  --wp--preset--color--ved-dark: var(--wp--preset--color--ink, #1f2937);

  --mvma-gutter: clamp(1rem, 4vw, 2.5rem);
  --mvma-wide: var(--wp--style--global--wide-size, 1200px);
  --mvma-header-height: var(--wp--custom--header--height, 76px);
}

/* --- réinitialisation courte ------------------------------------------- */

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

html {
  scroll-behavior: smooth;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

img {
  height: auto;
}

/* Une image de fond en `<img>` n'est pas décorative par accident : elle est
   toujours posée par un gabarit qui lui donne un texte alternatif. */
figure {
  margin: 0;
}

/* --- rythme typographique ---------------------------------------------- */

h1,
h2,
h3,
h4 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

:where(a):focus-visible,
:where(button):focus-visible,
:where(input, select, textarea):focus-visible {
  outline: 3px solid var(--mvma-ocean);
  outline-offset: 2px;
}

/* --- boutons du thème --------------------------------------------------- */

.c-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border: 2px solid transparent;
  border-radius: var(--mvma-radius-pill);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.c-btn:hover {
  transform: translateY(-1px);
}

.c-btn .c-icon {
  width: 1.1em;
  height: 1.1em;
  flex: none;
}

.c-btn.-cta {
  background: var(--mvma-orange);
  color: var(--mvma-white);
  box-shadow: 0 6px 18px rgba(255, 138, 0, 0.32);
}

.c-btn.-cta:hover {
  background: #e67a00;
  color: var(--mvma-white);
}

.c-btn.-outline {
  border-color: var(--mvma-night);
  color: var(--mvma-night);
  background: transparent;
}

.c-btn.-outline:hover {
  background: var(--mvma-night);
  color: var(--mvma-white);
}

.c-btn.-outline-light {
  border-color: rgba(255, 255, 255, 0.55);
  color: var(--mvma-white);
  background: transparent;
}

.c-btn.-outline-light:hover {
  background: var(--mvma-white);
  color: var(--mvma-night);
}

.c-btn.-light {
  background: var(--mvma-white);
  color: var(--mvma-night);
}

.c-btn.-light:hover {
  background: var(--mvma-sky);
  color: var(--mvma-night);
}

/* Variantes de style déclarées côté serveur pour `core/button`. */
.wp-block-button.is-style-cta .wp-block-button__link {
  background: var(--mvma-orange);
  color: var(--mvma-white);
  box-shadow: 0 6px 18px rgba(255, 138, 0, 0.32);
}

.wp-block-button.is-style-outline-night .wp-block-button__link {
  background: transparent;
  border: 2px solid var(--mvma-night);
  color: var(--mvma-night);
}

/* --- icônes ------------------------------------------------------------- */

.c-icon {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
}

/* --- utilitaires -------------------------------------------------------- */

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

/* --- enveloppe de page -------------------------------------------------- */

.mvma-shell {
  display: flow-root;
  min-height: 60vh;
  /* Les carrousels mobiles débordent volontairement de leur gouttière : sans
     cette coupe, leur débordement devient un défilement horizontal de la PAGE.
     `clip` plutôt que `hidden` — `hidden` ferait de l'enveloppe un conteneur de
     défilement et casserait le `position: sticky` de ce qu'elle contient. */
  overflow-x: clip;
}

.mvma-shell > .wp-block-group,
.mvma-shell > .entry-content {
  margin-inline: auto;
}

/* Sections de la une : largeur « wide » du thème, gouttière fluide. */
.c-section {
  max-width: var(--mvma-wide);
  margin-inline: auto;
  padding-inline: var(--mvma-gutter);
}

.c-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.c-section-head__title {
  margin: 0;
  font-size: var(--wp--preset--font-size--h2);
  color: var(--mvma-night);
}

.c-section-head__subtitle {
  margin: 0.35rem 0 0;
  color: var(--mvma-muted);
}

.c-section-head__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--mvma-ocean);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.c-section-head__link:hover {
  text-decoration: underline;
}

.c-section-head__link .c-icon {
  width: 1.1em;
  height: 1.1em;
}

/* --- contenu éditorial (articles, pages) -------------------------------- */

.c-entry {
  max-width: var(--wp--style--global--content-size, 760px);
  margin-inline: auto;
  padding-inline: var(--mvma-gutter);
}

.c-entry__meta {
  color: var(--mvma-muted);
  font-size: var(--wp--preset--font-size--small);
}

.c-entry__thumb img {
  width: 100%;
  border-radius: var(--mvma-radius-m);
  box-shadow: var(--mvma-shadow-card);
}

/* --- logo ----------------------------------------------------------------

   Le fichier est le logo officiel détouré. Sa hauteur suit celle de la barre :
   la maquette le donne nettement plus grand que le texte de navigation.
   --------------------------------------------------------------------- */

.c-logo {
  display: inline-block;
  color: var(--mvma-night);
  line-height: 0;
}

.c-logo.-light {
  color: var(--mvma-white);
}

.c-logo__image {
  display: block;
  width: clamp(140px, 14vw, 195px);
  height: auto;
}

.c-footer .c-logo__image {
  width: 190px;
}

/* Repli sans fichier : le mot-symbole en texte, pour qu'un site sans logo
   reste identifiable. */
.c-logo__word {
  display: block;
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: currentColor;
}

.c-logo__baseline {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1.2;
  color: currentColor;
  opacity: 0.85;
}
