/* =============================================================
   GEARS OF NATIONAL ECONOMIC POWER — Stylesheet
   File: css/style.css

   Table of Contents
   -----------------
   1. Reset & Base
   2. Hero Image & Video Overlay
   3. Gear Link Overlays
   4. Intro Text Block
   5. Section Layout
   6. Section Accent Colors (borders + headings)
   7. Section Body (image + list)
   8. Authority Table
   9. Mobile (≤ 768px)
   ============================================================= */

/* ─────────────────────────────────────────────────────────────
   1. Reset & Base
   ───────────────────────────────────────────────────────────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: "Lato", sans-serif;
    background: #f5f5f5;
}

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ─────────────────────────────────────────────────────────────
   2. Hero Image & Video Overlay
   The hero contains the gear graphic and an intro video that
   plays once on load, then fades out to reveal the static image.
   ───────────────────────────────────────────────────────────── */
.hero {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    /* Keeps the hero flush with viewport bottom on short pages */
    margin-bottom: 0;
    padding-top: 75px;
}

/* The static gear image underneath the video */
.hero > img:not(.hero-bottom-img) {
    display: none;
}

/* Video overlay sits on top of the image and is removed after playback */
#gearOverlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: calc(100%); /* leaves room for the caption below */
    pointer-events: none; /* clicks pass through to gear links */
    z-index: 10;
}

#gearVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* FDD logo link — invisible clickable area over the logo */
.cefp-link {
    position: absolute;
    left: 1.5%;
    bottom: 1%;
    width: 15%;
    height: 8%;
    background: transparent;
}

/* ─────────────────────────────────────────────────────────────
   3. Gear Link Overlays
   Circular transparent hotspots positioned over each gear in
   the image. Positions are expressed as % of image width/height
   so they scale correctly at any viewport size.
   ───────────────────────────────────────────────────────────── */
.gear-link {
    position: absolute;
    border-radius: 50%;
    cursor: pointer;
    background: transparent;
    transition: background 0.2s;
    text-decoration: none;
    aspect-ratio: 1;
    height: auto;
}

.gear-link:hover {
    background: rgba(255, 255, 255, 0.15);
    outline: 3px solid rgba(255, 255, 255, 0.6);
}

/* Individual gear positions — tweak left/top/width to realign */
#gear-trade {
    left: 5.3%;
    top: 25.1%;
    width: 15.2%;
}
#gear-sanctions {
    left: 20.2%;
    top: 50.6%;
    width: 14.4%;
}
#gear-export {
    left: 31.8%;
    top: 22%;
    width: 14.4%;
}
#gear-resilience {
    left: 46.2%;
    top: 45.4%;
    width: 13.99%;
}
#gear-transparency {
    left: 57.3%;
    top: 16.6%;
    width: 14%;
}
#gear-investment {
    left: 69.2%;
    top: 44.9%;
    width: 13.7%;
}
#gear-positive {
    left: 78.9%;
    top: 9.57%;
    width: 17.2%;
}

/* ─────────────────────────────────────────────────────────────
   Page Title
   ───────────────────────────────────────────────────────────── */
.page-title {
    text-align: center;
    padding: 48px 24px 28px;
    max-width: 600px;
    margin: 0 auto;
}

.page-title h1 {
    font-family: "urw-din", sans-serif;
    font-weight: 900;
    font-size: 3rem;
    line-height: 1.02;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    color: #00558c;
    margin: 0;
}

@media (max-width: 768px) {
    .page-title h1 {
        font-size: 2.52rem;
    }
}

/* ─────────────────────────────────────────────────────────────
   Fixed right-side section index
   ───────────────────────────────────────────────────────────── */
.page-index {
    position: fixed;
    top: 50%;
    right: 28px;
    transform: translateY(-50%);
    width: 230px;
    z-index: 50;
    font-family: "Lato", sans-serif;
    background: #fff;
    border: 1px solid #e3e7ec;
    border-radius: 3px;
    padding: 18px 18px 14px;
    box-shadow: 0 14px 32px -22px rgba(0, 34, 56, 0.22);
}

@media (max-width: 1280px) {
    .page-index {
        display: none;
    }
}

.page-index-label {
    font-family: "urw-din", sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    /* letter-spacing: 0.2em; */
    color: #6c7480;
    margin: 0 0 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #ebeef2;
}

.page-index-list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: pidx;
}

.page-index-list li {
    counter-increment: pidx;
}

.page-index-list a {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 6px 0;
    text-decoration: none;
    color: #4a525c;
    font-size: 0.82rem;
    line-height: 1.3;
    font-weight: 600;
    transition:
        color 0.2s ease,
        transform 0.2s ease;
}

.page-index-list a::before {
    content: counter(pidx, decimal-leading-zero);
    flex-shrink: 0;
    font-weight: 700;
    font-size: 0.74rem;
    color: #b0b6bd;
    /* letter-spacing: 0.04em; */
    transition: color 0.2s ease;
}

.page-index-list a:hover {
    color: #14181d;
}

.page-index-list a:hover::before {
    color: #00558c;
}

.page-index-list a.active {
    color: #14181d;
    transform: translateX(2px);
}

.page-index-list a.active::before {
    color: #00558c;
}

/* ─────────────────────────────────────────────────────────────
   Gear Category Legend
   ───────────────────────────────────────────────────────────── */
.gear-legend {
    display: none;
}

.gear-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: "Lato", sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: capitalize;
    letter-spacing: 0;
    color: #444;
}

.gear-legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────────
   Gear Boxes — editorial policy-brief tab cards
   ───────────────────────────────────────────────────────────── */
.gear-boxes {
    max-width: 940px;
    margin: 36px auto 0;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    counter-reset: gearbox;
}

.gear-box {
    counter-increment: gearbox;
    position: relative;
    display: block;
    margin-bottom: 18px;
    padding: 30px 36px 22px;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border: 1px solid #e3e7ec;
    border-radius: 3px;
    overflow: hidden;
    isolation: isolate;
    transition:
        transform 0.35s cubic-bezier(0.22, 0.8, 0.28, 1),
        box-shadow 0.35s ease,
        border-color 0.3s ease,
        border-radius 0.2s ease;
    scroll-margin-top: 90px;
}

/* Thin accent rule across the top — replaces the heavy left border */
.gear-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent, #00558c);
    z-index: 2;
    transition: height 0.3s ease;
}

/* Faint oversized numeral watermark in the top-right */
.gear-box::after {
    content: counter(gearbox, decimal-leading-zero);
    position: absolute;
    top: 8px;
    right: 26px;
    font-family: "urw-din-condensed", "urw-din", sans-serif;
    font-weight: 700;
    font-size: 6.5rem;
    line-height: 0.85;
    color: var(--accent, #00558c);
    opacity: 0.07;
    pointer-events: none;
    letter-spacing: -0.04em;
    z-index: 0;
    transition:
        opacity 0.35s ease,
        transform 0.45s cubic-bezier(0.22, 0.8, 0.28, 1);
}

.gear-box:hover {
    transform: translateY(-2px);
    border-color: #d4dae2;
    box-shadow: 0 18px 36px -22px rgba(0, 34, 56, 0.32);
}

.gear-box:hover::after {
    opacity: 0.13;
    transform: translateX(-4px);
}

/* Seamless join: card followed by an open section drops bottom edges
   so the two surfaces share one continuous border on the sides. */
.gear-box:has(+ .section.active) {
    margin-bottom: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: none;
    box-shadow: none;
    transform: none;
}

.gear-box:has(+ .section.active)::before {
    height: 4px;
}

.gear-box:has(+ .section.active)::after {
    opacity: 0.16;
}

/* Top metadata row: index + category, both auto-numbered via counter */
.gear-box-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
    position: relative;
    z-index: 1;
    font-family: "Lato", sans-serif;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0;
    text-transform: capitalize;
    line-height: 1;
}

.gear-box-meta::before {
    content: counter(gearbox, decimal-leading-zero);
    color: var(--accent, #00558c);
}

.gear-box-cat {
    position: relative;
    color: #6c7480;
    padding-left: 14px;
}

.gear-box-cat::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 1px;
    height: 11px;
    background: #cfd5dc;
    transform: translateY(-50%);
}

/* Compact gear mark in the top-right corner — replaces full-bleed panel */
.gear-box-img {
    position: absolute;
    top: 24px;
    right: 28px;
    width: 78px;
    height: 78px;
    object-fit: contain;
    background: transparent;
    padding: 0;
    z-index: 1;
    filter: drop-shadow(0 4px 10px rgba(0, 34, 56, 0.1));
}

.gear-box-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    z-index: 1;
}

.gear-box-title {
    font-family: "urw-din", sans-serif;
    font-weight: 900;
    font-size: 1.85rem;
    text-transform: uppercase;
    letter-spacing: -0.6px;
    color: #4a5568;
    margin: 0;
    line-height: 1;
    max-width: calc(100% - 100px);
}

.gear-box-text {
    font-size: 0.95rem;
    line-height: 1.65;
    color: #4a525c;
    margin: 0;
    max-width: 64ch;
}

/* Footer rule + CTA: text + chevron disclosure icon, right-aligned */
.gear-box-cta {
    margin-top: 22px;
    padding-top: 16px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    font-family: "Lato", sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1;
    text-transform: none;
    color: var(--accent, #00558c);
    border-top: 1px solid #ebeef2;
    position: relative;
    z-index: 1;
    transition: border-color 0.3s ease;
}

.gear-box-cta::before {
    content: "Explore instruments";
}

/* Chevron pointing down — drawn from two CSS borders */
.gear-box-cta::after {
    content: "";
    width: 9px;
    height: 9px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.35s cubic-bezier(0.22, 0.8, 0.28, 1);
}

.gear-box:hover .gear-box-cta {
    border-top-color: color-mix(in srgb, var(--accent) 35%, #ebeef2);
}

.gear-box:hover .gear-box-cta::after {
    transform: translateY(0) rotate(45deg);
}

.gear-box:has(+ .section.active) .gear-box-cta::before {
    content: "Hide instruments";
}

/* Chevron flips to point up when section is open */
.gear-box:has(+ .section.active) .gear-box-cta::after {
    transform: translateY(2px) rotate(-135deg);
}

.gear-box[data-section="trade"] {
    --accent: #4990c4;
}
.gear-box[data-section="sanctions"] {
    --accent: #fa706d;
}
.gear-box[data-section="export"] {
    --accent: #fa706d;
}
.gear-box[data-section="resilience"] {
    --accent: #4990c4;
}
.gear-box[data-section="transparency"] {
    --accent: #8163a2;
}
.gear-box[data-section="investment"] {
    --accent: #fa706d;
}
.gear-box[data-section="positive"] {
    --accent: #5aa08a;
}

@media (max-width: 640px) {
    .gear-box {
        padding: 24px 25px 18px;
    }
    .gear-box::after {
        font-size: 4.75rem;
        top: 6px;
        right: 16px;
    }
    .gear-box-img {
        width: 56px;
        height: 56px;
        top: 18px;
        right: 18px;
    }
    .gear-box-meta {
        margin-bottom: 16px;
    }
    .gear-box-title {
        font-size: 1.35rem;
        max-width: calc(100% - 76px);
    }
    .gear-box-text {
        font-size: 0.92rem;
    }
    .gear-box-cta {
        margin-top: 18px;
        padding-top: 14px;
        font-size: 0.68rem;
    }
}

/* ─────────────────────────────────────────────────────────────
   4. Intro Text Block
   Full-width intro paragraph beneath the hero image.
   ───────────────────────────────────────────────────────────── */
.intro {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    padding: 10px 24px 0;
}

.intro h2 {
    font-size: 0.625rem;
    font-weight: 900;
    text-transform: uppercase;
    /* letter-spacing: 1.5px; */
    color: #00558c;
    margin-bottom: 8px;
}

.intro p {
    color: #555;
    line-height: 1.6;
    font-size: 1.25rem;
    margin-bottom: 0;
    text-align: left;
}

/* ─────────────────────────────────────────────────────────────
   5. Section Layout
   Each gear section has a top border, a heading, a side-by-side
   image+list body, and a full-width authority table below.
   ───────────────────────────────────────────────────────────── */
.sections {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px 24px 32px;
}

.section {
    padding: 48px 0 32px;
    scroll-margin-top: 90px;
}

.section h2 {
    font-size: 1.05rem;
    font-weight: 800;
    text-transform: uppercase;
    /* letter-spacing: 1.2px; */
    margin-bottom: 12px;
}

/* Heading links scroll back to top — inherit color, underline on hover */
.section h2 a {
    text-decoration: none;
    color: inherit;
}
.section h2 a:hover {
    text-decoration: underline;
}

/* Side-by-side layout: thumbnail image left, bullet list right */
.section-body {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    margin-top: 16px;
}

.section-body img {
    width: 420px;
    flex-shrink: 0; /* image never squishes below 420px */
}

.section p {
    color: #222;
    line-height: 1.65;
    font-size: 0.95rem;
}
.section ul {
    color: #222;
    line-height: 1.8;
    font-size: 0.95rem;
    padding-left: 20px;
}

.section-intro {
    color: #444;
    line-height: 1.65;
    font-size: 0.95rem;
    max-width: 100%;
    margin-bottom: 16px;
    border-left: 3px solid currentColor;
    padding-left: 14px;
}

.section-body-text {
    color: #444;
    line-height: 1.65;
    font-size: 0.95rem;
    max-width: 100%;
    margin-bottom: 12px;
}

/* ─────────────────────────────────────────────────────────────
   6. Section Accent Colors
   Each section has a unique color for its top border and heading.
   To change a section's color, update both rules together.
   ───────────────────────────────────────────────────────────── */
#trade {
    --accent: #4990c4;
    --accent-soft: rgba(73, 144, 196, 0.08);
}
#sanctions {
    --accent: #fa706d;
    --accent-soft: rgba(250, 112, 109, 0.08);
}
#export {
    --accent: #fa706d;
    --accent-soft: rgba(250, 112, 109, 0.08);
}
#resilience {
    --accent: #4990c4;
    --accent-soft: rgba(73, 144, 196, 0.08);
}
#transparency {
    --accent: #8163a2;
    --accent-soft: rgba(129, 99, 162, 0.08);
}
#investment {
    --accent: #fa706d;
    --accent-soft: rgba(250, 112, 109, 0.08);
}
#positive {
    --accent: #5aa08a;
    --accent-soft: rgba(90, 160, 138, 0.08);
}

#trade h2 {
    color: #4990c4;
}
#sanctions h2 {
    color: #fa706d;
}
#export h2 {
    color: #fa706d;
}
#resilience h2 {
    color: #4990c4;
}
#transparency h2 {
    color: #8163a2;
}
#investment h2 {
    color: #fa706d;
}
#positive h2 {
    color: #5aa08a;
}

/* ─────────────────────────────────────────────────────────────
   7. Authority Table
   Appears below the bullet list in every section.
   Dark header row, alternating light body rows, hover highlight.
   ───────────────────────────────────────────────────────────── */
.authority-table-wrap {
    display: block;
    width: 100%;
    margin-top: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.authority-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.authority-table caption {
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    /* letter-spacing: 1px; */
    color: #222;
    padding-bottom: 8px;
}

.authority-table th {
    background: var(--accent, #00558c);
    color: #fff;
    padding: 10px 16px;
    text-align: center;
    font-family: "urw-din-condensed", "urw-din", sans-serif;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    /* letter-spacing: 0.04em; */
    line-height: 1.05;
}

.authority-table td {
    padding: 10px 16px;
    vertical-align: middle;
    color: #111;
    border-bottom: 1px solid #ddd;
}

.authority-table tr:nth-child(even) td {
    background: #f0f4f8;
}
.authority-table tr:nth-child(odd) td {
    background: #fff;
}
.authority-table tr:hover td {
    background: #e6edf5;
}

@media (max-width: 900px) {
    .authority-table {
        min-width: 640px;
    }
}

/* "Legal Authorities" label above the table */
.authority-table caption {
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    /* letter-spacing: 1px; */
    color: #222;
    padding-bottom: 8px;
}

.authority-table th {
    background: var(--accent, #00558c);
    color: #fff;
    padding: 10px 16px;
    text-align: center;
    font-family: "urw-din-condensed", "urw-din", sans-serif;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    /* letter-spacing: 0.04em; */
    line-height: 1.05;
}

.authority-table td {
    padding: 10px 16px;
    vertical-align: middle;
    color: #111;
    border-bottom: 1px solid #ddd;
}

/* Alternating row shading */
.authority-table tr:nth-child(even) td {
    background: #f0f4f8;
}
.authority-table tr:nth-child(odd) td {
    background: #fff;
}

/* Subtle hover highlight */
.authority-table tr:hover td {
    background: #e6edf5;
}

/* ─────────────────────────────────────────────────────────────
   8. Mobile (≤ 768px)
   - Stack image above text list in each section
   - Scale down headings
   - Allow authority table to scroll horizontally
   ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .intro {
        padding: 32px 28px 0;
    }

    /* Stack image on top, list below */
    .section-body {
        flex-direction: column;
    }

    /* Smaller headings on narrow screens */
    .section h2 {
        font-size: 0.95rem;
    }
    .intro h2 {
        font-size: 0.65rem;
    }

    .section-header {
        flex-direction: column-reverse;
    }

    .section-header img {
        width: 90% !important;
        max-width: 90% !important;
    }

    .authority-table {
        font-size: 0.7rem;
    }

    .authority-table th,
    .authority-table td {
        padding: 6px 8px;
    }

    .section-body-text,
    .section-intro,
    .section p,
    .section ul {
        font-size: 0.72rem;
    }

    .gear-boxes {
        padding: 0 28px;
    }
}

/* ─────────────────────────────────────────────────────────────
   8. COLLAPSIBLE Authority Tables
   ───────────────────────────────────────────────────────────── */
.toggle-authority {
    margin: 36px 0 0;
    background: none;
    border: none;
    border-bottom: 1px solid currentColor;
    cursor: default;
    pointer-events: none;
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
    /* letter-spacing: 2px; */
    color: var(--accent, #444);
    padding: 0 0 10px 0;
    display: block;
    width: fit-content;
}

/* ─────────────────────────────────────────────────────────────
   9. COLLAPSIBLE Section Body
   ───────────────────────────────────────────────────────────── */
.toggle-section-body {
    margin-top: 24px;
    background: none;
    border: none;
    cursor: default;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    /* letter-spacing: 1.2px; */
    color: #444;
    padding: 0;
    pointer-events: none;
}

.toggle-section-body::after {
    display: none;
}

.toggle-section-body::after {
    content: "▼";
    font-size: 0.75rem;
    transition: transform 0.25s;
}

.toggle-section-body.open::after {
    transform: rotate(-180deg);
}

.section-body {
    display: none;
    margin-top: 32px;
}

.section-body.visible {
    display: flex;
}

/* ── Instruments of Power — Circle Button System ── */
.instruments-panel {
    display: none;
    margin-top: 0;
}

.circles-col {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 14px;
}

/* ── Grouped Institutions Layout ── */
.inst-groups {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.inst-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.inst-group {
    transition: opacity 0.4s ease;
}

.inst-subheading {
    font-family: "Lato", sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    /* letter-spacing: 1.5px; */
    color: #999;
    margin: 0;
    text-align: center;
}

.inst-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    align-items: center;
}

.inst-btn {
    border-radius: 50%;
    border: none;
    cursor: default;
    width: 88px;
    height: 88px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px;
    font-family: "Lato", sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.3;
    color: #fff;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
    overflow: hidden;
    white-space: normal;
}

.inst-btn:hover,
.inst-btn.active {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 8px 18px -6px rgba(0, 34, 56, 0.35);
}

/* Floating tooltip for instrument hover (interactive — sources are clickable) */
.inst-tooltip {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    max-width: 360px;
    min-width: 220px;
    padding: 12px 16px 11px;
    background: #fff;
    border-radius: 6px;
    border-left: 3px solid var(--tt-accent, #00558c);
    box-shadow: 0 12px 28px -10px rgba(0, 34, 56, 0.28);
    pointer-events: auto;
    opacity: 0;
    transform: translateY(4px);
    transition:
        opacity 0.14s ease,
        transform 0.14s ease;
    visibility: hidden;
}

.inst-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.inst-tooltip h3 {
    font-family: "urw-din", sans-serif;
    font-weight: 800;
    font-size: 0.78rem;
    text-transform: uppercase;
    /* letter-spacing: 0.5px; */
    color: var(--tt-accent, #00558c);
    margin: 0 0 7px;
    line-height: 1.2;
}

.inst-tooltip ul {
    margin: 0;
    padding-left: 16px;
    font-size: 0.8rem;
    line-height: 1.45;
    color: #444;
    list-style: disc outside;
}

.inst-tooltip ul li {
    margin-bottom: 5px;
}

.inst-tooltip ul li::marker {
    color: var(--tt-accent, #00558c);
}

.inst-tooltip ul li:last-child {
    margin-bottom: 0;
}

/* Source links (clickable — open in a new tab) */
.inst-tooltip-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid rgba(0, 34, 56, 0.08);
}

.inst-tooltip-sources:empty {
    display: none;
}

.inst-tooltip-sources a {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px 5px;
    font-family: "Lato", sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    /* letter-spacing: 1px; */
    color: var(--tt-accent, #00558c);
    background: #fff;
    border: 1px solid currentColor;
    border-radius: 3px;
    text-decoration: none;
    transition:
        background 0.18s ease,
        color 0.18s ease;
}

.inst-tooltip-sources a:hover {
    background: var(--tt-accent, #00558c);
    color: #fff;
}

.inst-detail {
    opacity: 0;
    pointer-events: none;
    min-width: 0;
}

.inst-detail.visible {
    opacity: 1;
    pointer-events: auto;
}

.inst-detail h3 {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    /* letter-spacing: 1px; */
    margin: 0 0 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 34, 56, 0.08);
}

.inst-detail ul {
    color: #222;
    line-height: 1.65;
    font-size: 0.85rem;
    padding-left: 16px;
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
}

.inst-back {
    background: #fff;
    border: 1px solid #d4dde6;
    cursor: pointer;
    font-family: "Lato", sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    color: #555;
    display: none;
    align-items: center;
    gap: 6px;
    padding: 7px 14px 7px 12px;
    margin-top: 18px;
    margin-bottom: 0;
    /* letter-spacing: 1.2px; */
    text-transform: uppercase;
    border-radius: 3px;
    transition:
        background 0.18s ease,
        color 0.18s ease,
        border-color 0.18s ease;
}
.inst-back:hover {
    background: #00558c;
    color: #fff;
    border-color: #00558c;
}
.inst-back::before {
    content: "←";
    font-size: 0.95rem;
    margin-right: 0;
}

.instruments-panel.has-active .inst-back {
    display: flex;
}

/* Section colors */
#trade .inst-btn {
    background: #4990c4;
}
#sanctions .inst-btn {
    background: #fa706d;
}
#export .inst-btn {
    background: #fa706d;
}
#resilience .inst-btn {
    background: #4990c4;
}
#transparency .inst-btn {
    background: #8163a2;
}
#investment .inst-btn {
    background: #fa706d;
}
#positive .inst-btn {
    background: #5aa08a;
}

.inst-detail h3 {
    color: var(--accent, #111);
}

/* Official source link in detail panel */
.inst-source-link {
    display: inline-flex;
    align-items: center;
    padding: 6px 11px 7px;
    margin-top: 0;
    font-family: "Lato", sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    color: #00558c;
    background: #fff;
    border: 1px solid #d4dde6;
    border-radius: 3px;
    text-decoration: none;
    /* letter-spacing: 1.2px; */
    text-transform: uppercase;
    transition:
        background 0.18s ease,
        color 0.18s ease,
        border-color 0.18s ease;
}
.inst-source-link:hover {
    background: #00558c;
    color: #fff;
    border-color: #00558c;
}

/* Authority table links */
.authority-table td a {
    color: #1a5276;
    text-decoration: none;
    border-bottom: 1px dotted #aac4d8;
}
.authority-table td a:hover {
    color: #00558c;
    border-bottom-color: #00558c;
}

/* ── Active section layout ── */
.section.active .toggle-section-body {
    display: none;
}

.section.active .instruments-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 32px;
    align-items: center;
}

.section.active .instruments-panel .circles-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
}

.section.active .instruments-panel::before {
    content: "Instruments of Power";
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
    /* letter-spacing: 2px; */
    white-space: nowrap;
    align-self: center;
    padding-bottom: 10px;
    margin-bottom: 8px;
    border-bottom: 1px solid currentColor;
    grid-column: 1;
    grid-row: 1;
}

#trade.active .instruments-panel::before {
    color: #4990c4;
}
#sanctions.active .instruments-panel::before {
    color: #fa706d;
}
#export.active .instruments-panel::before {
    color: #fa706d;
}
#resilience.active .instruments-panel::before {
    color: #4990c4;
}
#transparency.active .instruments-panel::before {
    color: #8163a2;
}
#investment.active .instruments-panel::before {
    color: #fa706d;
}
#positive.active .instruments-panel::before {
    color: #5aa08a;
}

/* default (closed): circles fill full width evenly */
.section.active .circles-col {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
    width: 100%;
    justify-content: space-evenly;
    align-items: center;
}

.section.active .instruments-panel.has-active .circles-col {
    width: auto;
    flex-wrap: wrap;
}

.section.active .inst-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    align-items: center;
}

.section.active .instruments-panel.has-active .inst-groups {
    width: auto;
}

.section.active .instruments-panel.has-active .inst-row {
    justify-content: center;
}

.section.active .inst-groups {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.section.active .instruments-panel.has-active {
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.section.active .instruments-panel.has-active::before {
    width: auto;
    white-space: nowrap;
    flex-shrink: 0;
}

.section.active .instruments-panel.has-active .inst-detail {
    width: 100%;
    flex-basis: 100%;
}

.section.active .inst-detail {
    display: none;
}

.section.active .inst-detail.visible {
    display: block;
    opacity: 1;
    margin-top: 28px;
    padding: 22px 26px 24px;
    background: var(--accent-soft, #f6f8fa);
    border-left: 3px solid var(--accent, #00558c);
    border-radius: 0 6px 6px 0;
    width: 100%;
    animation: inst-detail-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes inst-detail-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .section.active .instruments-panel {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        row-gap: 16px;
    }

    .section.active .instruments-panel::before {
        font-size: 1.1rem;
        grid-column: 1;
        grid-row: 1;
        white-space: normal;
    }

    .section.active .circles-col {
        grid-column: 1;
        grid-row: 2;
        gap: 12px;
    }

    .section.active .inst-groups {
        gap: 16px;
    }

    .section.active .inst-row {
        gap: 10px;
    }

    .inst-subheading {
        font-size: 0.7rem;
    }

    .section.active .inst-back {
        grid-column: 1;
        grid-row: 3;
        height: auto;
    }

    .section.active .inst-detail {
        grid-column: 1;
        grid-row: 4;
    }

    .inst-btn {
        width: 60px;
        height: 60px;
        font-size: 0.6rem;
    }

    .inst-btn.active {
        width: 110px;
        height: 44px;
        font-size: 0.68rem;
        border-radius: 22px;
    }

    .inst-btn.shrunk {
        width: 34px;
        height: 34px;
    }
}

/* ─────────────────────────────────────────────────────────────
   10. HIDE Section Bodies
   ───────────────────────────────────────────────────────────── */
.sections {
    display: none;
}

.section {
    display: none;
}

.section.active {
    display: block;
    border-radius: 0 0 3px 3px;
    padding: 28px 36px 36px;
    border: 1px solid #e3e7ec;
    border-top: none;
    box-shadow: 0 18px 36px -24px rgba(0, 34, 56, 0.24);
    margin: 0 0 18px;
    background: #fff;
}

.section.active .toggle-section-body {
    display: none;
}

/* Match label color to each section heading */
#trade.active .instruments-panel::before {
    color: #4990c4;
}
#sanctions.active .instruments-panel::before {
    color: #fa706d;
}
#export.active .instruments-panel::before {
    color: #fa706d;
}
#resilience.active .instruments-panel::before {
    color: #4990c4;
}
#transparency.active .instruments-panel::before {
    color: #8163a2;
}
#investment.active .instruments-panel::before {
    color: #fa706d;
}
#positive.active .instruments-panel::before {
    color: #5aa08a;
}

/* Per-section accents now flow from the card-above top stripe and
   each section's --accent variable; the surrounding section border
   stays neutral hairline so the colored top edge has more punch. */

.sections.active {
    display: block;
}

#back-btn {
    display: inline-flex;
    align-items: center;
    position: sticky;
    top: 90px;
    z-index: 5;
    margin: 0 0 20px;
    padding: 12px 22px;
    background: #00558c;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: "Lato", sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    /* letter-spacing: 1.2px; */
    box-shadow: 0 6px 16px -4px rgba(0, 34, 56, 0.35);
    transition:
        background 0.18s ease,
        transform 0.18s ease;
}

#back-btn:hover {
    background: #003e66;
    transform: translateY(-1px);
}

/* 11. Section Header with Image ── */
.section-header {
    display: flex;
    align-items: center;
    gap: 32px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #eef1f5;
    flex-wrap: nowrap;
    overflow: hidden;
}

.section-header-text {
    flex: 1;
}

.section-header img {
    width: 45%;
    flex-shrink: 1;
    max-width: 45%;
}

/* ============================================================
   ZOOM TRANSITION
   When a gear is clicked, the hero scales up slightly and
   fades out before the page scrolls to the target section.
   Sections animate in (fade + slide up) when they enter the
   viewport via IntersectionObserver.
   ============================================================ */

/* Hero zoom-out state — added by JS on gear click */
.hero.zooming {
    transform: scale(1.07);
    filter: blur(2px);
    opacity: 0;
    pointer-events: none; /* prevent double-clicks mid-animation */
}

/* The hero transition itself — smooth 0.55s ease */
.hero {
    /* ADD to your existing .hero rule — don't replace it */
    transition:
        transform 0.55s ease,
        filter 0.55s ease,
        opacity 0.55s ease;
    transform-origin: center center;
}

.hero-inner {
    position: relative;
    max-width: 980px;
    margin: 0 auto;
}

.hero-inner > img {
    width: 100%;
    max-width: 100%;
    display: block;
}

.hero-bottom-img {
    display: block;
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
}

/* ── Hero restore on scroll back up ─────────────────────── */

.inst-source-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(0, 34, 56, 0.08);
}

.multi-link-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.multi-link-toggle {
    background: #00558c;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    font-weight: 700;
    font-style: italic;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    margin-left: 4px;
    flex-shrink: 0;
    transition:
        background 0.18s ease,
        transform 0.18s ease;
}
.multi-link-toggle:hover {
    background: #003e66;
    transform: scale(1.08);
}

.multi-link-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: #fff;
    border: 1px solid #d4dde6;
    border-radius: 4px;
    box-shadow:
        0 8px 24px -4px rgba(0, 34, 56, 0.16),
        0 1px 3px rgba(0, 34, 56, 0.04);
    padding: 6px;
    z-index: 100;
    min-width: 220px;
    flex-direction: column;
    gap: 0;
}

.multi-link-dropdown.open {
    display: flex;
    animation: dropdown-in 0.18s ease;
}

@keyframes dropdown-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.multi-link-dropdown a {
    font-size: 0.75rem;
    font-weight: 600;
    color: #1a5276;
    text-decoration: none;
    white-space: nowrap;
    padding: 7px 10px;
    border-radius: 3px;
    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.multi-link-dropdown a:hover {
    background: #f0f4f8;
    color: #00558c;
}
/* When user scrolls back near the top, hero un-zooms.
   JS adds/removes .zooming; the transition above handles it. */

.see-more {
    width: 100%;
    padding: 48px 24px;
    text-align: center;
}

.see-more-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    max-width: 760px;
    padding: 22px 36px;
    background: #00558c;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.see-more-btn:hover {
    background: #003e6b;
    transform: translateY(-1px);
}

.see-more-label {
    font-family: "Oswald", sans-serif;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.85;
}

.see-more-title {
    font-family: "Lato", sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    line-height: 1.35;
}

@media (max-width: 600px) {
    .see-more-btn {
        padding: 18px 22px;
    }
    .see-more-title {
        font-size: 0.95rem;
    }
}

.page-credits {
    width: 100%;
    padding: 32px 24px 40px;
    text-align: center;
}

.page-credits-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.page-credits-line {
    margin: 0;
    font-family: "Lato", sans-serif;
    font-size: 0.85rem;
    color: #4a5568;
    /* letter-spacing: 0.02em; */
}

.page-credits-role {
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 700;
    /* letter-spacing: 0.14em; */
    color: #00558c;
    margin-right: 6px;
}

.page-credits-name {
    font-weight: 600;
    color: #1a202c;
}

.page-credits-sep {
    color: #94a3b8;
    margin: 0 2px;
}
