/*------------------------------------------------------
· Gallery Latest Skin Style
· Type : style.css
· 게시판 스킨: skin/latest/gallery
· 구조: 좌(필터 트랙) / 중(내용) / 우(갤러리) 3단 레이아웃
---------------------------------------------------------*/

@charset "utf-8";

/* 3단 레이아웃 — 필터+내용 고정폭, 갤러리 유동 */
.yhd-tour-layout {
    display: grid;
    grid-template-columns: 8rem 28rem 1fr;
    gap: clamp(1.5rem, 2.5vw, 3.5rem);
    align-items: stretch;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* ── 왼쪽: 필터 트랙 ── */
.yhd-tour-left {
    position: relative;
    padding-left: 0;
}

/* 세로 트랙 라인 (전체 높이) */
.yhd-tour-left::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--yhd-white-12);
}

/* 활성 인디케이터 — 포인트 컬러, JS로 원형 애니메이션 + 이동 */
.yhd-tour-filter-indicator {
    position: absolute;
    left: 0;
    width: 2px;
    background: var(--yhd-point);
    border-radius: 1px;
    transition: top 0.45s cubic-bezier(0.4, 0, 0.2, 1),
                height 0.38s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-radius 0.25s ease,
                box-shadow 0.3s ease;
    z-index: 1;
}

/* 카테고리 필터 — 세로 리스트 */
.yhd-tour-filter {
    display: flex;
    flex-direction: column;
}

.yhd-tour-tab {
    padding: clamp(0.5rem, 0.6vw, 0.75rem) clamp(1rem, 1.25vw, 1.5rem);
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--yhd-white-40, rgba(255,255,255,0.4));
    font-size: clamp(0.875rem, 0.2vw + 0.75rem, 1rem);
    font-weight: 400;
    cursor: pointer;
    transition: color 0.3s;
    text-align: left;
    white-space: nowrap;
}

.yhd-tour-tab:focus-visible {
    outline: 2px solid var(--yhd-point);
    outline-offset: -2px;
}

@media (hover: hover) {
    .yhd-tour-tab:hover {
        color: var(--yhd-white-70);
    }
}

.yhd-tour-tab.is-active {
    color: var(--yhd-white);
    font-weight: 600;
}

/* 빈 카테고리 — 구분선 */
.yhd-tour-tab--circle {
    width: clamp(1.5rem, 2vw, 2.5rem);
    height: 1px;
    padding: 0;
    border-radius: 0;
    min-width: 0;
    background: var(--yhd-white-10);
    margin: clamp(0.25rem, 0.3vw, 0.5rem) 0 clamp(0.25rem, 0.3vw, 0.5rem) clamp(1rem, 1.25vw, 1.5rem);
    pointer-events: none;
    cursor: default;
}

.yhd-tour-tab--circle.is-active {
    background: var(--yhd-white-10);
}

/* ── 중앙: 게시물 내용 ── */
.yhd-tour-center {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background: var(--yhd-surface-dark, rgba(255,255,255,0.04));
    border-radius: clamp(0.5rem, 0.75vw, 1rem);
    padding: clamp(1.25rem, 1.5vw, 2rem);
    overflow: hidden;
}

/* 만다라 장식 — 느린 회전, 배경 역할 */
.yhd-tour-center-mandala {
    position: absolute;
    bottom: -15%;
    right: -20%;
    width: clamp(10rem, 12vw + 2rem, 18rem);
    height: auto;
    opacity: 0.04;
    animation: tourCenterMandalaRotate 90s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes tourCenterMandalaRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.yhd-tour-top-info {
    position: relative;
    z-index: 1;
    text-align: left;
}

.yhd-tour-top-info .yhd-tour-item-title {
    font-size: clamp(1.25rem, 0.5vw + 0.875rem, 1.75rem);
    font-weight: 600;
    color: var(--yhd-white);
    margin: 0;
}

.yhd-tour-top-info .yhd-tour-item-desc {
    font-size: clamp(0.875rem, 0.15vw + 0.75rem, 1rem);
    font-weight: 300;
    color: var(--yhd-white-70);
    line-height: 1.8;
    margin: clamp(0.5rem, 0.75vw, 1rem) 0 0;
}

/* ── 오른쪽: 갤러리 리스트 ── */
.yhd-tour-list {
    display: flex;
    flex-direction: column;
    gap: clamp(2.5rem, 3vw + 1rem, 5rem);
}

.yhd-tour-item.is-hidden,
.yhd-tour-video-section.is-hidden {
    display: none !important;
}

/* 각 게시물 정보 (JS가 중앙으로 복사, 원본은 숨김) */
.yhd-tour-item-info {
    margin-bottom: clamp(0.75rem, 1vw, 1.25rem);
}

.yhd-tour-item-title {
    font-size: clamp(1.125rem, 0.4vw + 0.75rem, 1.5rem);
    font-weight: 600;
    color: var(--yhd-white);
    margin: 0;
}

.yhd-tour-item-desc {
    font-size: clamp(0.875rem, 0.15vw + 0.75rem, 1rem);
    font-weight: 300;
    color: var(--yhd-white-70);
    line-height: 1.8;
    margin: clamp(0.25rem, 0.375vw, 0.5rem) 0 0;
}

/* 뷰어: 메인 이미지 + 썸네일 */
.yhd-tour-item-viewer {
    display: grid;
    grid-template-columns: 55% 1fr;
    gap: clamp(0.5rem, 0.75vw, 1rem);
    max-height: 80vh;
}

.yhd-tour-item-main {
    position: relative;
    border-radius: clamp(0.5rem, 0.75vw, 1rem);
    overflow: hidden;
    background: var(--yhd-surface-dark);
}

.yhd-tour-item-main-img {
    position: relative;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.yhd-tour-item-main-img--next {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 0;
}

.yhd-tour-item-main-img--next.is-visible {
    opacity: 1;
}

.yhd-tour-item-thumbs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(0.375rem, 0.5vw, 0.625rem);
    align-content: start;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--yhd-white-20) transparent;
}

.yhd-tour-item-thumb {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    border-radius: clamp(0.5rem, 0.75vw, 0.875rem);
    overflow: hidden;
    cursor: pointer;
    opacity: 0.65;
    transition: opacity 0.3s, outline-color 0.3s;
    border: none;
    outline: 2px solid transparent;
    outline-offset: -2px;
    background: var(--yhd-surface-dark);
}

.yhd-tour-item-thumb:focus-visible {
    outline-color: var(--yhd-point);
    opacity: 1;
}

@media (hover: hover) {
    .yhd-tour-item-thumb:hover {
        opacity: 0.7;
    }
}

.yhd-tour-item-thumb.is-active {
    opacity: 1;
    outline-color: var(--yhd-point);
}

.yhd-tour-item-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(100%);
    transition: filter 0.3s;
}

.yhd-tour-item-thumb.is-active img,
.yhd-tour-item-thumb:focus-visible img {
    filter: grayscale(0%);
}

@media (hover: hover) {
    .yhd-tour-item-thumb:hover img {
        filter: grayscale(0%);
    }
}

.yhd-tour-empty {
    text-align: center;
    padding: clamp(4rem, 6vw, 8rem) 0;
    color: var(--yhd-white-40);
    font-size: clamp(0.875rem, 0.2vw + 0.75rem, 1rem);
}


/* **************************************************************
    Responsive — 1530px 이하: 세로 스택 + 필터 가로 전환
************************************************************** */

@media screen and (max-width: 1530px) {

    .yhd-tour-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .yhd-tour-left { grid-column: 1; grid-row: auto; }
    .yhd-tour-filter-indicator { display: none; }

    /* 필터 상단 가로 트랙 라인 */
    .yhd-tour-left::before {
        top: 0;
        bottom: auto;
        left: 0;
        right: 0;
        width: auto;
        height: 1px;
    }

    /* 카테고리 필터 가로 스크롤 */
    .yhd-tour-filter {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .yhd-tour-filter::-webkit-scrollbar { display: none; }

    .yhd-tour-tab {
        flex-shrink: 0;
        border-top: 2px solid transparent;
    }

    .yhd-tour-tab.is-active {
        border-top-color: var(--yhd-point);
    }

    .yhd-tour-center { grid-column: 1; grid-row: auto; overflow: visible; }
    .yhd-tour-list { grid-column: 1; grid-row: auto; }

    /* 뷰어 세로 배치 */
    .yhd-tour-item-viewer {
        display: flex;
        flex-direction: column;
        max-height: none;
    }

    .yhd-tour-item-main {
        width: 100%;
        aspect-ratio: 3 / 2;
    }

    /* 썸네일 가로 스크롤 */
    .yhd-tour-item-thumbs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        padding: clamp(0.5rem, 1vw, 0.75rem) 0;
    }

    .yhd-tour-item-thumbs::-webkit-scrollbar { display: none; }

    .yhd-tour-item-thumb {
        flex-shrink: 0;
        width: clamp(3rem, 14vw, 4.5rem);
        padding-bottom: 0;
        aspect-ratio: 1;
        position: static;
    }

    .yhd-tour-item-thumb img { position: static; }

}

/* 모션 감소 */
@media (prefers-reduced-motion: reduce) {
    .yhd-tour-filter-indicator { transition: none !important; }
    .yhd-tour-item-main-img--next { transition: none; }
    .yhd-tour-item-thumb { transition: none; }
    .yhd-tour-item-thumb img { transition: none; }
    .yhd-tour-center-mandala { animation: none; }
}

/* ── 영상 그룹 (tour 내 video) ── */
.yhd-tour-video-section {
    width: 100%;
    margin-top: clamp(4rem, 8vw, 6rem);
}

.yhd-tour-video-title {
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    font-weight: 700;
    color: var(--yhd-white);
    margin: 0 0 clamp(1rem, 2vw, 1.5rem);
}

.yhd-tour-video-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(0.75rem, 1.5vw, 1.25rem);
}
.yhd-tour-video-grid.is-single-row {
    justify-content: flex-start;
}
.yhd-tour-video-item {
    flex: 0 0 calc((100% - clamp(0.75rem, 1.5vw, 1.25rem) * 5) / 6);
}

.yhd-tour-video-item {
    overflow: hidden;
}

.yhd-tour-video-link {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: clamp(0.5rem, 0.8vw, 0.75rem);
    overflow: hidden;
    background: var(--yhd-black);
}

.yhd-tour-video-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s;
}

.yhd-tour-video-item:hover .yhd-tour-video-link img {
    transform: scale(1.05);
}

.yhd-tour-video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    filter: drop-shadow(0 0.25rem 0.75rem rgba(0, 0, 0, 0.5));
}

.yhd-tour-video-play-icon svg {
    width: clamp(2.5rem, 3.5vw, 3.25rem);
    height: auto;
}

.yhd-tour-video-play-icon svg circle {
    fill: rgba(0, 0, 0, 0.75);
    transition: fill 0.3s;
}

.yhd-tour-video-play-icon svg polygon {
    fill: #fff;
}

.yhd-tour-video-item:hover .yhd-tour-video-play-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.yhd-tour-video-item:hover .yhd-tour-video-play-icon svg circle {
    fill: var(--yhd-point);
}

@media (max-width: 1440px) {
    .yhd-tour-video-item { flex-basis: calc((100% - clamp(0.75rem, 1.5vw, 1.25rem) * 3) / 4); }
}
@media (max-width: 1024px) {
    .yhd-tour-video-item { flex-basis: calc((100% - clamp(0.75rem, 1.5vw, 1.25rem) * 2) / 3); }
}
@media (max-width: 640px) {
    .yhd-tour-video-item { flex-basis: calc((100% - clamp(0.75rem, 1.5vw, 1.25rem)) / 2); }
}
@media (max-width: 400px) {
    .yhd-tour-video-item { flex-basis: 100%; }
}
