/* ═══════════════════════════════════════════════════
   VIDEOS PAGE
═══════════════════════════════════════════════════ */

.mtic-section-heading {
    font-family: var(--mtic-font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: #1B3A6B;
    margin-bottom: 1.5rem;
    padding-bottom: 0.45rem;
    position: relative;
}

.mtic-section-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--mtic-primary);
    border-radius: 2px;
}

/* ═══════════════════════════════════════════════════
   HERO BANNER + SEARCH — mirror the Digital Library page
   Both use banner-digital-library.png, whose curve + gradient are
   baked into the artwork, so the component's CSS curve (border-radius)
   and overlay (::before) are disabled and the banner renders flat,
   edge-to-edge, exactly like the Library hero.
═══════════════════════════════════════════════════ */
.mtic-page--videos .mtic-page-hero {
    border-radius: 0;
    min-height: 0;
    aspect-ratio: 1440 / 411;
    background-position: center;
    /* PNG's bottom corners are transparent — don't show the dark fallback. */
    background-color: transparent;
}

.mtic-page--videos .mtic-page-hero::before {
    content: none;
}

.mtic-page--videos .mtic-page-hero__inner {
    padding: 3.5rem var(--mtic-container-pad) 4.5rem;
}

.mtic-page--videos .mtic-page-hero__title {
    font-size: clamp(1.75rem, 4vw, 42px);
    line-height: 1;
    margin-bottom: 1.25rem;
}

/* White subtitle (overrides the component's teal), like the Library. */
.mtic-page--videos .mtic-page-hero__subtitle {
    color: var(--mtic-white);
    font-size: clamp(1.1rem, 2.5vw, 30px);
    font-weight: 400;
    line-height: 1.3;
    max-width: 520px;
    margin-bottom: 1.25rem;
}

.mtic-page--videos .mtic-page-hero__desc {
    font-size: 1.25rem;
    max-width: 420px;
    padding-top: 0.25rem;
}

/* Search bar — narrower soft-rounded rectangle instead of the base pill. */
.mtic-page--videos .mtic-page-search {
    margin-top: -32px;
}

.mtic-page--videos .mtic-page-search__form {
    max-width: 430px;
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(3, 47, 60, 0.18);
}

.mtic-page--videos .mtic-page-search__btn {
    border-radius: 0 8px 8px 0;
    min-width: 56px;
}

/* The page-search heading duplicates the grid section heading — hide it. */
.mtic-page--videos .mtic-page-search__heading {
    display: none;
}

.mtic-videos-grid__empty {
    padding: var(--mtic-spacing-xl) 0;
    color: var(--mtic-text-light);
    text-align: center;
    font-size: 1rem;
    grid-column: 1 / -1; /* span the whole grid when shown as the empty state */
}

/* ── Videos listing layout — grid + sidebar, matching the News filter pattern ── */
.mtic-videos-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: var(--mtic-spacing-lg);
    padding: var(--mtic-spacing-lg) 0 var(--mtic-spacing-xl);
}

.mtic-videos-page__main {
    min-width: 0;
}

.mtic-videos-grid {
    padding-bottom: var(--mtic-spacing-xl);
}

.mtic-videos-grid__items {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--mtic-spacing-md);
    margin-bottom: var(--mtic-spacing-lg);
}

/* ── Live-search loading state (see assets/js/live-search.js) ── */
.mtic-videos-grid__items.mtic-listing--loading {
    opacity: 0.55;
    transition: opacity 0.15s ease;
    pointer-events: none;
}


/* ── Videos Sidebar ── */
.mtic-videos-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--mtic-spacing-lg);
    align-self: start;
    position: sticky;
    top: var(--mtic-header-offset, 180px);
}

.mtic-videos-sidebar__search-row {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--mtic-border);
    border-radius: 6px;
    overflow: hidden;
    background: var(--mtic-white);
}

.mtic-videos-sidebar__search-input {
    flex: 1;
    min-width: 0;
    min-height: 48px;
    border: none;
    outline: none;
    padding: 0.65rem 0.9rem;
    font-family: var(--mtic-font-main);
    font-size: 0.9rem;
    color: var(--mtic-text);
    background: transparent;
}

.mtic-videos-sidebar__search-input::placeholder {
    color: var(--mtic-text-light);
}

.mtic-videos-sidebar__search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 48px;
    padding: 0 0.85rem;
    border: none;
    background: var(--mtic-primary);
    color: var(--mtic-white);
    cursor: pointer;
    transition: var(--mtic-transition);
    flex-shrink: 0;
}

.mtic-videos-sidebar__search-btn:hover {
    background: var(--mtic-dark);
}

.mtic-videos-sidebar__categories,
.mtic-videos-sidebar__years {
    background: var(--mtic-white);
    border: 1px solid var(--mtic-border);
    border-radius: 6px;
}

.mtic-videos-sidebar__filter-summary {
    display: flex;
    align-items: center;
    gap: var(--mtic-spacing-sm);
    min-height: 48px;
    padding: var(--mtic-spacing-md);
    cursor: pointer;
    list-style: none;
}

.mtic-videos-sidebar__filter-summary::-webkit-details-marker {
    display: none;
}

.mtic-videos-sidebar__filter-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--mtic-dark);
}

.mtic-videos-sidebar__filter-active {
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0.15rem 0.6rem;
    border-radius: 12px;
    background: rgba(1, 180, 150, 0.12);
    color: var(--mtic-primary);
    font-size: 0.8rem;
    font-weight: 600;
}

.mtic-videos-sidebar__filter-chevron {
    flex-shrink: 0;
    margin-left: auto;
    color: var(--mtic-text-light);
    line-height: 0;
    transition: transform 0.28s ease;
}

.mtic-videos-sidebar__filter[open] .mtic-videos-sidebar__filter-chevron {
    transform: rotate(180deg);
}

.mtic-videos-sidebar__filter-body {
    padding: 0 var(--mtic-spacing-md) var(--mtic-spacing-md);
    overflow: hidden;
}

.mtic-videos-sidebar__filter--animating .mtic-videos-sidebar__filter-body {
    overflow: hidden;
}

/* Progressive enhancement: native details animation when JS is unavailable */
@supports (interpolate-size: allow-keywords) {
    html:not(.mtic-videos-filters-js) .mtic-videos-sidebar__filter {
        interpolate-size: allow-keywords;
    }

    html:not(.mtic-videos-filters-js) .mtic-videos-sidebar__filter::details-content {
        height: 0;
        overflow: clip;
        opacity: 0;
        transition:
            height 0.28s ease,
            opacity 0.28s ease,
            content-visibility 0.28s allow-discrete;
        content-visibility: hidden;
    }

    html:not(.mtic-videos-filters-js) .mtic-videos-sidebar__filter[open]::details-content {
        height: auto;
        opacity: 1;
        content-visibility: visible;
    }
}

.mtic-videos-sidebar__cat-list,
.mtic-videos-sidebar__year-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mtic-videos-sidebar__cat-link,
.mtic-videos-sidebar__year-link {
    display: flex;
    align-items: center;
    gap: var(--mtic-spacing-sm);
    padding: 0.55rem 0.5rem;
    border-radius: 4px;
    color: var(--mtic-text);
    font-size: 0.9rem;
    text-decoration: none;
    transition: var(--mtic-transition);
}

.mtic-videos-sidebar__cat-link:hover,
.mtic-videos-sidebar__cat-item--active .mtic-videos-sidebar__cat-link,
.mtic-videos-sidebar__year-link:hover,
.mtic-videos-sidebar__year-item--active .mtic-videos-sidebar__year-link {
    background: var(--mtic-light);
    color: var(--mtic-primary);
}

.mtic-videos-sidebar__cat-icon {
    flex-shrink: 0;
    color: var(--mtic-text-light);
    display: flex;
    align-items: center;
}

.mtic-videos-sidebar__cat-item--active .mtic-videos-sidebar__cat-icon {
    color: var(--mtic-primary);
}

.mtic-videos-sidebar__cat-count,
.mtic-videos-sidebar__year-count {
    margin-left: auto;
    min-width: 1.6rem;
    padding: 0.1rem 0.55rem;
    border-radius: 12px;
    background: var(--mtic-light);
    color: var(--mtic-text-light);
    font-size: 0.8rem;
    text-align: center;
}

.mtic-videos-sidebar__cat-item--active .mtic-videos-sidebar__cat-count,
.mtic-videos-sidebar__year-item--active .mtic-videos-sidebar__year-count {
    background: var(--mtic-primary);
    color: var(--mtic-white);
}

@media (prefers-reduced-motion: reduce) {
    .mtic-videos-sidebar__filter-chevron {
        transition: none;
    }

    html:not(.mtic-videos-filters-js) .mtic-videos-sidebar__filter::details-content {
        transition: none;
    }
}

/* ── Single video item ── */
.mtic-video-item__trigger {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
}

.mtic-video-item__trigger:focus-visible {
    outline: 2px solid var(--mtic-primary);
    outline-offset: 2px;
}

.mtic-video-item__image-wrap {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--mtic-light);
    display: block;
}

.mtic-video-item__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

.mtic-video-item__play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.mtic-video-item__play-bg {
    fill: var(--mtic-primary);
}

.mtic-video-item__trigger:hover .mtic-video-item__img {
    transform: scale(1.03);
}

.mtic-video-item__meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 1.25rem;
    margin: 0.65rem 0 0.25rem;
    font-size: 0.78rem;
    line-height: 1.35;
}

.mtic-video-item__category {
    color: var(--mtic-primary);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
}

.mtic-video-item__category:hover {
    color: var(--mtic-primary-light);
}

.mtic-video-item__meta-sep,
.mtic-video-item__date {
    color: var(--mtic-text-light);
}

.mtic-video-item__title {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--mtic-dark);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.35;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ── Video lightbox ── */
body.mtic-video-lightbox-open {
    overflow: hidden;
}

.mtic-video-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mtic-video-lightbox[hidden] {
    display: none;
}

.mtic-video-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 47, 60, 0.88);
    cursor: pointer;
}

.mtic-video-lightbox__chrome {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2rem;
    pointer-events: none;
}

.mtic-video-lightbox__counter,
.mtic-video-lightbox__close {
    pointer-events: auto;
}

.mtic-video-lightbox__counter {
    margin: 0;
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.mtic-video-lightbox__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    padding: 0;
    border: none;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.45));
    transition: opacity 0.2s ease;
}

.mtic-video-lightbox__close:hover {
    opacity: 0.75;
}

.mtic-video-lightbox__stage {
    position: relative;
    z-index: 1;
    width: min(960px, 88vw);
    margin: 0 4.5rem;
}

.mtic-video-lightbox__iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    background: #000000;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35);
}

.mtic-video-lightbox__nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--mtic-white);
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.mtic-video-lightbox__nav:hover {
    opacity: 0.75;
}

.mtic-video-lightbox__nav--prev {
    left: 1.25rem;
}

.mtic-video-lightbox__nav--next {
    right: 1.25rem;
}

/* ── Centered pagination ── */
.mtic-page--videos .mtic-pagination ul {
    justify-content: center;
}

/* ── Responsive ── */
@media screen and (min-width: 768px) and (max-width: 1024px) {
    .mtic-videos-page {
        grid-template-columns: minmax(0, 1fr) 240px;
        gap: 1.25rem;
    }

    .mtic-videos-grid__items {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media screen and (max-width: 767px) {
    /* ── Hero text — compacted to fit the shorter mobile banner;
       mirrors the Digital Library mobile hero (library.css). Readability
       comes from text-shadow (an overlay would tint the transparent
       curve corners). ── */
    .mtic-page--videos .mtic-page-hero__inner {
        padding: 3rem var(--mtic-container-pad) 2.5rem;
    }

    .mtic-page--videos .mtic-page-hero__title {
        font-size: 1.25rem;
        line-height: 0.71;
        margin-bottom: 0.75rem;
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    }

    .mtic-page--videos .mtic-page-hero__subtitle {
        font-size: 0.85rem;
        line-height: 0;
        margin-bottom: 0.85rem;
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    }

    .mtic-page--videos .mtic-page-hero__desc {
        font-size: 0.72rem;
        line-height: 1.4;
        max-width: 19rem;
        text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
    }

    /* ── Search bar sits below the banner in normal flow, with the
       "Videos" heading above it. ── */
    .mtic-page--videos .mtic-page-search {
        margin-top: var(--mtic-spacing-md);
    }

    .mtic-page--videos .mtic-page-search__heading {
        display: block;
        font-size: 1.35rem;
        font-weight: 700;
        color: var(--mtic-primary);
        margin: 0 0 0.75rem;
    }

    /* Full-width rounded bar with an inset teal button. */
    .mtic-page--videos .mtic-page-search__form {
        max-width: 100%;
        padding: 5px;
        border-radius: 10px;
    }

    .mtic-page--videos .mtic-page-search__btn {
        border-radius: 8px;
    }

    /*--- Large-text accessibility mode only ---*/
    .mtic-text-large .mtic-page-search__form {
        display: flex;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    .mtic-text-large .mtic-page-search__input {
        flex: 1;
        min-width: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .mtic-text-large .mtic-page-search__btn {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }


    .mtic-videos-page {
        grid-template-columns: 1fr;
        gap: var(--mtic-spacing-md);
        padding-top: var(--mtic-spacing-md);
    }

    .mtic-videos-sidebar {
        order: -1;
        position: static;
        gap: 0;
    }

    .mtic-videos-sidebar__search {
        margin-bottom: 1.25rem;
        border: 1px solid var(--mtic-border);
        border-radius: 6px;
        background: var(--mtic-white);
    }

    .mtic-videos-sidebar__filter {
        border: 1px solid var(--mtic-border);
        border-radius: 8px;
        background-color: var(--mtic-white);
        box-shadow: 0 3px 14px rgba(0, 0, 0, 0.12);
    }

    .mtic-videos-sidebar__categories {
        margin-bottom: 1.25rem;
    }

    .mtic-videos-sidebar__filter-summary {
        padding: var(--mtic-spacing-sm) var(--mtic-spacing-md);
    }

    .mtic-videos-sidebar__filter-body {
        padding: 0 var(--mtic-spacing-md) var(--mtic-spacing-md);
    }

    .mtic-videos-sidebar__cat-list,
    .mtic-videos-sidebar__year-list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem 0.75rem;
    }

    .mtic-videos-sidebar__cat-icon {
        display: none;
    }

    .mtic-videos-sidebar__cat-link,
    .mtic-videos-sidebar__year-link {
        display: inline-flex;
        align-items: center;
        height: 32px;
        min-height: unset;
        padding: 0 0.75rem;
        border: 1px solid var(--mtic-primary);
        border-radius: 20px;
        font-size: 0.85rem;
    }

    .mtic-videos-sidebar__cat-link:hover,
    .mtic-videos-sidebar__cat-item--active .mtic-videos-sidebar__cat-link,
    .mtic-videos-sidebar__year-link:hover,
    .mtic-videos-sidebar__year-item--active .mtic-videos-sidebar__year-link {
        background-color: var(--mtic-primary) !important;
        color: var(--mtic-white) !important;
    }

    .mtic-videos-sidebar__cat-count,
    .mtic-videos-sidebar__year-count {
        margin-left: auto;
        background: var(--mtic-light);
        color: var(--mtic-text-light);
    }

    .mtic-videos-sidebar__cat-item--active .mtic-videos-sidebar__cat-count,
    .mtic-videos-sidebar__year-item--active .mtic-videos-sidebar__year-count {
        background-color: var(--mtic-white);
        color: var(--mtic-primary);
    }

    /* ── Single-column video list ── */
    .mtic-videos-grid__items {
        grid-template-columns: 1fr;
        gap: var(--mtic-spacing-md);
    }

    .mtic-video-lightbox__chrome {
        padding: 1rem;
    }

    .mtic-video-lightbox__stage {
        margin: 0 3rem;
        width: calc(100vw - 6rem);
    }

    .mtic-video-lightbox__nav {
        width: 2.25rem;
        height: 2.25rem;
    }

    .mtic-video-lightbox__nav--prev {
        left: 0.5rem;
    }

    .mtic-video-lightbox__nav--next {
        right: 0.5rem;
    }
}
