/* ============================================================================
   IOI Noticeboard — Stylesheet
   Aesthetic: institutional, technical, motorsport-adjacent.
   Black-on-white with sharp red accents. Barlow Condensed display + IBM Plex Sans body.
   ============================================================================ */

/* ---------- Theme tokens ---------- */
:root {
    --c-bg:           #ffffff;
    --c-bg-soft:      #f6f7f8;
    --c-text:         #111213;
    --c-text-mute:    #5e6066;
    --c-line:         #e4e6ea;
    --c-line-strong:  #c5c8cf;
    --c-ink:          #0a0a0b;        /* near-black for the header bar */
    --c-accent:       #c8102e;        /* Indianapolis red */
    --c-accent-soft:  #fdecef;
    --c-active-text:  #ffffff;

    --f-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    --f-body:    'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

    --r-sm:  4px;
    --r-md:  6px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
    --shadow-md: 0 4px 18px rgba(0,0,0,.07);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--c-bg);
    color: var(--c-text);
    font-family: var(--f-body);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: var(--c-text); text-decoration: none; }
a:hover { color: var(--c-accent); }

ul { list-style: none; padding: 0; margin: 0; }

/* ---------- Header ---------- */
.site-header {
    background: var(--c-ink);
    color: #fff;
    border-bottom: 3px solid var(--c-accent);
}
.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 18px 28px;
    display: flex;
    align-items: center;
    gap: 28px;
}
.brand { display: inline-flex; align-items: center; }
.brand-logo {
    /* Logo height drives legibility of the FIA "Advisor" line, which is fine
       print in the artwork. Rule of thumb: advisor text on screen is roughly
       (height / 14) pixels tall. 140px -> ~10px, comfortably readable.
       Dial this ONE number to taste:
         110px = middle ground (advisor ~8px, shorter header)
         140px = readable advisor line (current)
         160px = crisp advisor line, tallest header */
    height: 140px;
    width: auto;
    display: block;
}
.brand-label {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 30px;
    letter-spacing: 0.18em;
    color: #fff;
    margin: 0 0 0 auto;
    border-left: 1px solid rgba(255,255,255,.18);
    padding-left: 28px;
}

/* ---------- Layout shell ---------- */
.content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px;
}

/* ---------- Filter strip ---------- */
.filter-strip {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 22px 24px;
    background: var(--c-bg-soft);
    border: 1px solid var(--c-line);
    border-radius: var(--r-md);
}

.filter-row {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 14px;
    align-items: baseline;
}
.filter-row-label {
    font-family: var(--f-display);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 13px;
    color: var(--c-text-mute);
    padding-top: 4px;
}
.filter-row-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid var(--c-line-strong);
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--r-sm);
    transition: all .12s ease;
}
.chip:hover {
    border-color: var(--c-ink);
    color: var(--c-ink);
}
.chip.is-active {
    background: var(--c-ink);
    border-color: var(--c-ink);
    color: var(--c-active-text);
}
.chip.is-active:hover {
    background: var(--c-accent);
    border-color: var(--c-accent);
    color: #fff;
}

/* ---------- Selection summary ---------- */
.summary {
    margin: 28px 0 18px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--c-ink);
}
.summary-series {
    font-family: var(--f-display);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 14px;
    color: var(--c-accent);
    font-weight: 700;
}
.summary-event {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 38px;
    line-height: 1.1;
    margin: 6px 0 4px;
    letter-spacing: -0.005em;
}
.summary-season {
    font-family: var(--f-body);
    font-weight: 500;
    font-size: 14px;
    color: var(--c-text-mute);
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

/* ---------- Board (doc list + viewer) ---------- */
.board {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 24px;
    align-items: start;
}

/* ---------- Document list ---------- */
.doc-list {
    background: #fff;
    border: 1px solid var(--c-line);
    border-radius: var(--r-md);
    padding: 8px 0;
    max-height: 75vh;
    overflow-y: auto;
}

.doc-category + .doc-category {
    border-top: 1px solid var(--c-line);
    margin-top: 6px;
    padding-top: 6px;
}

.doc-category-title {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin: 8px 0 6px;
    padding: 0 18px;
    color: var(--c-ink);
}

.doc-items li { margin: 0; }
.doc-link {
    display: block;
    padding: 9px 18px;
    font-size: 14px;
    line-height: 1.35;
    border-left: 3px solid transparent;
    transition: background .1s ease, border-color .1s ease, color .1s ease;
}
.doc-link:hover {
    background: var(--c-bg-soft);
    border-left-color: var(--c-line-strong);
}
.doc-link.is-active {
    background: var(--c-accent-soft);
    border-left-color: var(--c-accent);
    color: var(--c-ink);
    font-weight: 500;
}

.empty-state {
    padding: 24px;
    color: var(--c-text-mute);
    font-style: italic;
    font-size: 14px;
}
.empty-state-small {
    padding: 6px 18px 14px;
    font-size: 13px;
    font-style: normal;
}

/* ---------- PDF viewer ---------- */
.doc-viewer {
    background: #fff;
    border: 1px solid var(--c-line);
    border-radius: var(--r-md);
    overflow: hidden;
    min-height: 70vh;
    display: flex;
    flex-direction: column;
}

.viewer-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--c-line);
    background: var(--c-bg-soft);
}
.viewer-title {
    font-weight: 600;
    font-size: 14px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.viewer-open {
    font-size: 13px;
    font-weight: 500;
    color: var(--c-accent);
    white-space: nowrap;
}
.viewer-open:hover { text-decoration: underline; }

.viewer-frame {
    flex: 1;
    border: 0;
    width: 100%;
    min-height: 70vh;
    background: var(--c-bg-soft);
}

.viewer-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 60px 20px;
    color: var(--c-text-mute);
    text-align: center;
}
.placeholder-rule {
    width: 72px;
    height: 3px;
    background: var(--c-accent);
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--c-ink);
    color: #fff;
    margin-top: 48px;
    border-top: 3px solid var(--c-accent);
}
.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 22px 28px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: rgba(255,255,255,.78);
}

/* ---------- Footer policy links ---------- */
.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}
.footer-links a {
    color: rgba(255,255,255,.78);
    text-decoration: none;
    letter-spacing: 0.02em;
}
.footer-links a:hover {
    color: #fff;
    text-decoration: underline;
}

/* ---------- Mobile / narrow viewports ---------- */
@media (max-width: 900px) {
    .header-inner { padding: 14px 18px; gap: 14px; }
    .brand-logo { height: 88px; }  /* phone header is tight; kept modest */
    .brand-label {
        font-size: 22px;
        padding-left: 14px;
        letter-spacing: 0.14em;
    }

    .content { padding: 18px; }

    .filter-strip { padding: 16px; }
    .filter-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .summary-event { font-size: 28px; }

    .board { grid-template-columns: 1fr; }
    .doc-list { max-height: none; }
    .viewer-frame { min-height: 65vh; }
}

/* ---------- Accessibility: skip link & keyboard focus ---------- */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 1000;
    background: var(--c-accent);
    color: #fff;
    padding: 10px 16px;
    font-weight: 600;
    text-decoration: none;
}
.skip-link:focus {
    left: 8px;
    top: 8px;
}
/* Visible, consistent focus ring for keyboard users (does not show on mouse click) */
a:focus-visible,
.chip:focus-visible,
.doc-link:focus-visible,
.viewer-open:focus-visible,
.brand:focus-visible,
.skip-link:focus-visible {
    outline: 3px solid var(--c-accent);
    outline-offset: 2px;
    border-radius: 2px;
}
