/* =========================================================================
   Codony Motocycles — charte reprise de la maquette Lovable
   « codony-moto-reimagined » (valeurs relevées dans sa feuille compilée).
   ========================================================================= */

@font-face {
    font-family: "Bebas Neue";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/bebas-neue-latin.woff2") format("woff2");
}
@font-face {
    font-family: "DM Sans";
    font-style: normal;
    font-weight: 300 600;
    font-display: swap;
    src: url("../fonts/dm-sans-latin.woff2") format("woff2");
}

:root {
    --ink: oklch(14.5% 0 0);
    --paper: oklch(96.9% .004 106.5);
    --stone: oklch(61.6% 0 0);
    --primary: oklch(59.2% .229 27.4);
    --secondary: oklch(92% .003 106.5);
    --muted-foreground: oklch(47% 0 0);
    --border: oklch(84% .002 106.5);
    --on-dark-muted: oklch(74% 0 0);
    --header-shadow: 0 4px 24px oklch(14.5% 0 0 / .08);
    --font-display: "Bebas Neue", "Arial Narrow", sans-serif;
    --font-body: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --header-h: 76px;
}

/* --- Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; border: 0 solid var(--border); margin: 0; padding: 0; letter-spacing: 0; }
html { -webkit-text-size-adjust: 100%; line-height: 1.5; }
body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}
body.cd-menu-ouvert { overflow: hidden; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: inherit; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; background: none; }
button { cursor: pointer; }
ul, ol { list-style: none; }
h1, h2, h3 { font-family: var(--font-display); text-transform: uppercase; font-weight: 400; font-size: inherit; }
a:focus-visible, button:focus-visible, select:focus-visible { outline: 2px solid var(--primary); outline-offset: 5px; }
::selection { background: var(--primary); color: var(--paper); }
/* Un élément masqué reste masqué, même si une règle de carte le passe en flex. */
[hidden] { display: none !important; }
.cd-ico { flex-shrink: 0; pointer-events: none; }

.site-container { width: 100%; max-width: 1400px; margin-inline: auto; padding-inline: 40px; }

.skip-link { position: fixed; top: -100px; z-index: 100; background: var(--paper); color: var(--ink); padding: 15px; }
.skip-link:focus { top: 0; }

/* --- En-tête ------------------------------------------------------------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: var(--paper);
    border-bottom: 2px solid var(--ink);
    transition: box-shadow .25s;
}
.admin-bar .site-header { top: 32px; }
.site-header.scrolled { box-shadow: var(--header-shadow); }
.header-inner { display: flex; justify-content: space-between; align-items: center; height: var(--header-h); }
.wordmark { font-family: var(--font-display); color: inherit; font-size: 34px; line-height: 1; text-decoration: none; }
.wordmark small { display: block; margin-top: 4px; font-family: var(--font-body); font-size: 8px; text-align: center; }
.site-nav { display: flex; align-items: center; gap: 26px; }
.site-nav a {
    text-transform: uppercase; font-size: 12px; font-weight: 500;
    padding-block: 10px; border-bottom: 1px solid transparent;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--primary); border-color: var(--primary); }

.mobile-menu-button {
    display: none; align-items: center; justify-content: center;
    width: 36px; height: 36px; color: inherit;
}
.mobile-menu-button:hover { color: var(--primary); }
.mobile-menu-button .cd-ico { width: 16px; height: 16px; }

/* Panneau plein écran du menu mobile (sous 1024 px). */
.mobile-panel {
    position: fixed; inset: 0; z-index: 200;
    display: flex; flex-direction: column;
    background: var(--paper);
    overflow-y: auto;
}
.mobile-panel__haut {
    display: flex; justify-content: space-between; align-items: center;
    min-height: 66px; border-bottom: 2px solid var(--ink);
}
.mobile-panel__nav { display: flex; flex-direction: column; padding-block: 24px; }
.mobile-panel__nav a {
    font-family: var(--font-display); font-size: 40px; line-height: 1;
    padding-block: 14px; border-bottom: 1px solid var(--border);
}
.mobile-panel__nav a:hover, .mobile-panel__nav a[aria-current="page"] { color: var(--primary); }
.mobile-panel__cta { padding-bottom: 32px; }
.mobile-panel__cta .editorial-button { width: 100%; }

/* --- Boutons et liens ---------------------------------------------------- */
.editorial-button {
    display: inline-flex; align-items: center; justify-content: space-between; gap: 24px;
    min-height: 50px; padding: 16px 24px;
    background: var(--primary); color: var(--paper);
    text-transform: uppercase; font-size: 12px; font-weight: 500; line-height: calc(1.25 / .875);
    text-align: center; text-decoration: none;
    transition: background-color .15s, color .15s;
}
.editorial-button:hover { background: var(--ink); color: var(--paper); }
.editorial-button .cd-ico { width: 16px; height: 16px; }
.dark-band .editorial-button:hover { background: var(--paper); color: var(--ink); }

.text-link {
    display: inline-flex; align-items: center; gap: 12px;
    margin-top: 26px; padding-bottom: 6px;
    border-bottom: 2px solid var(--primary);
    text-transform: uppercase; font-size: 12px; font-weight: 400; color: inherit; text-decoration: none;
    transition: color .15s;
}
.text-link:hover { color: var(--primary); }
.text-links { display: flex; flex-direction: column; align-items: flex-start; }

.eyebrow { margin: 0 0 16px; text-transform: uppercase; color: var(--ink); font-size: 11px; font-weight: 500; }
.eyebrow::before { content: ""; display: inline-block; width: 24px; height: 2px; margin-right: 10px; vertical-align: middle; background: var(--primary); }

/* --- Hero ---------------------------------------------------------------- */
.hero {
    position: relative; overflow: hidden;
    height: 660px; min-height: 490px; max-height: calc(100svh - 160px);
    background: var(--ink); color: var(--paper);
}
.hero-image {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; object-position: center;
    will-change: transform;
}
/* Photo en couleur : un dégradé noir sous le titre garde le texte blanc lisible. */
.hero::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background:
        linear-gradient(to top, oklch(14.5% 0 0 / .75) 0%, oklch(14.5% 0 0 / .15) 55%, transparent 80%),
        linear-gradient(to right, oklch(14.5% 0 0 / .45) 0%, transparent 60%);
}
.hero-content {
    position: relative; z-index: 1; height: 100%;
    display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start;
    padding-bottom: 54px;
}
.hero .eyebrow { color: var(--paper); }
.hero-title { max-width: 800px; margin: 0 0 30px; font-size: 148px; line-height: .84; }
.hero-title span { display: block; }

/* --- Bandeau des marques ------------------------------------------------- */
.brand-band { background: var(--ink); color: var(--paper); }
.brands { display: flex; flex-wrap: wrap; align-items: center; gap: 40px; padding-block: 22px; }
.brands a { font-family: var(--font-display); font-size: 25px; transition: color .15s; }
.brands a:hover { color: var(--primary); }
.brands i { color: var(--primary); font-size: 15px; font-style: normal; }

/* --- Sections ------------------------------------------------------------ */
.section { padding-block: 88px; }
.section-title { margin: 0; font-size: 64px; line-height: .95; }
.section-copy, .section-copy p { color: var(--muted-foreground); max-width: 44ch; margin: 22px 0 0; font-size: 15px; line-height: 1.8; }
.dark-band { background: var(--ink); color: var(--paper); }
.dark-band .section-copy, .dark-band .section-copy p { color: var(--on-dark-muted); }
.dark-band .eyebrow { color: var(--paper); }

/* Sélection : grille éditoriale en 12 colonnes. */
.selection-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: start; gap: 40px; }
.selection-intro { grid-area: 1 / 1 / auto / span 4; padding-top: 40px; }
.selection-vespa { aspect-ratio: 4 / 5; grid-area: 1 / 8 / auto / span 5; }
.selection-piaggio { aspect-ratio: 4 / 3; grid-area: 2 / 3 / auto / span 5; }
.selection-peugeot { aspect-ratio: 4 / 3; grid-area: 2 / 8 / auto / span 5; }
.selection-grid .photo-link img { width: 100%; height: 100%; object-fit: cover; }

.photo-link { position: relative; display: block; overflow: hidden; color: var(--ink); background: var(--secondary); }
.photo-link img, .editorial-photo {
    display: block; width: 100%; height: auto; object-fit: cover;
    transition: transform .65s;
}
.photo-link:hover img { transform: scale(1.025); }
.photo-label { position: absolute; top: 18px; left: 20px; padding: 3px 10px; background: var(--ink); color: var(--paper); font-family: var(--font-display); font-size: 25px; }
.photo-arrow { position: absolute; right: 16px; bottom: 16px; display: grid; place-items: center; width: 40px; height: 40px; background: var(--primary); color: var(--paper); transition: background-color .15s; }
.photo-link:hover .photo-arrow { background: var(--ink); }
.photo-arrow .cd-ico { width: 20px; height: 20px; }

/* La maison. */
.house-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.house-copy { grid-column: 2; }
.house-grid > img { grid-column: 1; grid-row: 1; aspect-ratio: 4 / 3; height: 100%; align-self: center; object-fit: cover; }

/* Chiffres clés. */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); padding-block: 64px; border-bottom: 2px solid var(--ink); }
.stat { padding-inline: 34px; border-left: 1px solid var(--border); }
.stat:first-child { border: 0; padding-left: 0; }
.stat-number { display: block; font-family: var(--font-display); font-size: 110px; line-height: 1; color: var(--primary); }
.stat-caption { display: block; margin-top: 12px; text-transform: uppercase; color: var(--muted-foreground); font-size: 11px; line-height: 1.6; }

/* Atelier. */
.workshop-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: end; gap: 40px; }
.workshop-grid > img { grid-column: 1 / span 7; aspect-ratio: 1440 / 912; }
.workshop-copy { grid-column: 9 / span 4; }

/* --- Pages intérieures --------------------------------------------------- */
.page-heading { padding-block: 70px 48px; border-bottom: 2px solid var(--ink); }
.page-heading h1 { margin: 0; font-size: 100px; line-height: 1; }
.page-heading p { max-width: 58ch; color: var(--muted-foreground); line-height: 1.8; }
.page-heading .editorial-button { margin-top: 30px; }

.content-grid { display: grid; grid-template-columns: 1.2fr 1fr; align-items: start; gap: 70px; }
.content-grid h2 { margin: 0 0 24px; font-size: 48px; }
.content-grid p, .cd-texte p { color: var(--muted-foreground); line-height: 1.8; }
.dark-band .content-grid p { color: var(--on-dark-muted); }
.cd-texte:not(.section-copy) > :first-child { margin-top: 0; }
.cd-texte.section-copy { margin-top: 0; max-width: none; }
.cd-texte h3 { margin: 28px 0 0; font-size: 30px; line-height: 1.5; color: inherit; }
.cd-texte h3 + p { margin-top: 22px; }
.cd-texte a { text-decoration: underline; text-underline-offset: 4px; }
.cd-texte a:hover { color: var(--primary); }
.cd-texte strong { color: var(--ink); font-weight: 500; }
.dark-band .cd-texte strong { color: var(--paper); }
.cd-texte h2 { margin: 0 0 24px; font-size: 48px; }
.cd-texte--article { max-width: 70ch; }

.service-list { margin: 30px 0; }
.service-list li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.service-list li span { color: var(--primary); font-weight: 500; }
.service-list a { color: inherit; text-decoration: none; transition: color .15s; }
.service-list a:hover { color: var(--primary); }
.service-list li:has(a:hover) { color: var(--primary); }
.service-list .cd-ico { width: 16px; height: 16px; }

.equipment-row { border-bottom: 1px solid var(--border); }
.equipment-row > img { aspect-ratio: 4 / 3; object-fit: cover; }
.reverse-row > img { order: 2; }

.team-photo { filter: none; max-width: 850px; margin-inline: auto; }
.team-photo:hover { filter: none; }
.team-list li { display: flex; flex-direction: column; gap: 6px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.team-list strong { font-weight: 500; }
.team-list span { color: var(--muted-foreground); font-size: 13px; }

.image-note { padding-bottom: 44px; color: var(--muted-foreground); font-size: 11px; }
.empty-state { padding: 60px 0; }

/* Véhicules. */
.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 20px; padding-block: 30px; border-bottom: 1px solid var(--border); }
.filter-field { display: flex; flex-direction: column; gap: 8px; min-width: 180px; text-transform: uppercase; font-size: 11px; }
.filter-field select { min-height: 46px; padding: 12px; border: 1px solid var(--border); color: var(--ink); font-size: 14px; text-transform: none; }
.range-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; padding-block: 42px 20px; }
.range-item img { aspect-ratio: 4 / 5; object-fit: cover; background: var(--secondary); }
.range-item h2 { margin: 18px 0 5px; font-size: 36px; }
.range-item p { color: var(--muted-foreground); font-size: 13px; line-height: 1.7; }
.range-item .text-link { margin-top: 12px; }

/* Actualités. */
.archive-item { padding: 36px 0; border-bottom: 1px solid var(--border); }
.archive-item:first-child { padding-top: 0; }
.archive-item h2 { margin: 0; font-size: 42px; }
.nav-links { display: flex; gap: 16px; padding-top: 30px; font-size: 14px; }
.nav-links .current { color: var(--primary); }

/* Contact. */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; }
.contact-block { padding-block: 28px; border-bottom: 1px solid var(--border); }
.contact-block h2 { margin: 0 0 15px; font-size: 34px; }
.contact-block p, .contact-block .cd-texte p { margin: 0; color: var(--muted-foreground); line-height: 1.8; }
.contact-block a:not(.text-link):not(.editorial-button) { color: inherit; text-decoration: underline; text-underline-offset: 4px; }
.contact-block a:not(.text-link):not(.editorial-button):hover { color: var(--primary); }
.hours { display: flex; justify-content: space-between; gap: 20px; margin: 12px 0; font-size: 14px; }
.hours span:last-child { text-align: right; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 25px; }

/* --- Pied de page -------------------------------------------------------- */
.site-footer { background: var(--ink); color: var(--paper); border-top: 4px solid var(--primary); }
.footer-content { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.4fr; gap: 32px; padding-block: 54px; border-bottom: 1px solid var(--stone); }
.footer-content p { margin: 15px 0; color: var(--on-dark-muted); font-size: 12px; line-height: 1.8; }
.footer-content nav { display: flex; flex-direction: column; gap: 14px; }
.footer-content a, .footer-inner > a { font-size: 12px; transition: color .15s; }
.footer-content .wordmark { font-size: 30px; }
.footer-content a:hover, .footer-inner > a:hover { color: var(--primary); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-block: 40px; }
.footer-inner p { margin: 0; color: var(--on-dark-muted); font-size: 12px; }

/* --- Apparitions au défilement (activées par main.js) --------------------- */
.reveal { transition: opacity .7s, transform .7s; }
.motion-ready .reveal:not(.visible) { opacity: 0; transform: translateY(16px); }

/* --- Responsive ---------------------------------------------------------- */
@media (min-width: 1500px) {
    .hero-title { font-size: 170px; }
}

@media (max-width: 1023px) {
    :root { --header-h: 66px; }
    .site-nav { display: none; }
    .mobile-menu-button { display: inline-flex; }
    .wordmark { font-size: 29px; }
}

@media (max-width: 900px) {
    .hero-title { font-size: 112px; }
    .section-title { font-size: 50px; }
    .selection-grid { gap: 38px 24px; }
    .stat-number { font-size: 85px; }
    .workshop-copy { grid-column: 8 / span 5; }
    .content-grid { gap: 32px; }
    .page-heading h1 { font-size: 80px; }
    .footer-content { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 782px) {
    .admin-bar .site-header { top: 46px; }
}

/* Sous 768 px : une colonne, et tout est centré (titres, textes, boutons, cartes). */
@media (max-width: 767px) {
    .site-container { padding-inline: 22px; }
    .hero { height: 590px; min-height: 460px; max-height: calc(100svh - 155px); }
    .hero-image { object-position: 64% center; }
    .hero-content { align-items: center; text-align: center; padding-bottom: 32px; }
    .hero-title { max-width: 100%; margin-bottom: 26px; font-size: 76px; line-height: .9; }
    .hero .eyebrow { max-width: 26ch; font-size: 10px; line-height: 1.6; }
    .brands { justify-content: center; gap: 13px 22px; padding-block: 18px; }
    .brands a { font-size: 19px; }
    .brands i { display: none; }
    .section { padding-block: 56px; }
    .section-title { font-size: 52px; }
    .section-copy, .section-copy p { margin-inline: auto; }
    .selection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 14px; }
    .selection-intro { grid-area: auto / 1 / auto / -1; padding-top: 0; padding-bottom: 6px; text-align: center; }
    .selection-vespa { grid-area: auto / 1 / auto / -1; }
    .selection-piaggio { aspect-ratio: 4 / 5; grid-area: auto / 1; }
    .selection-peugeot { aspect-ratio: 4 / 5; grid-area: auto / 2; }
    .photo-label { top: 12px; left: 12px; font-size: 22px; }
    .photo-arrow { width: 32px; height: 32px; }
    .house-grid { grid-template-columns: 1fr; text-align: center; }
    .house-copy, .house-grid > img { grid-column: 1; grid-row: auto; }
    .house-grid > img { height: auto; }
    .stats { padding-block: 40px; text-align: center; }
    .stat { padding-inline: 12px; }
    .stat:first-child { padding-left: 12px; }
    .stat-number { font-size: 56px; }
    .stat-caption { margin-top: 6px; font-size: 9px; }
    .workshop-grid { grid-template-columns: 1fr; gap: 28px; text-align: center; }
    .workshop-grid > img, .workshop-copy { grid-column: 1; }
    .page-heading { padding-block: 44px 30px; text-align: center; }
    .page-heading h1 { font-size: 65px; overflow-wrap: anywhere; }
    .page-heading p { margin-inline: auto; }
    .content-grid, .contact-grid { grid-template-columns: 1fr; gap: 34px; text-align: center; }
    .content-grid h2 { font-size: 42px; }
    .reverse-row > img { order: 0; }
    .text-links { align-items: center; }
    .service-list li, .team-list li { text-align: left; }
    .range-grid { grid-template-columns: 1fr; text-align: center; }
    .filter-bar { gap: 16px; }
    .filter-field { flex: 1; min-width: 0; text-align: left; }
    .archive-item { text-align: center; }
    .hours { font-size: 13px; text-align: left; }
    .contact-actions { justify-content: center; }
    .image-note { text-align: center; }
    .footer-content { grid-template-columns: 1fr 1fr; gap: 30px 18px; text-align: center; }
    .footer-content nav { align-items: center; }
    .footer-content > div:first-child, .footer-content > div:last-child { grid-column: 1 / -1; }
    .footer-inner { flex-direction: column; gap: 16px; text-align: center; }
}

@media (max-width: 370px) {
    .hero-title { font-size: 66px; }
    .stat-number { font-size: 48px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
    .motion-ready .reveal:not(.visible) { opacity: 1; transform: none; }
    .hero-image { transform: none !important; }
}
