/* ─── Home page flex layout ──────────────────────────── */

article.content:has(.home-page) {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

    article.content:has(.home-page) > div {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

.home-page {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ─── Stats + actions bar (desktop lg+) ─────────────── */

.home-topbar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--bs-border-color-translucent);
}

.home-topbar-stats {
    display: flex;
    align-items: center;
}

.home-topbar-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 1.25rem;
    border-right: 1px solid var(--bs-border-color-translucent);
}

    .home-topbar-stat:first-child {
        padding-left: 0;
    }

.home-topbar-stat-val {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--bs-primary);
    line-height: 1;
    margin-bottom: 0.18rem;
}

.home-topbar-stat-lbl {
    font-size: 0.62rem;
    color: var(--bs-secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    white-space: nowrap;
}

.home-topbar-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    padding-left: 1.25rem;
    align-items: center;
}

/* ─── Map section ────────────────────────────────────── */

.home-map-section {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 0;
    overflow: hidden;
}

.home-map-frame {
    position: relative;
    height: 100%;
    aspect-ratio: 921 / 730;
    max-width: 100%;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.1), 0 0 0 1px var(--bs-border-color-translucent);
    transition: box-shadow 0.2s ease;
}

    .home-map-frame:hover {
        box-shadow: 0 6px 28px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(13, 110, 253, 0.25);
    }

[data-bs-theme=dark] .home-map-frame {
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

    [data-bs-theme=dark] .home-map-frame:hover {
        box-shadow: 0 6px 28px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(66, 135, 255, 0.3);
    }

.home-map-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

[data-bs-theme=dark] .home-map-img {
    filter: brightness(0.82) contrast(1.05);
}

/* ─── SVG polygon overlay ────────────────────────────── */

.home-map-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.navarea-poly-group {
    cursor: pointer;
}

    .navarea-poly-group polygon {
        fill: transparent;
        stroke: transparent;
        stroke-width: 0;
        pointer-events: all;
        transition: fill 0.15s ease, stroke-opacity 0.15s ease;
    }

    .navarea-poly-group:hover polygon {
        fill: rgba(13, 110, 253, 0.18);
        stroke: rgba(13, 110, 253, 0.6);
        stroke-width: 1.5px;
        stroke-linejoin: round;
    }

[data-bs-theme=dark] .navarea-poly-group:hover polygon {
    fill: rgba(66, 135, 255, 0.22);
    stroke: rgba(100, 160, 255, 0.65);
}

/* ─── Mobile section ─────────────────────────────────── */

.home-mobile-section {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    padding: 1rem;
}

/* ─── Region pills (mobile grid) ─────────────────────── */

.home-region-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.625rem;
    border-radius: 0.5rem;
    border: 1px solid var(--bs-border-color-translucent);
    background: var(--bs-body-bg);
    text-decoration: none;
    color: var(--bs-body-color);
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    min-height: 52px;
    overflow: hidden;
}

    .home-region-pill:hover {
        background: var(--bs-primary-bg-subtle);
        border-color: var(--bs-primary);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(13, 110, 253, 0.15);
        color: var(--bs-body-color);
        text-decoration: none;
    }

.home-region-roman {
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.25rem;
    background: linear-gradient(135deg, #0a2740, #1a4a73);
    color: #fff;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    font-family: Georgia, serif;
    flex-shrink: 0;
    white-space: nowrap;
}
