/*
 * Thoughts About God — MFM Video Collections v6.0
 * Scope: /videos/mfm/ and descendant collection pages.
 * Shared route isolation, MFM navigation, focus and reduced-motion rules live
 * in tag-resource-library.css.
 */

.tagvl-tools {
    margin: 0 0 1rem;
    padding: 14px;
    border: 1px solid var(--tagvl-border);
    border-radius: var(--tagvl-radius);
    background: var(--tagvl-cream);
}
.tagvl-search label { display: block; margin: 0 0 .45rem; color: var(--tagvl-navy); font-size: .86rem; font-weight: 800; }
.tagvl-search__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
.tagvl-search input[type="search"] {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 9px 13px;
    border: 1px solid #ccc4b8;
    border-radius: 9px;
    background: #fff;
    color: var(--tagvl-brown);
}
.tagvl-search input[type="search"]:focus { border-color: var(--tagvl-gold); box-shadow: 0 0 0 3px rgba(183,139,50,.18); outline: 0; }

.tagvl-button,
.tagvl-filter {
    appearance: none;
    min-height: 42px;
    padding: 8px 13px;
    border: 1px solid var(--tagvl-border);
    border-radius: 9px;
    background: #fff;
    color: var(--tagvl-navy);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}
.tagvl-button:hover,
.tagvl-button:focus-visible { border-color: var(--tagvl-navy); background: var(--tagvl-navy); color: #fff; }
.tagvl-filters { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.tagvl-filter { min-height: 36px; border-radius: 999px; font-size: .83rem; }
.tagvl-filter:hover,
.tagvl-filter:focus-visible,
.tagvl-filter.is-active,
.tagvl-filter[aria-pressed="true"] { border-color: var(--tagvl-burgundy); background: var(--tagvl-burgundy); color: #fff; }

.tagvl-summary { display: flex; justify-content: flex-end; margin: 0 0 .75rem; color: var(--tagvl-muted); font-size: .88rem; font-weight: 800; }

.tagvl-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.tagvl-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--tagvl-border);
    border-radius: var(--tagvl-radius);
    background: #fff;
    box-shadow: 0 4px 16px rgba(38,31,27,.045);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.tagvl-card:hover {
    transform: translateY(-2px);
    border-color: rgba(122,38,50,.30);
    box-shadow: var(--tagvl-shadow);
}

.tagvl-card__media {
    position: relative;
    display: grid;
    min-height: 190px;
    aspect-ratio: 16 / 9;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 28% 24%, rgba(183,139,50,.16), transparent 34%),
        linear-gradient(145deg, #172833, #0d1419 72%);
}

.tagvl-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    min-height: 48px;
    padding: .7rem 1rem;
    border: 2px solid rgba(255,255,255,.92);
    border-radius: 999px;
    background: rgba(122,38,50,.90);
    box-shadow: 0 8px 22px rgba(0,0,0,.22);
    color: #fff;
    font-weight: 850;
    text-decoration: none;
}
.tagvl-play:hover,
.tagvl-play:focus-visible { background: #5f1c26; color: #fff; }
.tagvl-play__mark { width: 0; height: 0; border-top: 7px solid transparent; border-bottom: 7px solid transparent; border-left: 11px solid currentColor; }

.tagvl-card__body { display: flex; flex: 1 1 auto; flex-direction: column; padding: 1rem 1.05rem 1.15rem; }
.tagvl-card__category { margin: 0 0 .4rem; color: var(--tagvl-burgundy); font-size: .72rem; font-weight: 850; letter-spacing: .065em; text-transform: uppercase; }
.tagvl-card__title { margin: 0 0 .9rem; color: var(--tagvl-navy); font-size: 1.06rem; line-height: 1.35; overflow-wrap: anywhere; }
.tagvl-card__direct { margin-top: auto; font-size: .88rem; }

.tagvl-empty { margin-top: 1rem; padding: 1.25rem; border: 1px dashed rgba(63,49,39,.32); border-radius: var(--tagvl-radius); background: var(--tagvl-paper); text-align: center; }
.tagvl-empty h3,
.tagvl-empty p { margin-top: 0; }
.tagvl-empty p:last-child { margin-bottom: 0; }
.tagvl-admin-notice { padding: .8rem 1rem; border-left: 4px solid var(--tagvl-burgundy); background: #fff8f8; }

/* Shared MFM modal used by all sub-collections. */
/* Critical self-contained state guard: do not rely on another stylesheet to hide it. */
.tagvl-modal[hidden],
.tagvl-modal[aria-hidden="true"] {
    display: none !important;
}

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

.tagvl-modal {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    display: grid;
    place-items: center;
    padding: 20px;
}
.tagvl-modal__backdrop { position: absolute; inset: 0; background: rgba(5,10,14,.80); backdrop-filter: blur(4px); }
.tagvl-modal__dialog {
    position: relative;
    z-index: 1;
    display: flex;
    width: min(1100px, 100%);
    max-height: min(92dvh, 900px);
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 16px;
    background: #0e161d;
    box-shadow: 0 30px 80px rgba(0,0,0,.46);
    color: #fff;
}
.tagvl-modal__header { padding: 18px 62px 14px 20px; border-bottom: 1px solid rgba(255,255,255,.1); background: #111d27; }
.tagvl-modal__header .tagvl-eyebrow { color: #d8ae54; }
.tagvl-modal__title { margin: 0; color: #fff; font-size: clamp(1.15rem, 2vw, 1.55rem); line-height: 1.3; }
.tagvl-modal__close {
    position: absolute;
    z-index: 3;
    top: 12px;
    right: 12px;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 50%;
    background: rgba(255,255,255,.08);
    color: #fff;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
}
.tagvl-modal__close:hover,
.tagvl-modal__close:focus-visible { border-color: var(--tagvl-burgundy, #7a2632); background: var(--tagvl-burgundy, #7a2632); }
.tagvl-modal__actions { display: flex; flex-wrap: wrap; gap: 9px; justify-content: flex-end; padding: 12px 16px 14px; border-top: 1px solid rgba(255,255,255,.1); background: #111d27; }
.tagvl-modal__actions .tagvl-card__direct,
.tagvl-modal__actions .tagvl-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 14px; border-radius: 9px; }
.tagvl-modal__actions .tagvl-card__direct { border: 1px solid #fff; color: #fff; }
.tagvl-modal__actions .tagvl-button { border-color: #fff; }

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

@media (max-width: 680px) {
    .tagvl-library { margin: 1.5rem auto; }
    .tagvl-grid { grid-template-columns: 1fr; }
    .tagvl-search__row { grid-template-columns: 1fr; }
    .tagvl-button { width: 100%; }
    .tagvl-card__media { min-height: 165px; }

    .tagvl-modal { padding: 0; }
    .tagvl-modal__dialog { width: 100%; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
    .tagvl-modal__header { padding: 15px 56px 12px 15px; }
    .tagvl-modal__player { max-height: calc(100dvh - 145px); }
    .tagvl-modal__actions { display: grid; grid-template-columns: 1fr 1fr; }
    .tagvl-modal__actions .tagvl-card__direct,
    .tagvl-modal__actions .tagvl-button { width: 100%; }
}

@media (max-width: 430px) {
    .tagvl-modal__actions { grid-template-columns: 1fr; }
}

.tagvl-button--secondary { background: #fff; color: var(--tagvl-navy); }
.tagvl-empty--static { margin-top: 0; }

/* ========================================================================== 
   v5.0 production isolation for /videos/mfm/* collection pages
   ========================================================================== */
/* Collection component provides its own semantic hero/title. */
body.tag-video-collection-page .tag-reading-article--page > .tag-reading-header,
body.tag-video-collection-page .tag-reading-article--page > .tag-reading-featured,
body.tag-video-collection-page .tag-reading-article--page > .tag-reading-footer {
    display: none !important;
}

body.tag-video-collection-page .tag-reading-article--page,
body.tag-video-collection-page .tag-reading-content {
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.tag-video-collection-page .tag-reading-content > :first-child {
    margin-top: 0 !important;
}

body.tag-video-collection-page .tagvl-library {
    margin-top: clamp(24px, 4vw, 48px);
    margin-bottom: clamp(48px, 7vw, 84px);
}

.tagvl-modal__player-wrap {
    position: relative;
    display: grid;
    flex: 1 1 auto;
    min-height: 260px;
    place-items: center;
    background: #050708;
}

.tagvl-modal__player {
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: min(72vh, 760px);
    aspect-ratio: 16 / 9;
    object-fit: contain;
    background: #000;
}

.tagvl-modal__status {
    position: absolute;
    left: 50%;
    bottom: 12px;
    z-index: 2;
    max-width: calc(100% - 32px);
    margin: 0;
    padding: 7px 10px;
    transform: translateX(-50%);
    border-radius: 8px;
    background: rgba(0, 0, 0, .72);
    color: #fff;
    font-size: .78rem;
    line-height: 1.35;
    text-align: center;
    pointer-events: none;
}

.tagvl-modal__status:empty { display: none; }
.tagvl-modal__status[data-state="error"] { background: rgba(122, 38, 50, .95); }
.tagvl-modal__status[data-state="success"] { background: rgba(32, 90, 62, .95); }

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

@media (max-width: 640px) {
    .tagvl-grid {
        grid-template-columns: 1fr;
    }

    .tagvl-search__row {
        grid-template-columns: 1fr;
    }

    .tagvl-search input,
    .tagvl-button,
    .tagvl-filter {
        min-height: 44px;
    }

    .tagvl-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: thin;
    }

    .tagvl-filter {
        flex: 0 0 auto;
    }

    .tagvl-modal {
        padding: 0;
    }

    .tagvl-modal__dialog {
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border: 0;
        border-radius: 0;
    }

    .tagvl-modal__player-wrap {
        flex: 1 1 auto;
        min-height: 0;
    }

    .tagvl-modal__player {
        max-height: none;
    }

    .tagvl-modal__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .tagvl-modal__actions > * {
        width: 100%;
    }
}

@media (max-width: 420px) {
    .tagvl-modal__actions {
        grid-template-columns: 1fr;
    }
}


/* v7 visual hardening: collection metadata, full-width shell and modal consistency. */
.tagvl-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: .38rem;
    margin: -.35rem 0 .85rem;
    color: var(--tagvl-muted);
    font-size: .76rem;
    font-weight: 700;
}
body.tag-video-collection-page .tag-video-collection-page-main {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
body.tag-video-collection-page .tagvl-library {
    width: min(1440px, calc(100% - 40px));
    max-width: none !important;
}
.tagvl-modal[hidden],
.tagvl-modal[aria-hidden="true"] { display: none !important; }
body .tagvl-modal .tagvl-modal__dialog {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: min(1040px, calc(100vw - 40px));
    height: auto;
    max-height: calc(100dvh - 40px);
}
body .tagvl-modal .tagvl-modal__header {
    min-height: 92px;
    padding: 18px 70px 16px 22px;
}
body .tagvl-modal .tagvl-modal__title,
body .tagvl-modal .tagvl-modal__header h2 {
    margin: 0 !important;
    color: #fff !important;
    font-size: clamp(1.15rem, 2.1vw, 1.7rem) !important;
    line-height: 1.22 !important;
    letter-spacing: -.01em;
}
body .tagvl-modal .tagvl-modal__player-wrap {
    min-height: 0;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}
body .tagvl-modal .tagvl-modal__player {
    width: 100%;
    height: 100%;
    max-height: min(68dvh, 680px);
    aspect-ratio: 16 / 9;
    object-fit: contain;
}
body .tagvl-modal .tagvl-modal__actions {
    position: relative;
    z-index: 2;
    min-height: 64px;
    align-items: center;
}
@media (max-width: 640px) {
    body .tagvl-modal .tagvl-modal__dialog { width: 100vw; height: 100dvh; max-height: 100dvh; }
    body .tagvl-modal .tagvl-modal__player-wrap { aspect-ratio: auto; }
}
