.portal-skip:focus { z-index: 101; }

.city-dialog {
    position: fixed;
    inset: 0;
    width: min(44rem, calc(100% - 3rem));
    max-width: none;
    max-height: calc(100vh - 3rem);
    max-height: calc(100dvh - 3rem);
    margin: auto;
    padding: clamp(1.25rem, 3vw, 2rem);
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid #d9e1e6;
    border-radius: 1.2rem;
    background: #fff;
    color: var(--ink);
    box-shadow: 0 1.5rem 6rem rgb(5 22 34 / 26%);
}

.city-dialog:not([open]) { display: none; }
.city-dialog::backdrop { background: rgb(7 23 36 / 63%); }
html:has(.city-dialog[open]) { overflow: hidden; }

.city-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    margin-block-end: 1.25rem;
}

.city-dialog-header h2 {
    margin: 0;
    font: 650 clamp(1.45rem, 3vw, 2rem)/1.12 var(--font);
    letter-spacing: -.035em;
}

.city-dialog-close {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #f4f7f8;
    color: var(--ink);
    cursor: pointer;
}

.city-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.city-option {
    display: grid;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #d6dfe4;
    border-radius: .8rem;
    background: #fff;
    color: var(--ink);
    transition: border-color .18s ease, box-shadow .18s ease;
}

.city-photo {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-block-end: 2px solid var(--gold);
    background: #16364c;
}

.city-photo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s var(--ease);
}

.city-caption {
    display: grid;
    align-content: center;
    gap: .25rem;
    padding: 1rem 1.1rem;
}

.city-caption strong {
    font-size: clamp(1.15rem, 2.1vw, 1.4rem);
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: -.025em;
}

.city-caption > span { color: var(--muted); font-size: .9rem; }

.city-dialog :focus-visible {
    outline: 3px solid #1a5979;
    outline-offset: 3px;
}

@media (hover: hover) {
    .city-option:hover {
        border-color: #a48045;
        box-shadow: 0 .3rem 1rem rgb(17 42 61 / 10%);
    }
    .city-option:hover img { transform: scale(1.035); }
    .city-dialog-close:hover { border-color: #a48045; background: #fbf7ee; }
}

@media (max-width: 36rem) {
    .city-dialog {
        inset: auto 0 0;
        margin: 0 auto;
        width: 100%;
        max-height: calc(100dvh - 1rem);
        padding: 1.25rem max(1rem, env(safe-area-inset-right)) max(1.5rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
        border-radius: 1.25rem 1.25rem 0 0;
    }
    .city-dialog-header { margin-block-end: 1rem; }
    .city-options { grid-template-columns: 1fr; gap: .65rem; }
    .city-option { grid-template-columns: clamp(5.2rem, 25vw, 7.5rem) minmax(0, 1fr); }
    .city-photo { aspect-ratio: auto; min-height: 5rem; border: 0; border-inline-end: 2px solid var(--gold); }
    .city-caption { padding: .85rem .95rem; }
}

@media (prefers-reduced-motion: no-preference) {
    .city-dialog[open] { animation: city-enter .2s var(--ease); }
    @keyframes city-enter {
        from { opacity: 0; transform: translateY(.55rem); }
        to { opacity: 1; transform: translateY(0); }
    }
}

@media (prefers-reduced-motion: reduce) {
    .city-option, .city-photo img { transition: none; }
    .city-option:hover img { transform: none; }
}
