@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Lora:wght@500;600;700&display=swap');

:root {
    --covered: #003399;
    --highlight: #ffcc00;
    --silent: #e5e7eb;
    --ink: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #ffffff;
    color: var(--ink);
}

body {
    min-height: 100vh;
    overflow-y: auto;
}

.canvas {
    width: 100%;
    max-width: 900px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: clamp(20px, 5vw, 56px) clamp(20px, 6vw, 64px);
    margin: 0 auto;
}

.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;
}

a:focus-visible {
    outline: 3px solid #003399;
    outline-offset: 3px;
}

.skip-link {
    position: absolute;
    z-index: 1000;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.65rem 0.85rem;
    transform: translateY(-150%);
    border-radius: 4px;
    background: #ffffff;
    color: var(--ink);
}

.skip-link:focus {
    transform: translateY(0);
}

.headline {
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(26px, 4.25vw, 46px);
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 6px;
}

.thumbnail-headline {
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(26px, 4.5vw, 38px);
    line-height: 1.2;
    min-height: 0;
}

.subhead {
    font-size: clamp(16px, 2vw, 22px);
    color: var(--muted);
    margin: 0 0 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.subhead-terms {
    font-size: clamp(12px, 1.5vw, 16px);
    color: var(--covered);
    margin: 0 0 8px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

#map {
    flex: 0 0 auto;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: #f9fafb;
}

.legend {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    align-items: center;
    margin-top: 24px;
    padding: 0;
    font-size: 20px;
    color: var(--muted);
}

.legend li {
    display: inline-flex;
    align-items: center;
}

.swatch {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    margin-right: 8px;
    vertical-align: -3px;
}

.swatch.covered {
    background: var(--covered);
}

.swatch.silent {
    background: #8a929f;
    border: 1px solid #6b7280;
}

.swatch.untracked {
    background: transparent;
    border: 2px solid #6b7280;
}

.sources {
    margin-top: 20px;
    font-size: 17px;
    color: var(--muted);
    line-height: 1.5;
}

.source-country {
    margin-bottom: 0;
}

.source-country + .source-country {
    margin-top: 2em;
}

.source-country-name {
    margin: 0 0 2px;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 600;
}

.source-outlets {
    list-style: none;
    margin: 0;
    padding: 0;
}

.source-outlets li {
    color: var(--ink);
}

.source-outlet-name {
    color: var(--muted);
}

.source-headline {
    color: var(--ink);
    text-decoration: none;
}

.source-headline:hover,
.source-headline:focus-visible {
    text-decoration: underline;
}

.map-error {
    margin: 0.75rem 0 0;
    color: var(--ink);
    font-size: 0.95rem;
}

.back-link {
    align-self: flex-start;
    min-height: 44px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 15px;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

@media (min-width: 701px) {
    .canvas {
        padding-top: 30px;
        padding-bottom: 30px;
    }
}

@media (max-width: 700px) {
    .canvas {
        padding: 8px 20px;
    }

    .back-link {
        margin-bottom: 8px;
    }

    .headline {
        font-size: 23px;
        margin-bottom: 8px;
    }

    .subhead {
        margin-bottom: 10px;
    }

    #map {
        width: min(100%, 330px);
        margin-inline: auto;
    }

    .legend {
        gap: 16px;
        row-gap: 8px;
        margin-top: 8px;
        font-size: 14px;
    }

    .swatch {
        width: 13px;
        height: 13px;
    }
}
