@charset "utf-8";

/* =============================================================================
   v3_history.css — 연혁(history) 새 디자인: 세로 타임라인 (신규 테마 ver 3.0)
   261113 김동현 클로드활용 수정: 새로 만듦
   - skin/board/history/list.skin.php 가 불러옴
   - 구성: 연도 탭(.hs_tabs 최근 5개 + "이전 연도" 버튼으로 펼쳐지는 .hs_tabs_more, 글 제목의 연도에서 자동 생성) → 선택한 연도의 타임라인(.hs_year) → 월 원 + 내용 + 사진 타일
   - 색·여백 변수(--color-*, --grid-gap 등)는 css/v3_common.css 의 :root 값을 씀
   ============================================================================= */

/* 페이지 배경을 메인·서브 상단과 같은 색(#FCFBFA)으로. 이 CSS 는 연혁 스킨에서만 불러오므로 이 게시판에만 적용됨 */
body {
    background: var(--color-white);
}

/* 본문 틀 폭(1200px)과 좌우 여백을 메인·언론보도와 같게 맞추려고 틀 밖에서 다시 폭을 잡음 (연혁은 읽기 편하게 960px).
   위쪽 음수 여백은 서브 상단 아래 틀의 위쪽 여백(60px)이 커서 줄이는 것 (제품·언론보도와 동일) */
.v3_history {
    position: relative;
    left: 50%;
    width: min(100vw - var(--header-gap) * 2, 960px);
    margin-top: -40px;
    padding-bottom: clamp(72px, 7vw, 120px);
    transform: translateX(-50%);
    color: var(--color-text);
    word-break: keep-all;
}

/* ----- 연도 탭 (최근 5개 연도 + "이전 연도 ▾" 버튼) -----
   첫 줄(.hs_tabs): 최근 연도 탭이 남는 폭을 똑같이 나눠 가지고, 끝에 "이전 연도" 버튼.
   버튼을 누르면 아래에 나머지 연도(.hs_tabs_more)가 작은 판으로 펼쳐짐 (.hs_tabwrap 에 is_open 이 붙음) */
.hs_tabwrap {
    margin: 0 0 36px;
}

.hs_tabs {
    display: flex;
    gap: 6px;
}

/* 펼침판 열고 닫기: 높이를 0fr ↔ 1fr 로 바꾸는 방식이라 내용 높이를 몰라도 부드럽게 움직임.
   닫혀 있을 때는 visibility:hidden 이라 안 보이는 탭이 키보드로 선택되지 않음 (닫힌 뒤에 숨기려고 transition-delay 를 줌) */
.hs_more_panel {
    display: grid;
    grid-template-rows: 0fr;
    visibility: hidden;
    opacity: 0;
    transition: grid-template-rows 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease, visibility 0s linear 0.4s;
}

.hs_tabwrap.is_open .hs_more_panel {
    grid-template-rows: 1fr;
    visibility: visible;
    opacity: 1;
    transition: grid-template-rows 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease 0.05s, visibility 0s;
}

.hs_more_clip {
    min-height: 0;
    overflow: hidden;
}

.hs_tabs_more {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    padding: 14px;
    border: 1px solid #E5E7EB;
    border-radius: 18px;
    background: #fff;
    transform: translateY(-8px);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.hs_tabwrap.is_open .hs_tabs_more {
    transform: translateY(0);
}

/* 펼친 줄 안의 탭은 폭을 늘이지 않고 같은 크기로 */
.hs_tabs_more .hs_tab {
    flex: 0 0 auto;
    min-width: 72px;
}

/* "이전 연도 ▾" 버튼: 연도 탭과 구분되도록 글자 + 화살표, 점선 테두리 */
.hs_more_btn {
    display: inline-flex;
    flex: none;
    width: 112px; /* 글자가 "이전 연도" ↔ "접기" 로 바뀌어도 너비가 변하지 않게 고정 */
    height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0;
    border: 1px dashed #b9c5c0;
    border-radius: 999px;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-sub);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.hs_more_btn:hover,
.hs_more_btn:focus-visible,
.hs_tabwrap.is_open .hs_more_btn {
    border-color: var(--color-point);
    color: var(--color-point);
}

/* 버튼 글자: 두 글자를 같은 자리에 겹쳐 두고 투명도로 서서히 교체 */
.hs_more_label {
    display: inline-grid;
    text-align: center;
}

.hs_lbl_open,
.hs_lbl_close {
    grid-area: 1 / 1;
    white-space: nowrap;
    transition: opacity 0.25s ease;
}

.hs_lbl_close,
.hs_tabwrap.is_open .hs_lbl_open {
    opacity: 0;
}

.hs_tabwrap.is_open .hs_lbl_close {
    opacity: 1;
}

.hs_more_caret {
    width: 7px;
    height: 7px;
    margin-top: -3px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.25s, margin 0.25s;
}

.hs_tabwrap.is_open .hs_more_caret {
    margin-top: 3px;
    transform: rotate(-135deg);
}

.hs_tab {
    flex: 1 1 0;
    min-width: 0;
    height: 42px;
    padding: 0 8px;
    border: 1px solid #d9d9d9;
    border-radius: 999px;
    background: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--color-text-sub);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.hs_tab:hover,
.hs_tab:focus-visible {
    border-color: var(--color-point);
    color: var(--color-point);
}

.hs_tab.is_on {
    border-color: var(--color-deep);
    background: var(--color-deep);
    color: #fff;
}

/* ----- 검색창 (list.skin.php 의 $v3_history_show_search = true 일 때만 나옴) ----- */
.hs_search {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0 0 32px;
}

.hs_search select,
.hs_search input[type="text"] {
    height: 40px;
    padding: 0 12px;
    border: 1px solid #d5d5d5;
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
}

.hs_search button {
    height: 40px;
    padding: 0 18px;
    border: 0;
    border-radius: 6px;
    background: var(--color-deep);
    font-size: 14px;
    color: #fff;
    cursor: pointer;
}

/* ----- 관리자 도구 ----- */
.hs_bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding-bottom: 16px;
    margin-bottom: 24px;
    border-bottom: 1px solid #E5E7EB;
}

.hs_chkall {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 4px;
    font-size: 14px;
    color: var(--color-text-sub);
    cursor: pointer;
}

.hs_bar button,
.hs_tool_link {
    display: inline-block;
    height: 36px;
    padding: 0 14px;
    border: 1px solid #d5d5d5;
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
    line-height: 34px;
    color: var(--color-text);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.hs_bar button:hover,
.hs_tool_link:hover {
    border-color: var(--color-point);
    color: var(--color-point);
}

.hs_tool_main {
    border-color: var(--color-point);
    background: var(--color-point);
    color: #fff;
}

.hs_tool_main:hover {
    background: var(--color-point-hover);
    color: #fff;
}

/* ----- 연도 묶음: 탭에서 고르지 않은 연도는 숨김 (자바스크립트가 is_hidden 을 붙임) ----- */
.hs_year.is_hidden {
    display: none;
}

/* 연도를 바꿀 때 내용이 갑자기 뜨지 않고 아래에서 살짝 올라오며 나타남 */
@keyframes hs_year_in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.hs_year:not(.is_hidden) {
    animation: hs_year_in 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

/* 시스템에서 "동작 줄이기"를 켠 사용자는 움직임 없이 바로 바뀜 */
@media (prefers-reduced-motion: reduce) {
    .hs_more_panel,
    .hs_tabs_more,
    .hs_lbl_open,
    .hs_lbl_close,
    .hs_more_caret {
        transition: none !important;
    }

    .hs_year:not(.is_hidden) {
        animation: none;
    }
}

/* 연도가 하나뿐이거나 자바스크립트가 꺼져 있을 때 여러 연도가 이어 붙으면 구분이 되도록 */
.hs_year + .hs_year {
    margin-top: 24px;
}

/* ----- 타임라인 본체 ----- */
.hs_year_body {
    position: relative;
    padding: 0 0 8px;
}

/* 세로 선: 월 원(폭 52px)의 가운데를 지나도록 */
.hs_year_body::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 25px;
    width: 2px;
    background: #DCE6E2;
}

.hs_item {
    position: relative;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    column-gap: 24px;
    padding-bottom: 36px;
}

.hs_item:last-child {
    padding-bottom: 28px;
}

.hs_month_col {
    position: relative;
    z-index: 1;
}

/* 월 원: 숫자 + 작은 "월". 한 달의 첫 글에만 나옴 */
.hs_month {
    display: flex;
    width: 52px;
    height: 52px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--color-white);
    border-radius: 50%;
    background: var(--color-point);
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    box-shadow: 0 0 0 1px #DCE6E2;
}

.hs_month small {
    margin-top: 2px;
    font-size: 10px;
    font-weight: 500;
    opacity: 0.9;
}

/* 같은 달의 두 번째 글부터: 월 원 대신 선 위의 작은 점 */
.hs_item:not(.has_month) .hs_month_col::before {
    content: "";
    position: absolute;
    top: 11px;
    left: 20px;
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #A9C7BD;
}

.hs_content {
    position: relative;
    min-width: 0;
    padding: 4px 56px 0 0;
}

.hs_text {
    font-size: clamp(16px, 1.3vw, 18px);
    font-weight: 500;
    line-height: 1.7;
    letter-spacing: -0.015em;
    color: var(--color-text);
    overflow-wrap: break-word;
}

/* ----- 사진·영상 타일 ----- */
.hs_media {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.hs_thumb {
    position: relative;
    display: block;
    width: 148px;
    height: 108px;
    overflow: hidden;
    border-radius: 10px;
    background: #eceae6;
}

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

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .hs_thumb:hover img,
    .hs_thumb:hover video {
        transform: scale(1.06);
    }
}

.hs_thumb.is_video video {
    background: #000;
}

/* 영상 표시: 가운데 재생 버튼 */
.hs_play {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 1;
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    pointer-events: none;
}

.hs_play::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -6px 0 0 -4px;
    border-style: solid;
    border-width: 6px 0 6px 10px;
    border-color: transparent transparent transparent #fff;
}

/* ----- 관리자: 항목마다 수정 링크 + 선택 체크박스 ----- */
.hs_admin {
    position: absolute;
    top: 4px;
    right: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hs_edit {
    padding: 4px 10px;
    border: 1px solid #d5d5d5;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    color: var(--color-text-sub);
    transition: border-color 0.2s, color 0.2s;
}

.hs_edit:hover {
    border-color: var(--color-point);
    color: var(--color-point);
}

.hs_empty {
    padding: 80px 0;
    text-align: center;
    color: var(--color-text-sub);
}

/* ----- 모바일 ----- */
@media (max-width: 768px) {
    /* 탭 5개 + 버튼이 한 줄에 들어가도록 줄임 */
    .hs_tabs {
        gap: 4px;
    }

    .hs_tab {
        height: 40px;
        padding: 0;
        font-size: 14px;
    }

    .hs_more_btn {
        width: 92px;
        height: 40px;
        gap: 5px;
        font-size: 13px;
    }

    .hs_tabs_more {
        padding: 10px;
    }

    .hs_tabs_more .hs_tab {
        min-width: 64px;
    }

    .hs_year_body::before {
        left: 21px;
    }

    .hs_item {
        grid-template-columns: 44px minmax(0, 1fr);
        column-gap: 14px;
        padding-bottom: 28px;
    }

    .hs_month {
        width: 44px;
        height: 44px;
        font-size: 16px;
    }

    .hs_item:not(.has_month) .hs_month_col::before {
        left: 16px;
    }

    .hs_content {
        padding-right: 0;
    }

    /* 모바일에서는 관리자 도구가 글 위에 얹히지 않도록 글 아래로 내림 */
    .hs_admin {
        position: static;
        margin-top: 10px;
    }

    /* 사진 타일: 한 줄에 3개 */
    .hs_media {
        gap: 6px;
    }

    .hs_thumb {
        width: calc((100% - 12px) / 3);
        height: auto;
        aspect-ratio: 4 / 3;
    }
}
