/* 최신 트렌디한 한국 웹사이트 폰트 적용 */
:root {
    --main-color: #2457f3;
    --accent-color: #6930c3;
    --dark-text: #222222;
    --body-text: #444444;
    --light-text: #777777;
    --light-bg: #f9fafb;
    --border-color: #e9ecef;
    --card-shadow: 0 8px 24px rgba(149, 157, 165, 0.1);
    --hover-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--body-text);
    background-color: var(--light-bg);
    line-height: 1.7;
}

/* 상단 네비게이션 고정을 고려한 본문 여백 */
.post-container {
    padding-top: 40px;
    margin-bottom: 60px;
}

/* LCP 최적화 적용된 타이포그래피 스타일 - 인라인 CSS와 중복되어도 문제 없음 */
.post-title {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--dark-text);
    line-height: 1.3;
    margin-bottom: 1rem;
    word-break: keep-all;
    letter-spacing: -0.02em;
    text-rendering: optimizeLegibility;
    font-display: swap;
    will-change: auto;
    content-visibility: auto;
    contain: layout style paint;
}

/* 포스트 메타 정보 스타일 */
.post-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    font-size: 0.95rem;
    color: var(--light-text);
}

.post-meta .meta-item {
    display: inline-flex;
    align-items: center;
    margin-right: 1.5rem;
    margin-bottom: 0.5rem;
}

.post-meta i {
    margin-right: 0.4rem;
    opacity: 0.8;
}

/* 썸네일 이미지 스타일 */
.post-thumbnail {
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
    max-height: 450px; /* 이미지 최대 높이 제한 */
}

.post-thumbnail img {
    width: 100%;
    height: auto;
    max-height: 450px; /* 이미지 최대 높이 제한 */
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-thumbnail:hover img {
    transform: scale(1.02);
}

/* 글 내용 컨테이너 */
.post-content-wrapper {
    background-color: white;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 2.5rem;
    margin-bottom: 2rem;
}

/* 본문 타이포그래피 개선 */
div.row article h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-text);
    margin-top: 2rem;
    margin-bottom: 1.2rem;
    letter-spacing: -0.02em;
    word-break: keep-all;
    line-height: 1.4;
}

div.row article h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark-text);
    margin-top: 2.2rem;
    margin-bottom: 1.2rem;
    letter-spacing: -0.02em;
    word-break: keep-all;
    line-height: 1.4;
}

div.row article h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--dark-text);
    margin-top: 1.8rem;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    word-break: keep-all;
    line-height: 1.5;
}

div.row article p {
    color: var(--body-text);
    font-weight: 400;
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    line-height: 1.8;
    word-break: keep-all;
}

/* 본문 이미지 스타일 */
div.row article img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    margin: 1.5rem 0;
}

/* 리스트 스타일 */
div.row article ul, 
div.row article ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

div.row article li {
    margin-bottom: 0.6rem;
    line-height: 1.6;
}

/* 링크 스타일 */
div.row article a {
    color: var(--main-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
    font-weight: 500;
}

div.row article a:hover {
    border-bottom-color: var(--main-color);
}

/* 블록 인용구 스타일 */
div.row article blockquote {
    background-color: #f5f7ff;
    border-left: 4px solid var(--main-color);
    padding: 1.2rem 1.5rem;
    margin: 1.8rem 0;
    border-radius: 0 8px 8px 0;
}

div.row article blockquote p {
    margin-bottom: 0;
    font-style: italic;
    color: #444;
}

/* 코드 블록 스타일 */
div.row article pre,
div.row article code {
    background-color: #f5f7fa;
    font-family: 'SF Mono', Consolas, Monaco, 'Andale Mono', monospace;
    border-radius: 6px;
    font-size: 0.95em;
}

div.row article pre {
    padding: 1rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid #e5e9f0;
}

div.row article code {
    padding: 0.2em 0.4em;
}

/* 목차 스타일 */
.toc {
    background-color: white;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-left: 4px solid var(--main-color);
}

.toc-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--dark-text);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toc-title i {
    margin-right: 0.5rem;
    color: var(--main-color);
}

.toc-title .btn-link {
    color: var(--light-text);
    font-size: 0.9rem;
    padding: 0.2rem 0.5rem;
    margin-left: auto;
    text-decoration: none;
}

.toc-title .btn-link:hover {
    color: var(--main-color);
}

.toc-list {
    list-style-type: none;
    padding-left: 0;
    margin-bottom: 0;
}

.toc-list li {
    margin-bottom: 0.8rem;
    position: relative;
    padding-left: 1.2rem;
}

.toc-list li:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--main-color);
}

.toc-list li.sub-item {
    margin-left: 1rem;
    margin-bottom: 0.5rem;
}

.toc-list li.sub-item:before {
    width: 4px;
    height: 4px;
}

.toc-list a {
    color: var(--body-text);
    text-decoration: none;
    transition: color 0.2s;
}

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

/* 태그 스타일 */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.tag-item {
    display: inline-block;
    background-color: #f0f2f5;
    color: var(--body-text);
    padding: 0.4rem 1rem;
    margin-right: 0.6rem;
    margin-bottom: 0.6rem;
    border-radius: 30px;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s;
}

.tag-item:hover {
    background-color: var(--main-color);
    color: white;
    transform: translateY(-2px);
}

/* 공유 버튼 스타일 */
.share-section {
    margin: 2rem 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.share-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--dark-text);
}

.share-buttons {
    display: flex;
    gap: 10px;
}

.share-button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: white;
    transition: all 0.3s;
}

.share-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.share-button.facebook {
    background-color: #3b5998;
}

.share-button.twitter {
    background-color: #1da1f2;
}

.share-button.linkedin {
    background-color: #0077b5;
}

.share-button.kakao {
    background-color: #fee500;
    color: #111;
}

/* 저자 프로필 카드 */
.author-card {
    background-color: white;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
    margin-bottom: 2rem;
    transition: all 0.3s;
}

.author-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.author-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.author-image {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 1rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.author-info {
    flex: 1;
}

.author-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    color: var(--dark-text);
}

.author-role {
    font-size: 0.9rem;
    color: var(--light-text);
}

.author-description {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.2rem;
    color: var(--body-text);
}

.author-link {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background-color: var(--main-color);
    color: white;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.author-link:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 관련 글 스타일 */
.related-posts {
    background-color: white;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.related-posts-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
    color: var(--dark-text);
    display: flex;
    align-items: center;
}

.related-posts-title i {
    margin-right: 0.5rem;
    color: var(--main-color);
}

.related-post-item {
    display: flex;
    margin-bottom: 1.2rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid var(--border-color);
}

.related-post-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.related-post-image {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 1rem;
}

.related-post-content {
    flex: 1;
}

.related-post-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
    line-height: 1.4;
}

.related-post-title a {
    color: var(--dark-text);
    text-decoration: none;
    transition: color 0.2s;
}

.related-post-title a:hover {
    color: var(--main-color);
}

.related-post-meta {
    font-size: 0.85rem;
    color: var(--light-text);
    display: flex;
    align-items: center;
}

.related-post-meta i {
    margin-right: 0.3rem;
    font-size: 0.8rem;
}

/* 인기 포스트 위젯 */
.popular-posts {
    margin-top: 2rem;
}

.popular-posts-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
    color: var(--dark-text);
    display: flex;
    align-items: center;
}

.popular-posts-title i {
    margin-right: 0.5rem;
    color: var(--main-color);
}

.popular-post-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.popular-post-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.popular-post-rank {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 28px;
    height: 28px;
    background-color: var(--main-color);
    color: white;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.85rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.popular-post-rank.secondary {
    background-color: var(--light-text);
}

.popular-post-content {
    flex: 1;
}

.popular-post-title {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.2rem;
    line-height: 1.4;
}

.popular-post-title a {
    color: var(--dark-text);
    text-decoration: none;
    transition: color 0.2s;
}

.popular-post-title a:hover {
    color: var(--main-color);
}

.popular-post-meta {
    font-size: 0.8rem;
    color: var(--light-text);
}

/* CTA 위젯 */
.cta-card {
    background: linear-gradient(45deg, var(--main-color), var(--accent-color));
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
    margin-top: 2rem;
    color: white;
}

.cta-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.cta-description {
    font-size: 0.95rem;
    margin-bottom: 1.2rem;
    opacity: 0.9;
}

.cta-button {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background-color: white;
    color: var(--main-color);
    border-radius: 30px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* 반응형 스타일 */
@media (max-width: 991.98px) {
    .post-content-wrapper {
        padding: 1.8rem;
    }
    
    .post-title {
        font-size: 1.9rem;
    }
    
    div.row article h1 {
        font-size: 1.8rem;
    }
    
    div.row article h2 {
        font-size: 1.6rem;
    }
    
    div.row article h3 {
        font-size: 1.3rem;
    }
}

@media (max-width: 767.98px) {
    .post-container {
        padding-top: 30px;
    }
    
    .post-content-wrapper {
        padding: 1.5rem;
    }
    
    .post-title {
        font-size: 1.7rem;
    }
    
    .post-meta {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
        width: 100%;
    }
    
    .post-meta .meta-item {
        margin-right: 0;
        margin-bottom: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    div.row article h1 {
        font-size: 1.6rem;
    }
    
    div.row article h2 {
        font-size: 1.4rem;
    }
    
    div.row article h3 {
        font-size: 1.2rem;
    }
    
    .toc,
    .post-content-wrapper,
    .author-card,
    .related-posts,
    .cta-card {
        padding: 1.2rem;
    }
}

/* 모바일 초소형 화면에서 메타 정보 한 줄로 표시 */
@media (max-width: 375px) {
    .post-meta {
        grid-template-columns: 1fr;
    }
}

/* 사이드바 스크롤 고정 */
.sidebar-sticky {
    position: sticky;
    top: 80px; /* 네비게이션 바 높이에 맞게 조정 */
}

/* 공유 버튼 접근성 개선 */
.share-button-container {
    display: inline-block;
    margin-right: 0.8rem;
    margin-bottom: 0.5rem;
}

.share-button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: white;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.share-button span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 이미지 로딩 최적화 */
.lazy-load {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy-load.loaded {
    opacity: 1;
}

/* 포스트 카드 스타일링 - 목록 페이지용 */
.post-card {
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-img-link {
    overflow: hidden;
}

.card-img-top {
    height: 180px;
    object-fit: cover;
    transition: transform 0.3s;
}

.post-card:hover .card-img-top {
    transform: scale(1.05);
}

.card-title a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8rem;
    max-height: none;
    line-height: 1.4;
    text-overflow: ellipsis;
    word-break: keep-all;
}

.card-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 4.5rem;
    max-height: none;
}

/* 사이드바 스타일링 */
.card {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.tag-cloud a {
    display: inline-block;
    font-size: 0.85rem;
    transition: background-color 0.3s;
}

.tag-cloud a:hover {
    background-color: #e9ecef;
}

/* 페이지네이션 스타일링 */
.pagination .page-link {
    border-radius: 4px;
    margin: 0 3px;
}

.pagination .page-item.active .page-link {
    background-color: var(--main-color);
    border-color: var(--main-color);
}

/* 404 페이지 스타일 */
.error-container {
    padding: 2rem 0;
}

.display-1 {
    font-size: 8rem;
    font-weight: 700;
    opacity: 0.8;
    margin-bottom: 1rem;
}

.popular-posts .card {
    transition: transform 0.3s, box-shadow 0.3s;
}

.popular-posts .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* 이미지 플레이스홀더 스타일 */
.image-placeholder {
    background-color: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--light-text);
    margin: 1.5rem 0;
    min-height: 200px;
    transition: opacity 0.3s;
}

.spinner {
    font-size: 1.5rem;
    color: var(--main-color);
} 
