:root {
    --primary-color: #0067ae;
    --white: #fff;
}

.csn-location-cards {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

@media (min-width: 640px) {
    .csn-location-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (min-width: 1024px) {
    .csn-location-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.csn-location-card {
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    padding: 16px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.csn-location-card__title {
    margin: 0;
    line-height: 1.25;
    font-size: 24px !important;
}

.csn-result-links {
    margin-top: auto; /* pins links to bottom */
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* === Filter row mirrors the cards grid === */
.csn-location-filter-row {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 4rem;

    .csn-select {
        position: relative;
        width: 100%;

        select#csn-state-filter {
            width: 100%;
            box-sizing: border-box;
            border: 1px solid #aaaaaa20;
            box-shadow: 0px 4px 4px 0px #00000020;
            border-radius: 12px;
            background: #fff;
            padding: 0 2.75rem 0 1rem;
            color: var(--primary-color);
            font-weight: bold;

            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
        }

        /* remove old IE arrow (harmless elsewhere) */
        select#csn-state-filter::-ms-expand {
            display: none;
        }
    }

    /* custom caret you can inset */
    .csn-select::after {
        content: "";
        position: absolute;
        right: 1rem;
        top: 50%;
        width: 8px;
        height: 8px;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        transform: translateY(-60%) rotate(45deg);
        pointer-events: none;
        color: var(--primary-color);
    }
}

/* Tablet: 2 columns, dropdown in the right column */
@media (min-width: 640px) {
    .csn-location-filter-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .csn-location-filter-row .csn-select {
        grid-column: 2;
    }
}

/* Desktop: 3 columns, dropdown in the right column */
@media (min-width: 1024px) {
    .csn-location-filter-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .csn-location-filter-row .csn-select {
        grid-column: 3;
    }
}

#csn-location-results {
    .csn-location-cards {
        article.csn-location-card {
            justify-content: space-between;
            border: 1px solid #aaaaaa20;
            box-shadow: 0px 4px 4px 0px #00000020;
            padding: 1rem;
            margin-bottom: 0.75rem;

            .csn-result-title {
                display: flex;

                small {
                    margin-left: auto;
                }

                a {
                    font-weight: bold;
                }
            }

            .csn-loc-street,
            .csn-loc-cityline,
            .csn-loc-postalline {
                font-size: 0.75rem;
                color: #666;
            }

            .csn-loc-cityline {
                line-height: 1;
            }

            .csn-result-links {
                margin-top: 1.5rem;
                display: flex;
                font-size: 0.8rem;
                justify-content: space-between;

                a:link,
                a:visited,
                a:hover,
                a:active {
                    color: #000;
                    text-decoration: underline solid #000 1px;
                }
            }
        }
    }
}
