/* Koinonia Media Hub 3.0.1 — Video Archive */
.kmh-video-archive {
    --kmh-video-text: #1b1b1b;
    --kmh-video-muted: #777;
    --kmh-video-line: #e6e6e6;
    --kmh-video-soft: #f7f7f5;
    background: #fff;
    color: var(--kmh-video-text);
}

.kmh-video-preview-bar {
    background: #fff8d8;
    border-bottom: 1px solid #eadb87;
    color: #514612;
    font-size: 13px;
    line-height: 1.5;
    padding: 10px 0;
}

.kmh-video-browser {
    padding: 28px 0 80px;
}

.kmh-video-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
}

.kmh-video-count {
    display: flex;
    align-items: baseline;
    gap: 8px;
    white-space: nowrap;
    color: var(--kmh-video-muted);
    flex: 0 0 auto;
}

.kmh-video-count strong {
    color: var(--kmh-video-text);
    font-size: 28px;
    line-height: 1;
    font-weight: 600;
}

.kmh-video-count span {
    font-size: 13px;
}

.kmh-video-filter {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1 1 auto;
}

.kmh-video-filter__field {
    position: relative;
}

.kmh-video-filter__field > label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
}

.kmh-video-filter select,
.kmh-video-filter input[type="search"],
.kmh-video-filter__apply,
.kmh-video-filter__reset {
    box-sizing: border-box;
    height: 40px;
    border-radius: 999px;
    font: inherit;
    font-size: 13px;
}

.kmh-video-filter select,
.kmh-video-filter input[type="search"] {
    border: 1px solid var(--kmh-video-line);
    background: #fff;
    color: #333;
    outline: none;
}

.kmh-video-filter select:focus,
.kmh-video-filter input[type="search"]:focus {
    border-color: #999;
}

.kmh-video-filter select {
    min-width: 142px;
    padding: 0 36px 0 14px;
}

.kmh-video-filter select:disabled {
    color: #aaa;
    background: #fafafa;
}

.kmh-video-filter__search input {
    width: 210px;
    padding: 0 16px;
    -webkit-appearance: none;
}

.kmh-video-filter__apply,
.kmh-video-filter__reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.kmh-video-filter__apply {
    border: 1px solid #1f1f1f;
    background: #1f1f1f;
    color: #fff;
}

.kmh-video-filter__apply:hover,
.kmh-video-filter__apply:focus {
    background: #333;
    color: #fff;
}

.kmh-video-filter__reset {
    border: 1px solid transparent;
    color: #666;
    background: transparent;
}

.kmh-video-filter__reset:hover,
.kmh-video-filter__reset:focus {
    color: #111;
}

.kmh-video-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 34px 26px;
}

.kmh-video-card {
    margin: 0;
    min-width: 0;
    background: transparent;
}

.kmh-video-card__media {
    position: relative;
    height: 0;
    padding-top: 56.25%;
    overflow: hidden;
    border-radius: 4px;
    background: #171717;
}

.kmh-video-card__play-area {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #171717;
    color: inherit;
    text-align: initial;
    cursor: pointer;
    overflow: hidden;
    -webkit-appearance: none;
    appearance: none;
}

.kmh-video-card__image,
.kmh-video-card__play-area > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform .45s cubic-bezier(.2,.7,.2,1), filter .25s ease;
}

.kmh-video-card__placeholder {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #282828, #111);
}

.kmh-video-card__shade {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.08);
    transition: background-color .25s ease;
}

.kmh-video-card__play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 58px;
    height: 58px;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,.94);
    box-shadow: 0 5px 24px rgba(0,0,0,.20);
    color: #1d1d1d;
    transition: transform .2s ease, background-color .2s ease;
}

.kmh-video-card__play svg {
    width: 25px;
    height: 25px;
    fill: currentColor;
    margin-left: 2px;
}

.kmh-video-card__play-area:hover .kmh-video-card__image,
.kmh-video-card__play-area:focus .kmh-video-card__image,
.kmh-video-card__play-area:hover > img,
.kmh-video-card__play-area:focus > img {
    transform: scale(1.035);
    filter: brightness(.90);
}

.kmh-video-card__play-area:hover .kmh-video-card__shade,
.kmh-video-card__play-area:focus .kmh-video-card__shade {
    background: rgba(0,0,0,.16);
}

.kmh-video-card__play-area:hover .kmh-video-card__play,
.kmh-video-card__play-area:focus .kmh-video-card__play {
    transform: translate(-50%, -50%) scale(1.06);
    background: #fff;
}

.kmh-video-card__play-area:focus-visible {
    outline: 2px solid #111;
    outline-offset: 3px;
}

.kmh-video-card__content {
    padding: 15px 2px 0;
}

.kmh-video-card__meta {
    margin-bottom: 6px;
    color: #959595;
    font-size: 10px;
    line-height: 1.45;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.kmh-video-card__content h2 {
    margin: 0;
    font-size: 18px;
    line-height: 1.32;
    font-weight: 500;
}

.kmh-video-card__content h2 a {
    color: #1c1c1c;
    text-decoration: none;
}

.kmh-video-card__content h2 a:hover,
.kmh-video-card__content h2 a:focus {
    color: #555;
}

.kmh-video-pagination {
    margin-top: 48px;
}

.kmh-video-pagination ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.kmh-video-pagination li {
    margin: 0;
}

.kmh-video-pagination a,
.kmh-video-pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    box-sizing: border-box;
    border: 1px solid var(--kmh-video-line);
    border-radius: 50%;
    color: #333;
    background: #fff;
    text-decoration: none;
}

.kmh-video-pagination .current,
.kmh-video-pagination a:hover {
    background: #1f1f1f;
    border-color: #1f1f1f;
    color: #fff;
}

.kmh-video-empty {
    padding: 70px 20px 90px;
    border-top: 1px solid var(--kmh-video-line);
    text-align: center;
}

.kmh-video-empty h2 {
    margin: 0 0 10px;
    font-size: 24px;
}

.kmh-video-empty p {
    margin: 0 0 18px;
    color: var(--kmh-video-muted);
}

.kmh-video-empty a {
    color: #111;
    text-decoration: underline;
}

/* Inline video viewer. It deliberately sits above Bridge's fixed header. */
.kmh-video-modal[hidden] {
    display: none !important;
}

.kmh-video-modal {
    position: fixed;
    inset: 0;
    z-index: 10000050;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 56px 72px 42px;
    background: rgba(8,8,8,.96);
    color: #fff;
}

html.kmh-video-modal-open,
html.kmh-video-modal-open body {
    overflow: hidden !important;
}

/*
 * Bridge 17.2 gives both .content and footer z-index:100, while the header is 110.
 * Because the modal lives inside .content, a footer that comes later in the DOM can
 * paint above the modal when the page is scrolled to the bottom. Raise ONLY the
 * content stacking context while the viewer is open: 109 keeps the entire modal
 * above the footer (100) but still below Bridge's header (110). No footer hiding,
 * no layout shift and the original stacking order is restored automatically on close.
 */
html.kmh-video-modal-open .content {
    z-index: 109 !important;
}

.kmh-video-modal__dialog {
    width: 100%;
    max-width: 1180px;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/*
 * Viewer chrome is deliberately separate from the Vimeo/YouTube iframe.
 * The close control sits in the free dark gutter to the RIGHT of the player
 * on desktop/tablet/landscape, so it can never cover native player controls.
 */
.kmh-video-modal__viewer {
    position: relative;
    width: 100%;
    max-width: 100%;
}

.kmh-video-modal__controls {
    position: absolute;
    top: 0;
    left: calc(100% + 12px);
    z-index: 8;
    width: 44px;
    height: 44px;
    pointer-events: auto;
}

.kmh-video-modal__stage {
    position: relative;
    width: 100%;
    height: 0;
    padding-top: 56.25%;
    background: #000;
    box-shadow: 0 18px 60px rgba(0,0,0,.45);
}

.kmh-video-modal__stage iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: #000;
}

.kmh-video-modal__footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    min-height: 46px;
}

.kmh-video-modal__copy {
    min-width: 0;
}

.kmh-video-modal__meta {
    margin-bottom: 4px;
    color: #aaa;
    font-size: 11px;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.kmh-video-modal__title {
    color: #fff;
    font-size: 18px;
    line-height: 1.35;
    font-weight: 500;
}

.kmh-video-modal__page {
    flex: 0 0 auto;
    color: #ddd;
    font-size: 12px;
    line-height: 1.4;
    text-decoration: none;
    white-space: nowrap;
}

.kmh-video-modal__page:hover,
.kmh-video-modal__page:focus {
    color: #fff;
}

.kmh-video-modal__close {
    position: relative;
    z-index: 1;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 50%;
    background: rgba(255,255,255,.08);
    color: #fff;
    box-shadow: none;
    line-height: 1;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transform: none;
    touch-action: manipulation;
}

.kmh-video-modal__close svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

.kmh-video-modal__close:hover,
.kmh-video-modal__close:focus {
    background: rgba(255,255,255,.16);
    color: #fff;
}

.kmh-video-modal__close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

@media (max-width: 1000px) {
    .kmh-video-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .kmh-video-filter {
        width: 100%;
        justify-content: flex-start;
    }

    .kmh-video-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kmh-video-modal {
        padding: 58px 24px 28px;
    }
}

@media (max-width: 680px) {
    .kmh-video-browser {
        padding: 22px 0 60px;
    }

    .kmh-video-toolbar {
        gap: 18px;
        margin-bottom: 24px;
    }

    .kmh-video-count strong {
        font-size: 25px;
    }

    .kmh-video-filter {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .kmh-video-filter__search {
        grid-column: 1 / -1;
    }

    .kmh-video-filter__search input,
    .kmh-video-filter select {
        width: 100%;
        min-width: 0;
    }

    .kmh-video-filter__apply {
        width: 100%;
    }

    .kmh-video-filter__reset {
        width: 100%;
    }

    .kmh-video-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .kmh-video-card__play {
        width: 54px;
        height: 54px;
    }

    .kmh-video-modal {
        padding: 18px 12px;
    }

    .kmh-video-modal__footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .kmh-video-modal__title {
        font-size: 16px;
    }
}

@media (max-width: 680px) and (orientation: portrait) {
    /*
     * Portrait phones have no spare horizontal gutter. Reserve a compact
     * toolbar ABOVE the player instead; the button remains outside the video.
     */
    .kmh-video-modal__viewer {
        box-sizing: border-box;
        padding-top: 50px;
    }

    .kmh-video-modal__controls {
        top: 0;
        left: auto;
        right: 0;
        width: 42px;
        height: 42px;
    }

    .kmh-video-modal__close {
        width: 42px;
        height: 42px;
    }
}

@media (orientation: landscape) and (max-height: 520px) {
    .kmh-video-modal {
        padding: 10px 64px 10px;
    }

    .kmh-video-modal__dialog {
        width: 100%;
        max-width: 900px;
        height: 100%;
        justify-content: center;
        gap: 6px;
    }

    .kmh-video-modal__stage {
        width: auto;
        height: calc(100vh - 20px);
        max-height: 100%;
        max-width: 100%;
        padding-top: 0;
        aspect-ratio: 16 / 9;
        align-self: center;
    }

    .kmh-video-modal__stage iframe {
        position: absolute;
    }

    .kmh-video-modal__footer {
        position: absolute;
        left: 68px;
        right: 68px;
        bottom: 8px;
        min-height: 0;
        pointer-events: none;
    }

    .kmh-video-modal__footer > * {
        pointer-events: auto;
    }

    .kmh-video-modal__meta {
        display: none;
    }

    .kmh-video-modal__title {
        max-width: 62vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 12px;
        text-shadow: 0 1px 6px #000;
    }

    .kmh-video-modal__viewer {
        padding-top: 0;
    }

    .kmh-video-modal__controls {
        top: 0;
        left: calc(100% + 10px);
        right: auto;
        width: 36px;
        height: 36px;
    }

    .kmh-video-modal__close {
        width: 36px;
        height: 36px;
    }
}
