/* Thierry Content Studio v0.9.4 - Post viewer */
/* =========================================================
   SOCIAL CONTENT VIEWER - v0.4.0
   Instagram/KREAM style continuous content scroll
========================================================= */

.tcs-viewer-page {
    width: 100%;
    background: #fff;
    color: #111;
    padding: 42px 0 100px;
}

/*
 * PC에서 오래된 게시물 직접 진입 시 선택 위치를 맞추기 전까지
 * viewer를 숨깁니다. visibility는 레이아웃 공간을 유지하므로
 * scroll target 계산에는 영향을 주지 않습니다.
 */
@media (min-width: 768px) {
    .tcs-viewer-page.is-initial-positioning {
        visibility: hidden;
    }
}

.tcs-viewer-shell {
    width: min(100% - 32px, 620px);
    margin: 0 auto;
}

.tcs-viewer-post {
    width: 100%;
    margin: 0 0 74px;
    scroll-margin-top: 24px;
}

.tcs-viewer-post:last-child {
    margin-bottom: 0;
}

.tcs-viewer-post-head {
    display: flex;
    align-items: center;
    min-height: 58px;
    padding: 8px 2px 10px;
}

.tcs-viewer-profile-link {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: #111;
    text-decoration: none;
}

.tcs-shared-avatar {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid #e3e3e3;
    box-sizing: border-box;
    overflow: hidden;
    background: #111;
    color: #fff;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 16px;
}

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

.tcs-viewer-profile-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}

.tcs-viewer-profile-text strong {
    font-size: 14px;
    font-weight: 650;
    letter-spacing: -.015em;
}

.tcs-viewer-profile-text small {
    margin-top: 3px;
    color: #777;
    font-size: 11px;
    font-weight: 400;
}

.tcs-viewer-gallery {
    position: relative;

    /*
     * PC: 이미지 폭은 기존 viewer 폭 그대로 유지하면서
     * 좌우 38px을 화살표 전용 gutter로 추가합니다.
     * 따라서 화살표가 이미지 위에 올라가지 않습니다.
     */
    width: calc(100% + 76px);
    margin-left: -38px;
    padding-left: 38px;
    padding-right: 38px;
    box-sizing: border-box;

    overflow: visible;
    background: transparent;
}

.tcs-viewer-track {
    display: flex;
    width: 100%;
    background: #f3f3f3;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
}

.tcs-viewer-track::-webkit-scrollbar {
    display: none;
}

.tcs-viewer-slide {
    flex: 0 0 100%;
    width: 100%;
    aspect-ratio: 3 / 4;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    background: #f3f3f3;
}

.tcs-viewer-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.tcs-viewer-counter {
    position: absolute;
    top: 12px;
    right: 50px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 25px;
    padding: 0 9px;
    border-radius: 14px;
    background: rgba(0,0,0,.62);
    color: #fff;
    font-size: 11px;
    line-height: 1;
    pointer-events: none;
}

.tcs-viewer-gallery-arrow {
    position: absolute;
    top: 50%;
    z-index: 6;
    width: 38px;
    height: 56px;
    transform: translateY(-50%);
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;

    /* 게시물에서도 hover/focus 시에만 미니멀 화살표 노출 */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .16s ease, visibility .16s ease;
}

.tcs-viewer-gallery:hover .tcs-viewer-gallery-arrow:not(.is-hidden),
.tcs-viewer-gallery:focus-within .tcs-viewer-gallery-arrow:not(.is-hidden) {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.tcs-viewer-gallery-arrow.is-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* 화살표는 이미지 바깥 전용 gutter의 중앙에 배치 */
.tcs-viewer-gallery-prev {
    left: 0;
}

.tcs-viewer-gallery-next {
    right: 0;
}

.tcs-viewer-gallery-arrow span {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 10px;
    height: 10px;
    border-top: 1.25px solid #929292;
    border-right: 1.25px solid #929292;
    transition: border-color .16s ease;
}

.tcs-viewer-gallery-arrow:hover span,
.tcs-viewer-gallery-arrow:focus-visible span {
    border-color: #222;
}

.tcs-viewer-gallery-arrow:focus-visible {
    outline: none;
}

.tcs-viewer-gallery-next span {
    transform: translate(-68%, -50%) rotate(45deg);
}

.tcs-viewer-gallery-prev span {
    transform: translate(-32%, -50%) rotate(-135deg);
}

.tcs-viewer-dots {
    /* Instagram처럼 이미지 아래 별도 영역에 표시 */
    position: static;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 24px;
    padding: 8px 0 4px;
    transform: none;
    pointer-events: none;
    background: #fff;
}

.tcs-viewer-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #d7d7d7;
    box-shadow: none;
    transition: width .18s ease, border-radius .18s ease, background .18s ease;
}

.tcs-viewer-dot.is-active {
    width: 15px;
    border-radius: 8px;
    background: #3897f0;
}

.tcs-viewer-caption {
    padding: 14px 2px 0;
    font-size: 14px;
    line-height: 18px;
}

.tcs-viewer-caption-line {
    display: block;
    color: #222;
    word-break: keep-all;
}

.tcs-viewer-caption-user {
    margin-right: 7px;
    color: #111;
    font-size: 14px;
    line-height: 18px;
    font-weight: 600;
    text-decoration: none;
}

.tcs-viewer-caption-title {
    font-weight: 400;
}

.tcs-viewer-description {
    margin-top: 16px;
    color: #555;
    font-size: 14px;
    line-height: 18px;
    word-break: keep-all;
}


.tcs-viewer-date {
    display: block;
    margin-top: 8px;
    color: #9a9a9a;
    font-size: 11px;
    line-height: 1.35;
    font-weight: 400;
}

@media (max-width: 767px) {
    .tcs-viewer-page {
        padding: 14px 0 64px;
    }

    .tcs-viewer-shell {
        width: 100%;
        max-width: none;
    }

    .tcs-viewer-post {
        margin-bottom: 26px;
        padding-bottom: 0;
        border-bottom: 0;
    }

    .tcs-viewer-post-head {
        min-height: 54px;
        padding: 8px 16px;
    }

    .tcs-shared-avatar {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }

    .tcs-viewer-profile-text strong {
        font-size: 13px;
    }

    .tcs-viewer-profile-text small {
        font-size: 10px;
    }

    .tcs-viewer-gallery {
        width: 100%;
        margin-left: 0;
        padding-left: 0;
        padding-right: 0;
        overflow: hidden;
    }

    .tcs-viewer-gallery-arrow {
        display: none;
    }

    .tcs-viewer-counter {
        top: 10px;
        right: 10px;
        height: 24px;
        min-width: 38px;
        padding: 0 8px;
        font-size: 10px;
    }

    .tcs-viewer-dots {
        min-height: 24px;
        padding: 8px 0 4px;
    }

    .tcs-viewer-caption {
        padding: 12px 16px 0;
        font-size: 14px;
        line-height: 18px;
    }

    .tcs-viewer-caption-user {
        font-size: 14px;
        line-height: 18px;
        font-weight: 600;
    }

    .tcs-viewer-description {
        margin-top: 14px;
        font-size: 14px;
        line-height: 18px;
    }
}

@media (max-width: 767px) {
    .tcs-viewer-post {
        border-bottom: 0 !important;
        padding-bottom: 0 !important;
    }
}
/* =========================================================
   v0.6.0 MOBILE INSTAGRAM-STYLE VIEWER OVERLAY
   /social/ 모바일 그리드에서 새 페이지 로딩 없이 게시물 피드를 엽니다.
========================================================= */
.tcs-mobile-viewer-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147482000;
    display: block;
    background: #fff;
    color: #111;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: none;
}

.tcs-mobile-viewer-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.tcs-mobile-viewer-frame {
    position: absolute;
    inset: 0;
    background: #fff;
    transform: none;
    transform-origin: center center;
    transition: none;
}

.tcs-mobile-viewer-overlay.is-open .tcs-mobile-viewer-frame {
    transform: none;
}

.tcs-mobile-viewer-bar {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    z-index: 20;
    height: 52px;
    padding-top: env(safe-area-inset-top, 0px);
    box-sizing: content-box;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #efefef;
    background: rgba(255,255,255,.97);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.tcs-mobile-viewer-back {
    position: absolute;
    left: 8px;
    top: calc(env(safe-area-inset-top, 0px) + 2px);
    width: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #111;
    cursor: pointer;
}

.tcs-mobile-viewer-back::before {
    content: '';
    position: absolute;
    left: 19px;
    top: 15px;
    width: 14px;
    height: 14px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
}

.tcs-mobile-viewer-title {
    margin: 0;
    font-size: 15px;
    line-height: 1;
    font-weight: 650;
    letter-spacing: -.015em;
}

.tcs-mobile-viewer-scroll {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: calc(52px + env(safe-area-inset-top, 0px));
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    background: #fff;
}

.tcs-mobile-viewer-content {
    min-height: 100%;
}

.tcs-mobile-viewer-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 55vh;
    color: #777;
    font-size: 12px;
}

.tcs-mobile-viewer-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    margin-right: 9px;
    border: 2px solid #e4e4e4;
    border-top-color: #555;
    border-radius: 50%;
    animation: tcs-mobile-viewer-spin .7s linear infinite;
}

@keyframes tcs-mobile-viewer-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 767px) {
    .tcs-mobile-viewer-overlay .tcs-viewer-page {
        padding: 0 0 44px;
    }

    .tcs-mobile-viewer-overlay .tcs-viewer-shell {
        width: 100%;
        max-width: none;
    }

    .tcs-mobile-viewer-overlay .tcs-viewer-post:first-child .tcs-viewer-post-head {
        margin-top: 0;
    }

    .tcs-mobile-viewer-overlay .tcs-viewer-post {
        margin-bottom: 22px;
    }
}

@media (min-width: 768px) {
    .tcs-mobile-viewer-overlay {
        display: none !important;
    }
}


/* Canonical fast mobile overlay. Historical shared-element transition CSS was removed in v0.9.0. */
@media (max-width: 767px) {
    .tcs-mobile-viewer-overlay,
    .tcs-mobile-viewer-frame,
    .tcs-mobile-viewer-overlay.is-open .tcs-mobile-viewer-frame {
        transition: none !important;
        transform: none !important;
        animation: none !important;
    }

    .tcs-mobile-viewer-overlay.is-staging {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    .tcs-mobile-viewer-overlay.is-open {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    .tcs-mobile-viewer-scroll {
        overscroll-behavior-y: contain;
        scroll-behavior: auto;
        -webkit-overflow-scrolling: touch;
    }
}
