@import url('../vendor/leaflet/leaflet.css');

.school-directory-page .directory-hero { background: linear-gradient(125deg, #063a9a, #086dd4 60%, #10a6ed); }
.school-directory-page .notification {
    border-radius: calc(21 * var(--u));
    background: #fff;
    box-shadow: 0 calc(6 * var(--u)) calc(13 * var(--u)) #2346842a;
}
.school-directory-page main { padding-bottom: calc(189 * var(--u) + env(safe-area-inset-bottom)); }

.school-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px clamp(12px, 4cqw, 26px) 0;
}
.school-filter { display: grid; gap: 3px; color: #314c78; font-size: var(--type-body); font-weight: var(--weight-label); }
.school-filter select,
.school-map-toggle,
.school-map-reset,
.school-load-more {
    min-height: 38px;
    border: 1px solid #c2dcf6;
    border-radius: 12px;
    padding: 5px 11px;
    background: #f4faff;
    color: #074ca8;
    font-size: var(--type-body);
    font-weight: var(--weight-bold);
}
.school-map-toggle { display: inline-flex; align-items: center; gap: 6px; border-color: #075ae5; background: #075ae5; color: #fff; }
.school-map-toggle .icon { width: 1.15em; height: 1.15em; }

.school-map-panel { scroll-margin-top: 12px; }
.school-section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 11px; }
.school-section-heading h2 { margin: 0; }
.school-map-reset { min-height: 33px; font-size: var(--type-action); }
.school-map-reset:disabled { opacity: .55; cursor: default; }
.school-map-layers {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 9px;
    padding: 4px;
    border: 1px solid #dce8f4;
    border-radius: 13px;
    background: #eef5fb;
}
.school-map-layers button {
    flex: 1 1 auto;
    min-height: 34px;
    padding: 4px 7px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: #46617a;
    font-size: var(--type-action);
    font-weight: var(--weight-bold);
    white-space: nowrap;
}
.school-map-layers button[aria-pressed="true"] {
    border-color: #d5e6f5;
    background: #fff;
    color: #15538a;
    box-shadow: 0 2px 5px #23467213;
}
.school-map {
    z-index: 0;
    width: 100%;
    height: clamp(255px, 67cqw, 405px);
    overflow: hidden;
    border: 1px solid #c4daee;
    border-radius: 15px;
    background: #e6f1fb;
}
.school-map-status { margin-top: 8px; color: #38547e; font-size: var(--type-body); line-height: 1.3; }
.school-pin { display: flex; justify-content: center; }
.school-marker {
    --school-pin-fill: #edf5ff;
    --school-pin-edge: #8eb6d8;
    --school-pin-ink: #27618c;
    position: relative;
    display: grid;
    place-items: center;
    width: 33px;
    height: 33px;
    border: 1px solid var(--school-pin-edge);
    border-radius: 11px;
    background: var(--school-pin-fill);
    color: var(--school-pin-ink);
    box-shadow: 0 2px 5px #17334d47;
}
.school-marker.smp { --school-pin-fill: #e7f7ef; --school-pin-edge: #88baa5; --school-pin-ink: #296750; }
.nonformal-directory .school-marker { --school-pin-fill: #f0ecfb; --school-pin-edge: #b5a4dd; --school-pin-ink: #664b9e; }
.school-marker::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: calc(50% - 4px);
    width: 8px;
    height: 8px;
    rotate: 45deg;
    border: solid var(--school-pin-edge);
    border-width: 0 1px 1px 0;
    background: var(--school-pin-fill);
}
.school-marker > .icon { width: 17px; height: 17px; }
.school-marker-count {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 14px;
    height: 14px;
    padding-inline: 2px;
    border: 1px solid #fff;
    border-radius: 99px;
    background: #28658e;
    color: #fff;
    font: var(--weight-heading) 9px/12px var(--portal-font);
    text-align: center;
}
.school-pin:focus-visible { outline-offset: 2px; }
.school-marker:hover { filter: brightness(.97); }

.school-popup-shell .leaflet-popup-content-wrapper { border-radius: 16px; box-shadow: 0 7px 21px #233b5655; }
.school-popup-shell .leaflet-popup-content { margin: 0; }
.school-popup-shell .leaflet-popup-close-button { width: 29px; height: 29px; line-height: 28px; color: #385570; }
.school-pin-popup {
    width: min(254px, calc(100vw - 62px));
    max-height: 220px;
    overflow: auto;
    padding: 13px;
    color: #152b48;
    font-family: var(--portal-font);
    font-size: var(--type-body);
    line-height: 1.33;
}
.school-pin-popup p { margin: 0; }
.school-popup-card + .school-popup-card { margin-top: 11px; padding-top: 11px; border-top: 1px solid #e2eaf3; }
.school-popup-heading { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: 8px; padding-right: 10px; }
.school-popup-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: #eaf4ff;
    color: #28618d;
    font-size: 16px;
}
.school-popup-level { color: #3a688e; font-size: var(--type-caption); font-weight: var(--weight-heading); letter-spacing: .06em; }
.school-popup-heading h3 { margin: 2px 0 0; font-size: var(--type-card); font-weight: var(--weight-heading); line-height: 1.2; overflow-wrap: anywhere; }
.school-pin-popup .school-popup-address { display: flex; align-items: flex-start; gap: 5px; margin: 8px 0; color: #435b72; }
.school-popup-address .icon { margin-top: 1px; color: #44779e; }
.school-popup-address span { overflow-wrap: anywhere; }
.school-popup-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.school-popup-npsn { padding: 4px 6px; border-radius: 6px; background: #eef3f8; color: #425c73; font-size: var(--type-caption); font-weight: var(--weight-bold); font-variant-numeric: tabular-nums; }
.school-pin-popup .school-route-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 32px;
    padding: 5px 7px;
    border-radius: 8px;
    background: #e7f2ff;
    color: #14528d;
    font-size: var(--type-action);
    font-weight: var(--weight-bold);
    white-space: nowrap;
}
.school-pin-popup .school-route-action:hover { background: #d9ebff; }

.school-count { color: #38547e; font-size: var(--type-meta); font-weight: var(--weight-label); }
.school-list { display: grid; gap: 8px; }
.school-card {
    display: grid;
    grid-template-columns: clamp(33px, 10cqw, 52px) minmax(0, 1fr);
    align-items: start;
    gap: clamp(8px, 3cqw, 15px);
    padding: 12px;
    border: 1px solid #dbe8f7;
    border-radius: 16px;
    background: linear-gradient(135deg, #f4faff, #fff 74%);
    box-shadow: 0 2px 6px #1646770b;
}
.school-card-icon {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    border-radius: 12px;
    background: #e0efff;
    color: #0068e4;
    font-size: clamp(21px, 6.1cqw, 34px);
}
.nonformal-directory :is(.school-card-icon, .school-popup-icon) { background: #f0ecfb; color: #664b9e; }
.school-card h3 { margin: 4px 0 2px; font-size: var(--type-card); font-weight: var(--weight-heading); line-height: 1.2; overflow-wrap: anywhere; }
.school-card-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.school-card-tags span { padding: 2px 6px; border-radius: 6px; background: #e3f0fb; color: #075395; font-size: var(--type-caption); font-weight: var(--weight-bold); }
.school-card-tags span + span { background: #edf3fa; color: #38527c; }
.school-npsn, .school-address, .school-location-missing { font-size: var(--type-body); color: #4a5b78; overflow-wrap: anywhere; }
.school-npsn { font-weight: var(--weight-label); }
.school-address { margin-top: 4px; line-height: 1.3; }
.school-location { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; margin-top: 2px; color: #0255c9; font-size: var(--type-action); font-weight: var(--weight-bold); }
.school-card-actions { display: flex; flex-wrap: wrap; gap: 1px 15px; }
.school-list-route { color: #2d5a82; }
.school-location-missing { margin-top: 5px; }
.school-load-more { display: block; margin: 12px auto 0; }
