/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #FAFAFA; /* Off-white for a cleaner look */
    --text-primary: #111111;
    --text-secondary: #888888;
    --border-color: #EAEAEA;
    --transition-speed: 0.4s;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden; /* 모바일 가로 스크롤 방지 */
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden; /* 모바일 가로 스크롤 방지 */
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
}

/* Header (Sticky Navigation) */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background-color: rgba(250, 250, 250, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid transparent;
    z-index: 1000;
    transition: border-bottom var(--transition-speed) ease;
}

.header.scrolled {
    border-bottom: 1px solid var(--border-color);
}

.main-content {
    padding-top: 80px; /* Offset for fixed header */
    min-height: calc(100vh - 80px); /* Ensure footer stays at bottom */
    display: flex;
    flex-direction: column;
}

.header-container {
    width: 100%; /* 고정 너비 방지 */
    max-width: 1800px; /* 로고와 메뉴 사이 간격을 1600 정도로 넓히기 위해 컨테이너 크기 확장 */
    margin: 0 auto;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px 0; /* 상단 여백 15px 추가, 좌우 40px, 하단 0 */
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 45px;
    width: auto;
}

.nav-list {
    display: flex;
    gap: 40px;
}

.nav-link {
    font-size: 12pt;
    font-weight: 500;
    letter-spacing: 1px;
    color: var(--text-secondary);
    transition: color var(--transition-speed) ease;
    position: relative;
    text-transform: uppercase;
}

.nav-link.active,
.nav-link:hover {
    color: var(--text-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -4px;
    left: 0;
    background-color: var(--text-primary);
    transition: width var(--transition-speed) ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Splash Section (Main Landing) */
.splash-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100%;
    background-color: var(--bg-color);
    text-decoration: none;
    cursor: pointer;
}

.splash-container img {
    max-width: 800px;
    width: 80%; /* Responsive fallback */
    animation: fadeIn 1.5s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Project Section */
.project-section {
    width: 100%; /* 고정 너비 방지 */
    max-width: 1800px;
    margin: 0 auto;
    padding: 60px 40px;
}

/* Filter Buttons */
.filter-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 60px;
}

.filter-btn {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 2px;
    color: var(--text-secondary);
    cursor: pointer;
    padding-bottom: 5px;
    position: relative;
    transition: color var(--transition-speed) ease;
}

.filter-btn.active, .filter-btn:hover {
    color: var(--text-primary);
}

.filter-btn::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--text-primary);
    transition: width var(--transition-speed) ease;
}

.filter-btn.active::after {
    width: 100%;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 60px;
}

.gallery-item {
    display: flex;
    flex-direction: column;
    transition: opacity var(--transition-speed) ease, transform var(--transition-speed) ease;
    opacity: 1;
    transform: scale(1);
}

/* Class applied by JS for filtering out items */
.gallery-item.hide {
    display: none;
}

.gallery-item.fade-out {
    opacity: 0;
    transform: scale(0.95);
}

.img-wrapper {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    margin-bottom: 20px;
    background-color: #eee;
    position: relative;
}

.img-wrapper::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0);
    transition: background-color 0.4s ease;
    pointer-events: none;
}

.img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.gallery-item:hover .img-wrapper img {
    transform: scale(1.05);
}

.gallery-item:hover .img-wrapper::after {
    background-color: rgba(0, 0, 0, 0.15);
}

.item-info {
    text-align: center;
}

.item-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.item-tag {
    font-size: 0.75rem;
    font-weight: 300;
    color: var(--text-secondary);
    letter-spacing: 1px;
    text-transform: uppercase;
}


/* Common Page Styles */
.page-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800; /* 굵은 글씨로 변경 */
    letter-spacing: 2px;
    margin: 60px 0 40px;
    text-transform: uppercase;
}

/* About Section */
.about-section {
    width: 100%;
    margin: 0 auto;
    padding: 60px 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.about-content {
    max-width: 800px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 60px;
}

.about-headline {
    font-size: 2.2rem;
    font-weight: 300;
    line-height: 1.5;
    text-align: center;
    margin: 40px 0 60px;
    color: var(--text-primary);
    word-break: keep-all;
}

.about-text-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 650px;
}

.about-description {
    font-size: 1.05rem;
    line-height: 1.9;
    margin-bottom: 50px;
    color: #444; 
    text-align: center; 
    word-break: keep-all;
    padding: 0 20px;
}

.about-description:last-child {
    margin-bottom: 0;
}



/* Contact Section */
.contact-section {
    width: 100%; /* 고정 너비 방지 */
    max-width: 1600px;
    margin: 0 auto;
    padding: 60px 40px 0 40px; /* 하단 패딩 제거 (-40px) */
    flex-grow: 1;
}

.contact-section .page-title {
    margin-bottom: 90px; /* 타이틀과 내용 사이 여백 50 추가 (기존 40 + 50) */
}

.contact-info-grid {
    display: grid;
    grid-template-columns: max-content;
    gap: 20px;
    margin-bottom: 100px; /* 내용과 지도 사이 여백 */
    justify-content: center;
}

.contact-item {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    gap: 50px; /* 항목 이름과 내용 사이 여백 50 추가 */
}

.contact-label {
    font-weight: 800; /* 굵은 글씨로 더 강조 */
    width: 140px; /* 라벨 폰트가 커졌으므로 넓이도 조금 늘림 */
    letter-spacing: 1px;
    font-size: 19px;
}

.contact-value {
    color: var(--text-secondary);
    font-size: 15px;
}

.contact-map {
    width: 100%;
    height: 500px;
    background-color: #eee;
    overflow: hidden;
    margin-bottom: 0; /* 억지스러운 마이너스 마진 제거 후 초기화 */
}

.contact-map iframe,
.contact-map img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px; /* 상하 패딩을 약간 줄여서 타이트하게 조정 */
    font-size: 11pt;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    border-top: 0.5pt solid var(--border-color);
    margin-top: 0; /* 불필요한 상단 마진 제거로 깔끔하게 밀착 */
}

/* Project Detail Page */
.project-detail-section {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 40px 100px;
    flex-grow: 1;
}

.back-link {
    display: inline-flex;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    transition: color var(--transition-speed) ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.back-link:hover {
    color: var(--text-primary);
}

.project-header {
    margin-bottom: 60px;
}

.project-title {
    font-size: 30px;
    font-weight: 800;
    margin-top: 60px;
    margin-bottom: 40px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.project-overview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px 5%;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.overview-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.overview-label {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.overview-value {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    word-break: keep-all;
}

.project-images {
    display: flex;
    flex-direction: column;
    gap: 50px;
    margin-bottom: 60px;
}

.project-images img {
    width: 100%;
    height: auto;
    object-fit: cover;
    background-color: #eee;
    cursor: pointer;
}

.context-map img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    background-color: #eee;
}

.project-context {
    display: flex;
    flex-direction: column;
    gap: 50px;
    width: 100%;
    background-color: #ececec;
    padding: 30px 40px;
    border-radius: 0;
    box-sizing: border-box;
}

.context-top-row {
    display: flex;
    align-items: center;
    gap: 40px;
    width: 100%;
}

.context-map {
    flex: 3.5;
}

.context-text {
    flex: 6.5;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.context-text p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 30px;
    word-break: keep-all;
}

.context-text p:last-child {
    margin-bottom: 0;
}

.project-description {
    width: 100%;
    max-width: none;
    margin: 0;
    text-align: left;
}

.project-description h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 30px;
    text-align: center;
}

.project-description p {
    font-size: 1.05rem;
    line-height: 2;
    color: var(--text-primary);
    margin-bottom: 20px;
    word-break: keep-all;
}

.project-diagram-wrapper {
    width: 100%;
    margin-bottom: 30px;
}

.project-diagram-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    background-color: transparent;
}

/* Plan Slider */
.plan-slider-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 60px;
}

.plan-slider {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    scroll-behavior: smooth;
}

.plan-slider::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
}

.plan-slider img {
    width: 100%;
    flex-shrink: 0;
    scroll-snap-align: start;
    object-fit: contain;
    cursor: pointer;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.7);
    color: #333;
    border: none;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.slider-btn:hover {
    background-color: rgba(255, 255, 255, 0.9);
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}
/* Gallery Slider (photo slider with aspect-ratio container) */
.gallery-slider-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    background-color: #f5f5f5;
    overflow: hidden;
}

.gallery-slider {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    scroll-behavior: smooth;
    width: 100%;
    height: 100%;
}

.gallery-slider::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
}

.gallery-slider img {
    width: 100%;
    height: 100%;
    flex-shrink: 0;
    scroll-snap-align: start;
    object-fit: contain; /* default fallback */
    cursor: pointer;
}

.gallery-slider img.landscape {
    object-fit: cover;
}

.gallery-slider img.portrait {
    object-fit: contain;
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background-color: rgba(0, 0, 0, 0.85);
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.close-lightbox {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close-lightbox:hover,
.close-lightbox:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

.prev-lightbox, .next-lightbox {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 40px;
    color: #fff;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.3s, transform 0.3s;
    padding: 20px;
    z-index: 10000;
}

.prev-lightbox {
    left: 30px;
}

.next-lightbox {
    right: 30px;
}

.prev-lightbox:hover, .next-lightbox:hover {
    opacity: 0.7;
    transform: translateY(-50%) scale(1.1);
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    animation: zoomIn 0.3s ease;
}

.back-link-bottom-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-top: 60px;
    width: 100%;
}

.back-link-bottom-wrapper .back-link {
    margin-bottom: 0;
}

/* ==========================================================
   Responsive Design - 모바일 (모든 기본 스타일 아래에 배치)
   ========================================================== */
@media (max-width: 768px) {
    /* Header */
    .header {
        height: auto;
        padding: 15px 0;
    }
    .header-container {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 15px 20px;
    }
    .logo img {
        height: 35px;
        margin-top: 0;
        margin-bottom: 20px;
    }
    .nav-list {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 15px;
        width: 100%;
        margin-top: 0;
    }
    .nav-link {
        font-size: 13px;
        letter-spacing: 1px;
    }

    /* Main Content & Sections */
    .main-content {
        padding-top: 80px;
    }
    .page-title {
        margin: 40px 0 !important;
    }
    .project-section,
    .about-section,
    .contact-section {
        padding: 60px 20px 60px;
    }

    /* Gallery */
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 30px;
    }
    .filter-container {
        gap: 15px;
    }
    .filter-btn {
        font-size: 0.75rem;
        letter-spacing: 1px;
    }

    /* About Page */
    .about-headline {
        font-size: 1.6rem;
        margin: 20px 0 40px;
    }
    .about-description {
        font-size: 0.95rem;
        line-height: 1.8;
        padding: 0 15px;
    }

    /* Contact Page */
    .contact-info-grid {
        display: flex;
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }
    .contact-item {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
        gap: 20px;
        width: 100%;
        max-width: 320px;
    }
    .contact-label {
        font-weight: 800;
        font-size: 15px;
        letter-spacing: 1px;
        width: 85px;
        flex-shrink: 0;
    }
    .contact-value {
        font-size: 14px;
        color: var(--text-secondary);
        word-break: keep-all;
    }
    .contact-map {
        width: 100%;
        max-width: 100%;
        height: 300px;
        margin-bottom: 50px !important;
    }

    /* Project Detail Page */
    .project-detail-section {
        padding: 10px 20px 60px;
    }
    .project-title {
        font-size: 24px;
        margin-top: 10px;
        margin-bottom: 30px;
    }
    .project-overview {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px 15px;
    }
    .overview-item {
        gap: 6px;
    }
    .project-context {
        padding: 30px 20px;
        gap: 40px;
    }
    .context-top-row {
        flex-direction: column;
        gap: 20px;
    }
    .context-map, .context-text {
        width: 100%;
        flex: auto;
    }
}
