/* --- City Card Grid Container (No Change from previous answer) --- */
.city-list-grid {
    display: grid;
    /* This line is the most important: it creates columns that are at least 280px wide. 
       'auto-fit' means it will fill the available space with as many columns as possible. */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 30px; /* Space between cards */
    padding: 20px 0;
    /* Optional: Center the grid container on the page if it doesn't take full width */
    margin: 0 auto; 
}

/* --- Individual Card Styles (Refined) --- */
.city-card-col {
    display: flex;
}

.city-card {
    display: flex; /* New: Use flex to stack content vertically */
    flex-direction: column;
    width: 100%;
    text-decoration: none;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.city-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* --- Image Consistency Fix --- */
.city-card-image-wrapper {
    width: 100%;
    /* Key Fix: Enforce a 16:9 aspect ratio using padding-bottom trick */
    padding-bottom: 56.25%; /* 9/16 = 0.5625 */
    position: relative;
    overflow: hidden;
    background-color: #f5f5f5; 
    /* Ensures the image wrapper takes the full width available */
    flex-shrink: 0; 
}

.city-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Key Fix: Crop the image to cover the entire container without distortion */
    object-fit: cover; 
}

.city-card-name {
    /* Ensures text block pushes to the bottom of the card */
    margin: 0;
    padding: 15px;
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    text-align: center;
    /* Ensures name block takes remaining space and centers text vertically */
    flex-grow: 1; 
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.city-card-state {
    display: block;
    font-size: 0.9rem;
    color: #888;
    margin-top: 5px;
    font-weight: 400;
}