/* Data coverage: a full-bleed world map with a legend card and a detail card over it. */

.coverage-page {
    overflow: hidden;
    background: #0c0d0e;
}

.coverage-main {
    position: fixed;
    inset: 0;
}

/* The quality tiers of a layer, best first. The script reads these from the map's element. */
.coverage-page .world-map {
    --tier-1: #7ae8d9;
    --tier-2: #35a89b;
    --tier-3: #24766f;
    --tier-ground: #1c4a46;
    --tier-coming: #7ae8d9;
    --tier-waiting: #6f767c;
    /* The edges of the cells of a gridded source. */
    --coverage-lattice: #0c0d0e;
}

.coverage-panel,
.coverage-detail {
    position: absolute;
    z-index: 2;
    width: min(340px, calc(100vw - 32px));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: rgba(24, 26, 28, 0.88);
    color: #e6e6e6;
    backdrop-filter: blur(14px);
}

.coverage-panel {
    top: 96px;
    left: 28px;
    width: min(420px, calc(100vw - 32px));
    max-height: calc(100vh - 96px - 28px);
    padding: 22px 22px 18px;
    overflow-y: auto;
}

.coverage-title {
    margin: 0 0 6px;
    font-size: 1.375rem;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.coverage-lead {
    margin: 0 0 18px;
    color: rgba(230, 230, 230, 0.66);
    font-size: 0.875rem;
    line-height: 1.5;
}

.coverage-layers {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin: 0 0 18px;
    padding: 3px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
}

.coverage-layers button {
    flex: 1 1 auto;
    padding: 7px 5px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(230, 230, 230, 0.7);
    font: inherit;
    font-size: 0.8125rem;
    white-space: nowrap;
    cursor: pointer;
}

.coverage-layers button:hover {
    color: #ffffff;
}

.coverage-layers button[aria-selected="true"] {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

.coverage-layers button:focus-visible,
.coverage-detail button:focus-visible {
    outline: 2px solid #7ae8d9;
    outline-offset: 1px;
}

.coverage-legend {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.coverage-legend li {
    display: grid;
    grid-template-columns: 14px 1fr;
    column-gap: 11px;
    align-items: start;
}

.coverage-swatch {
    width: 14px;
    height: 14px;
    margin-top: 2px;
    border-radius: 4px;
    background: var(--swatch);
}

.coverage-swatch--base {
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.coverage-swatch--hatch {
    background: repeating-linear-gradient(135deg, var(--swatch) 0 2px, transparent 2px 5px);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.coverage-legend strong {
    display: block;
    font-size: 0.8438rem;
    font-weight: 500;
}

.coverage-legend span {
    display: block;
    margin-top: 2px;
    color: rgba(230, 230, 230, 0.6);
    font-size: 0.7813rem;
    line-height: 1.45;
}

/* What the import uses at the place that was clicked. */
.coverage-detail {
    top: 96px;
    right: 28px;
    max-height: calc(100vh - 96px - 120px);
    padding: 20px 22px;
    overflow-y: auto;
}

.coverage-detail header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.coverage-detail h2 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 500;
    letter-spacing: -0.015em;
}

/* jifto's own buildings in the country, beside its name. */
.coverage-count {
    margin-left: 10px;
    color: rgba(230, 230, 230, 0.6);
    font-size: 0.8125rem;
    font-weight: 400;
    letter-spacing: 0;
    white-space: nowrap;
}

.coverage-detail button {
    padding: 2px 6px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: rgba(230, 230, 230, 0.6);
    font: inherit;
    font-size: 1.125rem;
    line-height: 1;
    cursor: pointer;
}

.coverage-detail button:hover {
    color: #ffffff;
}

.coverage-detail .coverage-where {
    margin: 0 0 16px;
    color: rgba(230, 230, 230, 0.6);
    font-size: 0.7813rem;
}

.coverage-detail h3 {
    margin: 18px 0 8px;
    color: rgba(230, 230, 230, 0.56);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.coverage-source {
    display: grid;
    grid-template-columns: 14px 1fr;
    column-gap: 11px;
    padding: 10px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.coverage-source:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.coverage-source strong {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
}

.coverage-source p {
    margin: 3px 0 0;
    color: rgba(230, 230, 230, 0.78);
    font-size: 0.7813rem;
    line-height: 1.5;
}

.coverage-source em {
    display: block;
    margin-top: 5px;
    color: rgba(230, 230, 230, 0.56);
    font-size: 0.75rem;
    font-style: normal;
}

.coverage-status {
    position: absolute;
    left: 50%;
    bottom: 28px;
    z-index: 2;
    margin: 0;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(24, 26, 28, 0.88);
    color: rgba(230, 230, 230, 0.8);
    font-size: 0.8125rem;
    transform: translateX(-50%);
}

.coverage-status[hidden] {
    display: none;
}

@media (max-width: 760px) {
    .coverage-panel {
        top: 84px;
        left: 16px;
        padding: 16px 16px 14px;
    }

    .coverage-lead,
    .coverage-legend span {
        display: none;
    }

    .coverage-legend {
        gap: 8px;
    }

    .coverage-detail {
        top: auto;
        right: 16px;
        bottom: 16px;
        left: 16px;
        width: auto;
        max-height: 46vh;
    }
}
