/* 아사주달 사주명리학 강의 - SEO 정적 사이트 스타일 */

/* ===== 변수 정의 ===== */
:root {
    --primary-color: #d97706;
    --primary-dark: #b45309;
    --secondary-color: #92400e;
    --accent-color: #fbbf24;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-color: #fffbeb;
    --bg-light: #fef3c7;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --max-width: 1200px;
    --content-width: 800px;
    --sidebar-width: 280px;
    --header-height: 52px;
}

/* ===== 리셋 ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-color);
    background: var(--bg-color);
    min-height: 100vh;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== 헤더 ===== */
.site-header {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
}

.site-header .container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--secondary-color);
}

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

.main-nav {
    display: flex;
    gap: 0.75rem;
}

.main-nav a {
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* 모바일 메뉴 */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* ===== 브레드크럼 ===== */
.breadcrumb {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 1.5rem;
}

.breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.breadcrumb li:not(:last-child)::after {
    content: '/';
    margin-left: 0.5rem;
    color: var(--text-light);
}

.breadcrumb a {
    color: var(--text-light);
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb [aria-current="page"] {
    color: var(--text-color);
    font-weight: 500;
}

/* ===== 메인 레이아웃 ===== */
.content-wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: 2rem;
}

/* ===== 강의 콘텐츠 ===== */
.lecture-content {
    background: var(--card-bg);
    padding: 2.5rem 3rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.lecture-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--bg-light);
}

.lecture-header h1 {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--secondary-color);
    line-height: 1.3;
    margin-bottom: 1rem;
}

.lecture-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
}

.lecture-meta .category {
    background: var(--bg-light);
    color: var(--secondary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 600;
}

.lecture-meta .read-time {
    color: var(--text-light);
}

/* 강의 본문 */
.lecture-body {
    font-size: 1.125rem;
    line-height: 2;
    letter-spacing: -0.01em;
    word-break: keep-all;
}

/* 첫 문단 드롭캡 효과 (선택적) */
.lecture-body > p:first-of-type::first-letter {
    font-size: 3.5rem;
    font-weight: 700;
    float: left;
    line-height: 1;
    margin-right: 0.5rem;
    margin-top: 0.1rem;
    color: var(--primary-color);
}

.lecture-body h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--secondary-color);
    margin: 2.5rem 0 1.5rem;
    line-height: 1.4;
}

.lecture-body h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin: 3rem 0 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--accent-color);
    position: relative;
}

/* h2 앞에 아이콘 데코 */
.lecture-body h2::before {
    content: '📌';
    margin-right: 0.5rem;
}

.lecture-body h3 {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 2.5rem 0 1rem;
    padding-left: 1rem;
    border-left: 4px solid var(--primary-color);
    background: linear-gradient(90deg, var(--bg-light) 0%, transparent 100%);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.lecture-body h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin: 2rem 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lecture-body h4::before {
    content: '▸';
    color: var(--primary-color);
}

.lecture-body p {
    margin: 1.5rem 0;
    text-align: justify;
}

.lecture-body ul, .lecture-body ol {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
}

.lecture-body li {
    margin: 0.75rem 0;
    padding-left: 0.5rem;
}

.lecture-body ul li::marker {
    color: var(--primary-color);
}

.lecture-body ol li::marker {
    color: var(--primary-color);
    font-weight: 600;
}

/* 인용문 스타일 개선 */
.lecture-body blockquote {
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 50%, #fef3c7 100%);
    border-left: 5px solid var(--primary-color);
    border-radius: 0 1rem 1rem 0;
    font-style: italic;
    position: relative;
    box-shadow: 0 4px 15px rgba(217, 119, 6, 0.15);
}

.lecture-body blockquote::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 15px;
    font-size: 4rem;
    color: var(--primary-color);
    opacity: 0.3;
    font-family: Georgia, serif;
    line-height: 1;
}

.lecture-body blockquote p {
    margin: 0;
    position: relative;
    z-index: 1;
}

/* 코드 스타일 */
.lecture-body code {
    background: var(--bg-light);
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'Fira Code', 'D2Coding', monospace;
    font-size: 0.9em;
    color: var(--secondary-color);
}

.lecture-body pre {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    color: #f9fafb;
    padding: 1.5rem;
    border-radius: 0.75rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-lg);
}

.lecture-body pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* 테이블 스타일 개선 */
.lecture-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.lecture-body th, .lecture-body td {
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.lecture-body th {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-dark) 100%);
    color: white;
    font-weight: 600;
}

.lecture-body tr:nth-child(even) {
    background: var(--bg-light);
}

.lecture-body tr:hover {
    background: #fef3c7;
}

/* 구분선 스타일 개선 */
.lecture-body hr {
    margin: 3rem 0;
    border: none;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-color), var(--accent-color), var(--primary-color), transparent);
    border-radius: 2px;
}

/* 강조 텍스트 */
.lecture-body strong {
    color: var(--secondary-color);
    font-weight: 700;
    background: linear-gradient(transparent 60%, #fde68a 60%);
    padding: 0 0.2rem;
}

.lecture-body em {
    color: var(--primary-dark);
    font-style: italic;
}

/* 마크 (형광펜 효과) */
.lecture-body mark {
    background: linear-gradient(transparent 40%, #fde68a 40%);
    padding: 0.1rem 0.3rem;
    border-radius: 0.2rem;
}

/* 팁 박스 */
.tip-box, .lecture-body .tip {
    margin: 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-left: 5px solid #10b981;
    border-radius: 0 1rem 1rem 0;
    position: relative;
}

.tip-box::before, .lecture-body .tip::before {
    content: '💡 TIP';
    display: block;
    font-weight: 700;
    color: #059669;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* 정보 박스 */
.info-box, .lecture-body .info {
    margin: 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left: 5px solid #3b82f6;
    border-radius: 0 1rem 1rem 0;
}

.info-box::before, .lecture-body .info::before {
    content: 'ℹ️ 정보';
    display: block;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* 경고 박스 */
.warning-box, .lecture-body .warning {
    margin: 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
    border-left: 5px solid #ef4444;
    border-radius: 0 1rem 1rem 0;
}

.warning-box::before, .lecture-body .warning::before {
    content: '⚠️ 주의';
    display: block;
    font-weight: 700;
    color: #dc2626;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* 핵심 요약 박스 */
.summary-box, .lecture-body .summary {
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #fefce8 0%, #fef08a 100%);
    border: 2px solid var(--accent-color);
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.summary-box::before, .lecture-body .summary::before {
    content: '📝 핵심 요약';
    display: block;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

/* 이미지 스타일 */
.lecture-body img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    margin: 1.5rem 0;
}

.lecture-body figure {
    margin: 2rem 0;
    text-align: center;
}

.lecture-body figcaption {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-light);
    font-style: italic;
}

/* 링크 스타일 */
.lecture-body a {
    color: var(--primary-color);
    text-decoration: underline;
    text-decoration-color: var(--accent-color);
    text-underline-offset: 3px;
    transition: all 0.2s;
}

.lecture-body a:hover {
    color: var(--primary-dark);
    text-decoration-color: var(--primary-color);
    background: var(--bg-light);
    padding: 0.1rem 0.3rem;
    border-radius: 0.2rem;
}

/* 태그 */
.lecture-tags {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: var(--bg-light);
    color: var(--secondary-color);
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* ===== 사이드바 ===== */
.sidebar {
    position: sticky;
    top: calc(var(--header-height) + 2rem);
    height: fit-content;
}

.toc, .related-lectures {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.toc h3, .related-lectures h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--bg-light);
}

.toc ul {
    list-style: none;
}

.toc li {
    margin: 0.5rem 0;
}

.toc a {
    color: var(--text-light);
    font-size: 0.875rem;
    display: block;
    padding: 0.25rem 0;
    transition: all 0.2s;
}

.toc a:hover {
    color: var(--primary-color);
    padding-left: 0.5rem;
}

.toc .toc-h3 {
    padding-left: 1rem;
    font-size: 0.8125rem;
}

.related-lectures ul {
    list-style: none;
}

.related-lectures li {
    margin: 0.5rem 0;
}

.related-lectures a {
    color: var(--text-color);
    font-size: 0.875rem;
    display: block;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background 0.2s;
}

.related-lectures a:hover {
    background: var(--bg-light);
}

/* ===== 이전/다음 네비게이션 ===== */
.lecture-nav {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.lecture-nav a {
    flex: 1;
    background: var(--card-bg);
    padding: 1.25rem 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    color: var(--text-color);
    font-weight: 500;
    transition: all 0.2s;
}

.lecture-nav a:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.lecture-nav .prev {
    text-align: left;
}

.lecture-nav .next {
    text-align: right;
}

/* ===== 푸터 ===== */
.site-footer {
    background: var(--secondary-color);
    color: white;
    padding: 1.25rem 1.5rem;
    margin-top: 2rem;
}

.site-footer .container {
    max-width: var(--max-width);
    margin: 0 auto;
    text-align: center;
}

.site-footer p {
    margin: 0.25rem 0;
    opacity: 0.9;
    font-size: 0.875rem;
}

.site-footer nav {
    margin-top: 0.5rem;
}

.site-footer nav a {
    color: white;
    opacity: 0.8;
    margin: 0 1rem;
    font-size: 0.875rem;
}

.site-footer nav a:hover {
    opacity: 1;
}

/* ===== 목록 페이지 ===== */
.page-header {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem 1.5rem 2rem;
    text-align: center;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-light);
    font-size: 1.125rem;
}

.lecture-grid {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.lecture-card {
    background: var(--card-bg);
    border-radius: 1rem;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.2s;
}

.lecture-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.lecture-card a {
    display: block;
    padding: 1.5rem;
    color: var(--text-color);
}

.lecture-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.lecture-card p {
    font-size: 0.875rem;
    color: var(--text-light);
    line-height: 1.6;
}

.lecture-card .card-meta {
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--text-light);
}

/* 카테고리 그리드 */
.category-grid {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    padding: 2rem;
    text-align: center;
    transition: all 0.2s;
    border: 1px solid #e5e7eb;
}

.category-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--primary-color);
}

.category-card .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.category-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.category-card p {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.category-card .count {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* ===== 반응형 ===== */
@media (max-width: 1024px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }

    /* 모바일 헤더: 텍스트 숨기고 아이콘만 표시 */
    .logo a:nth-child(2) span {
        display: none;
    }

    .logo a:nth-child(2) {
        width: 40px;
        height: 40px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: linear-gradient(to bottom right, #a855f7, #6366f1, #a855f7);
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
        transition: all 0.3s ease;
        position: relative;
    }

    .logo a:nth-child(2):hover {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
    }

    /* 홈 아이콘 추가 */
    .logo a:nth-child(2)::before {
        content: '';
        display: block;
        width: 20px;
        height: 20px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'/%3E%3C/svg%3E");
        background-size: contain;
        background-repeat: no-repeat;
        filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
    }

    .main-nav {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow);
    }

    .main-nav.active {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }

    /* 모바일 여백 대폭 축소 */
    .content-wrapper {
        padding: 0.5rem 0.5rem 1rem;
    }

    .lecture-content {
        padding: 0.75rem;
        border-radius: 12px;
    }

    .lecture-header {
        margin-bottom: 1rem;
        padding-bottom: 1rem;
    }

    .lecture-header h1 {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }

    .lecture-meta {
        gap: 0.5rem;
    }

    .lecture-body {
        font-size: 1rem;
    }

    .lecture-body h1 {
        font-size: 1.5rem;
        margin: 1.5rem 0 1rem;
    }

    .lecture-body h2 {
        font-size: 1.375rem;
        margin: 1.5rem 0 1rem;
        padding-bottom: 0.5rem;
    }

    .lecture-body h3 {
        font-size: 1.125rem;
        margin: 1.5rem 0 0.75rem;
        padding: 0.375rem 0 0.375rem 0.75rem;
    }

    .lecture-body h4 {
        font-size: 1rem;
        margin: 1.25rem 0 0.5rem;
    }

    .lecture-body p {
        margin: 1rem 0;
    }

    .lecture-body ul, .lecture-body ol {
        margin: 1rem 0;
        padding-left: 1.25rem;
    }

    .lecture-body li {
        margin: 0.5rem 0;
    }

    .lecture-body blockquote {
        margin: 1.25rem 0;
        padding: 1rem 1.25rem;
    }

    .lecture-body table {
        margin: 1.25rem 0;
    }

    .lecture-body th, .lecture-body td {
        padding: 0.75rem 0.875rem;
    }

    .tip-box, .lecture-body .tip,
    .info-box, .lecture-body .info,
    .warning-box, .lecture-body .warning,
    .summary-box, .lecture-body .summary {
        margin: 1.25rem 0;
        padding: 1rem;
    }

    .lecture-tags {
        margin-top: 1.5rem;
        padding-top: 1rem;
    }

    .sidebar {
        grid-template-columns: 1fr;
    }

    .toc, .related-lectures {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .lecture-nav {
        flex-direction: column;
        padding: 0 0.5rem 1rem;
    }

    .lecture-nav a {
        padding: 1rem 1.25rem;
    }

    .page-header {
        padding: 2rem 0.75rem 1.5rem;
    }

    .page-header h1 {
        font-size: 1.75rem;
    }

    .page-header p {
        font-size: 1rem;
    }

    .lecture-grid,
    .category-grid {
        padding: 0 0.75rem 2rem;
        gap: 1rem;
    }

    .category-card {
        padding: 1.25rem;
    }
}

@media (max-width: 480px) {
    .lecture-grid,
    .category-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== CTA 박스 ===== */
.cta-box {
    background: linear-gradient(135deg, #FFF2CC 0%, #FFEAA7 100%) !important;
    padding: 1.25rem 1.5rem !important;
    border-radius: 12px !important;
    text-align: center !important;
    margin: 1.5rem 0 !important;
    border: 1px solid #F0D78C !important;
    color: #5D4E37 !important;
}

.cta-box h3,
.cta-box h4 {
    display: none !important;
}

.cta-box p {
    margin: 0 0 0.5rem 0 !important;
    font-size: 0.95rem !important;
    color: #5D4E37 !important;
    font-weight: 500 !important;
    text-align: center !important;
    background: none !important;
    padding: 0 !important;
}

.cta-box a {
    display: inline-block !important;
    background: #FFF8E1 !important;
    color: #D35400 !important;
    padding: 0.5rem 1.25rem !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    text-decoration: none !important;
    border: 1px solid #E8C547 !important;
    transition: all 0.2s !important;
    margin-top: 0 !important;
}

.cta-box a:hover {
    background: #FFFFFF !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(211, 84, 0, 0.15);
}

/* ===== 유틸리티 ===== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
