/*
 * School Locations (new; replaces Multiple Locations) (`vc_school_locations`)
 *
 * Loaded only on pages that use this element, after common.css. Rules
 * shared with other elements are in common.css.
 */

/*
* School Locations (plugin `vc_school_locations`).
*
* Map and list: the campuses as tabs beside a stage holding the chosen one's
* map and, under it, its details in a white card; with one campus, its
* details beside its map instead. Cards: a card per campus. The cards and the
* details card are white whatever the section's colour profile, so they read
* in the Default profile's colours (cwb-default-colours, from the plugin); a
* single campus's details sit on the section and take its profile.
*
* The map is a picture linking to Google Maps, with a View on Google Maps
* label always showing on it. A live map, when consent allows (app.js), fills
* the same box and the picture's link steps aside.
*/
.cwb-loc .cwb-loc__name {
    margin: 0;
}

.cwb-loc .cwb-loc__line,
.cwb-loc-modal .cwb-loc__line {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}

.cwb-loc .cwb-loc__blocks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px 28px;
}

.cwb-loc .cwb-loc__block-title {
    margin: 0 0 6px;
    font-family: var(--font-family-base, inherit);
    font-size: 16px;
    font-weight: var(--font-weight-bold, 700);
    line-height: 1.3;
}

.cwb-loc .cwb-loc__block address,
.cwb-loc .cwb-loc__block p {
    margin: 0 0 8px;
    font-style: normal;
}

.cwb-loc .cwb-loc__block > :last-child {
    margin-bottom: 0;
}

/* The text's own size - the theme's global `a` rule sets 16px, smaller than
a school's body text - and underlined, as a link in a site's link colour can
be the same colour as the text around it. !important only because that
same rule has text-decoration:none!important, as with the Page Header. */
.cwb-loc .cwb-loc__block a {
    font-size: inherit;
    overflow-wrap: anywhere;
    text-decoration: underline !important;
    text-underline-offset: 2px;
}

.cwb-loc .cwb-loc__actions,
.cwb-loc-modal .cwb-loc-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.cwb-loc .cwb-loc__actions .btn,
.cwb-loc-modal .cwb-loc-modal__actions .btn {
    margin: 0;
}

/* The map. */
.cwb-loc .cwb-loc-map {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    background: #e8eaed;
    aspect-ratio: 4 / 3;
}

.cwb-loc .cwb-loc-map__link {
    position: absolute;
    inset: 0;
    display: block;
    color: inherit;
}

.cwb-loc .cwb-loc-map img.cwb-loc-map__img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
    object-fit: cover;
}

.cwb-loc .cwb-loc-map__cta {
    position: absolute;
    left: 12px;
    bottom: 12px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #fff;
    color: var(--cwb-default-link, #10171e);
    box-shadow: 0 1px 6px rgba(16, 23, 30, .25);
    font-size: 15px;
    font-weight: var(--font-weight-bold, 700);
    line-height: 1.2;
}

.cwb-loc .cwb-loc-map__link:hover .cwb-loc-map__cta,
.cwb-loc .cwb-loc-map__link:focus-visible .cwb-loc-map__cta {
    text-decoration: underline;
}

.cwb-loc .cwb-loc-map__link:focus-visible {
    outline: 3px solid var(--cwb-link, #1a558b);
    outline-offset: -3px;
}

/* No picture: the label in the middle of the grey box. */
.cwb-loc .cwb-loc-map--no-image .cwb-loc-map__cta {
    left: 50%;
    bottom: 50%;
    transform: translate(-50%, 50%);
    white-space: nowrap;
}

.cwb-loc .cwb-loc-map__frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.cwb-loc .cwb-loc-map.is-live .cwb-loc-map__link {
    display: none;
}

/* One campus. */
.cwb-loc .cwb-loc-single {
    display: grid;
    gap: 32px;
}

.cwb-loc .cwb-loc-single__details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cwb-loc .cwb-loc-single__details > * {
    margin: 0;
}

/* Map and list: an accordion below 992px - each campus's button, then its
panel when open - and from 992px the buttons as a list beside the stage. */
.cwb-loc .cwb-loc-tabs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cwb-loc .cwb-loc-tab {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    width: 100%;
    margin: 0;
    padding: 14px 16px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.cwb-loc .cwb-loc-tab:hover {
    background: rgba(16, 23, 30, .05);
    background: color-mix(in srgb, currentColor 7%, transparent);
}

/* The open campus: white, like the card it opens, so it reads in the
Default profile's text colour on any section. */
.cwb-loc .cwb-loc-tab.is-active {
    background: #fff;
    color: var(--cwb-body-text, #10171e);
    box-shadow: 0 2px 14px rgba(16, 23, 30, .12);
}

.cwb-loc .cwb-loc-tab:focus-visible {
    outline: 3px solid var(--cwb-link, #1a558b);
    outline-offset: 2px;
}

.cwb-loc .cwb-loc-tab__num {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 2px solid currentColor;
    border-radius: 50%;
    font-size: 15px;
    font-weight: var(--font-weight-bold, 700);
    line-height: 1;
}

.cwb-loc .cwb-loc-tab.is-active .cwb-loc-tab__num {
    border-color: var(--cwb-accent-bg, #10171e);
    background: var(--cwb-accent-bg, #10171e);
    color: var(--cwb-accent-text, #fff);
}

.cwb-loc .cwb-loc-tab__text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding-top: 4px;
}

.cwb-loc .cwb-loc-tab__name {
    font-size: 18px;
    font-weight: var(--font-weight-bold, 700);
    line-height: 1.3;
}

.cwb-loc .cwb-loc-tab__line {
    font-size: 14px;
    line-height: 1.4;
}

/* The accordion's chevron, pointing down, and up when open. */
.cwb-loc .cwb-loc-tab__chevron {
    flex: none;
    width: 10px;
    height: 10px;
    margin: 10px 4px 0 0;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform .2s ease;
}

.cwb-loc .cwb-loc-tab.is-active .cwb-loc-tab__chevron {
    margin-top: 14px;
    transform: rotate(-135deg);
}

.cwb-loc .cwb-loc-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 4px 0 12px;
}

.cwb-loc .cwb-loc-panel[hidden] {
    display: none;
}

.cwb-loc .cwb-loc-panel .cwb-loc-map {
    aspect-ratio: 16 / 9;
}

.cwb-loc .card.cwb-loc-panel__card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0;
    padding: 24px;
    border: 0;
    border-radius: 6px;
    background: #fff;
    color: var(--cwb-body-text, #10171e);
    box-shadow: 0 2px 14px rgba(16, 23, 30, .12);
}

.cwb-loc .card.cwb-loc-panel__card > * {
    margin: 0;
}

@media (max-width: 991px) {
    /* The campus's name and line are on its button, just above: kept for
    screen readers, which meet the card's heading, but not shown twice. */
    .cwb-loc .cwb-loc-panel__card > .cwb-loc__name,
    .cwb-loc .cwb-loc-panel__card > .cwb-loc__line {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}

@media (min-width: 992px) {
    /* Each campus's button and panel are grid items of the list itself: the
    buttons a row each down the first column, the open panel across all
    the rows of the second. */
    .cwb-loc .cwb-loc-tabs {
        display: grid;
        grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
        grid-template-rows: repeat(var(--cwb-loc-n, 1), auto) 1fr;
        align-items: start;
        gap: 4px 32px;
    }

    .cwb-loc .cwb-loc-acc__item {
        display: contents;
    }

    .cwb-loc .cwb-loc-tab {
        grid-column: 1;
    }

    .cwb-loc .cwb-loc-panel {
        grid-column: 2;
        grid-row: 1 / -1;
        gap: 20px;
        padding: 0;
    }

    .cwb-loc .cwb-loc-tab__chevron {
        display: none;
    }
}

/* The map picture on hover, where a device can hover: darkened, with "Open
in Google Maps" in the middle in place of the label in the corner. A live
map takes the picture's link away, so it is never darkened. */
.cwb-loc .cwb-loc-map__hover {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    padding: 10px 18px;
    border-radius: 999px;
    background: #fff;
    color: var(--cwb-default-link, #10171e);
    font-size: 16px;
    font-weight: var(--font-weight-bold, 700);
    line-height: 1.2;
    white-space: nowrap;
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: opacity .2s ease;
    pointer-events: none;
}

.cwb-loc .cwb-loc-map:not(.cwb-loc-map--no-image) .cwb-loc-map__link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(16, 23, 30, .4);
    opacity: 0;
    transition: opacity .2s ease;
}

.cwb-loc .cwb-loc-map__cta {
    z-index: 2;
    transition: opacity .2s ease;
}

@media (hover: hover) {
    .cwb-loc .cwb-loc-map:not(.cwb-loc-map--no-image) .cwb-loc-map__link:hover::after,
    .cwb-loc .cwb-loc-map:not(.cwb-loc-map--no-image) .cwb-loc-map__link:hover .cwb-loc-map__hover {
        opacity: 1;
    }

    .cwb-loc .cwb-loc-map:not(.cwb-loc-map--no-image) .cwb-loc-map__link:hover .cwb-loc-map__cta {
        opacity: 0;
    }
}

/* The same for the keyboard, on any device. */
.cwb-loc .cwb-loc-map:not(.cwb-loc-map--no-image) .cwb-loc-map__link:focus-visible::after,
.cwb-loc .cwb-loc-map:not(.cwb-loc-map--no-image) .cwb-loc-map__link:focus-visible .cwb-loc-map__hover {
    opacity: 1;
}

.cwb-loc .cwb-loc-map:not(.cwb-loc-map--no-image) .cwb-loc-map__link:focus-visible .cwb-loc-map__cta {
    opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
    .cwb-loc .cwb-loc-tab__chevron,
    .cwb-loc .cwb-loc-map__hover,
    .cwb-loc .cwb-loc-map__cta,
    .cwb-loc .cwb-loc-map__link::after {
        transition: none;
    }
}

/* Cards. */
.cwb-loc .cwb-loc-cards {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
}

.cwb-loc .card.cwb-loc-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin: 0;
    overflow: hidden;
    border: 0;
    border-radius: 6px;
    background: #fff;
    color: var(--cwb-body-text, #10171e);
    box-shadow: 0 2px 14px rgba(16, 23, 30, .12);
}

.cwb-loc .cwb-loc-card__media {
    position: relative;
    flex: none;
    background: #eceef0;
    aspect-ratio: 16 / 9;
}

.cwb-loc .cwb-loc-card__media.cwb-loc-shape-ratio-1x1 {
    aspect-ratio: 1;
}

.cwb-loc .cwb-loc-card__media.cwb-loc-shape-ratio-4x3 {
    aspect-ratio: 4 / 3;
}

.cwb-loc .cwb-loc-card__media.cwb-loc-shape-ratio-21x9 {
    aspect-ratio: 21 / 9;
}

/* Three classes and the element, so `.card img{height:200px}` stays out. */
.cwb-loc .cwb-loc-card__media img.cwb-loc-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
    object-fit: cover;
}

.cwb-loc .cwb-loc-card__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 16px;
    padding: 22px;
}

.cwb-loc .cwb-loc-card__body > * {
    margin: 0;
}

.cwb-loc .cwb-loc-card__body .cwb-loc__actions {
    margin-top: auto;
    padding-top: 4px;
}

/* The theme's 199px .btn minimum would hold a narrow card's buttons wider
than the card. */
.cwb-loc .cwb-loc__actions .btn {
    min-width: 0;
    max-width: 100%;
}

@media (min-width: 768px) {
    .cwb-loc .cwb-loc-cards:not(.cwb-loc-cards--cols-1) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .cwb-loc .cwb-loc-single {
        grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
        align-items: start;
    }

    .cwb-loc .cwb-loc-single--no-map {
        grid-template-columns: minmax(0, 1fr);
    }

    .cwb-loc .cwb-loc-cards.cwb-loc-cards--cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .cwb-loc .cwb-loc-cards.cwb-loc-cards--cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .cwb-loc .cwb-loc-cards--cols-1 {
        max-width: 480px;
        margin: 0 auto;
    }
}

/* The popup, as Child's Journey's. */
.cwb-loc-modal .modal-content {
    overflow: hidden;
    border: 0;
    color: var(--cwb-body-text, #10171e);
}

.cwb-loc-modal .modal-body {
    padding: 0;
}

.cwb-loc-modal .cwb-loc-modal__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

.cwb-loc-modal .cwb-loc-modal__media {
    position: relative;
    background: #eceef0;
    aspect-ratio: 16 / 9;
}

.cwb-loc-modal .cwb-loc-modal__media img.cwb-loc-modal__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
}

.cwb-loc-modal .cwb-loc-modal__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 28px 24px 32px;
}

.cwb-loc-modal .cwb-loc-modal__grid:not(.cwb-loc-modal__grid--image) .cwb-loc-modal__text {
    padding-top: 72px;
}

.cwb-loc-modal .cwb-loc-modal__text > *,
.cwb-loc-modal .cwb-loc-modal__more > :last-child {
    margin: 0;
}

.cwb-loc-modal .cwb-loc-modal__actions {
    margin-top: 8px;
}

@media (max-width: 767px) {
    .cwb-loc-modal .modal-content {
        min-height: 0;
        border-radius: 12px;
    }

    .cwb-loc-modal .modal-dialog {
        margin: 12px;
    }

    .cwb-loc-modal .btn-close {
        background: #fff;
    }
}

@media (min-width: 768px) {
    .cwb-loc-modal .cwb-loc-modal__grid--image {
        grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    }

    .cwb-loc-modal .cwb-loc-modal__grid--image .cwb-loc-modal__media {
        min-height: 360px;
        aspect-ratio: auto;
    }

    .cwb-loc-modal .cwb-loc-modal__text {
        padding: 72px 40px 40px 36px;
    }
}

.cwb-loc .cwb-loc-card__media.cwb-loc-shape-circle {
    width: 160px;
    margin: 20px auto 0;
    overflow: hidden;
    border-radius: 50%;
    aspect-ratio: 1;
}

@media (max-width: 767px) {
    .cwb-loc .cwb-loc-card__media.cwb-loc-shape-circle {
        width: 120px;
    }
}
