/* ========================================
   ARTICLE 페이지 전용 스타일
   ======================================== */

/* 포스트 기본 구조 */
.post {
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 포스트 헤더 */
.post-header {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    padding-bottom: 50px;
}

/* 글 제목 */
.post-title {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--quantum-text-primary);
    margin-bottom: 24px;
    word-break: keep-all;
    overflow-wrap: break-word;
}

/* 글 메타 정보 */
.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0px 16px;
    color: var(--quantum-text-tertiary);
    font-size: 14px;
}

.post-author {
    width: 100%;
    font-size: 16px;
    font-weight: 600;
    color: var(--quantum-text-secondary);
}

.post-date {
    color: var(--quantum-text-tertiary);
}

.reading-time {
    color: var(--quantum-text-tertiary);
}

.reading-time-container {
    display: flex;
    gap: 4px;
}

.reading-time-icon {
    color: var(--quantum-text-tertiary);
}

/* 관리자용 수정/삭제 버튼 */
.post-admin-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--quantum-transition);
    text-decoration: none;
    border: 1px solid transparent;
    background: var(--quantum-bg-secondary);
    border-color: var(--quantum-border-light);
    color: var(--quantum-text-tertiary);
}

.admin-btn [data-lucide] {
    width: 14px;
    height: 14px;
    stroke-width: 2;
}

.admin-btn--edit:hover {
    color: var(--quantum-point);
    background: var(--quantum-point-light);
    border-color: rgba(var(--quantum-point-rgb), 0.3);
}

.admin-btn--delete:hover {
    color: var(--quantum-danger);
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

/* 글 내용 */
.post-content {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.8;
    color: var(--quantum-text-primary);
}

.tt_article_useless_p_margin.contents_style > *:first-child {
    margin-top: 0 !important;
}

.post-body h1 {
    font-size: 32px;
    font-weight: 700 !important;
    margin: 48px 0 16px 0 !important;
    line-height: 1.4;
    color: var(--quantum-text-primary);
}

.post-body h2 {
    font-size: 24px;
    font-weight: 700 !important;
    margin: 40px 0 12px 0 !important;
    line-height: 1.4;
    color: var(--quantum-text-primary);
}

.post-body h3 {
    font-size: 20px;
    font-weight: 600 !important;
    margin: 32px 0 8px 0 !important;
    line-height: 1.4;
    color: var(--quantum-text-primary);
}

.post-body h4 {
    font-size: 18px;
    font-weight: 600 !important;
    margin: 24px 0 8px 0 !important;
    line-height: 1.4;
    color: var(--quantum-text-primary);
}

.post-body p {
    margin-bottom: 24px;
    line-height: 1.8;
    color: var(--quantum-text-secondary);
    overflow-x: auto;
}

.post-body ul, .post-body ol {
    margin: 16px 0 24px 0;
    padding-left: 24px;
}

.post-body li {
    margin-bottom: 8px;
    line-height: 1.75;
    color: var(--quantum-text-secondary);
}

.post-body li:last-child {
    margin-bottom: 0;
}

/* 중첩 리스트 */
.post-body li > ul,
.post-body li > ol {
    margin: 8px 0 0 0;
}

.post-body strong {
    color: var(--quantum-text-primary);
    font-weight: 700;
}

.post-body blockquote {
    background: var(--quantum-bg-secondary);
    border-left: 4px solid var(--quantum-point);
    padding: 16px 24px;
    margin: 32px 0;
    border-radius: 0 12px 12px 0;
}

.post-body blockquote p {
    margin: 0;
    color: var(--quantum-text-secondary);
}

.post-body blockquote p + p {
    margin-top: 12px;
}

/* 인라인 코드 */
.post-body code:not(pre code) {
    background: var(--quantum-bg-tertiary);
    padding: 3px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    color: var(--quantum-danger);
}

/* 코드 블록 */
.post-body pre {
    background: var(--quantum-code-bg);
    color: var(--quantum-code-text);
    margin: 12px 0;
    border-radius: 6px;
    overflow-x: auto;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.6;
}

.post-body pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
    color: inherit;
}

.post-body pre code .hljs-comment {
    font-style: normal !important;
}

/* 수평선 */
.post-body hr {
    margin: 48px 0;
    border: none;
    border-top: 1px solid var(--quantum-border-light);
}

/* 테이블 wrapper - 가로 스크롤 지원 */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin: 24px 0;
}

/* 테이블 */
.post-body table {
    width: 100%;
    min-width: 700px;
    table-layout: fixed;
    border-collapse: collapse !important;
    border: none !important;
    margin: 0 !important;
    border-radius: 8px;
    overflow: hidden;
}

.post-body th,
.post-body td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--quantum-border-light);
    word-break: keep-all;
}

.post-body th {
    background: var(--quantum-bg-secondary);
    font-weight: 600;
    color: var(--quantum-text-primary);
}

.post-body td {
    color: var(--quantum-text-secondary);
}

.post-body tbody tr:nth-child(even) {
    background: var(--quantum-bg-secondary);
}

.post-body tbody tr:last-child td {
    border-bottom: none;
}

/* 이미지 */
.post-body img {
    max-width: 100%;
    height: auto;
}

.post-body .category-tags a {
    color: var(--quantum-text-secondary);
    text-decoration: none;
}

.post-body .category-tags a:hover {
    color: var(--quantum-text-secondary);
}

/* 포스트 바디 (실제 글 내용) */
.post-body {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.post-body > div:nth-child(1) {
    margin-bottom: 60px;
}

.post-body > .category-tags {
    margin-top: 60px;
    order: 99;
}

.post-body code:not(pre code) {
    background: var(--quantum-bg-tertiary);
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 14px;
    color: var(--quantum-danger);
}

/* 카테고리의 다른 글 */
.another_category {
    border-radius: 12px;
}

/* 강조 박스 */
.highlight-box {
    background: var(--quantum-bg-secondary);
    border: 1px solid var(--quantum-border-medium);
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
}

.highlight-box h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--quantum-text-primary);
    margin-bottom: 16px;
}

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

.highlight-box li {
    margin-bottom: 12px;
    color: var(--quantum-text-secondary);
    line-height: 1.6;
}

/* CTA 버튼 */
.cta-button {
    background: var(--quantum-point);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s ease;
    margin: 24px 0;
    text-align: center;
}

.cta-button:hover {
    background: var(--quantum-point-hover);
}

/* 카테고리 태그 */
.category-tags {
    display: flex;
    width: 700px;
    gap: 4px;
    font-size: 0;
    flex-wrap: wrap;
}

.category-tags a {
    background: var(--quantum-bg-tertiary);
    color: var(--quantum-text-secondary);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.category-tags a:hover {
    background: var(--quantum-border-medium);
}

/* 작성자 정보 */
.author-info {
    width: 100%;
    max-width: 700px;
    background: var(--quantum-bg-secondary);
    border-radius: 16px;
    padding: 24px;
    margin: 48px 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--quantum-point);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 18px;
}

.author-details h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--quantum-text-primary);
    margin-bottom: 4px;
}

.author-details p {
    font-size: 14px;
    color: var(--quantum-text-tertiary);
}

/* 사이드 액션 바 */
.side-actions {
    position: absolute;
    left: calc(50% - 500px);
    height: 100%;
}

.actions-container {
    position: sticky;
    top: 160px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 64px;
    height: 64px;
    border: 1px solid var(--quantum-border-light);
    border-radius: 12px;
    background: none;
    color: var(--quantum-text-tertiary);
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                background-color 0.2s ease,
                color 0.2s ease,
                box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.action-btn:hover {
    background: var(--quantum-bg-primary);
    color: var(--quantum-point);
    transform: translateZ(0) translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.05);
}

.action-item:first-child .action-btn:hover {
    color: var(--quantum-like);
}

.action-btn:hover::before {
    opacity: 1;
}

.action-btn:active {
    transform: translateZ(0) translateY(0);
}

.action-btn.active {
    background: linear-gradient(135deg, #c41e3a, #e8334a, #cc2936);
    border: 0;
    color: white !important;
    box-shadow: 0 4px 15px rgba(196, 30, 58, 0.3);
    transform: translateZ(0);
}

.action-btn.active svg,
.action-btn.active [data-lucide] {
    fill: currentColor;
}

.action-btn svg,
.action-btn [data-lucide] {
    width: 24px;
    height: 24px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    will-change: transform;
    backface-visibility: hidden;
}

.action-btn:hover svg,
.action-btn:hover [data-lucide] {
    transform: translateZ(0) scale(1.1);
}

/* hover 상태가 아닐 때의 like-animation - 성능 최적화 */
.action-btn.like-animation svg {
    animation: heartBeat 0.6s ease-in-out;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0); /* GPU 가속 강제 적용 */
}

/* hover 상태에서의 like-animation - 자연스러운 전환을 위해 */
.action-btn:hover.like-animation svg {
    animation: heartBeatHover 0.6s ease-in-out;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0); /* GPU 가속 강제 적용 */
}

.action-count {
    font-size: 14px;
    color: var(--quantum-text-secondary);
    text-align: center;
}

.action-item:has(.action-btn.active) .action-count {
    color: white;
}

/* 관련 글 섹션 */
.related-posts {
    width: 100%;
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid var(--quantum-border-medium);
}

.related-posts h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--quantum-text-primary);
}

.related-post-item {
    display: block;
    padding: 16px 0;
    border-bottom: 1px solid var(--quantum-border-light);
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease;
}

.related-post-item:hover {
    background: var(--quantum-bg-secondary);
    border-radius: 8px;
    padding: 16px 12px;
}

.related-post-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--quantum-text-primary);
    margin-bottom: 4px;
}

.related-post-date {
    font-size: 14px;
    color: var(--quantum-text-tertiary);
}

/* ========================================
   반응형 미디어 쿼리 (Article 전용)
   ======================================== */

/* 태블릿 (1199px 이하) */
@media (max-width: 1199px) {
    /* 사이드 액션 숨김 */
    .side-actions {
        display: none;
    }
}

/* 모바일 (700px 이하) */
@media (max-width: 700px) {
    /* 카테고리 태그 */
    .category-tags {
        width: 100%;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .category-tag {
        font-size: 13px;
        padding: 4px 10px;
    }

    /* 포스트 헤더 */
    .post-title {
        font-size: 28px;
        line-height: 1.3;
    }

    .post-admin-actions {
        width: 100%;
        margin-left: 0;
        margin-top: 12px;
    }

    .admin-btn {
        padding: 8px 14px;
    }

    /* 포스트 콘텐츠 - 모바일 */
    .post-body h1 {
        font-size: 28px;
        margin: 36px 0 12px 0 !important;
    }

    .post-body h2 {
        font-size: 22px;
        margin: 32px 0 10px 0 !important;
    }

    .post-body h3 {
        font-size: 18px;
        margin: 24px 0 8px 0 !important;
    }

    .post-body h4 {
        font-size: 16px;
        margin: 20px 0 8px 0 !important;
    }

    .post-body p {
        margin-bottom: 20px;
    }

    .post-body ol {
        margin: 12px 0 20px 0;
        padding-left: 20px;
    }

    .post-body blockquote {
        margin: 24px 0;
        padding: 12px 16px;
    }

    .post-body hr {
        margin: 36px 0;
    }

    /* 테이블은 wrapper가 스크롤 담당 */

    /* 작성자 정보 */
    .author-info {
        margin: 48px 16px;
        flex-direction: column;
        text-align: center;
        gap: 12px;
        padding: 20px;
    }

}

/* 소형 모바일 (480px 이하) */
@media (max-width: 480px) {
    /* 포스트 헤더 */
    .post-title {
        font-size: 24px;
        line-height: 1.3;
    }

    .admin-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .admin-btn [data-lucide] {
        width: 12px;
        height: 12px;
    }

    /* 포스트 콘텐츠 - 소형 모바일 */
    .post-body h1 {
        font-size: 24px;
        margin: 28px 0 10px 0 !important;
    }

    .post-body h2 {
        font-size: 20px;
        margin: 24px 0 8px 0 !important;
    }

    .post-body h3 {
        font-size: 17px;
        margin: 20px 0 6px 0 !important;
    }

    .post-body h4 {
        font-size: 16px;
        margin: 16px 0 6px 0 !important;
    }

    .post-body p {
        margin-bottom: 16px;
        line-height: 1.75;
    }

    .post-body ol {
        margin: 8px 0 16px 0;
        padding-left: 18px;
    }

    .post-body li {
        margin-bottom: 6px;
    }

    .post-body blockquote {
        margin: 20px 0;
        padding: 10px 14px;
    }

    .post-body pre {
        margin: 20px 0;
    }

    .post-body hr {
        margin: 28px 0;
    }

    /* 작성자 정보 */
    .author-info {
        margin: 48px 12px;
        padding: 16px;
    }

    /* 카테고리 태그 */
    .category-tags {
        gap: 4px;
    }

}

/* ========================================
   티스토리 전용 아티클 스타일
   ======================================== */

/* 글 목록용 포스트 아이템 수정 */
.inner .post-item {
    max-width: 1024px;
    margin: 0 auto 24px auto;
}

/* 포스트 커버 (상세 페이지) */
.post-cover {
    width: 100%;
    min-height: 400px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: white;
}

.post-cover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6));
}

.post-cover .inner {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    padding: 0 20px;
}

.post-cover .category {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.post-cover h1 {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.post-cover .meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-size: 14px;
    opacity: 0.9;
}

.post-cover .meta .author {
    font-weight: 600;
}

/* 공지사항 스타일 */
.post-cover.notice {
    background: linear-gradient(135deg, var(--quantum-point), var(--quantum-point-hover));
}

.post-cover.notice h1 a {
    color: white;
    text-decoration: none;
}

/* 엔트리 콘텐츠 (글 내용) */
.entry-content {
    max-width: 700px;
    margin: 0 auto;
    padding: 60px 20px;
    line-height: 1.8;
    position: relative;
}

.entry-content h1, .entry-content h2, .entry-content h3,
.entry-content h4, .entry-content h5, .entry-content h6 {
    color: var(--quantum-text-primary);
    font-weight: 600;
    margin: 32px 0 16px 0;
    line-height: 1.4;
}

.entry-content h1 { font-size: 28px; }
.entry-content h2 { font-size: 24px; }
.entry-content h3 { font-size: 20px; }
.entry-content h4 { font-size: 18px; }

.entry-content p {
    margin-bottom: 20px;
    color: var(--quantum-text-secondary);
}

.entry-content ul, .entry-content ol {
    margin: 20px 0;
    padding-left: 24px;
}

.entry-content li {
    margin-bottom: 8px;
    color: var(--quantum-text-secondary);
    line-height: 1.6;
}

.entry-content blockquote {
    background: var(--quantum-bg-secondary);
    border-left: 4px solid var(--quantum-point);
    padding: 20px 24px;
    margin: 24px 0;
    border-radius: 0 12px 12px 0;
    font-style: italic;
}

.entry-content blockquote p {
    margin-bottom: 0;
    color: var(--quantum-text-secondary);
}

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 24px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.entry-content pre {
    background: var(--quantum-code-bg);
    color: var(--quantum-code-text);
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 24px 0;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.5;
}

.entry-content code {
    background: var(--quantum-bg-tertiary);
    color: var(--quantum-code-highlight);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.9em;
}

.entry-content pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.entry-content a {
    color: var(--quantum-point);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

.entry-content a:hover {
    color: var(--quantum-point-hover);
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.entry-content th, .entry-content td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--quantum-border-medium);
}

.entry-content th {
    background: var(--quantum-bg-secondary);
    font-weight: 600;
    color: var(--quantum-text-primary);
}

.entry-content td {
    color: var(--quantum-text-secondary);
}

/* 태그 레이블 */
.tags {
    max-width: 700px;
    margin: 40px auto;
    padding: 0 20px;
}

.tags h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--quantum-text-primary);
    margin-bottom: 16px;
}

.tags a {
    display: inline-block;
    background: var(--quantum-bg-tertiary);
    color: var(--quantum-text-secondary);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    margin: 0 8px 8px 0;
    transition: var(--quantum-transition);
}

.tags a:hover {
    background: var(--quantum-point);
    color: white;
}

/* 관련글 */
.related-articles {
    max-width: 700px;
    margin: 60px auto;
    padding: 0 20px;
}

.related-articles h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--quantum-text-primary);
    margin-bottom: 24px;
    text-align: center;
}

.related-articles ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    list-style: none;
    padding: 0;
}

.related-articles li {
    background: var(--quantum-bg-primary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: var(--quantum-transition);
    margin: 0;
}

.related-articles li:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.related-articles a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.related-articles figure {
    width: 100%;
    height: 140px;
    overflow: hidden;
    margin: 0;
}

.related-articles img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: 0;
    box-shadow: none;
    border-radius: 0;
}

.related-articles .title {
    padding: 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--quantum-text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 반응형 개선 */
@media (max-width: 700px) {
    .post-cover {
        min-height: 300px;
    }
    
    .post-cover h1 {
        font-size: 28px;
    }
    
    .post-cover .meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .entry-content {
        padding: 40px 16px;
    }
    
    .entry-content h1 { font-size: 24px; }
    .entry-content h2 { font-size: 20px; }
    .entry-content h3 { font-size: 18px; }
    
    .entry-content pre {
        padding: 16px;
        font-size: 13px;
    }
    
    /* 테이블은 wrapper가 스크롤 담당 */
    
    .related-articles ul {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .post-cover {
        min-height: 250px;
    }
    
    .post-cover h1 {
        font-size: 24px;
        line-height: 1.2;
    }
    
    .entry-content {
        padding: 30px 12px;
    }
    
    .entry-content h1 { font-size: 22px; }
    .entry-content h2 { font-size: 18px; }
    
    .tags, .related-articles, .comments {
        padding: 0 12px;
    }
}

