.lesson-map {

}

.lesson-map__inner {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.lesson-map__heading {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 720px;
}

.lesson-map__heading h2 {
    font-family: var(--font-title);
    font-size: 40px;
    line-height: 1.1;
    margin: 0;
}

.lesson-map__heading p {
    font-size: 16px;
    line-height: 1.5;
    margin: 0;
}

/* Map + pool list layout */
.lesson-map__body {
    display: grid;
    gap: 24px;
    grid-template-columns: 1fr 280px;
    align-items: start;
}

.lesson-map__body.hide-sidebar {
    grid-template-columns: 1fr;
}

.lesson-map__frame {
    border-radius: var(--radius-m);
    overflow: hidden;
}

#lesson-map-leaflet {
    height: 480px;
    width: 100%;
}

/* Pool list sidebar */
.lesson-map__pool-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 480px;
    overflow-y: auto;
}

.map-pool-item {
    align-items: flex-start;
    cursor: pointer;
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-m);
    transition: background 100ms ease;
}

.map-pool-item:hover {
    background: #f5f5f5;
}

.map-pool-item__icon {
    flex: 0 0 auto;
    height: 25px;
    margin-top: 2px;
    width: 18px;
}

.map-pool-item__info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.map-pool-item__title {
    color: var(--heading);
    font-family: var(--font-title);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
}

a.map-pool-item__title:hover {
    color: var(--primary-blue);
    text-decoration: underline;
}

.map-pool-item__address {
    color: #555;
    font-size: 13px;
    line-height: 1.4;
}

.pool-legend {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 20px 28px;
}

.pool-legend__item {
    align-items: center;
    display: inline-flex;
    font-size: 15px;
    gap: 8px;
}

.pool-legend__icon {
    height: 25px;
    width: 18px;
}

/* Leaflet popup overrides */
.pool-leaflet-popup .leaflet-popup-content-wrapper {
    border-radius: var(--radius-m);
    box-shadow: 0 7px 10px rgb(0 0 0 / 15%);
    overflow: hidden;
    padding: 0;
}

.pool-leaflet-popup .leaflet-popup-content {
    margin: 0;
    width: 240px !important;
}

.pool-leaflet-popup .leaflet-popup-tip-container {
    display: none;
}

/* Shared pool popup/modal content */
.pool-popup__image, .pool-modal__image {
    aspect-ratio: 294 / 201;
    object-fit: cover;
    width: 100%;
}

.pool-popup__content, .pool-modal__content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 16px 20px;
}

.pool-popup__heading, .pool-modal__heading {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pool-popup__heading h3, .pool-modal__heading h3 {
    font-family: var(--font-title);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.2;
    margin: 0;
}

.pool-popup__heading p, .pool-modal__heading p {
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
}

.pool-popup__lessons {
    display: flex;
    flex-direction: column;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pool-popup__lesson {
    align-items: center;
    --lesson-accent: currentColor;
    color: var(--heading);
    display: inline-flex;
    font-size: 14px;
    gap: 8px;
}

.pool-popup__lesson::before {
    border-bottom: 3px solid var(--lesson-accent);
    border-right: 3px solid var(--lesson-accent);
    content: "";
    display: inline-block;
    height: 10px;
    transform: rotate(40deg) translateY(-1px);
    width: 6px;
}

.pool-popup__lesson--individual {
    --lesson-accent: var(--primary-red);
}

.pool-popup__lesson--group {
    --lesson-accent: var(--primary-blue);
}

.pool-popup a, .pool-modal a {
    font-size: 16px;
    line-height: 1.4;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Mobile modal */
.pool-modal {
    align-items: flex-end;
    background: rgb(0 0 0 / 55%);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 24px;
    position: fixed;
    z-index: 1000;
}

.pool-modal__card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgb(0 0 0 / 18%);
    max-width: 292px;
    overflow: hidden;
    position: relative;
    width: 100%;
    transform: translateY(-50%);
}

.pool-modal__close {
    align-items: center;
    background: var(--primary-red);
    border: 0;
    border-radius: 999px;
    color: var(--white);
    cursor: pointer;
    display: inline-flex;
    font-size: 24px;
    height: 36px;
    justify-content: center;
    padding: 0;
    position: absolute;
    right: 12px;
    top: 12px;
    width: 36px;
}

.pool-modal__close:hover, .pool-modal__close:focus-visible {
    background: #a80f1e;
}

body.has-modal-open {
    overflow: hidden;
}

@media (max-width: 900px) {
    .lesson-map__body {
        grid-template-columns: 1fr;
    }

    .lesson-map__pool-list {
        max-height: none;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 760px) {
    .lesson-map__heading h2 {
        font-size: 36px;
    }

    #lesson-map-leaflet {
        height: 320px;
    }

    .lesson-map__pool-list {
        grid-template-columns: 1fr;
    }
}
