@charset "utf-8";


/* =========================================================
   Latest Portfolio
========================================================= */

.latest_portfolio {
    position: relative;
    width: 100%;
}


/* =========================================================
   Grid
========================================================= */

.latest_portfolio_grid {
    display: grid;

    /* PC: 4개씩 2줄 균등 배치 */
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(2, auto);

    gap: 24px;

    width: 100%;
}


/*
|--------------------------------------------------------------------------
| Item
|--------------------------------------------------------------------------
*/

.latest_portfolio_item {
    position: relative;

    min-width: 0;
    margin: 0;
}


/*
 * PC에서도 첫 번째 항목을 크게 만들지 않고
 * 나머지 항목과 동일한 1칸으로 표시합니다.
 */
.latest_portfolio_item.featured {
    grid-column: auto;
    grid-row: auto;
}


.latest_portfolio_link {
    display: block;

    width: 100%;
    height: 100%;

    color: inherit;
    text-decoration: none;
}


/* =========================================================
   Thumbnail
========================================================= */

.latest_portfolio_thumb {
    position: relative;
    display: block;

    width: 100%;
    height: 0;
    /* 대표이미지 기준 규격: 600 x 756 */
    padding-bottom: 126%;

    overflow: hidden;

    border: 1px solid #ececec;
    border-radius: 16px;
    background: #fff;
}


/*
 * FEATURED는 카드 전체 높이에 맞춤
 */

.latest_portfolio_item.featured .latest_portfolio_thumb {
    height: 0;
    padding-bottom: 126%;
}

.latest_portfolio_thumb img {
    position: absolute;
    top: 0;
    left: 0;

    display: block;

    width: 100%;
    height: 100%;

    /* 대표이미지 전체 노출 */
    object-fit: contain;
    object-position: center top;

    transition: opacity .25s ease;
}


.latest_portfolio_link:hover .latest_portfolio_thumb img {
    transform: none;
    opacity: .97;
}


/* =========================================================
   Information
========================================================= */

.latest_portfolio_info {
    margin-top: 14px;
}


.latest_portfolio_category {
    display: block;

    margin-bottom: 6px;

    color: var(--color-primary);

    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}


.latest_portfolio_title {
    margin: 0;

    color: var(--color-title);

    font-size: 18px;
    font-weight: 600;
    line-height: 1.45;

    word-break: keep-all;
}


/* 첫 번째 항목도 동일한 제목 크기 */
.latest_portfolio_item.featured .latest_portfolio_title {
    font-size: 18px;
}


/* =========================================================
   Empty
========================================================= */

.latest_portfolio_empty {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 300px;

    border: 1px solid var(--color-line);
    border-radius: 16px;

    color: var(--color-subtext);

    font-size: 16px;
}


/* =========================================================
   Tablet
   3 columns × 2 rows
========================================================= */

@media (max-width: 1024px) {

    .latest_portfolio_grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-template-rows: auto;
        gap: 36px 18px;
    }

    /* FEATURED 해제 */
    .latest_portfolio_item.featured {
        grid-column: auto;
        grid-row: auto;
    }

    /* 모든 이미지 동일 비율 */
    .latest_portfolio_item.featured .latest_portfolio_thumb,
    .latest_portfolio_thumb {
        height: 0;
        padding-bottom: 126%;
    }

    /* 제목 크기도 동일하게 */
    .latest_portfolio_item.featured .latest_portfolio_title,
    .latest_portfolio_title {
        font-size: 18px;
    }

    /* 7번째 포트폴리오 숨김 */
    .latest_portfolio_item:nth-child(n+7) {
        display: none;
    }

}


/* =========================================================
   Mobile
   2 columns × 3 rows
========================================================= */

@media (max-width: 600px) {

    .latest_portfolio_grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px 12px;
    }

    .latest_portfolio_info {
        margin-top: 8px;
    }

    .latest_portfolio_category {
        margin-bottom: 3px;
        font-size: 14px;
        line-height: 1.3;
    }

    .latest_portfolio_item.featured .latest_portfolio_title,
    .latest_portfolio_title {
        font-size: 16px;
        line-height: 1.35;
    }

}
/* =========================================================
   PC 메인 포트폴리오 미리보기
   - 기존 세로형 대표이미지 높이의 약 2/3만 기본 노출
   - 마우스를 올리면 이미지 상단에서 하단까지 3초 슬라이드
   - 이미지 클릭 이동 대신 사이트 보기 버튼으로 이동
   - 1024px 이하 모바일/태블릿은 기존 카드 링크/비율 유지
========================================================= */

.latest_portfolio_card {
    position: relative;
}

.latest_portfolio_mobile_link {
    display: none;
}

.latest_portfolio_hover_hint,
.latest_portfolio_site_btn {
    display: none;
}

@media (min-width: 1025px) and (hover: hover) {

    .latest_portfolio_thumb,
    .latest_portfolio_item.featured .latest_portfolio_thumb {
        /* 기존 600x756(126%) 높이의 약 2/3 = 600x504(84%) */
        height: 0;
        padding-bottom: 84%;
    }

    .latest_portfolio_thumb img,
    .latest_portfolio_item.featured .latest_portfolio_thumb img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center top;
        transform: none;
        opacity: 1;
        transition:
            object-position 3s linear,
            opacity .25s ease;
        will-change: object-position;
    }

    .latest_portfolio_thumb:hover img {
        object-position: center bottom;
        transform: none;
        opacity: 1;
    }

    .latest_portfolio_hover_hint {
        position: absolute;
        top: 14px;
        left: 14px;
        z-index: 3;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        min-height: 30px;
        padding: 5px 10px 5px 8px;
        border: 1px solid rgba(255, 255, 255, .48);
        border-radius: 999px;
        background: rgba(255, 255, 255, .70);
        box-shadow: 0 3px 12px rgba(0, 0, 0, .06);
        color: rgba(35, 35, 35, .55);
        font-size: 11px;
        font-weight: 600;
        line-height: 1;
        letter-spacing: -.02em;
        pointer-events: none;
        opacity: .80;
        visibility: visible;
        transition: opacity .18s ease, visibility .18s ease;
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
    }

    .latest_portfolio_hover_hint_icon {
        display: flex;
        width: 18px;
        height: 18px;
        align-items: center;
        justify-content: center;
    }

    .latest_portfolio_hover_hint_icon svg {
        display: block;
        width: 18px;
        height: 18px;
    }

    .latest_portfolio_thumb:hover .latest_portfolio_hover_hint {
        visibility: hidden;
        opacity: 0;
    }

    .latest_portfolio_info {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .latest_portfolio_text {
        min-width: 0;
        flex: 1 1 auto;
    }

    .latest_portfolio_title,
    .latest_portfolio_item.featured .latest_portfolio_title {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .latest_portfolio_site_btn {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        min-height: 36px;
        padding: 0 12px;
        border: 1px solid var(--color-primary);
        border-radius: 999px;
        background: #fff;
        color: var(--color-primary);
        font-size: 12px;
        font-weight: 700;
        line-height: 1;
        white-space: nowrap;
        text-decoration: none;
        transition:
            background-color .25s ease,
            color .25s ease,
            border-color .25s ease;
    }

    .latest_portfolio_site_btn:hover,
    .latest_portfolio_site_btn:focus {
        border-color: var(--color-primary);
        background: var(--color-primary);
        color: #fff;
    }

    .latest_portfolio_site_btn_arrow {
        font-size: 14px;
        line-height: 1;
        transition: transform .25s ease;
    }

    .latest_portfolio_site_btn:hover .latest_portfolio_site_btn_arrow,
    .latest_portfolio_site_btn:focus .latest_portfolio_site_btn_arrow {
        transform: translateX(3px);
    }
}

/* 모바일/태블릿은 직전 상태를 그대로 유지합니다. */
@media (max-width: 1024px) {
    .latest_portfolio_mobile_link {
        position: absolute;
        inset: 0;
        z-index: 4;
        display: block;
    }

    .latest_portfolio_site_btn,
    .latest_portfolio_hover_hint {
        display: none !important;
    }
}


/* =========================================================
   PC 메인 포트폴리오 최종 강제 보정
   - 4개 × 2줄
   - 첫 카드 확대 금지
   - 세로형 대표이미지의 약 2/3 높이만 노출
   - 외부의 과거 featured/grid CSS보다 우선 적용
========================================================= */
@media (min-width: 1025px) {
    .latest_portfolio_grid {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        grid-template-rows: none !important;
        grid-auto-rows: auto !important;
        gap: 24px !important;
    }

    .latest_portfolio_item,
    .latest_portfolio_item.featured {
        grid-column: auto !important;
        grid-row: auto !important;
        min-width: 0;
    }

    .latest_portfolio_thumb,
    .latest_portfolio_item.featured .latest_portfolio_thumb {
        position: relative;
        width: 100%;
        height: 0 !important;
        padding-bottom: 84% !important;
        overflow: hidden;
    }

    .latest_portfolio_info {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .latest_portfolio_site_btn {
        flex: 0 0 auto;
        display: inline-flex;
    }

    .latest_portfolio_mobile_link {
        display: none !important;
    }
}

@media (min-width: 1025px) and (hover: hover) {
    .latest_portfolio_thumb img,
    .latest_portfolio_item.featured .latest_portfolio_thumb img {
        position: absolute !important;
        top: 0;
        left: 0;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center top !important;
        transform: none !important;
        transition: object-position 3s linear, opacity .25s ease !important;
        will-change: object-position;
    }

    .latest_portfolio_thumb:hover img,
    .latest_portfolio_item.featured .latest_portfolio_thumb:hover img {
        object-position: center bottom !important;
        transform: none !important;
    }
}


/* =========================================================
   모바일 메인 포트폴리오 최종 보정
   - 2열 × 4줄 = 최대 8개
   - 세로형 대표이미지 높이의 약 2/3만 기본 노출
   - 이미지 터치 시 실제 이미지 끝까지 슬라이드 후 자동 복귀
   - 터치 안내는 좌측 상단, 복귀 완료 후 다시 표시
   - 사이트 이동은 사이트 보기 버튼으로만 처리
========================================================= */
.latest_portfolio_touch_hint {
    display: none;
}

@media (max-width: 600px) {
    .latest_portfolio_grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-template-rows: auto !important;
        gap: 22px 12px !important;
    }

    /* 태블릿 규칙에서 숨긴 7~8번째를 모바일에서는 다시 노출 */
    .latest_portfolio_item:nth-child(7),
    .latest_portfolio_item:nth-child(8) {
        display: block !important;
    }

    /* 모바일 메인은 최대 8개 */
    .latest_portfolio_item:nth-child(n+9) {
        display: none !important;
    }

    .latest_portfolio_thumb,
    .latest_portfolio_item.featured .latest_portfolio_thumb {
        position: relative;
        width: 100%;
        height: 0 !important;
        /* 기존 600x756(126%) 높이의 약 2/3 = 84% */
        padding-bottom: 84% !important;
        overflow: hidden;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .latest_portfolio_thumb img,
    .latest_portfolio_item.featured .latest_portfolio_thumb img {
        position: absolute !important;
        top: 0;
        left: 0;
        display: block;
        width: 100% !important;
        height: auto !important;
        max-width: none;
        object-fit: initial !important;
        object-position: initial !important;
        transform: translate3d(0, 0, 0) !important;
        opacity: 1 !important;
        transition:
            transform var(--main-portfolio-preview-duration, 2.4s) linear,
            opacity .25s ease !important;
        will-change: transform;
    }

    .latest_portfolio_thumb.is_touch_preview img,
    .latest_portfolio_item.featured .latest_portfolio_thumb.is_touch_preview img {
        transform: translate3d(0, calc(-1 * var(--main-portfolio-preview-distance, 0px)), 0) !important;
    }

    .latest_portfolio_thumb.is_touch_returning img,
    .latest_portfolio_item.featured .latest_portfolio_thumb.is_touch_returning img {
        transform: translate3d(0, 0, 0) !important;
        transition:
            transform var(--main-portfolio-return-duration, .75s) ease-in-out,
            opacity .25s ease !important;
    }

    .latest_portfolio_touch_hint {
        position: absolute;
        top: 10px;
        left: 10px;
        z-index: 5;
        display: inline-flex;
        align-items: center;
        gap: 4px;
        min-height: 26px;
        padding: 4px 8px 4px 6px;
        border: 1px solid rgba(255, 255, 255, .52);
        border-radius: 999px;
        background: rgba(255, 255, 255, .72);
        box-shadow: 0 3px 12px rgba(0, 0, 0, .06);
        color: rgba(35, 35, 35, .56);
        font-size: 10px;
        font-weight: 600;
        line-height: 1;
        letter-spacing: -.02em;
        pointer-events: none;
        opacity: .82;
        visibility: visible;
        transition: opacity .18s ease, visibility .18s ease;
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
    }

    .latest_portfolio_touch_hint_icon {
        display: flex;
        width: 16px;
        height: 16px;
        align-items: center;
        justify-content: center;
    }

    .latest_portfolio_touch_hint_icon svg {
        display: block;
        width: 16px;
        height: 16px;
    }

    .latest_portfolio_thumb.is_touch_preview .latest_portfolio_touch_hint,
    .latest_portfolio_thumb.is_touch_returning .latest_portfolio_touch_hint {
        opacity: 0;
        visibility: hidden;
    }

    /* 모바일에서는 이미지 터치와 사이트 이동을 분리 */
    .latest_portfolio_mobile_link {
        display: none !important;
    }

    .latest_portfolio_hover_hint {
        display: none !important;
    }

    .latest_portfolio_info {
        display: block;
        margin-top: 8px;
    }

    .latest_portfolio_site_btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: 4px;
        min-height: 30px;
        margin-top: 8px;
        padding: 0 9px;
        border: 1px solid var(--color-primary);
        border-radius: 999px;
        background: #fff;
        color: var(--color-primary);
        font-size: 10px;
        font-weight: 700;
        line-height: 1;
        white-space: nowrap;
        text-decoration: none;
    }

    .latest_portfolio_site_btn_arrow {
        font-size: 12px;
    }
}
