/*
 * Elden Ring full map page only (/elden-ring/map/): the intro under the H1 and the
 * "Locations by Region" index under the map. Enqueued by rb_er_map_page_style() in
 * map/RB-EldenRing-WorldMap.php, never on location-single embeds.
 * Vocabulary = the page itself: Nunito (theme), ink #333, link blue #0067b1 (the
 * breadcrumb links), the 8px radius of the map frame. No accent stripe on any edge.
 */

.rb-ermap-intro,
.rb-ermap-howto {
    margin: 4px 0 0;
    font-size: 17px;
    line-height: 1.6;
    color: #333;
}

/* M13 (audit UX-06): one short sentence above the map, the how-to sentences under it, so the map frame fits the first screen. */
.rb-ermap-howto {
    margin-top: 20px;
}

/* Map legend (M12 fix round 2): the Bosses + Invaders group keeps its data name "Enemies", because the ER tracker
   group chips and their filter key on it, and shows as "Bosses & Invaders" next to the Field Enemies group. Display
   text only: the button takes its accessible name from the new text, the hidden span leaves the name. */
.pkmega[data-game-slug="elden-ring"] .pkmega-legend-group:has(.pkmega-legend-row[data-cat="boss"]) .pkmega-lgh-name {
    display: none;
}
.pkmega[data-game-slug="elden-ring"] .pkmega-legend-group:has(.pkmega-legend-row[data-cat="boss"]) .pkmega-lgh::before {
    content: "Bosses & Invaders";
    /* The longer name takes the free width and wraps inside it in a narrow desktop panel, so the group switch stays on its row and every word shows. */
    flex: 1 1 0;
    min-width: 0;
}
.pkmega[data-game-slug="elden-ring"] .pkmega-legend-group:has(.pkmega-legend-row[data-cat="boss"]) .pkmega-lgh-chev {
    order: -1;
}

/* Breadcrumb links: 45px tap height from padding, cancelled by equal negative margins so the trail does not move. */
.rbss-breadcrumb-nav a {
    display: inline-block;
    padding: 13px 0;
    margin: -13px 0;
}

.rb-ermap-regions {
    margin: 28px 0 8px;
}

.rb-ermap-regions .rb-ermap-h2 {
    margin: 0 0 14px;
    font-size: 24px !important; /* theme forces h2 to 32px !important */
    line-height: 1.3;
    font-weight: 600;
    color: #222;
}

/* Masonry-style columns: cards keep their full height and never split. */
.rb-ermap-regions-grid {
    column-width: 300px;
    column-gap: 16px;
}

.rb-ermap-region {
    display: inline-block;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 16px;
    padding: 6px 14px 12px;
    break-inside: avoid;
    background: #fff;
    border: 1px solid #e3e6eb;
    border-radius: 8px;
}

.rb-ermap-regions .rb-ermap-region-h {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 8px;
    margin: 0;
    min-height: 44px;
    font-size: 19px !important; /* theme forces h3 to 29px !important */
    line-height: 1.3;
    font-weight: 600;
    color: #222;
}

.rb-ermap-region-h a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: #0067b1;
    text-decoration: none;
}

.rb-ermap-region-h a:hover,
.rb-ermap-region-h a:focus-visible,
.rb-ermap-region-list a:hover,
.rb-ermap-region-list a:focus-visible {
    text-decoration: underline;
}

.rb-ermap-region-h a:focus-visible,
.rb-ermap-region-list a:focus-visible {
    outline: 2px solid #0067b1;
    outline-offset: 2px;
    border-radius: 2px;
}

.rb-ermap-region-meta {
    font-size: 14px;
    font-weight: 400;
    color: #595959;
}

.rb-ermap-region-tag {
    display: inline-block;
    padding: 0 8px;
    font-size: 13px;
    line-height: 22px;
    font-weight: 600;
    color: #fff;
    background: #2b3240;
    border-radius: 11px;
}

/* The same tag on an entry of the closing card (a place or region page on the Underground layer). */
.rb-ermap-region-list .rb-ermap-region-tag {
    margin-left: 4px;
}

/* Place names flow like text and wrap freely: every word stays on phones, the card grows. */
.rb-ermap-regions .rb-ermap-region-list {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.rb-ermap-regions .rb-ermap-region-list li {
    margin: 0;
    padding: 0;
    font-size: 16px;
    line-height: 1.9;
    list-style: none;
}

.rb-ermap-region-list a {
    color: #0067b1;
    font-weight: 400;
    text-decoration: none;
}

@media (max-width: 600px) {
    .rb-ermap-intro,
    .rb-ermap-howto {
        font-size: 16px;
    }
    .rb-ermap-regions .rb-ermap-h2 {
        font-size: 22px !important;
    }
    .rb-ermap-region {
        margin-bottom: 12px;
        padding: 4px 12px 10px;
    }
    .rb-ermap-regions .rb-ermap-region-list {
        gap: 0 14px;
    }
    .rb-ermap-regions .rb-ermap-region-list li {
        line-height: 1.75;
    }
}

/* Phones: every place is a 44 px block cell (light fill + keyline, lightness not hue) in a 2-column grid, so the
   index does not double in length; a long name wraps inside its cell and keeps every word. Desktop keeps the text flow. */
@media (max-width: 480px) {
    .rb-ermap-regions .rb-ermap-region-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        /* 8 px under the card header: a place count that wraps to its own line no longer touches the first cell */
        padding-top: 8px;
    }
    .rb-ermap-region {
        padding-left: 10px;
        padding-right: 10px;
    }
    .rb-ermap-regions .rb-ermap-region-list li {
        display: flex;
        font-size: 14px;
        line-height: 1.25;
    }
    .rb-ermap-regions .rb-ermap-region-list a {
        display: flex;
        align-items: center;
        box-sizing: border-box;
        width: 100%;
        min-height: 44px;
        padding: 3px 8px;
        background: #f5f7fa;
        border: 1px solid #e3e6eb;
        border-radius: 6px;
        overflow-wrap: break-word;
    }
    /* A tagged entry: the Underground tag wraps under the name inside its cell, every word kept. */
    .rb-ermap-regions .rb-ermap-region-list a:has(.rb-ermap-region-tag) {
        flex-wrap: wrap;
        gap: 4px 6px;
        padding-top: 5px;
        padding-bottom: 5px;
    }
    .rb-ermap-region-list .rb-ermap-region-tag {
        margin-left: 0;
    }
}
