/* The nations page (page-nations.js) */

/* The bot's footer lines */
.nations-quip {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-style: italic;
}

.nations-result {
    margin: 0;
    color: var(--muted);
}

.nations-empire {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nations-pick {
    margin-bottom: 14px;
}

.nations-picker {
    font-size: 14px;
    color: var(--text);
    background: var(--field);
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 6px 10px;
    min-height: 34px;
    max-width: 100%;
}

/* The nation's banner, edged in its colour */
.nations-hero {
    display: grid;
    gap: 14px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-left: 6px solid var(--nation, var(--accent));
    border-radius: 12px;
    background: linear-gradient(90deg, color-mix(in srgb, var(--nation, var(--accent)) 16%, transparent), transparent 70%);
}

.nations-hero-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 18px;
}

.nations-flag {
    height: 64px;
    max-width: 120px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid var(--line);
}

.nations-hero-text {
    flex: 1 1 260px;
    min-width: 0;
}

.nations-name {
    margin: 0 0 6px;
    font-size: 24px;
    overflow-wrap: anywhere;
}

.nations-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
}

.nations-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.nations-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 6px 24px;
    margin-top: 10px;
}

.nations-details summary {
    cursor: pointer;
    color: var(--muted);
}

.nations-details[open] > summary {
    margin-bottom: 8px;
}

/* The profile's tabs */
.nations-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 18px 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.nations-tab {
    all: unset;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 7px;
    color: var(--muted);
    white-space: nowrap;
}

.nations-tab:hover {
    color: var(--text);
    background: var(--field-hover);
}

.nations-tab.active {
    color: var(--on-accent);
    background: var(--accent);
}

.nations-tab:focus-visible {
    outline: 2px solid var(--accent);
}

.nations-tab-body > * + * {
    margin-top: 14px;
}

.nations-two {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
    gap: 12px;
    align-items: start;
}

/* Overview: a card per tab, opening it */
.nations-overview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
    gap: 10px;
}

.nations-ov {
    all: unset;
    cursor: pointer;
    display: grid;
    gap: 3px;
    align-content: start;
    padding: 14px 16px;
    border-radius: 10px;
    background: var(--field);
    border: 1px solid var(--line);
}

.nations-ov:hover {
    border-color: var(--accent);
}

.nations-ov:focus-visible {
    outline: 2px solid var(--accent);
}

.nations-ov-go {
    margin-top: 6px;
    color: var(--accent);
    font-size: 12px;
}

/* Regions */
.nations-regions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: 12px;
    align-items: start;
}

.nations-region-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nations-shape {
    display: block;
    width: 100%;
    height: 180px;
    margin: 8px 0;
}

.nations-region-figures {
    display: flex;
    gap: 16px;
    margin-bottom: 6px;
}

.nations-links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
}

.nations-rarity {
    white-space: nowrap;
}

/* War & crates: the date range */
.nations-range {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px 16px;
}

.nations-custom input[type="date"] {
    font-size: 14px;
    color: var(--text);
    background: var(--field);
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 5px 8px;
    min-height: 34px;
    color-scheme: light dark;
}

/* Tech: the eras as one bar */
.nations-eras {
    display: flex;
    min-height: 54px;
    border: 2px solid var(--accent);
    border-radius: 8px;
    overflow: hidden;
}

.nations-era {
    position: relative;
    flex-basis: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 4px;
    font-size: 12px;
    color: var(--muted);
    background: var(--field);
}

.nations-era + .nations-era {
    border-left: 2px solid var(--panel-solid);
}

.nations-era.past {
    background: var(--accent);
    color: var(--on-accent);
}

.nations-era.current {
    background: color-mix(in srgb, var(--accent) 30%, var(--field));
    color: var(--text);
}

.nations-era-fill {
    position: absolute;
    inset: 0 auto 0 0;
    background: var(--accent);
    opacity: 0.6;
}

.nations-era > span,
.nations-era > b {
    position: relative;
}

.nations-techs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.nations-techchip {
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}

.nations-techchip.done {
    border-color: var(--accent);
    color: var(--text);
}

@media (max-width: 640px) {
    .nations-hero {
        padding: 12px;
    }

    .nations-name {
        font-size: 20px;
    }

    .nations-flag {
        height: 44px;
    }

    .nations-hero-actions,
    .nations-picker {
        width: 100%;
    }

    .nations-shape {
        height: 140px;
    }

    /* The eras stacked, one per row */
    .nations-eras {
        flex-direction: column;
    }

    .nations-era {
        flex-direction: row;
        justify-content: space-between;
        min-height: 30px;
        padding: 4px 10px;
    }

    .nations-era + .nations-era {
        border-left: 0;
        border-top: 2px solid var(--panel-solid);
    }
}
