/* Thierry Content Studio v0.9.2 - YouTube vertical viewer
   =========================================================
   UNIFIED YOUTUBE VIEWER
   - Outer viewer: fixed 9:16 portrait frame
   - Inner YouTube iframe: fixed 16:9 canvas, center-clipped
   - YouTube Shorts/general embed variations are pushed outside visible center
   - Thierry profile/title overlay is always rendered in one fixed position
   ========================================================= */

.tcs-social-video-modal {
    --tcs-video-vw: 100vw;
    --tcs-video-vh: 100dvh;
    --tcs-video-vtop: 0px;
    --tcs-video-vleft: 0px;
    position: fixed !important;
    top: var(--tcs-video-vtop) !important;
    left: var(--tcs-video-vleft) !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 2147483000;
    display: none;
    width: var(--tcs-video-vw) !important;
    height: var(--tcs-video-vh) !important;
    max-width: none !important;
    max-height: none !important;
    overflow: hidden;
    background: #000;
    color: #fff;
}

.tcs-social-video-modal.is-open { display: block; }
.tcs-social-video-modal.is-preparing { visibility: hidden; }

.tcs-shorts-shell,
.tcs-shorts-feed {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
}

.tcs-shorts-feed {
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: none;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}
.tcs-shorts-feed::-webkit-scrollbar { display: none; }

.tcs-shorts-slide {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    height: var(--tcs-video-vh);
    min-height: var(--tcs-video-vh);
    max-height: var(--tcs-video-vh);
    padding: 18px 72px;
    overflow: hidden;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    background: #000;
}

.tcs-shorts-media {
    position: relative;
    box-sizing: border-box;
    width: min(430px, calc((var(--tcs-video-vh) - 36px) * 9 / 16));
    height: min(calc(var(--tcs-video-vh) - 36px), calc(430px * 16 / 9));
    max-width: calc(var(--tcs-video-vw) - 144px);
    max-height: calc(var(--tcs-video-vh) - 36px);
    aspect-ratio: 9 / 16;
    overflow: hidden;
    border-radius: 10px;
    background: #000;
    isolation: isolate;
}

.tcs-shorts-placeholder,
.tcs-shorts-embed {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

.tcs-shorts-placeholder {
    z-index: 1;
    object-fit: cover;
    object-position: center;
    opacity: 1;
    transition: opacity .12s linear;
}
.tcs-shorts-placeholder.is-hidden { opacity: 0; }

.tcs-shorts-embed {
    z-index: 2;
    overflow: hidden;
    background: #000;
    pointer-events: none;
}

/* 16:9 inner canvas centered behind the 9:16 crop window. */
.tcs-shorts-embed iframe {
    position: absolute !important;
    top: 0 !important;
    left: -108.024691358% !important;
    right: auto !important;
    bottom: auto !important;
    display: block;
    width: 316.049382716% !important;
    height: 100% !important;
    min-width: 316.049382716% !important;
    max-width: none !important;
    min-height: 100% !important;
    max-height: none !important;
    border: 0;
    margin: 0 !important;
    padding: 0 !important;
    background: #000;
    transform: none !important;
    pointer-events: none !important;
    opacity: 0;
}
.tcs-shorts-embed.is-ready iframe { opacity: 1; }

/* One consistent Thierry identity layer. */
.tcs-shorts-meta {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 18px;
    z-index: 5;
    display: block !important;
    padding: 0;
    margin: 0;
    background: transparent !important;
    color: #fff;
    pointer-events: none;
    text-shadow: 0 1px 3px rgba(0,0,0,.72);
}

.tcs-shorts-profile-row {
    display: flex !important;
    align-items: center;
    gap: 9px;
    min-width: 0;
    background: transparent !important;
}

.tcs-shorts-profile-avatar {
    display: flex;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.85);
    background: #fff;
    color: #111;
    font-size: 12px;
}

.tcs-shorts-profile-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tcs-shorts-profile-name {
    overflow: hidden;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.tcs-shorts-title {
    display: block !important;
    max-width: calc(100% - 8px);
    margin-top: 8px;
    overflow: hidden;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
    text-overflow: ellipsis;
    background: transparent !important;
}


/* Uniform Thierry playback controls. */
.tcs-shorts-controls {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: block;
    background: transparent;
    cursor: pointer;
    touch-action: pan-y;
    -webkit-tap-highlight-color: transparent;
}

.tcs-shorts-play-state {
    position: absolute;
    left: 50%;
    top: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(0,0,0,.30);
    color: #fff;
    font-size: 31px;
    font-weight: 700;
    line-height: 1;
    opacity: 0;
    transform: translate(-50%, -50%) scale(.86);
    transition: opacity .12s ease, transform .12s ease;
    pointer-events: none;
}

.tcs-shorts-play-state.is-visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.tcs-shorts-progress-wrap {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 8;
    display: flex;
    align-items: flex-end;
    height: 24px;
    padding: 0 0 2px;
    pointer-events: none;
}

.tcs-shorts-progress {
    --tcs-progress: 0%;
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 18px;
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    cursor: pointer;
    pointer-events: auto;
    touch-action: none;
}

.tcs-shorts-progress::-webkit-slider-runnable-track {
    width: 100%;
    height: 3px;
    border: 0;
    border-radius: 0;
    background: linear-gradient(to right,
        #ff0033 0%,
        #ff0033 var(--tcs-progress),
        rgba(255,255,255,.42) var(--tcs-progress),
        rgba(255,255,255,.42) 100%);
}

.tcs-shorts-progress::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 11px;
    height: 11px;
    margin-top: -4px;
    border: 0;
    border-radius: 50%;
    background: #ff0033;
    opacity: 0;
    transition: opacity .12s ease;
}

.tcs-shorts-progress:hover::-webkit-slider-thumb,
.tcs-shorts-progress:active::-webkit-slider-thumb,
.tcs-shorts-progress:focus-visible::-webkit-slider-thumb {
    opacity: 1;
}

.tcs-shorts-progress::-moz-range-track {
    height: 3px;
    border: 0;
    border-radius: 0;
    background: rgba(255,255,255,.42);
}

.tcs-shorts-progress::-moz-range-progress {
    height: 3px;
    background: #ff0033;
}

.tcs-shorts-progress::-moz-range-thumb {
    width: 11px;
    height: 11px;
    border: 0;
    border-radius: 50%;
    background: #ff0033;
}

/* Lift Thierry metadata above the seek bar. */
.tcs-shorts-meta {
    bottom: 30px;
}

.tcs-shorts-author { display: none !important; }
.tcs-shorts-gesture,
.tcs-shorts-counter,
.tcs-shorts-nav { display: none !important; }

.tcs-social-video-close {
    position: absolute;
    top: max(14px, env(safe-area-inset-top));
    right: max(18px, env(safe-area-inset-right));
    z-index: 12;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin: 0;
    padding: 0 0 4px;
    border: 0;
    border-radius: 50%;
    background: rgba(0,0,0,.32);
    color: #fff;
    font-size: 33px;
    font-weight: 200;
    line-height: 1;
    cursor: pointer;
}

body.tcs-video-viewer-open .kakaoChatPc,
body.tcs-video-viewer-open .kakaoChatMob { display: none !important; }

@media (min-width: 768px) {
    .tcs-social-video-modal {
        --tcs-video-vw: 100vw !important;
        --tcs-video-vh: 100dvh !important;
        --tcs-video-vtop: 0px !important;
        --tcs-video-vleft: 0px !important;
    }
    .tcs-shorts-slide { padding: 18px 72px; }
    .tcs-shorts-media {
        width: min(430px, calc((100dvh - 36px) * 9 / 16));
        height: min(calc(100dvh - 36px), calc(430px * 16 / 9));
        max-width: calc(100vw - 144px);
        max-height: calc(100dvh - 36px);
    }
}

@media (max-width: 767px) {
    .tcs-shorts-slide {
        height: var(--tcs-video-vh) !important;
        min-height: var(--tcs-video-vh) !important;
        max-height: var(--tcs-video-vh) !important;
        padding: 0;
    }
    .tcs-shorts-media {
        width: min(var(--tcs-video-vw), calc(var(--tcs-video-vh) * 9 / 16));
        height: min(var(--tcs-video-vh), calc(var(--tcs-video-vw) * 16 / 9));
        max-width: var(--tcs-video-vw);
        max-height: var(--tcs-video-vh);
        border-radius: 0;
    }
    .tcs-shorts-meta {
        left: max(16px, env(safe-area-inset-left));
        right: max(16px, env(safe-area-inset-right));
        bottom: max(30px, calc(env(safe-area-inset-bottom) + 26px));
    }
    .tcs-social-video-close {
        top: max(10px, env(safe-area-inset-top));
        right: max(10px, env(safe-area-inset-right));
        width: 38px;
        height: 38px;
        font-size: 30px;
    }
}
