/* MeginLeid AS — shared stylesheet */
:root {
    --black:   #000000;
    --gold:    #FFD700;
    --white:   #FFFFFF;
    --bg:      #18191c;
    --surface: #25272e;   /* dark-gray panel/card surface (was white) */
    --border:  #3a3d47;
    --text:    #e8eaf0;   /* light text on the dark surfaces */
    --muted:   #9aa0aa;
    --link:    #7db3ff;
    --link-h:  #a9ccff;
    --radius:  8px;
    --shadow:  0 2px 8px rgba(0,0,0,.35);

    /* ── Data-viz palette (2026-06 review §1) ──────────────────────────────────
       ONE source of truth for category/status colours, shared by the data-table
       badges (var(--…)) and the server-rendered Plotly charts (same hex in the
       Python figure builders). Blue stays reserved for links → excluded here. */
    --surface-2:     #1c1c20;            /* dropdowns/hover on data pages */
    --border-strong: rgba(255,255,255,.16);
    /* status as a progression: waiting → committed → live */
    --st-queue:      #94a3b8;            /* slate  */
    --st-reserved:   #2dd4bf;            /* teal   */
    --st-connected:  #4ade80;            /* green  */
    --warning:       #fbbf24;            /* genuine alerts only */
    --danger:        #f87171;
    /* categorical (sectors / tech / chart series) — colourblind-aware, no link-blue */
    --cat-1: #2dd4bf;  --cat-2: #a78bfa;  --cat-3: #4ade80;  --cat-4: #f472b6;
    --cat-5: #fb923c;  --cat-6: #38bdf8;  --cat-7: #a3e635;  --cat-8: #fb7185;
    --chart-grid: rgba(255,255,255,.08);
    --chart-axis: var(--muted);
}

/* Translucent-tint chip: each pill/badge sets --c; fill/border/text derive from it. */
.pill, .badge {
    --c: var(--gold);
    color: var(--c);
    background: color-mix(in srgb, var(--c) 15%, transparent);
    border: 1px solid color-mix(in srgb, var(--c) 38%, transparent);
}
.s-queue,.badge-queue,.c-queue       { --c: var(--st-queue); }
.s-reserved,.badge-reserved          { --c: var(--st-reserved); }
.s-connected,.badge-connected        { --c: var(--st-connected); }
.c1{--c:var(--cat-1);} .c2{--c:var(--cat-2);} .c3{--c:var(--cat-3);} .c4{--c:var(--cat-4);}
.c5{--c:var(--cat-5);} .c6{--c:var(--cat-6);} .c7{--c:var(--cat-7);} .c8{--c:var(--cat-8);}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: -apple-system, "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Data archetype: light text directly on the dark page (charts, prices, tables).
   Page width / page-header sizing stay inline per page (they vary). */
body.surface-dark { color: #e8eaf0; }

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-h); text-decoration: underline; }

/* ── Top navigation ─────────────────────────────────────── */
.site-nav {
    background: var(--black);
    color: var(--white);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: 52px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-nav .nav-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    text-decoration: none;
}
.site-nav .nav-logo img {
    height: 36px;
    width: auto;
}

.nav-links {
    display: flex;
    flex: 1;
    gap: 1.5rem;
    list-style: none;
}

.nav-links .nav-about { margin-left: auto; }

.nav-links a {
    color: rgba(255,255,255,.8);
    font-size: 0.9rem;
    text-decoration: none;
    padding-bottom: 2px;
}

.nav-links a:hover { color: var(--white); text-decoration: none; }

.nav-links a.active {
    color: var(--gold);
    border-bottom: 2px solid var(--gold);
}

/* ── Page wrapper ───────────────────────────────────────── */
.page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    flex: 1;
    width: 100%;
}

/* ── Logo header block ─────────────────────────────────── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 2rem;
    gap: 1rem;
}

.page-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #f0f2f8;
    margin-bottom: 0.25rem;
}

.page-header .subtitle {
    color: #9ca3af;
    font-size: 0.9rem;
}

.page-header .logo {
    flex-shrink: 0;
}
.page-header .logo svg {
    height: 80px;
    width: auto;
    display: block;
}

/* ── Hero (home page) ───────────────────────────────────── */
.hero {
    background: var(--black);
    color: var(--white);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.hero .hero-logo {
    height: 80px;
    width: auto;
    flex-shrink: 0;
}

.hero h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 0.4rem;
}

.hero .tagline {
    font-size: 1rem;
    color: rgba(255,255,255,.75);
    margin-bottom: 1.2rem;
}

.contact-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
}

.contact-list li {
    font-size: 0.9rem;
    color: rgba(255,255,255,.85);
}

.contact-list a { color: var(--gold); }
.contact-list a:hover { color: var(--white); }

/* ── Section lede — one-line positioning line above a card grid ─────────── */
.section-lede {
    max-width: 760px;
    margin: 0 0 1.75rem;
    color: #c8ccd6;
    font-size: 1.05rem;
    line-height: 1.6;
}

/* ── ERM figure — inline diagram that blends into the prose panel ───────── */
.erm-figure {
    display: block;
    width: 100%;
    height: auto;
    margin: 1.5rem auto 0.75rem;
}

/* ── Section cards ─────────────────────────────────────── */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: box-shadow .15s, border-color .15s;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
    border-color: var(--gold);
}

.card h2, .card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);          /* white by default — a plain (non-link) card */
}
/* Blue heading when the whole card is a redirect link (a.card); white when it isn't. */
a.card h2, a.card h3 { color: var(--link); }
a.card:hover h2, a.card:hover h3 { color: var(--link-h); }

.card p {
    font-size: 0.88rem;
    color: var(--muted);
    flex: 1;
}

.card .card-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--link);
}

.card .card-link:hover { color: var(--link-h); }

/* ── About / prose block ───────────────────────────────── */
.prose {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    max-width: 780px;
}

.about-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.prose h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.prose p { font-size: 0.95rem; color: #c8ccd6; margin-bottom: 0.6rem; }
.prose p:last-child { margin-bottom: 0; }

/* ── Table / data views ────────────────────────────────── */
/* Editorial table component (light archetype). The ENTIRE block is scoped to
   body:not(.surface-dark) so data pages (grid-queue/prices/legal), which link this stylesheet
   but style their own dark tables inline, inherit none of it — exactly as before they linked it. */
body:not(.surface-dark) .table-wrap {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

body:not(.surface-dark) table { border-collapse: collapse; width: 100%; font-size: 0.88em; }
body:not(.surface-dark) thead tr { background: var(--black); color: var(--white); }

body:not(.surface-dark) th {
    padding: 9px 12px;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
}

body:not(.surface-dark) th:hover { background: #222; }

body:not(.surface-dark) td {
    padding: 7px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

body:not(.surface-dark) tr:last-child td { border-bottom: none; }
body:not(.surface-dark) tr:nth-child(even) td { background: #2c2e36; }
body:not(.surface-dark) tr:hover td { background: #313440 !important; }

/* ── Badges ────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
    white-space: nowrap;
}

/* ── Controls bar ──────────────────────────────────────── */
.controls {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    box-shadow: var(--shadow);
    font-size: 0.88rem;
}

.controls label { font-weight: 600; color: var(--text); }

.controls select,
.controls input {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.88em;
    font-family: inherit;
}

.count-label { margin-left: auto; color: var(--muted); font-size: 0.84rem; }

/* ── Newsletter list ───────────────────────────────────── */
.news-list { list-style: none; }

.news-list li {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: baseline;
    gap: 1rem;
    box-shadow: var(--shadow);
    transition: border-color .15s;
}

.news-list li:hover { border-color: var(--gold); }

.news-list .news-date {
    font-size: 0.82rem;
    color: var(--muted);
    white-space: nowrap;
    min-width: 90px;
}

.news-list .news-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.news-list .news-tags {
    margin-left: auto;
    display: flex;
    gap: 0.4rem;
}

.tag {
    background: #e8edf8;
    color: #3a5099;
    padding: 1px 7px;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ── Newsletter article ────────────────────────────────── */
.newsletter {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 2.5rem;
    box-shadow: var(--shadow);
    max-width: 760px;
}

.newsletter-meta {
    border-bottom: 2px solid var(--gold);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.newsletter-meta h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.newsletter-meta .meta-line {
    font-size: 0.85rem;
    color: var(--muted);
}

.newsletter h2 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }
.newsletter h3 { font-size: 0.95rem; margin: 1.2rem 0 0.4rem; }
.newsletter p  { margin-bottom: 0.8rem; font-size: 0.95rem; color: #333; }
.newsletter ul, .newsletter ol { margin: 0.5rem 0 0.8rem 1.5rem; font-size: 0.95rem; }
.newsletter li { margin-bottom: 0.3rem; }

/* ── Site footer ───────────────────────────────────────── */
.site-footer {
    background: var(--black);
    color: rgba(255,255,255,.6);
    text-align: center;
    padding: 1.2rem 2rem;
    font-size: 0.8rem;
    margin-top: auto;
}

.site-footer a { color: var(--gold); }
.site-footer a:hover { color: var(--white); text-decoration: none; }
.site-footer .build-stamp {
    margin-top: 0.5rem;
    font-size: 0.7rem;
    color: rgba(255,255,255,.35);
    letter-spacing: 0.3px;
}

/* ── Featured map (front page) ──────────────────────────── */
.featured-map-link {
    display: block;
    text-decoration: none;
    margin-bottom: 2rem;
}

.featured-map {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16/7;
    background: #1a1c20;
    border: 1px solid #3a3d47;
    box-shadow: var(--shadow);
}

.featured-map img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.featured-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,.8) 0%, transparent 100%);
    color: #fff;
    padding: 1.5rem 1.25rem 0.9rem;
    font-size: 0.9rem;
}

.featured-caption strong {
    display: block;
    font-size: 1.05rem;
    margin-bottom: 0.2rem;
    color: var(--gold);
}

/* ── Partner logos grid ─────────────────────────────────── */
.sources-section {
    margin-top: 2.5rem;
}

.sources-section h2 {
    font-size: 1rem;
    font-weight: 700;
    color: #f0f2f8;
    margin-bottom: 1rem;
}

.sources-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
}

.sources-grid a {
    display: block;
    opacity: 0.75;
    transition: opacity .15s;
}

.sources-grid a:hover { opacity: 1; }

.sources-grid img {
    height: 40px;
    width: auto;
    filter: brightness(0) invert(1);
}

.source-label {
    display: inline-block;
    background: #25272e;
    border: 1px solid #3a3d47;
    border-radius: 4px;
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #e8eaf0;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 700px) {
    .card-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .site-nav { padding: 0 1rem; gap: 1rem; }
    .nav-links { gap: 0.9rem; }
    .page { padding: 1.25rem 1rem; }
    .hero { flex-direction: column; gap: 1rem; padding: 1.5rem 1.25rem; }
    .hero .hero-logo { height: 56px; }
    .hero h1 { font-size: 1.4rem; }
    .page-header { flex-direction: column; }
    .page-header .logo svg { height: 56px; }
    .site-nav .nav-logo img { height: 28px; }
    .newsletter { padding: 1.25rem 1rem; }
    .news-list li { flex-wrap: wrap; }
    .news-list .news-tags { margin-left: 0; }
}

@media (max-width: 480px) {
    .nav-links a { font-size: 0.78rem; }
    .site-nav { gap: 1rem; padding: 0 0.75rem; }
}
