/* ==========================================================================
   "Heads of NSOs" — main page (grid of cards) and biography page.
   ========================================================================== */

/* --- Toolbar: search, group filter, sort (ref. 1.6 to 1.9) ------------- */

.nso-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
    padding: 18px 20px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.nso-toolbar .field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nso-toolbar .field-search {
    flex: 1 1 320px;
}

.nso-toolbar label {
    color: var(--ink-3);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.nso-toolbar input,
.nso-toolbar select {
    height: 44px;
    padding: 0 13px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    font-family: inherit;
    font-size: 15px;
}

.nso-toolbar select {
    min-width: 210px;
}

.nso-toolbar input:hover,
.nso-toolbar select:hover {
    border-color: #b6ccd5;
}

.nso-toolbar input:focus,
.nso-toolbar select:focus {
    border-color: var(--brand);
    outline: none;
    box-shadow: 0 0 0 3px rgba(18, 200, 244, .25);
}

.btn-apply {
    height: 44px;
}

/* --- Result counter and empty state (ref. 1.10, 1.11) ------------------ */

.nso-count {
    margin: 22px 0 26px;
    color: var(--ink-3);
    font-size: 14px;
}

    .nso-count strong {
        color: var(--ink);
    }

.nso-empty {
    max-width: 60ch;
    margin: 40px 0;
    padding: 22px 24px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-left: 4px solid var(--brand-mid);
    border-radius: var(--radius);
    color: var(--ink-2);
}

/* --- Region blocks (ref. 1.12 to 1.14) -------------------------------- */

.nso-block {
    margin-bottom: 52px;
}

.nso-block-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 22px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--brand);
    font-size: 21px;
}

    .nso-block-heading span {
        color: var(--ink-3);
        font-size: 14px;
        font-weight: 400;
    }

/* --- Cards (ref. 1.15 to 1.23) ---------------------------------------- */

.nso-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
    gap: 22px;
}

.nso-card {
    position: relative;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

    .nso-card:hover,
    .nso-card:focus-within {
        border-color: #b6ccd5;
        box-shadow: var(--shadow);
        transform: translateY(-2px);
    }

.nso-card-link {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.nso-card-photo {
    position: relative;
    aspect-ratio: 4 / 5;
    background: var(--brand-tint);
    overflow: hidden;
}

    .nso-card-photo img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

/* Ref. 1.21 — badge shown only on the cards of Bureau members. It overlays the card
   link, so it needs its own stacking level. */
.nso-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    padding: 5px 10px;
    background: var(--accent);
    border-radius: 5px;
    color: var(--brand-deep);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
    text-decoration: none;
}

    .nso-badge:hover {
        background: var(--brand-mid);
        color: var(--brand-deep);
    }

/* Ref. 1.22 — hover text. */
.nso-card-hover {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 24px 14px 11px;
    background: linear-gradient(180deg, rgba(5, 68, 84, 0) 0%, rgba(5, 68, 84, .9) 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    transition: opacity .16s ease;
}

.nso-card:hover .nso-card-hover,
.nso-card:focus-within .nso-card-hover {
    opacity: 1;
}

.nso-card-body {
    padding: 16px 17px 19px;
}

.nso-card-country {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    color: var(--brand);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.nso-flag {
    width: 24px;
    height: 16px;
    flex-shrink: 0;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 2px;
}

.nso-card-name {
    margin: 0 0 5px;
    font-size: 17px;
    font-weight: 700;
}

.nso-card-position {
    margin: 0 0 6px;
    color: var(--brand-dark);
    font-size: 14px;
    font-weight: 600;
}

.nso-card-office {
    margin: 0;
    color: var(--ink-2);
    font-size: 13.5px;
    line-height: 1.45;
}

.nso-card-since {
    margin: 10px 0 0;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    color: var(--ink-3);
    font-size: 12.5px;
}

/* Ref. 3.2 — biography not yet received. */
.nso-card-pending {
    margin: 0;
    color: var(--ink-3);
    font-size: 13.5px;
    font-style: italic;
    line-height: 1.5;
}

.nso-card-sep {
    margin: 0 5px;
    opacity: .6;
}

/* --- Notes below the grid (ref. 1.24 to 1.26) ------------------------- */

.nso-notes {
    margin-top: 18px;
    padding-top: 30px;
    border-top: 1px solid var(--line);
}

.nso-source,
.nso-correction {
    max-width: 80ch;
    color: var(--ink-3);
    font-size: 14px;
}

.nso-related {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 18px;
    margin-top: 22px;
}

    .nso-related h2 {
        margin: 0;
        font-size: 14px;
        font-weight: 700;
    }

    .nso-related ul {
        display: flex;
        flex-wrap: wrap;
        gap: 8px 18px;
        margin: 0;
        padding: 0;
        list-style: none;
        font-size: 14px;
    }

/* ==========================================================================
   Biography page
   ========================================================================== */

.bio-header {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 36px;
    padding: 30px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.bio-photo {
    margin: 0;
}

    .bio-photo img {
        display: block;
        width: 100%;
        aspect-ratio: 4 / 5;
        object-fit: cover;
        border-radius: 8px;
        background: var(--brand-tint);
    }

    .bio-photo figcaption {
        margin-top: 9px;
        color: var(--ink-3);
        font-size: 12px;
    }

.bio-identity h1 {
    margin: 0 0 6px;
    font-size: clamp(26px, 3vw, 34px);
}

.bio-native-name {
    margin: 0 0 10px;
    color: var(--ink-3);
    font-size: 16px;
}

.bio-position {
    margin: 0 0 14px;
    color: var(--brand-dark);
    font-size: 18px;
    font-weight: 600;
}

.bio-country {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    color: var(--ink-2);
    font-size: 14.5px;
}

.bio-since,
.bio-bureau {
    display: inline-block;
    margin: 0 8px 0 0;
    padding: 6px 12px;
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink-2);
    font-size: 13px;
}

.bio-bureau {
    background: rgba(18, 200, 244, .13);
    border-color: rgba(13, 167, 207, .45);
    color: var(--brand-dark);
    font-weight: 600;
}

.bio-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 40px;
    margin-top: 40px;
}

.bio-section {
    margin-bottom: 34px;
}

    .bio-section h2 {
        margin-bottom: 14px;
        padding-bottom: 9px;
        border-bottom: 1px solid var(--line);
        color: var(--brand-dark);
        font-size: 19px;
    }

    .bio-section p {
        max-width: 78ch;
        color: var(--ink-2);
        line-height: 1.75;
    }

.bio-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

    .bio-list li {
        position: relative;
        padding: 9px 0 9px 20px;
        border-bottom: 1px solid var(--line);
        color: var(--ink-2);
    }

        .bio-list li::before {
            position: absolute;
            top: 16px;
            left: 2px;
            width: 6px;
            height: 6px;
            background: var(--brand);
            border-radius: 50%;
            content: "";
            opacity: .55;
        }

        .bio-list li:last-child {
            border-bottom: 0;
        }

/* Pointer back to the authoritative page on oicstatcom.org. */
.source-line {
    margin-top: -6px;
    font-size: 13.5px;
}

.bio-list + .source-line {
    margin-top: 14px;
}

    .source-line a::after {
        margin-left: 5px;
        content: "↗";
        opacity: .7;
    }

.bio-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

    .bio-tags li {
        padding: 6px 13px;
        background: var(--brand-tint);
        border-radius: 999px;
        color: var(--brand-dark);
        font-size: 13px;
    }

.bio-card {
    margin-bottom: 20px;
    padding: 22px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

    .bio-card h2 {
        margin-bottom: 16px;
        font-size: 16px;
    }

    .bio-card p {
        color: var(--ink-2);
        font-size: 14.5px;
    }

    .bio-card dl {
        margin: 0;
    }

    .bio-card dt {
        margin-top: 14px;
        color: var(--ink-3);
        font-size: 11.5px;
        font-weight: 700;
        letter-spacing: .05em;
        text-transform: uppercase;
    }

        .bio-card dt:first-child {
            margin-top: 0;
        }

    .bio-card dd {
        margin: 3px 0 0;
        font-size: 14.5px;
        overflow-wrap: anywhere;
    }

.bio-card-note {
    margin: 18px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    color: var(--ink-3);
    font-size: 13px;
}

.bio-footer {
    margin-top: 34px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    color: var(--ink-3);
    font-size: 13.5px;
}

.bio-updated {
    margin-bottom: 6px;
}

/* Ref. 3.3 — the biography has not been received yet. */
.bio-pending {
    max-width: 66ch;
    padding: 40px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

    .bio-pending h1 {
        margin-bottom: 16px;
        font-size: clamp(24px, 2.6vw, 30px);
    }

    .bio-pending p {
        color: var(--ink-2);
    }

/* Ref. 2.18 — previous / index / next, within the same OIC group. */
.bio-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    font-size: 14.5px;
}

.bio-nav-next {
    text-align: right;
}

.bio-nav-index a {
    padding: 9px 16px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 999px;
    text-decoration: none;
}

    .bio-nav-index a:hover {
        border-color: var(--brand);
    }

/* --- Narrow screens --------------------------------------------------- */

@media (max-width: 900px) {
    .bio-header {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .bio-photo {
        max-width: 220px;
    }

    .bio-layout {
        grid-template-columns: 1fr;
        gap: 28px;
    }
}

@media (max-width: 640px) {
    .nso-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 14px;
    }

    .nso-toolbar select {
        min-width: 0;
        width: 100%;
    }

    .nso-toolbar .field {
        flex: 1 1 100%;
    }

    .bio-nav {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .bio-nav-next {
        text-align: center;
    }
}
.nso-card-photo {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: #f2f4f6;
}

    .nso-card-photo img {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: cover;
        object-position: center top;
    }
.bio-photo {
    width: 280px;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    margin: 0;
    background: #f2f4f6;
}

    .bio-photo img {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: cover;
        object-position: center top;
    }
.page-head-main h1 {
    max-width: none;
    width: 100%;
    font-size: clamp(28px, 3.2vw, 40px);
}

    .page-head-main > div {
        flex: 1 1 auto;
        min-width: 0;
    }

    .page-head-main .page-intro {
        width: 100%;
        max-width: none;
    }

    .page-head-main .page-updated {
        flex: 0 0 auto;
        margin: 0;
        white-space: nowrap;
    }
.preview-access-page {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.preview-access-card {
    width: 100%;
    max-width: 520px;
    padding: 40px;
    background: #fff;
    border: 1px solid #e4e7eb;
    border-radius: 14px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.08);
}

.preview-access-heading h1 {
    margin: 0 0 14px;
    font-size: 28px;
}

.preview-access-heading p {
    margin: 0 0 28px;
    line-height: 1.6;
    color: #5b6470;
}

.preview-field {
    margin-bottom: 20px;
}

    .preview-field label {
        display: block;
        margin-bottom: 8px;
        font-weight: 600;
    }

    .preview-field input {
        width: 100%;
        padding: 12px 14px;
        border: 1px solid #cfd5dc;
        border-radius: 7px;
        font-size: 16px;
    }

        .preview-field input:focus {
            outline: none;
            border-color: #16705a;
            box-shadow: 0 0 0 3px rgba(22, 112, 90, 0.12);
        }

.preview-button {
    width: 100%;
    padding: 12px 18px;
    border: 0;
    border-radius: 7px;
    background: #16705a;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.preview-validation {
    margin-bottom: 16px;
    color: #b42318;
}

.preview-note {
    margin: 22px 0 0;
    text-align: center;
    font-size: 13px;
    color: #7b8490;
}