@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

/* 기본 스타일 리셋 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html body,
html body h1,
html body h2,
html body h3,
html body h4,
html body h5,
html body h6,
html body input,
html body button,
html body textarea,
html body select,
html body table,
html body th,
html body td,
html body p,
html body span,
html body a,
html body div,
html body li {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    font-size: 16px;
    line-height: 1.5;
    color: #000;
    background-color: #fff;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

ul,
ol {
    list-style: none;
}

/* WWD 스타일 헤더 */
#header {
    background-color: #fff;
    border-bottom: 2px solid #000;
    padding: 0;
    width: 100%;
    z-index: 1000;
}

body.is-index #header {
    position: fixed;
    top: 0;
    left: 0;
    background-color: transparent;
    border-bottom: none;
    transition: all 0.3s ease;
}

body.is-index #header.scrolled {
    background-color: #fff;
    border-bottom: 1px solid #e5e5e5;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.main-logo-img {
    height: 48px;
    width: auto;
    filter: brightness(0);
    /* Black by default */
    transition: filter 0.3s ease;
}

body.is-index #header:not(.scrolled) .main-logo-img {
    filter: brightness(0) invert(1);
    /* White on transparent index */
}

body.is-index #header:not(.scrolled) .header-topbar {
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

body.is-index #header:not(.scrolled) .header-bottom {
    background: transparent;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: none;
}

body.is-index #header:not(.scrolled) .header-util a,
body.is-index #header:not(.scrolled) .gnb .menu-list li a,
body.is-index #header:not(.scrolled) .header-search a {
    color: #fff;
}

body.is-index #header.scrolled .header-topbar {
    display: none;
    /* 스크롤 시 상단 툴바 숨김으로 깔끔하게 처리 */
}

body:not(.is-index) {
    padding-top: 156px;
    /* Header height for other pages */
}

@media (max-width: 768px) {
    body:not(.is-index) {
        padding-top: 100px;
    }
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Single Line Header Layout */
.single-line-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 80px;
}

/* 로고 영역 (왼쪽) */
.logo {
    display: flex;
    align-items: center;
    margin: 0;
}

.logo a {
    display: flex;
    align-items: center;
    color: #000;
}

.main-logo-img {
    height: 54px;
    width: auto;
    transition: filter 0.3s;
}

body.is-index #header:not(.scrolled) .main-logo-img {
    filter: brightness(0) invert(1);
}

/* 네비게이션 메뉴 (중앙) */
.gnb {
    display: flex;
    flex-grow: 1;
    justify-content: center;
}

.gnb .menu-list {
    display: flex;
    gap: 40px;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.gnb .menu-list li a {
    font-size: 16px;
    color: #000;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: color 0.2s;
    text-decoration: none;
}

.gnb .menu-list li a:hover {
    color: #666;
    text-decoration: underline;
    text-underline-offset: 4px;
}

body.is-index #header:not(.scrolled) .gnb .menu-list li a {
    color: #fff;
}

body.is-index #header:not(.scrolled) .gnb .menu-list li a:hover {
    color: #ccc;
}

/* 아이콘 메뉴 (오른쪽) */
.header-util-icons {
    display: flex;
    gap: 20px;
    align-items: center;
}

.util-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    transition: color 0.3s, transform 0.2s;
}

.util-icon:hover {
    color: #666;
    transform: scale(1.1);
}

body.is-index #header:not(.scrolled) .util-icon {
    color: #fff;
}

body.is-index #header:not(.scrolled) .util-icon:hover {
    color: #ccc;
}

/* 모바일 햄버거 버튼 기본 숨김 */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
    padding: 5px;
}

/* 스티키 헤더 로고 기본 숨김 */
.sticky-logo {
    display: none;
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    line-height: 1;
}

.sticky-logo-img {
    height: 30px;
    width: auto;
    filter: brightness(0);
    transition: filter 0.3s ease;
}

body.is-index #header:not(.scrolled) .sticky-logo-img {
    filter: brightness(0) invert(1);
}

.mobile-menu-btn .bar {
    display: block;
    width: 25px;
    height: 2px;
    background-color: #000;
    margin: 5px 0;
    transition: all 0.3s ease-in-out;
}

body.is-index #header:not(.scrolled) .mobile-menu-btn .bar {
    background-color: #fff;
}

.mobile-menu-btn.active .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn.active .bar:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active .bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* 메인 콘텐츠 스타일 - WWD 레이아웃 */
#main-content.wwd-layout {
    padding: 40px 0;
    min-height: calc(100vh - 300px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%;
    /* 모바일에서 좌우 여백 확보되도록 % 단위 적용 */
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* 1. Top Story Section */
.top-story-section {
    margin-bottom: 60px;
    border-bottom: 2px solid #000;
    padding-bottom: 40px;
}

.top-story-card .top-story-link {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    color: #000;
}

.top-story-img-wrap {
    flex: 2;
    min-width: 300px;
}

.top-story-img-wrap img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.top-story-text {
    flex: 1;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.article-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.category-badge {
    color: #cc0000;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: inline-block;
}

.top-story-headline {
    font-family: 'Pretendard', sans-serif !important;
    font-size: 28px;
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 20px;
}

.top-story-desc {
    font-family: 'Pretendard', sans-serif !important;
    font-size: 16px;
    color: #444;
    line-height: 1.6;
    margin-bottom: 25px;
}

.top-story-link:hover .top-story-headline {
    text-decoration: underline;
}

/* 2. Grid News Section */
.section-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 1px solid #000;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.news-grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px 30px;
}

.grid-article-item {
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 20px;
}

.grid-article-item .article-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: #000;
}

.article-img-wrap {
    width: 100%;
    aspect-ratio: 3/2;
    margin-bottom: 15px;
    overflow: hidden;
    background: #f4f4f4;
}

.article-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.grid-article-item:hover .article-img-wrap img {
    transform: scale(1.05);
}

.no-img-box {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12px;
}

.article-title {
    font-family: 'Pretendard', sans-serif !important;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 15px;
}

@media (max-width: 900px) {
    .article-title {
        font-size: 20px;
    }
}

.grid-article-item:hover .article-title {
    text-decoration: underline;
}

.article-meta {
    font-size: 13px;
    color: #999;
    text-transform: uppercase;
}

/* 반응형 모바일 */
@media (max-width: 900px) {
    .news-grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .top-story-card .top-story-link {
        flex-direction: column;
        gap: 20px;
    }

    .top-story-headline {
        font-size: 28px;
    }

    .news-grid-container {
        grid-template-columns: 1fr;
    }

    /* 모바일 환경 이미지 비율 1080:1350 (4:5) 적용 */
    .top-story-img-wrap,
    .article-img-wrap {
        aspect-ratio: 1080 / 1350 !important;
        height: auto;
    }
}

/* 푸터 스타일 */
#footer {
    background-color: #2c2c2c;
    color: #fff;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-info {
    margin-bottom: 30px;
}

.footer-info h2 {
    font-size: 20px;
    margin-bottom: 15px;
}

.footer-info address {
    font-style: normal;
    line-height: 1.8;
}

.footer-info p {
    margin: 5px 0;
    color: #ccc;
}

.footer-sns {
    margin-bottom: 30px;
}

.footer-sns h3 {
    font-size: 16px;
    margin-bottom: 15px;
}

.sns-list {
    display: flex;
    gap: 20px;
}

.sns-list li a {
    color: #ccc;
    transition: color 0.3s;
}

.sns-list li a:hover {
    color: #fff;
}

.footer-copyright {
    padding-top: 20px;
    border-top: 1px solid #444;
    text-align: center;
    color: #999;
    font-size: 12px;
}

/* Hero Slider 스타일 */
.hero-slider-section {
    width: 100%;
    height: 100vh;
    position: relative;
    overflow: hidden;
    margin: 0;
}

.hero-slider-section.mobile {
    display: none;
}

.hero-slider-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* 슬라이드 영역 바깥 이미지는 숨김 */
}

.hero-slider-section.mobile .hero-slider-wrapper {
    height: 100%;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%);
    /* 기본적으로 오른쪽에 대기 */
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.6s ease;
    z-index: 1;
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    z-index: 2;
}

.hero-slide.exiting {
    opacity: 1;
    visibility: visible;
    transform: translateX(-100%);
    /* 왼쪽으로 빠짐 */
    z-index: 1;
}

.hero-slide.exiting-reverse {
    opacity: 1;
    visibility: visible;
    transform: translateX(100%);
    /* 오른쪽으로 빠짐 */
    z-index: 1;
}

.hero-slide-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-slide::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 위쪽 로고 보호를 위한 그라데이션 및 전체 20% 투명 블랙 */
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.2) 20%, rgba(0, 0, 0, 0.2) 80%, rgba(0, 0, 0, 0.6) 100%);
    pointer-events: none;
    z-index: 10;
}

.hero-slide-link {
    display: block;
    width: 100%;
    height: 100%;
}

.hero-slide-overlay {
    position: absolute;
    top: 60%;
    left: 0;
    width: 100%;
    transform: translateY(-50%);
    padding: 0 5%;
    color: #fff;
    pointer-events: none;
    z-index: 20;
    text-align: center;
}

.hero-slide-text {
    font-family: 'Pretendard', sans-serif !important;
    font-size: 32px;
    font-weight: 700;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.4;
    text-shadow: 1px 1px 10px rgba(0, 0, 0, 0.5);
    word-break: keep-all;
}

.hero-slide-summary {
    font-family: 'Pretendard', sans-serif !important;
    font-size: 16px;
    font-weight: 400;
    max-width: 800px;
    margin: 15px auto 0;
    line-height: 1.6;
    color: #eee;
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);
    word-break: keep-all;
}

.hero-slide-read-more {
    display: inline-block;
    margin-top: 25px;
    padding: 10px 24px;
    background: transparent;
    border: 1px solid #fff;
    color: #fff;
    font-family: 'Pretendard', sans-serif;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s;
    pointer-events: all;
}

.hero-slide-read-more:hover {
    background: #fff;
    color: #000;
}

@media (max-width: 768px) {
    .hero-slide-text {
        font-size: 24px;
        padding-bottom: 20px;
    }
}


.hero-slider-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
}

.hero-slider-prev,
.hero-slider-next {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    width: 50px;
    height: 50px;
    font-size: 30px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    transition: background 0.3s;
}

.hero-slider-prev:hover,
.hero-slider-next:hover {
    background: rgba(0, 0, 0, 0.7);
}

.hero-slider-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    pointer-events: all;
    z-index: 30;
}

.hero-slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: transparent;
    cursor: pointer;
    transition: background 0.3s;
}

.hero-slider-dot.active {
    background: #fff;
}

/* 유틸리티 클래스 */
.hide-on-pc {
    display: none !important;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .main-logo-img {
        height: 36px;
    }

    .header-inner {
        flex-direction: column;
        gap: 20px;
    }

    .gnb .menu-list {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
        transition: all 0.3s;
    }

    .main-layout {
        flex-direction: column;
    }

    .header-util {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* 모바일 헤더 처리 (항상 아이콘 형태로 GNB 변경) */
    .single-line-header {
        padding: 0 15px;
        height: 60px;
        flex-direction: row !important;
        /* 강제로 한 줄 유지 */
        gap: 0;
    }

    .hide-on-mobile {
        display: none !important;
    }

    .header-util-icons {
        margin-left: auto;
        /* 우측 정렬 */
    }

    .hide-on-pc {
        display: block !important;
    }

    .mobile-menu-btn {
        display: block;
        margin-left: 10px;
        z-index: 1001;
        /* 메뉴보다 위에 */
    }

    #gnbNav {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: #fff;
        border-bottom: 1px solid #eee;
        padding: 20px 0;
        z-index: 999;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    }

    #gnbNav.is-open {
        display: block;
    }

    #header.scrolled #gnbNav,
    #header.is-sticky #gnbNav {
        top: 60px;
    }

    #gnbNav .menu-list {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }

    #gnbNav .menu-list li a {
        color: #000 !important;
        /* 모바일 메뉴 펼쳤을 때는 흰색 배경이므로 텍스트 검정색 고정 */
    }

    /* 스티키 헤더 고정 (전체) */
    #header.is-sticky {
        position: fixed;
        width: 100%;
        top: 0;
        left: 0;
        background: #fff !important;
        border-bottom: 1px solid #eee;
    }

    #header.is-sticky .main-logo-img {
        filter: none !important;
    }

    #header.is-sticky .util-icon {
        color: #000 !important;
    }

    #header.is-sticky .mobile-menu-btn .bar {
        background-color: #000 !important;
    }

    /* PC 슬라이더는 모바일에서 숨김 */
    .hero-slider-section.pc {
        display: none;
    }

    /* 모바일 슬라이더는 표시 */
    .hero-slider-section.mobile {
        display: block;
        width: 100%;
        height: 100vh;
        margin: 0;
        padding: 0;
    }

    .hero-slider-wrapper {
        height: 100%;
    }

    .hero-slider-prev,
    .hero-slider-next {
        width: 40px;
        height: 40px;
        font-size: 24px;
        padding: 0;
    }

    .hero-slider-controls {
        padding: 0 10px;
    }

    .hero-slider-dots {
        bottom: 10px;
    }

    .hero-slider-dot {
        width: 10px;
        height: 10px;
    }
}

/* -------------------------------------
   기사 상세 뷰어 (View.php) WWD 스타일
------------------------------------- */
.article-view-layout {
    background-color: #fff;
    padding: 40px 0 80px;
}

.article-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.article-breadcrumb {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 25px;
}

.article-breadcrumb a {
    color: #999;
}

.article-breadcrumb a:hover {
    color: #000;
}

.article-breadcrumb span {
    color: #000;
    font-weight: 700;
}

.article-header {
    margin-bottom: 40px;
    text-align: center;
}

.article-header .category-badge {
    display: inline-block;
    color: #e3000f;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.article-header .article-title {
    font-size: 28px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #000;
    margin-bottom: 25px;
    word-break: keep-all;
}

.article-meta-info {
    font-size: 16px;
    color: #555;
    display: flex;
    justify-content: center;
    gap: 15px;
    align-items: center;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.article-meta-info strong {
    color: #000;
}

.article-body {
    font-size: 16px;
    line-height: 1.5;
    color: #222;
    margin-bottom: 40px;
    font-weight: 400;
}

.article-body p {
    margin-bottom: 25px;
}

.article-body img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
    border-radius: 4px;
}

.article-body h3,
.article-body h4 {
    font-size: 22px;
    font-weight: 700;
    margin: 40px 0 15px;
    color: #000;
}

.article-body blockquote {
    border-left: 4px solid #000;
    padding-left: 20px;
    margin: 30px 0;
    font-size: 20px;
    font-style: italic;
    color: #444;
}

.article-footer-actions {
    text-align: center;
    border-top: 2px solid #000;
    padding-top: 30px;
}

.btn-back-list {
    display: inline-block;
    padding: 12px 30px;
    background-color: #000;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid #000;
    transition: all 0.3s ease;
}

.btn-back-list:hover {
    background-color: #fff;
    color: #000;
}

/* 모바일 대응 */
@media screen and (max-width: 768px) {
    .article-view-layout {
        padding: 20px 0 50px;
    }

    .article-header .article-title {
        font-size: 26px;
    }

    .article-body {
        font-size: 16px;
    }
}