.locations-directory {
    padding: 0 0 1rem;
}

.locations-layout {
    display: grid;
    align-items: stretch;
    height: var(--locations-panel-height, calc(100dvh - 280px));
    grid-template-rows: minmax(0, 1fr);
    grid-template-columns: minmax(240px, 0.36fr) minmax(0, 1fr);
    gap: 3rem;
}

.locations-list {
    min-height: 0;
    min-width: 0;
    overflow-y: auto;
    scrollbar-gutter: stable;
    padding: 0.75rem 0.5rem 0 0;
}

.locations-list:focus-visible {
    outline: 3px solid var(--lec-focus);
    outline-offset: -3px;
}

.location-card {
    /* Keep absolutely positioned screen-reader labels inside the scroll panel. */
    position: relative;
    padding: 0.75rem 0.75rem 1.25rem;
    border-bottom: 1px dotted #cfd2d4;
}

.location-card + .location-card {
    padding-top: 1.25rem;
}

.location-card h2 {
    margin: 0 0 0.45rem;
    color: #17191b;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.45;
}

.location-card__map-trigger {
    margin: 0;
    padding: 0;
    color: inherit;
    background: transparent;
    border: 0;
    font: inherit;
    text-align: left;
}

.location-card__map-trigger:hover,
.location-card__map-trigger:focus-visible {
    color: var(--lec-green);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.location-card__map-trigger:focus-visible {
    outline: 3px solid var(--lec-focus);
    outline-offset: 3px;
}

.location-card address {
    margin: 0 0 0.75rem;
    color: #4f5458;
    font-size: 1rem;
    font-style: normal;
    line-height: 1.7;
}

.location-card__directions {
    color: var(--lec-green);
    font-weight: 700;
    text-decoration: none;
}

.location-card__directions::after {
    display: inline-block;
    margin-left: 0.35rem;
    content: "\2197";
    font-size: 0.8em;
    transition: transform 150ms ease-in-out;
}

.location-card__directions:hover,
.location-card__directions:focus {
    color: var(--lec-green-dark);
    text-decoration: underline;
}

.location-card__directions:hover::after,
.location-card__directions:focus::after {
    transform: translate(2px, -2px);
}

.locations-map-shell {
    position: relative;
    min-width: 0;
    min-height: 0;
    height: 100%;
    background: #e8e9e9;
}

.locations-map {
    width: 100%;
    height: 100%;
    min-height: 0;
}

.locations-map__link {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    z-index: 1000;
    padding: 0.5rem 0.75rem;
    color: #24272a;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid #d5d7d8;
    border-radius: 0.2rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
}

.locations-map__notice {
    position: absolute;
    inset: 50% auto auto 50%;
    margin: 0;
    transform: translate(-50%, -50%);
}

.location-map-marker {
    background: transparent;
    border: 0;
}

.location-map-marker__pin {
    position: relative;
    display: block;
    width: 30px;
    height: 30px;
    background: #477c29;
    border: 2px solid #285116;
    border-radius: 50% 50% 50% 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
    transform: rotate(-45deg);
}

.location-map-marker__dot {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
}

.location-popup h3 {
    margin: 0 0 0.55rem;
    color: #17191b;
    font-size: 1rem;
}

.location-popup address {
    margin: 0 0 0.75rem;
    color: #555b60;
    font-style: normal;
    line-height: 1.55;
}

.location-popup a {
    color: var(--lec-green);
    font-weight: 700;
    text-decoration: none;
}

.location-popup a:hover,
.location-popup a:focus {
    color: var(--lec-green-dark);
    text-decoration: underline;
}

.locations-map .leaflet-popup-content-wrapper {
    border-radius: 0.25rem;
}

.locations-map .leaflet-popup-content {
    min-width: 210px;
    margin: 1.2rem 1.25rem;
}

.locations-map__link:hover,
.locations-map__link:focus {
    color: var(--lec-green);
    text-decoration: underline;
}

@media (max-width: 991.98px) {
    .locations-layout { grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1fr); gap: 2rem; }
}

/* Short desktop windows use normal page scrolling instead of tiny panels. */
.locations-layout--short {
    height: auto;
    grid-template-rows: auto;
}
.locations-layout--short .locations-list { overflow: visible; }
.locations-layout--short .locations-map-shell { height: 65dvh; min-height: 220px; }

@media (max-width: 767.98px) {
    .locations-layout {
        height: auto;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto;
        gap: 1rem;
    }
    .locations-list {
        height: clamp(200px, 45dvh, 360px);
        padding-top: 0.5rem;
    }
    .locations-map-shell { height: clamp(220px, 45dvh, 420px); }
    .location-card { padding-inline: 0.5rem; }
}

@media (max-width: 767.98px) and (max-height: 480px) {
    .locations-list { height: auto; overflow: visible; }
}
