/* =========================================
   학락(haklak.net) 공통 스타일
   - 기본 디자인: 사용자 제공 CSS(노란 헤더 · 3단 구성)
   - 덧붙인 것: 펼침 소메뉴, 하위 페이지 틀, 문의 상자, 양식·표·버튼, 사업자 정보 꼬리말
========================================= */

/* =========================================
   기본 설정 (색을 바꿀 땐 여기만)
========================================= */
:root {
    --main-yellow: #f4c94e;
    --main-orange: #ed8b26;
    --soft-yellow: #fff5d5;
    --border-color: #dedbd2;
    --text-color: #444;
    --sub-color: #888;
    --bg-color: #f5f5f2;
    --header-yellow: #f5cf53;
    --logo-brown: #72521b;
}

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

body {
    font-family: "Malgun Gothic", "맑은 고딕", "Noto Sans KR", sans-serif;
    font-size: 13px;
    color: var(--text-color);
    background: #ededeb;
    line-height: 1.6;
    word-break: keep-all;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }
ul { list-style: none; }

/* =========================================
   전체 홈페이지
========================================= */
.site-wrapper {
    width: 100%;
    max-width: 1180px;
    min-height: 100vh;
    margin: 0 auto;
    background: #fff;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
}

/* =========================================
   상단 헤더
========================================= */
.site-header {
    height: 76px;
    background: var(--header-yellow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
}

.site-logo {
    font-size: 23px;
    font-weight: bold;
    color: var(--logo-brown);
    letter-spacing: -1px;
}

.site-logo small {
    display: block;
    font-size: 10px;
    font-weight: normal;
    color: #856b36;
    letter-spacing: 0;
}

.header-search { display: flex; align-items: center; }

.header-search input {
    width: 180px;
    height: 25px;
    border: 1px solid #d4ad43;
    padding: 5px 8px;
    background: #fff;
    font-size: 11px;
}

.header-search button {
    height: 25px;
    padding: 0 12px;
    border: 0;
    background: #d99b26;
    color: white;
    cursor: pointer;
}

.menu-toggle {
    display: none;
    border: 0;
    background: none;
    font-size: 22px;
    color: var(--logo-brown);
    cursor: pointer;
    margin-left: 8px;
}

.header-search .menu-toggle { display: none; height: auto; padding: 0 2px; background: none; color: var(--logo-brown); }

/* =========================================
   상단 메뉴 (+ 펼침 소메뉴)
========================================= */
.main-nav {
    height: 38px;
    background: #fff;
    border-bottom: 1px solid #ccc;
    padding: 0 22px;
    position: relative;
    z-index: 30;
}

.main-nav > ul { display: flex; height: 100%; white-space: nowrap; }
.main-nav > ul > li { position: relative; }

.main-nav > ul > li > a {
    padding: 0 15px;
    height: 38px;
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #444;
    border-right: 1px solid #eee;
}

.main-nav > ul > li:first-child > a { padding-left: 5px; }
.main-nav > ul > li.has-sub > a::after { content: "▾"; font-size: 9px; color: #aaa; margin-left: 4px; }

.main-nav > ul > li > a:hover,
.main-nav > ul > li:hover > a {
    color: #d78118;
    background: #fff8e6;
}

.main-nav > ul > li.on > a { color: #d78118; font-weight: bold; }

.main-nav .sub {
    display: none;
    position: absolute;
    top: 38px;
    left: 0;
    min-width: 150px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-top: 2px solid var(--main-yellow);
    box-shadow: 0 4px 10px rgba(0, 0, 0, .06);
    padding: 4px 0;
}

.main-nav > ul > li:hover .sub,
.main-nav > ul > li:focus-within .sub { display: block; }

.main-nav .sub a {
    display: block;
    padding: 7px 14px;
    font-size: 12px;
    color: #555;
}

.main-nav .sub a:hover { background: #fff8e6; color: #d78118; }

/* =========================================
   메인 이미지 배너 (이미지가 없으면 글자 배너)
========================================= */
.main-visual {
    width: 100%;
    height: 330px;
    overflow: hidden;
    background: #392b20;
    position: relative;
}

.main-visual img { width: 100%; height: 100%; object-fit: cover; }

.main-visual .visual-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 45px;
    color: #fff;
    background: linear-gradient(90deg, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0));
}

.main-visual .visual-text strong { font-size: 30px; font-weight: normal; line-height: 1.4; }
.main-visual .visual-text span { font-size: 13px; color: #f4dfa8; margin-top: 8px; }

/* =========================================
   메인 콘텐츠 레이아웃 (3단)
========================================= */
.content-area {
    display: grid;
    grid-template-columns: 225px minmax(0, 1fr) 225px;
    gap: 20px;
    padding: 25px 22px;
    flex: 1;
}

.content-box { background: #fff; margin-bottom: 20px; }

.box-title {
    font-size: 14px;
    font-weight: bold;
    padding: 8px 0;
    border-bottom: 2px solid var(--main-yellow);
    margin-bottom: 12px;
    color: #444;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.box-title .more, .section-title .more { font-size: 11px; font-weight: normal; color: var(--sub-color); }
.box-title .more:hover, .section-title .more:hover { color: #d78118; }

/* =========================================
   왼쪽 사이드바
========================================= */
.left-sidebar { min-width: 0; }

.quick-menu { display: flex; flex-direction: column; gap: 7px; }

.quick-menu a {
    padding: 9px 12px;
    background: #faf8f1;
    border: 1px solid #e8e2d2;
    color: #555;
    font-size: 12px;
}

.quick-menu a:hover { background: #fff1c4; border-color: #e9c55b; }
.quick-menu a.on { background: #fff1c4; border-color: #e9c55b; color: #b4690f; font-weight: bold; }

/* =========================================
   중앙 메인 영역
========================================= */
.main-content { min-width: 0; }

.section-title {
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9c24d;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.featured-menu {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 22px;
}

.featured-item { display: block; border: 1px solid #ddd; background: #fff; overflow: hidden; }
.featured-item img { width: 100%; height: 110px; object-fit: cover; }

/* 이미지가 아직 없을 때 쓰는 칸 */
.featured-item .thumb {
    height: 110px;
    background: var(--soft-yellow);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b98a2a;
    font-size: 12px;
}

.featured-item p { padding: 8px 5px; text-align: center; font-size: 11px; color: #555; }
.featured-item:hover { border-color: #e3b842; }

/* 메인 게시물 */
.main-article {
    padding: 18px;
    border: 1px solid #e5e5e5;
    background: #fff;
    margin-bottom: 18px;
}

.main-article h2 { font-size: 22px; font-weight: normal; margin-bottom: 12px; }
.main-article .article-meta { font-size: 11px; color: #999; margin-bottom: 15px; }
.main-article p { line-height: 1.9; font-size: 13px; }

.today { display: flex; gap: 18px; align-items: center; }
.today .big { font-size: 60px; line-height: 1; min-width: 70px; text-align: center; color: #333; }

/* 게시물 목록 */
.board-list { border-top: 1px solid #ddd; }

.board-list li {
    padding: 10px 5px;
    border-bottom: 1px solid #eee;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.board-list li:hover { background: #fffaf0; }
.board-list time { color: #999; font-size: 11px; white-space: nowrap; }

/* =========================================
   오른쪽 사이드바
========================================= */
.right-sidebar { min-width: 0; }

/* 로그인 상자 자리 → 문의 상자 */
.login-box, .contact-box {
    padding: 13px;
    background: #f8f8f8;
    border: 1px solid #ddd;
    margin-bottom: 20px;
}

.login-box h3, .contact-box h3 { font-size: 13px; margin-bottom: 10px; }
.contact-box p { font-size: 11px; color: var(--sub-color); margin-bottom: 10px; }

.login-box input {
    display: block;
    width: 100%;
    height: 30px;
    padding: 6px;
    border: 1px solid #ddd;
    margin-bottom: 6px;
    font-size: 11px;
}

.login-box button {
    width: 100%;
    height: 32px;
    background: var(--main-orange);
    border: none;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
}

.login-box button:hover { background: #d97a17; }
.login-links { margin-top: 8px; font-size: 10px; color: #888; text-align: center; }

.side-banner { display: block; margin-bottom: 18px; border: 1px solid #eee; overflow: hidden; }
.side-banner img { width: 100%; height: auto; }

/* 이미지 없는 글자 배너 */
.side-banner.text {
    padding: 16px 12px;
    text-align: center;
    background: var(--soft-yellow);
    border-color: #f0dfa8;
}

.side-banner.text strong { display: block; font-size: 13px; color: #a8650c; }
.side-banner.text span { font-size: 11px; color: var(--sub-color); }

/* =========================================
   버튼 · 입력창 · 표
========================================= */
.btn {
    display: inline-block;
    height: 32px;
    line-height: 30px;
    padding: 0 14px;
    border: 1px solid #ccc;
    background: #fff;
    color: #555;
    font-size: 12px;
    text-align: center;
    cursor: pointer;
}

.btn:hover { border-color: #e3b842; color: #d78118; }
.btn-primary { background: var(--main-orange); border-color: var(--main-orange); color: #fff; font-weight: bold; }
.btn-primary:hover { background: #d97a17; color: #fff; }
.btn-block { display: block; width: 100%; }
.btn-block + .btn-block { margin-top: 6px; }

.form-row { margin-bottom: 10px; }
.form-row label { display: block; font-size: 12px; color: #666; margin-bottom: 3px; }

.form-row input, .form-row select, .form-row textarea {
    width: 100%;
    border: 1px solid #ddd;
    padding: 6px 8px;
    font-size: 12px;
}

.form-row input, .form-row select { height: 30px; }
.form-row textarea { min-height: 130px; resize: vertical; }
.form-row input:focus, .form-row textarea:focus { outline: 1px solid var(--main-yellow); border-color: #e3b842; }
.form-agree { font-size: 11px; color: #777; display: flex; gap: 6px; align-items: flex-start; }

.info-table { width: 100%; border-collapse: collapse; border-top: 2px solid var(--main-yellow); font-size: 12px; }
.info-table th, .info-table td { padding: 9px 10px; border-bottom: 1px solid #eee; text-align: left; vertical-align: top; }
.info-table th { width: 120px; background: #faf8f1; font-weight: bold; }

/* =========================================
   하위 페이지 (경로 · 제목 · 왼쪽 소메뉴 · 본문)
   → 왼쪽 사이드바 자리에 소메뉴, 가운데+오른쪽 자리를 본문으로 씀
========================================= */
.page-head { padding: 18px 25px 14px; border-bottom: 1px solid #eee; background: #fdfcf8; }
.crumb { font-size: 11px; color: #999; }
.crumb span + span::before { content: " > "; }
.page-head h1 { font-size: 20px; font-weight: bold; color: #333; margin-top: 2px; }

.content-area.sub-page { grid-template-columns: 225px minmax(0, 1fr); }

.page-body h2 { font-size: 18px; font-weight: normal; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid #e9c24d; }
.page-body h3 { font-size: 14px; margin: 20px 0 8px; color: #b4690f; }
.page-body p { line-height: 1.9; margin-bottom: 10px; }
.page-body .sign { text-align: right; margin-top: 20px; }
.page-body .sign strong { font-size: 16px; margin-left: 6px; }

/* =========================================
   하단 푸터
========================================= */
.site-footer {
    padding: 22px 25px;
    background: #f5f3ec;
    border-top: 1px solid #ddd;
    text-align: center;
    color: #888;
    font-size: 11px;
    line-height: 1.9;
}

.footer-links { margin-bottom: 8px; }
.footer-links a { margin: 0 7px; color: #666; }
.footer-links a:hover { color: #d78118; }
.footer-links a.strong { font-weight: bold; color: #444; }
.biz-info span { display: inline-block; margin: 0 6px; }

/* =========================================
   반응형 - 태블릿
========================================= */
@media (max-width: 900px) {
    .content-area { grid-template-columns: 190px minmax(0, 1fr); }
    .right-sidebar { display: none; }
    .main-visual { height: 260px; }
}

/* =========================================
   반응형 - 모바일
========================================= */
@media (max-width: 600px) {
    .site-header { height: 60px; padding: 0 12px; }
    .site-logo { font-size: 19px; }
    .header-search input { width: 100px; }
    .header-search .menu-toggle { display: block; }

    .main-nav { height: auto; padding: 0; display: none; }
    .main-nav.open { display: block; }
    .main-nav > ul { flex-direction: column; }
    .main-nav > ul > li > a, .main-nav > ul > li:first-child > a { height: 40px; padding: 0 14px; border-right: 0; border-bottom: 1px solid #eee; font-size: 13px; }
    .main-nav > ul > li.has-sub > a::after { content: ""; }
    .main-nav .sub { display: block; position: static; border: 0; box-shadow: none; padding: 2px 0 6px 14px; background: #fcfbf7; }

    .main-visual { height: 170px; }
    .main-visual .visual-text { padding: 0 18px; }
    .main-visual .visual-text strong { font-size: 19px; }

    .content-area, .content-area.sub-page { display: flex; flex-direction: column; padding: 15px 12px; gap: 10px; }
    .left-sidebar { order: 2; }
    .main-content { order: 1; }
    .right-sidebar { display: block; order: 3; }
    .sub-page .left-sidebar { order: 0; }

    .featured-menu { grid-template-columns: repeat(2, 1fr); }
    .featured-item img, .featured-item .thumb { height: 100px; }
    .main-article { padding: 12px; }
    .main-article h2 { font-size: 19px; }
    .page-head { padding: 14px 12px 10px; }
}

/* 관리자에서 넣는 사진 */
.site-logo .logo-img { max-height: 44px; width: auto; }
.page-body .page-image { max-width: 100%; margin: 0 0 16px; border: 1px solid #eee; }
.main-visual img + .visual-text { background: linear-gradient(90deg, rgba(0, 0, 0, .5), rgba(0, 0, 0, 0)); }

/* 학락의 방향: 원칙 목록 */
.principles { list-style: none; margin: 18px 0; display: flex; flex-direction: column; gap: 10px; }
.principles li { display: flex; gap: 16px; padding: 16px 18px; background: #faf8f1; border: 1px solid #e8e2d2; }
.principles .no { font-size: 22px; font-weight: bold; color: var(--main-orange); min-width: 34px; line-height: 1.2; }
.principles h3 { font-size: 15px; margin: 0 0 4px; color: #333; }
.principles p { margin: 0; color: #555; }

/* 연혁 */
.timeline { list-style: none; margin: 10px 0 0; border-left: 2px solid var(--main-yellow); padding-left: 0; }
.timeline li { position: relative; display: flex; gap: 18px; padding: 10px 0 10px 22px; border-bottom: 1px dashed #eee; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 16px; width: 10px; height: 10px; border-radius: 50%; background: var(--main-orange); }
.timeline .date { font-weight: bold; color: #b4690f; min-width: 80px; }

/* 오시는 길 */
.map-box { border: 1px solid #ddd; background: #f5f5f2; margin-bottom: 10px; }
.map-box iframe { display: block; width: 100%; height: 340px; border: 0; }
.map-box img { width: 100%; }
.map-link { text-align: right; margin-bottom: 14px; }

@media (max-width: 600px) {
    .map-box iframe { height: 240px; }
    .timeline li { flex-direction: column; gap: 2px; }
}

/* 도서 목록 */
.book-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 16px; }
.book-list a { display: block; }
.book-list .cover { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border: 1px solid #ddd; box-shadow: 2px 3px 0 #ece7da; }
.no-cover { display: flex; align-items: center; justify-content: center; background: var(--soft-yellow); color: #b98a2a; font-size: 12px; }
.book-list .info { padding: 8px 2px; }
.book-list .info strong { display: block; font-size: 13px; color: #333; }
.book-list .info span:not(.badge) { display: block; font-size: 11px; color: var(--sub-color); }
.book-list a:hover strong { color: #d78118; }
.badge { display: inline-block; padding: 0 6px; margin: 0 4px 4px 0; font-size: 10px; line-height: 18px; color: #fff; border-radius: 2px; }
.badge.soon { background: #7a8aa0; }
.badge.new { background: var(--main-orange); }
.empty-note { padding: 40px 0; text-align: center; color: var(--sub-color); background: #faf8f1; border: 1px dashed #e8e2d2; margin-top: 14px; }

/* 도서 상세 */
.book-detail { display: grid; grid-template-columns: 220px 1fr; gap: 24px; margin-bottom: 10px; }
.book-detail .cover { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border: 1px solid #ddd; box-shadow: 3px 4px 0 #ece7da; }
.book-detail h2 { border: 0; padding: 0; margin: 4px 0 4px; font-size: 22px; }
.book-detail .subtitle { color: var(--sub-color); margin-bottom: 12px; }
.book-detail .buy { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.book-detail .buy strong { margin-right: 6px; }
.page-body .toc { background: #faf8f1; padding: 12px 14px; border: 1px solid #eee; }
.page-body .back { margin-top: 24px; text-align: center; }

@media (max-width: 900px) { .book-list { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) {
    .book-list { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .book-detail { grid-template-columns: 1fr; }
    .book-detail .cover { max-width: 220px; }
}

/* 강의·교육 */
.program-list { list-style: none; margin: 16px 0; display: flex; flex-direction: column; gap: 12px; }
.program-list li { display: flex; gap: 18px; padding: 16px 18px; border: 1px solid #e8e2d2; background: #fff; }
.program-list img { width: 180px; aspect-ratio: 4 / 3; object-fit: cover; flex-shrink: 0; }
.program-list h3 { font-size: 15px; margin: 0 0 4px; color: #333; }
.program-list .meta { font-size: 11px; color: #b4690f; margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.program-list p { margin: 0; color: #555; }
.steps { list-style: none; margin: 10px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.steps li { padding: 14px 12px; background: #faf8f1; border: 1px solid #e8e2d2; border-top: 3px solid var(--main-yellow); }
.steps .no { display: block; font-size: 10px; font-weight: bold; color: var(--main-orange); }
.steps strong { display: block; font-size: 14px; margin: 2px 0 4px; color: #333; }
.steps li span:last-child { font-size: 12px; color: #666; }
.checklist { list-style: none; margin: 8px 0 0; padding: 12px 16px; background: #faf8f1; border: 1px solid #eee; }
.checklist li { padding: 4px 0 4px 20px; position: relative; }
.checklist li::before { content: "✓"; position: absolute; left: 0; color: var(--main-orange); font-weight: bold; }
.cta-box { margin-top: 26px; padding: 18px 20px; text-align: center; background: var(--soft-yellow); border: 1px solid #f0dfa8; }
.cta-box p { margin: 0 0 10px; color: #6b5420; }
.cta-box p:last-child { margin-bottom: 0; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) {
    .program-list li { flex-direction: column; }
    .program-list img { width: 100%; }
}

/* 영상 */
.video-list { list-style: none; margin: 16px 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px 18px; }
.video-box { position: relative; aspect-ratio: 16 / 9; background: #222; }
.video-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-list h3 { font-size: 14px; margin: 8px 0 2px; color: #333; }
.video-list .date { font-size: 11px; color: var(--sub-color); }
.video-list p { margin: 4px 0 0; color: #555; font-size: 12px; }
.program-list .go { margin-top: 10px; }
@media (max-width: 600px) { .video-list { grid-template-columns: 1fr; } }

/* 문의 · 투고 */
.inq-form { margin-top: 16px; max-width: 640px; }
.inq-form .form-row label { font-size: 12px; color: #555; font-weight: bold; }
.inq-form .form-row em { color: var(--main-orange); font-style: normal; }
.inq-form .form-row input[type=file] { height: auto; padding: 5px; background: #fff; }
.inq-form .hint { font-size: 11px; color: var(--sub-color); margin: 3px 0 0; }
.inq-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.agree-box { margin: 16px 0 10px; padding: 12px 14px; background: #faf8f1; border: 1px solid #eee; font-size: 12px; color: #555; }
.agree-box strong { display: block; margin-bottom: 4px; color: #333; }
.agree-box p { margin: 0 0 6px; }
.agree-box .form-agree { margin-top: 8px; font-size: 12px; color: #333; }
.inq-form .submit { text-align: center; margin-top: 14px; }
.inq-form .submit .btn { height: 38px; line-height: 36px; padding: 0 34px; font-size: 13px; }
.form-errors { margin: 14px 0 0; padding: 10px 14px 10px 30px; background: #fdecea; border: 1px solid #f5c2bd; color: #b3261e; font-size: 12px; }
.cta-box.done { text-align: left; }
.content-area.sub-page.no-lnb { grid-template-columns: minmax(0, 1fr); }
.doc-text h3 { margin-top: 22px; }
.doc-text p { color: #444; }

/* 소식 게시판 */
.post-list { margin-top: 16px; }
.post-list li.pin { background: #fffaf0; }
.tag { display: inline-block; margin-right: 6px; padding: 0 6px; font-size: 10px; line-height: 18px; color: #a8650c; border: 1px solid #f0d08a; background: #fff8e6; border-radius: 2px; vertical-align: 1px; }
.tag.pin { color: #fff; background: var(--main-orange); border-color: var(--main-orange); }
.pager { margin-top: 18px; text-align: center; font-size: 12px; }
.pager a, .pager strong { display: inline-block; min-width: 28px; padding: 4px 6px; margin: 0 2px; border: 1px solid #ddd; }
.pager strong { background: var(--main-yellow); border-color: var(--main-yellow); }
.post-view header { border-bottom: 2px solid var(--main-yellow); padding-bottom: 10px; margin-bottom: 16px; }
.post-view h2 { border: 0; padding: 0; margin: 4px 0 2px; }
.post-view time { font-size: 11px; color: var(--sub-color); }
.post-view .post-link { margin-top: 16px; }
