/**
 * Styles publics — Roadbooks FLC
 * Design néo-brutaliste « Foutons le Camp » (clair/crème) :
 * bordures encre épaisses, ombres dures décalées, pilules, polices Notably Absent / Nunito.
 *
 * Les couleurs et polices héritent des variables du thème (`:root` dans le style.css du
 * thème actif) et suivent donc le Customizer. Des fallbacks garantissent un rendu correct
 * même hors du thème FLC.
 */

/* ═══ Jeton de design (alias locaux des variables du thème + fallbacks) ═══ */
.flc-roadbooks-list,
.flc-roadbook-single,
.flc-roadbook-password-modal {
    --rb-ink:    var(--ink,    #1C2B1A);
    --rb-cream:  var(--cream,  #FDFAF5);
    --rb-teal:   var(--teal,   #326186);
    --rb-blue:   var(--blue,   #A3CBE1);
    --rb-green:  var(--green,  #758E4F);
    --rb-yellow: var(--yellow, #F8C462);
    --rb-orange: var(--orange, #D4520C);
    --rb-white:  #ffffff;

    --rb-D: var(--D, 'Notably Absent', 'Fredoka', sans-serif);
    --rb-B: var(--B, 'Nunito', sans-serif);

    --rb-radius:    20px;
    --rb-radius-sm: 14px;
    --rb-pill:      9999px;
    --rb-border:    3px solid var(--rb-ink);
    --rb-border-2:  2.5px solid var(--rb-ink);
    --rb-shadow:    4px 4px 0 var(--rb-ink);
    --rb-shadow-sm: 3px 3px 0 var(--rb-ink);
    --rb-shadow-lg: 6px 6px 0 var(--rb-ink);

    font-family: var(--rb-B);
    color: var(--rb-ink);
}

/* ═══ Conteneurs — centrés, cohérents avec la largeur de lecture du thème ═══ */
.flc-roadbooks-list,
.flc-roadbook-single {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px clamp(16px, 4vw, 40px) 64px;
    box-sizing: border-box;
}

.flc-roadbooks-list {
    text-align: center;
}

/* ═══ Liste — titres d'année ═══ */
.flc-roadbooks-year {
    margin-bottom: 56px;
}

.flc-year-title {
    display: inline-block;
    margin: 0 auto 32px;
    padding: 10px 28px;
    font-family: var(--rb-D);
    font-weight: 400;
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1;
    color: var(--rb-cream);
    background: var(--rb-teal);
    border: var(--rb-border);
    border-radius: var(--rb-pill);
    box-shadow: var(--rb-shadow);
    transform: rotate(-1.5deg);
}

/* ═══ Grille de cartes ═══ */
.flc-roadbooks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px;
    text-align: left;
}

.flc-roadbook-card {
    --flc-difficulty-accent: var(--rb-teal);
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--rb-white);
    border: var(--rb-border);
    border-radius: var(--rb-radius);
    box-shadow: var(--rb-shadow-lg);
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s;
}

/* Légères rotations façon « stickers » (comme les cartes .wc du thème) */
.flc-roadbooks-grid .flc-roadbook-card:nth-child(3n+1) { transform: rotate(-1.2deg); }
.flc-roadbooks-grid .flc-roadbook-card:nth-child(3n+2) { transform: rotate(0.8deg); }
.flc-roadbooks-grid .flc-roadbook-card:nth-child(3n+3) { transform: rotate(-0.5deg); }

.flc-roadbook-card:hover {
    transform: rotate(0deg) translateY(-8px);
    box-shadow: 9px 12px 0 var(--rb-ink);
    z-index: 2;
}

/* Bande d'accent (couleur de difficulté) en haut de carte */
.flc-roadbook-card::before {
    content: '';
    display: block;
    height: 8px;
    background: var(--flc-difficulty-accent, var(--rb-teal));
    border-bottom: var(--rb-border);
}

.flc-roadbook-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--rb-blue);
    border-bottom: var(--rb-border);
    position: relative;
}

.flc-roadbook-image img,
.flc-roadbook-image .flc-roadbook-list-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover !important;
    object-position: var(--flc-object-position, 50% 50%) !important;
    max-width: none;
    transition: transform 0.4s ease;
}

.flc-roadbook-card:hover .flc-roadbook-image img,
.flc-roadbook-card:hover .flc-roadbook-image .flc-roadbook-list-thumb {
    transform: scale(1.06);
    transform-origin: var(--flc-object-position, 50% 50%);
}

.flc-roadbook-content {
    flex: 1;
    padding: 22px 24px;
    text-align: left;
}

.flc-roadbook-content h3 {
    margin: 0 0 8px;
    font-family: var(--rb-D);
    font-weight: 400;
    font-size: clamp(1.5rem, 2.2vw, 1.9rem);
    line-height: 1.05;
    color: var(--rb-ink);
}

.flc-roadbook-route {
    margin: 0 0 14px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--rb-ink) 55%, transparent);
}

.flc-roadbook-description {
    font-size: 0.92rem;
    line-height: 1.55;
    color: color-mix(in srgb, var(--rb-ink) 75%, transparent);
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.flc-roadbook-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 14px 0 0;
}

/* ═══ Badges — pilules bordées encre, légèrement penchées ═══ */
.flc-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    font-family: var(--rb-B);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    color: #fff;
    border: var(--rb-border-2);
    border-radius: var(--rb-pill);
    box-shadow: 2px 2px 0 var(--rb-ink);
    transform: rotate(-2deg);
}

.flc-roadbook-meta .flc-badge:nth-child(even) { transform: rotate(1.5deg); }

/* Couleurs injectées en style inline depuis les Paramètres (difficulté/durée/catégorie) */
.flc-badge-duration,
.flc-badge-difficulty,
.flc-badge-category { color: #fff; }

.flc-badge-year {
    background: var(--rb-yellow);
    color: var(--rb-ink);
}

/* ═══ Boutons — pilules à ombre dure (façon .btn-a / .btn-b du thème) ═══ */
.flc-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 13px 28px;
    font-family: var(--rb-B);
    font-size: 0.95rem;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
    color: var(--rb-ink);
    background: var(--rb-white);
    border: var(--rb-border-2);
    border-radius: var(--rb-pill);
    box-shadow: var(--rb-shadow);
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s, color 0.15s;
}

.flc-button:hover {
    transform: translate(-3px, -3px) rotate(-1deg);
    box-shadow: 7px 7px 0 var(--rb-ink);
}

.flc-button:active {
    transform: translate(0, 0);
    box-shadow: 2px 2px 0 var(--rb-ink);
}

.flc-button-primary {
    background: var(--rb-orange);
    color: var(--rb-cream);
}

.flc-button-outline {
    background: transparent;
    color: var(--rb-ink);
    box-shadow: none;
}

.flc-button-outline:hover {
    background: var(--rb-ink);
    color: var(--rb-cream);
    transform: rotate(1deg);
    box-shadow: none;
}

.flc-roadbook-actions {
    padding: 0 24px 24px;
    text-align: center;
}

.flc-roadbook-actions .flc-button { width: 100%; }

/* Messages vides — centrés */
.flc-roadbooks-list > p,
.flc-roadbook-single > p {
    text-align: center;
    max-width: 480px;
    margin: 40px auto;
    font-weight: 700;
    color: color-mix(in srgb, var(--rb-ink) 65%, transparent);
}

/* ═══ Vue single — navigation retour ═══ */
.flc-roadbook-navigation {
    margin-bottom: 24px;
    text-align: left;
}

/* ═══ En-tête du roadbook (façon .ph / trace-hero du thème) ═══ */
.flc-roadbook-header {
    position: relative;
    min-height: 220px;
    display: flex;
    align-items: flex-end;
    padding: 32px clamp(20px, 5vw, 48px);
    background: var(--rb-teal);
    background-size: cover;
    background-position: center;
    border: var(--rb-border);
    border-radius: var(--rb-radius);
    box-shadow: var(--rb-shadow-lg);
    overflow: hidden;
}

.flc-roadbook-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(28, 43, 26, 0.15) 0%, rgba(28, 43, 26, 0.45) 60%, rgba(28, 43, 26, 0.85) 100%);
}

.flc-roadbook-header-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 900px;
}

.flc-roadbook-header h1 {
    margin: 0;
    font-family: var(--rb-D);
    font-weight: 400;
    font-size: clamp(2.4rem, 7vw, 5rem);
    line-height: 0.9;
    color: var(--rb-cream);
    text-shadow: 4px 4px 0 rgba(28, 43, 26, 0.55);
}

.flc-roadbook-header-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.flc-roadbook-single .flc-roadbook-route {
    margin-top: 14px;
    color: var(--rb-cream);
    font-size: 0.85rem;
}

/* ═══ Layout : aside résumé + contenu principal ═══ */
.flc-roadbook-body {
    display: block;
}

.flc-roadbook-main {
    margin-top: 28px;
}

/* ═══ Bloc résumé (cartes-stats façon .pf-stat) ═══ */
.flc-roadbook-summary {
    margin-top: 24px;
    padding: 22px;
    background: var(--rb-white);
    border: var(--rb-border);
    border-radius: var(--rb-radius);
    box-shadow: var(--rb-shadow);
    display: grid;
    gap: 16px;
}

.flc-roadbook-summary__route {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 18px;
    background: var(--rb-cream);
    border: var(--rb-border-2);
    border-radius: var(--rb-radius-sm);
    box-shadow: var(--rb-shadow-sm);
}

.flc-roadbook-summary__label {
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--rb-orange);
}

.flc-roadbook-summary__value {
    font-weight: 800;
    color: var(--rb-ink);
}

.flc-roadbook-summary__route .flc-roadbook-summary__value {
    font-family: var(--rb-D);
    font-weight: 400;
    font-size: 1.4rem;
    line-height: 1.05;
}

.flc-roadbook-summary__description {
    font-size: 0.92rem;
    line-height: 1.6;
    color: color-mix(in srgb, var(--rb-ink) 80%, transparent);
    padding: 14px 18px;
    background: var(--rb-cream);
    border: var(--rb-border-2);
    border-radius: var(--rb-radius-sm);
}

.flc-roadbook-summary__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.flc-roadbook-summary__item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    padding: 14px 18px;
    background: var(--rb-cream);
    border: var(--rb-border-2);
    border-radius: var(--rb-radius-sm);
    box-shadow: var(--rb-shadow-sm);
}

.flc-roadbook-summary__item .flc-roadbook-summary__value {
    font-family: var(--rb-D);
    font-weight: 400;
    font-size: 1.6rem;
    line-height: 1;
}

/* ═══ Onglets ═══ */
.flc-roadbook-tabs {
    margin-top: 32px;
    text-align: left;
}

/* Mobile : sélecteur natif (évite une barre horizontale illisible) */
.flc-tabs-mobile-picker { display: none; }

.flc-tabs-mobile-select-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--rb-orange);
}

.flc-tabs-mobile-select {
    width: 100%;
    min-height: 48px;
    padding: 12px 40px 12px 16px;
    font-family: var(--rb-B);
    font-size: 16px;
    font-weight: 800;
    color: var(--rb-ink);
    background-color: var(--rb-white);
    border: var(--rb-border-2);
    border-radius: var(--rb-radius-sm);
    box-shadow: var(--rb-shadow-sm);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%231C2B1A' d='M1.4 0L6 4.6 10.6 0 12 1.4l-6 6-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.flc-tabs-mobile-select:focus {
    outline: none;
    box-shadow: var(--rb-shadow-sm), 0 0 0 3px var(--rb-yellow);
}

.flc-tabs-nav-wrapper {
    margin-bottom: 24px;
}

.flc-tabs-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Onglet = pilule bordée encre (façon .nav-link / .pf-tag du thème) */
.flc-tab-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 20px;
    font-family: var(--rb-B);
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    color: var(--rb-ink);
    background: var(--rb-white);
    border: var(--rb-border-2);
    border-radius: var(--rb-pill);
    box-shadow: 2px 2px 0 var(--rb-ink);
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s, color 0.15s;
}

.flc-tab-button:hover {
    transform: translate(-2px, -2px) rotate(-1deg);
    box-shadow: 4px 4px 0 var(--rb-ink);
}

.flc-tab-button.active {
    background: var(--rb-ink);
    color: var(--rb-yellow);
    box-shadow: 2px 2px 0 var(--rb-orange);
    transform: none;
}

.flc-tab-button:focus-visible {
    outline: 3px solid var(--rb-yellow);
    outline-offset: 2px;
}

.flc-tab-button__label { white-space: nowrap; }

.flc-tab-button__badge {
    font-size: 0.62rem;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: var(--rb-pill);
    border: 2px solid currentColor;
}

.flc-tab-badge-gpx {
    background: var(--rb-green);
    color: #fff;
    border-color: var(--rb-ink);
}

.flc-tab-badge-locked {
    border: none;
    font-size: 0.95rem;
    padding: 0;
}

/* Panneaux */
.flc-tab-panel { display: none; }
.flc-tab-panel.active { display: block; }
.flc-tab-panel[hidden] { display: none !important; }

.flc-tab-panel.active {
    padding: 28px 26px;
    background: var(--rb-white);
    border: var(--rb-border);
    border-radius: var(--rb-radius);
    box-shadow: var(--rb-shadow);
}

/* Contenu d'onglet : largeur de lecture confortable */
.flc-tab-content {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--rb-ink);
    max-width: 720px;
}

.flc-tab-content > *:first-child { margin-top: 0; }

/* Onglet verrouillé */
.flc-tab-locked {
    text-align: center;
    padding: 48px 24px;
    background: var(--rb-cream);
    border: 3px dashed var(--rb-ink);
    border-radius: var(--rb-radius);
}

.flc-tab-locked p { font-weight: 700; }

.flc-unlock-date {
    margin-top: 12px;
    font-family: var(--rb-D);
    font-weight: 400;
    font-size: 1.6rem;
    line-height: 1.1;
    color: var(--rb-orange);
}

/* ═══ Viewer GPX ═══ */
.flc-gpx-viewer { margin: 24px 0; }

.flc-gpx-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.flc-stat-item {
    padding: 18px 14px;
    text-align: center;
    background: var(--rb-cream);
    border: var(--rb-border-2);
    border-radius: var(--rb-radius-sm);
    box-shadow: var(--rb-shadow-sm);
}

.flc-stat-value {
    display: block;
    font-family: var(--rb-D);
    font-weight: 400;
    font-size: 1.7rem;
    line-height: 1;
    color: var(--rb-teal);
}

.flc-stat-label {
    display: block;
    margin-top: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--rb-ink) 60%, transparent);
}

.flc-gpx-map {
    width: 100%;
    height: 380px;
    margin: 22px 0;
    border: var(--rb-border);
    border-radius: var(--rb-radius);
    box-shadow: var(--rb-shadow);
    overflow: hidden;
}

.flc-gpx-elevation { width: 100%; height: 300px; margin: 20px 0; }
.flc-gpx-elevation canvas { max-height: 300px; }
.flc-gpx-elevation-charts { margin: 22px 0; }

.flc-gpx-chart-wrapper {
    margin-bottom: 24px;
    padding: 22px;
    background: var(--rb-white);
    border: var(--rb-border);
    border-radius: var(--rb-radius);
    box-shadow: var(--rb-shadow);
}

.flc-gpx-chart-wrapper h4 {
    margin: 0 0 14px;
    font-family: var(--rb-D);
    font-weight: 400;
    font-size: 1.2rem;
    color: var(--rb-ink);
}

.flc-gpx-chart-wrapper canvas { max-height: 300px; }

.flc-gpx-loading {
    text-align: center;
    padding: 40px 24px;
    font-weight: 700;
    color: color-mix(in srgb, var(--rb-ink) 60%, transparent);
    background: var(--rb-cream);
    border: 3px dashed var(--rb-ink);
    border-radius: var(--rb-radius);
}

/* Section fichiers GPX */
.flc-gpx-files-section {
    margin-top: 36px;
    padding-top: 28px;
    border-top: var(--rb-border);
}

.flc-gpx-files-section h3 {
    margin-bottom: 18px;
    font-family: var(--rb-D);
    font-weight: 400;
    font-size: 1.7rem;
    color: var(--rb-ink);
}

.flc-gpx-files-section h4 {
    margin: 24px 0 14px;
    font-family: var(--rb-D);
    font-weight: 400;
    font-size: 1.3rem;
    color: var(--rb-ink);
}

.flc-gpx-files-download {
    margin-top: 26px;
    padding-top: 20px;
    border-top: 2.5px dashed color-mix(in srgb, var(--rb-ink) 35%, transparent);
}

.flc-gpx-files-list {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ═══ Contenu WYSIWYG des onglets ═══ */
.flc-tab-content h1,
.flc-tab-content h2,
.flc-tab-content h3,
.flc-tab-content h4,
.flc-tab-content h5,
.flc-tab-content h6 {
    margin: 1.5em 0 0.6em;
    font-family: var(--rb-D);
    font-weight: 400;
    line-height: 1.1;
    color: var(--rb-ink);
}

.flc-tab-content h1 { font-size: 2.2em; margin-top: 0; }
.flc-tab-content h2 { font-size: 1.8em; }
.flc-tab-content h3 { font-size: 1.5em; }
.flc-tab-content h4 { font-size: 1.25em; }
.flc-tab-content h5 { font-size: 1.1em; }
.flc-tab-content h6 { font-size: 1em; }

.flc-tab-content p { margin-bottom: 1em; }

.flc-tab-content ul {
    margin: 1em 0;
    padding-left: 0;
    list-style: none !important;
}

.flc-tab-content ol { margin: 1em 0; padding-left: 1.5em; }

.flc-tab-content ul li {
    position: relative;
    margin-bottom: 0.55em;
    padding-left: 1.6em;
    list-style: none !important;
}

.flc-tab-content ul li::marker { content: '' !important; font-size: 0 !important; }

.flc-tab-content ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 10px;
    height: 10px;
    background: var(--rb-orange);
    border: 2px solid var(--rb-ink);
    border-radius: 2px;
    transform: rotate(45deg);
}

.flc-tab-content ol li { margin-bottom: 0.5em; }

.flc-tab-content blockquote {
    margin: 1.5em 0;
    padding: 1em 1.4em;
    background: var(--rb-cream);
    border: var(--rb-border-2);
    border-left-width: 6px;
    border-radius: var(--rb-radius-sm);
    box-shadow: var(--rb-shadow-sm);
    font-style: italic;
}

.flc-tab-content img {
    max-width: 100%;
    height: auto;
    margin: 1em 0;
    border: var(--rb-border-2);
    border-radius: var(--rb-radius-sm);
    box-shadow: var(--rb-shadow-sm);
}

.flc-tab-content a {
    color: var(--rb-teal);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
}

.flc-tab-content a:hover { color: var(--rb-orange); }

.flc-tab-content strong,
.flc-tab-content b { font-weight: 900; color: var(--rb-ink); }

.flc-tab-content em,
.flc-tab-content i { font-style: italic; }

.flc-tab-content code {
    padding: 2px 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    background: var(--rb-cream);
    border: 2px solid var(--rb-ink);
    border-radius: 6px;
}

.flc-tab-content pre {
    margin: 1em 0;
    padding: 1em 1.25em;
    overflow-x: auto;
    background: var(--rb-cream);
    border: var(--rb-border-2);
    border-radius: var(--rb-radius-sm);
    box-shadow: var(--rb-shadow-sm);
}

.flc-tab-content pre code { padding: 0; background: transparent; border: none; }

.flc-tab-content table {
    width: 100%;
    margin: 1.5em 0;
    border-collapse: collapse;
    border: var(--rb-border-2);
}

.flc-tab-content table th,
.flc-tab-content table td {
    padding: 0.7em 1em;
    border: 2px solid var(--rb-ink);
    text-align: left;
}

.flc-tab-content table th {
    background: var(--rb-yellow);
    font-weight: 900;
}

.flc-tab-content hr {
    margin: 2em 0;
    border: none;
    border-top: 3px solid var(--rb-ink);
}

/* Boîtes de contenu (rendu identique à l'éditeur) */
.flc-tab-content .info-box,
.flc-tab-content .warning-box,
.flc-tab-content .success-box,
.flc-tab-content .error-box {
    margin: 16px 0;
    padding: 16px 20px;
    border: var(--rb-border-2);
    border-left-width: 6px;
    border-radius: var(--rb-radius-sm);
    box-shadow: var(--rb-shadow-sm);
}

.flc-tab-content .info-box    { background: color-mix(in srgb, var(--rb-blue)   28%, var(--rb-cream)); border-left-color: var(--rb-teal); }
.flc-tab-content .warning-box { background: color-mix(in srgb, var(--rb-yellow) 32%, var(--rb-cream)); border-left-color: var(--rb-orange); }
.flc-tab-content .success-box { background: color-mix(in srgb, var(--rb-green)  24%, var(--rb-cream)); border-left-color: var(--rb-green); }
.flc-tab-content .error-box   { background: color-mix(in srgb, var(--rb-orange) 24%, var(--rb-cream)); border-left-color: var(--rb-orange); }

.flc-tab-content .pullquote {
    margin: 20px 0;
    padding: 16px 22px;
    font-style: italic;
    font-size: 1.1em;
    background: var(--rb-cream);
    border: var(--rb-border-2);
    border-left-width: 6px;
    border-radius: var(--rb-radius-sm);
}

.flc-tab-content .code-block {
    margin: 16px 0;
    padding: 16px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    background: var(--rb-cream);
    border: var(--rb-border-2);
    border-radius: var(--rb-radius-sm);
}

.flc-tab-content .text-important { font-weight: 900; color: var(--rb-orange); }
.flc-tab-content .text-muted { color: color-mix(in srgb, var(--rb-ink) 55%, transparent); }

.flc-tab-content mark.highlight {
    padding: 2px 6px;
    background: var(--rb-yellow);
    border-radius: 4px;
}

/* Boutons insérés dans le contenu : pilules à ombre dure */
.flc-tab-content .btn {
    display: inline-block;
    padding: 12px 26px;
    font-weight: 900;
    text-decoration: none;
    color: var(--rb-ink);
    background: var(--rb-white);
    border: var(--rb-border-2);
    border-radius: var(--rb-pill);
    box-shadow: var(--rb-shadow-sm);
    transition: transform 0.15s, box-shadow 0.15s;
}

.flc-tab-content .btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 var(--rb-ink);
}

.flc-tab-content .btn-primary   { background: var(--rb-teal);   color: var(--rb-cream); }
.flc-tab-content .btn-secondary { background: var(--rb-blue);   color: var(--rb-ink); }
.flc-tab-content .btn-success   { background: var(--rb-green);  color: var(--rb-cream); }
.flc-tab-content .btn-danger    { background: var(--rb-orange); color: var(--rb-cream); }

/* ═══ Modale mot de passe — overlay plein écran ═══ */
.flc-roadbook-password-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.flc-roadbook-password-modal--root {
    position: fixed;
    inset: 0;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    max-width: none;
    margin: 0;
    z-index: 2147483000;
}

.flc-roadbook-password-modal--on-list { display: none; }
.flc-roadbook-password-modal--on-list.is-open { display: flex; }

.flc-roadbook-password-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(28, 43, 26, 0.35);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.flc-roadbook-password-modal__box {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 40px);
    overflow: auto;
}

.flc-roadbook-password-modal .flc-roadbook-password-form {
    position: relative;
    padding: 44px 32px 36px;
    text-align: center;
    background: var(--rb-cream);
    border: var(--rb-border);
    border-radius: var(--rb-radius);
    box-shadow: 8px 8px 0 var(--rb-ink);
}

.flc-roadbook-password-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin: 0;
    padding: 0;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--rb-ink);
    text-decoration: none;
    cursor: pointer;
    background: var(--rb-white);
    border: var(--rb-border-2);
    border-radius: 50%;
    box-shadow: 2px 2px 0 var(--rb-ink);
    transition: transform 0.15s, box-shadow 0.15s;
}

.flc-roadbook-password-modal__close:hover {
    transform: rotate(90deg);
    box-shadow: 3px 3px 0 var(--rb-ink);
}

.flc-roadbook-password-modal__close:focus-visible {
    outline: 3px solid var(--rb-yellow);
    outline-offset: 2px;
}

.flc-roadbook-password-modal__close-icon { display: block; }

.flc-roadbook-password-form__title,
.flc-roadbook-password-form h2 {
    margin: 0 0 10px;
    font-family: var(--rb-D);
    font-weight: 400;
    font-size: 1.9rem;
    line-height: 1;
    color: var(--rb-ink);
}

.flc-roadbook-password-form__desc,
.flc-roadbook-password-form p {
    margin-bottom: 18px;
    font-weight: 700;
    color: color-mix(in srgb, var(--rb-ink) 75%, transparent);
}

.flc-roadbook-password-form input[type="password"] {
    width: 100%;
    margin: 14px 0;
    padding: 14px 18px;
    font-size: 16px;
    font-family: var(--rb-B);
    color: var(--rb-ink);
    background: var(--rb-white);
    border: var(--rb-border-2);
    border-radius: var(--rb-radius-sm);
    box-shadow: inset 2px 2px 0 rgba(28, 43, 26, 0.12);
    box-sizing: border-box;
}

.flc-roadbook-password-form input[type="password"]:focus {
    outline: none;
    box-shadow: inset 2px 2px 0 rgba(28, 43, 26, 0.12), 0 0 0 3px var(--rb-yellow);
}

.flc-roadbook-password-form .flc-button {
    margin-top: 8px;
    width: 100%;
}

.flc-error {
    margin-top: 14px;
    font-weight: 800;
    color: var(--rb-orange);
}

.flc-password-modal-error { margin-bottom: 0; }

/* ═══ Animations — privilégie le hook .rev du thème, fallback intégré ═══ */
@keyframes flc-fadeup {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* N'anime à l'entrée que si le thème ne pilote pas déjà .rev */
.flc-roadbook-card:not(.rev) { animation: flc-fadeup 0.45s ease both; }
.flc-roadbooks-grid .flc-roadbook-card:not(.rev):nth-child(2) { animation-delay: 0.05s; }
.flc-roadbooks-grid .flc-roadbook-card:not(.rev):nth-child(3) { animation-delay: 0.10s; }
.flc-roadbooks-grid .flc-roadbook-card:not(.rev):nth-child(4) { animation-delay: 0.15s; }
.flc-roadbooks-grid .flc-roadbook-card:not(.rev):nth-child(5) { animation-delay: 0.20s; }
.flc-roadbooks-grid .flc-roadbook-card:not(.rev):nth-child(6) { animation-delay: 0.25s; }

@media (prefers-reduced-motion: reduce) {
    .flc-roadbook-card,
    .flc-roadbooks-grid .flc-roadbook-card { animation: none; }
    .flc-roadbook-card,
    .flc-tab-button,
    .flc-button { transition: none; }
}

/* ═══ Responsive — breakpoints alignés sur le thème (1024 / 680 / 480) ═══ */
@media (min-width: 680px) {
    .flc-roadbook-summary__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .flc-roadbook-body {
        display: grid;
        grid-template-columns: 320px 1fr;
        gap: 28px;
        align-items: start;
        margin-top: 24px;
    }
    .flc-roadbook-aside {
        position: sticky;
        top: 100px;
    }
    .flc-roadbook-main { margin-top: 0; min-width: 0; }
    .flc-roadbook-summary { margin-top: 0; }
    .flc-roadbook-summary__grid { grid-template-columns: 1fr; }
    .flc-roadbook-tabs { margin-top: 0; }
}

/* Mobile : sélecteur d'onglets natif, rotations désactivées */
@media (max-width: 679px) {
    .flc-tabs-mobile-picker { display: block; }
    .flc-tabs-nav { display: none !important; }

    .flc-roadbooks-grid { grid-template-columns: 1fr; }
    .flc-roadbooks-grid .flc-roadbook-card,
    .flc-roadbook-card:hover { transform: none; }

    .flc-tab-panel.active { padding: 22px 18px; }
    .flc-gpx-map { height: 300px; }
}

/* Compensation barre d'administration WordPress */
body.admin-bar .flc-roadbook-aside { top: 132px; }
@media screen and (max-width: 782px) {
    body.admin-bar .flc-roadbook-aside { top: 100px; }
}

/* Safe-area mobile (encoches) */
@supports (padding: env(safe-area-inset-left)) {
    .flc-roadbooks-list,
    .flc-roadbook-single {
        padding-left: max(clamp(16px, 4vw, 40px), env(safe-area-inset-left));
        padding-right: max(clamp(16px, 4vw, 40px), env(safe-area-inset-right));
    }
}
