.video-library {
    --video-purple: #512c85;
    --video-dark: #34214e;
    --video-text: #393140;
    --video-muted: #655a73;
    --video-surface: #f7f3fb;
    --video-line: #e4dcec;
    --video-accent: #eee132;
    display: flow-root;
    color: var(--video-text);
    background: var(--video-surface);
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.video-library *,
.video-library *::before,
.video-library *::after {
    box-sizing: border-box;
}

.video-library .video-library__container {
    float: none;
    max-width: 100%;
    margin-inline: auto;
}

.video-library__header {
    float: none;
    padding: clamp(1.75rem, 3.5vw, 3rem) 0;
    background: var(--video-dark);
    color: #fff;
    box-shadow: inset 0 -3px var(--video-accent);
}

.video-library__breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 0 0 clamp(1rem, 2vw, 1.5rem);
    color: #e4d8ef;
    font-size: 0.9rem;
}

.video-library__breadcrumb a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.video-library h1,
.video-library h2,
.video-library h3 {
    float: none;
    width: auto;
    margin: 0;
    padding: 0;
    color: var(--video-purple);
    font-family: "Domine", Georgia, serif;
    line-height: 1.2;
}

.video-library h1 {
    max-width: 27ch;
    color: #fff;
    font-size: clamp(2rem, 5vw, 3.75rem);
}

.video-library h2 {
    font-size: clamp(1.55rem, 3vw, 2.3rem);
}

.video-library h3 {
    font-size: 1.35rem;
}

.video-library__date {
    margin: 0 0 0.65rem;
    color: #e4d8ef;
    font-size: 0.95rem;
    font-weight: 600;
}

.video-library__intro {
    max-width: 65ch;
    margin: 1rem 0 0;
    color: #f1e9f7;
    white-space: pre-line;
}

.video-library__body {
    display: flow-root;
    padding-top: 40px;
    padding-bottom: clamp(1.75rem, 4vw, 3.25rem);
}

.video-library[data-video-library] .video-library__body {
    padding-bottom: 40px;
}

.video-library__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(1rem, 2.5vw, 1.75rem);
    margin-top: 1.25rem;
}

.video-library__card {
    min-width: 0;
    background: #fff;
    border: 1px solid var(--video-line);
    border-radius: 0.75rem;
}

.video-library__card--collection {
    border-block-start: 3px solid var(--video-purple);
}

.video-library__card--no-cover {
    align-self: start;
}

.video-library__card--featured {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 4fr);
    align-items: center;
    gap: clamp(1rem, 3vw, 2rem);
    padding: clamp(1rem, 3vw, 1.5rem);
    border-block-start: 3px solid var(--video-purple);
}

.video-library__card-body {
    padding: 1.25rem;
}

.video-library__card--featured .video-library__card-body {
    padding: 0;
}

.video-library__label {
    margin: 0 0 0.65rem;
    color: var(--video-purple);
    font-size: 0.9rem;
    font-weight: 700;
}

.video-library__meta {
    margin: 0.6rem 0 0;
    color: var(--video-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.video-library__meta:first-child {
    margin: 0 0 0.45rem;
}

.video-library__description {
    margin: 0.65rem 0 0;
    font-size: 1rem;
    white-space: pre-line;
}

.video-library__sessions {
    margin-top: clamp(2.25rem, 5vw, 4rem);
}

.video-library__empty {
    margin: 1rem 0 0;
}

.video-library__collection-cover,
.video-library__poster {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    background-color: var(--video-dark);
    border-radius: 0.7rem 0.7rem 0 0;
}

.video-library__collection-cover {
    aspect-ratio: 2 / 1;
}

.video-library__card--featured .video-library__poster {
    border-radius: 0.45rem;
}

.video-library__collection-cover img,
.video-library__poster img,
.video-library__frame iframe,
.video-library__frame video {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: inherit;
}

.video-library__frame video {
    object-fit: contain;
}

.video-library__collection-cover img,
.video-library__poster img {
    object-fit: cover;
}

.video-library__poster {
    display: grid;
    place-items: center;
    width: 100%;
    padding: 0;
    border: 0;
    font: inherit;
    cursor: pointer;
}

.video-library__play {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 1rem;
    border-radius: 2rem;
    background: var(--video-accent);
    color: var(--video-dark);
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 2px 12px rgb(30 17 42 / 30%);
}

.video-library__play::before {
    content: "";
    border: 0.32rem solid transparent;
    border-right: 0;
    border-left: 0.52rem solid currentColor;
}

.video-library__poster:hover .video-library__play {
    background: #fff;
}

.video-library__runtime {
    position: absolute;
    right: 0.65rem;
    bottom: 0.65rem;
    padding: 0.1rem 0.45rem;
    border-radius: 0.25rem;
    background: var(--video-dark);
    color: #fff;
    font-size: 0.78rem;
}

.video-library__downloads a,
.video-library__collection-link {
    color: var(--video-purple);
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.video-library__card-body a:hover {
    color: var(--video-dark);
}

.video-library__dialog {
    width: min(60rem, calc(100% - 2rem));
    width: min(60rem, calc(100% - 2rem), max(18rem, calc((100dvh - 7rem) * 16 / 9)));
    max-height: calc(100% - 2rem);
    margin: auto;
    padding: 0;
    border: 0;
    border-top: 3px solid var(--video-accent);
    border-radius: 0.75rem;
    background: var(--video-surface);
    color: var(--video-text);
    box-shadow: 0 1.25rem 4rem rgb(21 11 32 / 38%);
}

.video-library__dialog::backdrop {
    background: rgb(28 16 43 / 78%);
}

html:has(.video-library__dialog[open]) {
    overflow: hidden;
}

.video-library__dialog-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    padding: 0.75rem 1rem;
}

.video-library .video-library__dialog-title {
    font-size: clamp(1.15rem, 3vw, 1.6rem);
}

.video-library__dialog-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.video-library__dialog-exit {
    color: var(--video-purple);
    font-size: 0.9rem;
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.video-library__close {
    min-height: 2.75rem;
    padding: 0.3rem 0.8rem;
    border: 1px solid var(--video-purple);
    border-radius: 0.35rem;
    background: var(--video-purple);
    color: #fff;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.video-library__close:hover {
    background: var(--video-dark);
}

.video-library__frame {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
}

.video-library__downloads {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.1rem;
    margin-top: 0.85rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.video-library :focus-visible {
    outline: 3px solid var(--video-purple);
    outline-offset: 3px;
}

.video-library__header a:focus-visible {
    outline-color: var(--video-accent);
}

@media (max-width: 992px) {
    .video-library .video-library__container {
        padding-inline: 1rem;
    }
}

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

@media (max-width: 640px) {
    .video-library__grid,
    .video-library__card--featured {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .video-library a {
        transition: none;
    }
}
