/**
 * eafps_public_videos — public-facing styles.
 *
 * Same design tokens as eafps_videos (parme/turquoise/navy) so the two
 * libraries look like siblings of the same site, but the layout is
 * simpler: no searchbar, just sidebar (hierarchical tree) + grid.
 */

.eafps-pv {
    --eafps-pv-turquoise: #4BC1D0;
    --eafps-pv-turquoise-dark: #08AEC0;
    --eafps-pv-marine: #272E47;
    --eafps-pv-parme-clair: #E3E9F6;
    --eafps-pv-parme-tres-clair: #F6F7FF;
    --eafps-pv-contour-champs: #DCE4F5;
    --eafps-pv-muted: #667085;
    --eafps-pv-pill-bg: #272E47;

    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--eafps-pv-marine);
    display: flex;
    flex-direction: column;
    gap: 32px;
    width: 100%;
    box-sizing: border-box;
}
.eafps-pv *,
.eafps-pv *::before,
.eafps-pv *::after { box-sizing: border-box; }

/* ── Layout ────────────────────────────────── */
.eafps-pv__layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    align-items: start;
}
.eafps-pv__main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* ── Sidebar ───────────────────────────────── */
.eafps-pv__sidebar {
    background: var(--eafps-pv-parme-tres-clair);
    border: 1px solid var(--eafps-pv-parme-clair);
    border-radius: 12px;
    padding: 24px 20px;
    align-self: start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    z-index: 1;
}
.eafps-pv__sidebar-title {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--eafps-pv-marine);
    margin: 0 0 12px;
}
.eafps-pv__sidebar-empty {
    color: var(--eafps-pv-muted);
    font-style: italic;
    font-size: 14px;
    margin: 0;
}

/* ── Hierarchical category tree ──────────── */
.eafps-pv__tree,
.eafps-pv__tree-children {
    list-style: none !important;
    list-style-type: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
.eafps-pv__tree-item,
.eafps-pv__tree-item::before,
.eafps-pv__tree-item::marker {
    list-style: none !important;
    content: none !important;
}
.eafps-pv__tree-item {
    margin: 0 !important;
    padding: 0 !important;
}

/* Nested children are slightly indented; depth=0 (top-level) has no inset. */
.eafps-pv__tree-children {
    margin-left: 24px !important;
    border-left: 1px dashed var(--eafps-pv-parme-clair);
    padding-left: 8px !important;
}

.eafps-pv__tree-row {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 4px;
    border-radius: 6px;
    transition: background .12s ease;
}
.eafps-pv__tree-row:hover { background: rgba(255, 255, 255, 0.6); }

/* Caret toggle button (▸ collapsed / ▾ expanded). */
.eafps-pv__tree-toggle {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    color: var(--eafps-pv-turquoise-dark);
    line-height: 1;
}
.eafps-pv__tree-caret {
    display: inline-block;
    font-size: 12px;
    transition: transform .15s ease;
    transform-origin: center;
}
.eafps-pv__tree-item.is-open > .eafps-pv__tree-row > .eafps-pv__tree-toggle .eafps-pv__tree-caret {
    transform: rotate(90deg);
}
.eafps-pv__tree-spacer {
    flex: 0 0 22px;
    width: 22px;
}

.eafps-pv__tree-label {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.2;
    color: var(--eafps-pv-marine);
}
.eafps-pv__tree-checkbox {
    appearance: auto;
    -webkit-appearance: auto;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    accent-color: var(--eafps-pv-turquoise);
    cursor: pointer;
    margin: 0;
    padding: 0;
    border-radius: 3px;
}
.eafps-pv__tree-name { flex: 1 1 auto; }
.eafps-pv__tree-count {
    color: var(--eafps-pv-muted);
    font-size: 13px;
    font-weight: 300;
}

/* ── Grid ──────────────────────────────────── */
.eafps-pv__grid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 40px;
    align-self: stretch;
    position: relative;
}
.eafps-pv__grid > .eafps-pv__card {
    flex: 0 1 calc((100% - (var(--eafps-pv-columns, 3) - 1) * 40px) / var(--eafps-pv-columns, 3));
    min-width: 260px;
}
.eafps-pv__grid.is-loading { opacity: .55; pointer-events: none; transition: opacity .15s; }
.eafps-pv__empty {
    flex: 1 1 100%;
    text-align: center;
    color: var(--eafps-pv-muted);
    font-style: italic;
    padding: 40px 0;
}

/* ── Card ──────────────────────────────────── */
/* Aspect ratio matches YouTube/Vimeo native 16:9 so we use the full thumbnail
   without any letterboxing. Cover is a real <img> (object-fit:cover) — a
   ::before pseudo paints the dark gradient overlay above it; the title sits
   on top via z-index. */
.eafps-pv button.eafps-pv__card,
.eafps-pv button.eafps-pv__card:hover,
.eafps-pv button.eafps-pv__card:focus,
.eafps-pv button.eafps-pv__card:active,
.eafps-pv button.eafps-pv__card:focus-visible {
    border: 0 !important;
    border-radius: 18px !important;
    padding: 0 !important;
    margin: 0 !important;
    background-color: #cfd3dd !important;
    color: #fff !important;
    font: inherit !important;
    font-weight: 400 !important;
    text-transform: none !important;
    text-decoration: none !important;
    letter-spacing: normal !important;
    line-height: 1 !important;
    height: auto !important;
    min-height: 0 !important;
    box-shadow: 0 4px 20px rgba(39, 46, 71, 0.10);
    outline: 0;
    transform: none;
}
.eafps-pv button.eafps-pv__card {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;            /* native YouTube/Vimeo ratio */
    overflow: hidden;
    text-align: left;
    cursor: pointer;
    transition: transform .25s ease, box-shadow .25s ease;
}
.eafps-pv__card-cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    z-index: 0;
}
.eafps-pv button.eafps-pv__card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(39, 46, 71, 0.17) 0%, rgba(39, 46, 71, 0.70) 100%);
    pointer-events: none;
    z-index: 1;
}
.eafps-pv button.eafps-pv__card:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 10px 30px rgba(39, 46, 71, 0.18);
}
.eafps-pv button.eafps-pv__card.is-active {
    box-shadow: 0 0 0 3px var(--eafps-pv-turquoise), 0 10px 30px rgba(39, 46, 71, 0.18);
}
.eafps-pv__card-body {
    position: absolute;
    left: 22px;
    right: 22px;
    bottom: 20px;
    color: #fff;
    z-index: 2;
}
.eafps-pv__card-title {
    display: block;
    color: #FFF;
    font-family: 'Butler', 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
    font-size: 24px;
    font-weight: 400;
    line-height: normal;
    margin: 0;
}

/* ── Player panel (same logic as eafps_videos, simpler) ──────────── */
.eafps-pv__player-panel {
    flex: 0 0 100%;
    width: 100%;
    background: #FFF;
    border: 1px solid var(--eafps-pv-parme-clair);
    border-radius: 18px;
    padding: 24px;
    position: relative;
    box-shadow: 0 8px 30px rgba(39, 46, 71, 0.12);
    order: 0;
}
.eafps-pv__player-panel[hidden] { display: none !important; }
.eafps-pv__player-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--eafps-pv-parme-tres-clair);
    border: 1px solid var(--eafps-pv-parme-clair);
    border-radius: 50%;
    color: var(--eafps-pv-marine);
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
    z-index: 2;
}
.eafps-pv__player-close:hover {
    background: var(--eafps-pv-turquoise);
    color: #FFF;
    border-color: var(--eafps-pv-turquoise);
}
.eafps-pv__player-frame {
    aspect-ratio: 16 / 9;
    width: 100%;
    max-width: calc(75vh * 16 / 9);
    max-height: 75vh;
    margin: 0 auto;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}
.eafps-pv__player-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #000;
}
.eafps-pv__player-title {
    margin: 18px 0 0;
    font-family: 'Butler', 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
    font-size: 26px;
    font-weight: 400;
    color: var(--eafps-pv-marine);
    line-height: 1.2;
    padding-right: 56px;
}

/* ── Load more ─────────────────────────────── */
.eafps-pv__more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}
.eafps-pv .eafps-pv__more-btn,
.eafps-pv button.eafps-pv__more-btn {
    background: var(--eafps-pv-pill-bg) !important;
    color: #FFF !important;
    border: 0 !important;
    border-radius: 999px !important;
    padding: 16px 36px !important;
    font-family: 'Inter', system-ui, sans-serif !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: normal !important;
    letter-spacing: normal !important;
    text-transform: uppercase !important;
    cursor: pointer;
    transition: background-color .15s ease, transform .15s ease;
    box-shadow: none !important;
    text-shadow: none !important;
    height: auto !important;
    min-height: 0 !important;
}

/* ── Responsive ────────────────────────────── */
@media (max-width: 1100px) {
    .eafps-pv__layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .eafps-pv__sidebar {
        max-height: none;
        overflow: visible;
        transform: none !important;
    }
    .eafps-pv__grid { gap: 32px; }
    .eafps-pv__grid > .eafps-pv__card {
        flex-basis: calc((100% - 32px) / 2);
    }
}
@media (max-width: 700px) {
    .eafps-pv__grid > .eafps-pv__card { flex-basis: 100%; }
    .eafps-pv__card-title { font-size: 22px; }
}
