﻿/*
Theme Name: Alpine × RSound Connect
Theme URI: https://toofoot.com/rsound-connect
Author: Toofoot SAS
Author URI: https://toofoot.com
Description: Thème premium immersif pour le catalogue Alpine, conçu pour intégrer le plugin RSound Connect de narration vocale scénarisée. Chaque page voiture raconte son histoire à travers le texte, le visuel et la voix.
Version: 1.6.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: Proprietary
License URI: https://toofoot.com/licence
Text Domain: alpine-rsound
Tags: automotive, dark-mode, full-width, custom-post-types, audio

Ce thème a été spécifiquement conçu pour Alpine (Groupe Renault)
en partenariat avec RSound Connect par Toofoot SAS.
*/

/* ========================================================================
   CSS CUSTOM PROPERTIES
   ======================================================================== */

:root {
    /* ------------------------------------------------------------------
       Palette Alpine — basée sur l'identité de marque officielle
       (référence : charte Alpine / Alpine F1)
         Bleu Alpine        #2173B8   (bleu de marque)
         Bleu Alpine clair  #3E92E0   (accents / dégradés sur fond sombre)
         Bleu Alpine foncé  #0F4C86
         Navy Alpine        #02192B   (bleu nuit — fonds profonds, wordmark)
         Rouge Alpine       #E12319   (accent, à utiliser avec parcimonie)
         Blanc              #FFFFFF
       ------------------------------------------------------------------ */
    --alpine-blue: #2173B8;
    --alpine-blue-dark: #0F4C86;
    --alpine-blue-light: #3E92E0;
    --alpine-red: #E12319;
    --alpine-navy: #02192B;
    --alpine-black: #050B12;
    --alpine-dark: #0A141E;
    --alpine-dark-2: #10202E;
    --alpine-dark-3: #1A2E40;
    --alpine-gray: #8A97A5;
    --alpine-gray-light: #BCC6D1;
    --alpine-white: #F4F7FA;
    --alpine-pure-white: #FFFFFF;

    /* Typography — substituts libres des polices Alpine
       Archivo (Expanded) ≈ Alpine Vision (titres) · Inter ≈ Alpine Ascension (textes) */
    --font-heading: 'Archivo', 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
    --font-body: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2.5rem;
    --space-xl: 4rem;
    --space-2xl: 6rem;
    --space-3xl: 10rem;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Layout */
    --container-max: 1400px;
    --container-narrow: 900px;
    --header-height: 80px;
}


/* ========================================================================
   RESET & BASE
   ======================================================================== */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background-color: var(--alpine-black);
    color: var(--alpine-white);
    line-height: 1.7;
    overflow-x: hidden;
}

a {
    color: var(--alpine-blue-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--alpine-blue);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: var(--alpine-pure-white);
}


/* ========================================================================
   LAYOUT
   ======================================================================== */

.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container--narrow {
    max-width: var(--container-narrow);
}

.section {
    padding: var(--space-2xl) 0;
}

.section--dark {
    background-color: var(--alpine-dark);
}

.section--darker {
    background-color: var(--alpine-dark-2);
}


/* ========================================================================
   HEADER / NAVIGATION
   ======================================================================== */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background var(--transition-base);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.site-logo img {
    height: 40px;
    width: auto;
}

.site-logo .logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--alpine-pure-white);
}

.site-logo .logo-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 var(--space-xs);
}

.site-logo .logo-sub {
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--alpine-gray);
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: var(--space-lg);
    align-items: center;
}

.main-nav a {
    color: var(--alpine-gray-light);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    position: relative;
    padding: var(--space-xs) 0;
    transition: color var(--transition-fast);
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--alpine-blue);
    transition: width var(--transition-base);
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--alpine-pure-white);
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-xs);
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--alpine-pure-white);
    margin: 5px 0;
    transition: all var(--transition-fast);
}


/* ========================================================================
   HERO SECTION
   ======================================================================== */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-top: var(--header-height);
}

.hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero__bg img,
.hero__bg video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero__overlay {
    position: absolute;
    inset: 0;
    /* 1.2.0 : la zone médiane (0.1) laissait le titre et le badge se battre
       avec les hautes lumières de la photo. On assombrit le cœur de l'image
       et on ajoute une vignette radiale derrière le bloc de contenu. */
    background:
        radial-gradient(ellipse 62% 52% at 50% 46%, rgba(10, 10, 15, 0.45) 0%, rgba(10, 10, 15, 0) 100%),
        linear-gradient(
            180deg,
            rgba(10, 10, 15, 0.35) 0%,
            rgba(10, 10, 15, 0.3) 40%,
            rgba(10, 10, 15, 0.65) 70%,
            rgba(10, 10, 15, 0.95) 100%
        );
    z-index: 1;
}

.hero__content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: var(--space-xl);
    max-width: 900px;
}

.hero__badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    /* 1.2.0 : lisibilité sur photo. Le libellé (« Collection Alpine ») était
       bleu clair sur les zones claires de l'image ; on l'assoit sur une
       puce sombre semi-opaque et on éclaircit légèrement le texte. */
    color: #C9D8FF;
    background: rgba(10, 10, 15, 0.55);
    border: 1px solid rgba(120, 160, 255, 0.35);
    padding: 0.45em 1.2em;
    border-radius: 100px;
    margin-bottom: var(--space-md);
    backdrop-filter: blur(10px);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

.hero__title {
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 800;
    margin-bottom: var(--space-md);
    line-height: 1.05;
}

.hero__title span {
    display: block;
    background: linear-gradient(135deg, var(--alpine-blue-light), var(--alpine-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    /* 1.2.0 : un texte détouré (background-clip) n'accepte pas text-shadow,
       mais filter: drop-shadow suit la forme des lettres — indispensable
       pour décoller « Heritage Collection » des zones claires de la photo. */
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.55));
}

.hero__subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--alpine-gray-light);
    max-width: 600px;
    margin: 0 auto var(--space-lg);
    line-height: 1.8;
    font-weight: 300;
}

.hero__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    background: var(--alpine-blue);
    color: var(--alpine-pure-white);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-base);
}

.hero__cta:hover {
    background: var(--alpine-blue-dark);
    color: var(--alpine-pure-white);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 85, 255, 0.3);
}

.hero__scroll {
    position: absolute;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    color: var(--alpine-gray);
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    animation: pulse-down 2s ease-in-out infinite;
}

.hero__scroll svg {
    width: 20px;
    height: 20px;
    stroke: var(--alpine-gray);
}

@keyframes pulse-down {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 1; }
    50% { transform: translateX(-50%) translateY(8px); opacity: 0.5; }
}


/* ========================================================================
   CAR GRID (HOME / ARCHIVE)
   ======================================================================== */

.car-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--space-md);
}

.car-card {
    position: relative;
    aspect-ratio: 16 / 10;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: var(--alpine-dark);
}

.car-card__image {
    position: absolute;
    inset: 0;
    transition: transform var(--transition-slow);
}

.car-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.car-card:hover .car-card__image {
    transform: scale(1.05);
}

.car-card__overlay {
    position: absolute;
    inset: 0;
    /* 1.2.0 : sur les visuels clairs (A290 blanche, ciels lumineux), le nom
       et la tagline devenaient illisibles — le dégradé ne démarrait qu'à
       30 % et laissait le bas de carte trop transparent. Départ plus haut,
       pied plus dense. */
    background: linear-gradient(
        180deg,
        rgba(10, 10, 15, 0.15) 0%,
        rgba(10, 10, 15, 0.05) 25%,
        rgba(10, 10, 15, 0.55) 62%,
        rgba(10, 10, 15, 0.94) 100%
    );
    z-index: 1;
    transition: background var(--transition-base);
}

.car-card:hover .car-card__overlay {
    background: linear-gradient(
        180deg,
        transparent 20%,
        rgba(10, 10, 15, 0.9) 100%
    );
}

.car-card__content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-lg);
    z-index: 2;
}

.car-card__badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    /* 1.3.0 : le fond bleu à 15 % ne portait pas sur les visuels clairs
       (bâtiment de l'A390) — le badge s'y effaçait. Fond sombre opaque. */
    color: #D3E0FF;
    background: rgba(6, 12, 22, 0.72);
    padding: 0.35em 0.85em;
    border-radius: 3px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    margin-bottom: var(--space-xs);
}

.car-card__name {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    /* 1.2.0 : filet de sécurité sur visuels clairs, en plus de l'overlay. */
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.65);
}

.car-card__tagline {
    font-size: 0.9rem;
    color: #E6E9EF;
    font-weight: 400;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

.car-card__specs {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-sm);
    opacity: 0;
    transform: translateY(10px);
    transition: all var(--transition-base);
}

.car-card:hover .car-card__specs {
    opacity: 1;
    transform: translateY(0);
}

.car-card__spec {
    display: flex;
    flex-direction: column;
}

.car-card__spec-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--alpine-pure-white);
}

.car-card__spec-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--alpine-gray);
}

.car-card__link {
    position: absolute;
    inset: 0;
    z-index: 3;
}


/* ========================================================================
   SINGLE CAR PAGE
   ======================================================================== */

/* Car Hero */
.car-hero {
    position: relative;
    min-height: 90vh;
    display: flex;
    align-items: flex-end;
    padding-top: var(--header-height);
    overflow: hidden;
}

.car-hero__bg {
    position: absolute;
    inset: 0;
}

.car-hero__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 40%;
}

.car-hero__gradient {
    position: absolute;
    inset: 0;
    /* 1.2.0 : le nom du modèle et la tagline s'affichent dans le tiers bas ;
       la plage 30-60 % restait presque transparente et laissait les photos
       claires (A290 blanche, ciel A390) manger le texte. Bas renforcé. */
    background: linear-gradient(
        180deg,
        rgba(10, 10, 15, 0.25) 0%,
        rgba(10, 10, 15, 0.05) 30%,
        rgba(10, 10, 15, 0.55) 60%,
        rgba(10, 10, 15, 1) 100%
    );
}

.car-hero__content {
    position: relative;
    z-index: 2;
    padding: var(--space-3xl) 0 var(--space-2xl);
    width: 100%;
}

.car-hero__model-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    /* 1.3.0 : c'était le texte le moins lisible du site — bleu clair posé nu
       sur la photo. Illisible sur la carrosserie bleue de l'A290 et sur le
       ciel clair de l'A390. Même traitement que le badge du héros d'accueil :
       puce sombre semi-opaque, texte éclairci. */
    color: #C9D8FF;
    background: rgba(10, 10, 15, 0.55);
    border: 1px solid rgba(120, 160, 255, 0.3);
    padding: 0.45em 1.1em;
    border-radius: 100px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
    margin-bottom: var(--space-sm);
}

.car-hero__name {
    font-size: clamp(3rem, 8vw, 7rem);
    font-weight: 900;
    line-height: 0.95;
    margin-bottom: var(--space-md);
    letter-spacing: 0.005em;
    /* 1.2.0 : lisibilité sur photos claires. */
    text-shadow: 0 3px 18px rgba(0, 0, 0, 0.55);
}

.car-hero__tagline {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    /* 1.2.0 : gris trop faible sur photo — éclairci + ombre portée. */
    color: #E8EBF2;
    font-weight: 300;
    max-width: 600px;
    line-height: 1.6;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

/* Quick Specs Bar */
.quick-specs {
    display: flex;
    gap: var(--space-xl);
    padding: var(--space-lg) 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: var(--space-lg);
    flex-wrap: wrap;
}

.quick-spec {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.quick-spec__value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--alpine-pure-white);
    line-height: 1;
}

.quick-spec__value .unit {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--alpine-gray);
    margin-left: 0.15em;
}

.quick-spec__label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--alpine-gray);
}


/* ========================================================================
   STORY SECTIONS (CAR PAGE CONTENT)
   ======================================================================== */

.story-section {
    padding: var(--space-2xl) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.story-section:last-child {
    border-bottom: none;
}

.story-header {
    margin-bottom: var(--space-xl);
}

.story-header__number {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--alpine-blue);
    margin-bottom: var(--space-xs);
    display: block;
}

.story-header__title {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 800;
}

.story-header__line {
    width: 60px;
    height: 3px;
    background: var(--alpine-blue);
    margin-top: var(--space-sm);
    border-radius: 2px;
}

/* Text + Image Layout */
.story-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    align-items: center;
}

.story-layout--reverse {
    direction: rtl;
}

.story-layout--reverse > * {
    direction: ltr;
}

.story-text p {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--alpine-gray-light);
    margin-bottom: var(--space-md);
}

.story-text p:first-of-type::first-letter {
    font-size: 3rem;
    font-weight: 800;
    color: var(--alpine-blue);
    float: left;
    margin-right: 0.15em;
    margin-top: 0.1em;
    line-height: 0.8;
}

.story-text .highlight {
    color: var(--alpine-pure-white);
    font-weight: 600;
}

/* Contenu saisi dans l'éditeur WordPress (post_content) */
.article-content h2,
.article-content h3 {
    text-transform: uppercase;
    letter-spacing: 0.01em;
}

.article-content h2 {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    margin: var(--space-xl) 0 var(--space-sm);
    padding-top: var(--space-md);
}

.article-content h2::before {
    content: '';
    display: block;
    width: 56px;
    height: 3px;
    background: var(--alpine-blue);
    border-radius: 2px;
    margin-bottom: var(--space-md);
}

.article-content h3 {
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    margin: var(--space-lg) 0 var(--space-xs);
    color: var(--alpine-gray-light);
}

.article-content h2:first-child,
.article-content h3:first-child {
    margin-top: 0;
    padding-top: 0;
}

.article-content p {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--alpine-gray-light);
    margin-bottom: var(--space-md);
}

.article-content img {
    border-radius: 8px;
    margin: var(--space-md) 0;
}

.story-image {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
}

/* 1.2.0 : la photo de l'Héritage (le trio A110/A290/A390) est un plan large ;
   recadrée en 4/3 elle coupait les voitures des extrémités. On la laisse à
   son ratio naturel : toutes les voitures restent visibles. */
#heritage .story-image {
    aspect-ratio: auto;
}

#heritage .story-image img {
    height: auto;
}

.story-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.story-image:hover img {
    transform: scale(1.03);
}


/* ========================================================================
   RSOUND CONNECT INTEGRATION ZONE
   ======================================================================== */

.rsound-zone {
    position: relative;
    background: linear-gradient(135deg, var(--alpine-dark-2), var(--alpine-dark-3));
    border: 1px solid rgba(0, 85, 255, 0.15);
    border-radius: 12px;
    padding: var(--space-lg);
    margin: var(--space-xl) 0;
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    overflow: hidden;
}

.rsound-zone::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(0, 85, 255, 0.08), transparent 70%);
    pointer-events: none;
}

.rsound-zone__icon {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(0, 85, 255, 0.1);
    border: 1px solid rgba(0, 85, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.rsound-zone__icon svg {
    width: 28px;
    height: 28px;
    fill: var(--alpine-blue-light);
}

.rsound-zone__content {
    flex: 1;
}

.rsound-zone__label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--alpine-blue-light);
    margin-bottom: 0.25rem;
}

.rsound-zone__title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.rsound-zone__desc {
    font-size: 0.85rem;
    color: var(--alpine-gray);
}

/* RSound audio player placeholder - will be replaced by the plugin */
.rsound-player-placeholder {
    background: var(--alpine-dark-3);
    border: 1px dashed rgba(0, 85, 255, 0.2);
    border-radius: 8px;
    padding: var(--space-md);
    text-align: center;
    color: var(--alpine-gray);
    font-size: 0.8rem;
}


/* ========================================================================
   SPECS TABLE
   ======================================================================== */

.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    overflow: hidden;
}

.spec-item {
    background: var(--alpine-dark);
    padding: var(--space-md) var(--space-lg);
    /* 1.2.0 : libellé AU-DESSUS de la valeur. L'ancienne disposition en ligne
       (libellé à gauche, valeur à droite) éclatait les valeurs longues sur
       2 à 4 lignes (« BVA 7 rapports double embrayage ») pendant que les
       valeurs courtes tenaient sur une — rendu inégal d'une tuile à l'autre.
       En colonne, la valeur dispose de toute la largeur de la tuile et la
       min-height garde des rangées régulières. */
    display: flex;
    flex-direction: column;
    /* 1.4.0 : chaque tuile porte désormais un texte sous la valeur — on aligne
       en haut plutôt qu'au centre pour que les gloses démarrent au même
       niveau d'une colonne à l'autre. */
    justify-content: flex-start;
    align-items: flex-start;
    gap: 6px;
    min-height: 96px;
}

/* 1.4.0 : chapeau introductif d'une section (coloris, caractéristiques). */
.section-lede {
    max-width: 680px;
    margin: 0 auto var(--space-xl);
    text-align: center;
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--alpine-gray-light);
}

/* ========================================================================
   1.5.0 — SÉLECTEUR DE TEINTES
   Une teinte à la fois plutôt que cinq blocs empilés. Mécanique en CSS pur
   (radio + :checked), sans JavaScript : navigation clavier native, et si le
   CSS ne charge pas, toutes les teintes restent lisibles à la suite.
   ======================================================================== */

.color-picker {
    max-width: 760px;
    margin: 0 auto;
}

/* Les radios pilotent l'affichage mais ne doivent pas être visibles.
   On les garde focusables (pas de display:none) pour le clavier. */
.color-picker__input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.color-picker__swatches {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.color-picker__swatch {
    cursor: pointer;
    line-height: 0;
    padding: 4px;
    border-radius: 50%;
    transition: transform var(--transition-base);
}

.color-picker__chip {
    display: block;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    /* Le liseré garde le Noir Profond visible sur le fond sombre. */
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), 0 4px 14px rgba(0, 0, 0, 0.4);
    transition: box-shadow var(--transition-base);
}

@media (hover: hover) {
    .color-picker__swatch:hover { transform: translateY(-3px); }
}

.color-picker__panel {
    text-align: center;
    animation: colorFade var(--transition-base) ease both;
}

.color-picker__name {
    font-size: 1.35rem;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-sm);
}

.color-picker__text {
    max-width: 560px;
    margin: 0 auto;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--alpine-gray-light);
}

@keyframes colorFade {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

/* Un seul panneau visible : celui dont le radio de même rang est coché.
   Cinq rangs couvrent le nombre maximal de teintes d'un modèle. */
.color-picker__panel { display: none; }

.color-picker__input:nth-of-type(1):checked ~ .color-picker__panels .color-picker__panel:nth-child(1),
.color-picker__input:nth-of-type(2):checked ~ .color-picker__panels .color-picker__panel:nth-child(2),
.color-picker__input:nth-of-type(3):checked ~ .color-picker__panels .color-picker__panel:nth-child(3),
.color-picker__input:nth-of-type(4):checked ~ .color-picker__panels .color-picker__panel:nth-child(4),
.color-picker__input:nth-of-type(5):checked ~ .color-picker__panels .color-picker__panel:nth-child(5) {
    display: block;
}

/* Pastille active : anneau bleu Alpine. */
.color-picker__input:nth-of-type(1):checked ~ .color-picker__swatches .color-picker__swatch:nth-child(1) .color-picker__chip,
.color-picker__input:nth-of-type(2):checked ~ .color-picker__swatches .color-picker__swatch:nth-child(2) .color-picker__chip,
.color-picker__input:nth-of-type(3):checked ~ .color-picker__swatches .color-picker__swatch:nth-child(3) .color-picker__chip,
.color-picker__input:nth-of-type(4):checked ~ .color-picker__swatches .color-picker__swatch:nth-child(4) .color-picker__chip,
.color-picker__input:nth-of-type(5):checked ~ .color-picker__swatches .color-picker__swatch:nth-child(5) .color-picker__chip {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3),
                0 0 0 2px var(--alpine-black),
                0 0 0 4px var(--alpine-blue-light);
}

/* Focus clavier : le radio est masqué, on porte l'anneau sur sa pastille. */
.color-picker__input:nth-of-type(1):focus-visible ~ .color-picker__swatches .color-picker__swatch:nth-child(1),
.color-picker__input:nth-of-type(2):focus-visible ~ .color-picker__swatches .color-picker__swatch:nth-child(2),
.color-picker__input:nth-of-type(3):focus-visible ~ .color-picker__swatches .color-picker__swatch:nth-child(3),
.color-picker__input:nth-of-type(4):focus-visible ~ .color-picker__swatches .color-picker__swatch:nth-child(4),
.color-picker__input:nth-of-type(5):focus-visible ~ .color-picker__swatches .color-picker__swatch:nth-child(5) {
    outline: 2px solid var(--alpine-pure-white);
    outline-offset: 2px;
}

/* Repli sans CSS avancé : tout reste affiché plutôt que rien. */
@supports not (selector(:checked ~ *)) {
    .color-picker__panel { display: block; margin-bottom: var(--space-lg); }
}

@media (max-width: 600px) {
    .color-picker__chip { width: 38px; height: 38px; }
    .color-picker__swatches { gap: var(--space-sm); margin-bottom: var(--space-lg); }
}

/* ========================================================================
   1.5.0 — CHIFFRES CLÉS
   Trois données portent le récit, en grand format ; les autres restent des
   lignes de tableau. Hiérarchie plutôt qu'uniformité.
   ======================================================================== */

.spec-keys {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: var(--space-lg);
}

.spec-key {
    background: var(--alpine-dark);
    padding: var(--space-lg);
}

.spec-key__label {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--alpine-blue-light);
    margin-bottom: var(--space-xs);
}

.spec-key__value {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    margin-bottom: var(--space-sm);
}

.spec-key__num {
    font-family: var(--font-heading);
    font-size: clamp(2.25rem, 4.5vw, 3.25rem);
    font-weight: 800;
    line-height: 1;
    color: var(--alpine-pure-white);
    overflow-wrap: anywhere;
}

/* Certaines données sont des phrases, pas des nombres (« Tri-moteur AWD
   (1 synchrone + 2 aimants permanents) »). Affichées à la taille d'un
   chiffre elles débordaient de leur tuile : le PHP pose cette classe dès
   que la valeur n'est pas numérique. */
.spec-key__num--text {
    font-size: clamp(1.15rem, 2vw, 1.5rem);
    line-height: 1.3;
    letter-spacing: 0.01em;
}

.spec-key__unit {
    font-size: 1rem;
    font-weight: 600;
    color: var(--alpine-gray);
}

.spec-key__text {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--alpine-gray-light);
}

.spec-item__label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--alpine-gray);
}

.spec-item__value {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--alpine-pure-white);
    text-wrap: balance;
}


/* ========================================================================
   GALLERY
   ======================================================================== */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xs);
}

.gallery-grid__item {
    aspect-ratio: 16 / 10;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
}

.gallery-grid__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-base);
}

.gallery-grid__item:hover img {
    transform: scale(1.05);
}

.gallery-grid__item:first-child {
    grid-column: span 2;
    grid-row: span 2;
}


/* ========================================================================
   CTA SECTION
   ======================================================================== */

.cta-section {
    text-align: center;
    padding: var(--space-3xl) 0;
    background: linear-gradient(180deg, var(--alpine-black), var(--alpine-dark));
}

.cta-section__title {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: var(--space-sm);
}

.cta-section__text {
    color: var(--alpine-gray-light);
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto var(--space-lg);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

.btn--primary {
    background: var(--alpine-blue);
    color: var(--alpine-pure-white);
}

.btn--primary:hover {
    background: var(--alpine-blue-dark);
    color: var(--alpine-pure-white);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 85, 255, 0.25);
}

.btn--outline {
    background: transparent;
    color: var(--alpine-pure-white);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn--outline:hover {
    border-color: var(--alpine-blue);
    color: var(--alpine-blue-light);
}


/* ========================================================================
   FOOTER
   ======================================================================== */

.site-footer {
    background: var(--alpine-dark);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding: var(--space-xl) 0 var(--space-lg);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.footer-brand .logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: var(--space-sm);
}

.footer-brand p {
    font-size: 0.85rem;
    color: var(--alpine-gray);
    line-height: 1.7;
    max-width: 300px;
}

.footer-col h4 {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--alpine-gray);
    margin-bottom: var(--space-sm);
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 0.5rem;
}

.footer-col a {
    font-size: 0.85rem;
    color: var(--alpine-gray-light);
    transition: color var(--transition-fast);
}

.footer-col a:hover {
    color: var(--alpine-pure-white);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-bottom p {
    font-size: 0.75rem;
    color: var(--alpine-gray);
}

.footer-bottom .powered-by {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: var(--alpine-gray);
}

.footer-bottom .powered-by img {
    height: 18px;
}


/* ========================================================================
   LOGO EMBLEM
   ======================================================================== */

.site-logo__img {
    height: 30px;
    width: auto;
    display: block;
}

.site-logo__emblem {
    display: inline-flex;
    align-items: center;
}

.site-logo__emblem .alpine-emblem,
.footer-brand__logo .alpine-emblem {
    height: 30px;
    width: auto;
    color: var(--alpine-pure-white);
}

.footer-brand__logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: var(--space-sm);
}

.footer-brand__logo .alpine-emblem {
    /* 1.3.0 : chevron Alpine officiel (ratio 1,84) — hauteur réduite pour
       garder une largeur comparable à l'ancien symbole à côté du mot. */
    height: 20px;
    width: auto;
}

.footer-brand__logo .logo-text {
    margin-bottom: 0;
}

.hero__hero-emblem {
    display: block;
    margin: 0 auto var(--space-md);
}

.hero__hero-emblem .alpine-emblem {
    /* 1.3.0 : le chevron Alpine officiel est nettement plus large que haut
       (ratio 1,84) là où l'ancien symbole était plus haut que large. À 56 px
       de haut il écrasait le titre ; on le pose à 40 px et on le centre. */
    height: 40px;
    width: auto;
    margin: 0 auto;
    filter: drop-shadow(0 4px 24px rgba(33, 115, 184, 0.5));
}


/* ========================================================================
   BRAND PLACEHOLDER (emblème en filigrane — en attendant les photos)
   ======================================================================== */

.alpine-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    background:
        radial-gradient(circle at 30% 30%, rgba(33, 115, 184, 0.12), transparent 60%),
        linear-gradient(135deg, var(--alpine-dark) 0%, var(--alpine-navy) 60%, var(--alpine-black) 100%);
    overflow: hidden;
}

.alpine-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(115deg, rgba(255,255,255,0.015) 0 2px, transparent 2px 26px);
    pointer-events: none;
}

.alpine-placeholder__emblem .alpine-emblem {
    height: 72px;
    width: auto;
    color: rgba(62, 146, 224, 0.35);
    filter: drop-shadow(0 4px 20px rgba(0,0,0,0.4));
}

.alpine-placeholder__label {
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.8rem;
    color: rgba(188, 198, 209, 0.55);
}

/* Placeholder plein écran pour les héros */
.car-hero .alpine-placeholder__emblem .alpine-emblem,
.hero .alpine-placeholder__emblem .alpine-emblem {
    height: 120px;
}


/* ========================================================================
   COLORIS (nuancier peinture Alpine)
   ======================================================================== */

.colors-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-lg);
    justify-content: center;
}

.color-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    width: 150px;
}

.color-swatch__chip {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 4px 20px rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    transition: transform var(--transition-base);
}

.color-swatch:hover .color-swatch__chip {
    transform: translateY(-6px) scale(1.04);
}

.color-swatch__chip::after {
    content: '';
    position: absolute;
    top: 14px;
    left: 22px;
    width: 34px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.35), transparent 70%);
    filter: blur(3px);
}

.color-swatch__name {
    font-size: 0.8rem;
    color: var(--alpine-gray-light);
    text-align: center;
    letter-spacing: 0.02em;
}


/* ========================================================================
   GALLERY (mise à jour)
   ======================================================================== */

.gallery-grid__item {
    position: relative;
}


/* ========================================================================
   ANIMATIONS
   ======================================================================== */

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}


/* ========================================================================
   RESPONSIVE
   ======================================================================== */

@media (max-width: 1024px) {
    .story-layout {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .story-layout--reverse {
        direction: ltr;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .car-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --space-2xl: 4rem;
        --space-3xl: 6rem;
    }

    .main-nav {
        display: none;
    }

    .main-nav.active {
        display: flex;
        position: fixed;
        inset: 0;
        background: rgba(10, 10, 15, 0.98);
        z-index: 999;
        align-items: center;
        justify-content: center;
    }

    .main-nav.active ul {
        flex-direction: column;
        gap: var(--space-lg);
        text-align: center;
    }

    .main-nav.active a {
        font-size: 1.25rem;
    }

    .menu-toggle {
        display: block;
        z-index: 1001;
    }

    .hero__title {
        font-size: 2.5rem;
    }

    .quick-specs {
        gap: var(--space-md);
    }

    .gallery-grid {
        grid-template-columns: 1fr 1fr;
    }

    .gallery-grid__item:first-child {
        grid-column: span 2;
        grid-row: auto;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-sm);
        text-align: center;
    }

    .rsound-zone {
        flex-direction: column;
        text-align: center;
    }

    .specs-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero__content {
        padding: var(--space-md);
    }

    .car-hero__name {
        font-size: 2.5rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-grid__item:first-child {
        grid-column: auto;
    }
}
