/* ==========================================================================
   FanaticF1.com : thème sombre par défaut, clair selon le système ou au choix
   ========================================================================== */

/* ---------- Polices auto-hébergées (sous-ensemble latin, licence OFL : voir assets/fonts/) ---------- */

@font-face {
    font-family: 'Barlow Condensed';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/barlow-condensed-700-fn5da0S.woff2") format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Barlow Condensed';
    font-style: italic;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/barlow-condensed-700-italic-JLqcU3V.woff2") format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Barlow Condensed';
    font-style: italic;
    font-weight: 800;
    font-display: swap;
    src: url("../fonts/barlow-condensed-800-italic-MXE3yNX.woff2") format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/inter-variable-Gz7AlRl.woff2") format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --bg: #0B0D12;
    --bg-2: #10131A;
    --surface: #151922;
    --surface-2: #1C212D;
    --line: #262C3A;
    --text: #EEF1F6;
    --muted: #A1A9BA;
    --faint: #737C8F;
    --accent: #FF2A1F;
    --accent-strong: #E10600;
    --accent-soft: rgba(255, 42, 31, .13);
    --header-bg: rgba(11, 13, 18, .82);
    --shadow: 0 18px 40px -22px rgba(0, 0, 0, .75);

    --radius: 16px;
    --radius-sm: 10px;
    --wrap: 1320px;
    --font-display: 'Barlow Condensed', 'Arial Narrow', 'Roboto Condensed', sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

    color-scheme: dark;
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        --bg: #F4F5F8;
        --bg-2: #ECEEF2;
        --surface: #FFFFFF;
        --surface-2: #F3F4F7;
        --line: #E1E4EA;
        --text: #10131A;
        --muted: #4F596B;
        --faint: #7A8396;
        --accent: #D70500;
        --accent-strong: #B80400;
        --accent-soft: rgba(215, 5, 0, .08);
        --header-bg: rgba(244, 245, 248, .85);
        --shadow: 0 18px 40px -26px rgba(16, 19, 26, .35);
        color-scheme: light;
    }
}

:root[data-theme="light"] {
    --bg: #F4F5F8;
    --bg-2: #ECEEF2;
    --surface: #FFFFFF;
    --surface-2: #F3F4F7;
    --line: #E1E4EA;
    --text: #10131A;
    --muted: #4F596B;
    --faint: #7A8396;
    --accent: #D70500;
    --accent-strong: #B80400;
    --accent-soft: rgba(215, 5, 0, .08);
    --header-bg: rgba(244, 245, 248, .85);
    --shadow: 0 18px 40px -26px rgba(16, 19, 26, .35);
    color-scheme: light;
}

/* ---------- Base ---------- */

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 400 15px/1.55 var(--font-body);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

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

h1, h2, h3 { margin: 0; }

ul, ol { margin: 0; padding: 0; list-style: none; }

p { margin: 0; }

[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

turbo-frame { display: block; }
turbo-frame[busy] { opacity: .55; transition: opacity .2s; }

.turbo-progress-bar { height: 3px; background: var(--accent); }

.ff-wrap {
    width: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: clamp(16px, 3vw, 32px);
}

.ff-skip {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 100;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    background: var(--accent-strong);
    color: #fff;
    font-weight: 600;
}
.ff-skip:focus { top: 12px; color: #fff; }

/* ---------- Header ---------- */

.ff-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--header-bg);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--line);
}

.ff-header__bar {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 68px;
}

.ff-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: none;
    color: var(--text);
}
.ff-logo:hover { color: var(--text); }
.ff-logo__mark { width: 38px; height: 38px; transition: transform .25s ease; }
.ff-logo:hover .ff-logo__mark { transform: rotate(-6deg) scale(1.05); }

.ff-logo__word {
    font: italic 800 27px/1 var(--font-display);
    letter-spacing: .02em;
    text-transform: uppercase;
}
.ff-logo__word em { font-style: inherit; color: var(--accent); margin-left: 2px; }

.ff-nav ul { display: flex; gap: 2px; }

.ff-nav a {
    position: relative;
    display: block;
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    transition: color .15s, background .15s;
}
.ff-nav a:hover { color: var(--text); background: var(--surface-2); }
.ff-nav a[aria-current="page"] { color: var(--text); }
.ff-nav a[aria-current="page"]::after {
    content: '';
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: -13px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--accent);
}

.ff-header__tools {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.ff-icon-btn {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: none;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.ff-icon-btn:hover { background: var(--surface-2); border-color: var(--faint); }
.ff-icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.ff-icon-btn--sm { width: 32px; height: 32px; border-color: transparent; color: var(--faint); }
.ff-icon-btn--sm:hover { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.ff-icon-btn--sm svg { width: 16px; height: 16px; }

.ff-i-moon { display: none; }
:root[data-theme="light"] .ff-i-sun { display: none; }
:root[data-theme="light"] .ff-i-moon { display: block; }
@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) .ff-i-sun { display: none; }
    :root:not([data-theme="dark"]) .ff-i-moon { display: block; }
}

.ff-burger { display: none; }

/* Recherche dans les actualités (champ de l'en-tête) */
.ff-search { position: relative; width: 260px; }
.ff-search .form-control {
    width: 100%;
    height: 40px;
    padding: 0 14px 0 38px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A93A5' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 13px center / 16px;
    color: var(--text);
    font: 500 14px var(--font-body);
    transition: border-color .15s, box-shadow .15s;
}
.ff-search .form-control::placeholder { color: var(--faint); }
.ff-search .form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- Titres de sections ---------- */

.ff-main { padding-bottom: 64px; }

.ff-hero { padding-top: clamp(28px, 5vw, 56px); padding-bottom: clamp(20px, 3vw, 32px); }

.ff-breadcrumb { margin-bottom: 14px; color: var(--faint); font-size: 13px; }
.ff-breadcrumb a { color: var(--muted); }

.ff-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.ff-live {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}
.ff-live::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    animation: ff-pulse 1.8s ease-out infinite;
}
@keyframes ff-pulse {
    from { transform: scale(.5); opacity: 1; }
    to { transform: scale(1.6); opacity: 0; }
}

.ff-hero h1 {
    font: italic 800 clamp(40px, 6.5vw, 76px)/.92 var(--font-display);
    letter-spacing: -.005em;
    text-transform: uppercase;
    text-wrap: balance;
}

.ff-lead {
    max-width: 62ch;
    margin-top: 14px;
    color: var(--muted);
    font-size: clamp(15px, 1.6vw, 17px);
}

.ff-section-head {
    display: flex;
    align-items: baseline;
    gap: 6px 16px;
    margin-bottom: 16px;
}
.ff-section-head--wrap { flex-wrap: wrap; }
.ff-section-head h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font: italic 700 28px/1 var(--font-display);
    text-transform: uppercase;
}
.ff-section-head h2::before {
    content: '';
    width: 6px;
    height: 22px;
    border-radius: 2px;
    background: var(--accent);
    transform: skewX(-14deg);
}
.ff-section-head h2 span { color: var(--faint); font-weight: 700; }
.ff-section-head p { color: var(--faint); font-size: 13px; }

/* ---------- Méta & petits éléments ---------- */

.ff-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    color: var(--faint);
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
}

.ff-src {
    color: var(--accent);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.ff-thumb {
    flex: none;
    width: 88px;
    height: 66px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    object-fit: cover;
}

.ff-empty { padding: 18px 4px; color: var(--faint); font-size: 14px; }

.ff-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font: 600 13px var(--font-body);
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
}
.ff-btn:hover { border-color: var(--accent); color: var(--accent); }
.ff-btn--sm { padding: 6px 12px; font-size: 12.5px; }

/* ---------- Top 5 + En continu ---------- */

.ff-top-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
    gap: 28px;
    align-items: start;
}

.ff-top__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.ff-top__lead {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.ff-top__media {
    position: relative;
    display: block;
    /* Sans min-width: 0, le ratio 16/10 appliqué à la hauteur de la ligne élargit l'image
       au-delà de sa colonne : elle passe alors sous le texte du n° 1 */
    min-width: 0;
    min-height: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(135deg, var(--surface-2), var(--bg-2));
}
.ff-top__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}
.ff-top__lead:hover .ff-top__media img { transform: scale(1.04); }
.ff-top__placeholder { width: 30%; height: auto; margin: auto; position: absolute; inset: 0; opacity: .35; }

.ff-top__lead-body {
    position: relative;
    z-index: 1;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    padding: clamp(20px, 3vw, 32px);
}
.ff-top__lead-body h3 {
    font: italic 700 clamp(24px, 2.6vw, 32px)/1.05 var(--font-display);
    text-wrap: balance;
}
.ff-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--muted);
    font-size: 14.5px;
}

.ff-rank {
    flex: none;
    min-width: 34px;
    color: var(--accent);
    font: italic 800 44px/.8 var(--font-display);
}
.ff-rank--lead {
    align-self: flex-start;
    padding: 6px 14px 4px;
    border-radius: 8px;
    background: var(--accent-strong);
    color: #fff;
    font-size: 30px;
    transform: skewX(-10deg);
}

.ff-top__item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    transition: border-color .15s, transform .15s;
}
.ff-top__item:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); transform: translateY(-2px); }
.ff-top__item-body { display: flex; flex: 1; flex-direction: column; gap: 8px; min-width: 0; }
.ff-top__item h3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
}
.ff-top__item .ff-thumb { width: 84px; height: 63px; }

.ff-side { display: grid; gap: 16px; position: sticky; top: 88px; }

.ff-latest {
    padding: 20px 20px 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}
.ff-latest .ff-section-head { margin-bottom: 8px; }

.ff-timeline li {
    position: relative;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
    padding: 11px 0;
    border-top: 1px solid var(--line);
}
.ff-timeline li:first-child { border-top: 0; }
.ff-timeline time {
    padding-top: 1px;
    color: var(--faint);
    font-size: 12.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.ff-timeline a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 3px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}
.ff-timeline .ff-empty { display: block; }

.ff-promo {
    display: grid;
    gap: 4px;
    padding: 18px 20px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    color: var(--muted);
    font-size: 13px;
}
.ff-promo strong { color: var(--text); font: italic 700 20px/1 var(--font-display); text-transform: uppercase; }
.ff-promo:hover { border-color: var(--accent); color: var(--muted); }

/* ---------- Cartes par source ---------- */

.ff-sources { margin-top: clamp(40px, 6vw, 64px); }
.ff-sources .ff-section-head #ff-restore { margin-left: auto; }

.ff-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
    gap: 18px;
    align-items: start;
}

.ff-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    transition: border-color .2s, box-shadow .2s;
}
.ff-card:hover { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); box-shadow: var(--shadow); }

.ff-card__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px 12px 16px;
    border-bottom: 1px solid var(--line);
}
.ff-card__head h3 {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-size: 16px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ff-avatar {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: none;
    border-radius: 9px;
    background: var(--accent-soft);
    color: var(--accent);
    font: italic 800 18px/1 var(--font-display);
}

.ff-card__body { padding: 4px 16px 14px; }

.ff-list__item {
    display: flex;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}
.ff-list__item:last-child { border-bottom: 0; }
.ff-list__body { display: flex; flex: 1; flex-direction: column; gap: 5px; min-width: 0; }
.ff-list__title {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
}
.ff-list__excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--muted);
    font-size: 13.5px;
}

.ff-pager { display: flex; gap: 8px; padding-top: 10px; }
.ff-pager__next { margin-left: auto; }

/* ---------- Prochaine course (accueil) ---------- */

/* L'encart se place en haut de la colonne de droite, au niveau du titre de la page */
.ff-top-grid--hero .ff-next { margin-top: clamp(28px, 5vw, 56px); }

.ff-next {
    position: relative;
    overflow: hidden;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, var(--accent-soft), transparent 55%),
        var(--surface);
}
.ff-next::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    width: 64px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--accent);
}
.ff-next__kicker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    color: var(--accent);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.ff-next__kicker > span:not(.ff-live):not(.ff-badge) { color: var(--faint); }
.ff-next h2 {
    margin-top: 8px;
    font: italic 800 30px/1 var(--font-display);
    text-transform: uppercase;
}
.ff-next__place { margin-top: 4px; color: var(--muted); font-size: 13.5px; }

.ff-countdown {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
}
.ff-countdown span {
    padding: 8px 6px 6px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--faint);
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
}
.ff-countdown b {
    display: block;
    color: var(--text);
    font: italic 800 30px/1 var(--font-display);
    font-variant-numeric: tabular-nums;
}

.ff-sessions { margin-top: 14px; font-size: 13px; }
.ff-sessions li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-top: 1px solid var(--line);
}
.ff-sessions li:first-child { border-top: 0; }
.ff-sessions span { color: var(--muted); }
.ff-sessions time { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ff-sessions time::first-letter { text-transform: uppercase; }
.ff-sessions .is-race span, .ff-sessions .is-race time { color: var(--accent); font-weight: 700; }
.ff-sessions .is-past { opacity: .5; }

.ff-next__links { display: flex; gap: 8px; margin-top: 14px; }
.ff-next__links a {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}
.ff-next__links a:hover { border-color: var(--accent); }

.ff-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.ff-badge--accent { background: var(--accent-strong); color: #fff; }

/* ---------- Championnat (accueil, sous le Top 5) ---------- */

.ff-champ { margin-top: 32px; }
.ff-champ__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.ff-champ__card {
    display: flex;
    flex-direction: column;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}
.ff-champ__card h3 {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 8px;
    margin-bottom: 10px;
    font: italic 700 20px/1.1 var(--font-display);
    text-transform: uppercase;
}
.ff-champ__card h3 span { color: var(--faint); }
.ff-champ__card .ff-champ__sub { margin: 16px 0 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.ff-champ__list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}
.ff-champ__list .ff-team-bar { height: 28px; }
.ff-champ__list--compact .ff-team-bar { height: 18px; }
.ff-champ__list .ff-entrant { flex: 1; }
.ff-champ__list .ff-entrant strong { white-space: nowrap; }
.ff-champ__pos {
    width: 18px;
    flex: none;
    color: var(--faint);
    font-size: 13px;
    font-weight: 700;
    text-align: right;
}
.ff-champ__pts {
    flex: none;
    font: italic 800 20px/1 var(--font-display);
    font-variant-numeric: tabular-nums;
}
.ff-champ__pts small { color: var(--faint); font-size: 12px; }
.ff-champ__card .ff-podium { margin-top: 0; }
.ff-champ__more {
    margin-top: auto;
    padding-top: 12px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
}

/* ---------- Vidéos (accueil) ---------- */

.ff-videos { margin-top: clamp(40px, 6vw, 64px); }
.ff-videos__list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}
.ff-video {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    transition: border-color .2s, transform .2s;
}
.ff-video:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); transform: translateY(-2px); }
.ff-video__thumb { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--surface-2); }
.ff-video__thumb img { width: 100%; height: 100%; object-fit: cover; }
.ff-video__play {
    position: absolute;
    left: 12px;
    bottom: 12px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent-strong);
    box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .6);
    transition: transform .2s;
}
.ff-video__play svg { width: 20px; height: 20px; margin-left: 2px; fill: #fff; }
.ff-video:hover .ff-video__play { transform: scale(1.1); }
.ff-video__body { display: flex; flex: 1; flex-direction: column; justify-content: space-between; gap: 10px; padding: 14px 16px 16px; }
.ff-video h3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.35;
}

.ff-player {
    width: min(960px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
}
.ff-player::backdrop { background: rgba(5, 6, 9, .82); backdrop-filter: blur(4px); }
.ff-player__head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 18px; }
.ff-player__title { flex: 1; min-width: 0; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.ff-player__frame { aspect-ratio: 16 / 9; background: #000; }
.ff-player__frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.ff-player__note { padding: 8px 18px 12px; color: var(--faint); font-size: 12px; }

/* ---------- Calendrier ---------- */

.ff-calendar {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr));
    gap: 16px;
    align-items: start;
}
.ff-race {
    display: flex;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    scroll-margin-top: 90px;
}
.ff-race.is-next { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ff-race__round {
    flex: none;
    width: 46px;
    color: var(--accent);
    font: italic 800 38px/.9 var(--font-display);
}
.ff-race.is-done .ff-race__round { color: var(--faint); }
.ff-race__body { flex: 1; min-width: 0; }
.ff-race h2 { margin-top: 6px; font: italic 700 24px/1.05 var(--font-display); text-transform: uppercase; }
.ff-race__place { margin-top: 3px; color: var(--muted); font-size: 13.5px; }

.ff-podium { display: grid; gap: 4px; margin-top: 12px; font-size: 13.5px; }
.ff-podium li { display: flex; align-items: baseline; gap: 8px; }
.ff-podium b {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    flex: none;
    border-radius: 6px;
    background: var(--surface-2);
    font-size: 11.5px;
}
.ff-podium li:first-child b { background: #D4A72C; color: #1A1400; }
.ff-podium small { color: var(--faint); }

.ff-race__sessions { margin-top: 10px; }
.ff-race__sessions summary {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.ff-race__sessions summary:hover { color: var(--accent); }
.ff-race__sessions .ff-sessions { margin-top: 6px; }

.ff-source-note { margin-top: 20px; color: var(--faint); font-size: 12.5px; }
.ff-source-note a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Classement ---------- */

.ff-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Sélecteurs Pilotes / Écuries et Positions / Points : boutons radio, sans JavaScript */
.ff-switch {
    display: inline-flex;
    gap: 2px;
    margin: 0 8px 16px 0;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    vertical-align: middle;
}
.ff-switch input { position: absolute; opacity: 0; pointer-events: none; }
.ff-switch label {
    padding: 7px 16px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.ff-switch input:checked + label { background: var(--accent-strong); color: #fff; }
.ff-switch input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.ff-switch--sm label { padding: 5px 12px; font-size: 12.5px; }

.ff-standings:has(#ff-show-drivers:checked) .ff-panel--teams,
.ff-standings:has(#ff-show-teams:checked) .ff-panel--drivers { display: none; }
/* Positions / Points ne concerne que les pilotes (les écuries sont toujours en points) */
.ff-standings:has(#ff-show-teams:checked) .ff-switch--sm { visibility: hidden; }
.ff-standings:has(#ff-show-positions:checked) .ff-res__pts,
.ff-standings:has(#ff-show-points:checked) .ff-res__pos { display: none; }
.ff-standings:has(#ff-show-points:checked) .ff-res.is-dnf { color: var(--muted); font-size: inherit; }

.ff-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}
.ff-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}
.ff-table th, .ff-table td {
    padding: 0;
    border-bottom: 1px solid var(--line);
    text-align: center;
    white-space: nowrap;
}
.ff-table tbody tr:last-child > * { border-bottom: 0; }
.ff-table thead th {
    padding: 10px 4px;
    color: var(--faint);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
}
.ff-table abbr { text-decoration: none; cursor: help; }
.ff-table tbody tr:hover > * { background-color: var(--surface-2); }

/* Colonnes fixes à gauche : position, nom, total */
.ff-table__pos, .ff-table__name, .ff-table__total {
    position: sticky;
    z-index: 1;
    background: var(--surface);
}
.ff-table__pos { left: 0; width: 44px; min-width: 44px; color: var(--muted); font-weight: 700; }
.ff-table__name { left: 44px; min-width: 210px; text-align: left !important; }
.ff-table__total {
    left: 254px;
    min-width: 56px;
    padding-inline: 8px !important;
    border-right: 1px solid var(--line);
    font: italic 800 18px/1 var(--font-display);
}
.ff-table tbody .ff-table__name { display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 0; }
.ff-team-bar { width: 4px; height: 30px; flex: none; border-radius: 2px; background: var(--team); }
.ff-entrant { display: grid; min-width: 0; line-height: 1.25; }
.ff-entrant strong { overflow: hidden; font-size: 13.5px; text-overflow: ellipsis; }
.ff-entrant small { color: var(--faint); font-size: 11.5px; font-weight: 500; }

.ff-table__round { min-width: 42px; }
.ff-table__round.is-future { opacity: .45; }

.ff-res {
    height: 45px;
    padding: 0 2px !important;
    border-left: 1px solid color-mix(in srgb, var(--line) 50%, transparent);
    font-weight: 600;
}
.ff-res sup { margin-left: 1px; color: var(--faint); font-size: 9.5px; font-weight: 700; }
.ff-res.is-future { background: repeating-linear-gradient(-45deg, transparent 0 6px, color-mix(in srgb, var(--line) 35%, transparent) 6px 7px); }
.ff-table tbody tr .ff-res.is-p1 { background-color: color-mix(in srgb, #D4A72C 32%, var(--surface)); }
.ff-table tbody tr .ff-res.is-p2 { background-color: color-mix(in srgb, #A7B0BE 30%, var(--surface)); }
.ff-table tbody tr .ff-res.is-p3 { background-color: color-mix(in srgb, #C0784A 30%, var(--surface)); }
.ff-table tbody tr .ff-res.is-points { background-color: color-mix(in srgb, #2BB673 18%, var(--surface)); }
.ff-res.is-out { color: var(--muted); }
.ff-res.is-dnf { color: var(--accent); font-size: 11.5px; }
.ff-res--team { color: var(--faint); }
.ff-res--team.is-points { color: var(--text); }

.ff-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin: 12px 0 0;
    color: var(--faint);
    font-size: 12.5px;
}
.ff-legend li { display: flex; align-items: center; gap: 6px; }
.ff-legend .ff-res {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface);
}
.ff-legend .ff-res.is-p1 { background: color-mix(in srgb, #D4A72C 32%, var(--surface)); }
.ff-legend .ff-res.is-p2 { background: color-mix(in srgb, #A7B0BE 30%, var(--surface)); }
.ff-legend .ff-res.is-p3 { background: color-mix(in srgb, #C0784A 30%, var(--surface)); }
.ff-legend .ff-res.is-points { background: color-mix(in srgb, #2BB673 18%, var(--surface)); }
.ff-legend .ff-res.is-dnf { border-color: var(--accent); }
.ff-legend sup { color: var(--faint); font-weight: 700; }

/* ---------- Page de recherche ---------- */

.ff-search-page { display: flex; gap: 10px; max-width: 640px; margin-top: 18px; }
.ff-search-page input {
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font: 500 16px var(--font-body);
}
.ff-search-page input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ff-search-page .ff-btn { height: 46px; padding-inline: 22px; background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.ff-search-page .ff-btn:hover { background: var(--accent); color: #fff; }
.ff-results { max-width: 900px; }
.ff-results .ff-pager { padding-top: 16px; }

/* ---------- Pages de contenu ---------- */

.ff-prose { max-width: 780px; padding-top: clamp(32px, 5vw, 56px); }
.ff-prose h1 { margin-bottom: 20px; font: italic 800 clamp(36px, 5vw, 56px)/1 var(--font-display); text-transform: uppercase; }
.ff-prose h2 { margin: 32px 0 10px; font: italic 700 24px/1.1 var(--font-display); text-transform: uppercase; }
.ff-prose p, .ff-prose li { color: var(--muted); }
.ff-prose p + p { margin-top: 12px; }
.ff-prose ul { padding-left: 18px; list-style: disc; }
.ff-prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Articles sponsorisés ---------- */

.ff-card--sponsored { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.ff-card--sponsored .ff-avatar { background: var(--accent-strong); color: #fff; }
.ff-card--sponsored .ff-badge { text-decoration: none; }
.ff-card--sponsored .ff-list__excerpt { -webkit-line-clamp: 6; }
.ff-disclaimer { color: var(--faint); font-size: 11.5px; line-height: 1.4; }
.ff-sponsored__label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 14px; }
.ff-sponsored__preview { margin-bottom: 16px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); }
.ff-prose .ff-sponsored__lead { color: var(--text); font-size: 18px; font-weight: 600; line-height: 1.5; }
.ff-sponsored__image { display: block; width: 100%; height: auto; margin: 24px 0; border-radius: var(--radius); }
.ff-sponsored__body { margin-top: 20px; }
.ff-sponsored__body h3 { margin: 24px 0 8px; font-size: 18px; }
.ff-sponsored__body ol { padding-left: 20px; list-style: decimal; }
.ff-sponsored__body blockquote { margin: 16px 0; padding-left: 16px; border-left: 3px solid var(--accent); }
.ff-sponsored__body * + p, .ff-sponsored__body * + ul, .ff-sponsored__body * + ol { margin-top: 12px; }
.ff-sponsored .ff-disclaimer { margin-top: 24px; }
.ff-prose .ff-sponsored__about { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--faint); font-size: 13px; }

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

.ff-footer {
    border-top: 1px solid var(--line);
    background: var(--bg-2);
    color: var(--muted);
    font-size: 14px;
}
.ff-footer__grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr));
    gap: 32px;
    padding-block: 48px 32px;
}
.ff-footer__about p { max-width: 52ch; margin-top: 14px; }
.ff-footer h2 {
    margin-bottom: 12px;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.ff-footer li + li { margin-top: 8px; }
.ff-footer a:hover { color: var(--accent); }
.ff-tribute { color: var(--faint); font-size: 13px; }
.ff-tribute span { color: var(--accent); font-weight: 700; }
.ff-footer__legal { padding-block: 18px 28px; border-top: 1px solid var(--line); color: var(--faint); font-size: 12.5px; }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
    .ff-search { width: 200px; }
    .ff-videos__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ff-burger { display: inline-grid; }
    .ff-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
        padding: 8px clamp(16px, 3vw, 32px) 16px;
        border-bottom: 1px solid var(--line);
        background: var(--bg);
        box-shadow: var(--shadow);
    }
    [data-menu-open] .ff-nav { display: block; }
    .ff-nav ul { flex-direction: column; gap: 2px; }
    .ff-nav a { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 16px; }
    .ff-nav a[aria-current="page"] { background: var(--surface-2); }
    .ff-nav a[aria-current="page"]::after { left: 0; right: auto; top: 10px; bottom: 10px; width: 3px; height: auto; border-radius: 3px; }
}

@media (max-width: 960px) {
    .ff-top-grid { grid-template-columns: minmax(0, 1fr); }
    /* Une seule colonne : titre, prochaine course, Top 5, puis « En continu » */
    .ff-top-grid--hero { gap: 24px; }
    .ff-top-grid--hero .ff-col, .ff-top-grid--hero .ff-side { display: contents; }
    .ff-top-grid--hero .ff-hero { order: 1; padding-bottom: 0; }
    .ff-top-grid--hero .ff-next { order: 2; margin-top: 0; }
    .ff-top-grid--hero .ff-top { order: 3; }
    .ff-top-grid--hero .ff-champ { order: 4; margin-top: 0; }
    .ff-top-grid--hero .ff-latest { order: 5; }
    .ff-top-grid--hero .ff-promo { order: 6; }
    .ff-side { position: static; }
    .ff-footer__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .ff-footer__about { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
    .ff-header__bar { flex-wrap: wrap; gap: 10px 8px; padding-block: 10px; }
    /* Logo + boutons sur la première ligne, recherche pleine largeur dessous */
    .ff-header__tools { display: contents; }
    .ff-logo { margin-right: auto; }
    .ff-search { order: 3; width: 100%; }
    .ff-logo__word { font-size: 24px; }
    .ff-logo__mark { width: 34px; height: 34px; }
    .ff-top__lead { grid-template-columns: minmax(0, 1fr); }
    .ff-top__media { aspect-ratio: 16 / 9; }
    .ff-top__list { grid-template-columns: minmax(0, 1fr); }
    .ff-champ__grid { grid-template-columns: minmax(0, 1fr); }
    /* Vidéos : bandeau à faire défiler horizontalement */
    .ff-videos__list {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: 78%;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 6px;
    }
    .ff-video { scroll-snap-align: start; }
    .ff-section-head { flex-wrap: wrap; }
    .ff-section-head h2 { font-size: 24px; }
    /* Sur mobile, le nom du pilote seul reste figé : le total suit le défilement */
    .ff-table__name { min-width: 150px; }
    .ff-table__total { position: static; }
    .ff-entrant small { display: none; }
}

@media (max-width: 480px) {
    .ff-footer__grid { grid-template-columns: minmax(0, 1fr); }
    .ff-thumb { width: 72px; height: 54px; }
}

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