/* ============================================================
   data.astrobreizh.fr — Feuille de style
   ============================================================
   Reprend la charte du site principal (Orbitron, rouge #d32f2f,
   fond nuit #0b1026 de la section Rocket Creator) en la déclinant
   sur un fond sombre : les courbes de télémétrie se lisent mieux
   sur fond nuit, et l'écart visuel signale qu'on est sur une
   section « données » plutôt que sur le site vitrine.
   ============================================================ */

@font-face {
    font-family: 'Orbitron';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/orbitron-v35-latin-variable.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: 'Orbitron';
    font-style: normal;
    font-weight: 900;
    font-display: swap;
    src: url('../fonts/orbitron-v35-latin-variable.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 {
    --nuit: #0b1026;
    --nuit-2: #141c3d;
    --nuit-3: #1b2450;
    --metal: #8a94a6;
    --metal-clair: #c7cedb;
    --texte: #e8edf7;
    --rouge: #d32f2f;
    --rouge-vif: #ff3b30;
    --or: #f5b642;
    --cyan: #4dd0e1;
    --bordure: rgba(199, 206, 219, 0.14);
    --display: 'Orbitron', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --corps: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--corps);
    line-height: 1.6;
    color: var(--texte);
    background: var(--nuit);
    /* Halo discret rappelant le champ d'étoiles du site principal. */
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(211, 47, 47, 0.18), transparent 70%),
        radial-gradient(ellipse 60% 40% at 90% 10%, rgba(77, 208, 225, 0.08), transparent 70%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

a { color: var(--cyan); }

/* ============================================
   Navigation
   ============================================ */

.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(11, 16, 38, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--bordure);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.logo { display: flex; align-items: baseline; gap: 0.6rem; }

.logo h1 { font-family: var(--display); font-size: 1.25rem; font-weight: 900; }

.logo h1 a { color: var(--texte); text-decoration: none; }

.logo-sous-titre {
    font-family: var(--display);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--rouge-vif);
}

.nav-menu { list-style: none; display: flex; gap: 1.25rem; flex-wrap: wrap; }

.nav-menu a {
    color: var(--metal-clair);
    text-decoration: none;
    font-size: 0.92rem;
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.nav-menu a:hover { color: var(--texte); }

.nav-menu a.active { color: var(--texte); border-bottom-color: var(--rouge); }

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

.entete { padding: 3rem 0 2rem; text-align: center; }

.entete h1 {
    font-family: var(--display);
    font-size: clamp(1.6rem, 4vw, 2.5rem);
    font-weight: 900;
    letter-spacing: 0.02em;
}

.entete p {
    max-width: 60ch;
    margin: 0.9rem auto 0;
    color: var(--metal-clair);
}

/* ============================================
   Barre d'outils (sélection du vol, zoom)
   ============================================ */

.barre-outils {
    position: sticky;
    top: 56px;
    z-index: 40;
    background: rgba(20, 28, 61, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--bordure);
    border-bottom: 1px solid var(--bordure);
    padding: 0.75rem 0;
    margin-bottom: 1.5rem;
}

.barre-outils-contenu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.champ-selection { display: flex; align-items: center; gap: 0.6rem; flex: 1 1 320px; }

.champ-selection label {
    font-family: var(--display);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--metal);
    white-space: nowrap;
}

#selecteur-vol {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 30rem;
    background: var(--nuit);
    color: var(--texte);
    border: 1px solid var(--bordure);
    border-radius: 6px;
    padding: 0.5rem 0.7rem;
    font-family: var(--corps);
    font-size: 0.95rem;
    cursor: pointer;
}

#selecteur-vol:focus-visible,
.btn:focus-visible,
.legende-item:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
}

#selecteur-vol:disabled { opacity: 0.55; cursor: default; }

/* Les <option> héritent du fond du système, pas du nôtre : sans ça,
   le menu déroulant ouvert est illisible sur certains navigateurs. */
#selecteur-vol option { background: var(--nuit-2); color: var(--texte); }

.commandes-zoom { display: flex; align-items: center; gap: 0.75rem; }

.etat-zoom {
    font-size: 0.82rem;
    color: var(--metal);
    font-variant-numeric: tabular-nums;
}

.btn {
    display: inline-block;
    border: 1px solid var(--bordure);
    background: transparent;
    color: var(--texte);
    border-radius: 6px;
    padding: 0.45rem 0.9rem;
    font-family: var(--corps);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s, opacity 0.2s;
}

.btn:hover:not(:disabled) { border-color: var(--cyan); background: rgba(77, 208, 225, 0.08); }

.btn:disabled { opacity: 0.4; cursor: default; }

/* ============================================
   Messages
   ============================================ */

.message {
    border-radius: 8px;
    padding: 1rem 1.15rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--bordure);
    background: var(--nuit-2);
    font-size: 0.95rem;
}

.message.erreur {
    border-color: rgba(255, 59, 48, 0.5);
    background: rgba(211, 47, 47, 0.14);
}

.message code {
    font-family: Consolas, 'Courier New', monospace;
    font-size: 0.88em;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.1em 0.4em;
    border-radius: 4px;
}

/* ============================================
   Fiche du vol
   ============================================ */

.fiche-vol {
    background: var(--nuit-2);
    border: 1px solid var(--bordure);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.fiche-entete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.fiche-entete h2 {
    font-family: var(--display);
    font-size: clamp(1.2rem, 3vw, 1.7rem);
    font-weight: 700;
}

.bandeau-demo {
    border-left: 3px solid var(--or);
    background: rgba(245, 182, 66, 0.12);
    padding: 0.8rem 1rem;
    border-radius: 0 6px 6px 0;
    margin-bottom: 1.1rem;
    font-size: 0.92rem;
    color: var(--metal-clair);
}

.bandeau-demo strong { color: var(--or); }

.fiche {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.9rem 1.5rem;
}

.fiche-ligne dt {
    font-family: var(--display);
    font-size: 0.66rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--metal);
    margin-bottom: 0.15rem;
}

.fiche-ligne dd { font-size: 0.98rem; }

.description-vol {
    margin-top: 1.1rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--bordure);
    color: var(--metal-clair);
    font-size: 0.94rem;
}

/* ============================================
   Tuiles de chiffres clés
   ============================================ */

.tuiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.9rem;
    margin-bottom: 1.5rem;
}

.tuile {
    background: var(--nuit-2);
    border: 1px solid var(--bordure);
    border-top: 2px solid var(--rouge);
    border-radius: 10px;
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.tuile-alerte { border-top-color: var(--or); }

.tuile-label {
    font-family: var(--display);
    font-size: 0.62rem;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--metal);
    line-height: 1.4;
}

.tuile-valeur {
    font-family: var(--display);
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    display: flex;
    align-items: baseline;
    gap: 0.28rem;
}

.tuile-unite { font-size: 0.85rem; font-weight: 400; color: var(--metal); }

.tuile-detail { font-size: 0.78rem; color: var(--metal); }

.tuile-alerte .tuile-detail { color: var(--or); }

/* ============================================
   Avertissements de lecture
   ============================================ */

.avertissements {
    background: rgba(245, 182, 66, 0.08);
    border: 1px solid rgba(245, 182, 66, 0.3);
    border-radius: 10px;
    padding: 1.1rem 1.3rem;
    margin-bottom: 1.5rem;
}

.avertissements h3 {
    font-family: var(--display);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--or);
    margin-bottom: 0.6rem;
}

.avertissements ul { margin: 0; padding-left: 1.2rem; }

.avertissements li {
    font-size: 0.9rem;
    color: var(--metal-clair);
    margin-bottom: 0.4rem;
}

.avertissements li:last-child { margin-bottom: 0; }

/* ============================================
   Graphiques
   ============================================ */

.aide-graphiques {
    font-size: 0.86rem;
    color: var(--metal);
    margin-bottom: 0.9rem;
    max-width: 78ch;
}

.legende-reperes {
    display: flex;
    flex-wrap: wrap;
    gap: 1.1rem;
    margin-bottom: 1.1rem;
    font-size: 0.82rem;
    color: var(--metal-clair);
}

.repere-item { display: inline-flex; align-items: center; gap: 0.4rem; }

.repere-trait {
    display: inline-block;
    width: 2px;
    height: 0.85em;
    /* Rappelle le pointillé utilisé pour les repères sur le canvas. */
    background-image: linear-gradient(currentColor 50%, transparent 0);
    background-size: 2px 5px;
}

.repere-t { color: var(--metal); font-variant-numeric: tabular-nums; }

.carte-graphique {
    background: var(--nuit-2);
    border: 1px solid var(--bordure);
    border-radius: 12px;
    padding: 1.1rem 1.2rem 1.2rem;
    margin-bottom: 1.1rem;
}

.carte-graphique header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem 1.25rem;
    flex-wrap: wrap;
    margin-bottom: 0.6rem;
}

.carte-graphique h3 {
    font-family: var(--display);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.grille-graphiques {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
    gap: 1.1rem;
}

.grille-graphiques .carte-graphique { margin-bottom: 0; }

.zone-canvas { position: relative; height: 210px; }

.zone-canvas-haute { height: 300px; }

.zone-canvas canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
    /* Laisse le défilement vertical de la page passer au travers,
       tout en réservant les gestes horizontaux au zoom du graphique. */
    touch-action: pan-y;
}

.note-graphique {
    margin-top: 0.7rem;
    font-size: 0.8rem;
    color: var(--metal);
    line-height: 1.5;
    max-width: 76ch;
}

/* --- Légende cliquable --- */

.legende { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; }

.legende-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    border: none;
    padding: 0.15rem 0.2rem;
    border-radius: 4px;
    color: var(--metal-clair);
    font-family: var(--corps);
    font-size: 0.8rem;
    cursor: pointer;
    transition: opacity 0.15s;
}

.legende-item:hover { color: var(--texte); }

.legende-item.masquee { opacity: 0.38; }

.legende-pastille {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

.legende-valeur {
    font-variant-numeric: tabular-nums;
    color: var(--texte);
    /* Largeur réservée : sans elle, la légende se réorganise à chaque
       mouvement de curseur et le texte « saute » sous la souris. */
    min-width: 6.5ch;
    text-align: right;
}

.legende-item.masquee .legende-valeur { color: var(--metal); }

/* Le tiret signale l'absence de valeur (curseur hors du graphique) :
   grisé, il ne se lit plus comme un séparateur entre les entrées. */
.legende-valeur.sans-valeur { color: rgba(138, 148, 166, 0.5); }

/* ============================================
   Note de méthode
   ============================================ */

.methode {
    background: var(--nuit-2);
    border: 1px solid var(--bordure);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0 3rem;
}

.methode h2 {
    font-family: var(--display);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
}

.methode p {
    color: var(--metal-clair);
    font-size: 0.92rem;
    max-width: 80ch;
    margin-bottom: 0.8rem;
}

.methode p:last-child { margin-bottom: 0; }

.methode strong { color: var(--texte); }

/* ============================================
   Pied de page
   ============================================ */

.footer {
    border-top: 1px solid var(--bordure);
    background: rgba(11, 16, 38, 0.6);
    padding: 2rem 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--metal);
}

.footer p { margin-bottom: 0.35rem; }

/* ============================================
   Adaptations petits écrans
   ============================================ */

@media (max-width: 700px) {
    .barre-outils { position: static; }
    .barre-outils-contenu { align-items: stretch; }
    .champ-selection { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
    #selecteur-vol { max-width: none; width: 100%; }
    .commandes-zoom { justify-content: space-between; }
    .zone-canvas { height: 190px; }
    .zone-canvas-haute { height: 230px; }
    .tuile-valeur { font-size: 1.45rem; }
    .nav-menu { gap: 0.9rem; font-size: 0.85rem; }
}

/* Respecte le réglage système : pas d'animation de défilement forcée. */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; }
}
