.blog {
    display: grid;
    gap: 28px;
}

.blog-header {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: 24px;
    align-items: center;
}

.blog-header__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.blog-new-btn {
    align-self: flex-start;
    border: 1px solid rgba(192, 132, 252, 0.45);
    background: rgba(192, 132, 252, 0.1);
    color: var(--accent-blog);
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.blog-new-btn:hover {
    background: rgba(192, 132, 252, 0.2);
    border-color: rgba(192, 132, 252, 0.7);
}

.blog-kicker {
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 12px;
    color: var(--accent-blog);
    margin: 0 0 10px;
}

.blog-header h1 {
    font-family: var(--font-display);
    margin: 0 0 12px;
    font-size: clamp(30px, 4vw, 40px);
}

.blog-sub {
    margin: 0;
    color: var(--muted);
}

.blog-status {
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 20px;
    background: var(--surface);
}

.blog-status__title {
    margin: 0 0 8px;
    font-weight: 600;
}

.blog-status__desc {
    margin: 0;
    color: var(--muted);
}

.blog-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.3fr) minmax(0, 0.7fr);
    gap: 22px;
    align-items: start;
}

.blog-toggle-list {
    display: none;
    position: fixed;
    /* 사이드바 토글 버튼(top-left) 과 겹치지 않도록 오른쪽 하단 배치 */
    bottom: calc(var(--bottom-nav-h, 64px) + var(--safe-area-bottom, 0px) + 16px);
    right: 24px;
    top: auto;
    left: auto;
    z-index: 1000;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(192, 132, 252, 0.45);
    background: rgba(10, 12, 20, 0.88);
    color: var(--accent-blog);
    font-size: 18px;
    cursor: pointer;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.blog-toggle-list:hover {
    transform: scale(1.08);
    opacity: 0.9;
}

.blog-list {
    display: grid;
    gap: 12px;
}

.blog-category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.blog-category-chip {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
}

.blog-category-chip.is-active {
    border-color: rgba(192, 132, 252, 0.55);
    background: rgba(192, 132, 252, 0.15);
    color: var(--accent-blog);
}

.blog-list__item-wrap {
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: var(--radius-md);
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-inset);
    overflow: hidden;
}

.blog-list__item-wrap:hover {
    border-color: var(--line-strong);
    background: var(--surface-raised);
    box-shadow: var(--shadow-sm), var(--shadow-inset);
}

.blog-list__item-wrap.is-active {
    border-color: rgba(192, 132, 252, 0.5);
    box-shadow: 0 4px 20px rgba(192, 132, 252, 0.12), var(--shadow-inset);
    background: rgba(192, 132, 252, 0.05);
}

.blog-list__item-btn {
    width: 100%;
    padding: 16px;
    text-align: left;
    cursor: pointer;
    display: grid;
    gap: 8px;
    background: transparent;
    border: none;
    color: inherit;
}

.blog-list__actions {
    display: flex;
    gap: 6px;
    padding: 0 12px 10px;
}

.blog-list__action-btn {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.blog-list__action-btn:hover {
    border-color: var(--accent-blog);
    color: var(--accent-blog);
}

.blog-list__action-btn--del:hover {
    border-color: #f04452;
    color: #f04452;
}

.blog-article__edit-btn {
    font-size: 11px;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    transition: border-color 0.15s, color 0.15s;
}

.blog-article__edit-btn:hover {
    border-color: var(--accent-blog);
    color: var(--accent-blog);
}

.blog-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 10px;
}

.blog-page-btn {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
}

.blog-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.blog-page-indicator {
    color: var(--muted);
    font-size: 12px;
}

.blog-list__title {
    margin: 0;
    font-weight: 600;
    font-size: 16px;
    color: #f8f3ee;
}

.blog-list__excerpt {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.blog-list__meta {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--accent-blog);
}

.blog-article {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(9, 10, 16, 0.65);
    padding: 28px;
    box-shadow: var(--shadow-md), var(--shadow-inset);
}

.blog-article__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.blog-tags {
    display: flex;
    gap: 6px;
}

.blog-tag {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 11px;
    text-transform: none;
    letter-spacing: 0.06em;
}

.blog-article__body h1,
.blog-article__body h2,
.blog-article__body h3,
.blog-article__body h4,
.blog-article__body h5,
.blog-article__body h6 {
    font-family: var(--font-display);
    margin: 22px 0 10px;
}

.blog-article__body h1 {
    font-size: 30px;
}

.blog-article__body h2 {
    font-size: 24px;
}

.blog-article__body h3 {
    font-size: 20px;
}

.blog-article__body h4 {
    font-size: 18px;
}

.blog-article__body h5 {
    font-size: 16px;
}

.blog-article__body h6 {
    font-size: 14px;
}

.md-paragraph {
    margin: 0 0 14px;
    color: var(--muted);
    line-height: 1.8;
}

.blog-article__body ul {
    margin: 0 0 16px;
    padding-left: 18px;
    color: var(--muted);
}

.blog-article__body code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.85em;
}

.blog-article__body del {
    text-decoration: line-through;
    opacity: 0.7;
}

.blog-article__body a {
    color: #f7d4c9;
}

.md-image {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    margin: 12px 0;
}

.md-quote {
    margin: 0 0 14px;
    padding: 12px 16px;
    border-left: 3px solid rgba(192, 132, 252, 0.5);
    background: rgba(192, 132, 252, 0.05);
    border-radius: 0 8px 8px 0;
    color: var(--muted);
}

.md-hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    margin: 18px 0;
}

.md-code {
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.4);
    font-size: 13px;
    overflow-x: auto;
}

.blog-empty {
    color: var(--muted);
}

.blog-categories {
    display: grid;
    gap: 18px;
}

.blog-categories__head h2 {
    margin: 0 0 6px;
    font-size: 24px;
    font-family: var(--font-display);
}

.blog-categories__head p {
    margin: 0;
    color: var(--muted);
}

.blog-categories__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.blog-category-card {
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 18px;
    padding: 16px;
    text-align: left;
    color: inherit;
    cursor: pointer;
    display: grid;
    gap: 12px;
    transition: border-color 0.2s ease;
}

.blog-category-card:hover {
    border-color: rgba(255, 255, 255, 0.25);
}

.blog-category-card__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.blog-category-card__count {
    font-size: 12px;
    color: var(--muted);
}

.blog-category-card__list {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
}

.blog-category-card__empty {
    color: var(--muted);
}

@media (max-width: 768px) {
    .blog-header {
        grid-template-columns: 1fr;
    }

    .blog-header__actions {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
    }

    .blog-toggle-list {
        display: block;
    }

    .blog-list {
        display: none;
        gap: 10px;
    }

    .blog-list.is-visible {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(6, 8, 12, 0.7);
        z-index: 999;
        padding: 80px 20px 20px;
        overflow-y: auto;
        backdrop-filter: blur(10px);
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .blog-list.is-visible .blog-category-filter {
        margin-bottom: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
    }

    .blog-list.is-visible .blog-category-filter > * {
        flex-shrink: 0;
    }

    .blog-list.is-visible .blog-pagination {
        margin-top: 8px;
    }

    .blog-article {
        width: 100%;
        padding: 18px;
    }

    .blog-header h1 {
        font-size: clamp(24px, 6vw, 32px);
    }

    .blog-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .blog-list__item-btn {
        padding: 14px;
    }

    .blog-list__title {
        font-size: 15px;
    }

    .blog-list__excerpt {
        font-size: 12px;
    }

    .blog-article__body h1 {
        font-size: 24px;
    }

    .blog-article__body h2 {
        font-size: 20px;
    }

    .blog-article__body h3 {
        font-size: 18px;
    }

    .blog-article__body h4 {
        font-size: 16px;
    }

    .blog-article__body h5 {
        font-size: 14px;
    }

    .blog-article__body h6 {
        font-size: 12px;
    }

    .blog-categories__grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 14px;
    }

    .blog-category-card {
        padding: 16px;
    }
}

/* ── 블로그 에디터 모달 ──────────────────────────────────────────────────── */

.blog-editor-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 6, 14, 0.75);
    backdrop-filter: blur(6px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.blog-editor {
    background: #0c0f1e;
    border: 1px solid rgba(192, 132, 252, 0.25);
    border-radius: var(--radius-xl, 20px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(192, 132, 252, 0.06);
    width: 100%;
    max-width: 860px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.blog-editor__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px 14px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}

.blog-editor__heading {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--accent-blog);
    letter-spacing: 0.04em;
}

.blog-editor__close {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    line-height: 1;
    transition: color 0.15s;
}

.blog-editor__close:hover {
    color: var(--text-bright, #fff);
}

.blog-editor__title-input {
    margin: 14px 24px 0;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    border-radius: var(--radius-md, 10px);
    color: var(--text-bright, #f8f3ee);
    font-size: 16px;
    font-weight: 600;
    outline: none;
    transition: border-color 0.15s;
    flex-shrink: 0;
}

.blog-editor__title-input:focus {
    border-color: rgba(192, 132, 252, 0.5);
}

.blog-editor__title-input::placeholder {
    color: var(--muted);
}

.blog-editor__tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 24px 0;
    flex-shrink: 0;
}

.blog-editor__tab-bar {
    display: flex;
    gap: 4px;
    padding: 12px 24px 0;
    flex-shrink: 0;
}

.blog-editor__tab {
    padding: 5px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.blog-editor__tab.is-active {
    border-color: rgba(192, 132, 252, 0.55);
    background: rgba(192, 132, 252, 0.12);
    color: var(--accent-blog);
}

.blog-editor__textarea {
    flex: 1;
    margin: 10px 24px 0;
    padding: 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--line);
    border-radius: var(--radius-md, 10px);
    color: var(--text-bright, #f8f3ee);
    font-size: 14px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    line-height: 1.75;
    resize: none;
    outline: none;
    min-height: 320px;
    transition: border-color 0.15s;
}

.blog-editor__textarea:focus {
    border-color: rgba(192, 132, 252, 0.4);
}

.blog-editor__preview {
    flex: 1;
    margin: 10px 24px 0;
    padding: 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--line);
    border-radius: var(--radius-md, 10px);
    overflow-y: auto;
    min-height: 320px;
}

.blog-editor__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 24px 18px;
    border-top: 1px solid var(--line);
    flex-shrink: 0;
    margin-top: 12px;
}

.blog-editor__save-btn {
    border-color: rgba(192, 132, 252, 0.55) !important;
    background: rgba(192, 132, 252, 0.15) !important;
    color: var(--accent-blog) !important;
}

.blog-editor__save-btn:hover:not(:disabled) {
    background: rgba(192, 132, 252, 0.25) !important;
}

.blog-editor__save-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .blog-editor-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .blog-editor {
        max-width: 100%;
        max-height: 95vh;
        border-radius: var(--radius-xl, 20px) var(--radius-xl, 20px) 0 0;
    }

    .blog-editor__title-input,
    .blog-editor__tag-row,
    .blog-editor__tab-bar,
    .blog-editor__textarea,
    .blog-editor__preview {
        margin-left: 16px;
        margin-right: 16px;
    }

    .blog-editor__header,
    .blog-editor__footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .blog-new-btn {
        align-self: stretch;
        text-align: center;
    }

    /* 태그/카테고리 필터 가로 스크롤 */
    .blog-categories,
    .blog-category-list {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        gap: 8px;
    }

    .blog-categories > *,
    .blog-category-list > * {
        flex-shrink: 0;
    }
}
