:root {
    font-family: system-ui, Segoe UI, Arial, sans-serif;
    color: #172033;
    background: #f5f7fb;
}

body { margin: 0; }
h1 { margin-bottom: 4px; }
.intro { margin-top: 0; color: #536079; }

.status-panel, .log-panel {
    background: white;
    border: 1px solid #d8deea;
    border-radius: 14px;
    padding: 14px 16px;
    margin: 16px 0;
    box-shadow: 0 2px 8px rgb(0 0 0 / 0.04);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
    align-items: stretch;
}

.talking-host {
    border-radius: 18px;
    outline: none;
    cursor: pointer;

    /*
     * Important when TalkingButton wraps content coming from
     * another component, such as the top-bar breadcrumbs.
     */
    font: inherit;
    color: inherit;
}

.talking-host:focus-visible {
    box-shadow: 0 0 0 4px #4d90fe;
}

.card, .real-button, .svg-object {
    min-height: 190px;
    width: 100%;
    border: 2px solid #d6dded;
    border-radius: 18px;
    background: white;
    padding: 18px;
    box-sizing: border-box;
    transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.talking-host:hover .card,
.talking-host:hover .real-button,
.talking-host:hover .svg-object,
.talking-host:focus .card,
.talking-host:focus .real-button,
.talking-host:focus .svg-object {
    transform: translateY(-2px);
    border-color: #5987ff;
    box-shadow: 0 10px 22px rgb(40 80 160 / 0.18);
}

.emoji { font-size: 58px; line-height: 1; }
.card h2 { margin: 12px 0 8px; }
.card p { color: #536079; }

.real-button {
    font: inherit;
    text-align: center;
    font-weight: 700;
    color: #172033;
}

.video-card { background: linear-gradient(135deg, #fff, #eef4ff); }
.video-card.ocean { background: linear-gradient(135deg, #fff, #e8fbff); }

.svg-object {
    background: white;
}
.svg-object circle { fill: #f5c344; stroke: #8d6d00; stroke-width: 5; }
.svg-object text { font: bold 32px system-ui; fill: #3f3000; }

.log-panel ul { margin: 0; padding-left: 22px; }

/* TalkingButton custom video player */
.talking-video-host {
    position: relative;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #000;
    color: #fff;
}

.talking-video-host--embedded {
    border-radius: inherit;
}

.talking-video-host--floating {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: min(520px, calc(100vw - 48px));
    aspect-ratio: 16 / 9;
    border-radius: 0;
    box-shadow: 0 22px 50px rgb(0 0 0 / 0.35);
    z-index: 1000;
}

.talking-video-host:fullscreen,
.talking-video-host:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
}

.talking-video-element {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* Galeli-style custom control bar */
.talking-video-controls {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    height: 58px;
    padding: 0 18px;
    box-sizing: border-box;
    /* background: rgb(55 95 132 / 0.88);*/
    background: rgb(24 63 130 / 0.58);
    direction: ltr;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 180ms ease, transform 180ms ease;
}

.talking-video-controls.is-hidden {
    opacity: 0;
    transform: translateY(100%);
    pointer-events: none;
}

.talking-video-control-button {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 0;
    padding: 4px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.talking-video-control-button img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

.talking-video-reading {
    width: 52px;
    height: 52px;
    padding: 4px;
    position: relative;
}

    .talking-video-reading img {
        width: 44px;
        height: 44px;
        position: relative;
        z-index: 1;
    }

.talking-video-host.is-reading-mode .talking-video-reading::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 40px;
    height: 30px;
    transform: translate(-50%, -50%);
    background: #fff;
    z-index: 0;
    pointer-events: none;
}

.talking-video-control-button:hover:not(:disabled),
.talking-video-control-button:focus-visible {
    background: rgb(255 255 255 / 0.12);
}

.talking-video-control-button:disabled {
    opacity: 0.35;
    cursor: default;
}

.talking-video-control-button:focus-visible,
.talking-video-progress:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

.talking-video-progress {
    flex: 1 1 auto;
    min-width: 0;
    height: 26px;
    margin: 0;
    cursor: pointer;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
}

.talking-video-progress::-webkit-slider-runnable-track {
    height: 4px;
    background: #fff;
    border-radius: 999px;
}

.talking-video-progress::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    margin-top: -10px;
    border: 0;
    border-radius: 50%;
    background-color: transparent;
    background-image: url("https://galeli.com/galeli.web/content/v5/circle_icon3.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    box-shadow: none;
}

.talking-video-progress::-moz-range-track {
    height: 4px;
    background: #fff;
    border-radius: 999px;
}

.talking-video-progress::-moz-range-progress {
    height: 4px;
    background: #fff;
    border-radius: 999px;
}

.talking-video-progress::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 50%;
    background-color: transparent;
    background-image: url("https://galeli.com/galeli.web/content/v5/circle_icon3.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    box-shadow: none;
}

/* Reading mode area above the video controls */
.talking-reading-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 58px;
    left: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    overflow: auto;
    box-sizing: border-box;
    padding: 34px 42px 28px;
    background: #fff;
    direction: rtl;
    text-align: right;
}

.talking-reading-header {
    flex: 0 0 auto;
    margin: 0 0 1.5rem;
    font-family: 'Abraham', Arial, sans-serif;
    font-size: clamp(1.875rem, 4vw, 3.375rem);
    font-weight: 700;
    line-height: 1.1;
    color: #3aa8df;
    text-align: right;
}

.talking-reading-content {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    box-sizing: border-box;
    padding: 1.625rem 2.125rem;
    border: 1px solid #777;
    background: #fff;
    font-family: 'Abraham', Arial, sans-serif;
    font-size: clamp(1.6875rem, 3.5vw, 3rem);
    font-weight: 700;
    line-height: 1.55;
    color: #244f95;
    text-align: right;
    white-space: pre-wrap;
}
.talking-reading-panel[hidden] {
    display: none;
}


.talking-video-host--embedded:not(:fullscreen):not(:-webkit-full-screen)
.talking-reading-panel {
    padding: 22px 28px 18px;
}

.talking-video-host--embedded:not(:fullscreen):not(:-webkit-full-screen)
.talking-reading-header {
    margin-bottom: 16px;
    font-size: clamp(24px, 3.1vw, 38px);
    line-height: 1.08;
}

.talking-video-host--embedded:not(:fullscreen):not(:-webkit-full-screen)
.talking-reading-content {
    padding: 18px 24px;
    font-size: clamp(19px, 2.35vw, 30px);
    line-height: 1.35;
    min-height: 0;
    overflow: auto;
}


/* Reading mode keeps the same control stripe. The regular controls retain
   their space but become invisible, so the Video switch remains exactly
   where the Reading switch was. */
.talking-video-host.is-reading-mode .talking-video-play-pause,
.talking-video-host.is-reading-mode .talking-video-progress,
.talking-video-host.is-reading-mode .talking-video-fullscreen {
    visibility: hidden;
    pointer-events: none;
}

.talking-video-host.is-reading-mode .talking-video-controls {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* The entire host enters fullscreen, so custom controls and reading mode stay available. */
.talking-video-host:fullscreen .talking-video-controls,
.talking-video-host:-webkit-full-screen .talking-video-controls {
    z-index: 40;
}

@media (max-width: 640px) {
    .talking-video-controls {
        gap: 8px;
        padding-inline: 10px;
    }

    .talking-video-control-button {
        width: 38px;
        height: 38px;
    }

    .talking-video-control-button img {
        width: 30px;
        height: 30px;
    }

    .talking-video-reading {
        width: 46px;
        height: 46px;
    }

    .talking-video-reading img {
        width: 40px;
        height: 40px;
    }

    .talking-reading-panel {
        bottom: 58px;
        padding: 22px 20px 18px;
    }

    .talking-reading-header {
        margin-bottom: 16px;
        font-size: 30px;
    }

    .talking-reading-content {
        padding: 18px 20px;
        font-size: 25px;
        line-height: 1.45;
    }
}
