/* Auto-école Martin, version « classique » : reprend l'apparence de l'ancien site (fond anthracite, bandes rouges, motif carbone). Mobile d'abord. */

:root {
    --red: #e20715;
    --red-dark: #b0050f;
    --bg: #29292a;
    --band-dark: #242424;
    --line: #3e3e3e;
    --text: #aaa9a9;
    --muted: #8c8989;
    --white: #ffffff;
    --green: #5fbf6f;
    --carbon: #353535 url("images/carbon.png") center / auto repeat;
    --font: "Open Sans", Arial, sans-serif;
    --font-title: "Antic Slab", Georgia, serif;
    --font-condensed: "Open Sans Condensed", "Arial Narrow", sans-serif;
    --font-menu: "Electrolize", var(--font);
    --header-h: 76px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    padding-bottom: 56px; /* barre d'appel mobile */
}

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

a { color: var(--red); text-decoration: none; }
a:hover { color: var(--white); }

h1, h2, h3 { font-family: var(--font-title); font-weight: 400; line-height: 1.3; color: var(--white); }

:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.container { width: 100%; max-width: 1266px; margin: 0 auto; padding: 0 16px; }

.visually-hidden, .hp {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--red); color: #fff; padding: 10px 14px; }
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- Boutons ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 42px; padding: 9px 22px;
    border: 1px solid transparent; border-radius: 2px;
    font: 600 .85rem/1.2 var(--font); text-transform: uppercase; letter-spacing: .04em;
    cursor: pointer; transition: background-color .2s, color .2s, border-color .2s;
}
.btn--primary { background: var(--red); color: #fff; }
.btn--primary:hover { background: var(--red-dark); color: #fff; }
.btn--light { background: #fff; color: var(--bg); }
.btn--light:hover { background: var(--red); color: #fff; }
.btn--ghost { border-color: #fff; color: #fff; background: transparent; }
.btn--ghost:hover { background: #fff; color: var(--bg); }
.btn--lg { min-height: 48px; padding: 12px 28px; }

/* ---------- Bandeau d'annonces ---------- */

.notice-bar { background: var(--bg); text-align: center; padding: 32px 0 8px; font-family: var(--font-title); }
.notice-bar__label { margin: 0 0 12px; color: var(--red); font-size: 1.6rem; font-weight: 700; text-transform: uppercase; }
.notice-bar ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.notice-bar li { color: var(--red); font-size: 1.2rem; font-weight: 700; }
.notice-bar li:first-child { font-size: 1.45rem; }

/* Encadré « Informations » de l'accueil : la présentation de l'ancien site */
.home-notices { background: var(--bg); text-align: center; padding: 40px 0 8px; font-family: var(--font-title); }
.home-notices__title { margin: 0 0 12px; color: var(--red); font-size: 1.6rem; font-weight: 700; text-transform: uppercase; }
.home-notices ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.home-notices li { color: var(--red); font-size: 1.2rem; font-weight: 700; }
.home-notices li:first-child { font-size: 1.45rem; }

/* ---------- En-tête ---------- */

.site-header {
    position: sticky; top: 0; z-index: 50;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: 16px; }

.brand img { width: 190px; height: auto; }

.nav-toggle {
    display: inline-flex; align-items: center; gap: 10px;
    min-height: 44px; padding: 8px 12px;
    background: none; color: #fff; border: 1px solid var(--line);
    font: 400 1rem var(--font-menu); text-transform: uppercase; cursor: pointer;
}
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
    display: block; width: 20px; height: 2px; background: currentColor;
    transition: transform .2s, background-color .2s;
}
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

.site-nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--band-dark); border-bottom: 3px solid var(--red);
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
}
.site-nav.is-open { display: block; }
.site-nav__list { list-style: none; margin: 0; padding: 0 16px 12px; }
.site-nav__list > li { border-bottom: 1px solid var(--line); }
.site-nav__list > li:last-child { border-bottom: 0; }
.site-nav a, .site-nav__sub-toggle {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    min-height: 48px; padding: 10px 4px;
    font: 400 1rem var(--font-menu); text-transform: uppercase; color: #fff;
    background: none; border: 0; cursor: pointer; text-align: left;
}
.site-nav a:hover, .site-nav__sub-toggle:hover { color: var(--red); }
.site-nav__sub-toggle::after {
    content: ""; width: 7px; height: 7px; margin-right: 6px;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px); transition: transform .2s;
}
.site-nav__sub-toggle[aria-expanded="true"]::after { transform: rotate(-135deg) translateY(-2px); }
.site-nav__sub { display: none; list-style: none; margin: 0 0 10px; padding: 0 0 0 14px; }
.site-nav__sub.is-open { display: block; }
.site-nav__sub a { font: 400 .92rem var(--font); text-transform: none; min-height: 40px; color: var(--text); }
.site-nav a[aria-current="page"], .site-nav .is-active > a, .site-nav .is-active > .site-nav__sub-toggle { color: var(--red); }

/* ---------- Accueil ---------- */

.slider { position: relative; aspect-ratio: 1266 / 600; max-height: 600px; width: 100%; overflow: hidden; background: var(--band-dark); }
.slider__slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1s ease; }
.slider__slide.is-active { opacity: 1; }
.slider__dots { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 10px; }
.slider__dots button { width: 12px; height: 12px; padding: 0; border: 2px solid #fff; border-radius: 50%; background: transparent; cursor: pointer; }
.slider__dots button[aria-current="true"] { background: #fff; }

.intro { padding: 40px 0 48px; }
.intro h1 { margin: 0; font-size: 1.9rem; }
.intro__sub { margin: 0 0 24px; font-family: var(--font-title); font-size: 1.25rem; color: #fff; }
.intro .prose { max-width: none; }

.band { padding: 40px 0; }
.band--red { background: var(--red); }
.band--dark { background: var(--band-dark); }

.cards { display: grid; gap: 20px; }
.card {
    display: flex; flex-direction: column;
    border: 1px solid rgba(255, 255, 255, .85);
    color: #fff; transition: background-color .25s;
}
.card:hover { background: rgba(0, 0, 0, .15); color: #fff; }
.band--dark .card:hover { background: rgba(255, 255, 255, .05); }
.card__body { display: flex; flex-direction: column; gap: 14px; padding: 30px 24px 22px; flex: 1; }
.card__title { font-family: var(--font-title); font-size: 1.75rem; line-height: 1.2; color: #fff; }
.card__text { font-size: .95rem; color: #fff; }
.card__more { margin-top: auto; padding-top: 8px; font-size: .92rem; color: #fff; }
.card:hover .card__more { text-decoration: underline; }

/* ---------- Agences ---------- */

.agencies { display: grid; gap: 20px; }
.agencies--page { margin-top: 28px; }
.agency { background: var(--band-dark); border: 1px solid var(--line); display: flex; flex-direction: column; }
.agency__photo { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; }
.agency__body { padding: 22px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.agency__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.agency__head h3 { margin: 0; font-size: 1.5rem; text-transform: uppercase; }
.agency__address { margin: 0; }
.agency__note { margin: 0; font-size: .88rem; color: #fff; border-left: 3px solid var(--red); padding: 4px 10px; }
.agency__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; text-transform: uppercase; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge--open { color: var(--green); }
.badge--closed { color: var(--muted); }

.hours { width: 100%; border-collapse: collapse; font-size: .93rem; }
.hours th, .hours td { padding: 7px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.hours th { font-weight: 400; width: 38%; }
.hours tr.is-today th, .hours tr.is-today td { color: #fff; font-weight: 700; }
.hours tr.is-today th::after { content: " · aujourd'hui"; font-weight: 400; font-size: .78rem; color: var(--red); }

/* ---------- Pages intérieures ---------- */

.page-hero { background: var(--carbon); border-bottom: 1px solid #464646; }
.page-hero__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 24px; min-height: 87px; padding-top: 14px; padding-bottom: 14px; }
.page-hero h1 { margin: 0; font-family: var(--font-condensed); font-weight: 700; font-size: 1.7rem; line-height: 1.2; color: #fff; text-transform: uppercase; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: .85rem; color: var(--text); }
.breadcrumb a { color: var(--text); }
.breadcrumb a:hover { color: #fff; }
.breadcrumb > * + *::before { content: "/"; margin-right: 6px; opacity: .6; }

.page-banner { height: 180px; background: var(--band-dark) var(--hero-image) center / cover no-repeat; border-bottom: 4px solid var(--red); }

.page-layout { display: grid; gap: 32px; padding-top: 40px; padding-bottom: 56px; }
.page-main { min-width: 0; }

.aside-box { background: var(--band-dark); border: 1px solid var(--line); padding: 18px 20px; }
.aside-box + .aside-box { margin-top: 16px; }
.aside-box h2 { font-size: 1.15rem; text-transform: uppercase; margin: 0 0 10px; padding-bottom: 8px; border-bottom: 2px solid var(--red); }
.aside-box ul { list-style: none; margin: 0; padding: 0; }
.aside-box li a { display: block; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.aside-box li:last-child a { border-bottom: 0; }
.aside-box li a:hover { color: var(--red); }
.aside-box--call { background: var(--red); border-color: var(--red); }
.aside-box--call h2 { border-color: #fff; }
.aside-box--call p { margin: 6px 0; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: #fff; }
.aside-box--call a { color: #fff; font-weight: 700; }

/* Contenu rédigé dans l'admin */
.prose { max-width: 80ch; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 1.6rem; margin: 1.6em 0 .5em; }
.prose h3 { font-size: 1.3rem; margin: 1.4em 0 .4em; }
.prose strong { color: #fff; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; }
.prose ul { padding-left: 0; list-style: none; }
.prose ul li { position: relative; padding-left: 22px; margin-bottom: .45em; }
.prose ul li::before { content: ""; position: absolute; left: 4px; top: .6em; width: 7px; height: 7px; background: var(--red); }
.prose ol { padding-left: 1.4em; }
.prose img { margin: 1.2em 0; }
/* Pictogrammes de l'ancien site, dessinés en blanc pour ce fond sombre. */
.prose img[src$=".svg"] { width: 220px; max-width: 100%; }
.prose iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; margin: 1em 0; }
.prose blockquote { margin: 1.4em 0; padding: 12px 18px; background: var(--band-dark); border-left: 4px solid var(--red); }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose a[href$=".pdf"]::after { content: " (PDF)"; font-size: .8em; color: var(--muted); }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.prose th { color: #fff; }
.prose--intro { margin: 0 auto; }

/* ---------- Galerie ---------- */

.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 28px; }
.gallery__item { display: block; overflow: hidden; background: var(--band-dark); }
.gallery__item img { width: 100%; height: 100%; aspect-ratio: 1; object-fit: cover; transition: opacity .3s; }
.gallery__item:hover img { opacity: .75; }

.lightbox {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0, 0, 0, .94);
    display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 12px;
    padding: 56px 12px 24px;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-height: calc(100vh - 120px); width: auto; }
.lightbox p { color: #fff; margin: 0; font-size: .9rem; }
.lightbox button {
    position: absolute; background: rgba(255, 255, 255, .12); color: #fff; border: 0;
    width: 48px; height: 48px; font-size: 1.5rem; cursor: pointer;
}
.lightbox button:hover { background: var(--red); }
.lightbox__close { top: 12px; right: 12px; }
.lightbox__prev { left: 12px; top: 50%; }
.lightbox__next { right: 12px; top: 50%; }

/* ---------- Contact ---------- */

.contact-grid { display: grid; gap: 24px; margin-top: 28px; }
.contact-form-wrap { background: var(--band-dark); border: 1px solid var(--line); padding: 22px 18px; }
.contact-form-wrap h2 { margin: 0 0 16px; font-size: 1.5rem; }
.contact-form { display: grid; gap: 14px; }
.field-row { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; font-size: .9rem; color: #fff; }
.field input, .field select, .field textarea {
    width: 100%; min-height: 44px; padding: 9px 12px;
    font: 400 .95rem var(--font); color: #ccc;
    background: var(--bg); border: 1px solid var(--line); border-radius: 0;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--red); }
.field [aria-invalid="true"] { border-color: var(--red); }
.field__error { color: var(--red); font-size: .85rem; }
.form-note { margin: 0; font-size: .85rem; color: var(--muted); }
.contact-agencies { display: grid; gap: 16px; align-content: start; }

.alert { padding: 14px 16px; margin-bottom: 16px; border-left: 4px solid; }
.alert--success { background: rgba(95, 191, 111, .12); color: var(--green); }
.alert--error { background: rgba(226, 7, 21, .12); color: #ff6b74; }

/* ---------- Pied de page ---------- */

.site-footer { color: var(--muted); font-size: .9rem; }
.site-footer__grid { display: grid; gap: 32px; padding-top: 48px; padding-bottom: 48px; }
.site-footer { background: var(--carbon); }
.site-footer h2 { color: #fff; font-family: var(--font-title); font-size: 1.05rem; text-transform: uppercase; margin: 0 0 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { padding: 3px 0; }
.site-footer a { color: var(--red); }
.site-footer a:hover { color: #fff; }
.site-footer__phone { font-weight: 700; }
.site-footer__bottom { background: #292929; border-top: 1px solid #4b4c4d; padding: 18px 0 16px; font-size: .8rem; }
.site-footer__bottom p { margin: 0; }
.site-footer__bottom a { color: var(--muted); }
.site-footer__bottom a:hover { color: #fff; }

/* Barre d'appel fixe (mobile) */
.call-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    display: flex; background: var(--red);
    padding-bottom: env(safe-area-inset-bottom);
}
.call-bar a {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 56px; color: #fff; font-family: var(--font-menu); text-transform: uppercase; font-size: .9rem;
}
.call-bar a + a { border-left: 1px solid rgba(255, 255, 255, .3); }

/* ---------- Écrans plus larges ---------- */

@media (min-width: 600px) {
    .gallery { grid-template-columns: repeat(3, 1fr); }
    .field-row { grid-template-columns: 1fr 1fr; }
    .site-footer__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 860px) {
    .cards { grid-template-columns: repeat(3, 1fr); gap: 30px; }
    .agencies { grid-template-columns: repeat(2, 1fr); }
    .site-footer__grid { grid-template-columns: repeat(3, 1fr); }
    .page-layout--aside { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
    .page-aside { position: sticky; top: calc(var(--header-h) + 20px); }
    .contact-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
    .gallery { grid-template-columns: repeat(4, 1fr); }
    .intro { padding: 60px 0 70px; }
    .intro .prose { text-align: justify; }
    .intro h1 { font-size: 2.2rem; }
    .band { padding: 50px 0; }
    .page-banner { height: 260px; }
    .notice-bar__label { font-size: 2rem; }
    .notice-bar li { font-size: 1.4rem; }
    .notice-bar li:first-child { font-size: 1.8rem; }
    .home-notices__title { font-size: 2rem; }
    .home-notices li { font-size: 1.4rem; }
    .home-notices li:first-child { font-size: 1.8rem; }
}

@media (min-width: 1000px) {
    :root { --header-h: 100px; }
    body { padding-bottom: 0; }
    .call-bar { display: none; }
    .brand img { width: 260px; }

    .nav-toggle { display: none; }
    .site-nav {
        display: block; position: static; background: none; border: 0;
        max-height: none; overflow: visible;
    }
    .site-nav__list { display: flex; align-items: stretch; gap: 26px; padding: 0; }
    .site-nav__list > li { border: 0; position: relative; }
    .site-nav a, .site-nav__sub-toggle { min-height: var(--header-h); padding: 0; width: auto; gap: 6px; font-size: 1rem; }
    .site-nav__list > li > a, .site-nav__list > li > .site-nav__sub-toggle { border-top: 3px solid transparent; border-bottom: 3px solid transparent; }
    .site-nav__list > li:hover > a, .site-nav__list > li:hover > .site-nav__sub-toggle,
    .site-nav__list > li.is-active > a, .site-nav__list > li.is-active > .site-nav__sub-toggle { color: var(--red); border-top-color: var(--red); }
    .site-nav__sub-toggle::after { display: none; }

    .site-nav__sub {
        position: absolute; top: 100%; left: 0; min-width: 260px;
        padding: 0; margin: 0;
        background: var(--band-dark); border-top: 3px solid var(--red);
        box-shadow: 0 6px 16px rgba(0, 0, 0, .4);
    }
    .has-sub:hover > .site-nav__sub, .has-sub:focus-within > .site-nav__sub, .site-nav__sub.is-open { display: block; }
    .site-nav__sub a { min-height: 0; padding: 11px 18px; border-bottom: 1px solid var(--line); font-size: .9rem; }
    .site-nav__sub li:last-child a { border-bottom: 0; }
    .site-nav__sub a:hover { background: var(--bg); color: #fff; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

@media print {
    .site-header, .notice-bar, .call-bar, .site-footer, .page-aside { display: none; }
    body { padding: 0; background: #fff; color: #000; }
    h1, h2, h3 { color: #000; }
}
