.region-grid{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
    max-width: 1300px;
    margin: auto;
}

.region-name{
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    font-size: 16px;
    line-height: 1.3;
    text-align: left;
    color: #1a1a1a;
    text-decoration: none;
    cursor: pointer;
    transition: border-color .12s, background-color .12s, box-shadow .12s;
}

.region-name,
.region-name:hover,
.region-name:visited{
    color: #1a1a1a;
    text-decoration: none;
}

.region-name:hover{
    border-color: #c7ccd1;
    background: #f7f8fa;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .07);
}

.region-type{
    font-size: 11px;
    font-weight: 400;
    color: #9aa0a6;
    line-height: 1;
    text-align: left;
}

.region-row{
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.acount{
    flex: none;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    background: #f3f4f6;
    border-radius: 20px;
    padding: 2px 10px;
    font-variant-numeric: tabular-nums;
}

.grid-section-title{
    max-width: 1300px;
    margin: 28px auto 12px;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    text-align: left;
}

.grid-title{
    text-align: center;
    padding: 25px 15px 7px 15px;
    margin: 0;
    color: black;
    font-weight: bold;
    text-shadow: 2px 2px 2px rgb(200 200 200);
    background: #eee;
}

#h2 {
    background: #eee;
    font-size: 18px;
    color: #555;
    margin: 0;
    padding: 0 0 15px 0;
    text-align: center;
}

.properties{
    float: right;
    color: #444;
    text-transform: none;
    font-weight: normal;
    font-size: 15px;
    position: relative;
    top: 2px;
}

.zero_results{
    color: gray;
    cursor: text;
    opacity: 0.7;
}

.region-name.zero_results:hover {
    color: gray;
    cursor: text;
    opacity: 0.7;
}

@media only screen and (max-width : 768px) {
    .region-grid{
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 6px;
    }

    .region-name{
        font-size: 15px;
        padding: 10px 12px;
    }

    .grid-title {
        font-size: 26px;
        padding: 20px 10px;
    }
}

.section-subtitle{
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    margin-bottom: var(--space-4);
}

.top-searched-section,
.city-list-section{
    padding-bottom: var(--space-8);
}

.top-searched-grid{
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
}

.top-searched-grid .top-city-card:nth-child(n+5){
    display: none;
}

.top-city-card{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-4);
    background: linear-gradient(135deg, color-mix(in srgb, var(--color-secondary) 4%, transparent), color-mix(in srgb, var(--color-secondary) 1%, transparent));
    border: 1px solid color-mix(in srgb, var(--color-secondary) 15%, transparent);
    border-radius: var(--radius-lg);
    text-align: center;
    text-decoration: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    min-width: 0;
}

.top-city-card:hover{
    border-color: var(--color-secondary);
    box-shadow: var(--shadow-sm);
}

.top-city-card__name{
    max-width: 100%;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-city-card__count{
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.anchor-letters{
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    margin-bottom: var(--space-4);
}

.anchor-letter{
    min-width: 30px;
    padding: var(--space-1) var(--space-2);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-secondary);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.anchor-letter:hover{
    color: var(--color-text-inverse);
    background: var(--color-secondary);
    border-color: var(--color-secondary);
}

.city-list{
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
}

.letter-group{
    padding: var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.letter-group.selected{
    background: linear-gradient(135deg, color-mix(in srgb, var(--color-secondary) 4%, transparent), color-mix(in srgb, var(--color-secondary) 1%, transparent));
    border-color: color-mix(in srgb, var(--color-secondary) 15%, transparent);
}

.letter-group__letter{
    margin: 0 0 var(--space-2);
    padding-bottom: var(--space-2);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-secondary);
    border-bottom: 2px solid var(--color-secondary);
}

.letter-group__cities{
    display: flex;
    flex-direction: column;
}

.city-link{
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) 0;
    color: var(--color-text);
    font-size: var(--font-size-sm);
    text-decoration: none;
    border-bottom: 1px solid var(--color-border-light);
    transition: color var(--transition-fast);
}

.city-link:hover{
    color: var(--color-secondary);
}

.city-link__name{
    font-weight: var(--font-weight-medium);
}

.city-link__type{
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.city-link__count{
    margin-left: auto;
    min-width: 18px;
    padding: 1px var(--space-2);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-muted);
    background: var(--color-bg-light-gray);
    border-radius: var(--radius-full);
    text-align: center;
    flex-shrink: 0;
}

.type-group + .type-group{
    margin-top: 17px;
}

.type-group .city-link:last-child{
    border-bottom: none;
}

.letter-group.selected .city-link{
    border-bottom-color: color-mix(in srgb, var(--color-secondary) 15%, transparent);
}

.letter-group.selected .city-link__count{
    background: var(--color-surface);
}

.city-link--empty{
    opacity: 0.5;
    pointer-events: none;
    cursor: default;
}

.city-link--empty .city-link__name{
    color: var(--color-text-muted);
}



@media (min-width: 640px) {
    .top-searched-grid{
        grid-template-columns: repeat(3, 1fr);
    }

    .top-searched-grid .top-city-card:nth-child(n+4){
        display: none;
    }

    .city-list{
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .top-searched-grid{
        grid-template-columns: repeat(4, 1fr);
    }

    .top-searched-grid .top-city-card:nth-child(n+4){
        display: flex;
    }

    .top-searched-grid .top-city-card:nth-child(n+5){
        display: none;
    }

    .anchor-letters{
        justify-content: center;
    }

    .city-list{
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1280px) {
    .city-list{
        grid-template-columns: repeat(5, 1fr);
    }

    .top-searched-grid{
        grid-template-columns: repeat(6, 1fr);
    }

    .top-searched-grid .top-city-card:nth-child(n+5){
        display: flex;
    }
}
