/* ============================================================
   cosmic.css — Design system hb9vkl.ch
   Inspiré de la QSL : noir profond, voie lactée, arcs dorés, cyan
   ============================================================ */

/* ----- Variables ----- */
:root {
    /* Couleurs */
    --bg-deep:       #050510;
    --bg-card:       #0f1320;
    --bg-card-hov:   #14182a;
    --bg-elevated:   #181d2f;

    --text-primary:  #e6edf3;
    --text-secondary:#a8b3c5;
    --text-muted:    #6e7891;

    --accent-gold:   #ffd060;
    --accent-gold-d: #d4a020;
    --accent-cyan:   #5fc4ff;
    --accent-cyan-d: #1f6feb;
    --accent-red:    #d52b1e;       /* rouge drapeau suisse */

    --border:        #1f2940;
    --border-light:  #2a3550;

    /* Effets */
    --glow-gold:     0 0 24px rgba(255, 208, 96, 0.45);
    --glow-cyan:     0 0 18px rgba(95, 196, 255, 0.35);

    /* Typo */
    --font-display:  'Inter', 'Helvetica Neue', Arial, sans-serif;
    --font-body:     'Inter', system-ui, -apple-system, sans-serif;
    --font-mono:     'JetBrains Mono', 'Courier New', monospace;

    /* Rythme */
    --container:     1280px;
    --gutter:        clamp(16px, 3vw, 32px);
    --section-pad:   clamp(60px, 10vw, 120px);
    --radius:        12px;
    --radius-lg:     20px;
}

/* ----- Reset minimaliste ----- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

/* Accessibilité clavier : anneau de focus net et contrasté (cyan du thème).
   :focus-visible n'apparaît qu'à la navigation clavier, pas au clic souris. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--accent-cyan);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Reset des figures (le navigateur leur met 40px de margin par défaut !) */
figure { margin: 0; min-width: 0; }
a { color: var(--accent-cyan); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-gold); }

/* ----- Fond cosmique global ----- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 80% 20%, rgba(255, 100, 60, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 80%, rgba(95, 196, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(255, 208, 96, 0.04) 0%, transparent 70%),
        var(--bg-deep);
    z-index: -2;
}

/* Champ d'étoiles */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 25px 5px, white, transparent),
        radial-gradient(1px 1px at 50px 25px, rgba(255,255,255,0.85), transparent),
        radial-gradient(1px 1px at 125px 20px, white, transparent),
        radial-gradient(1.5px 1.5px at 50px 75px, rgba(255,255,255,0.9), transparent),
        radial-gradient(2px 2px at 15px 125px, white, transparent),
        radial-gradient(1px 1px at 110px 80px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1.5px 1.5px at 200px 35px, white, transparent);
    background-size: 250px 250px;
    background-repeat: repeat;
    opacity: 0.65;
    z-index: -1;
    pointer-events: none;
}

/* ============================================================
   Typographie
   ============================================================ */
h1, h2, h3, h4, h5 {
    font-family: var(--font-display);
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: 0 0 0.5em 0;
}
h1 { font-size: clamp(2.2rem, 5vw, 4rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); font-weight: 700; }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); font-weight: 600; }
h4 { font-size: 1.2rem; font-weight: 600; }

.callsign-hero {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(3rem, 11vw, 9rem);
    line-height: 1;
    letter-spacing: -0.04em;
    color: #fff;
    text-shadow: 0 4px 30px rgba(0,0,0,0.5);
}

.tagline-gold {
    color: var(--accent-gold);
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-size: 0.95rem;
}

p { margin: 0 0 1em 0; color: var(--text-secondary); }
.lead { font-size: 1.15rem; color: var(--text-primary); }

/* ============================================================
   Layout
   ============================================================ */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
}
.section { padding: var(--section-pad) 0; }
.section-tight { padding: clamp(40px, 6vw, 80px) 0; }

/* ============================================================
   Header / Navigation
   ============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(5, 5, 16, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;  /* margin-left: auto sur les drapeaux fera le push à droite */
    flex-wrap: nowrap;
    gap: 8px;
    height: 72px;
}
.site-header__brand,
.site-nav-toggle {
    flex-shrink: 0;   /* le logo et le burger ne se compressent jamais */
}
.site-header__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.4rem;
    color: #fff;
    letter-spacing: -0.01em;
}
.site-header__brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, var(--accent-gold), var(--accent-gold-d));
    box-shadow: var(--glow-gold);
    position: relative;
}
.site-header__brand-icon::after {
    content: '';
    position: absolute; inset: -8px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 208, 96, 0.3);
    animation: pulse 3s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50%      { transform: scale(1.15); opacity: 0.2; }
}

.site-nav { display: flex; gap: 2px; }
.site-nav a {
    color: var(--text-secondary);
    font-size: 0.92rem;
    font-weight: 500;
    padding: 8px 11px;
    border-radius: 8px;
    transition: all .2s;
    white-space: nowrap;
}
.site-nav a:hover { color: #fff; background: var(--bg-card); }
.site-nav a.active {
    color: var(--accent-gold);
    background: rgba(255, 208, 96, 0.08);
}

.site-nav-toggle { display: none; }

/* ===== Boutons drapeaux : traduction Google Translate ===== */
.site-translate {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;   /* push à droite, mais avant le burger */
    margin-right: 50px;  /* respiration entre drapeaux et menu */
    flex-shrink: 0;
}
.site-translate__link {
    font-size: 1.15rem;
    line-height: 1;
    padding: 5px 7px;
    border-radius: 6px;
    text-decoration: none;
    opacity: 0.65;
    transition: opacity 0.2s, transform 0.2s, background 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.site-translate__link:hover {
    opacity: 1;
    transform: scale(1.15);
    background: rgba(95, 196, 255, 0.08);
}

/* Mobile : on serre tout pour que ça tienne dans la largeur */
@media (max-width: 880px) {
    .site-translate {
        margin-right: 6px;
        gap: 0;
    }
    .site-translate__link {
        font-size: 0.95rem;
        padding: 3px 4px;
        opacity: 0.85;
    }
}
@media (max-width: 480px) {
    .site-translate {
        margin-right: 4px;
        gap: 0;
    }
    .site-translate__link {
        font-size: 0.85rem;
        padding: 2px 3px;
    }
    /* Logo compact sur très petit écran pour faire de la place */
    .site-header__brand {
        font-size: 1.15rem;
        gap: 8px;
    }
    .site-header__brand-icon {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 880px) {
    .site-nav-toggle {
        display: block;
        background: transparent;
        border: 1px solid var(--border);
        color: #fff;
        padding: 8px 10px;
        border-radius: 8px;
        cursor: pointer;
    }
    .site-nav {
        display: none;
        position: absolute;
        top: 72px;
        left: 0; right: 0;
        flex-direction: column;
        background: var(--bg-deep);
        border-bottom: 1px solid var(--border);
        padding: 12px var(--gutter);
        gap: 4px;
    }
    .site-nav.is-open { display: flex; }
    .site-nav a { padding: 12px; }
}

/* ============================================================
   Cards & Composants
   ============================================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: clamp(20px, 3vw, 32px);
    transition: all .25s ease;
}
.card:hover {
    border-color: var(--border-light);
    background: var(--bg-card-hov);
    transform: translateY(-2px);
}
.card--gold {
    border-color: var(--accent-gold-d);
    background: linear-gradient(135deg, rgba(255, 208, 96, 0.06), transparent);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    font-family: var(--font-display);
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .2s;
}
.btn-primary {
    background: var(--accent-gold);
    color: #1c1306;
    box-shadow: var(--glow-gold);
}
.btn-primary:hover {
    background: #fff;
    color: var(--accent-gold-d);
    transform: translateY(-1px);
}
.btn-secondary {
    background: transparent;
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}
.btn-secondary:hover {
    background: rgba(95, 196, 255, 0.1);
    border-color: #fff;
    color: #fff;
}
.btn-ghost {
    background: var(--bg-card);
    border-color: var(--border);
    color: var(--text-primary);
}
.btn-ghost:hover { background: var(--bg-card-hov); border-color: var(--border-light); }

/* ============================================================
   Stat blocks (compteurs DXCC, QSO, etc.)
   ============================================================ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin: 32px 0;
}
/* Variante 3 colonnes — quand il y a 6 stats, évite la grille trop serrée
   !important pour passer outre le auto-fit du .stat-grid de base */
.stat-grid.stat-grid--3col {
    grid-template-columns: repeat(3, 1fr) !important;
}
@media (max-width: 720px) {
    .stat-grid.stat-grid--3col {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
@media (max-width: 420px) {
    .stat-grid.stat-grid--3col {
        grid-template-columns: 1fr !important;
    }
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    text-align: center;
    transition: all .25s;
}
.stat-card:hover {
    border-color: var(--accent-gold-d);
    box-shadow: var(--glow-gold);
}
.stat-card__value {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    color: var(--accent-gold);
    line-height: 1;
    margin-bottom: 6px;
}
.stat-card__label {
    color: var(--text-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

/* ============================================================
   Hero (page d'accueil) — avec photo cosmique en arrière-plan
   ============================================================ */
.hero {
    position: relative;
    min-height: clamp(480px, 70vh, 720px);
    display: flex;
    align-items: center;
    overflow: hidden;
    background-image: url('../img/hero-cosmic.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}
/* Overlay sombre uniquement sur la GAUCHE (où va le texte)
   pour que la zone droite + centre (Suisse + arcs + voie lactée) reste intacte */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        /* Très léger fondu en tout bas pour la jonction avec la section suivante (10% seulement) */
        linear-gradient(180deg, transparent 88%, rgba(5,5,16,0.7) 97%, var(--bg-deep) 100%),
        /* Vignette sombre à GAUCHE pour la lisibilité du texte, transparente à droite */
        linear-gradient(90deg, rgba(5,5,16,0.65) 0%, rgba(5,5,16,0.35) 35%, rgba(5,5,16,0.05) 55%, transparent 75%);
    z-index: 1;
    pointer-events: none;
}
.hero__arcs {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}
/* Canvas d'animation des arcs radio par-dessus la photo cosmique */
.hero__canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}
.hero__content {
    position: relative;
    z-index: 2;
    padding-top: 40px;
    padding-bottom: 60px;
    max-width: 720px;     /* texte aligné à gauche, libère la moitié droite pour la photo */
}
.hero__content > * { text-shadow: 0 2px 18px rgba(0,0,0,0.7); }
.hero__content .btn { text-shadow: none; }
.callsign-hero { text-shadow: 0 4px 30px rgba(0,0,0,0.65), 0 0 60px rgba(0,0,0,0.3); }
.hero__sub {
    color: var(--accent-gold);
    letter-spacing: 0.25em;
    font-size: 0.95rem;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.hero__intro {
    max-width: 620px;
    font-size: 1.15rem;
    color: #d0d8e5;   /* gris très clair, vers le blanc — meilleure lisibilité sur la photo */
    margin: 24px 0 32px 0;
}
.hero__actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* Drapeau suisse stylisé */
.swiss-flag {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px 4px 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
}
.swiss-flag::before {
    content: '';
    width: 24px;
    height: 24px;
    background: var(--accent-red);
    border-radius: 3px;
    position: relative;
}
.swiss-flag-cross {
    width: 24px; height: 24px;
    display: inline-block;
    background: var(--accent-red);
    border-radius: 3px;
    position: relative;
    flex-shrink: 0;
}
.swiss-flag-cross::before, .swiss-flag-cross::after {
    content: '';
    position: absolute;
    background: #fff;
}
.swiss-flag-cross::before {  /* barre verticale */
    top: 5px; bottom: 5px; left: 10px; width: 4px;
}
.swiss-flag-cross::after {   /* barre horizontale */
    left: 5px; right: 5px; top: 10px; height: 4px;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
    margin-top: 80px;
    padding: 40px 0 24px;
    border-top: 1px solid var(--border);
    background: linear-gradient(180deg, transparent, rgba(0,0,0,0.4));
}
.site-footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}
@media (max-width: 720px) {
    .site-footer__grid { grid-template-columns: 1fr 1fr; }
}
.site-footer h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-gold);
    margin-bottom: 16px;
}
.site-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.site-footer li { margin-bottom: 8px; }
.site-footer a {
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.site-footer a:hover { color: #fff; }
.site-footer__bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
}
.site-footer__bottom .callsign {
    color: var(--accent-gold);
    font-family: var(--font-mono);
    font-weight: bold;
    letter-spacing: 0.1em;
}

/* ============================================================
   Utilitaires
   ============================================================ */
.text-gold  { color: var(--accent-gold); }
.text-cyan  { color: var(--accent-cyan); }
.text-muted { color: var(--text-muted); }
.text-center{ text-align: center; }
.mono       { font-family: var(--font-mono); }
.glow-gold  { box-shadow: var(--glow-gold); }
.glow-cyan  { box-shadow: var(--glow-cyan); }

.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-light), transparent);
    margin: 40px 0;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-cyan);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: 600;
    margin-bottom: 16px;
}
/* Trait décoratif retiré (design plus sobre) */

/* Animation d'apparition */
@media (prefers-reduced-motion: no-preference) {
    .fade-in {
        opacity: 0;
        transform: translateY(20px);
        animation: fadeIn .8s ease forwards;
    }
    .fade-in-delay-1 { animation-delay: .15s; }
    .fade-in-delay-2 { animation-delay: .3s; }
    .fade-in-delay-3 { animation-delay: .45s; }
}
@keyframes fadeIn {
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   FIX RESPONSIVE GLOBAL — Aplatit les grilles inline 2 cols → 1 col
   Couvre toutes les variantes de grid-template-columns utilisées
   dans les pages (avec/sans espace après les `:`, ratios divers)
   ============================================================ */
@media (max-width: 860px) {
    /* Grilles 1fr 1fr et variantes (texte + cards / photo + texte) */
    .section [style*="grid-template-columns: 1fr 1fr"],
    .section [style*="grid-template-columns:1fr 1fr"],
    .section [style*="grid-template-columns: 1.1fr 1fr"],
    .section [style*="grid-template-columns:1.1fr 1fr"],
    .section [style*="grid-template-columns: 1.3fr 1fr"],
    .section [style*="grid-template-columns:1.3fr 1fr"],
    .section [style*="grid-template-columns: 1fr 1.3fr"],
    .section [style*="grid-template-columns:1fr 1.3fr"],
    .section [style*="grid-template-columns: 1fr 1.1fr"],
    .section [style*="grid-template-columns:1fr 1.1fr"],
    .section [style*="grid-template-columns: 1fr 1.4fr"],
    .section [style*="grid-template-columns:1fr 1.4fr"],
    .section [style*="grid-template-columns: 1.4fr 1fr"],
    .section [style*="grid-template-columns:1.4fr 1fr"],
    .section [style*="grid-template-columns: 2fr 1fr"],
    .section [style*="grid-template-columns:2fr 1fr"],
    .section [style*="grid-template-columns: 1fr 2fr"],
    .section [style*="grid-template-columns:1fr 2fr"],
    .section [style*="grid-template-columns: auto 1fr"],
    .section [style*="grid-template-columns:auto 1fr"],
    .section [style*="grid-template-columns: 1fr auto"],
    .section [style*="grid-template-columns:1fr auto"] {
        grid-template-columns: 1fr !important;
        gap: 28px !important;
    }

    /* Grilles auto-fit avec minmax — forcer 1 colonne propre sur mobile */
    .section [style*="grid-template-columns: repeat(auto-fit"],
    .section [style*="grid-template-columns:repeat(auto-fit"] {
        grid-template-columns: 1fr !important;
    }

    /* Cas spécial : section sans .section autour (header / footer-tight) */
    .section-tight [style*="grid-template-columns: 1fr 1fr"],
    .section-tight [style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }
}
