/* =========================================================================
   Respir — page-pivot
   Stack : CSS pur, mobile-first, zéro dépendance JS.

   Architecture :
   1. Variables CSS (palette, typo, espacement) — modifier ici pour toute la DA
   2. @font-face Libre Baskerville (local)
   3. Reset minimal
   4. Layout
   5. Composants (brand, lead, boutons, footer)
   6. Page mentions légales
   7. Animations
   8. Media queries
   ========================================================================= */


/* =========================================================================
   1. Variables — toute la DA pilotée d'ici
   ========================================================================= */

:root {
    /* ---- Palette Respir ---- */
    /* Couleurs fournies par la charte */
    --color-bg: #bcc4b5;            /* Fond principal (sage du flyer) */
    --color-text: #f6f7f4;          /* Texte clair sur fond sage */
    --color-cream: #f6f2cc;         /* Cream du logo, accents bouton primaire */
    --color-leaves-light: #aeb9a0;  /* Vert clair feuilles logo */
    --color-leaves-dark: #848f74;   /* Vert foncé feuilles/tiges logo */

    /* Couleurs dérivées pour les besoins UI (contraste, hover, ombres) */
    --color-cream-bright: #fdfbe4;     /* Cream éclairci pour hover */
    --color-leaves-deeper: #5d6855;    /* Vert plus profond pour hover */
    --color-text-dark: #2c3826;        /* Vert très foncé, pour texte sur cream */
    --color-text-dark-soft: #4a5544;   /* Vert foncé pour texte secondaire sur cream */
    --color-shadow: rgba(44, 56, 38, 0.18);
    --color-shadow-soft: rgba(44, 56, 38, 0.08);
    --color-border-soft: rgba(246, 247, 244, 0.45);

    /* ---- Typographie ---- */
    --font-display: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
    --font-body: 'Libre Baskerville', Georgia, 'Times New Roman', serif;

    /* ---- Échelle d'espacement ---- */
    --space-2xs: 0.25rem;
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* ---- Rayons ---- */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* ---- Ombres (couleur cohérente avec la palette) ---- */
    --shadow-sm: 0 1px 2px var(--color-shadow-soft);
    --shadow-md: 0 4px 14px var(--color-shadow);
    --shadow-lg: 0 12px 32px var(--color-shadow);

    /* ---- Transitions ---- */
    --transition-fast: 150ms ease;
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}


/* =========================================================================
   2. Polices auto-hébergées (Libre Baskerville)
   Les fichiers .woff2 doivent être placés dans /assets/fonts/.
   Voir /assets/fonts/README.md pour les liens de téléchargement.
   En l'absence des fichiers, fallback automatique sur Georgia (très proche).
   ========================================================================= */

@font-face {
    font-family: 'Libre Baskerville';
    src: url('/assets/fonts/LibreBaskerville-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Libre Baskerville';
    src: url('/assets/fonts/LibreBaskerville-Italic.woff2') format('woff2');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Libre Baskerville';
    src: url('/assets/fonts/LibreBaskerville-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}


/* =========================================================================
   3. Reset minimal
   ========================================================================= */

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

html {
    -webkit-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
}

body {
    min-height: 100dvh;
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

/* Utilitaire : masquage visuel tout en gardant accessible aux lecteurs d'écran */
.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;
}


/* =========================================================================
   4. Layout principal
   ========================================================================= */

.page {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-xl) var(--space-lg) var(--space-lg);
    gap: var(--space-xl);
}

.card {
    width: 100%;
    max-width: 30rem;
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
    text-align: center;
    margin: auto auto;
}


/* =========================================================================
   5. Composants
   ========================================================================= */

/* ---- Brand : logo + tagline ---- */

.brand {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    align-items: center;
}

.brand__heading {
    /* Le h1 sert juste de wrapper sémantique pour le logo, pas de style propre. */
    font-weight: normal;
    line-height: 0;
    margin: 0;
}

.brand__logo {
    width: 100%;
    max-width: 18rem;
    height: auto;
    /* Ombre subtile pour donner de la profondeur sur le fond sage */
    filter: drop-shadow(0 4px 12px var(--color-shadow-soft));
}

.brand__tagline {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-style: italic;
    color: var(--color-text);
    letter-spacing: 0.08em;
    opacity: 0.85;
    margin-top: var(--space-sm);
}

/* ---- Lead : description / prestations ---- */

.lead {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    max-width: 24rem;
    margin: 0 auto;
    margin-top: calc(var(--space-xl) * -1 + var(--space-xs));
    padding: 0 var(--space-xs);
}

.lead__services {
    font-family: var(--font-display);
    font-size: 1.0625rem;
    font-style: italic;
    color: var(--color-cream);
    letter-spacing: 0.02em;
    line-height: 1.5;
}

.lead__detail {
    font-size: 0.9375rem;
    color: var(--color-text);
    opacity: 0.9;
    line-height: 1.6;
}

/* ---- Boutons d'action ---- */

.actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    width: 100%;
    margin-top: var(--space-xs);
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
    min-height: 54px;
    padding: var(--space-md) var(--space-lg);
    border: 1.5px solid transparent;
    border-radius: var(--radius-md);
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background-color var(--transition-base),
                border-color var(--transition-base),
                color var(--transition-base),
                box-shadow var(--transition-base),
                transform var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* CTA principal : cream lumineux qui ressort sur le sage = focus immédiat */
.btn--primary {
    background-color: var(--color-cream);
    color: var(--color-text-dark);
    box-shadow: var(--shadow-md);
    font-weight: 700;
}

.btn--primary:hover {
    background-color: var(--color-cream-bright);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.btn--primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Boutons secondaires : transparents bordés, dans l'esprit minimaliste du flyer */
.btn--secondary {
    background-color: transparent;
    color: var(--color-text);
    border-color: var(--color-border-soft);
}

.btn--secondary:hover {
    background-color: rgba(246, 247, 244, 0.12);
    border-color: var(--color-text);
    transform: translateY(-1px);
}

.btn--secondary:active {
    transform: translateY(0);
    background-color: rgba(246, 247, 244, 0.06);
}

.btn--leaves-light {
    background-color: var(--color-leaves-light);
    color: var(--color-text-dark);
    border-color: transparent;
}

.btn--leaves-light:hover {
    background-color: #c2cdb5;
    transform: translateY(-1px);
}

.btn--leaves-dark {
    background-color: var(--color-leaves-dark);
    color: var(--color-text);
    border-color: transparent;
}

.btn--leaves-dark:hover {
    background-color: #96a082;
    transform: translateY(-1px);
}

/* Accessibilité : focus visible au clavier */
.btn:focus-visible {
    outline: 2px solid var(--color-cream);
    outline-offset: 3px;
}

.btn__icon {
    flex-shrink: 0;
}

.btn__label {
    white-space: nowrap;
}

/* ---- Footer ---- */

.footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2xs);
    padding: var(--space-md) 0;
    font-size: 0.75rem;
    color: var(--color-text);
    opacity: 0.7;
    text-align: center;
}

.footer__legal a {
    text-decoration: underline;
    text-decoration-color: var(--color-border-soft);
    text-underline-offset: 3px;
    transition: text-decoration-color var(--transition-base);
}

.footer__legal a:hover {
    text-decoration-color: var(--color-text);
}


/* =========================================================================
   6. Page Mentions légales
   ========================================================================= */

.legal-page .page {
    justify-content: flex-start;
    padding-top: var(--space-lg);
}

.legal {
    width: 100%;
    max-width: 38rem;
    padding: var(--space-xl) 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.legal__header {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    align-items: flex-start;
}

.legal__back {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    margin-left: calc(var(--space-sm) * -1);
    font-family: var(--font-display);
    font-size: 0.875rem;
    color: var(--color-text);
    opacity: 0.85;
    border-radius: var(--radius-sm);
    transition: opacity var(--transition-base),
                background-color var(--transition-base);
}

.legal__back:hover {
    opacity: 1;
    background-color: rgba(246, 247, 244, 0.1);
}

.legal__back:focus-visible {
    outline: 2px solid var(--color-cream);
    outline-offset: 2px;
    opacity: 1;
}

.legal__title {
    font-family: var(--font-display);
    font-size: clamp(1.875rem, 7vw, 2.5rem);
    font-weight: 700;
    color: var(--color-cream);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.legal__section {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.legal__section h2 {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-cream);
    letter-spacing: 0.01em;
}

.legal__section p {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--color-text);
    opacity: 0.92;
}

.legal__section a {
    text-decoration: underline;
    text-decoration-color: var(--color-border-soft);
    text-underline-offset: 3px;
    transition: text-decoration-color var(--transition-base),
                color var(--transition-base);
}

.legal__section a:hover {
    color: var(--color-cream);
    text-decoration-color: var(--color-cream);
}

.legal__section strong {
    font-weight: 700;
    color: var(--color-cream);
}


/* =========================================================================
   7. Animations d'apparition (respecte prefers-reduced-motion)
   ========================================================================= */

@media (prefers-reduced-motion: no-preference) {
    .brand,
    .lead,
    .actions {
        opacity: 0;
        transform: translateY(12px);
        animation: fadeUp 700ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    .brand   { animation-delay: 100ms; }
    .lead    { animation-delay: 250ms; }
    .actions { animation-delay: 400ms; }
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =========================================================================
   8. Breakpoints (mobile-first → tablette → desktop)
   ========================================================================= */

/* Tablette */
@media (min-width: 640px) {
    .page {
        padding: var(--space-3xl) var(--space-xl) var(--space-xl);
    }

    .card {
        gap: var(--space-2xl);
    }

    .brand__logo {
        max-width: 20rem;
    }

    .brand__tagline {
        font-size: 0.9375rem;
    }

    .lead__services {
        font-size: 1.1875rem;
    }

    .lead__detail {
        font-size: 1rem;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .brand__logo {
        max-width: 22rem;
    }

    .card {
        max-width: 32rem;
    }
}
