/* =========================================================
   ASUNG DESIGN — Style 1 Home (index only)
   Bench: salad-bowl.co.kr / vertical sidebar + project mosaic
========================================================= */

:root {
    --asung-bg: #ffffff;
    --asung-sidebar: #ffffff;
    --asung-ink: #1a1a1a;
    --asung-muted: #8a8a8a;
    --asung-line: #e8e8e4;
    /* 고객 기준: 브라우저 125% 느낌을 100% 기본값으로 */
    --asung-scale: 1.25;
    --asung-sidebar-w: calc(70px * var(--asung-scale));
    --asung-tile-w: calc(500px * var(--asung-scale));
    --asung-font: 'Pretendard', 'Pretendard Variable', 'Noto Sans KR', sans-serif;
}

/* ---------- Hide legacy rentcar chrome on home only ---------- */
body.asung-home-page,
body.asung-page {
    margin: 0;
    background: var(--asung-bg);
    font-family: var(--asung-font);
    color: var(--asung-ink);
}

body.asung-home-page {
    overflow: hidden;
}

body.asung-home-page .header,
body.asung-home-page .mob-header,
body.asung-home-page .quick-fixed,
body.asung-home-page .mobile-side-fixed,
body.asung-home-page .mobile-bottom-nav,
body.asung-home-page #footer,
body.asung-page .header,
body.asung-page .mob-header,
body.asung-page .quick-fixed,
body.asung-page .mobile-side-fixed,
body.asung-page .mobile-bottom-nav,
body.asung-page #footer {
    display: none !important;
}

body.asung-home-page,
body.asung-page {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

body.asung-home-page #wrapper,
body.asung-home-page #container,
body.asung-home-page #container_wr,
body.asung-home-page .wrapper,
body.asung-page #wrapper,
body.asung-page #container,
body.asung-page #container_wr,
body.asung-page .wrapper {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

/* ---------- Shell ---------- */
.asung-home {
    display: flex;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: var(--asung-bg);
}

/* ---------- Left sidebar ---------- */
.asung-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: var(--asung-sidebar-w);
    height: 100vh;
    height: 100dvh;
    padding: calc(20px * var(--asung-scale)) 0;
    box-sizing: border-box;
    background: transparent;
    border-right: 0;
    overflow: visible;
}

.asung-brand {
    display: flex;
    align-items: flex-start;
    align-self: flex-start;
    justify-content: flex-start;
    padding-left: calc(20px * var(--asung-scale));
    box-sizing: border-box;
    text-decoration: none;
    color: var(--asung-ink);
}

.asung-brand-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(6px * var(--asung-scale));
}

.asung-brand-word {
    writing-mode: vertical-lr;
    text-orientation: upright;
    font-size: calc(20px * var(--asung-scale));
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1;
    white-space: nowrap;
}

.asung-social {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: calc(8px * var(--asung-scale));
    flex-shrink: 0;
    align-self: flex-start;
}

.asung-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--asung-ink);
    text-decoration: none;
    opacity: 0.72;
    transition: opacity 0.2s ease;
}

.asung-social-link:hover,
.asung-social-link:focus-visible {
    opacity: 1;
}

.asung-social-ico--n,
.asung-social-ico--ig {
    display: block;
    width: calc(18px * var(--asung-scale));
    height: calc(18px * var(--asung-scale));
    object-fit: contain;
}

/* 좌측 하단: 예전 다줄 블록 형태 유지 + 글자만 정방향 */
.asung-sidebar-foot {
    position: absolute;
    left: calc(20px * var(--asung-scale));
    bottom: calc(24px * var(--asung-scale));
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: calc(12px * var(--asung-scale));
    width: auto;
    max-width: none;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    transform: none;
}

.asung-sidebar-meta {
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-start;
    gap: calc(8px * var(--asung-scale));
    font-size: calc(10px * var(--asung-scale));
    font-weight: 400;
    line-height: 1;
    color: var(--asung-ink);
}

.asung-meta-line,
.asung-meta-copy {
    display: block;
    margin: 0;
    writing-mode: vertical-rl;
    text-orientation: upright;
    white-space: nowrap;
    letter-spacing: -0.22em;
    line-height: 1;
    word-break: keep-all;
}

/* (주)/(C) 한 덩어리 — upright에서 괄호가 벌어지지 않게 */
.asung-meta-combine {
    text-combine-upright: all;
    -webkit-text-combine: horizontal;
}

/* upright 세로쓰기에서 일반 스페이스가 글자폭으로 커지는 문제 → 얇은 간격만 */
.asung-meta-sp {
    display: inline;
    font-size: 0.3em;
    letter-spacing: 0;
    line-height: 1;
}

/* 하이픈을 세로 방향 막대로 */
.asung-meta-hyphen {
    display: inline-block;
    width: 1em;
    font-size: 0.85em;
    letter-spacing: 0;
    line-height: 1;
    text-align: center;
    transform: rotate(90deg);
}

.asung-meta-copy {
    opacity: 0.85;
}

/* ---------- Main ---------- */
.asung-main {
    position: relative;
    flex: 1;
    margin-left: var(--asung-sidebar-w);
    min-width: 0;
    height: 100%;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
}

/* 서브 페이지: 사이드바 width만큼 밀고, 남은 영역에서 콘텐츠 가운데 */
.asung-home.asung-home--page {
    display: block;
    width: 100%;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible;
}

.asung-main.asung-main--page {
    display: flex;
    flex-direction: column;
    align-items: center; /* 사이드바 민 영역 안에서 자식 가로 가운데 */
    box-sizing: border-box;
    width: calc(100% - var(--asung-sidebar-w));
    margin-left: var(--asung-sidebar-w);
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible;
}

body.asung-page {
    overflow-x: hidden;
    overflow-y: auto;
    height: auto;
}

body.asung-page #wrapper,
body.asung-page #container,
body.asung-page #container_wr,
body.asung-page .wrapper {
    overflow: visible !important;
    height: auto !important;
}

.asung-menu-toggle {
    display: none;
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 50;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--asung-line);
    border-radius: 0;
    background: #fff;
    cursor: pointer;
}

.asung-menu-toggle span {
    display: block;
    width: 18px;
    height: 1px;
    margin: 5px auto;
    background: var(--asung-ink);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

body.asung-nav-open .asung-menu-toggle span:first-child {
    transform: translateY(3px) rotate(45deg);
}

body.asung-nav-open .asung-menu-toggle span:last-child {
    transform: translateY(-3px) rotate(-45deg);
}

.asung-stage {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: calc(12px * var(--asung-scale));
    width: max-content;
    max-width: 100%;
    height: 100%;
    min-height: 0;
    margin-left: auto;
    margin-right: 0;
    padding: calc(20px * var(--asung-scale)) 0;
    box-sizing: border-box;
}

/* PROJECT 페이지만: 모자이크 스테이지 가로 가운데 */
.asung-stage.asung-stage--center {
    margin-left: auto;
    margin-right: auto;
}

/* PROJECT 분류 메뉴 (Home / Medical) — stage 위 */
.asung-main.asung-main--project {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

/* PROJECT: 좌/우 개별 스크롤 해제 → body 스크롤 */
body.asung-home-page.asung-project-page {
    /* overflow-x:hidden 은 sticky를 깨뜨리는 경우가 있어 clip 사용 */
    overflow-x: clip;
    overflow-y: auto;
    height: auto;
}

body.asung-home-page.asung-project-page #wrapper,
body.asung-home-page.asung-project-page #container,
body.asung-home-page.asung-project-page #container_wr,
body.asung-home-page.asung-project-page .wrapper {
    overflow: visible !important;
    height: auto !important;
}

body.asung-project-page .asung-home {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible;
}

body.asung-project-page .asung-main.asung-main--project {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible;
}

body.asung-project-page .asung-main.asung-main--project .asung-stage {
    flex: 0 0 auto;
    align-items: flex-start;
    height: auto;
    min-height: 0;
    padding-top: calc(20px * var(--asung-scale));
    padding-bottom: calc(60px * var(--asung-scale));
    overflow: visible;
}

/* 프로젝트 아이템 타이틀 sticky는 해제, 네비만 sticky 유지 */
body.asung-project-page .asung-main.asung-main--project .asung-nav {
    position: sticky;
    top: calc(20px * var(--asung-scale));
    align-self: flex-start;
    flex-shrink: 0;
    height: auto;
    max-height: calc(100vh - (40px * var(--asung-scale)));
    z-index: 30;
}

body.asung-project-page .asung-grid {
    height: auto;
    align-items: start;
}

body.asung-project-page .asung-col-wrap {
    height: auto;
    align-items: flex-start;
}

body.asung-project-page .asung-col {
    height: auto;
    overflow: visible;
}

body.asung-project-page .asung-scrollbar {
    display: none;
}

/* body 스크롤에서는 컬럼 sticky 캡션이 뷰포트에 붙으므로 해제 */
body.asung-project-page .asung-tile-cap {
    position: static;
}

.asung-project-cats {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: calc(56px * var(--asung-scale));
    flex: 0 0 auto;
    margin: 0;
    padding: calc(18px * var(--asung-scale)) calc(20px * var(--asung-scale)) calc(16px * var(--asung-scale));
    box-sizing: border-box;
}

.asung-project-cats__link {
    color: var(--asung-ink);
    text-decoration: none;
    font-family: 'Pretendard', 'Pretendard Variable', sans-serif;
    font-size: calc(32px * var(--asung-scale));
    font-weight: 500;
    letter-spacing: normal;
    text-transform: none;
    opacity: 0.35;
    transition: opacity 0.2s ease;
}

.asung-project-cats__link:hover,
.asung-project-cats__link:focus-visible,
.asung-project-cats__link.is-active {
    opacity: 1;
}

.asung-main.asung-main--project .asung-stage {
    flex: 1 1 auto;
    min-height: 0;
    padding-top: calc(20px * var(--asung-scale));
}

.asung-nav {
    position: static;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
    gap: calc(22px * var(--asung-scale));
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 서브 페이지: 햄버거 대신 우상단 고정 세로 메뉴 */
.asung-nav--corner {
    position: fixed;
    top: calc(20px * var(--asung-scale));
    right: calc(28px * var(--asung-scale));
    z-index: 50;
    margin: 0;
}

.asung-nav-link.is-active {
    opacity: 0.55;
}

.asung-nav-symbol {
    display: block;
    width: calc(36px * var(--asung-scale));
    height: auto;
    line-height: 0;
    flex-shrink: 0;
    margin: calc(20px * var(--asung-scale)) auto 0;
}

.asung-nav-symbol img {
    display: block;
    width: 100%;
    height: auto;
}

.asung-nav-links {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: calc(4px * var(--asung-scale));
}

.asung-nav-link {
    writing-mode: vertical-lr;
    text-orientation: upright;
    font-size: calc(12px * var(--asung-scale));
    font-weight: 500;
    letter-spacing: calc(-3px * var(--asung-scale));
    line-height: 1;
    color: var(--asung-ink);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.asung-nav-link:hover,
.asung-nav-link:focus-visible {
    opacity: 0.55;
}

/* ---------- Project mosaic (좌/우 독립 스크롤) ---------- */
.asung-grid {
    display: grid;
    grid-template-columns: max-content max-content;
    gap: calc(20px * var(--asung-scale));
    align-items: stretch;
    flex: 0 0 auto;
    min-width: 0;
    min-height: 0;
    width: auto;
    max-width: none;
    height: 100%;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.asung-col-wrap {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-width: 0;
    min-height: 0;
    height: 100%;
    gap: calc(8px * var(--asung-scale));
}

.asung-col {
    display: flex;
    flex-direction: column;
    gap: calc(20px * var(--asung-scale));
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.asung-col::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
    background: transparent;
}

/* 타이틀 우측 1px 커스텀 스크롤바
   벤치(salad-bowl): track 밝음 + thumb 어두움 → 움직이는 막대만 보임
   기존: track/thumb 둘 다 ink → 항상 세로 border처럼만 보임 */
.asung-scrollbar {
    position: relative;
    flex: 0 0 1.5px;
    width: 1.5px;
    min-width: 1.5px;
    align-self: stretch;
    background: transparent;
}

.asung-scrollbar-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 1.5px;
    min-height: 24px;
    height: 40%;
    background: var(--asung-ink);
    border-radius: 0;
    pointer-events: none;
}

.asung-tile {
    position: relative;
    overflow: visible;
    background: transparent;
    min-height: 0;
    flex-shrink: 0;
    width: 100%;
}

.asung-tile-body {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: calc(8px * var(--asung-scale));
    width: 100%;
}

.asung-tile-media {
    position: relative;
    display: block;
    flex: 0 0 var(--asung-tile-w);
    width: var(--asung-tile-w);
    max-width: var(--asung-tile-w);
    overflow: hidden;
    background: #ecece8;
    aspect-ratio: 3 / 4;
    color: inherit;
    text-decoration: none;
}

/* 우측 첫번째만 좌측보다 살짝 길게 */
.asung-tile--lead .asung-tile-media {
    aspect-ratio: 3 / 4.35;
}

.asung-tile-media img {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.asung-tile-cap {
    position: sticky;
    top: 0;
    align-self: flex-start;
    z-index: 2;
    flex: 0 0 auto;
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-size: calc(10px * var(--asung-scale));
    font-weight: 500;
    letter-spacing: -0.22em;
    line-height: 1;
    color: var(--asung-ink);
    white-space: nowrap;
}

/* ---------- About ---------- */
.asung-about {
    margin-top: 72px;
    max-width: 640px;
    padding: 8px 4px 40px;
}

.asung-about-title {
    margin: 0 0 18px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.22em;
}

.asung-about-text {
    margin: 0;
    font-size: 15px;
    font-weight: 300;
    line-height: 1.85;
    color: #444;
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .asung-social-link,
    .asung-nav-link,
    .asung-menu-toggle span {
        transition: none;
    }
}

/* ---------- Tablet / Mobile ---------- */
@media (max-width: 1100px) {
    .asung-grid {
        grid-template-columns: 1fr 1fr;
        gap: 14px 16px;
    }
}

@media (max-width: 900px) {
    :root {
        --asung-scale: 1;
        --asung-sidebar-w: 0px;
        --asung-tile-w: min(100%, 420px);
    }

    .asung-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 56px;
        flex-direction: row;
        justify-content: flex-start;
        gap: 16px;
        padding: 0 18px;
        border-right: 0;
        border-bottom: 1px solid var(--asung-line);
    }

    .asung-brand {
        padding-left: 0;
        align-self: auto;
    }

    .asung-brand-text {
        flex-direction: row;
        gap: 6px;
    }

    .asung-brand-word {
        writing-mode: horizontal-tb;
        text-orientation: mixed;
        font-size: 12px;
        letter-spacing: 0;
    }

    .asung-sidebar-foot {
        position: static;
        left: auto;
        bottom: auto;
        writing-mode: horizontal-tb;
        text-orientation: mixed;
        transform: none;
        transform-origin: unset;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        margin-left: auto;
        margin-right: 52px;
        width: auto;
    }

    .asung-sidebar-meta {
        display: none;
    }

    .asung-social {
        flex-direction: row;
    }

    .asung-social-link {
        transform: none;
    }

    .asung-menu-toggle {
        display: block;
    }

    .asung-stage {
        flex-direction: column;
        width: 100%;
        max-width: none;
        height: auto;
        margin: 0;
        padding: 0;
        gap: 0;
    }

    .asung-nav {
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 0;
        background: #fff;
        border-bottom: 1px solid var(--asung-line);
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.04);
    }

    body.asung-nav-open .asung-nav {
        display: flex;
    }

    /* about 등: 우상단 세로 메뉴 유지 (햄버거 대체) */
    .asung-nav--corner {
        top: 16px;
        right: 16px;
        left: auto;
        display: flex !important;
        flex-direction: column;
        align-items: center;
        gap: 16px;
        padding: 0;
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    .asung-nav-symbol {
        display: none;
    }

    .asung-nav--corner .asung-nav-symbol {
        display: block;
    }

    .asung-nav-links {
        flex-direction: column;
        gap: 0;
    }

    .asung-nav--corner .asung-nav-links {
        flex-direction: row;
        align-items: flex-start;
        justify-content: center;
        gap: 4px;
    }

    .asung-nav-link {
        writing-mode: horizontal-tb;
        text-orientation: mixed;
        width: 100%;
        padding: 14px 20px;
        box-sizing: border-box;
        letter-spacing: 0;
    }

    .asung-nav--corner .asung-nav-link {
        writing-mode: vertical-lr;
        text-orientation: upright;
        width: auto;
        padding: 0;
        letter-spacing: -3px;
    }

    .asung-grid {
        width: min(100%, 420px);
        max-width: none;
        height: auto;
        margin-top: 24px;
        margin-left: auto;
        margin-right: auto;
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .asung-col-wrap {
        height: auto;
        gap: 0;
    }

    .asung-col {
        height: auto;
        overflow: visible;
        gap: 16px;
    }

    .asung-scrollbar {
        display: none;
    }

    .asung-tile-media,
    .asung-tile--lead .asung-tile-media {
        flex: 1 1 auto;
        width: 100%;
        max-width: none;
        aspect-ratio: 3 / 4;
    }

    .asung-about {
        margin-top: 24px;
    }

    body.asung-home-page {
        overflow: auto;
    }

    .asung-home {
        height: auto;
        min-height: 100dvh;
        overflow: visible;
        flex-direction: column;
    }

    .asung-main {
        height: auto;
        overflow: visible;
        margin-left: 0;
        padding: 80px 16px 64px;
    }
}

@media (max-width: 480px) {
    .asung-brand-word {
        font-size: 11px;
    }

    .asung-tile-cap {
        font-size: 9px;
    }
}
