/*
 Theme Name:   YS Note Child
 Theme URI:    https://ys-note.com
 Description:  YS Note Child Theme based on GeneratePress
 Author:       YS Note
 Template:     generatepress
 Version:      1.0.0
*/

/* --- 0. 웹폰트 (Pretendard) --- */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.min.css');

/* --- 0-1. CSS 변수 (다크모드 지원) --- */
:root {
    --color-bg: #f4f6f8;
    --color-bg-card: #ffffff;
    --color-text: #333333;
    --color-text-muted: #64748b;
    --color-heading: #111111;
    --color-border: rgba(0, 0, 0, 0.06);
    --color-primary: #1a4a7a;
    --color-header-bg: rgba(255, 255, 255, 0.85);
    --color-shadow: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    --color-bg: #0f172a;
    --color-bg-card: #1e293b;
    --color-text: #e2e8f0;
    --color-text-muted: #94a3b8;
    --color-heading: #f8fafc;
    --color-border: rgba(255, 255, 255, 0.1);
    --color-primary: #60a5fa;
    --color-header-bg: rgba(15, 23, 42, 0.9);
    --color-shadow: rgba(0, 0, 0, 0.3);
}

/* --- 1. 기본 타이포그래피 개선 --- */
body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 17px;
    line-height: 1.7;
    color: var(--color-text);
    background-color: var(--color-bg);
    transition: background-color 0.3s, color 0.3s;
}


h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--color-heading);
    font-weight: 700;
    margin-bottom: 0.8em;
}

/* 글 상세 페이지 제목 (h1) 크기 조정 */
.single .entry-title,
.page .entry-title,
article h1.entry-title {
    font-size: 1.8em;
}

/* 피드 목록에서의 포스트 제목 크기 축소 */
.site-main .entry-title,
.archive .entry-title,
.home .entry-title {
    font-size: 1.4em;
    line-height: 1.4;
}

h3 {
    font-size: 1.3em;
}

/* 본문 내 헤딩 스타일 */
.entry-content h2,
.post-content h2,
article h2 {
    margin-top: 1.5em !important;
    margin-bottom: 0.8em;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.entry-content h3,
.post-content h3,
article h3 {
    font-size: 1.3em;
    margin-top: 1.3em;
    margin-bottom: 0.6em;
}

.entry-content h4,
.post-content h4,
article h4 {
    font-size: 1.1em;
    margin-top: 1.2em;
    margin-bottom: 0.5em;
}

/* 글 제목은 상단 마진 제거 */
.entry-title,
.entry-header h2.entry-title,
.single .entry-title {
    margin-top: 0 !important;
    border-bottom: none;
}

/* 글 본문 대표 이미지 숨김 */
.single .post-image,
.single .featured-image {
    display: none !important;
}

/* --- 2. 카드 스타일 레이아웃 (Card UI) --- */
/* 메인 컨텐츠 영역 */
.site-main .post,
.site-main .page {
    background: var(--color-bg-card);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px var(--color-shadow);
    margin-bottom: 30px;
    overflow: hidden;
    border: 1px solid var(--color-border);
}

/* GeneratePress inside-article 패딩 */
.separate-containers .inside-article {
    padding: 32px !important;
}

/* 사이드바 - 스티키 제거 (시리즈 네비게이션만 스티키) */
.inside-right-sidebar {
    /* position: sticky 제거 - 시리즈 네비게이션이 독립적으로 스티키 */
    margin-top: 0 !important;
}

/* 사이드바 컨테이너 본문과 상단 정렬 */
.site-content .content-area,
.site-content .widget-area,
.right-sidebar {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.inside-right-sidebar::-webkit-scrollbar {
    width: 4px;
}

.inside-right-sidebar::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

/* 사이드바 위젯 영역 (카드 스타일) */
.sidebar .widget {
    background: var(--color-bg-card);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--color-shadow);
    margin-bottom: 20px;
    border: 1px solid var(--color-border);
}

/* 사이드바 위젯 타이틀 스타일 */
.sidebar .widget-title {
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 2px solid #f1f5f9;
}

/* 모바일 패딩 조정 */
@media (max-width: 768px) {
    .separate-containers .inside-article {
        padding: 0px !important;
    }

    .sidebar .widget {
        padding: 16px;
    }
}

/* --- 3. 스티키 헤더 (글래스모피즘) --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 999;
    background: var(--color-header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 var(--color-border);
    border-bottom: 1px solid var(--color-border);
    overflow: visible !important;
}

.inside-header {
    overflow: visible !important;
}

.inside-header {
    padding: 12px 20px;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    gap: 12px;
}

/* 사이트 로고/제목 - 항상 좌측 정렬 */
.site-branding {
    flex: 1;
    min-width: 0;
    text-align: left !important;
}

.site-branding,
.site-logo {
    margin-left: 0 !important;
    margin-right: auto !important;
}

/* 헤더 위젯 (언어 전환기) */
.header-widget {
    flex-shrink: 0;
    margin-left: auto;
    margin-top: 0 !important;
}

/* 중복 제거됨 - 아래 154번 줄에 통합 */

/* 본문 영역 상단 여백 줄이기 */
.site-content {
    padding-top: 30px !important;
}

.site-main {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* 워드프레스 관리자 바 있을 때 */
.admin-bar .site-header {
    top: 32px;
}

@media (max-width: 782px) {
    .admin-bar .site-header {
        top: 46px;
    }

    .inside-header {
        padding: 12px 20px;
        gap: 12px;
    }

    .site-content {
        padding-top: 8px !important;
    }
}

/* --- 3-1. 다크모드 토글 버튼 --- */
.ys-theme-toggle {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--color-text-muted);
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ys-theme-toggle:hover {
    color: var(--color-primary);
}

/* 라이트 모드: 달 아이콘 표시, 해 숨김 */
.ys-theme-toggle__sun {
    display: none;
}

.ys-theme-toggle__moon {
    display: block;
}

/* 다크 모드: 해 아이콘 표시, 달 숨김 */
[data-theme="dark"] .ys-theme-toggle__sun {
    display: block;
}

[data-theme="dark"] .ys-theme-toggle__moon {
    display: none;
}

/* --- 4. 헤더 언어 전환 (Polylang) --- */


/* 헤더 위젯 영역 Polylang */
.header-widget .widget_polylang {
    margin: 0;
    padding: 0;
}

/* Polylang 드롭다운 스타일 */
.pll-switcher-select {
    padding: 8px 32px 8px 12px;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23374151' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: all 0.2s;
}

.pll-switcher-select:hover {
    background-color: #f9fafb;
    border-color: #4f46e5;
}

.pll-switcher-select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* --- 4-1. 헤더 주제 메뉴 (Topic Menu) --- */
.topic-header-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 24px;
}

.topic-header-menu__link {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    color: #64748b;
    font-size: 0.9em;
    font-weight: 500;
    text-decoration: none;
    border-radius: 20px;
    transition: all 0.2s;
}

.topic-header-menu__link:hover {
    color: #4f46e5;
    background: #eef2ff;
    text-decoration: none;
}

.topic-header-menu__link--active {
    color: #ffffff;
    background: #4f46e5;
}

.topic-header-menu__link--active:hover {
    color: #ffffff;
    background: #4338ca;
}

/* 모바일 헤더 메뉴 조정 */
@media (max-width: 768px) {
    .topic-header-menu {
        display: none !important;
        /* 상단 탭은 모바일에서 숨김 */
    }

    /* 모바일 햄버거 버튼 강제 노출 (메뉴가 비어있어도 보이게) */
    .menu-toggle,
    #mobile-header .menu-toggle {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: auto !important;
    }
}

/* --- 4-2. 커스텀 모바일 메뉴 (라이트 테마) --- */
.ys-mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    padding: 12px;
    cursor: pointer;
    z-index: 10001;
    margin-left: auto;
}

.ys-mobile-toggle:hover,
.ys-mobile-toggle:focus {
    background: transparent;
    outline: none;
}

/* 메뉴 오픈 시 햄버거 버튼 숨김 */
body.ys-mobile-menu-active .ys-mobile-toggle {
    display: none !important;
}

@media (max-width: 768px) {
    .ys-mobile-toggle {
        display: inline-flex;
    }
}

.ys-mobile-toggle__box {
    width: 20px;
    height: 14px;
    display: inline-block;
    position: relative;
}

.ys-mobile-toggle__inner,
.ys-mobile-toggle__inner::before,
.ys-mobile-toggle__inner::after {
    width: 20px;
    height: 2px;
    background-color: #64748b;
    position: absolute;
    transition: all 0.2s;
    border-radius: 1px;
}

.ys-mobile-toggle__inner {
    top: 50%;
    margin-top: -1px;
}

.ys-mobile-toggle__inner::before {
    content: "";
    top: -6px;
}

.ys-mobile-toggle__inner::after {
    content: "";
    bottom: -6px;
}

/* X 변형 애니메이션 제거 - 단순히 숨김 처리로 대체 */

/* 모바일 메뉴 오버레이 (배경) */
.ys-mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s;
}

.ys-mobile-menu-overlay.is-open {
    visibility: visible;
    opacity: 1;
}

/* 모바일 메뉴 백드롭 */
.ys-mobile-menu-overlay__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}

/* 메뉴 패널 (라이트 테마) - 오른쪽에서 슬라이드 */
.ys-mobile-menu-overlay__panel {
    position: absolute;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background: #ffffff;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    z-index: 1;
    padding-top: 60px;
}

.ys-mobile-menu-overlay.is-open .ys-mobile-menu-overlay__panel {
    right: 0;
}


.ys-mobile-menu-overlay__logo {
    font-weight: 800;
    color: #1a4a7a;
    font-size: 1.2rem;
    letter-spacing: -0.5px;
}

/* X 닫기 버튼 */
.ys-mobile-menu-overlay__close-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 24px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.ys-mobile-menu-overlay__close-btn:hover {
    background: #eef2ff;
    color: #1a4a7a;
    border-color: #1a4a7a;
}

.ys-mobile-menu-overlay .mobile-menu-section__title {
    color: #4f46e5;
    font-weight: 700;
}

/* 본문 스크롤 방지 */
body.ys-mobile-menu-active {
    overflow: hidden;
}

/* 모바일 메뉴 내부 애드온 스타일 */
#mobile-menu ul.sub-menu {
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    margin-left: 15px;
}

/* 섹션 스타일 공통 */
.mobile-menu-section {
    padding: 24px 20px;
    border-bottom: 1px solid #f5f5f5;
}

.mobile-menu-section__title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #a0aec0;
    margin-bottom: 16px;
    font-weight: 700;
}

/* 모바일 언어 전환 (카드 형태) */
.mobile-menu-languages__list {
    list-style: none;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.mobile-menu-languages__list li {
    background: #f8fafc;
    border: 1px solid #edf2f7;
    border-radius: 8px;
    transition: all 0.2s;
}

.mobile-menu-languages__list li:hover {
    border-color: #1a4a7a;
    background: #fff;
}

.mobile-menu-languages__list li.current-lang {
    border-color: #1a4a7a;
    background: #eef2ff;
}

.mobile-menu-languages__list li a {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    gap: 6px;
    color: #4a5568;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.mobile-menu-languages__list li a img {
    width: 20px;
    height: auto;
    border-radius: 2px;
}

/* 모바일 주제 선택 (네이비 포인트) */
.mobile-menu-topics__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.mobile-menu-topic-item {
    background: #fff;
    padding: 14px 16px;
    border-radius: 10px;
    color: #2d3748;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.mobile-menu-topic-item::after {
    content: "→";
    opacity: 0.3;
}

.mobile-menu-topic-item.is-active {
    background: #1a4a7a;
    color: #fff;
    border-color: #1a4a7a;
}

.mobile-menu-topic-item.is-active::after {
    opacity: 1;
}

/* 모바일 카테고리 리스트 */
.mobile-menu-categories__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-menu-categories__list li {
    margin-bottom: 0;
    /* 카테고리명과 갯수를 한 줄에 */
    display: flex;
    align-items: baseline;
    flex-wrap: nowrap;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
}

.mobile-menu-categories__list li a {
    color: #4a5568;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    flex-shrink: 0;
}

.mobile-menu-categories__list li a:hover {
    color: #1a4a7a;
}

/* 카테고리 글 갯수 (비링크 텍스트로 표시 됨) */
.mobile-menu-categories__list li {
    font-size: 13px;
    color: #94a3b8;
}

.mobile-menu-categories__list .children {
    margin: 5px 0 10px 15px;
    padding-left: 15px;
    border-left: 2px solid #f0f0f0;
}

/* 본문 스크롤 방지 */
body.ys-mobile-menu-active {
    overflow: hidden;
}

/* 태블릿: 간격 조정 */
@media (max-width: 1024px) and (min-width: 769px) {
    .topic-header-menu {
        margin-left: 16px;
        gap: 2px;
    }

    .topic-header-menu__link {
        padding: 6px 12px;
        font-size: 0.85em;
    }
}

/* --- 4. 링크 스타일 --- */
a {
    color: #2563eb;
    /* 모던한 블루 */
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* --- 5. 블로그 메타데이터 (날짜, 카테고리 등) --- */
.entry-meta {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 20px;
}

.cat-links a,
.tags-links a {
    display: inline-block;
    /* ✨ 줄바꿈 시 간격 확보 */
    background: #eef2ff;
    color: #4f46e5;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
    margin-right: 5px;
    margin-bottom: 5px;
    /* ✨ 아래 간격 추가 */
    text-decoration: none;
}

.cat-links a:hover,
.tags-links a:hover {
    background: #4f46e5;
    color: #ffffff;
    text-decoration: none;
}

/* 태그/카테고리 사이 쉼표 숨김 */
.cat-links>a:not(:last-child)::after,
.tags-links>a:not(:last-child)::after {
    content: none !important;
}

/* --- 6. 푸터 스타일 (가로 한 줄 레이아웃) --- */
/* 푸터 위젯 영역 숨김 (사용 안 함) */
.footer-widgets {
    display: none;
}

/* 사이트 푸터 바 */
.site-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 20px 40px;
    background: #ffffff;
    border-top: 1px solid #eaeaea;
    font-size: 0.9em;
    color: #666;
    flex-wrap: wrap;
}

/* 저작권 텍스트 */
.copyright-bar {
    color: #666;
}

/* 푸터 메뉴 링크들 */
.site-info a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}

.site-info a:hover {
    color: #4f46e5;
}

/* 구분선 스타일 (|) */
.footer-nav {
    display: flex;
    gap: 16px;
}

.footer-nav a::before {
    content: "";
}

.footer-nav a:not(:first-child)::before {
    content: "|";
    margin-right: 16px;
    color: #d1d5db;
}

@media (max-width: 768px) {
    .site-info {
        flex-direction: column;
        gap: 12px;
        padding: 16px 20px;
        text-align: center;
    }

    .footer-nav a:not(:first-child)::before {
        content: "";
        margin-right: 0;
    }

    .footer-nav {
        gap: 20px;
    }
}

/* --- 7. 댓글 영역 디자인 --- */
.comments-area {
    background: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-top: 40px;
}

/* 댓글 제목 */
.comments-title {
    font-size: 1.4em;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #eee;
}

/* 댓글 목록 */
.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comment {
    padding: 20px 0;
    border-bottom: 1px solid #f0f0f0;
}

.comment:last-child {
    border-bottom: none;
}

/* 댓글 작성자 */
.comment-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.comment-author .avatar {
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

.comment-author .fn {
    font-weight: 600;
    color: #333;
}

/* 댓글 날짜 */
.comment-metadata {
    font-size: 0.85em;
    color: #888;
    margin-bottom: 12px;
}

/* 댓글 내용 */
.comment-content {
    line-height: 1.7;
    color: #444;
}

/* 답글 버튼 */
.reply a {
    display: inline-block;
    padding: 6px 14px;
    background: #f3f4f6;
    color: #4f46e5;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 500;
    margin-top: 12px;
    transition: all 0.2s;
}

.reply a:hover {
    background: #4f46e5;
    color: #fff;
    text-decoration: none;
}

/* 댓글 폼 */
.comment-respond {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid #eee;
}

.comment-reply-title {
    font-size: 1.2em;
    margin-bottom: 16px;
}

/* 입력 필드 */
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95em;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 16px;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.comment-form textarea {
    min-height: 120px;
    resize: vertical;
}

/* 제출 버튼 */
.comment-form .submit {
    display: inline-block;
    padding: 14px 32px;
    background: #4f46e5;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.comment-form .submit:hover {
    background: #4338ca;
}

/* 라벨 */
.comment-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: #333;
}

/* 웹사이트(URL) 필드 숨김 */
.comment-form-url {
    display: none !important;
}

@media (max-width: 768px) {
    .comments-area {
        padding: 20px;
    }

    .comment-author .avatar {
        width: 32px;
        height: 32px;
    }
}

/* --- 8. 시리즈 네비게이션 --- */
.series-navigation {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    border: 1px solid #e0e7ff;
    border-left: 4px solid #4f46e5;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
    display: none;
    /* JS가 위치 결정 후 표시 */
}

/* 사이드바 배치 시 스티키 */
.series-navigation--sidebar {
    position: sticky;
    top: 130px;
    z-index: 100;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    /* 본문과 높이 맞춤 */
}

/* 본문 배치 시 */
.series-navigation--content {
    position: relative;
}

/* 탭 */
.series-navigation__tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-bottom: 16px;
    padding-bottom: 4px;
    scrollbar-width: none;
    /* Firefox */
}

.series-navigation__tabs::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari */
}

.series-navigation__tab {
    padding: 8px 14px;
    border: 1px solid #e0e7ff;
    border-radius: 20px;
    background: #ffffff;
    font-size: 0.85em;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    white-space: nowrap;
}

.series-navigation__tab:hover {
    border-color: #4f46e5;
    color: #4f46e5;
}

.series-navigation__tab--active {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #ffffff;
}

/* 패널 */
.series-navigation__panel {
    display: none;
}

.series-navigation__panel--active {
    display: block;
}

/* 리스트 */
.series-navigation__list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 400px;
    /* 약 10개 정도 */
    overflow-y: auto;
}

.series-navigation__item {
    margin-bottom: 4px;
    border-radius: 8px;
    font-size: 0.95em;
    transition: background-color 0.2s;
}

.series-navigation__item:last-child {
    margin-bottom: 0;
}

/* 링크 - 전체 영역 클릭 */
.series-navigation__link {
    display: block;
    padding: 10px 14px;
    color: #475569;
    text-decoration: none;
    border-radius: 8px;
}

.series-navigation__item:hover {
    background-color: rgba(79, 70, 229, 0.08);
}

.series-navigation__item--current {
    background-color: #4f46e5;
}

.series-navigation__item--current .series-navigation__link {
    color: #ffffff;
    font-weight: 600;
}

.series-navigation__number {
    color: #94a3b8;
    margin-right: 8px;
    font-weight: 500;
}

.series-navigation__item--current .series-navigation__number {
    color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 768px) {
    .series-navigation {
        padding: 12px 16px;
    }

    .series-navigation__header {
        flex-wrap: wrap;
    }

    .series-navigation__tabs {
        gap: 6px;
    }

    .series-navigation__tab {
        padding: 6px 10px;
        font-size: 0.8em;
    }

    .series-navigation__link {
        padding: 8px 12px;
    }
}

/* --- 9. 검색 버튼 스타일 --- */
.search-item a,
.search-form button,
button.search-submit,
.wp-block-search__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef2ff !important;
    border: none;
    color: #ffffff !important;
    cursor: pointer;
    transition: all 0.2s;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0;
}

.search-item a::before,
.search-form button::before,
button.search-submit::before,
.wp-block-search__button::before {
    content: "🔍";
    font-size: 1.1rem;
}

.search-item a:hover,
.search-form button:hover,
button.search-submit:hover,
.wp-block-search__button:hover {
    background: #4338ca !important;
}

/* 검색 폼 인풋 */
.search-form .search-field {
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9em;
    transition: border-color 0.2s;
}

.search-form .search-field:focus {
    outline: none;
    border-color: #4f46e5;
}

/* --- 10. 페이지네이션 --- */
/* 페이지네이션 래퍼 - 카드 스타일 */
.paging-navigation,
.posts-navigation,
.post-navigation {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 20px;
    margin: 32px 0;
}

.pagination,
.nav-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span,
.nav-links a,
.nav-links span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #374151;
    font-size: 0.9em;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

/* 다음/이전 버튼 안의 화살표 숨김 */
.nav-links a svg,
.pagination a svg,
.nav-links span svg,
.pagination span svg,
.nav-links .next span,
.nav-links .prev span,
.pagination .next span,
.pagination .prev span {
    display: none !important;
}

.pagination a:hover,
.nav-links a:hover {
    background: #f3f4f6;
    border-color: #4f46e5;
    color: #4f46e5;
}

.pagination .current,
.nav-links .current {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #ffffff;
}

.pagination .prev,
.pagination .next,
.nav-links .prev,
.nav-links .next {
    padding: 0 16px;
}

@media (max-width: 768px) {

    .paging-navigation,
    .posts-navigation,
    .post-navigation {
        padding: 16px;
        margin: 24px 0;
    }

    .pagination a,
    .pagination span,
    .nav-links a,
    .nav-links span {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        font-size: 0.85em;
    }
}

/* ========================================
   11. 추천 글 섹션 (Featured Posts)
   ======================================== */

/* 섹션 컨테이너 */
.featured-section {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 24px 48px;
    margin-bottom: 30px;
}

.featured-section__header {
    margin-bottom: 20px;
}

.featured-section__title {
    font-size: 1.3em;
    font-weight: 700;
    color: #111;
    margin: 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #eee;
}

.featured-section__title-link {
    text-decoration: none;
    display: block;
}

.featured-section__title-link:hover {
    text-decoration: none;
}

.featured-section__title-link:hover .featured-section__title {
    color: #4f46e5;
}

.featured-section__more {
    font-size: 0.7em;
    font-weight: 500;
    color: #888;
    margin-left: 8px;
}

.featured-section__title-link:hover .featured-section__more {
    color: #4f46e5;
}

/* 그리드 레이아웃 */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* 카드 스타일 */
.featured-card {
    display: block;
    text-decoration: none;
    border-radius: 10px;
    overflow: hidden;
    background: #f9fafb;
    transition: transform 0.2s, box-shadow 0.2s;
}

.featured-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.featured-carousel .featured-card {
    user-select: none;
    -webkit-user-drag: none;
}

.featured-card__image {
    width: 100%;
    height: 0;
    padding-bottom: 60%;
    /* 5:3 ratio for better consistency */
    background-size: cover;
    background-position: center;
    background-color: #e5e7eb;
    background-repeat: no-repeat;
}

.featured-card__title {
    padding: 12px;
    margin: 0;
    font-size: 0.9em;
    font-weight: 600;
    color: #333;
    line-height: 1.5;
    overflow: hidden;
    word-break: keep-all;
}

.featured-card:hover .featured-card__title {
    color: #4f46e5;
}

/* 캐러셀 (사이드바용) */
.featured-carousel {
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
}

.featured-carousel .widget-title {
    font-size: 1.1em;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.featured-carousel__track {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    overflow: hidden;
}

.featured-carousel__slide {
    grid-column: 1;
    grid-row: 1;
    opacity: 0;
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.3s ease;
    width: 100%;
    /* 기존 display:none 로직 무력화 및 Grid Item으로서 동작 보장 */
    display: block !important;
}

.featured-carousel__slide.active {
    opacity: 1;
    z-index: 2;
    pointer-events: auto;
}

.featured-carousel__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.featured-carousel__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d1d5db;
    cursor: pointer;
    transition: background 0.2s;
}

.featured-carousel__dot.active {
    background: #4f46e5;
}

.featured-carousel__dot:hover {
    background: #4f46e5;
}

/* 반응형 */
@media (max-width: 1024px) {
    .featured-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .featured-section {
        padding: 16px;
    }

    .featured-card__title {
        font-size: 0.85em;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .featured-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   12. 이전/다음 글 네비게이션 (썸네일)
   ======================================== */

.post-nav-thumbnails {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 40px 0;
}

.post-nav-card {
    display: flex;
    align-items: stretch;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-nav-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.post-nav-card--empty {
    background: transparent;
    box-shadow: none;
}

.post-nav-card__image {
    width: 100px;
    min-height: 80px;
    background-size: cover;
    background-position: center;
    background-color: #e5e7eb;
    flex-shrink: 0;
}

.post-nav-card__content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-width: 0;
}

.post-nav-card__label {
    font-size: 0.75em;
    color: #888;
    font-weight: 500;
    margin-bottom: 4px;
}

.post-nav-card--prev .post-nav-card__label {
    color: #4f46e5;
}

.post-nav-card--next .post-nav-card__label {
    color: #4f46e5;
    text-align: right;
}

.post-nav-card--next .post-nav-card__content {
    text-align: right;
}

.post-nav-card__title {
    font-size: 0.95em;
    font-weight: 600;
    color: #333;
    margin: 0;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.post-nav-card:hover .post-nav-card__title {
    color: #4f46e5;
}

@media (max-width: 768px) {
    .post-nav-thumbnails {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .post-nav-card__image {
        width: 80px;
        min-height: 60px;
    }

    .post-nav-card__content {
        padding: 12px;
    }

    .post-nav-card__title {
        font-size: 0.9em;
    }
}

/* ========================================
   13. 스크롤 진행 바
   ======================================== */

.scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    z-index: 9999;
    transition: width 0.1s ease-out;
}

/* ========================================
   14. 맨 위로 버튼
   ======================================== */

.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: #4f46e5;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: #4338ca;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
    }
}

/* ========================================
   15. 목차 (Table of Contents)
   ======================================== */

.table-of-contents {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    border: 1px solid #e0e7ff;
    border-left: 4px solid #4f46e5;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.toc-title {
    font-size: 1.1em;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.toc-toggle {
    width: 28px;
    height: 28px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2em;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.toc-toggle:hover {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #ffffff;
}

.toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 400px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.toc-list.collapsed {
    max-height: 0;
}

.toc-item {
    margin-bottom: 8px;
}

.toc-item a {
    color: #374151;
    text-decoration: none;
    font-size: 0.95em;
    line-height: 1.5;
    display: block;
    padding: 4px 0;
    transition: color 0.2s;
}

.toc-item a:hover {
    color: #4f46e5;
    text-decoration: none;
}

.toc-item--sub {
    padding-left: 16px;
}

.toc-item--sub a {
    font-size: 0.9em;
    color: #6b7280;
}

.toc-item--sub a::before {
    content: "└ ";
    color: #d1d5db;
}

@media (max-width: 768px) {
    .table-of-contents {
        padding: 16px;
    }

    .toc-list {
        max-height: 300px;
    }
}

/* ========================================
   16. 글 하단 요소 순서 재배치
   ======================================== */

/* 글 내용 영역을 flex 컨테이너로 */
.single .entry-content {
    display: flex;
    flex-direction: column;
}

/* 순서 지정 */
.single .entry-content>* {
    order: 0;
}

/* Jetpack 공유 버튼 - 맨 마지막 */
.single .entry-content .sharedaddy,
.single .entry-content .sd-sharing-enabled {
    order: 100;
    margin-top: 30px;
}

/* 글 하단 영역 순서 */
.single .inside-article {
    display: flex;
    flex-direction: column;
}

/* 이전/다음 글 */
.post-nav-thumbnails {
    order: 10;
}

/* More Articles */
.featured-section {
    order: 20;
}

/* 태그/카테고리 (entry-meta는 보통 footer-entry-meta 클래스) */
.single .entry-meta.entry-meta-footer,
.single .footer-entry-meta,
.single .cat-links,
.single .tags-links {
    order: 30;
}