/* ===== 1. 기본 설정 및 원형 마크 제거 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ★ 모든 리스트 앞의 점(bullet)을 완전히 제거합니다 */
ul, li {
    list-style: none;
    list-style-type: none;
}

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

body {
    font-family: 'ChosunGu', sans-serif;
    padding-top: 70px;
}

/* ===== 2. 헤더 레이아웃 (3단 분리) ===== */
#tale-header {
    width: 100%;
    height: 70px;
    background-color: #000000;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10000;
    border-bottom: 1px solid #222;
}

.header-inner {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 40px;
    height: 100%;
    display: flex;
    justify-content: space-between; /* 좌, 중, 우 간격 균등 분배 */
    align-items: center;
}
.mobile-user-info, #mobile-toggle {
    display: none;
}

/* 우측 정보 영역 (기존 코드 유지) */
.header-right {
    flex-shrink: 0; 
    color: #ffffff;
    font-size: 14px;
    text-align: right;
}

/* 좌측 로고 */
.header-left {
    flex-shrink: 0; /* 로고 크기 고정 */
}
.logo {
    font-family: 'Paperlogy-8ExtraBold', sans-serif;
    font-size: 30px;
    color: #ffffff;
    font-weight: bolder;
}
.logo-num { color: #ff0000; }

/* 중앙 내비게이션 - 중앙 정렬의 핵심 */
.header-center {
    flex: 1; /* 남은 공간을 차지 */
    display: flex;
    justify-content: center; /* 메뉴들을 정중앙으로 보냄 */
}

.main-menu {
    display: flex;
}

.menu-item {
    position: relative;
}

.menu-item > a {
    display: block;
    padding: 0 18px; /* 메뉴 간 간격을 살짝 조정 */
    line-height: 70px;
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    transition: 0.2s;
}

/* ★ 노란 형광펜 효과 */
.menu-item:hover > a {
    background-color: #ffff00;
    color: #000000;
}

/* 하위 메뉴 (드롭다운) */
.sub-menu {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    width: 160px;
    background-color: #111111;
    padding: 10px 0;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    border-bottom: 3px solid #ffff00;
}

.menu-item:hover .sub-menu {
    display: block;
}

.sub-menu li a {
    display: block;
    padding: 12px 20px;
    color: #bbbbbb;
    font-size: 20px;
}

.sub-menu li a:hover {
    color: #ffff00;
    background-color: #222222;
}

/* 우측 정보 영역 */
.header-right {
    flex-shrink: 0; /* 우측 영역 크기 고정 */
    color: #ffffff;
    font-size: 14px;
    text-align: right;
}

.user-info-box {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logout-btn {
    padding: 5px 12px;
    border: 1px solid #555;
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
    transition: 0.2s;
}

.logout-btn:hover {
    background-color: #ffffff;
    color: #000000;
}

/* ===== 3. 푸터 레이아웃 (슬림 버전) ===== */
#tale-footer {
    width: 100%;
    background-color: #000000;
    color: white; 
    /* 기존 40px에서 70% 수준인 28px로 두께 축소 */
    padding: 28px 0;
    margin-top: auto;
    border-top: 1px solid #222;
}

.footer-inner {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

/* 좌측 영역 */
.footer-left {
    flex: 1;
    min-width: 300px;
}
.brand-name { font-weight: bold; color:red; }
.footer-slogan { font-size: 0.8rem; margin-left: 5px; }
.nonprofit { color: #ff0000; font-weight: bold; }

/* 중앙 영역 (정책 링크) */
.footer-center {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
}
.policy-link:hover { color: #ffff00; }
.divider { color: #333; }

/* 우측 영역 (SNS 텍스트 링크) */
.footer-right {
    display: flex;
    justify-content: flex-end;
}
.social-text-links {
    display: flex;
    gap: 20px; /* 글자 사이 간격 */
}
.sns-text {
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 0.05em; /* 글자 사이를 약간 벌려 세련되게 */
    color: #777;
    transition: color 0.2s;
}
.sns-text:hover {
    color: #ffffff; /* 마우스 올리면 하얗게 빛남 */
    text-decoration: underline; /* 호버 시 밑줄 효과 */
}

/* 모바일 대응 */
@media (max-width: 900px) {
    .footer-inner {
        flex-direction: column;
        text-align: center;
        padding: 20px 0;
    }
    .footer-right { justify-content: center; }
}

/* ===== 4. 메인 페이지 전용 디자인 ===== */
#maincontainer {
    width: 100%;
    min-height: 80vh; /* 화면 높이의 80% 정도 확보 */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 50px 0;
}

#maintitle2 {
    width: 100%;
    max-width: 1200px;
    text-align: center;
}

#indexhomeimg {
    width: 100%;
    max-width: 1000px; /* 너무 크지 않게 조절 */
    height: auto;
    border-radius: 15px; /* 모서리를 둥글게 */
    box-shadow: 0 10px 30px rgba(0,0,0,0.1); /* 은은한 그림자 */
    margin-bottom: 30px;
}

.welcome-text h2 {
    font-family: 'Paperlogy-8ExtraBold', sans-serif;
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #333;
}

.welcome-text p {
    color: #777;
    font-size: 1.1rem;
}

/* 반응형 모바일 */
@media (max-width: 1155px) {
    .welcome-text h2 { font-size: 1.8rem; }
    #indexhomeimg { width: 90%; }
}

/* ===== 5. 로그인 페이지 전용 디자인 ===== */

/* 로그인 페이지 전체 배경 (어둡고 웅장하게) */
.login-page-body {
    background-color: #000000;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    padding: 0;
}

.login-container {
    width: 100%;
    /* 1. 글자 크기에 맞춰 컨테이너 너비를 충분히 키워줍니다 (핵심) */
    max-width: 600px; 
    padding: 20px;
    text-align: center;
    
    /* 2. 컨테이너 자체가 정중앙에 오도록 보장 */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.netflix-logo {
    font-family: 'Paperlogy-8ExtraBold', sans-serif;
    /* 3. 요청하신 대로 100px로 증폭 */
    font-size: 100px; 
    font-weight: 900;
    color: white;
    letter-spacing: -4px; /* 글자가 커진 만큼 자간을 더 줄여야 세련돼 보입니다 */
    
    /* 4. 줄 바꿈 방지 (글자가 길어지면 아래로 꺾이는 걸 막음) */
    white-space: nowrap; 
    
    /* 5. 정렬 보정: 폰트 자체의 위아래 여백을 제거하여 정중앙을 맞춤 */
    line-height: 1.1;
    margin-bottom: 10px;
    
    text-shadow: 4px 4px 15px rgba(0, 0, 0, 0.9);
}

.index-subtitle {
    color: #fff;
    font-size: 1.1rem; /* 로고가 커졌으니 부제목도 살짝 키워주면 좋습니다 */
    margin-bottom: 50px;
    letter-spacing: 0.2em;
    opacity: 0.8;
}

/* 로그인 박스 너비는 유지하고 싶을 때 */
.login-wrapper {
    width: 100%;
    max-width: 400px; /* 로고는 커도 입력창은 너무 넓지 않게 잡습니다 */
    background: rgba(255, 255, 255, 0.05);
    padding: 35px;
    border-radius: 8px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group input {
    width: 100%;
    padding: 15px;
    background-color: #333;
    border: none;
    border-radius: 5px;
    color: #fff;
    font-size: 16px;
    outline: none;
}

.input-group input:focus {
    background-color: #444;
    border-bottom: 2px solid #E50914;
}

/* 로그인 버튼 (강렬한 레드) */
.loginbtn {
    width: 100%;
    padding: 15px;
    background-color: #E50914;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}


.loginbtn:hover {
    background-color:yellow;
    color : black;
}

.login-footer {
    margin-top: 25px;
    font-size: 0.85rem;
    color: #777;
}

.login-footer a {
    color: #fff;
    text-decoration: underline;
}

/* 본문 전체 레이아웃 */
.content-wrapper {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

.page-title {
    font-family: 'Paperlogy-8ExtraBold', sans-serif;
    font-size: 2rem;
    color: #000;
    border-left: 8px solid #E50914; /* 넷플릭스 레드 포인트 */
    padding-left: 15px;
    margin-bottom: 40px;
}

/* 아코디언 버튼 스타일 */
.collapsible {
    background-color: #f8f8f8;
    color: #333;
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: 1px solid #ddd;
    text-align: left;
    outline: none;
    font-size: 18px;
    font-weight: bold;
    transition: 0.3s;
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.collapsible:after {
    content: '\002B'; /* 플러스(+) 기호 */
    font-size: 20px;
}

.collapsible.active:after {
    content: "\2212"; /* 마이너스(-) 기호 */
}

/* ★ 호버 시 노란 형광펜 효과 */
.collapsible:hover {
    background-color: #ffff00;
    color: #000;
}

/* 펼쳐지는 내용 상자 */
.content-box {
    padding: 0 18px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: #fff;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
}

.text-inner {
    padding: 25px 0;
    line-height: 1.8;
    color: #444;
}

.text-inner h2 { color: #000; margin-bottom: 15px; }

/* 표 디자인 */
.link-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}
.link-table td {
    border: 1px solid #000;
    padding: 15px;
    text-align: center;
    background: #fdfdfd;
}
.link-table a { color: #E50914; font-weight: bold; text-decoration: underline; }

/* ===== 도서 카테고리 페이지 레이아웃 ===== */

.category-header {
    text-align: center;
    margin-top: 50px;
    margin-bottom: 40px;
}

.page-subtitle {
    color: #666;
    margin-top: 10px;
    font-size: 1.1rem;
}

/* 10열 격자 구조 */
#bookmainbox {
    display: grid;
    grid-template-columns: repeat(10, 100px); /* 100px씩 10열 */
    grid-auto-rows: 100px; /* 행 높이 고정 */
    gap: 10px; /* 박스 사이 간격 */
    justify-content: center;
    max-width: 1100px;
    margin: 0 auto 50px auto;
}

/* 카테고리 박스 공통 스타일 */
.box {
    width: 95px;
    height: 95px;
    background-color: #fff;
    border: 2px solid #000;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    line-height: 1.4;
    transition: all 0.2s ease;
    padding: 5px;
}

/* ★ 호버 시: 노란색 형광펜 배경 + 빨간색 테두리 (넷플릭스 테마와 조화) */
.box:hover {
    background-color: yellow;
    border-color: blue; /* 넷플릭스 레드 */
    border-width: 5px;
    transform: scale(1.15); /* 살짝 커지는 효과 */
    z-index: 10;
}

/* 반응형 처리 (태블릿 대응) */
@media (max-width: 1100px) {
    #mainbox {
        grid-template-columns: repeat(5, 100px); /* 화면 작아지면 5열로 변경 */
    }
}

/* ===== 도서 리스트 페이지 전용 스타일 ===== */

.list-header {
    text-align: center;
    margin: 50px 0 30px 0;
}

.section-tag {
    display: inline-block;
    padding: 5px 15px;
    border: 2px solid #000;
    border-left: none;
    border-right: none;
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.second-section { margin-top: 80px; }

/* 5열 카드 그리드 */
.book-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 5열 균등 배분 */
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto 50px auto;
    padding: 0 20px;
}

/* 개별 도서 카드 */
.book-card {
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.book-img-wrapper {
    width: 100%;
    aspect-ratio: 2 / 3; /* 책 표지 비율 유지 */
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    background-color: #f5f5f5;
    margin-bottom: 12px;
}

.book-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 이미지가 꽉 차도록 */
    transition: transform 0.3s;
}

/* ★ 넷플릭스 스타일 호버: 살짝 커지면서 입체감 부여 */
.book-card:hover {
    transform: translateY(-10px);
}

.book-card:hover img {
    transform: scale(1.1);
}

.book-info {
    padding: 0 5px;
}

.book-title {
    font-size: 16px;
    font-weight: bold;
    line-height: 1.4;
    color: #333;
    display: inline; /* 형광펜 효과를 위해 inline 설정 */
    transition: all 0.2s;
}

/* ★ 제목 호버 시 노란 형광펜 효과 */
.book-card:hover .book-title {
    background-color: #ffff00;
    box-shadow: 0 0 5px #ffff00;
}

/* 반응형: 화면 작아지면 열 개수 조절 */
@media (max-width: 1024px) { .book-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .book-grid { grid-template-columns: repeat(2, 1fr); } }

/* 여기서부터 모바일 */
/* ==========================================
   [최종] 모바일 통합 최적화 (1155px 이하)
   ========================================== */
@media screen and (max-width: 1155px) {
    /* 1. 기본 레이아웃: 가로 스크롤 완전 제거 */
    html, body { overflow-x: hidden !important; width: 100% !important; }

    /* 2. 헤더: 로그아웃/합격스토리 숨기고 햄버거 노출 */
    #tale-header { height: 60px !important; }
    .header-right { display: none !important; } /* PC용 우측 영역 삭제 */
    .header-inner { position: relative !important; padding: 0 15px !important; }
    
    #mobile-toggle {
        display: flex !important;
        position: absolute !important;
        right: 15px; top: 50%; transform: translateY(-50%);
        flex-direction: column; gap: 5px; width: 30px; cursor: pointer; z-index: 10001;
    }
    #mobile-toggle span { display: block; width: 100%; height: 3px; background: #fff; transition: 0.3s; }

    /* 3. 모바일 전체화면 검은색 메뉴 (오버레이) */
    .header-center {
        display: none; /* 기본은 숨김 */
        position: fixed !important;
        top: 0 !important; left: 0 !important;
        width: 100vw !important; height: 100vh !important;
        background-color: #000000 !important; /* 배경 검정 */
        z-index: 9999 !important;
        padding: 80px 30px 30px 30px !important;
        overflow-y: auto !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: flex-start !important;
    }

    /* 메뉴 활성화 시 노출 */
    .header-center.mobile-nav-active { display: flex !important; }

    /* 4. 세로 메뉴 및 하위 메뉴 (겹침 방지 핵심) */
    .main-menu {
        flex-direction: column !important;
        width: 100% !important;
        height: auto !important;
    }

    .menu-item {
        width: 100% !important;
        margin-bottom: 15px !important;
        position: static !important; /* 겹침 방지 */
    }

    .menu-item > a {
        display: block !important;
        line-height: 1.4 !important; /* PC의 70px 초기화 */
        padding: 10px 0 !important;
        font-size: 22px !important;
        color: white; /* 대분류 노란색 */
        font-weight: bold !important;
        border-bottom: 1px solid #333;
    }

    /* 하위 메뉴: 대분류 바로 밑에 세로로 나열 */
    .sub-menu {
        display: block !important; /* 모바일은 항상 펼침 */
        position: static !important; /* 공중부양 해제 */
        width: 100% !important;
        background: none !important;
        padding: 10px 0 10px 20px !important; /* 왼쪽 여백으로 계단식 표현 */
        box-shadow: none !important;
        border: none !important;
    }

    .sub-menu li { margin-bottom: 8px !important; }
    .sub-menu li a {
        font-size: 17px !important;
        color: #ccc !important;
        line-height: 1.4 !important;
    }

    /* 5. 모바일 전용 유저 정보 (메뉴 최상단 배치) */
    .mobile-user-info {
        display: flex !important;
        flex-direction: column;
        gap: 15px;
        margin-bottom: 30px;
        width: 100%;
    }
    .mobile-user-info .user-nickname { color: #fff; font-size: 1.2rem; }
    .mobile-logout-btn {
        width: 100px; padding: 10px; background: #ff0000; color: #fff !important;
        text-align: center; border-radius: 4px; font-weight: bold;
    }

    /* 6. 페이지/그리드 정렬 (너비 100% 맞춤) */
    div[style*="width: 755px"], .contenttitle, #writeForm, #filebox, .content-wrapper {
        width: 100% !important; max-width: 100vw !important;
        padding: 0 15px !important; box-sizing: border-box !important;
    }
    #bookmainbox { grid-template-columns: repeat(3, 1fr) !important; gap: 8px !important; }
    .book-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 15px !important; }
    #indexhomeimg { width: 100% !important; height: auto !important; }
}
/* 모바일 통합 최적화: 중앙 정렬 및 요소 너비 동기화 */
@media screen and (max-width: 1155px) {
    
    /* 1. 가로 스크롤 방지 및 기본 너비 설정 */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
    }

    /* 2. 주요 컨테이너(KEYWORDS, 755px 박스 등)를 92% 너비로 중앙 정렬 */
    #keywords,
    div[style*="width: 755px"], 
    .contenttitle, 
    #writeForm, 
    #filebox,
    .content-wrapper {
        width: 92% !important; /* 모든 요소의 가로 길이를 동일하게 맞춤 */
        max-width: 92% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    /* 3. 버튼과 선택창을 부모 너비(92%)에 꽉 차게 100%로 설정 */
    .pdfbutton-main, 
    #jongSelect, 
    .pdfbutton-cover,
    .text, 
    .cover-textarea {
        width: 100% !important; /* 상단 박스들과 가로 길이를 완벽히 일치시킴 */
        display: block !important;
        margin: 10px 0 !important;
        box-sizing: border-box !important;
    }

    /* 4. 필드셋(글쓰기 박스) 내부 여백 및 정렬 조정 */
    fieldset {
        width: 100% !important;
        padding: 15px !important;
        margin: 20px 0 !important;
        box-sizing: border-box !important;
    }

    /* 5. 활동 구분 제목 바 정렬 보정 */
    #display-subject-name {
        width: 100% !important;
        font-size: 20px !important;
        text-align: left !important;
        padding-left: 15px !important;
        border-left: 6px solid #E50914 !important;
    }
}

/* style.css의 1155px 미디어 쿼리 내부 */

/* 이전 단계에서 추가한 기본 링크 스타일은 유지 (패딩, 블록 등) */
#mobile-menu a {
    display: block !important;
    width: 100%;
    padding: 15px 20px !important;
    text-decoration: none;
    color: white; /* 기본 글자색 흰색 */
    box-sizing: border-box;
    line-height: 1.2;
}

/* 모바일 메뉴 호버 시: 배경은 투명하게, 글자만 빨간색으로 */
#mobile-menu a:hover {
    background-color: transparent !important; /* 기존의 회색 배경 제거 */
    color: red !important; /* 글자색을 강렬한 빨간색으로 변경 */
    /* 혹시 모를 테두리 둥글기도 제거 */
    border-radius: 0 !important;
}
