/* Accessibilité — texte visible uniquement pour les lecteurs d'écran */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* =========================================
   VARIABLES & RESET
========================================= */
:root {
    --bleu:        #003189;
    --bleu-fonce:  #00205b;
    --rouge:       #C0001B;
    --argent:      #C8C8C8;
    --gris-clair:  #F2F4F8;
    --gris-moyen:  #DDE1EA;
    --blanc:       #FFFFFF;
    --texte:       #2A2A2A;
    --radius:      10px;
    --ombre:       0 4px 18px rgba(0,0,0,.12);
    --transition:  .25s ease;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Open Sans', sans-serif;
    background: var(--gris-clair);
    color: var(--texte);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* =========================================
   HEADER / NAV — MOBILE FIRST
========================================= */
header {
    background: linear-gradient(135deg, var(--bleu-fonce) 0%, var(--bleu) 100%);
    box-shadow: 0 3px 14px rgba(0,0,0,.35);
    position: sticky;
    top: 0;
    z-index: 200;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    z-index: 201;
}
.logo-badge {
    background: var(--rouge);
    color: var(--blanc);
    font-family: 'Oswald', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 4px 10px;
    border-radius: 5px;
    line-height: 1;
}
.logo-text {
    font-family: 'Oswald', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--blanc);
    letter-spacing: 1px;
}
.logo-text span { color: var(--argent); font-weight: 400; }

/* --- HAMBURGER --- */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 18px;
    cursor: pointer;
    z-index: 201;
    background: none;
    border: none;
    padding: 0;
}
.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--blanc);
    border-radius: 2px;
    transition: var(--transition);
}
.hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* --- NAV MOBILE --- */
nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 75%;
    max-width: 280px;
    height: 100vh;
    background: var(--bleu-fonce);
    display: flex;
    flex-direction: column;
    padding: 80px 24px 32px;
    transition: right .3s ease;
    box-shadow: -4px 0 20px rgba(0,0,0,.3);
    z-index: 199;
}
nav.open { right: 0; }

/* Overlay */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 198;
}
.nav-overlay.open { display: block; }

nav ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
nav ul li a {
    display: block;
    font-family: 'Oswald', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: .8px;
    color: var(--argent);
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: var(--transition);
}
nav ul li a:hover,
nav ul li a.active {
    color: var(--blanc);
    border-color: var(--rouge);
    background: rgba(192, 0, 27, .18);
}

.stripe {
    height: 4px;
    background: linear-gradient(90deg, var(--rouge), #ff5a6a, var(--rouge));
}

main {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 14px;
}

/* =========================================
   FOOTER — MOBILE FIRST
========================================= */
footer { background: var(--bleu-fonce); color: var(--argent); margin-top: auto; }
.footer-stripe { height: 4px; background: linear-gradient(90deg, var(--rouge), #ff5a6a, var(--rouge)); }
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 14px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
}
.footer-brand .logo-badge { display: inline-block; font-size: 1.1rem; padding: 4px 10px; margin-bottom: 8px; }
.footer-brand p { font-size: .82rem; color: #b0c4de; line-height: 1.5; }
.footer-links h4 { font-family: 'Oswald', sans-serif; font-size: .9rem; letter-spacing: 1px; color: var(--blanc); margin-bottom: 10px; text-transform: uppercase; }
.footer-links ul { list-style: none; }
.footer-links ul li { margin-bottom: 6px; }
.footer-links ul li a { color: var(--argent); text-decoration: none; font-size: .85rem; transition: color .2s; }
.footer-links ul li a:hover { color: var(--blanc); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); text-align: center; padding: 14px 20px; font-size: .78rem; color: #a0afd0; }

/* =========================================
   PAGE ACCUEIL — MOBILE FIRST
========================================= */
.hero {
    background: linear-gradient(135deg, var(--bleu-fonce) 0%, var(--bleu) 60%, #1a4abf 100%);
    border-radius: var(--radius);
    padding: 36px 22px;
    color: var(--blanc);
    text-align: center;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    right: -60px; top: -60px;
    width: 220px; height: 220px;
    background: rgba(192, 0, 27, .12);
    border-radius: 50%;
}
.hero-content { position: relative; z-index: 1; }
.hero-label {
    display: inline-block;
    background: var(--rouge);
    color: var(--blanc);
    font-family: 'Oswald', sans-serif;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 4px;
    margin-bottom: 14px;
}
.hero h1 { font-family: 'Oswald', sans-serif; font-size: 2rem; font-weight: 700; line-height: 1.1; margin-bottom: 12px; }
.hero h1 span { color: var(--argent); }
.hero p { font-size: .95rem; color: rgba(255,255,255,.82); line-height: 1.7; margin-bottom: 20px; }
.hero-visual { display: none; }
.btn-hero {
    display: inline-block;
    background: var(--rouge);
    color: var(--blanc);
    font-family: 'Oswald', sans-serif;
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: 1px;
    padding: 10px 24px;
    border-radius: 7px;
    text-decoration: none;
    transition: var(--transition);
    border: 2px solid var(--rouge);
}
.btn-hero:hover { background: transparent; }

/* STATS */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 24px; }
.stat-card {
    background: var(--blanc);
    border-radius: var(--radius);
    box-shadow: var(--ombre);
    padding: 20px 14px;
    text-align: center;
    border-top: 4px solid var(--bleu);
    transition: var(--transition);
}
.stat-card:hover { transform: translateY(-3px); }
.stat-card:nth-child(2) { border-color: var(--rouge); }
.stat-card:nth-child(3) { border-color: #f0a500; }
.stat-card:nth-child(4) { border-color: #00875a; }
.stat-number { font-family: 'Oswald', sans-serif; font-size: 2rem; font-weight: 700; color: var(--bleu); line-height: 1; margin-bottom: 4px; }
.stat-card:nth-child(2) .stat-number { color: var(--rouge); }
.stat-card:nth-child(3) .stat-number { color: #f0a500; }
.stat-card:nth-child(4) .stat-number { color: #00875a; }
.stat-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: #595959; }

/* SECTION HEADER */
.section-header { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 16px; }
.section-header h2 { font-family: 'Oswald', sans-serif; font-size: 1.4rem; font-weight: 700; color: var(--bleu-fonce); }
.section-header h2::after { content: ''; display: block; width: 36px; height: 3px; background: var(--rouge); margin-top: 5px; border-radius: 2px; }
.btn-voir { font-family: 'Oswald', sans-serif; font-size: .85rem; font-weight: 600; color: var(--bleu); text-decoration: none; border: 2px solid var(--bleu); padding: 5px 14px; border-radius: 6px; transition: var(--transition); }
.btn-voir:hover { background: var(--bleu); color: var(--blanc); }

/* CARDS TGV */
.cards-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 24px; }
.tgv-card, article.tgv-card { background: var(--blanc); border-radius: var(--radius); box-shadow: var(--ombre); overflow: hidden; transition: var(--transition); border: 1px solid var(--gris-moyen); }
.tgv-card:hover { transform: translateY(-4px); box-shadow: 0 10px 32px rgba(0,49,137,.18); }
.card-img { background: linear-gradient(135deg, var(--bleu-fonce), var(--bleu)); height: 100px; display: flex; align-items: center; justify-content: center; font-family: 'Oswald', sans-serif; font-size: 2.2rem; font-weight: 700; color: rgba(255,255,255,.15); position: relative; }
.card-img .tgv-emoji { font-size: 2.2rem; position: absolute; opacity: .85; }
.card-body { padding: 14px; }
.card-badge { display: inline-block; background: var(--gris-clair); color: var(--bleu); font-size: .7rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; padding: 2px 8px; border-radius: 20px; margin-bottom: 6px; border: 1px solid var(--gris-moyen); }
.card-title { font-family: 'Oswald', sans-serif; font-size: 1.1rem; font-weight: 600; color: var(--bleu-fonce); margin-bottom: 8px; }
.card-meta { display: flex; flex-direction: column; gap: 3px; }
.card-meta span { font-size: .8rem; color: #555; display: flex; align-items: center; gap: 5px; }
.meta-icon { font-size: .85rem; }

/* LIGNES LIST */
.lignes-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.ligne-row { background: var(--blanc); border-radius: var(--radius); box-shadow: var(--ombre); padding: 14px 16px; display: flex; align-items: center; gap: 14px; border-left: 5px solid var(--bleu); transition: var(--transition); flex-wrap: wrap; }
.ligne-row:hover { border-left-color: var(--rouge); transform: translateX(3px); }
.ligne-icon { font-size: 1.4rem; flex-shrink: 0; }
.ligne-info { flex: 1; min-width: 0; }
.ligne-nom { font-family: 'Oswald', sans-serif; font-size: .95rem; font-weight: 600; color: var(--bleu-fonce); }
.ligne-trajet { font-size: .78rem; color: #595959; margin-top: 2px; }
.ligne-trajet strong { color: var(--texte); }
.ligne-dist { font-family: 'Oswald', sans-serif; font-size: 1rem; font-weight: 700; color: var(--rouge); white-space: nowrap; width: 100%; text-align: right; }

/* =========================================
   PAGE LISTING — MOBILE FIRST
========================================= */
.page-header {
    background: linear-gradient(135deg, var(--bleu-fonce), var(--bleu));
    border-radius: var(--radius);
    padding: 24px 18px;
    color: var(--blanc);
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: center;
}
.page-header h1 { font-family: 'Oswald', sans-serif; font-size: 1.5rem; font-weight: 700; }
.page-header p { font-size: .85rem; color: rgba(255,255,255,.75); margin-top: 4px; }
.count-badge { background: var(--rouge); color: var(--blanc); font-family: 'Oswald', sans-serif; font-size: 1.6rem; font-weight: 700; padding: 10px 20px; border-radius: 8px; text-align: center; }
.count-badge small { display: block; font-size: .6rem; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; opacity: .85; }

.section-label { font-family: 'Oswald', sans-serif; font-size: 1.2rem; font-weight: 700; color: var(--bleu-fonce); margin-bottom: 14px; padding-bottom: 8px; border-bottom: 3px solid var(--rouge); display: inline-block; }

/* TABLE */
.table-wrapper { background: var(--blanc); border-radius: var(--radius); box-shadow: var(--ombre); overflow-x: auto; margin-bottom: 32px; border: 1px solid var(--gris-moyen); }
table { width: 100%; border-collapse: collapse; font-size: .82rem; }
thead tr { background: linear-gradient(135deg, var(--bleu-fonce), var(--bleu)); color: var(--blanc); }
thead th { font-family: 'Oswald', sans-serif; font-size: .72rem; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; padding: 11px 10px; text-align: left; white-space: nowrap; }
tbody tr { border-bottom: 1px solid var(--gris-moyen); transition: background var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f0f4ff; }
tbody td { padding: 11px 10px; vertical-align: middle; color: var(--texte); }

/* Colonnes masquées sur mobile */
.col-hide { display: none; }

.tgv-name { font-family: 'Oswald', sans-serif; font-size: .9rem; font-weight: 600; color: var(--bleu-fonce); }
.tgv-icon { font-size: 1.2rem; margin-right: 6px; vertical-align: middle; }
.badge-vitesse { background: #e8f0fe; color: var(--bleu); font-weight: 700; font-size: .75rem; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.badge-pays { background: var(--gris-clair); color: var(--texte); font-size: .72rem; font-weight: 600; padding: 2px 7px; border-radius: 20px; border: 1px solid var(--gris-moyen); white-space: nowrap; }

/* Photo TGV */
.tgv-photo { width: 90px; height: 100px; object-fit: cover; border-radius: 5px; display: block; }
.tgv-photo-placeholder { width: 90px; height: 100px; background: linear-gradient(135deg, var(--bleu-fonce), var(--bleu)); border-radius: 5px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }

/* Image inline dans le tableau */
.table-wrapper img { width: 180px !important; height: 120px !important; object-fit: cover; border-radius: 4px; display: block; }


/* =========================================
   BREAKPOINT 576px — DESKTOP ENHANCEMENTS
========================================= */
@media (min-width: 576px) {

    .header-inner { height: 70px; padding: 0 20px; }
    .logo-badge { font-size: 1.3rem; padding: 5px 12px; }
    .logo-text { font-size: 1.4rem; }

    /* Nav desktop : on cache le hamburger, on affiche la nav normale */
    .hamburger { display: none; }
    .nav-overlay { display: none !important; }

    nav {
        position: static;
        width: auto;
        max-width: none;
        height: auto;
        background: none;
        flex-direction: row;
        padding: 0;
        box-shadow: none;
        right: auto;
    }
    nav ul { flex-direction: row; gap: 6px; }
    nav ul li a { font-size: .95rem; padding: 8px 16px; }

    main { padding: 40px 20px; }

    /* Footer desktop */
    .footer-inner { flex-direction: row; align-items: center; justify-content: center; text-align: center; padding: 32px 20px 20px; }

    /* Hero desktop */
    .hero { display: flex; align-items: center; justify-content: space-between; text-align: left; padding: 64px 48px; margin-bottom: 50px; }
    .hero h1 { font-size: 3rem; }
    .hero-visual { display: block; font-family: 'Oswald', sans-serif; font-size: 8rem; font-weight: 700; color: rgba(255,255,255,.07); line-height: 1; white-space: nowrap; letter-spacing: -4px; position: relative; z-index: 1; }

    /* Stats */
    .stats-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 50px; }
    .stat-number { font-size: 2.4rem; }

    /* Section header */
    .section-header { flex-direction: row; align-items: center; margin-bottom: 24px; }

    /* Cards */
    .cards-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 50px; }

    /* Ligne dist */
    .ligne-dist { width: auto; }

    /* Page header listing */
    .page-header { flex-direction: row; align-items: center; text-align: left; padding: 36px 40px; margin-bottom: 36px; }

    /* Colonnes visibles desktop */
    .col-hide { display: table-cell; }

    table { font-size: .78rem; table-layout: fixed; width: 100%; }
    thead th { font-size: .72rem; padding: 10px 7px; }
    tbody td { padding: 10px 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    /* Largeurs fixes par colonne pour eviter le scroll horizontal */
    table th:nth-child(1),  table td:nth-child(1)  { width: 190px; } /* Photo        */
    table th:nth-child(2),  table td:nth-child(2)  { width: 150px; } /* Modele       */
    table th:nth-child(3),  table td:nth-child(3)  { width: 110px; } /* Constructeur */
    table th:nth-child(4),  table td:nth-child(4)  { width: 75px;  } /* Vitesse      */
    table th:nth-child(5),  table td:nth-child(5)  { width: 65px;  } /* Capacite     */
    table th:nth-child(6),  table td:nth-child(6)  { width: 55px;  } /* Service      */
    table th:nth-child(7),  table td:nth-child(7)  { width: 90px; white-space: normal; } /* Pays */
    table th:nth-child(8),  table td:nth-child(8)  { width: 120px; } /* Ligne        */
    table th:nth-child(9),  table td:nth-child(9)  { width: 110px; } /* Depart       */
    table th:nth-child(10), table td:nth-child(10) { width: 110px; } /* Arrivee      */
    table th:nth-child(11), table td:nth-child(11) { width: 65px;  } /* Distance     */
}
/* =========================================
   FOCUS VISIBLE — Accessibilité clavier
========================================= */
:focus-visible {
    outline: 3px solid var(--rouge);
    outline-offset: 2px;
    border-radius: 3px;
}
a:focus-visible, button:focus-visible {
    outline: 3px solid #ff6b35;
    outline-offset: 3px;
}