/* FCA Media Hopper. Colours follow FluentCommunity's theme (and its dark mode)
   through its CSS variables, with plain fallbacks elsewhere. */

.fcamh {
    --fcamh-accent: var(--fcom-primary-button, #2563eb);
    --fcamh-text: var(--fcom-primary-text, #19283a);
    --fcamh-soft: var(--fcom-secondary-text, #525866);
    --fcamh-line: var(--fcom-primary-border, #e3e8ee);
    --fcamh-bg: var(--fcom-primary-bg, #fff);
    --fcamh-bg-2: var(--fcom-secondary-bg, #f5f7fa);
    --fcamh-radius: 8px;
    --fcamh-ratio: 16 / 9;
    box-sizing: border-box;
    width: 100%;
    max-width: var(--fcamh-max, none);
    margin-left: auto;
    margin-right: auto;
    color: var(--fcamh-text);
    container-type: inline-size;
}

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

.fcamh.alignwide,
.fcamh.alignfull {
    max-width: none;
}

.fcamh.is-style-rounded { --fcamh-radius: 16px; }
.fcamh.is-style-rounded .fcamh-stage { box-shadow: 0 10px 30px -12px rgba(15, 23, 42, .45); }

.fcamh.is-style-card {
    --fcamh-radius: 8px;
    padding: 12px;
    border: 1px solid var(--fcamh-line);
    border-radius: 12px;
    background: var(--fcamh-bg);
}

.fcamh.is-style-flat { --fcamh-radius: 0px; }
.fcamh.is-style-flat .fcamh-chapters,
.fcamh.is-style-flat .fcamh-transcript { border-radius: 0; }

/* ---------- player ---------- */

.fcamh-main {
    display: block;
}

.fcamh-stage {
    position: relative;
    width: 100%;
    aspect-ratio: var(--fcamh-ratio);
    overflow: hidden;
    border-radius: var(--fcamh-radius);
    background: #000;
}

.fcamh-target,
.fcamh-poster {
    position: absolute;
    inset: 0;
}

.fcamh-target > * {
    width: 100% !important;
    height: 100% !important;
}

.fcamh-poster {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #000;
    cursor: pointer;
    color: #fff;
    font: inherit;
    z-index: 2;
}

.fcamh-is-live .fcamh-poster {
    display: none;
}

.fcamh-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.fcamh-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, .72) 0%, rgba(0, 0, 0, .35) 22%, rgba(0, 0, 0, 0) 42%, rgba(0, 0, 0, 0) 72%, rgba(0, 0, 0, .35) 100%);
}

.fcamh-title {
    position: absolute;
    top: 14px;
    left: 16px;
    right: 16px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.35;
    text-align: left;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}

.fcamh-play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 68px;
    height: 68px;
    margin: -34px 0 0 -34px;
    border-radius: 50%;
    background: var(--fcamh-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
    transition: transform .15s ease;
}

.fcamh-play svg {
    width: 34px;
    height: 34px;
    margin-left: 4px;
}

.fcamh-poster:hover .fcamh-play,
.fcamh-poster:focus-visible .fcamh-play {
    transform: scale(1.08);
}

.fcamh-poster:focus-visible {
    outline: 3px solid var(--fcamh-accent);
    outline-offset: -3px;
}

.fcamh-length {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, .7);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.fcamh-is-loading .fcamh-play {
    animation: fcamh-pulse 1s ease-in-out infinite;
}

@keyframes fcamh-pulse {
    50% { opacity: .55; }
}

.fcamh-notice {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 56px;
    z-index: 3;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(17, 24, 39, .88);
    color: #fff;
    font-size: 14px;
    line-height: 1.45;
}

.fcamh-notice[hidden] {
    display: none;
}

.fcamh-notice a,
.fcamh-notice button {
    color: #fff;
    text-decoration: underline;
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    cursor: pointer;
}

/* ---------- chapters ---------- */

.fcamh-chapters {
    margin-top: 12px;
    border: 1px solid var(--fcamh-line);
    border-radius: 10px;
    background: var(--fcamh-bg);
    overflow: hidden;
}

.fcamh-panel-head {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--fcamh-soft);
    border-bottom: 1px solid var(--fcamh-line);
}

/* FC's lesson styles number and indent every list: not this one. */
.fcamh ol.fcamh-chapter-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 4px !important;
}

.fcamh ol.fcamh-chapter-list > li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.fcamh ol.fcamh-chapter-list > li::marker {
    content: none;
}

.fcamh-chapter {
    display: flex;
    align-items: baseline;
    gap: 12px;
    width: 100%;
    margin: 0;
    padding: 8px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--fcamh-text);
    font: inherit;
    font-size: 15px;
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
}

.fcamh-chapter:hover {
    background: var(--fcamh-bg-2);
}

.fcamh-chapter:focus-visible {
    outline: 2px solid var(--fcamh-accent);
    outline-offset: -2px;
}

.fcamh-time {
    flex: none;
    min-width: 3.4em;
    color: var(--fcamh-accent);
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.fcamh-chapter.is-current {
    background: color-mix(in srgb, var(--fcamh-accent) 12%, transparent);
    font-weight: 600;
}

/* Side by side: the list sits beside the video and scrolls within its height. */
.fcamh-layout-side .fcamh-main {
    display: grid;
    gap: 12px;
}

@container (min-width: 720px) {
    .fcamh-layout-side .fcamh-main {
        grid-template-columns: minmax(0, 1fr) 280px;
        align-items: stretch;
    }
    .fcamh-layout-side .fcamh-main > .fcamh-chapters {
        margin-top: 0;
        position: relative;
        display: flex;
        flex-direction: column;
    }
    .fcamh-layout-side .fcamh-main > .fcamh-chapters .fcamh-chapter-list {
        position: absolute;
        top: 41px;
        left: 0;
        right: 0;
        bottom: 0;
        overflow-y: auto;
    }
}

.fcamh-layout-side .fcamh-main > .fcamh-chapters {
    margin-top: 0;
}

/* Cards: a strip of thumbnails. */
.fcamh-layout-cards .fcamh-chapters {
    border: 0;
    background: transparent;
    overflow: visible;
}

.fcamh-layout-cards .fcamh-panel-head {
    padding: 0 0 8px;
    border: 0;
}

.fcamh.fcamh-layout-cards ol.fcamh-chapter-list {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(160px, 200px);
    gap: 12px;
    padding: 2px 2px 10px !important;
    overflow-x: auto;
    scroll-snap-type: x proximity;
}

.fcamh-layout-cards .fcamh-chapter {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 0 0 8px;
    border: 1px solid var(--fcamh-line);
    border-radius: 10px;
    background: var(--fcamh-bg);
    overflow: hidden;
    scroll-snap-align: start;
    font-size: 14px;
}

.fcamh-layout-cards .fcamh-chapter img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    background: #000;
}

.fcamh-layout-cards .fcamh-time,
.fcamh-layout-cards .fcamh-chapter-title {
    padding: 0 10px;
}

.fcamh-layout-cards .fcamh-chapter.is-current {
    border-color: var(--fcamh-accent);
    box-shadow: 0 0 0 1px var(--fcamh-accent);
}

/* ---------- transcript ---------- */

.fcamh-transcript {
    margin-top: 12px;
    border: 1px solid var(--fcamh-line);
    border-radius: 10px;
    background: var(--fcamh-bg);
}

.fcamh-transcript > summary {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--fcamh-soft);
    cursor: pointer;
}

.fcamh-transcript[open] > summary {
    border-bottom: 1px solid var(--fcamh-line);
}

.fcamh-transcript-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    padding: 10px 14px 0;
}

.fcamh-search {
    flex: 1 1 200px;
    min-width: 0;
    padding: 7px 10px;
    border: 1px solid var(--fcamh-line);
    border-radius: 6px;
    background: var(--fcamh-bg);
    color: var(--fcamh-text);
    font: inherit;
    font-size: 14px;
}

.fcamh-count,
.fcamh-follow {
    font-size: 13px;
    color: var(--fcamh-soft);
}

.fcamh-follow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.fcamh-transcript-body {
    max-height: 320px;
    overflow-y: auto;
    padding: 10px 14px 14px;
    font-size: 15px;
    line-height: 1.65;
}

.fcamh-transcript-body p {
    margin: 0 0 10px;
}

.fcamh-stamp {
    margin: 0 8px 0 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--fcamh-accent);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}

.fcamh-cue {
    cursor: pointer;
    border-radius: 3px;
}

.fcamh-cue:hover {
    background: var(--fcamh-bg-2);
}

.fcamh-cue.is-now {
    background: color-mix(in srgb, var(--fcamh-accent) 18%, transparent);
}

.fcamh-cue.is-match {
    background: #fde68a;
    color: #111827;
}

/* ---------- caption ---------- */

.fcamh .fcamh-caption {
    margin: 8px 0 0;
    font-size: 14px;
    color: var(--fcamh-soft);
    text-align: center;
}

/* No script (or an old copy): the saved link. */
.fcamh:not(.fcamh-ready) .fcamh-stage {
    display: flex;
    align-items: center;
    justify-content: center;
}

.fcamh-fallback {
    color: #fff;
}

@container (max-width: 480px) {
    .fcamh-title { font-size: 15px; }
    .fcamh-play { width: 56px; height: 56px; margin: -28px 0 0 -28px; }
    .fcamh-play svg { width: 28px; height: 28px; }
    .fcamh-transcript-body { max-height: 260px; }
}
