@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css');

/* ==========================================================================
   [테마 변수 - 화이트/연그레이 기반 심플 & 다크모드]
   ========================================================================== */
:root {
    --bg-color: #ffffff;
    --card-bg: #f9f9f9;
    --text-main: #1a1a1a;
    --text-sub: #555555;
    --text-light: #999999;
    --border-line: #ebebeb;
    --border-strong: #dddddd;
    --accent: #222222;
    --radius: 12px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.03);
    --shadow-md: 0 6px 16px rgba(0,0,0,0.06);
}

[data-theme="dark"] {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-main: #eeeeee;
    --text-sub: #aaaaaa;
    --text-light: #777777;
    --border-line: #2a2a2a;
    --border-strong: #444444;
    --accent: #ffffff;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
    --shadow-md: 0 6px 16px rgba(0,0,0,0.4);
}

/* ==========================================================================
   [기본 리셋 & 레이아웃]
   ========================================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Pretendard', sans-serif;
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}
a { color: inherit; text-decoration: none !important; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

.container { max-width: 1060px;  margin: 0 auto; padding: 0 20px 80px; margin-top: 6em; }
.main-header { text-align: center; padding: 60px 0 50px; }
.logo a { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.5px; }

/* ==========================================================================
   [1. 좌측 고정 미니멀 리모컨 메뉴]
   ========================================================================== */
.floating-remote {
    position: fixed; left: 24px; top: 50%; transform: translateY(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 10px 8px; background: var(--bg-color); border: 1px solid var(--border-line);
    border-radius: 30px; box-shadow: var(--shadow-sm); z-index: 9999;
}
.remote-btn {
    width: 36px; height: 36px; border: none; background: transparent;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-sub); transition: 0.2s ease;
}
.remote-btn:hover { background: var(--card-bg); color: var(--text-main); }
.remote-btn svg { width: 18px; height: 18px; }
.theme-btn .icon-moon { display: none; }
[data-theme="dark"] .theme-btn .icon-sun { display: none; }
[data-theme="dark"] .theme-btn .icon-moon { display: block; }

.remote-divider { width: 20px; height: 1px; background: var(--border-line); }

.menu-btn { display: flex; flex-direction: column; gap: 4px; }
.menu-btn .bar { width: 16px; height: 1.5px; background: currentColor; border-radius: 2px; }

/* 카테고리 패널 */
.remote-panel {
    position: absolute; left: 64px; top: 50%; transform: translateY(-50%) translateX(-10px);
    width: 220px; max-height: 70vh; overflow-y: auto; background: var(--bg-color);
    border: 1px solid var(--border-line); border-radius: var(--radius); padding: 20px;
    box-shadow: var(--shadow-md); opacity: 0; visibility: hidden; transition: 0.2s ease;
}
.remote-panel.active { opacity: 1; visibility: visible; transform: translateY(-50%) translateX(0); }
.panel-header { font-size: 0.65rem; font-weight: 800; color: var(--text-light); margin-bottom: 12px; letter-spacing: 1px; }

/* 카테고리 대/소분류 접기 화살표 버튼 */
.blog-category-list-wrap ul li { font-size: 0.85rem; margin-bottom: 6px; position: relative; display: flex; flex-direction: column; }
.blog-category-list-wrap ul li a { color: var(--text-sub); transition: color 0.15s; display: inline-block; width: fit-content; }
.blog-category-list-wrap ul li a:hover { color: var(--text-main); font-weight: 600; }
.blog-category-list-wrap ul li ul { padding-left: 12px; margin-top: 6px; border-left: 1px solid var(--border-line); display: none; }

.cat-toggle-btn {
    position: absolute; right: 0; top: 0;
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; cursor: pointer; color: var(--text-light);
    transition: transform 0.2s;
}
.cat-toggle-btn svg { width: 12px; height: 12px; }
.cat-toggle-btn.open { transform: rotate(180deg); }

@media (max-width: 800px) {
    .floating-remote { left: auto; right: 16px; }
    .remote-panel { left: auto; right: 64px; }
}

/* ==========================================================================
   [2. 카테고리 썸네일 갤러리 피드 (목록)]
   ========================================================================== */
/* 상단 메인 2열 고정 배너 */
.main-profile-section { margin-bottom: 40px; }
.main-grid-top { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.main-card-hero {
    position: relative; display: flex; flex-direction: column; justify-content: flex-end;
    height: 350px; border-radius: var(--radius); overflow: hidden;
}
.hero-bg, .hero-bg img, .empty-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--border-line); }
.hero-content {
    position: relative; z-index: 2; padding: 30px 24px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%); color: #fff;
}
.hero-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.hero-desc { font-size: 0.8rem; color: rgba(255,255,255,0.7); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 하단 피드: 격자(Grid) 해제 -> 다중열(Multi-Column)로 빈틈없이 위로 자동밀착 */
.grid-feed-container {
    column-count: 3;
    column-gap: 24px;
    width: 100%;
}
.feed-item {
    break-inside: avoid;
    margin-bottom: 24px;
    display: block;
}
.card-inner {
    display: block;
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.card-inner:hover {
    transform: translateY(-4px);
}

.thumb-wrap {
    position: relative;
    width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--card-bg);
}
.thumb-wrap img {
    width: 100%;
    height: auto;
    display: block;
}

/* 1) 텍스트 형태 피드 디자인 */
.type-text .card-inner {
    background: var(--card-bg);
    border: 1px solid var(--border-line);
    padding: 24px;
    display: flex;
    flex-direction: column;
}
.text-card-content {
    margin-bottom: 20px;
}
.type-text .card-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 10px;
    line-height: 1.4;
}
.type-text .card-excerpt {
    font-size: 0.82rem;
    color: var(--text-sub);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* ==========================================================================
   [macOS 스타일 슬림 상단바 & 위젯 디자인]
   ========================================================================== */

/* 1. 이미지 및 유튜브 카드 통합 그릇 설정 */
.type-image .card-inner,
.type-youtube .card-inner {
    background: var(--bg-color) !important; /* 위젯 느낌의 화이트 바탕 */
    border: 1px solid var(--border-line) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    border-radius: var(--radius) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.02) !important;
    transition: transform 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.22s ease !important;
}

.type-image .card-inner:hover,
.type-youtube .card-inner:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06) !important;
    border-color: var(--border-strong) !important;
}

/* 2. 극도로 미니멀하고 슬림한 macOS 위젯형 상단바 */
.card-meta-tag {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    background: var(--bg-color) !important; /* 깔끔한 퓨어 화이트 */
    border-bottom: 1px solid var(--border-line) !important;
    padding: 20px 14px !important; /* 기존보다 훨씬 슬림하고 미니멀한 패딩 조절 */
    width: 100% !important;
    position: relative !important;
    z-index: 5;
    height: 34px !important; /* 고정 높이 제공으로 뚱뚱함 최소화 */
}

/* 상단바 내부 타이틀 (컴팩트 & 1줄 요약) */
.meta-title {
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    color: var(--text-main) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 68% !important;
    letter-spacing: -0.2px !important;
}

/* 상단바 내부 우측 날짜 */
.meta-date {
    font-size: 0.65rem !important;
    color: var(--text-light) !important;
    font-weight: 500 !important;
    flex-shrink: 0 !important;
    letter-spacing: 0.2px !important;
}

/* 3. 상단바와 결합하는 썸네일 포맷 */
.type-image .thumb-wrap,
.type-youtube .thumb-wrap {
    width: 100% !important;
    border-radius: 0 !important; /* 상단바와 완벽 밀착을 위해 위쪽만 0 처리 */
    overflow: hidden !important;
    position: relative !important;
}

/* 유튜브 16:9 비율 유지 */
.type-youtube .thumb-wrap {
    aspect-ratio: 16/9 !important;
}
.type-youtube .thumb-wrap img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* 4. [개선] 유튜브 정중앙 재생 버튼 아이콘 디자인 */
.play-indicator {
    position: absolute !important;
    inset: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(0, 0, 0, 0.12) !important; /* 썸네일 대비감 상향 */
    z-index: 3 !important;
    transition: background 0.2s ease !important;
}
.type-youtube .card-inner:hover .play-indicator {
    background: rgba(0, 0, 0, 0.22) !important; /* 호버 시 플레이 시인성 향상 */
}

/* 원형 플레이 유어 버튼 */
.play-btn-circle {
    width: 46px;
    height: 46px;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, background-color 0.2s ease;
}
.type-youtube .card-inner:hover .play-btn-circle {
    transform: scale(1.1);
    background: #ffffff;
}
.play-btn-circle svg {
    width: 16px;
    height: 16px;
    color: #1a1a1a;
    margin-left: 2px; /* 재생 심볼 우측 치우침 눈대중 정렬 맞춤 */
}


/* ==========================================================================
   [미니멀 저널 스타일 감성 텍스트 카드 디자인]
   ========================================================================== */
.type-text .card-inner {
    background: var(--bg-color) !important; /* 순수 화이트 배경 */
    border: 1px solid var(--border-line) !important;
    padding: 16px 18px 18px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    min-height: 190px !important;
    border-radius: var(--radius) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.02) !important;
    transition: transform 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.22s ease !important;
}

.type-text .card-inner:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06) !important;
    border-color: var(--border-strong) !important;
}

/* 텍스트 카드는 내부의 메타태그를 '글 타이틀바' 용도로 경량화 적용 */
.type-text .card-meta-tag {
    background: transparent !important;
    border-bottom: 1px solid var(--border-line) !important;
    padding: 0 0 10px 0 !important;
    margin-bottom: 14px !important;
    height: auto !important;
}

.type-text .meta-title {
    font-size: 0.85rem !important; /* 본문 텍스트 타이틀 가시성 업 */
    font-weight: 800 !important;
    color: var(--text-main) !important;
}

.type-text .meta-date {
    font-size: 0.65rem !important;
    color: var(--text-light) !important;
}

/* 텍스트 카드 본문 */
.type-text .text-card-content {
    flex-grow: 1;
    display: flex;
    align-items: flex-start;
    margin-bottom: 16px;
}

.type-text .card-excerpt {
    font-size: 0.82rem !important;
    color: var(--text-sub) !important;
    line-height: 1.65 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 10 !important; /* 가독성 극대화하기 위해 라인 수 제한 */
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

/* 텍스트 카드 푸터 */
.type-text .text-card-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    border-top: 1px dashed var(--border-line);
    padding-top: 10px;
}

.type-text .read-more {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-light);
    transition: color 0.2s ease;
}

.type-text .card-inner:hover .read-more {
    color: var(--text-main);
}


/* ==========================================================================
   [반응형 피드 정렬 조절 (복구)]
   ========================================================================== */
@media (max-width: 900px) {
    .grid-feed-container {
        column-count: 2 !important;
        column-gap: 16px !important;
    }
    .feed-item {
        margin-bottom: 16px !important;
    }
}
@media (max-width: 600px) {
    .grid-feed-container {
        column-count: 1 !important;
    }
}

/* ==========================================================================
   [3. 페이지네이션 (시인성 복구)]
   ========================================================================== */
.custom-pagination {
    display: flex !important; /* 타 스타일 우선순위 우회 */
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 60px 0 20px;
    width: 100%;
    clear: both; /* multi-column 플로팅 해제 */
}
.custom-pagination a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    color: var(--text-sub);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}
.custom-pagination a:hover {
    color: var(--text-main);
}
.custom-pagination .btn-prev, .custom-pagination .btn-next {
    width: 36px;
    height: 36px;
    background: var(--card-bg);
    border-radius: 50%;
    border: 1px solid var(--border-line);
    color: var(--text-main) !important;
}
.custom-pagination .btn-prev svg, .custom-pagination .btn-next svg {
    width: 16px; height: 16px;
}
.custom-pagination .page-nums {
    display: flex;
    gap: 12px;
}
.custom-pagination .page-nums a {
    padding: 2px 6px;
}
.custom-pagination .selected {
    color: var(--text-main) !important;
    font-weight: 800;
    border-bottom: 2px solid var(--text-main);
}
.no-more-prev, .no-more-next {
    opacity: 0.3;
    pointer-events: none;
}

/* ==========================================================================
   [4. 게시글 본문 뷰 (깔끔하고 세련된 정렬)]
   ========================================================================== */
.post-view {
    max-width: 700px; margin: 0 auto; padding: 0 0 60px;
}

/* 본문 카테고리, 제목, 날짜, 관리버튼 한 줄 정렬 */
.post-view-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-line);
    padding-bottom: 24px;
    margin-bottom: 45px;
    gap: 16px;
}
.post-head-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-grow: 1;
    min-width: 0;
}
.post-view-cat {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-light);
    border: 1px solid var(--border-line);
    padding: 4px 10px;
    border-radius: 20px;
    flex-shrink: 0;
}
.post-view-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}
.post-head-right {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-light);
    flex-shrink: 0;
}
.admin-divider {
    color: var(--border-strong);
}
.admin-controls {
    display: inline-flex;
    gap: 8px;
}
.admin-controls a {
    color: var(--text-light);
    font-size: 0.75rem;
    text-decoration: underline !important;
}
.admin-controls a:hover {
    color: var(--text-main);
}

@media (max-width: 768px) {
    .post-view-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .post-head-left {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .post-view-title {
        white-space: normal;
        font-size: 1.25rem;
    }
    .post-head-right {
        width: 100%;
        justify-content: space-between;
    }
}

/* 본문 미디어 모서리 둥글게 */
.post-view-content img,
.post-view-content iframe,
.post-view-content video,
.post-view-content .iframe-wrapper {
    border-radius: var(--radius) !important;
    overflow: hidden;
}

.post-view-content { color: var(--text-main); font-size: 1rem; line-height: 1.8; letter-spacing: -0.2px; word-break: break-word; }
.post-view-content img { margin: 30px auto; }
.post-view-content p { margin-bottom: 24px; color: var(--text-sub); }

.post-view-content h2, .post-view-content h1 { font-size: 1.5rem; font-weight: 800; margin: 50px 0 20px; color: var(--text-main); border-bottom: 2px solid var(--border-line); padding-bottom: 10px; }
.post-view-content h3 { font-size: 1.25rem; font-weight: 700; margin: 40px 0 16px; color: var(--text-main); }
.post-view-content h4 { font-size: 1.1rem; font-weight: 600; margin: 30px 0 12px; color: var(--text-main); }

.post-view-content blockquote { border-left: 3px solid var(--border-strong); padding: 10px 20px; margin: 30px 0; background: var(--card-bg); font-style: italic; border-radius: 0 8px 8px 0; }
.post-view-content a { color: #3b82f6; text-decoration: underline !important; }

/* ==========================================================================
   [티스토리 시스템 강제 주입 요소 제거 (공감버튼, 카테고리 다른글목록 강제 강퇴)]
   ========================================================================== */
.container_postbtn, 
.another_category, 
.tagty,
.revenue_unit_wrap { 
    display: none !important; 
}
/* ==========================================================================
   [5. 보호글/비밀글 입력 폼 스타일]
   ========================================================================== */
.protected-view {
    text-align: center;
}
.protected-form-wrap {
    padding: 60px 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-line);
    border-radius: var(--radius);
    margin-top: 20px;
}
.protected-msg {
    font-size: 0.9rem;
    color: var(--text-sub);
    margin-bottom: 20px;
}
.protected-input-group {
    display: inline-flex;
    gap: 8px;
    max-width: 320px;
    width: 100%;
}
.protected-input {
    flex: 1;
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-main);
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s;
}
.protected-input:focus {
    border-color: var(--text-main);
}
.protected-btn {
    height: 42px;
    padding: 0 20px;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: var(--bg-color);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity 0.2s;
}
.protected-btn:hover {
    opacity: 0.85;
}