/* =========================================================================
   SkyRaccoon — Modern theme (1/3) : tokens, layout, header, sidebars
   ========================================================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg:          #f6f7f9;
    --surface:     #ffffff;
    --surface-2:   #fafbfc;
    --surface-3:   #f1f3f5;
    --border:      #e5e7eb;
    --border-strong:#d1d5db;

    --text:        #0f172a;
    --text-2:      #334155;
    --muted:       #64748b;
    --muted-2:     #94a3b8;

    --dark:        #0f172a;
    --dark-2:      #1e293b;
    --dark-text:   #e2e8f0;
    --dark-muted:  #94a3b8;

    --accent:      #4f46e5;
    --accent-h:    #4338ca;
    --accent-soft: #eef2ff;
    --accent-ring: rgba(79,70,229,.25);

    --success:     #10b981;
    --warning:     #f59e0b;
    --danger:      #ef4444;

    --shadow-sm: 0 1px 2px rgba(15,23,42,.04);
    --shadow:    0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
    --shadow-md: 0 4px 6px -1px rgba(15,23,42,.08), 0 2px 4px -2px rgba(15,23,42,.05);
    --shadow-lg: 0 10px 15px -3px rgba(15,23,42,.08), 0 4px 6px -4px rgba(15,23,42,.05);
    --radius:    8px;
    --radius-sm: 6px;
    --radius-lg: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-h); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.01em; color: var(--text); }

/* ---------- Header ---------- */
.site-header {
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    position: sticky; top: 0; z-index: 50;
    background: rgba(255,255,255,.85);
    backdrop-filter: saturate(180%) blur(8px);
}
.header-inner {
    display: flex; align-items: center; gap: 32px;
    max-width: 1600px; margin: 0 auto;
    height: 60px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
    width: 44px; height: 44px; display: block;
    border-radius: 8px; object-fit: contain;
    flex: 0 0 auto;
}
/* Logo mis en avant dans la sidebar gauche, au-dessus du compteur de modèles. */
.sidebar-mark {
    display: block; margin: 0 auto 10px;
    width: 128px; height: 128px; max-width: 100%;
    object-fit: contain;
}
/* Bouton "Buy me a coffee" sous le bloc Thank you. */
.bmac-link {
    display: block; margin: 12px auto 0; width: fit-content;
    transition: transform .15s;
}
.bmac-link:hover { transform: translateY(-1px); }
.bmac-link img {
    display: block; max-width: 180px; height: auto;
}
.brand-logo {
    display: inline-flex; align-items: center;
    font-weight: 800; font-size: 18px; letter-spacing: -0.02em;
}
.brand-sky { color: var(--text); }
.brand-rac { color: var(--accent); }

.main-nav { display: flex; gap: 4px; flex: 1; font-size: 14px; }
.main-nav a {
    color: var(--text-2); padding: 8px 12px; border-radius: var(--radius-sm);
    font-weight: 500; transition: background .15s, color .15s;
}
.main-nav a:hover { background: var(--surface-3); color: var(--text); }
.header-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- Mega-menu "Aircraft" (hover 2 colonnes : catégories / sous-types) ---------- */
.nav-mega { position: relative; }
.nav-mega-trigger {
    display: inline-block;
    color: var(--text-2); padding: 8px 12px; border-radius: var(--radius-sm);
    font-weight: 500;
}
.nav-mega-trigger:hover,
.nav-mega:hover .nav-mega-trigger,
.nav-mega:focus-within .nav-mega-trigger {
    background: var(--surface-3); color: var(--text);
}
.nav-mega-panel {
    position: absolute; top: 100%; left: 0;
    display: none;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(0,0,0,.12);
    padding: 8px; gap: 0;
    min-width: 440px;
    z-index: 100;
}
/* Petit "pont" invisible pour éviter que le menu se ferme en traversant le gap */
.nav-mega-panel::before {
    content: ''; position: absolute; left: 0; right: 0; top: -8px; height: 8px;
}
.nav-mega:hover .nav-mega-panel,
.nav-mega:focus-within .nav-mega-panel { display: grid; grid-template-columns: 1fr 1fr; }

.nav-mega-col {
    list-style: none; margin: 0; padding: 4px;
    font-size: 13.5px;
}
.nav-mega-col li a {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    padding: 7px 10px; border-radius: var(--radius-sm);
    color: var(--text-2); font-weight: 500;
    white-space: nowrap;
}
.nav-mega-col li a:hover { background: var(--surface-3); color: var(--text); }

.nav-mega-cats { border-right: 1px solid var(--border); }
.nav-mega-cat.is-active > a {
    background: var(--surface-3); color: var(--text);
}
.nav-mega-arrow { color: var(--muted); font-size: 11px; }

.nav-mega-types { display: none; grid-column: 2; grid-row: 1; }
.nav-mega-types.is-active { display: block; }
.nav-mega-all {
    font-weight: 700 !important; color: var(--text) !important;
    border-bottom: 1px solid var(--border); border-radius: 0 !important;
    margin-bottom: 4px;
}
.nav-mega-empty {
    padding: 7px 10px; color: var(--muted); font-size: 12.5px; font-style: italic;
}

/* Mega-menu "Directory" : 2 colonnes autonomes (Manufacturers / Shops),
   chacune avec un en-tête cliquable et une liste scrollable. */
.nav-mega-panel--dir {
    min-width: 520px;
    padding: 12px;
}
.nav-mega:hover .nav-mega-panel--dir,
.nav-mega:focus-within .nav-mega-panel--dir {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.nav-mega-dir-col { min-width: 0; }
.nav-mega-dir-head {
    margin: 0 0 8px; padding: 4px 6px 8px;
    font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--muted); border-bottom: 1px solid var(--border);
}
.nav-mega-dir-head a {
    color: var(--text); text-decoration: none;
}
.nav-mega-dir-head a:hover { color: var(--accent); }
.nav-mega-dir-list {
    list-style: none; margin: 0; padding: 0;
    max-height: 60vh; overflow-y: auto;
    font-size: 13.5px;
}
.nav-mega-dir-list li a {
    display: block; padding: 6px 10px; border-radius: var(--radius-sm);
    color: var(--text-2); font-weight: 500; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.nav-mega-dir-list li a:hover { background: var(--surface-3); color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 8px 14px; border-radius: var(--radius-sm);
    font-weight: 600; font-size: 13px;
    border: 1px solid transparent; cursor: pointer;
    text-align: center; transition: all .15s; line-height: 1;
}
.btn:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; }
.btn-outline {
    border-color: var(--border-strong); color: var(--text-2); background: var(--surface);
}
.btn-outline:hover { background: var(--surface-3); color: var(--text); }
.btn-lime, .btn-primary {
    background: var(--accent); color: #ffffff; border-color: var(--accent);
}
.btn-lime:hover, .btn-primary:hover {
    background: var(--accent-h); border-color: var(--accent-h); color: #ffffff;
}
.btn-pink { background: var(--text); color: #ffffff; }
.btn-pink:hover { background: var(--dark-2); color: #ffffff; }
.btn-block { display: flex; width: 100%; margin-top: 10px; }


/* ---------- 3-col layout ---------- */
.page-wrap { padding: 20px 24px; }
.layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) 280px;
    gap: 20px;
    max-width: 1600px; margin: 0 auto;
    align-items: start;
}
@media (max-width: 1200px) {
    .layout { grid-template-columns: 220px minmax(0, 1fr); }
    .col-right { display: none; }
}
@media (max-width: 820px) {
    .page-wrap { padding: 16px; }
    .layout { grid-template-columns: 1fr; gap: 16px; }
    .col-left { order: 2; }

    /* Header : wrap la nav sous le logo plutot que tronquer a droite. */
    .site-header { padding: 0 12px; }
    .header-inner {
        flex-wrap: wrap;
        height: auto;
        gap: 8px 16px;
        padding: 8px 0;
    }
    .main-nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 2px;
        font-size: 13.5px;
    }
    .main-nav a,
    .nav-mega-trigger { padding: 6px 10px; }
    /* Les mega-panels en largeur fixe debordent sur petit ecran. */
    .nav-mega-panel,
    .nav-mega-panel--dir {
        min-width: 0;
        width: calc(100vw - 24px);
        left: 50%;
        transform: translateX(-50%);
    }
}



/* ---------- Panels (sidebars) ---------- */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px; margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}
.panel-dashed {
    background: linear-gradient(180deg, var(--accent-soft) 0%, var(--surface) 100%);
    border: 1px solid var(--border);
    padding: 20px 16px;
}

/* ---------- Left sidebar ---------- */
.lang-select {
    display: flex; gap: 6px; justify-content: center;
    margin-bottom: 14px; font-size: 16px;
}
.big-count {
    text-align: center; font-size: 28px; font-weight: 800;
    margin: 4px 0 2px; color: var(--text); letter-spacing: -0.02em;
}
.small-count {
    text-align: center; font-size: 11px; color: var(--muted);
    margin: 0 0 18px; text-transform: uppercase; letter-spacing: 0.6px;
}
.side-title {
    color: var(--text); font-size: 11px; font-weight: 700;
    letter-spacing: 0.6px; margin: 16px 0 10px;
    text-transform: uppercase;
}
.side-text { font-size: 13px; color: var(--text-2); margin: 0 0 10px; line-height: 1.55; }

.randomizer-list { list-style: none; margin: 0; padding: 0; }
.rand-card {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    background: var(--surface); border: 1px solid var(--border);
    padding: 10px; margin-bottom: 8px; color: var(--text);
    border-radius: var(--radius-sm); min-height: 64px;
    transition: border-color .15s, box-shadow .15s;
}
.rand-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.rand-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rand-brand { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.rand-name {
    font-weight: 600; font-size: 13.5px; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rand-more { font-size: 11px; color: var(--muted-2); margin-top: 2px; }
.rand-thumb {
    width: 52px; height: 52px; border-radius: var(--radius-sm);
    background: var(--surface-3); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: var(--muted-2);
}

/* ---------- Right sidebar ---------- */
.ads-panel .ad-placeholder {
    background: var(--surface-3); border: 1px dashed var(--border-strong);
    color: var(--muted); padding: 24px 12px; margin-bottom: 12px;
    text-align: center; min-height: 140px;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    border-radius: var(--radius-sm);
}
.ad-placeholder .ad-label {
    font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px;
    color: var(--muted-2); margin-bottom: 10px; font-weight: 600;
}
.ad-placeholder p { margin: 0; font-size: 13px; color: var(--text-2); }
.note h4 {
    color: var(--text); font-size: 11px; margin: 20px 0 6px;
    letter-spacing: 0.6px; text-transform: uppercase; font-weight: 700;
}
.note p { font-size: 12.5px; color: var(--text-2); margin: 0; line-height: 1.55; }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 20px 24px; margin-top: 40px; text-align: center;
    font-size: 12.5px; color: var(--muted);
}
