/* ============================================
   Blog Page - 블로그
   ============================================ */

/* ============================================
   헤더 강제 스크롤 상태 (블로그 페이지)
   ============================================ */

body.blog-page #main-nav {
    background-color: #fff !important;
    border-bottom: 1px solid #eee !important;
}

body.blog-page #logo-link img {
    filter: brightness(0);
}

body.blog-page .location-info {
    color: #333 !important;
}

body.blog-page .location-info img {
    filter: none !important;
}

body.blog-page .hamburger-menu-btn span {
    background: #333 !important;
}

/* ============================================
   블로그 컨테이너
   ============================================ */

.blog-wrapper {
    padding-top: 80px; /* 헤더 높이만큼 */
    padding-bottom: 40px;
    min-height: 60vh;
}

/* ============================================
   카테고리 탭 바
   ============================================ */

.blog-category-bar {
    position: sticky;
    top: 80px;
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid #eee;
}

.blog-category-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

.blog-category-scroll {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 12px 0;
    position: relative;
    z-index: 3;
}

.blog-category-scroll::-webkit-scrollbar {
    display: none;
}

.blog-category-btn {
    flex-shrink: 0;
    padding: 8px 18px;
    font-size: 15px;
    font-weight: 400;
    color: #888;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
    z-index: 1;
    font-family: 'Pretendard', sans-serif;
    text-decoration: none;
    display: inline-block;
}

.blog-category-btn:hover {
    color: #333;
}

.blog-category-btn.active {
    color: #222;
    font-weight: 600;
}

.blog-category-btn.active::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 2px;
    background: #222;
}

/* 카테고리 우측 그라데이션 */
.blog-category-fade {
    position: absolute;
    right: 20px;
    top: 0;
    bottom: 0;
    width: 60px;
    background: linear-gradient(to right, transparent, #fff);
    pointer-events: none;
    z-index: 1;
}

.blog-category-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
    transition: all 0.3s;
    color: #888;
}

.blog-category-arrow:hover {
    border-color: #ccc;
    color: #333;
}

.blog-category-arrow--prev {
    left: 8px;
    opacity: 0;
    pointer-events: none;
}

.blog-category-arrow--prev.visible {
    opacity: 1;
    pointer-events: auto;
}

.blog-category-arrow--next {
    right: 8px;
}

.blog-category-arrow--next.hidden {
    opacity: 0;
    pointer-events: none;
}

.blog-category-arrow--mobile {
    display: none;
}

/* ============================================
   블로그 콘텐츠 영역
   ============================================ */

.blog-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px 80px;
}

/* ============================================
   블로그 포스트 리스트
   ============================================ */

.blog-post-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.blog-post-empty {
    padding: 48px 24px;
    text-align: center;
    color: #666;
    font-size: 15px;
}

/* 무한 스크롤 감지용 (보이지 않음) */
.blog-infinite-sentinel {
    height: 1px;
    visibility: hidden;
    pointer-events: none;
    margin: 0;
    padding: 0;
}

.blog-post-item {
    display: flex;
    width: 100%;
    align-items: stretch;
    gap: 50px;
    padding: 28px 0;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.blog-post-item:first-child {
    padding-top: 12px;
}

/* 썸네일 이미지 */
.blog-post-thumb {
    position: relative;
    flex-shrink: 0;
    width: 220px;
    height: 220px;
    overflow: hidden;
}

.blog-post-thumb--empty {
    background: #f5f5f5;
}

.blog-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-post-item:hover .blog-post-thumb img {
    opacity: 0.8;
}

/* 콘텐츠 영역 */
.blog-post-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: top;
    gap: 15px;
    min-width: 0;
}

.blog-post-title {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-post-subtitle {
    font-size: 17px;
    font-weight: 400;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-post-desc {
    font-size: 15px;
    font-weight: 300;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.blog-post-tag {
    font-size: 13px;
    color: #2A1F1B;
    font-weight: 300;
}

.blog-post-date {
    font-size: 13px;
    color: #555;
    font-weight: 300;
    margin-top: 2px;
}

/* ============================================
   빈 상태
   ============================================ */

.blog-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 120px 20px;
    text-align: center;
}

.blog-empty-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.blog-empty-text {
    font-size: 16px;
    color: #999;
    font-weight: 300;
}

/* ============================================
   블로그 디테일 페이지
   ============================================ */

.blog-detail {
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px 16px 0;
}

/* 상단 헤더 영역 (이미지 + 텍스트) */
.blog-detail-header {
    display: flex;
    align-items: stretch;
    gap: 40px;
}

.blog-detail-thumb {
    flex-shrink: 0;
    width: 220px;
    height: 220px;
    border-radius: 0;
    overflow: hidden;
}

.blog-detail-thumb--empty {
    background: #f5f5f5;
}

.blog-detail-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.blog-detail-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 0;
}

.blog-detail-title {
    font-size: 27px;
    font-weight: 600;
    line-height: 1.4;
    color: #111;
    margin: 0;
    word-break: keep-all;
}

.blog-detail-subtitle {
    font-size: 17px;
    font-weight: 400;
    line-height: 1.6;
    margin: 0;
}

.blog-detail-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.blog-detail-tag {
    font-size: 14px;
    color: #2A1F1B;
    font-weight: 300;
}

.blog-detail-date {
    font-size: 14px;
    color: #888;
    font-weight: 300;
    margin: 0;
}

/* 구분선 */
.blog-detail-divider {
    height: 1px;
    background: #e5e5e5;
    margin: 32px 0 50px;
}

/* 본문 콘텐츠 (WYSIWYG) */
.blog-detail-body {
    margin: 0 auto;
    padding: 0 0 80px;
}

/* 에디터/본문 공통 (프론트 상세 + 관리자 에디터 미리보기) - 여기만 수정 */
.wysiwyg-content {
    font-size: 16px;
    line-height: 1.85;
    color: #333;
    word-break: keep-all;
}

.wysiwyg-content p {
    font-size: 16px;
    font-weight: 500;
    line-height: 2;
}

.wysiwyg-content h1,
.wysiwyg-content h2,
.wysiwyg-content h3,
.wysiwyg-content h4 {
    font-weight: 600;
    color: #111;
    line-height: 1.4;
    margin: 32px 0 12px;
}

.wysiwyg-content h1 { font-size: 26px; }
.wysiwyg-content h2 { font-size: 24px; margin-top: 48px; }
.wysiwyg-content h3 { font-size: 20px; color: #222; margin-top: 36px; }
.wysiwyg-content h4 { font-size: 18px; }

.wysiwyg-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 24px 0;
    display: block;
}

.wysiwyg-content a {
    color: #1a3a2e;
    text-decoration: underline;
}

.wysiwyg-content a:hover {
    color: #0f2a20;
}

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

.wysiwyg-content li {
    font-size: 16px;
    font-weight: 300;
    line-height: 1.85;
    color: #333;
    margin-bottom: 8px;
}

.wysiwyg-content blockquote {
    border-left: 3px solid #c4b5a4;
    padding: 16px 20px;
    margin: 24px 0;
    background: #faf8f6;
    border-radius: 0 8px 8px 0;
}

.wysiwyg-content blockquote p {
    margin: 0;
    color: #555;
    font-style: italic;
}

.wysiwyg-content strong {
    font-weight: 600;
    color: #111;
}

.wysiwyg-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.wysiwyg-content th,
.wysiwyg-content td {
    border: 1px solid #e5e7eb;
    padding: 10px 12px;
    text-align: left;
}

.wysiwyg-content th {
    background: #f9fafb;
    font-weight: 600;
}

/* 목록으로 버튼 */
.blog-detail-back {
    display: flex;
    justify-content: center;
    padding: 40px 0 80px;
}

.blog-detail-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 500;
    color: #555;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    text-decoration: none;
    transition: all 0.2s;
}

.blog-detail-back-btn:hover {
    border-color: #999;
    color: #222;
}

/* ============================================
   블로그 디테일 반응형 - 태블릿 (1024px)
   ============================================ */

@media (max-width: 1024px) {
    .blog-detail-title {
        font-size: 24px;
    }
}

/* ============================================
   블로그 디테일 반응형 - 모바일 (768px)
   ============================================ */

@media (max-width: 768px) {
    .blog-detail {
        padding: 16px 16px 0;
    }

    .blog-detail-header {
        flex-direction: column;
        gap: 20px;
    }

    .blog-detail-thumb,
    .blog-detail-thumb--empty {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 10;
    }

    .blog-detail-title {
        font-size: 22px;
    }

    .blog-detail-subtitle {
        font-size: 15px;
    }

    .blog-detail-tag {
        font-size: 13px;
    }

    .blog-detail-date {
        font-size: 13px;
        margin-top: 8px;
    }

    .blog-detail-divider {
        margin: 24px 0 35px;
    }

    .blog-detail-body {
        padding: 0 0 60px;
    }

    .wysiwyg-content p {
        font-size: 15px;
    }

    .wysiwyg-content h2 {
        font-size: 20px;
        margin: 36px 0 12px;
    }

    .wysiwyg-content h3 {
        font-size: 18px;
        margin: 28px 0 10px;
    }

    .wysiwyg-content img {
        border-radius: 6px;
        margin: 20px 0;
    }

    .blog-detail-back {
        padding: 32px 0 60px;
    }
}

/* ============================================
   블로그 디테일 반응형 - 소형 모바일 (480px)
   ============================================ */

@media (max-width: 480px) {
    .blog-detail {
        padding: 12px 12px 0;
    }

    .blog-detail-title {
        font-size: 20px;
    }

    .blog-detail-subtitle {
        font-size: 14px;
    }

    .wysiwyg-content p {
        font-size: 14px;
    }

    .wysiwyg-content h2 {
        font-size: 18px;
    }

    .wysiwyg-content h3 {
        font-size: 16px;
    }
}

/* ============================================
   반응형 - 태블릿 (1024px)
   ============================================ */

@media (max-width: 1024px) {
    .blog-post-title {
        font-size: 18px;
    }

    .blog-post-item {
        gap: 24px;
    }
}

/* ============================================
   반응형 - 모바일 (768px)
   ============================================ */

@media (max-width: 768px) {
    .blog-category-bar {
        top: 80px;
    }

    .blog-category-inner {
        padding: 0 16px;
        position: relative;
    }

    .blog-category-scroll {
        flex-wrap: nowrap;
        overflow: hidden;
        max-height: 40px;
    }

    .blog-category-scroll.expanded {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        z-index: 110;
        background: #fff;
        flex-wrap: wrap;
        max-height: none;
        overflow: visible;
        padding: 12px 50px 12px 16px;
        border-bottom: 1px solid #eee;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    }

    .blog-category-btn {
        padding: 6px 12px;
        font-size: 14px;
    }

    .blog-category-btn.active::after {
        display: none;
    }

    .blog-category-fade {
        display: none;
    }

    .blog-category-arrow--prev,
    .blog-category-arrow--next {
        display: none;
    }

    .blog-category-arrow--mobile {
        display: flex;
        position: absolute;
        right: 12px;
        top: 6px;
        transform: none;
        width: 28px;
        height: 28px;
        z-index: 120;
        transition: transform 0.3s;
    }

    .blog-category-arrow--mobile.rotated {
        transform: rotate(180deg);
    }

    .blog-content {
        padding: 16px 16px 120px;
    }

    /* 세로 레이아웃 전환 */
    .blog-post-item {
        flex-direction: column;
        gap: 0;
        padding: 24px 0;
    }

    .blog-post-thumb,
    .blog-post-thumb--empty {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 10;
    }

    .blog-post-content {
        padding-top: 16px;
        gap: 6px;
    }

    .blog-post-title {
        font-size: 17px;
        -webkit-line-clamp: 2;
    }

    .blog-post-subtitle {
        font-size: 14px;
        display: -webkit-box;
        color: #555;
    }

    .blog-post-desc {
        display: none;
    }

    .blog-post-tags {
        display: flex;
        margin-top: 6px;
    }

    .blog-post-tag {
        font-size: 13px;
    }

    .blog-post-date {
        font-size: 13px;
        margin-top: 4px;
    }
}

/* ============================================
   반응형 - 소형 모바일 (480px)
   ============================================ */

@media (max-width: 480px) {
    .blog-content {
        padding: 12px 12px 100px;
    }

    .blog-post-item {
        padding: 20px 0;
    }

    .blog-post-title {
        font-size: 16px;
    }

    .blog-post-subtitle {
        font-size: 13px;
    }

    .blog-post-tag {
        font-size: 11px;
    }

    .blog-category-btn {
        padding: 6px 10px;
        font-size: 13px;
    }
}

