/* ============================================================================
   responsive.css — Cabinet de Psychologie Ambre Dremeau
   Approche Mobile First : styles de base dans style.css (desktop)
   Ce fichier gère les breakpoints descendants : tablette → mobile

   Breakpoints :
     ≤ 1024px  → Tablette paysage / petit desktop
     ≤ 768px   → Tablette portrait
     ≤ 600px   → Grand mobile
     ≤ 480px   → Mobile standard
     ≤ 360px   → Petit mobile
   ============================================================================ */


/* ============================================================================
   TABLETTE PAYSAGE — max-width: 1024px
   ============================================================================ */
@media (max-width: 1024px) {

    /* ── Variables : réduction des espacements ──────────────────────── */
    :root {
        --container-pad: var(--space-5);
        --space-20: 4rem;
        --space-24: 5rem;
    }

    /* ── Typographie ────────────────────────────────────────────────── */
    .section-header__title  { font-size: var(--text-2xl); }
    .home-hero__title        { font-size: var(--text-3xl); }

    /* ── Spécialités : 3 colonnes ───────────────────────────────────── */
    .specialties-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-4);
    }

    /* ── Équipe : 2 colonnes ────────────────────────────────────────── */
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }

    /* ── Footer : 2 colonnes ────────────────────────────────────────── */
    .footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-8);
    }

    /* ── Split layout : gap réduit ──────────────────────────────────── */
    .split-layout {
        gap: var(--space-8);
    }

    /* ── Header : navigation compacte ──────────────────────────────── */
    .nav-link {
        padding: var(--space-2) var(--space-3);
        font-size: var(--text-xs);
    }

    .header-brand-subtitle { display: none; }
}


/* ============================================================================
   TABLETTE PORTRAIT — max-width: 768px
   ============================================================================ */
@media (max-width: 768px) {

    /* ── Variables ──────────────────────────────────────────────────── */
    :root {
        --container-pad: var(--space-5);
        --header-height: 68px;
        --space-16: 3rem;
        --space-20: 3.5rem;
    }

    /* ── Typographie ────────────────────────────────────────────────── */
    .section-header__title  { font-size: var(--text-xl); }
    .home-hero__title        { font-size: var(--text-2xl); }

    /* ── Header : menu burger activé ────────────────────────────────── */
    .burger-btn {
        display: flex;
    }

    .main-nav {
        /* Menu déroulant plein écran sur mobile */
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        z-index: var(--z-overlay);
        background-color: var(--color-white);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: var(--space-6);
        overflow-y: auto;

        /* État masqué par défaut */
        opacity: 0;
        visibility: hidden;
        transform: translateY(-12px);
        transition:
            opacity    var(--transition-base),
            visibility var(--transition-base),
            transform  var(--transition-base);

        /* Ombre sur le côté */
        box-shadow: var(--shadow-xl);
    }

    /* État ouvert — classe ajoutée par menu.js */
    .main-nav--open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-2);
        width: 100%;
    }

    .nav-item { width: 100%; }

    .nav-link {
        display: block;
        padding: var(--space-4) var(--space-5);
        font-size: var(--text-base);
        border-radius: var(--radius-md);
        text-align: left;
    }

    .nav-item--cta {
        margin-left: 0;
        margin-top: var(--space-4);
        padding-top: var(--space-4);
        border-top: 1px solid var(--color-beige-mid);
    }

    .nav-item--cta .btn {
        width: 100%;
        justify-content: center;
        padding-block: var(--space-4);
        font-size: var(--text-md);
    }

    /* Bloquer le scroll du body quand le menu est ouvert */
    body.menu-open {
        overflow: hidden;
    }

    /* ── Split layout : colonne unique ─────────────────────────────── */
    .split-layout {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    /* L'image passe toujours après le texte sur mobile */
    .split-layout__text  { order: 1; }
    .split-layout__image { order: 2; }

    /* ── Spécialités : 2 colonnes ───────────────────────────────────── */
    .specialties-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }

    /* ── Équipe : 1 colonne ─────────────────────────────────────────── */
    .team-grid {
        grid-template-columns: 1fr;
        max-width: 480px;
        margin-inline: auto;
    }

    /* ── Carousel ───────────────────────────────────────────────────── */
    .carousel {
        border-radius: var(--radius-md);
        max-height: 420px;
    }

    .carousel-btn {
        width: 40px;
        height: 40px;
    }

    .carousel-btn svg {
        width: 18px;
        height: 18px;
    }

    /* ── Carte ──────────────────────────────────────────────────────── */
    .map-container { height: 320px; }

    /* ── Formulaire : une colonne ───────────────────────────────────── */
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    /* ── Footer : une colonne ───────────────────────────────────────── */
    .footer-inner {
        grid-template-columns: 1fr;
        gap: var(--space-8);
        padding-block: var(--space-10);
    }

    .footer-bottom-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }

    .footer-legal-list {
        gap: var(--space-4);
    }

    /* ── Section hero ───────────────────────────────────────────────── */
    .home-hero {
        padding-block: var(--space-12);
    }

    .home-hero__actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .home-hero__actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* ── Breadcrumb ─────────────────────────────────────────────────── */
    .breadcrumb-list {
        font-size: var(--text-xs);
    }

    /* ── Tableau des tests ──────────────────────────────────────────── */
    .tests-table th,
    .tests-table td {
        padding: var(--space-3) var(--space-4);
    }

    /* ── Pages ville ────────────────────────────────────────────────── */
    .ville-hero {
        padding-block: var(--space-10);
    }

    /* ── Fade-in : délais réduits sur mobile ────────────────────────── */
    .fade-in:nth-child(2) { transition-delay: 40ms; }
    .fade-in:nth-child(3) { transition-delay: 80ms; }
    .fade-in:nth-child(4) { transition-delay: 120ms; }
    .fade-in:nth-child(5) { transition-delay: 160ms; }
    .fade-in:nth-child(6) { transition-delay: 200ms; }
}


/* ============================================================================
   GRAND MOBILE — max-width: 600px
   ============================================================================ */
@media (max-width: 600px) {

    :root {
        --container-pad: var(--space-4);
        --space-12: 2.5rem;
        --space-16: 2.5rem;
    }

    /* ── Typographie ────────────────────────────────────────────────── */
    .section-header__title  { font-size: var(--text-xl); }
    .home-hero__title        { font-size: var(--text-2xl); }
    .section-header__subtitle { font-size: var(--text-base); }

    /* ── Header brand : nom court ───────────────────────────────────── */
    .header-brand-name {
        font-size: var(--text-base);
    }

    /* ── Spécialités : 1 colonne ────────────────────────────────────── */
    .specialties-grid {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }

    /* Cartes spécialités : disposition horizontale sur petit écran */
    .specialty-card {
        flex-direction: row;
        align-items: flex-start;
        padding: var(--space-4);
        gap: var(--space-4);
    }

    .specialty-card__icon {
        width: 44px;
        height: 44px;
        flex-shrink: 0;
    }

    .specialty-card__icon svg {
        width: 22px;
        height: 22px;
    }

    .specialty-card__content {
        flex: 1;
    }

    /* ── Carousel ───────────────────────────────────────────────────── */
    .carousel {
        border-radius: var(--radius-sm);
        max-height: 280px;
    }

    .carousel-btn--prev { left: var(--space-2); }
    .carousel-btn--next { right: var(--space-2); }

    .carousel-dots { gap: var(--space-1); }

    .carousel-dot {
        width: 6px;
        height: 6px;
    }

    .carousel-dot--active {
        width: 16px;
    }

    /* ── Carte ──────────────────────────────────────────────────────── */
    .map-container { height: 260px; }

    /* ── Section header ─────────────────────────────────────────────── */
    .section-header {
        margin-bottom: var(--space-8);
    }

    /* ── Tableau : version condensée ────────────────────────────────── */
    .tests-table th,
    .tests-table td {
        padding: var(--space-3);
        font-size: var(--text-xs);
    }

    /* Masquer la colonne Prix sur très petit écran si nécessaire */
    /* .tests-table .col-price { display: none; } */

    /* ── Footer social ──────────────────────────────────────────────── */
    .footer-social {
        gap: var(--space-2);
    }

    /* ── Boutons : pleine largeur par défaut ────────────────────────── */
    .map-cta .btn {
        width: 100%;
        justify-content: center;
    }

    /* ── Section pages ville ────────────────────────────────────────── */
    .ville-hero {
        padding-block: var(--space-8);
    }

    .ville-hero__address {
        font-size: var(--text-base);
    }
}


/* ============================================================================
   MOBILE STANDARD — max-width: 480px
   ============================================================================ */
@media (max-width: 480px) {

    :root {
        --container-pad: var(--space-4);
        --header-height: 62px;
    }

    /* ── Header : logo seul ─────────────────────────────────────────── */
    .header-logo {
        width: 44px;
        height: 44px;
    }

    .header-brand-name {
        font-size: var(--text-sm);
        max-width: 160px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* ── Typographie ────────────────────────────────────────────────── */
    .home-hero__title { font-size: var(--text-xl); }
    .section-header__title { font-size: var(--text-lg); }

    /* ── Sections ───────────────────────────────────────────────────── */
    .section    { padding-block: 2.5rem; }
    .section--sm { padding-block: 2rem; }
    .section--lg { padding-block: 3rem; }

    /* ── Tags équipe ────────────────────────────────────────────────── */
    .tag { font-size: 0.65rem; padding: 2px var(--space-2); }

    /* ── Formulaire ─────────────────────────────────────────────────── */
    .form-control {
        padding: var(--space-3);
        font-size: var(--text-sm);
    }

    /* ── Breadcrumb : raccourcir si nécessaire ──────────────────────── */
    .breadcrumb-item--current .breadcrumb-current {
        max-width: 180px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: inline-block;
    }

    /* ── Footer compact ─────────────────────────────────────────────── */
    .footer-inner { padding-block: var(--space-8); gap: var(--space-6); }

    .footer-legal-list {
        flex-direction: column;
        gap: var(--space-2);
    }

    /* ── Tableau tests : scroll horizontal bien géré ────────────────── */
    .tests-table-wrapper {
        border-radius: var(--radius-sm);
    }

    .tests-table th:first-child,
    .tests-table td:first-child {
        padding-left: var(--space-3);
    }

    /* ── Carousel ───────────────────────────────────────────────────── */
    .carousel-btn {
        width: 36px;
        height: 36px;
    }

    .carousel-btn svg {
        width: 16px;
        height: 16px;
    }
}


/* ============================================================================
   PETIT MOBILE — max-width: 360px
   ============================================================================ */
@media (max-width: 360px) {

    :root {
        --container-pad: var(--space-3);
    }

    /* ── Masquer le sous-titre du cabinet dans le header ────────────── */
    .header-brand-name {
        max-width: 120px;
    }

    /* ── Boutons ────────────────────────────────────────────────────── */
    .btn {
        font-size: var(--text-sm);
        padding: var(--space-2) var(--space-5);
    }

    /* ── Carte ──────────────────────────────────────────────────────── */
    .map-container { height: 220px; }

    /* ── Spécialités ────────────────────────────────────────────────── */
    .specialty-card {
        padding: var(--space-3);
        gap: var(--space-3);
    }
}


/* ============================================================================
   UTILITAIRES RESPONSIVE GLOBAUX
   ============================================================================ */

/* Affichage conditionnel */
.hide-mobile  { }
.show-mobile  { display: none; }

@media (max-width: 768px) {
    .hide-mobile  { display: none !important; }
    .show-mobile  { display: block !important; }
    .show-mobile--flex { display: flex !important; }
}

/* Texte centré sur mobile */
@media (max-width: 768px) {
    .text-center-mobile { text-align: center; }
    .text-center-mobile p { margin-inline: auto; }
}

/* Ordre inversé image/texte sur certaines sections (si besoin) */
@media (max-width: 768px) {
    .split-layout--image-first .split-layout__image { order: 1; }
    .split-layout--image-first .split-layout__text  { order: 2; }
}


/* ============================================================================
   IMPRESSION
   ============================================================================ */
@media print {
    .site-header,
    .burger-btn,
    .carousel-btn,
    .carousel-dots,
    .footer-social,
    .btn--rdv,
    .skip-link {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }

    .container {
        max-width: 100%;
        padding-inline: 0;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    a[href^="http"]::after {
        content: ' (' attr(href) ')';
        font-size: 0.8em;
        color: #555;
    }

    .site-footer {
        background-color: #f0f0f0;
        color: #000;
    }

    .footer-inner {
        grid-template-columns: 1fr 1fr;
    }

    .footer-heading,
    .footer-brand-name,
    .footer-nav-link,
    .footer-contact-item,
    .footer-hours-row dt,
    .footer-hours-row dd {
        color: #000 !important;
    }
}


/* ============================================================================
   PRÉFÉRENCES D'ACCESSIBILITÉ SUPPLÉMENTAIRES
   ============================================================================ */

/* Contraste élevé */
@media (prefers-contrast: high) {
    :root {
        --color-sage:       #4a7a47;
        --color-sage-dark:  #2d5c2a;
        --color-text:       #000000;
        --color-text-light: #1a1a1a;
        --color-beige-dark: #999999;
    }

    .specialty-card,
    .team-card {
        border-width: 2px;
        border-color: var(--color-text);
    }

    .btn--primary {
        border: 2px solid #000;
    }

    .nav-link--active {
        border: 2px solid var(--color-sage-dark);
    }
}

/* Mode sombre (optionnel — respecte la préférence système) */
@media (prefers-color-scheme: dark) {
    /* Désactivé volontairement : le cabinet souhaite conserver
       son identité visuelle beige/sauge en toutes circonstances.
       À activer si le client le demande ultérieurement. */
}