:root {
    --bg:           #0d1117;
    --surface:      #161b22;
    --surface-2:    #21262d;
    --border:       #30363d;
    --text:         #e6edf3;
    --text-muted:   #8b949e;
    --red:          #f44336;
    --red-dim:      rgba(244, 67, 54, 0.15);
    --blue:         #2196f3;
    --blue-dim:     rgba(33, 150, 243, 0.15);
    --green:        #4caf50;
    --green-dim:    rgba(76, 175, 80, 0.15);
    --max-width:    72rem;
    --radius:       8px;
    --font:         system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
    font-size: 100%;
    scroll-padding-top: 5rem;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

:focus { outline: 0; }
:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 3px;
    border-radius: 3px;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -5rem;
    left: 1rem;
    z-index: 200;
    padding: .75rem 1.25rem;
    background: var(--blue);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    border-radius: var(--radius);
    transition: top .2s ease;
}
.skip-link:focus { top: .75rem; }

/* Typography */
h1, h2, h3, h4 {
    margin: 0 0 .75rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text);
}
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
h2 { font-size: clamp(1.25rem, 3vw, 1.65rem); margin-top: 2rem; }
h3 { font-size: 1.15rem; margin-top: 1.5rem; color: var(--text); }
h4 { font-size: 1rem; }
p  { margin: 0 0 1rem; }

a {
    color: var(--blue);
    text-decoration: underline;
    text-underline-offset: 3px;
}
a:hover { color: #64b5f6; }

/* Wrapper */
.wrapper {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ─── Header ─────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    /* IPC tri-color accent */
    box-shadow: 0 3px 0 0 transparent;
}
.site-header::after {
    content: "";
    display: block;
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, var(--red) 0%, var(--red) 33%, var(--blue) 33%, var(--blue) 66%, var(--green) 66%, var(--green) 100%);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: 4rem;
    padding-top: .75rem;
    padding-bottom: .75rem;
}

.logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}
.logo img {
    display: block;
    height: 2.75rem;
    width: auto;
}

/* Hamburger */
.nav-toggle {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}
.nav-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 2.5rem; height: 2.5rem;
    padding: .5rem;
    background: transparent;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color .15s ease;
}
.nav-burger:hover { border-color: var(--green); }
.nav-burger__line {
    display: block;
    width: 100%; height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle:checked ~ .nav-burger .nav-burger__line:first-child { transform: translateY(7px) rotate(45deg); }
.nav-toggle:checked ~ .nav-burger .nav-burger__line:nth-child(2) { opacity: 0; }
.nav-toggle:checked ~ .nav-burger .nav-burger__line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Nav */
.nav {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    list-style: none;
    margin: 0; padding: 0;
}
.nav a {
    display: inline-block;
    padding: .4rem .75rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: .95rem;
    border-radius: var(--radius);
    transition: color .15s ease, background .15s ease;
}
.nav a:hover,
.nav a[aria-current="page"] {
    color: var(--text);
    background: var(--surface-2);
}
.nav a[aria-current="page"] {
    color: var(--green);
}

@media (max-width: 48em) {
    .nav-burger { display: flex; order: 2; }
    .site-header__inner { position: relative; }
    .nav-wrap {
        position: absolute;
        top: calc(100% + 4px);
        left: 0; right: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        background: var(--surface);
        border-top: 1px solid var(--border);
        border-bottom: 3px solid var(--blue);
        transition: max-height .3s ease, opacity .2s ease;
        order: 3;
        width: 100%;
        z-index: 40;
    }
    .nav-toggle:checked ~ .nav-wrap {
        max-height: 80vh;
        opacity: 1;
        overflow-y: auto;
    }
    .nav { flex-direction: column; gap: 0; padding: .5rem 0; }
    .nav a {
        display: block;
        padding: .75rem 1.25rem;
        border-radius: 0;
        border-bottom: 1px solid var(--border);
    }
    .nav li:last-child a { border-bottom: none; }
}
@media (min-width: 48.01em) {
    .nav-burger { display: none !important; }
}

/* ─── Main ───────────────────────────────────────────── */
main {
    padding: 2.5rem 0 3rem;
    min-height: 50vh;
}

/* ─── Hero ───────────────────────────────────────────── */
.hero {
    margin-bottom: 2.5rem;
}
.hero__figure {
    margin: 0;
    line-height: 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}
.hero__figure img {
    width: 100%;
    height: auto;
    max-height: 55vh;
    min-height: 20rem;
    object-fit: cover;
    display: block;
}

/* ─── Page content ───────────────────────────────────── */
.page-content {
    max-width: 52rem;
}

.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 3px solid var(--green);
}
.page-header h1 {
    margin: 0;
}

/* Entry (rich text content) */
.entry ul {
    margin: 0 0 1rem 1.25rem;
    padding: 0;
    list-style: disc;
}
.entry ol {
    margin: 0 0 1rem 1.25rem;
    padding: 0;
    list-style: decimal;
}
.entry li { margin-bottom: .4rem; }
.entry li ul { margin-top: .35rem; margin-bottom: .35rem; }
.entry hr {
    margin: 2rem 0;
    border: 0;
    border-top: 2px solid var(--border);
}
.entry strong { font-weight: 700; }
.entry h2 { color: var(--text); }
.entry h3 { color: var(--text); }
.entry h4 { color: var(--text); }
.entry em { color: var(--text-muted); }
.entry img { max-width: 100%; height: auto; border-radius: var(--radius); }
.entry small { color: var(--text-muted); font-size: .875rem; }

/* ─── Buttons ────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .6rem 1.2rem;
    border-radius: var(--radius);
    border: none;
    font-weight: 600;
    font-size: .95rem;
    text-decoration: none;
    cursor: pointer;
    transition: transform 80ms ease, filter .15s ease;
    margin: .25rem .25rem .25rem 0;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.1); }
.btn:active { transform: translateY(0); filter: brightness(.95); }
.btn:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

.btn--red   { background: var(--red);   color: #fff; }
.btn--blue  { background: var(--blue);  color: #fff; }
.btn--green { background: var(--green); color: #fff; }
.btn--ghost {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn--ghost:hover { border-color: var(--text-muted); }

/* Legacy btn classes from old Publii content */
.btn--ipc-red   { background: var(--red);   color: #fff; }
.btn--ipc-blue  { background: var(--blue);  color: #fff; }
.btn--ipc-green { background: var(--green); color: #fff; }

/* ─── Info card / highlight box ──────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}
.card--red   { border-left: 4px solid var(--red);   }
.card--blue  { border-left: 4px solid var(--blue);  }
.card--green { border-left: 4px solid var(--green); }

/* ─── Footer ─────────────────────────────────────────── */
.site-footer {
    margin-top: 3rem;
    padding: 1.75rem 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: .875rem;
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--green); }

/* ─── Eye-Able Consent Button ────────────────────────── */
.ea-consent-btn {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 100;
    padding: .65rem 1rem;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-left: 4px solid var(--blue);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .4);
    transition: border-color .15s ease, transform .15s ease;
}
.ea-consent-btn:hover { border-color: var(--blue); transform: translateY(-1px); }
.ea-consent-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* ─── Utilities ──────────────────────────────────────── */
.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
