/* =========================================
   1. 디자인 시스템 & 기본 설정
========================================= */
:root {
    --primary-text: #333333;
    --secondary-text: #555555;
    --brand-color: #345F53;
    --bg-white: #ffffff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: "kim-jung-chul-myungjo", sans-serif;
    font-weight: 300; 
    color: var(--primary-text);
    line-height: 1.5;
    background-color: var(--bg-white);
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

strong { font-weight: 400; color: inherit; }

/* =========================================
   2. 공통 헤더 & 네비게이션
========================================= */
/* 주의: background-image와 background-position은 개별 HTML 파일의 inline style로 제어합니다. */
header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    background-size: cover;
    background-repeat: no-repeat;
    margin-bottom: 20px;
}

/* index.html 등 메인 커버용 높이 */
header.hero-main { height: 100vh;position: relative;}
/* 리스트 페이지용 높이 */
header.hero-list {
    width: 100%;
    /* 3:1 비율 설정 (너비가 3일 때 높이는 1) */
    aspect-ratio: 3 / 1; 
    
    /* 기존의 height: 60vh; 가 있다면 지우거나 주석 처리하세요 */
    /* height: auto; */ 
    
    background-size: cover;
    background-repeat: no-repeat;
    
    /* 앞서 설정한 변수들을 그대로 유지하여 디테일 조정 가능하게 함 */
    background-position: var(--bg-pos-pc, center center);
    position: relative;
    overflow: hidden;
}

header::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.3);
}

nav {
    position: absolute;
    top: 0; width: 100%;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.logo-link { display: flex; }
.logo-img { height: 40px; width: auto; }
.menu { display: flex; align-items: center; }

.dropdown { position: relative; display: inline-block; white-space: nowrap; }
.dropbtn {
    color: white; text-decoration: none; font-size: 0.95rem; opacity: 0.9;
    background: none; border: none; cursor: pointer;
    font-family: "nanum-gothic", sans-serif; font-weight: 700; padding: 10px 0;
}
.dropdown:hover .dropbtn { opacity: 1; }
.dropdown-content {
    display: none; position: absolute; background-color: #ffffff;
    min-width: 180px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.1);
    border-radius: 8px; padding: 8px 0; top: 100%; right: 0; z-index: 1;
}
.dropdown:hover .dropdown-content { display: block; }
.dropdown-content a {
    font-family: "nanum-gothic", sans-serif; font-weight: 400;
    color: var(--primary-text); padding: 12px 24px; text-decoration: none;
    display: block; font-size: 0.9rem; text-align: left; transition: background 0.2s;
}
.dropdown-content a:hover {
    background-color: #f4f4f4; color: var(--brand-color); font-weight: bold;
}

.hero-text { z-index: 10; text-align: center; }
.hero-text h1 {
    font-family: "ultra", serif; font-weight: 400; font-style: normal;
    font-size: 3rem; letter-spacing: 2px; text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* =========================================
   3. 컨테이너 & 텍스트 요소
========================================= */
.container {
    max-width: 800px; 
    margin: 0 auto; 
    padding: 20px 20px;
    text-align: left;
}

.intro-title, h3.guide-title, h3 { 
    font-family: "rixgwangalli-pro", sans-serif; font-weight: 400; font-style: normal;
    color: var(--brand-color); word-break: keep-all; line-height: 1.3;
}
.intro-title { font-size: 1.6rem; margin-bottom: 20px; }
.intro-subtitle {
    font-family: "rixgwangalli-pro", sans-serif; font-weight: 400; font-style: normal;
    color: var(--brand-color); font-size: 1.6rem; margin-bottom: 20px; display: block; line-height: 1.3;
}
h3.guide-title, h3 { font-size: 1.5rem; margin-bottom: 15px; }

p { margin-bottom: 0; color: var(--secondary-text); font-size: 0.95rem; word-break: keep-all; }
p.guide-desc { font-size: 0.95rem; color: var(--secondary-text); margin-bottom: 0; word-break: keep-all; }

/* 메인 페이지 섹션 분리용 타이틀 여백 */
.section-title {
    margin-top: 40px; /* 위쪽 본문과의 간격을 시원하게 띄움 */
    margin-bottom: 10px; /* 아래쪽 버튼/내용과의 간격 */
}

/* =========================================
   4. 버튼 공통
========================================= */
.lang-buttons {
    display: flex; justify-content: center; gap: 20px;
    margin-top: 60px; margin-bottom: 0px; flex-wrap: wrap;
}
.btn {
    font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", sans-serif;
    background-color: var(--brand-color); color: white;
    padding: 12px 0; width: 180px; text-align: center; text-decoration: none;
    border-radius: 10px; font-size: 0.95rem; font-weight: 600;
    transition: background 0.3s, transform 0.2s; display: inline-block;
}
.btn:hover { filter: brightness(0.85); transform: translateY(-2px); }

/* index.html 특화 버튼 */
.city-buttons {
    display: flex; gap: 10px; justify-content: space-between;
    margin-top: 15px; margin-bottom: 15px;
}
.city-buttons .btn { flex: 1; width: auto; line-height: 1; padding: 12px; border: 1px solid #ddd;}

/* =========================================
   5. 리스트 페이지 특화 (가이드, 필터, 카드)
========================================= */
.guide-section {
    display: flex; 
    gap: 50px; 
    margin-bottom: 30px; 
    padding-bottom: 30px; 
    margin-top: 0 !important; 
    padding-top: 0 !important; 
    border-bottom: 1px solid #eee; 
    align-items: flex-start;
}
.guide-left { flex: 2; }
.guide-right {
    flex: 1; background-color: #fcfcfc; padding: 30px; border-radius: 12px;
    border: 1px dashed #ddd; text-align: left; 
}
.guide-right strong { font-family: "nanum-gothic", sans-serif; font-weight: 800; color: var(--brand-color); }
.guide-right em { font-style: italic; font-family: "kim-jung-chul-myungjo", serif; color: var(--brand-color); }

.filter-wrapper { display: flex; gap: 8px; margin-bottom: 30px; flex-wrap: wrap; }
select { 
    padding: 10px 14px; border-radius: 8px; border: 1px solid #ddd; background-color: white; 
    font-size: 0.8rem; cursor: pointer; font-weight: bold; color: #444; min-width: 140px; 
    font-family: "nanum-gothic", sans-serif;
}
select:hover { background-color: #f9f9f9; }

.grid-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.card { 
    background: white; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); 
    transition: transform 0.2s, box-shadow 0.2s; overflow: hidden; text-decoration: none; 
    color: #333; display: flex; flex-direction: column; min-height: 350px; 
    border: 1px solid #f0f0f0; position: relative;
}
.card.hide { display: none !important; }
.card:hover { transform: translateY(-5px); box-shadow: 0 12px 24px rgba(0,0,0,0.12); }
.card-image { 
    width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-bottom: 1px solid #eee; 
}
.card-content { padding: 18px; display: flex; flex-direction: column; flex-grow: 1; }
.card-title { 
    font-family: "nanum-gothic", sans-serif; font-weight: 700; font-size: 1rem; 
    margin: 0 0 10px 0; color: var(--primary-text); 
}
.meta-row { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.meta-item { 
    font-family: "nanum-gothic", sans-serif; font-size: 0.7rem; color: #FFFFFF; font-weight: 700; 
    padding: 4px 8px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.5px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.card-desc { font-size: 0.8rem; color: #666; line-height: 1.5; margin-bottom: 15px; flex-grow: 1; word-break: keep-all; font-weight: normal; }
.sticker-row { border-top: 1px solid #f5f5f5; padding-top: 10px; display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.sticker-emoji { font-size: 10px; background-color: #fff; border: 1px solid #eee; border-radius: 4px; padding: 4px 6px; color: #333; box-shadow: 0 1px 1px rgba(0,0,0,0.05); cursor: help; }
.ref-badge {
    position: absolute; top: 2px; right: 12px; font-size: 30px; 
    text-shadow: 0 2px 5px rgba(0,0,0,0.4); z-index: 10; cursor: help;
}

/* =========================================
   6. 기타 (비디오, 소셜)
========================================= */
.video-container {
    position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;
    margin-top: 60px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); margin-bottom: 15px;
}
.video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
.social-links { display: flex; justify-content: flex-end; gap: 10px; margin-top: 15px; margin-bottom: 10px; }
.social-icon svg { width: 24px; height: 24px; fill: var(--brand-color); transition: transform 0.2s, opacity 0.2s; }
.social-icon:hover svg { transform: translateY(-2px); opacity: 0.8; }

/* =========================================
   7. 공통 푸터
========================================= */
footer {
    background-color: #f9f9f9; border-top: 1px solid #eee; padding: 30px 0; text-align: left;
    font-family: "nanum-gothic", sans-serif; font-weight: 400; font-size: 0.8rem; color: #777; line-height: 1.6;
}
.footer-content { max-width: 800px; margin: 0 auto; padding: 0 20px; }
.footer-item { margin-bottom: 5px; font-size: 0.7rem; }
.footer-item:last-child { margin-bottom: 0; }
.footer-highlight { font-family: "nanum-gothic", sans-serif; font-weight: 700; color: var(--brand-color); font-size: 0.95rem; }
.footer-link { font-family: "nanum-gothic", sans-serif; font-weight: 700; text-decoration: none; color: var(--brand-color); font-size: 0.85rem; }
.footer-link:hover { text-decoration: underline; }

/* =========================================
   8. 미디어 쿼리 (모바일 대응)
========================================= */
.mobile-break { display: inline; }

@media (max-width: 768px) {
    .mobile-break { display: block; }
    .hero-text h1 { font-size: 2.2rem; }
    nav { padding: 20px; }
    .lang-buttons { flex-direction: column; }
    .btn { width: 100%; margin: 0; }
    .container { text-align: left; }
    .intro-title, .intro-subtitle { font-size: 1.5rem; }
    
    /* 리스트 가이드 모바일 */
    .guide-section { flex-direction: column; gap: 30px; align-items: stretch; }
    .guide-left, .guide-right { width: 100%; flex: auto; }
    .grid-container { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    
    /* 인덱스 모바일 */
    .city-buttons { flex-direction: column; }
    .city-buttons .btn .en { display: inline; margin-left: 5px; }
    .city-buttons .btn .en::before { content: "·"; margin-right: 5px; font-weight: bold; display: inline-block; }
}

/* =========================================
   다국어 토글 제어 (body의 data-lang 속성 기반)
========================================= */
body[data-lang="en"] .lang-kr { display: none !important; }
body[data-lang="kr"] .lang-en { display: none !important; }

/* =========================================
   네비게이션 언어 토글 버튼 (박스 제거 및 최적화)
========================================= */
.nav-lang-toggle {
    display: flex;
    align-items: center;
    margin-right: 25px; /* 도시 메뉴와의 간격 */
}

.lang-btn {
    background: none; /* 배경 박스 완전 제거 */
    border: none;     /* 테두리 완전 제거 */
    cursor: pointer;
    padding: 5px;
    font-size: 1.4rem; /* 박스가 없어진 대신 이모지 크기를 약간 키움 */
    line-height: 1;
    opacity: 0.8;      /* 평소엔 화면에 자연스럽게 스며들도록 살짝 투명하게 */
    transition: transform 0.2s, opacity 0.2s;
}

.lang-btn:hover {
    transform: scale(1.15); /* 마우스를 올리면 15% 커지는 효과 */
    opacity: 1;             /* 선명해짐 */
}

/* 모바일 화면 최적화 */
@media (max-width: 768px) {
    .nav-lang-toggle { margin-right: 15px; }
    .lang-btn { font-size: 1.2rem; }
    header.hero-list {
        aspect-ratio: 2 / 3; /* 모바일은 조금 더 시원하게 2:1 권장 */
        background-position: var(--bg-pos-mobile, var(--bg-pos-pc, center center));
    }
    .scroll-indicator { width: 36px; height: 36px; }
}

/* 기본적으로 다국어 클래스는 숨김 처리 (깜빡임 방지) */
.lang-kr, .lang-en { display: none; }

/* 바디 속성에 따라 해당 언어만 표시 */
body[data-lang="kr"] .lang-kr { display: block; }
body[data-lang="en"] .lang-en { display: block; }

/* 인라인 요소(단어 중간)용 */
body[data-lang="kr"] span.lang-kr { display: inline; }
body[data-lang="en"] span.lang-en { display: inline; }

/* =========================================
   스크롤 유도 화살표 애니메이션
========================================= */
.scroll-indicator {
    position: absolute;
    bottom: 10px; /* 바닥에서 띄우는 간격 */
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    color: white;
    opacity: 1;
    /* 어떤 밝은 배경이 와도 화살표가 보이도록 그림자 추가 */
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.4)); 
    animation: bounce 2s infinite;
    pointer-events: none; /* 클릭 방해 금지 */
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translate(-50%, 0);
    }
    40% {
        transform: translate(-50%, -15px); /* 위로 튀어오르는 높이 */
    }
    60% {
        transform: translate(-50%, -7px);
    }
}

/* [기존 레이아웃 유지] */
.footer-main-grid {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
    text-align: left;
}

.footer-left { flex: 1; }
.footer-right { flex: 0 0 auto; display: flex; justify-content: flex-end; }

.footer-lang-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* [언어 설정 디자인 최적화] */
.footer-lang-title {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 0px;
    color: var(--brand-color);
    opacity: 1;
    text-transform: uppercase;
}

/* 검은 박스 제거 및 크기 확대 */
.lang-btn-flag {
    background: none !important; /* 배경 제거 */
    border: none !important;     /* 테두리 제거 */
    padding: 0 !important;
    cursor: pointer;
    font-size: 1.6rem;           /* 국기 크기 대폭 확대 */
    line-height: 1;
    transition: transform 0.2s, opacity 0.2s;
    opacity: 0.4;                /* 비활성 상태 투명도 */
}

.lang-btn-flag.active, 
.lang-btn-flag:hover {
    opacity: 1;                  /* 활성 또는 호버 시 선명하게 */
    transform: scale(1.1);       /* 미세한 확대 효과 */
}

.lang-divider {
    color: rgba(255, 255, 255, 0.3);
    font-size: 1.5rem;
    margin: 0 0px;
    user-select: none;
    line-height: 1;
    display: flex;
    align-items: center;
}

.footer-lang-selector {
    display: flex;
    align-items: center;
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .footer-main-grid {
        flex-direction: column-reverse;
        align-items: center;
        text-align: center;
        gap: 30px;
    }
    .footer-lang-container { align-items: center; }
}

/* 중앙 정렬 카피라이트 스타일 */
.footer-copyright-center {
    margin-top: 5px;      /* 위쪽 메시지 영역과의 간격 확보 */
    padding-top: 10px;
    text-align: center;    /* 핵심: 중앙 정렬 */
    width: 100%;
    
    color: inherit;        /* 본문 색상 상속 */
    font-size: 0.75rem;    /* 본문보다 살짝 작게 */
    font-weight: 300;
    opacity: 0.8;          /* 도윤님의 수정사항을 반영하여 본문과 비슷한 명도 유지 */
}

/* 모바일에서도 동일하게 중앙 정렬 유지 */
@media (max-width: 768px) {
    .footer-copyright-center {
        margin-top: 10px;
        border-top: none; /* 모바일에서는 선을 없애 더 심플하게 처리 */
    }
}