/**
 * 블로그 포스트 스타일 - showthings 스타일 참고
 * 라이트/다크 모드 지원 + 주황색 강조
 */

/* ===== CSS 변수 ===== */
:root {
    /* 라이트 모드 (기본) */
    --st-bg: #ffffff;
    --st-bg-secondary: #f8f9fa;
    --st-text: #0f1419;
    --st-text-muted: #536471;
    --st-border: #e1eaef;
    --st-primary: #ff4b0f;
    --st-primary-dark: #e04400;
    --st-highlight-bg: rgba(255, 75, 15, 0.08);
    --st-link: #ff4b0f;
}

/* 다크 모드 */
.dark-mode,
[data-theme="dark"] {
    --st-bg: #000000;
    --st-bg-secondary: #16181c;
    --st-text: #e7e9ea;
    --st-text-muted: #71767b;
    --st-border: #2f3336;
    --st-primary: #ff4b0f;
    --st-highlight-bg: rgba(255, 75, 15, 0.15);
}

/* ===== 포스트 래퍼 ===== */
.st-post {
    max-width: 728px;
    margin: 0 auto;
    padding: 0;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    font-size: 1rem;
    line-height: 1.75;
    color: var(--st-text);
    word-break: keep-all;
}

/* ===== 포스트 헤더 ===== */
.st-post-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--st-border);
}

.st-post-title {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 16px 0;
    color: var(--st-text);
}

.st-post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
    color: var(--st-text-muted);
}

.st-post-date {
    color: var(--st-text-muted);
}

.st-post-category {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: var(--st-primary);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    text-decoration: none;
}

.st-post-category:hover {
    background: var(--st-primary-dark);
    color: #ffffff;
}

/* ===== 대표 이미지 ===== */
.st-featured-image {
    margin: 0 0 32px 0;
    border-radius: 8px;
    overflow: hidden;
}

.st-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* ===== 본문 콘텐츠 ===== */
.st-content {
    font-size: 1.0625rem;
    line-height: 1.8;
}

.st-content p {
    margin: 0 0 1.5em 0;
    color: var(--st-text);
}

.st-content h2 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--st-text);
    margin: 2.5em 0 1em 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--st-primary);
}

.st-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--st-text);
    margin: 2em 0 0.75em 0;
}

.st-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--st-text);
    margin: 1.5em 0 0.5em 0;
}

/* ===== 하이라이트 스타일 ===== */

/* 주황색 따옴표 하이라이트 */
.hl-quote {
    color: var(--st-primary);
    font-weight: 500;
}

.hl-quote::before {
    content: '"';
}

.hl-quote::after {
    content: '"';
}

/* 밑줄 하이라이트 (주황색 밑줄) */
.hl-underline {
    background: linear-gradient(to top, var(--st-primary) 35%, transparent 35%);
    padding: 0 2px;
    font-weight: 500;
    color: var(--st-text);
}

/* 볼드 강조 */
.hl-bold {
    font-weight: 700;
    color: var(--st-text);
}

/* 배경 하이라이트 */
.hl-bg {
    background: var(--st-highlight-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

/* 주황색 텍스트 강조 */
.hl-accent {
    color: var(--st-primary);
    font-weight: 600;
}

/* ===== 목차 (TOC) ===== */
.st-toc {
    background: var(--st-bg-secondary);
    border: 1px solid var(--st-border);
    border-radius: 8px;
    padding: 20px 24px;
    margin: 24px 0 32px 0;
}

.st-toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--st-border);
}

.st-toc-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--st-text);
    margin: 0;
}

.st-toc-toggle {
    background: none;
    border: none;
    color: var(--st-text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.st-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: toc-counter;
}

.st-toc-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--st-border);
    font-size: 0.9375rem;
    font-weight: 500;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.st-toc-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.st-toc-list li::before {
    counter-increment: toc-counter;
    content: counter(toc-counter) ".";
    color: var(--st-primary);
    font-weight: 700;
    min-width: 20px;
}

.st-toc-list a {
    color: var(--st-text);
    text-decoration: none;
    transition: color 0.15s ease;
}

.st-toc-list a:hover {
    color: var(--st-primary);
}

/* ===== 리스트 스타일 ===== */
.st-content ul,
.st-content ol {
    padding-left: 24px;
    margin: 1.25em 0;
}

.st-content li {
    margin-bottom: 8px;
    line-height: 1.7;
    color: var(--st-text);
}

.st-content ul > li::marker {
    color: var(--st-primary);
}

.st-content ol > li::marker {
    color: var(--st-primary);
    font-weight: 600;
}

/* ===== 정보 박스 ===== */
.st-info-box {
    background: var(--st-bg-secondary);
    border: 1px solid var(--st-border);
    border-left: 4px solid var(--st-primary);
    border-radius: 0 8px 8px 0;
    padding: 20px;
    margin: 1.5em 0;
}

.st-info-box-title {
    font-weight: 700;
    color: var(--st-primary);
    margin-bottom: 12px;
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.st-info-box ul {
    margin: 0;
    padding-left: 20px;
}

.st-info-box li {
    margin-bottom: 6px;
}

/* ===== 스펙 박스 ===== */
.st-spec-box {
    background: var(--st-bg-secondary);
    border: 1px solid var(--st-border);
    border-radius: 8px;
    padding: 20px;
    margin: 1.5em 0;
}

.st-spec-box h4 {
    color: var(--st-text);
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--st-border);
}

.st-spec-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--st-border);
}

.st-spec-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.st-spec-label {
    color: var(--st-text-muted);
    font-size: 0.9375rem;
}

.st-spec-value {
    color: var(--st-text);
    font-weight: 600;
    font-size: 0.9375rem;
}

.st-spec-value.highlight {
    color: var(--st-primary);
}

/* ===== 테이블 스타일 ===== */
.st-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 0.9375rem;
}

.st-content table th {
    background: var(--st-bg-secondary);
    color: var(--st-text);
    font-weight: 600;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 2px solid var(--st-primary);
}

.st-content table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--st-border);
    color: var(--st-text);
    vertical-align: top;
}

.st-content table tr:hover {
    background: var(--st-highlight-bg);
}

/* ===== 인용문 ===== */
.st-content blockquote {
    border-left: 4px solid var(--st-primary);
    background: var(--st-bg-secondary);
    padding: 16px 20px;
    margin: 1.5em 0;
    border-radius: 0 8px 8px 0;
    font-style: normal;
    color: var(--st-text);
}

.st-content blockquote p {
    margin: 0;
}

/* ===== FAQ 섹션 ===== */
.st-faq {
    margin-top: 48px;
}

.st-faq h2 {
    margin-bottom: 24px;
}

.st-faq-item {
    background: var(--st-bg-secondary);
    border: 1px solid var(--st-border);
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}

.st-faq-question {
    padding: 16px 20px;
    font-weight: 600;
    color: var(--st-text);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.st-faq-question:hover {
    background: var(--st-highlight-bg);
}

.st-faq-question::before {
    content: 'Q.';
    color: var(--st-primary);
    font-weight: 700;
    flex-shrink: 0;
}

.st-faq-answer {
    padding: 0 20px 16px 20px;
    color: var(--st-text);
    line-height: 1.7;
    padding-left: 44px;
}

/* ===== 링크 ===== */
.st-content a {
    color: var(--st-primary);
    text-decoration: none;
    font-weight: 500;
}

.st-content a:hover {
    text-decoration: underline;
}

/* ===== strong 태그 ===== */
.st-content strong {
    font-weight: 700;
    color: var(--st-text);
}

/* ===== 구분선 ===== */
.st-content hr {
    border: none;
    border-top: 1px solid var(--st-border);
    margin: 48px 0;
}

/* ===== 다음 글 안내 ===== */
.st-next-post {
    background: var(--st-highlight-bg);
    border: 1px solid var(--st-primary);
    border-radius: 8px;
    padding: 20px;
    margin: 2em 0;
}

.st-next-post p {
    margin: 0;
}

/* ===== 반응형 ===== */
@media (max-width: 768px) {
    .st-post {
        padding: 0 16px;
    }

    .st-post-title {
        font-size: 1.5rem;
    }

    .st-content h2 {
        font-size: 1.25rem;
    }

    .st-toc {
        padding: 16px 20px;
    }

    .st-spec-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .st-content table {
        font-size: 0.875rem;
    }

    .st-content table th,
    .st-content table td {
        padding: 10px 12px;
    }
}

/* ===== 다크 모드 오버라이드 (수동) ===== */
.dark-mode .st-post,
.dark-mode .st-content p,
.dark-mode .st-content h2,
.dark-mode .st-content h3,
.dark-mode .st-content li,
.dark-mode .st-toc-title,
.dark-mode .st-toc-list a,
.dark-mode .st-spec-value,
.dark-mode .st-faq-question,
.dark-mode .st-faq-answer {
    color: #e7e9ea;
}

.dark-mode .st-bg-secondary,
.dark-mode .st-toc,
.dark-mode .st-info-box,
.dark-mode .st-spec-box,
.dark-mode .st-faq-item,
.dark-mode .st-content blockquote {
    background: #16181c;
    border-color: #2f3336;
}
