/* Photo carousel on the program pages, printed by media_render_program() in includes/media.php. Uses the page's own tokens. */
.program-gallery { padding-top: 0; }
.pg-head { text-align: center; margin-bottom: 34px; }
.pg-head h2 {
    font-family: var(--heading-font);
    font-size: clamp(28px, 3.6vw, 38px);
    line-height: 1.2;
    letter-spacing: -1px;
    color: var(--primary-dark);
}

.pg-carousel {
    position: relative;
    border-radius: var(--radius, 22px);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: var(--primary-dark, #062a67);
    outline: none;
}
.pg-carousel:focus-visible { box-shadow: 0 0 0 3px var(--gold, #f4c542), var(--shadow); }

.pg-slides { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 620px; }

.pg-slide {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity .6s ease-in-out, visibility .6s ease-in-out;
}
.pg-slide.is-active { opacity: 1; visibility: visible; }

/* Blurred copy fills the frame so portrait and landscape photos both show in full. */
.pg-bg {
    position: absolute;
    inset: -30px;
    width: calc(100% + 60px);
    height: calc(100% + 60px);
    object-fit: cover;
    filter: blur(24px) brightness(.6);
}
.pg-img { position: relative; width: 100%; height: 100%; object-fit: contain; display: block; }

.pg-slide figcaption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 60px 28px 48px;
    background: linear-gradient(to top, rgba(6, 42, 103, .85), rgba(6, 42, 103, 0));
    color: #fff;
    font-family: var(--heading-font);
    font-size: 18px;
    font-weight: 700;
    text-align: center;
}

.pg-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 6;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, .9);
    color: var(--primary);
    font-size: 19px;
    cursor: pointer;
    opacity: 0;
    transition: .25s;
}
.pg-arrow.prev { left: 16px; }
.pg-arrow.next { right: 16px; }
.pg-carousel:hover .pg-arrow,
.pg-arrow:focus-visible { opacity: 1; }
.pg-arrow:hover { background: var(--primary); color: #fff; }

.pg-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 18px;
    z-index: 6;
    display: flex;
    justify-content: center;
    gap: 8px;
}
.pg-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .55);
    cursor: pointer;
    transition: background .3s ease, width .3s ease;
}
.pg-dot.is-active { background: #fff; width: 28px; border-radius: 12px; }

/* admin Media preview only */
.pg-add {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 7;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, .9);
    color: var(--primary);
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}
.pg-add:hover,
.pg-add:focus-visible { background: var(--primary); color: #fff; }
.pg-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, .8);
    font-weight: 600;
}

@media (max-width: 850px) {
    .pg-arrow { opacity: 1; width: 38px; height: 38px; font-size: 17px; }
}

@media (max-width: 600px) {
    .pg-slides { aspect-ratio: 4 / 3; }
    .pg-slide figcaption { padding: 40px 16px 40px; font-size: 15px; }
    .pg-arrow.prev { left: 10px; }
    .pg-arrow.next { right: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .pg-slide { transition: none; }
}
