.perth-video-gallery {
    padding: 48px 0;
    background: #f6f8fb;
}

.perth-video-gallery__heading {
    margin: 0 auto 28px;
    max-width: 820px;
    text-align: center;
}

.perth-video-gallery__heading .sub-cta-default {
    margin-bottom: 8px;
    color: var(--color-secondary, #1e5ca0);
}

.perth-video-gallery__heading h2 {
    margin-bottom: 12px;
    overflow-wrap: anywhere;
}

.perth-video-gallery__heading > p:last-child {
    margin-bottom: 0;
}

.perth-video-gallery__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
}

.perth-video-gallery [hidden] {
    display: none !important;
}

.perth-video-card {
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e2e7ee;
    border-radius: var(--md-radius, 10px);
    box-shadow: 0 3px 12px rgb(21 40 66 / 5%);
}

.perth-video-card__link {
    display: block;
    height: 100%;
    color: var(--fc-p, #1a1b1b);
    text-decoration: none;
}

.perth-video-card__image {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #14273c;
}

.perth-video-card__image--portrait {
    aspect-ratio: 9 / 16;
}

.perth-video-card__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.perth-video-card__image::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 60%, rgb(0 0 0 / 30%));
    content: "";
    pointer-events: none;
}

.perth-video-card__play {
    position: absolute;
    z-index: 1;
    inset: 50% auto auto 50%;
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--color-secondary, #1e5ca0);
    color: #fff;
    box-shadow: 0 2px 12px rgb(0 0 0 / 25%);
    transform: translate(-50%, -50%);
    transition: transform .15s ease;
}

.perth-video-card__play svg {
    margin-left: 2px;
}

.perth-video-card__duration {
    position: absolute;
    z-index: 1;
    right: 8px;
    bottom: 8px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgb(0 0 0 / 80%);
    color: #fff;
    font-size: 12px;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
}

.perth-video-card__content {
    display: block;
    padding: 15px 14px 16px;
}

.perth-video-card__title {
    display: block;
    color: var(--color-secondary, #1e5ca0);
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.perth-video-card__date {
    display: block;
    margin-top: 8px;
    color: #56616f;
    font-size: 13px;
    line-height: 1.4;
}

.perth-video-card__link:hover,
.perth-video-card__link:focus {
    color: var(--fc-p, #1a1b1b);
    text-decoration: none;
}

.perth-video-card__link:hover .perth-video-card__play {
    transform: translate(-50%, -50%) scale(1.08);
}

.perth-video-card__link:focus-visible {
    outline: 3px solid var(--color-secondary, #1e5ca0);
    outline-offset: -3px;
}

.perth-video-gallery__actions {
    margin-top: 28px;
    text-align: center;
}

.perth-video-gallery__status {
    margin: 0 0 12px;
    color: #56616f;
    font-size: 14px;
    line-height: 1.5;
}

.perth-video-gallery__status:empty {
    display: none;
}

.perth-video-gallery__more {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--color-secondary, #1e5ca0);
    cursor: pointer;
}

.perth-video-gallery__more:focus-visible,
.perth-video-modal a:focus-visible,
.perth-video-modal .btn-close:focus-visible {
    outline: 3px solid var(--color-secondary, #1e5ca0);
    outline-offset: 4px;
}

.perth-video-modal {
    z-index: 10050;
}

body.perth-service-video-open .modal-backdrop {
    z-index: 10040;
}

.perth-video-modal .modal-dialog {
    width: min(960px, calc(100vw - 24px), calc((100vh - 192px) * 1.777778));
    width: min(960px, calc(100vw - 24px), calc((100svh - 192px) * 1.777778));
    max-width: none;
    margin: 16px auto;
}

.perth-video-modal[data-video-portrait="true"] .modal-dialog {
    width: min(430px, calc(100vw - 24px), calc((100vh - 192px) * .5625));
    width: min(430px, calc(100vw - 24px), calc((100svh - 192px) * .5625));
}

.perth-video-modal .modal-content {
    overflow: hidden;
    border: 0;
    border-radius: var(--md-radius, 10px);
}

.perth-video-modal .modal-header {
    gap: 12px;
    min-width: 0;
    padding: 12px 16px;
}

.perth-video-modal .modal-title {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    color: var(--color-secondary, #1e5ca0);
    font-size: 17px;
    font-weight: 600;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow-wrap: anywhere;
}

.perth-video-modal .btn-close {
    flex-shrink: 0;
    min-width: 20px;
    min-height: 20px;
    padding: 12px;
    margin: -8px -12px -8px auto;
}

.perth-video-modal .modal-body {
    padding: 0;
    background: #000;
}

.perth-video-modal__player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
}

.perth-video-modal[data-video-portrait="true"] .perth-video-modal__player {
    aspect-ratio: 9 / 16;
}

.perth-video-modal__player iframe {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.perth-video-modal .modal-footer {
    justify-content: center;
    padding: 8px 12px;
}

.perth-video-modal .modal-footer a {
    color: var(--color-secondary, #1e5ca0);
    font-size: 14px;
    line-height: 1.5;
    text-decoration: underline;
}

@media (min-width: 768px) {
    .perth-video-gallery__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .perth-video-gallery__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    .perth-video-gallery {
        padding: 36px 0;
    }

    .perth-video-gallery__heading h2 {
        font-size: 27px;
        line-height: 1.25;
    }

    .perth-video-gallery__grid {
        gap: 14px 10px;
    }

    .perth-video-card__content {
        padding: 12px 10px;
    }

    .perth-video-card__title {
        font-size: 15px;
    }

    .perth-video-card__play {
        width: 46px;
        height: 46px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .perth-video-card__play {
        transition: none;
    }
}
