/* Video Gallery: three video cards in a grid, in the site's own navy and orange. */

.vg { background: var(--white); }
.vg__head { margin-bottom: clamp(1.75rem, 4vw, 2.75rem); }

.vg__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.vg-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 1.25rem;
    background: var(--white);
    box-shadow: 0 16px 30px -24px rgba(11, 31, 77, 0.55);
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.vg-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 34px -22px rgba(11, 31, 77, 0.6);
}

.vg-card__thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--navy-900);
}

.vg-card__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vg-card__thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(7, 20, 47, 0) 40%, rgba(7, 20, 47, 0.55) 100%);
}

.vg-card__play {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    width: 4rem;
    height: 4rem;
    padding-left: 0.2rem;
    border-radius: 50%;
    background: var(--orange-500);
    color: var(--white);
    box-shadow: 0 10px 24px -8px rgba(7, 20, 47, 0.7);
    transform: translate(-50%, -50%);
    transition: transform 0.2s var(--ease);
}

.vg-card:hover .vg-card__play { transform: translate(-50%, -50%) scale(1.08); }

.vg-card h3 {
    margin: 1rem 1.25rem 0.25rem;
    font-size: 1.125rem;
    color: var(--navy-900);
}

.vg-card p {
    margin: 0 1.25rem 1.25rem;
    font-size: 0.9rem;
    color: #526079;
}

@media (max-width: 960px) {
    .vg__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    .vg__grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    .vg-card, .vg-card__play { transition: none; }
    .vg-card:hover { transform: none; }
    .vg-card:hover .vg-card__play { transform: translate(-50%, -50%); }
}

/* Videos added in the admin panel: the card opens the video. */
.vg-card__open {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.vg-card__open:focus-visible { outline: 3px solid var(--orange-500); outline-offset: -3px; }

.vg-card__thumb { display: block; }

.vg__empty {
    max-width: 40rem;
    font-size: 1.0625rem;
    color: #526079;
}

/* The window the video plays in. */
.vg-player {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(7, 20, 47, 0.88);
}

.vg-player[hidden] { display: none; }

.vg-player__box {
    position: relative;
    width: min(100%, 64rem);
}

.vg-player__frame {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 0.75rem;
    background: #000;
}

.vg-player__frame iframe,
.vg-player__frame video {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.vg-player__close {
    position: absolute;
    top: -3rem;
    right: 0;
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    border-radius: 50%;
    background: var(--orange-500);
    font-size: 1.75rem;
    line-height: 1;
    color: var(--white);
    cursor: pointer;
}
