/* ==========================================================================
   데이터개방포털 레이아웃 (25년 개선 디자인 퍼블리싱 v5 기준)
   - 포털 모드에서만 로드된다(template/portal/*). 민간플랫폼에는 영향 없음
   - 본문 화면과 겹치지 않도록 레이아웃 클래스는 모두 pt- 접두어를 쓰고, 요소 전체 규칙(*, a, button 등)은 두지 않는다
     (본문이 쓰는 Tailwind가 기본 초기화를 이미 한다)
   ========================================================================== */

@font-face { font-family: 'Pretendard'; font-weight: 400; font-display: swap; src: url('../egovframework/mt/fonts/Pretendard-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Pretendard'; font-weight: 500; font-display: swap; src: url('./fonts/Pretendard-Medium.woff2') format('woff2'); }
@font-face { font-family: 'Pretendard'; font-weight: 600; font-display: swap; src: url('../egovframework/mt/fonts/Pretendard-SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'Pretendard'; font-weight: 700; font-display: swap; src: url('./fonts/Pretendard-Bold.woff2') format('woff2'); }
@font-face { font-family: 'Gmarket Sans'; font-weight: 500; font-display: swap; src: url('./fonts/GmarketSansMedium.woff2') format('woff2'); }
@font-face { font-family: 'Gmarket Sans'; font-weight: 700; font-display: swap; src: url('./fonts/GmarketSansBold.woff2') format('woff2'); }

:root {
    --pt-blue: #2563EB;
    --pt-blue-dark: #1d4ed8;
    --pt-blue-light: #EFF6FF;
    --pt-text: #09090B;
    --pt-gray: #71717B;
    --pt-line: #E4E4E7;
    --pt-line-light: #F4F4F5;
    --pt-header-h: 108px;
}

body.pt-body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    color: var(--pt-text);
    background: #fff;
    line-height: 1.6;
    min-width: 1240px; /* 2026-10-16: 1280 → 1240 — 1280 화면에서 세로 스크롤바 폭(15px)만큼 가로 스크롤이 생기던 문제(본문 최대 1200px + 여백 20px×2) */
    padding-top: var(--pt-header-h);
}

/* ---------- Header ---------- */
.pt-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    min-width: 1240px; /* 2026-10-16: 1280 → 1240 — 1280 화면에서 세로 스크롤바 폭(15px)만큼 가로 스크롤이 생기던 문제(본문 최대 1200px + 여백 20px×2) */
}
.pt-header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--pt-line);
    opacity: 0;
    transition: opacity .3s ease;
}
.pt-header:hover::after,
.pt-header.is-scrolled::after { opacity: 1; }
.pt-header-inner {
    max-width: 1280px;
    height: var(--pt-header-h);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pt-logo {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-shrink: 0;
    color: #000;
    text-decoration: none;
}
.pt-logo-icon { width: 60px; height: 60px; }
.pt-logo-icon img { width: 100%; height: 100%; }
.pt-logo-text {
    display: flex;
    flex-direction: column;
    font-family: 'Gmarket Sans', sans-serif;
    font-size: 22px;
    line-height: 26px;
    color: #000;
}
.pt-logo-text span:first-child { font-weight: 500; }
.pt-logo-text span:last-child { font-weight: 700; }

/* 주 메뉴 + 전체 폭 펼침 메뉴 */
.pt-gnb {
    display: flex;
    align-items: center;
    height: 100%;
}
.pt-gnb-item {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}
.pt-gnb-link {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 23px;
    font-size: 17px;
    font-weight: 600;
    color: #000;
    line-height: normal;
    white-space: nowrap;
    text-decoration: none;
}
.pt-gnb-link::after {
    content: '';
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform: translate(-50%, 14px);
    width: 0;
    height: 2px;
    background: var(--pt-blue);
    transition: width .2s;
}
.pt-gnb-item:hover .pt-gnb-link::after,
.pt-gnb-item.is-active .pt-gnb-link::after { width: calc(100% - 46px); }
.pt-gnb-item.is-active .pt-gnb-link { color: var(--pt-blue); }

.pt-mega {
    position: fixed;
    top: var(--pt-header-h);
    left: 0;
    right: 0;
    min-width: 1240px; /* 2026-10-16: 1280 → 1240 — 1280 화면에서 세로 스크롤바 폭(15px)만큼 가로 스크롤이 생기던 문제(본문 최대 1200px + 여백 20px×2) */
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
    z-index: 999;
    line-height: normal;
}
.pt-gnb-item:hover .pt-mega,
.pt-gnb-item:focus-within .pt-mega { opacity: 1; visibility: visible; }
.pt-mega-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 20px 32px;
    display: flex;
    gap: 70px;
    align-items: flex-start;
}
/* 3단계가 없는 펼침 메뉴: 2단계를 세로로 한 줄씩 */
.pt-mega-inner.is-list {
    flex-direction: column;
    gap: 16px;
    padding-bottom: 28px;
}
.pt-mega-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
}
.pt-mega-main {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 15px;
    font-weight: 600;
    color: #000;
    white-space: nowrap;
    text-decoration: none;
    transition: color .2s;
}
.pt-mega-main::after {
    content: '';
    width: 14px;
    height: 14px;
    margin-left: 4px;
    background: url('../../images/portal/nav-arrow.svg') center / contain no-repeat;
}
.pt-mega-main:hover,
.pt-mega-main.is-active { color: var(--pt-blue); }
.pt-mega-subs { display: flex; flex-direction: column; gap: 12px; }
.pt-mega-sub {
    font-size: 13px;
    color: var(--pt-gray);
    white-space: nowrap;
    text-decoration: none;
    transition: color .2s;
}
.pt-mega-sub:hover,
.pt-mega-sub.is-active { color: var(--pt-blue); }

/* 로그인·회원가입·로그아웃·시스템관리 */
.pt-auth {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    min-width: 234px;
    flex-shrink: 0;
}
.pt-btn-text,
.pt-btn-fill {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 999px;
    font-size: 17px;
    font-weight: 700;
    line-height: normal;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    transition: all .3s;
}
.pt-btn-text { color: var(--pt-blue); background: transparent; }
.pt-btn-text:hover { background: rgba(37, 99, 235, .1); }
.pt-btn-fill { color: #fff; background: var(--pt-blue); border: 1.5px solid var(--pt-blue); }
.pt-btn-fill:hover { background: var(--pt-blue-dark); border-color: var(--pt-blue-dark); }

.pt-mobile-btn { display: none; width: 24px; height: 24px; padding: 0; background: none; border: 0; cursor: pointer; }
.pt-mobile-btn img { width: 100%; height: 100%; }

/* ---------- Mobile menu ---------- */
.pt-mobile {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    flex-direction: column;
    overflow-y: auto;
    background: #fff;
}
.pt-mobile.is-open { display: flex; }
.pt-mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 12px 11px;
}
.pt-mobile-head .pt-logo-icon { width: 24px; height: 24px; }
.pt-mobile-head .pt-logo-text { flex-direction: row; gap: 4px; font-size: 15px; line-height: normal; }
.pt-mobile-close { width: 24px; height: 24px; padding: 0; background: none; border: 0; cursor: pointer; }
.pt-mobile-close img { width: 100%; height: 100%; }
.pt-mobile-body { padding: 0 20px 24px; }
.pt-mobile-auth { display: flex; gap: 8px; padding: 4px 0 16px; }
.pt-mobile-btn-light,
.pt-mobile-btn-fill {
    flex: 1;
    padding: 12px 0;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 700;
    line-height: normal;
    text-align: center;
    text-decoration: none;
}
.pt-mobile-btn-light { color: var(--pt-blue); background: var(--pt-blue-light); }
.pt-mobile-btn-fill { color: #fff; background: var(--pt-blue); }
.pt-mobile-nav { border: 1px solid var(--pt-line-light); border-radius: 4px; overflow: hidden; }
.pt-mobile-item { border-bottom: 1px solid var(--pt-line-light); }
.pt-mobile-item:last-child { border-bottom: 0; }
.pt-mobile-item.is-open { background: #FAFAFA; }
.pt-mobile-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 600;
    color: var(--pt-text);
    line-height: normal;
    text-align: left;
    text-decoration: none;
    background: none;
    border: 0;
    cursor: pointer;
}
.pt-mobile-item.is-open .pt-mobile-toggle span { color: var(--pt-blue); }
.pt-caret { width: 16px; height: 16px; transition: transform .3s; }
.pt-mobile-item.is-open .pt-caret { transform: rotate(180deg); }
.pt-mobile-sub { display: none; flex-direction: column; padding: 4px 0 8px; }
.pt-mobile-item.is-open .pt-mobile-sub { display: flex; }
.pt-mobile-subitem {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #52525C;
    line-height: normal;
    text-decoration: none;
}
.pt-mobile-subitem.pt-mobile-depth3 { padding: 8px 20px 8px 32px; font-size: 13px; font-weight: 400; color: var(--pt-gray); }
.pt-mobile-subitem.is-active { color: var(--pt-blue); }

/* 본문 화면의 Tailwind 모달(fixed + z-50: 미리보기·상세 등)이 고정 헤더(z-index 1000)에 가려지지 않게 */
body.pt-body .fixed.z-50 { z-index: 1100; }

/* 알림마당 게시판(9/29 퍼블리싱, 두 사이트 공용 board0107)은 자체 여백·폭을 갖고 있어 포털 레이아웃 안에서는 뺀다 */
body.pt-body .board0107 { padding: 0; }
body.pt-body .board0107 .content-wrapper { max-width: none; }

/* ---------- 대메뉴 배너 ---------- */
.pt-hero {
    height: 394px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: linear-gradient(to bottom, #1e1e1e 0%, rgba(37, 37, 39, .855) 72.934%, rgba(39, 39, 42, .8) 100%),
                url('../../images/portal/hero-sub.jpg') center / cover no-repeat;
}
.pt-hero h1 {
    margin: 0;
    padding-bottom: 123px;
    font-size: 55px;
    font-weight: 700;
    line-height: normal;
    color: #fff;
}

/* ---------- 본문 영역 ---------- */
.pt-page { padding: 42px 0 100px; min-height: 60vh; }
.pt-wrap {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.pt-page-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: normal;
    color: #000;
}
.pt-container {
    display: flex;
    gap: 22px;
    align-items: flex-start;
    min-width: 0;
}
.pt-main { flex: 1; min-width: 0; }

/* 좌측 메뉴 */
.pt-lnb { width: 172px; flex-shrink: 0; }
.pt-lnb-nav { display: flex; flex-direction: column; gap: 8px; }
.pt-lnb-item,
.pt-lnb-group {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border: 1px solid var(--pt-line);
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -.32px;
    line-height: normal;
    color: #212121;
    text-align: left;
    text-decoration: none;
    background: #fff;
    cursor: pointer;
    transition: all .3s;
}
.pt-lnb-item:hover,
.pt-lnb-group:hover { background: var(--pt-line-light); }
.pt-lnb-item.is-active,
.pt-lnb-section.is-open .pt-lnb-group {
    color: #fff;
    font-weight: 600;
    background: var(--pt-blue);
    border-color: var(--pt-blue);
}
.pt-lnb-section.is-open .pt-lnb-group .pt-caret { filter: brightness(0) invert(1); transform: rotate(180deg); }
.pt-lnb-sub {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
}
.pt-lnb-section.is-open .pt-lnb-sub { max-height: 600px; margin-top: 6px; }
.pt-lnb-subitem {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 4px;
    font-size: 16px;
    color: var(--pt-gray);
    letter-spacing: -.32px;
    line-height: normal;
    text-decoration: none;
    transition: all .3s;
}
.pt-lnb-subitem:hover,
.pt-lnb-subitem.is-active { color: var(--pt-blue); font-weight: 500; background: var(--pt-blue-light); }
/* 긴 메뉴 이름(예: 물류데이터 기반 신서비스 소개)이 단어 중간에서 끊기지 않게 띄어쓰기 단위로만 줄바꿈 (2026-10-15 기획자 요청) */
.pt-lnb-item, .pt-lnb-group, .pt-lnb-subitem { word-break: keep-all; }

/* ---------- Footer ---------- */
.pt-footer { background: #fff; border-top: 1px solid var(--pt-line); }
.pt-footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 0 30px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}
.pt-footer-logo { display: flex; align-items: center; gap: 9px; }
.pt-footer-logo-icon { width: 52px; height: 52px; }
.pt-footer-logo-icon img { width: 100%; height: 100%; }
.pt-footer-logo-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-family: 'Gmarket Sans', sans-serif;
    font-size: 18px;
    line-height: 1.2;
    color: #000;
}
.pt-footer-info { display: flex; flex-direction: column; gap: 14px; font-size: 14px; line-height: normal; color: #000; }
.pt-footer-info p { margin: 0; }
.pt-footer-info strong { font-weight: 700; }
.pt-copyright { font-size: 12px; color: #9F9FA9; }
.pt-footer-links { display: flex; flex-direction: column; gap: 4px; font-size: 12px; text-align: right; }
.pt-footer-links a { color: inherit; text-decoration: underline; transition: color .3s; }
.pt-footer-links a:hover { color: var(--pt-blue); }

/* ---------- 반응형 ---------- */
@media (max-width: 1440px) {
    .pt-wrap { max-width: 1200px; padding: 0 20px; }
}

@media (max-width: 768px) {
    :root { --pt-header-h: 48px; }
    body.pt-body { min-width: auto; }
    .pt-header { min-width: auto; border-bottom: 1px solid var(--pt-line-light); }
    .pt-header-inner { height: var(--pt-header-h); padding: 12px 16px 12px 11px; }
    .pt-logo { gap: 8px; }
    .pt-logo-icon { width: 24px; height: 24px; }
    .pt-logo-text { flex-direction: row; gap: 4px; font-size: 15px; line-height: normal; }
    .pt-gnb, .pt-auth, .pt-mega { display: none; }
    .pt-mobile-btn { display: block; }

    .pt-hero { height: 200px; align-items: center; }
    .pt-hero h1 { padding-bottom: 0; font-size: 28px; }

    .pt-page { padding: 0 0 72px; }
    .pt-wrap { padding: 0; gap: 0; }
    .pt-page-title { display: none; }
    .pt-container { flex-direction: column; gap: 0; }
    .pt-main { width: 100%; padding: 20px; }

    /* 좌측 메뉴 → 가로 스크롤 탭 */
    .pt-lnb { width: 100%; position: relative; }
    .pt-lnb-nav {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0;
        overflow-x: auto;
        scrollbar-width: none;
        border-bottom: 2px solid var(--pt-line);
    }
    .pt-lnb-nav::-webkit-scrollbar { display: none; }
    .pt-lnb-item,
    .pt-lnb-group {
        width: auto;
        flex-shrink: 0;
        padding: 14px 20px;
        border: 0;
        border-bottom: 2px solid transparent;
        border-radius: 0;
        margin-bottom: -2px;
        font-size: 14px;
        letter-spacing: 0;
        color: #A1A1AA;
        white-space: nowrap;
        background: transparent;
    }
    .pt-lnb-item:hover, .pt-lnb-group:hover { background: transparent; }
    .pt-lnb-item.is-active,
    .pt-lnb-section.is-open .pt-lnb-group {
        color: var(--pt-blue);
        font-weight: 600;
        background: transparent;
        border-bottom-color: var(--pt-blue);
    }
    .pt-lnb-group .pt-caret { display: none; }
    .pt-lnb-section { position: static; flex-shrink: 0; }
    .pt-lnb-sub {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: row;
        gap: 8px;
        max-height: none;
        padding: 6px 20px;
        overflow-x: auto;
        scrollbar-width: none;
        background: #fff;
    }
    .pt-lnb-sub::-webkit-scrollbar { display: none; }
    .pt-lnb-section.is-open .pt-lnb-sub { display: flex; margin-top: 0; }
    .pt-lnb-subitem {
        flex-shrink: 0;
        padding: 10px 16px;
        border-radius: 99px;
        font-size: 13px;
        white-space: nowrap;
        color: #9F9FA9;
        background: #FAFAFA;
    }
    .pt-lnb-subitem.is-active { color: #fff; font-weight: 600; background: var(--pt-blue); }
    .pt-lnb:has(.pt-lnb-section.is-open) { margin-bottom: 52px; }

    .pt-footer-inner { flex-direction: column; align-items: center; padding: 0; }
    .pt-footer-links { order: 1; width: 100%; padding: 19px 0; gap: 6px; text-align: center; }
    .pt-footer-logo { order: 2; width: 100%; justify-content: center; padding: 19px 0; border-top: 1px solid var(--pt-line-light); }
    .pt-footer-logo-icon { width: 40px; height: 40px; }
    .pt-footer-logo-text { flex-direction: row; font-size: 15px; }
    .pt-footer-info { order: 3; width: 100%; align-items: center; padding: 19px 0; text-align: center; border-top: 1px solid var(--pt-line-light); }
    .pt-footer-info p { font-size: 13px; color: #3F3F46; }
}
