/* ========================================
   BASE — Reset, variables, styles globaux
   ======================================== */

/* Police Manrope (variable 200–800, licence OFL : fonts/manrope-OFL.txt).
   Auto-hébergée : aucune requête vers Google Fonts, donc aucune IP de visiteur transmise.
   Trois sous-ensembles ; le navigateur ne télécharge que ceux dont la page a besoin. */
@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-display: swap;
    font-weight: 200 800;
    src: url("../fonts/manrope-latin.938c6e8019b6.woff2") format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-display: swap;
    font-weight: 200 800;
    src: url("../fonts/manrope-latin-ext.6d36d5bdedfa.woff2") format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-display: swap;
    font-weight: 200 800;
    src: url("../fonts/manrope-cyrillic.e58febde317b.woff2") format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* Variables */
:root {
    /* Couleurs — identité Azur : navy pour le texte, turquoise pour l'accent.
       Le turquoise ne sert qu'en fond ou en filet : sur fond clair, son texte tombe à
       1,5:1. Un texte « couleur de marque » prend --color-primary-text (AA). */
    --color-primary: #49e5fc;
    --color-primary-hover: #1FD4EF;
    --color-primary-light: #E6FAFE;
    --color-primary-text: #0A6E7D;
    --color-text: #1A2B3C;
    --color-text-light: #5A6B7C;
    --color-bg: #FFFFFF;
    --color-bg-light: #F7FAFA;
    --color-border: #DDE5E9;
    /* Texte et icônes posés sur un fond sombre (navy, photo, voile) */
    --color-on-dark: #FFFFFF;
    /* Rouge des filets et des fonds pleins (bordure de champ en erreur, bouton supprimer) */
    --color-danger: #DC3545;

    /* Neutres façon Airbnb (surfaces, bordures de champs, fond sombre) */
    --color-surface: #F7F7F7;
    --color-surface-2: #EBEBEB;
    --color-surface-3: #DDDDDD;
    --color-surface-cool: #F2F4F5;
    --color-border-strong: #B0B0B0;
    --color-dark: #1A2B3C;
    --color-dark-hover: #0E1A26;
    /* Voile sous un panneau ou une feuille ouverte */
    --color-overlay: rgba(0, 0, 0, 0.4);
    /* Pastille lisible posée sur une photo (compteur de la galerie) */
    --color-scrim: rgba(26, 43, 60, 0.72);

    /* États (badges, alertes, icônes de confirmation, calendrier) : fond / filet / texte.
       Chaque texte -fg tient 4,5:1 sur blanc comme sur son fond -bg. */
    --state-success-bg: #E7F6EC;
    --state-success-border: #BFE5C8;
    --state-success-fg: #1E7B34;
    --state-warning-bg: #FFF4D6;
    --state-warning-border: #FFE08A;
    --state-warning-fg: #6B4E00;
    --state-danger-bg: #FDEDEE;
    --state-danger-border: #F5C2C7;
    --state-danger-fg: #B02A37;
    --state-info-bg: var(--color-primary-light);
    --state-info-border: #A9EEF8;
    --state-info-fg: var(--color-text);
    --state-neutral-bg: var(--color-surface-2);
    --state-neutral-border: var(--color-text-light);
    --state-neutral-fg: var(--color-text-light);
    /* Occupé sur une autre plateforme (calendrier propriétaire) */
    --state-external-bg: #FFF4E5;
    --state-external-border: #C2410C;
    --state-external-fg: #9A3412;

    --font-main: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-base: 16px;
    --font-size-sm: 14px;
    --font-size-md: 15px;
    --font-size-lg: 18px;
    --font-size-title: 22px;
    --font-size-xl: 24px;
    --font-size-2xl: 32px;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    --radius-3xl: 32px;
    --radius-pill: 999px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-bar: 0 3px 12px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-card: 0 6px 16px rgba(0,0,0,.12);
    --shadow-float: 0 8px 28px rgba(0,0,0,.28);

    --ease: cubic-bezier(.2,0,0,1);

    /* Couches de la page, de bas en haut (les z-index de 1 à 50 restent locaux à un
       composant). Barre fixe mobile < navbar < feuille du bas < panneaux de la recherche
       < modales plein écran (recherche mobile, visionneuse) */
    --z-sticky: 90;
    --z-nav: 100;
    --z-feuille: 140;
    --z-popover: 1100;
    --z-modale: 2000;

    /* Chevrons des liens et boutons « Retour », « Précédent », « Suivant » : posés en
       mask sur un pseudo-élément (couleur = currentColor), au lieu des flèches ← → du
       texte, dessinées différemment par chaque système */
    --icone-chevron-gauche: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M10 3L5 8l5 5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    --icone-chevron-droite: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6 3l5 5-5 5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

    --max-width: 1200px;
    --page-gutter: clamp(16px, 4vw, 40px);
    /* Hauteur de la navbar : à reprendre pour les éléments sticky (top: var(--nav-height)) */
    --nav-height: 76px;
}

/* Points de rupture (une media query ne lit pas de variable CSS, d'où les valeurs écrites
   en dur dans chaque feuille) :
     max-width: 767px   mobile
     max-width: 1023px  tablette (navbar compacte, fiche et tunnel sur une colonne) ;
                        min-width: 1024px pour le cas inverse
   La recherche et le listing suivent le palier d'Airbnb (744.98px / min-width: 745px,
   repris par recherche.js). Les autres valeurs (959px, 899px…) sont des réglages de
   contenu propres à un composant, pas des paliers. */
@media (max-width: 1023px) {
    :root {
        --nav-height: 64px;
    }
}

/* Reset */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-main);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Couche modale ouverte (azur.js, Azur.couche : tiroir de la navbar, modale de recherche,
   visionneuse, feuille du calendrier) : la page ne défile plus dessous */
html.couche-ouverte,
html.couche-ouverte body {
    overflow: hidden;
}

/* Le pied de page reste bas sur les pages courtes ; cible du lien d'évitement, sans contour */
body > main {
    min-height: 60vh;
}

body > main:focus {
    outline: none;
}

/* Ancres (#annulation…) : la cible ne passe pas sous la navbar sticky */
[id] {
    scroll-margin-top: calc(var(--nav-height) + 16px);
}

h1, h2 {
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

h3, h4 {
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

a {
    color: inherit;
    text-decoration: none;
}

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

ul, ol {
    list-style: none;
}

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

button {
    -webkit-tap-highlight-color: transparent;
}

/* Focus clavier visible partout ; un clic souris ne dessine pas de contour */
:focus-visible {
    outline: 2px solid var(--color-text);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

::selection {
    background: var(--color-primary-light);
    color: var(--color-text);
}

/* Utilitaires */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--page-gutter);
}

/* Lisible par les lecteurs d'écran uniquement */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Lien d'évitement : hors écran jusqu'au premier Tab */
.skip-link {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: var(--z-modale);
    padding: 12px 20px;
    border-radius: var(--radius-pill);
    background: var(--color-dark);
    color: var(--color-on-dark);
    font-weight: 700;
    font-size: var(--font-size-sm);
    transform: translateY(-200%);
    transition: transform 0.2s var(--ease);
}

.skip-link:focus {
    transform: translateY(0);
}

/* Mouvement réduit : animations et transitions quasi instantanées */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0s !important;
        scroll-behavior: auto !important;
    }
}
