/* ==========================================
   RUNHAMS - VIDEO SWITCHER + CUSTOM PLAYER
   Used on the About page intro image area.
   Photo / Video toggle + a Runhams-styled
   player (poster thumbnail, centre play button,
   no timeline, sound on).
   Namespace: runhams-video-
   ========================================== */

/* ---- Photo / Video switcher ---- */
.runhams-video-switch {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.3rem;
    background-color: #f0f0f0;
    border-radius: 50px;
    margin-bottom: 1rem;
}

.runhams-video-switch-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: none;
    background: transparent;
    color: #555;
    font-family: 'Be Vietnam Pro', system-ui, sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.runhams-video-switch-btn i {
    font-size: 0.75rem;
}

.runhams-video-switch-btn:not(.is-active):hover {
    color: #d90f0f;
}

.runhams-video-switch-btn.is-active {
    background: linear-gradient(135deg, #ef3a3a 0%, #c41414 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(217, 15, 15, 0.25);
}

/* ---- Stage (fixed 16:9 box so the panes swap without the layout jumping) ---- */
.runhams-video-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    background-color: #000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.runhams-video-pane {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.runhams-video-pane.is-active {
    opacity: 1;
    visibility: visible;
}

/* ---- Photo pane ---- */
.runhams-video-pane-photo .runhams-video-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 0;
    box-shadow: none;
}

/* DBS seal sits bottom-right of the photo */
.runhams-video-pane-photo .runhams-dbs-seal {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    z-index: 3;
    display: block;
    line-height: 0;
}

.runhams-video-pane-photo .runhams-dbs-seal img {
    height: 88px;
    width: auto;
    display: block;
    border-radius: 0;
    box-shadow: none;
}

/* ---- Video pane / custom player ---- */
.runhams-video {
    position: absolute;
    inset: 0;
    background-color: #000;
    cursor: default;
}

/* when playing, clicking the frame pauses it */
.runhams-video[data-state="playing"] {
    cursor: pointer;
}

.runhams-video-el {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Centre play button (also carries a soft scrim for contrast) */
.runhams-video-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    padding: 0;
    cursor: pointer;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.30) 0%, rgba(0, 0, 0, 0) 60%);
    transition: opacity 0.25s ease;
}

/* hide the button while the video is playing */
.runhams-video[data-state="playing"] .runhams-video-play {
    opacity: 0;
    pointer-events: none;
}

.runhams-video-play-disc {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ef3a3a 0%, #c41414 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.runhams-video-play:hover .runhams-video-play-disc {
    transform: scale(1.07);
    box-shadow: 0 12px 30px rgba(217, 15, 15, 0.45);
}

.runhams-video-play-disc i {
    color: #fff;
    font-size: 1.9rem;
    margin-left: 5px; /* optical centring of the triangle */
}

/* ---- Playback control bar (timeline) — only visible while playing ---- */
.runhams-video-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 100%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.runhams-video[data-state="playing"] .runhams-video-controls {
    opacity: 1;
    pointer-events: auto;
}

.runhams-video-toggle {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, #ef3a3a 0%, #c41414 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.runhams-video-toggle:hover {
    transform: scale(1.08);
}

.runhams-video-toggle i {
    font-size: 0.9rem;
}

/* Seek slider — red fill driven by the --seek custom property */
.runhams-video-seek {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 6px;
    border-radius: 50px;
    outline: none;
    cursor: pointer;
    background: linear-gradient(to right,
        #ef3a3a 0%, #ef3a3a var(--seek, 0%),
        rgba(255, 255, 255, 0.4) var(--seek, 0%), rgba(255, 255, 255, 0.4) 100%);
}

.runhams-video-seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    cursor: pointer;
}

.runhams-video-seek::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border: none;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    cursor: pointer;
}

.runhams-video-seek::-moz-range-track {
    background: transparent;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .runhams-video-switch-btn {
        font-size: 0.8125rem;
        padding: 0.45rem 1rem;
    }
    .runhams-video-play-disc {
        width: 72px;
        height: 72px;
    }
    .runhams-video-play-disc i {
        font-size: 1.6rem;
    }
    .runhams-video-pane-photo .runhams-dbs-seal img {
        height: 72px;
    }
}

@media (max-width: 480px) {
    .runhams-video-play-disc {
        width: 62px;
        height: 62px;
    }
    .runhams-video-play-disc i {
        font-size: 1.4rem;
    }
    .runhams-video-pane-photo .runhams-dbs-seal {
        right: 0.75rem;
        bottom: 0.75rem;
    }
    .runhams-video-pane-photo .runhams-dbs-seal img {
        height: 58px;
    }
}
