/* =====================================================
   BASE CSS — WAM Dance Studio
   Reset, typographie globale, utilitaires de base.
   Chargé sur TOUTES les pages après tokens.css.
   ===================================================== */

/* -------------------------------------------------------
   Reset & Box model
   ------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    scrollbar-gutter: stable;
    /* évite le layout shift quand la scrollbar apparaît/disparaît */
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--wam-color-page-bg);
    color: var(--wam-color-text);
    font-family: var(--wam-font-body);
    font-size: 16px;
    line-height: 1.25;
    -moz-osx-font-smoothing: grayscale;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Force l'héritage de la police sur les éléments qui ne l'héritent pas par défaut */
button,
input,
optgroup,
select,
textarea {
    font-family: var(--wam-font-body);
}

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

/* Supprimer les marges des blocs par défaut */
p,
h1,
h2,
h3,
h4,
h5,
h6,
ul,
ol,
dl,
figure,
blockquote {
    margin: 0;
    padding: 0;
}

/* Formulaires WAM — Sécurisé pour ne pas impacter l'admin */
form:not(.wp-admin form),
.wam-checkout,
.wam-cart-form,
.wam-contact-form,
.woocommerce-form-login,
.woocommerce-form-register,
.woocommerce-EditAccountForm {
    display: flex;
    flex-direction: column;
    gap: var(--wam-spacing-sm);
}

/* Listes de base */
ul,
ol {
    padding: var(--wam-spacing-md) 0 var(--wam-spacing-md) var(--wam-spacing-2xl);
}

ul li+li {
    margin-top: var(--wam-spacing-2xs);
}

.wam-nav__list li {
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Liens par défaut */
a {
    color: inherit;
}

/* =====================================================
   DÉTECTION LIENS EXTERNES
   Auto-marquage via .is-external (inséré par PHP)
   ===================================================== */
.is-external {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.25em;
    /* petit espace réglable */
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Le picto hérite de la couleur du lien (stroke currentColor dans l'SVG) */
.is-external::after {
    content: "";
    display: inline-block;
    width: 0.75em;
    height: 0.75em;
    flex-shrink: 0;
    background-color: currentColor;
    /* Couleur dynamique du lien */

    /* On utilise mask-image pour colorer l'SVG via background-color */
    -webkit-mask-image: url('../images/Name=external%20link.svg');
    mask-image: url('../images/Name=external%20link.svg');
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;

    /* Alignement optique */
    margin-top: -2px;
    transition: transform var(--wam-transition), opacity var(--wam-transition);
    opacity: 0.8;
}

.is-external:hover::after {
    opacity: 1;
    transform: translate(2px, -2px);
    /* micro-animation directionnelle */
}

/* Focus visible global */
:focus-visible {
    outline: 2px solid var(--wam-color-green);
    outline-offset: 3px;
    border-radius: var(--wam-radius-sm);
}

/* -------------------------------------------------------
   Typographie — Hiérarchie sémantique H1→H5
   Alignée sur le brief WAM / theme.json > styles.elements
   ------------------------------------------------------- */

h1 {
    font-family: var(--wam-font-graphical-1);
    /* Mallia */
    font-size: 46px;
    font-weight: 400;
    line-height: 1.3;
    color: var(--wam-color-text);
}

h2 {
    font-family: var(--wam-font-body);
    /* Outfit */
    font-size: 32px;
    font-weight: bold;
    line-height: 1.1;
    color: var(--wp--preset--color--accent-yellow);
}

.wam-prose h2 {
    margin: var(--wam-spacing-3xl) 0;
}

h3 {
    font-family: var(--wam-font-body);
    /* Outfit */
    font-size: 28px;
    font-weight: bold;
    line-height: 1.1;
    color: var(--wp--preset--color--accent-yellow);
}

.wam-prose h3 {
    margin: var(--wam-spacing-xl) 0;
}

h4 {
    font-family: var(--wam-font-body);
    /* Outfit */
    font-size: 22px;
    font-weight: bold;
    line-height: 1.1;
    color: var(--wp--preset--color--accent-yellow);
}

.wam-prose h4 {
    margin: var(--wam-spacing-lg) 0;
}

h5 {
    font-family: var(--wam-font-body);
    /* Outfit */
    font-size: 26px;
    font-weight: 400;
    line-height: 1.25;
    color: var(--wp--preset--color--accent-yellow);
}

.wam-prose h5 {
    margin: var(--wam-spacing-lg) 0;
}

h6 {
    font-family: var(--wam-font-body);
    font-size: 16px;
    font-weight: bold;
    line-height: 1.25;
    color: var(--wam-color-subtext);
}

.wam-prose h6 {
    margin: var(--wam-spacing-lg) 0;
}

/* Paragraphe de base — text-md 20px */
p {
    font-family: var(--wam-font-body);
    font-size: 20px;
    line-height: 1.5;
    color: inherit;
}

.wam-prose p+p {
    margin-top: var(--wam-spacing-lg);
}

/* Les séparateurs sont gérés par prose-shared.css */

.wam-prose blockquote {
    font-style: italic;
    padding: var(--wam-spacing-md) var(--wam-spacing-lg);
    border: 1px solid var(--wam-color-card-bg);
    border-radius: var(--wam-radius-md);
    margin: var(--wam-spacing-3xl);
}


/* -------------------------------------------------------
   Tailles de texte Gutenberg (has-*-font-size)
   Correspondance avec fontSizes dans theme.json
   ------------------------------------------------------- */

.has-xs-font-size {
    font-size: 14px;
    line-height: 1.25;
}

.has-sm-font-size {
    font-size: 16px;
    line-height: 1.25;
}

.has-md-font-size {
    font-size: 20px;
    line-height: 1.25;
}

.has-lg-font-size {
    font-size: 26px;
    line-height: 1.25;
}

/* -------------------------------------------------------
   Couleurs de texte Gutenberg (has-*-color)
   ------------------------------------------------------- */

.has-text-normal-color {
    color: var(--wp--preset--color--text-normal) !important;
}

.has-text-subtext-color {
    color: var(--wp--preset--color--text-subtext) !important;
}

.has-text-disabled-color {
    color: var(--wp--preset--color--text-disabled) !important;
}

.has-accent-green-color {
    color: var(--wp--preset--color--accent-green) !important;
}

.has-accent-yellow-color {
    color: var(--wp--preset--color--accent-yellow) !important;
}

.has-accent-orange-color {
    color: var(--wp--preset--color--accent-orange) !important;
}

.has-accent-pink-color {
    color: var(--wp--preset--color--accent-pink) !important;
}

.has-background-800-color {
    color: var(--wp--preset--color--background-800) !important;
}

.has-background-600-color {
    color: var(--wp--preset--color--background-600) !important;
}

.has-background-500-color {
    color: var(--wp--preset--color--background-500) !important;
}

/* -------------------------------------------------------
   Couleurs de fond Gutenberg (has-*-background-color)
   ------------------------------------------------------- */

.has-text-normal-background-color {
    background-color: var(--wp--preset--color--text-normal) !important;
}

.has-text-subtext-background-color {
    background-color: var(--wp--preset--color--text-subtext) !important;
}

.has-accent-green-background-color {
    background-color: var(--wp--preset--color--accent-green) !important;
}

.has-accent-yellow-background-color {
    background-color: var(--wp--preset--color--accent-yellow) !important;
}

.has-accent-orange-background-color {
    background-color: var(--wp--preset--color--accent-orange) !important;
}

.has-accent-pink-background-color {
    background-color: var(--wp--preset--color--accent-pink) !important;
}

.has-background-800-background-color {
    background-color: var(--wp--preset--color--background-800) !important;
}

.has-background-600-background-color {
    background-color: var(--wp--preset--color--background-600) !important;
}

.has-background-500-background-color {
    background-color: var(--wp--preset--color--background-500) !important;
}

/* -------------------------------------------------------
   Styles de display custom (is-style-*)
   Appliqués via block styles Gutenberg sur p / heading
   ------------------------------------------------------- */

/* Title Norm — Outfit Bold */
.is-style-title-norm-lg,
h1.is-style-title-norm-lg,
h2.is-style-title-norm-lg,
h3.is-style-title-norm-lg,
p.is-style-title-norm-lg,
.wam-prose .is-style-title-norm-lg {
    font-family: var(--wam-font-body);
    font-size: var(--wam-font-size-h1);
    /* 32px */
    font-weight: bold;
    line-height: 1.1;
}

.is-style-title-norm-md,
h1.is-style-title-norm-md,
h2.is-style-title-norm-md,
h3.is-style-title-norm-md,
p.is-style-title-norm-md,
.wam-prose .is-style-title-norm-md {
    font-family: var(--wam-font-body);
    font-size: 28px;
    font-weight: bold;
    line-height: 1.1;
}

.is-style-title-norm-sm,
h1.is-style-title-norm-sm,
h2.is-style-title-norm-sm,
h3.is-style-title-norm-sm,
p.is-style-title-norm-sm,
.wam-prose .is-style-title-norm-sm {
    font-family: var(--wam-font-body);
    font-size: 22px;
    font-weight: bold;
    line-height: 1.1;
}

/* Title Cool — WAM Font */
.is-style-title-cool-lg,
h1.is-style-title-cool-lg,
h2.is-style-title-cool-lg,
h3.is-style-title-cool-lg,
p.is-style-title-cool-lg,
.wam-prose .is-style-title-cool-lg {
    font-family: var(--wam-font-graphical-2);
    font-size: var(--wam-font-size-display-lg);
    /* 48px */
    font-weight: 400;
    line-height: 1;
}

.is-style-title-cool-md,
h1.is-style-title-cool-md,
h2.is-style-title-cool-md,
h3.is-style-title-cool-md,
p.is-style-title-cool-md,
.wam-prose .is-style-title-cool-md {
    font-family: var(--wam-font-graphical-2);
    font-size: 36px;
    font-weight: 400;
    line-height: 1;
}

/* Title Sign — Mallia */
.is-style-title-sign-lg,
h1.is-style-title-sign-lg,
h2.is-style-title-sign-lg,
h3.is-style-title-sign-lg,
p.is-style-title-sign-lg,
.wam-prose .is-style-title-sign-lg {
    font-family: var(--wam-font-graphical-1);
    font-size: 46px;
    font-weight: 400;
    line-height: 1.3;
}

.is-style-title-sign-md,
h1.is-style-title-sign-md,
h2.is-style-title-sign-md,
h3.is-style-title-sign-md,
p.is-style-title-sign-md,
.wam-prose .is-style-title-sign-md {
    font-family: var(--wam-font-graphical-1);
    font-size: 32px;
    font-weight: 400;
    line-height: 1.1;
}

.is-style-title-sign-sm,
h1.is-style-title-sign-sm,
h2.is-style-title-sign-sm,
h3.is-style-title-sign-sm,
p.is-style-title-sign-sm,
.wam-prose .is-style-title-sign-sm {
    font-family: var(--wam-font-graphical-1);
    font-size: 24px;
    font-weight: 400;
    line-height: 1.1;
}

/* -------------------------------------------------------
   Utilitaires globaux
   ------------------------------------------------------- */

/* Liens d'évitement (Skip links) — Toujours cachés sauf au focus */
.skip-links-list {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 9999;
}

/* Accessibilité : texte visuellement caché mais lisible par SR */
.sr-only,
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip links focusables (RGAA 10.13) */
.skip-link:focus-visible,
.skip-link:focus {
    position: fixed;
    top: var(--wam-spacing-md);
    left: var(--wam-spacing-md);
    width: auto;
    height: auto;
    padding: var(--wam-spacing-sm) var(--wam-spacing-md);
    background: var(--wp--preset--color--accent-yellow);
    color: var(--wp--preset--color--background-800);
    z-index: var(--wam-z-a11y);
    clip: auto;
    margin: 0;
    text-decoration: none;
    border-radius: var(--wam-radius-sm);
    font-weight: bold;
    outline: 2px solid var(--wp--preset--color--text-normal);
    outline-offset: 2px;
}

/* Truncation de texte */
.text-truncate {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Figma Utilities */
.text-xs {
    font-size: var(--wam-font-size-xs) !important;
}

.text-sm {
    font-size: var(--wam-font-size-sm) !important;
}

.text-md {
    font-size: var(--wam-font-size-md) !important;
}

.text-lg {
    font-size: var(--wam-font-size-lg) !important;
}

.d-block {
    display: block !important;
}

.color-subtitle {
    color: var(--wam-color-subtext);
}

.fw-bold {
    font-weight: bold !important;
}

.color-text {
    color: var(--wam-color-text) !important;
}

.bg-page {
    background-color: var(--wam-color-page-bg) !important;
}

.color-subtext {
    color: var(--wam-color-subtext) !important;
}

.color-muted,
.color-disabled {
    color: var(--wam-color-disabled) !important;
}

.color-green {
    color: var(--wam-color-green) !important;
}

.color-yellow {
    color: var(--wam-color-yellow) !important;
}

.color-orange {
    color: var(--wam-color-orange) !important;
}

.color-pink {
    color: var(--wam-color-pink) !important;
}

.mt-xs {
    margin-top: var(--wam-spacing-xs) !important;
}

.mt-sm {
    margin-top: var(--wam-spacing-sm) !important;
}

.mt-md {
    margin-top: var(--wam-spacing-md) !important;
}

.mt-lg {
    margin-top: var(--wam-spacing-lg) !important;
}

.mt-xl {
    margin-top: var(--wam-spacing-xl) !important;
}

.mt-2xl {
    margin-top: var(--wam-spacing-2xl) !important;
}

.mt-9xl {
    margin-top: var(--wam-spacing-9xl) !important;
}

.mb-sm {
    margin-bottom: var(--wam-spacing-sm) !important;
}

.mb-md {
    margin-bottom: var(--wam-spacing-md) !important;
}

.mb-xl {
    margin-bottom: var(--wam-spacing-xl) !important;
}

/* -------------------------------------------------------
   Utilitaires de structure (Audit Conformité TOKENS.md)
   ------------------------------------------------------- */
.d-block {
    display: block !important;
}

.d-none {
    display: none !important;
}

.text-center {
    text-align: center !important;
}

/* Spacing spécifique hors échelle standard */
.mt-2 {
    margin-top: 2px !important;
}

/* Conteneur max-width centré */
.wam-container {
    max-width: var(--wam-max-screen);
    margin: 0 auto;
    width: 100%;
    padding: 0 var(--wam-page-mx);
    box-sizing: border-box;
}

/* -------------------------------------------------------
   Compatibilité Accessibilité — base.css
   ------------------------------------------------------- */

/* Polices graphiques désactivées → Outfit pour h1-h3 */
html.wam-no-graphical-fonts h1,
html.wam-no-graphical-fonts h2,
html.wam-no-graphical-fonts h3,
html.wam-no-graphical-fonts .is-style-title-cool-lg,
html.wam-no-graphical-fonts .is-style-title-cool-md,
html.wam-no-graphical-fonts .is-style-title-sign-lg,
html.wam-no-graphical-fonts .is-style-title-sign-md,
html.wam-no-graphical-fonts .is-style-title-sign-sm {
    font-family: var(--wam-font-body) !important;
    font-style: normal !important;
}

/* Animations désactivées */
html.wam-reduce-motion *,
html.wam-reduce-motion *::before,
html.wam-reduce-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}

/* -------------------------------------------------------
   SYSTÈME PROSE — Source unique : assets/css/prose-shared.css
   Chargé sur le front via wp_enqueue_style('wamv1-prose')
   et dans Gutenberg via add_editor_style() + classe wam-prose
   injectée sur le body de l'éditeur.
   ------------------------------------------------------- */

/* =====================================================
   SURCHARGES RESPONSIVE (MOBILE < 768px)
   ===================================================== */
@media (max-width: 768px) {

    /* Titres Mallia (H1 et Gutenberg) */
    .is-style-title-sign-lg,
    h1 {
        font-size: 36px !important;
    }

    /* Titres Norm Lg */
    .is-style-title-norm-lg {
        font-size: 40px !important;
    }
}

/* =====================================================
   SPECIFIC PAGE OVERRIDES
   ===================================================== */

/**
 * Page EVJF / EVG Animation Danse
 * On force la police WAM Font via la nouvelle classe de slug.
 */
.page-slug-evjf-evg-animation-danse h1,
.page-slug-evjf-evg-animation-danse .page-hero__title {
    font-family: var(--wam-font-graphical-2) !important;
    font-size: var(--wam-font-size-display-lg) !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-weight: 400 !important;
}