* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
    color: #202124;
    background: #ffffff;
    min-height: 100vh;
    display: flex !important;
    flex-direction: column;
    overflow: auto;
}

/* 데이터 로드 전까지 본문 숨김 — 이전/플레이스홀더 내용이 잠깐 보였다 바뀌는 현상 방지 */
body.archive-init #page-root,
body.archive-loading #page-root {
    visibility: hidden;
    min-height: 60vh;
}

/* 로딩이 글자 애니메이션보다 길어지면 " ..." 표시 */
#loading-overlay .loading-text .archive-loading-dots {
    display: inline-block;
    animation: archive-loading-dots 1.2s ease-in-out infinite;
}
@keyframes archive-loading-dots {
    0%, 20% { opacity: 0.3; }
    50% { opacity: 1; }
    80%, 100% { opacity: 0.3; }
}

.page-shell {
    max-width: 980px;
    margin: 0 auto;
    padding: 48px 20px 80px;
}

.page-hero {
    display: grid;
    gap: 24px;
}

.page-cover {
    width: 100%;
    padding-top: 46%;
    border-radius: 16px;
    background: #f1f3f4;
    background-size: cover;
    background-position: 50% 50%;
}

.page-head {
    display: grid;
    gap: 10px;
}

.page-kicker {
    font-size: 14px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #5f6368;
    margin: 0;
}

.page-title {
    font-size: 40px;
    margin: 0;
    line-height: 1.2;
}

.page-subtitle {
    font-size: 18px;
    color: #5f6368;
    margin: 0;
}

.page-date {
    font-size: 14px;
    color: #9aa0a6;
    margin: 0;
}

.page-content {
    margin-top: 40px;
    display: grid;
    gap: 18px;
    font-size: 16px;
    line-height: 1.7;
}

.page-content h2 {
    font-size: 28px;
    margin: 16px 0 4px;
}

.page-content p {
    margin: 0;
}

.page-content figure {
    margin: 12px 0;
}

.page-content figure img {
    width: 100%;
    border-radius: 12px;
    display: block;
}

.page-content figcaption {
    margin-top: 6px;
    font-size: 13px;
    color: #5f6368;
}

.page-content blockquote {
    margin: 10px 0;
    padding: 12px 16px;
    background: #f8f9fa;
    border-left: 3px solid #202124;
}

.page-content hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 8px 0;
}

.page-root {
    flex: 1 0 auto;
    padding-top: 84px;
}

#act_footer {
    margin-top: auto;
}

/* style.css .article_section(80px 상단) / 미디어쿼리(80px 48px 0)보다 우선 */
.article_section.archive-layout-v1,
.archive-layout-v1 {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0 20px 70px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, var(--right-col, 810px));
    grid-template-rows: 0 1fr;
    column-gap: 48px;
    row-gap: 0;
    --right-scale: clamp(0.5, calc(var(--right-col, 810px) / 810), 1);
}

.archive-layout-v1 .post_share,
.archive-layout-v1 .post_content,
.archive-layout-v1 .post_aside {
    float: none;
    width: auto;
    min-width: 0; /* 그리드 칸 안에서 줄어들 수 있게 (본문 오버플로우 방지) */
    position: static;
    margin: 0;
    padding: 0;
}

.archive-layout-v1 .post_content {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    justify-content: stretch;
    width: 100%;
    max-width: 800px;
    min-width: 0;
    margin: 0;
    position: relative;
}

.archive-layout-v1 .post_content .editor {
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
    max-width: 100%;
}

.archive-layout-v1 .post_content .codex-editor__redactor {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    position: relative;
    gap: 0 !important;
}

/* style.css의 vw 기반 간격 덮어쓰기 — 화면 크기와 관계없이 동일한 간격 유지 */
.archive-layout-v1 .post_content .editor .contt > div {
    margin-top: 16px !important;
}
/* 이미지/버튼 블록은 위 여백 없음 */
.archive-layout-v1 .post_content .editor .contt > div:has(.image-tool),
.archive-layout-v1 .post_content .editor .contt > div:has(.editor-button) {
    margin-top: 0 !important;
}
.archive-layout-v1 .post_content .editor .contt div img {
    margin-bottom: 12px !important;
}
/* 이미지 블록 내부 img 여백 제거 — 마진 0으로 맞춰도 간격 남는 현상 방지 */
.archive-layout-v1 .post_content .ce-block.is-image-block img,
.archive-layout-v1 .post_content .ce-block.is-image-block .image-tool__image-picture {
    margin: 0 !important;
    display: block !important;
    vertical-align: top;
}
.archive-layout-v1 .post_content .ce-block.is-image-block .image-tool__image {
    display: block !important;
    line-height: 0;
}
.archive-layout-v1 .post_content .ce-block.is-image-block {
    line-height: 0;
}
.archive-layout-v1 .post_content .codex-editor__redactor > .ce-block {
    margin-top: 12px;
    margin-bottom: 12px;
}
.archive-layout-v1 .post_content .codex-editor__redactor > .ce-block.is-image-block,
.archive-layout-v1 .post_content .codex-editor__redactor > .ce-block:has(.image-tool),
.archive-layout-v1 .post_content .codex-editor__redactor > .ce-block.is-button-block,
.archive-layout-v1 .post_content .codex-editor__redactor > .ce-block:has(.editor-button) {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}
.archive-layout-v1 .post_content .codex-editor__redactor > .ce-block:first-child {
    margin-top: 0;
}
.archive-layout-v1 .post_content .codex-editor__redactor > .ce-block:last-child {
    margin-bottom: 0;
}

.archive-layout-v1 .post_content .ce-block,
.archive-layout-v1 .post_content .ce-block__content,
.archive-layout-v1 .post_content .image-tool__image,
.archive-layout-v1 .post_content .editor-button,
.archive-layout-v1 .post_content .editor-button-preview,
.archive-layout-v1 .post_content .editor-button-link {
    max-width: 100% !important;
    box-sizing: border-box;
}


.archive-layout-v1 .post_share {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 13px;
    color: #5f6368;
    width: 220px;
    justify-self: start;
}

.archive-layout-v1 .post_share .post_tit {
    font-size: 18px;
    color: #202124;
    margin: 0;
}

.archive-layout-v1 .post_share .author {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.archive-layout-v1 .post_share .share_list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    display: flex;
    gap: 8px;
}

.archive-layout-v1 .share_btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: #e0e0e0;
    color: #5f6368;
    font-size: 12px;
}

.archive-layout-v1 .post_content .post_tit {
    font-size: 36px;
    margin: 0 0 16px;
}

.archive-layout-v1 .contt {
    display: grid;
    gap: 0;
    font-size: 15px;
    color: #3c4043;
}

.archive-layout-v1 .image-box {
    width: 100%;
    padding-top: 56%;
    background: #dfe3e7;
    border-radius: 8px;
}

.archive-layout-v1 .editor-actions {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 4px;
    width: 100%;
    max-width: 100%;
    margin-bottom: 12px;
}
.archive-layout-v1 .editor-actions .editor-save-btn {
    margin-left: 0;
}

.archive-layout-v1 .editor-save-btn {
    background: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
}

/* 미리보기 모달 */
.archive-preview-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: #fff;
    display: flex;
    flex-direction: column;
}
.archive-preview-overlay .archive-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #dadce0;
    background: #f8f9fa;
    flex-shrink: 0;
}
.archive-preview-overlay .archive-preview-close {
    padding: 6px 14px;
    border: 1px solid #dadce0;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}
.archive-preview-overlay .archive-preview-close:hover {
    background: #f1f3f4;
}
.archive-preview-overlay .archive-preview-iframe {
    flex: 1;
    width: 100%;
    border: none;
}

.archive-layout-v1 .ce-block__content,
.archive-layout-v1 .ce-toolbar__content {
    max-width: 100%;
}

.archive-layout-v1 .ce-block__content {
    width: 100%;
    padding: 0;
}

.archive-layout-v1 .ce-paragraph {
    width: 100%;
    font-size: 15px;
    line-height: 1.7;
    color: #3c4043;
}

.archive-layout-v1 .ce-header {
    width: 100%;
    margin: 16px 0 8px;
}

.archive-layout-v1 .image-tool__image {
    width: 100%;
    max-width: 100%;
}

.archive-layout-v1 .ce-inline-toolbar,
.archive-layout-v1 .ce-conversion-toolbar {
    display: none !important;
}

.page-edit-mode .archive-layout-v1 .ce-inline-toolbar,
.page-edit-mode .archive-layout-v1 .ce-conversion-toolbar {
    display: block !important;
}

/* 인덱스(비수정) 모드: 편집용 점선·테두리·저장버튼 등 절대 노출 안 되게 */
body:not(.page-edit-mode) .archive-layout-v1 .ce-block__content,
body:not(.page-edit-mode) .archive-layout-v1 .ce-block .ce-block__content,
body:not(.page-edit-mode) .archive-layout-v1 .image-tool__image,
body:not(.page-edit-mode) .archive-layout-v1 .ce-block.is-button-block > .ce-block__content,
body:not(.page-edit-mode) .archive-layout-v1 .ce-block:has(.editor-button) > .ce-block__content,
body:not(.page-edit-mode) .archive-layout-v1 .editor-button,
body:not(.page-edit-mode) .archive-layout-v1 .editor-button-preview,
body:not(.page-edit-mode) .archive-layout-v1 .editor-button-link,
body:not(.page-edit-mode) .archive-layout-v1 #page-title {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}
body:not(.page-edit-mode) .archive-layout-v1 .editor-actions,
body:not(.page-edit-mode) .archive-layout-v1 .button-resize-handle,
body:not(.page-edit-mode) .archive-layout-v1 .editor-empty-hint {
    display: none !important;
}

.archive-layout-v1 .image-tool__caption {
    display: none !important;
}

/* 이미지·버튼 블록 사이 간격 없음 — 딱 붙게 */
.archive-layout-v1 .ce-block.is-image-block,
.archive-layout-v1 .ce-block:has(.image-tool),
.archive-layout-v1 .ce-block.is-button-block,
.archive-layout-v1 .ce-block:has(.editor-button) {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}
.archive-layout-v1 .post_content .codex-editor__redactor > .ce-block.is-image-block:first-child,
.archive-layout-v1 .post_content .codex-editor__redactor > .ce-block:has(.image-tool):first-child {
    margin-top: 0 !important;
}
.archive-layout-v1 .post_content .codex-editor__redactor > .ce-block.is-image-block:last-child,
.archive-layout-v1 .post_content .codex-editor__redactor > .ce-block:has(.image-tool):last-child {
    margin-bottom: 0 !important;
}
.archive-layout-v1 .post_content .codex-editor__redactor > .ce-block.is-image-block {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}
.archive-layout-v1 .post_content .codex-editor__redactor > .ce-block:has(.image-tool) {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.archive-layout-v1 .ce-block.is-image-block + .ce-block.is-image-block,
.archive-layout-v1 .ce-block.is-image-block + .ce-block:has(.image-tool),
.archive-layout-v1 .ce-block:has(.image-tool) + .ce-block.is-image-block,
.archive-layout-v1 .ce-block:has(.image-tool) + .ce-block:has(.image-tool),
.archive-layout-v1 .ce-block.is-image-block + .ce-block:has(.editor-button),
.archive-layout-v1 .ce-block:has(.image-tool) + .ce-block:has(.editor-button),
.archive-layout-v1 .ce-block:has(.editor-button) + .ce-block.is-image-block,
.archive-layout-v1 .ce-block:has(.editor-button) + .ce-block:has(.image-tool),
.archive-layout-v1 .ce-block:has(.editor-button) + .ce-block:has(.editor-button) {
    margin-top: 0 !important;
}

.archive-layout-v1 .ce-block.is-image-block .ce-block__content {
    margin: 0 !important;
    padding: 0 !important;
}

/* 저장된 height 인라인 때문에 생기는 빈 여백 제거 — 블록/래퍼는 콘텐츠 높이만 */
.archive-layout-v1 .post_content .ce-block.is-image-block,
.archive-layout-v1 .post_content .ce-block:has(.image-tool) {
    height: auto !important;
    min-height: 0 !important;
}
.archive-layout-v1 .post_content .ce-block.is-image-block .image-tool__image,
.archive-layout-v1 .post_content .ce-block:has(.image-tool) .image-tool__image {
    height: auto !important;
    min-height: 0 !important;
}

/* 보기 모드: 이미지 컨테이너 잘림 방지 (edit에서는 .page-edit-mode가 overflow:hidden 사용) */
body:not(.page-edit-mode) .archive-layout-v1 .image-tool__image,
body:not(.page-edit-mode) .archive-layout-v1 .image-tool__image-picture {
    overflow: visible !important;
    height: auto !important;
    min-height: 0 !important;
}
/* 보기 모드: style.css의 .post_content .editor>.contt div img { max-height: 1000px/600px } 해제 — 세로 긴 이미지가 비율 줄어든 것 방지 */
body:not(.page-edit-mode) .archive-layout-v1 .post_content .editor .contt div img,
body:not(.page-edit-mode) .archive-layout-v1 .post_content img,
body:not(.page-edit-mode) .archive-layout-v1 .image-tool__image img,
body:not(.page-edit-mode) .archive-layout-v1 .image-tool__image-picture img {
    max-height: none !important;
}
/* 데스크톱 보기 모드: img 크기 규칙 없음 → 인라인 style(800px 등) 그대로 사용, admin과 동일 */

/* 이미지 블록 내부 img 여백 제거 — .contt div img의 margin-bottom이 블록 사이 간격을 만듦 */
.archive-layout-v1 .post_content .ce-block.is-image-block img,
.archive-layout-v1 .post_content .ce-block.is-image-block .image-tool__image,
.archive-layout-v1 .post_content .ce-block.is-image-block .image-tool__image-picture {
    margin: 0 !important;
    display: block;
    vertical-align: bottom;
}

.page-edit-mode .image-tool__image {
    display: inline-block;
    resize: both;
    overflow: hidden;
    outline: 1px dashed #c4c7cc;
    padding: 0;
    min-width: 120px;
    min-height: 80px;
    max-width: 100%;
    box-sizing: border-box;
}

.page-edit-mode .image-tool__image-picture {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: contain;
}

.page-edit-mode .image-tool {
    max-width: 100%;
}

.page-edit-mode .ce-paragraph,
.page-edit-mode .ce-header {
    resize: none;
    overflow: auto;
    min-height: 40px;
    max-width: 100% !important;
    box-sizing: border-box;
    width: 100%;
    margin: 0;
}

.page-edit-mode #page-title {
    border: 1px dashed #c4c7cc;
    border-radius: 6px;
    padding: 6px 8px;
    min-height: 44px;
    cursor: text;
    box-sizing: border-box;
    position: relative;
    z-index: 3;
}

.page-edit-mode #page-title.is-dragging {
    cursor: grabbing;
    user-select: none;
}

.page-edit-mode #editorjs {
    position: relative;
    z-index: 1;
}

.page-edit-mode .ce-block {
    cursor: grab;
    resize: both;
    overflow: auto;
    max-width: 100% !important;
    position: relative;
}

.page-edit-mode .ce-block.is-dragging {
    position: absolute !important;
    left: auto;
    top: auto;
    z-index: 2;
}

.page-edit-mode .ce-block.is-dragging {
    cursor: grabbing;
}

.page-edit-mode .ce-block.is-image-block {
    resize: none !important;
    overflow: visible;
    cursor: default;
    margin: 0 !important;
}

.page-edit-mode .is-selected {
    outline: none;
    box-shadow: 0 0 0 2px #1a73e8;
}

.page-edit-mode .ce-block.is-image-block + .ce-block.is-image-block {
    margin-top: 0 !important;
}

.page-edit-mode .image-tool {
    margin: 0 !important;
}

.page-edit-mode .ce-block.is-button-block {
    resize: none !important;
    overflow: hidden;
    cursor: grab;
}

.page-edit-mode .ce-block.is-image-block .ce-block__content {
    border: none;
    padding: 0;
    overflow: visible;
    resize: none !important;
    width: auto;
    height: auto;
}

.page-edit-mode .ce-block.is-button-block {
    display: inline-flex !important;
    align-items: flex-start;
    flex: 0 0 auto !important;
    width: auto !important;
    height: auto;
    max-width: none !important;
    min-width: 0 !important;
    resize: none !important;
    align-self: flex-start;
}

.page-edit-mode .ce-block.is-button-block > .ce-block__content {
    display: inline-block !important;
    width: auto;
    height: auto;
    max-width: none;
    min-width: 0 !important;
    padding: 0;
    border: 1px dashed #c4c7cc;
    border-radius: 6px;
    box-sizing: border-box;
    resize: none !important;
    overflow: hidden;
    min-width: 40px;
    min-height: 24px;
}

.page-edit-mode .ce-block.is-button-block .editor-button {
    display: inline-flex !important;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.page-edit-mode .ce-block.is-button-block .editor-button-preview,
.page-edit-mode .ce-block.is-button-block .editor-button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: #202124;
    color: #fff;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 60px;
    min-height: 32px;
    resize: none;
    overflow: hidden;
    white-space: normal;
}

.page-edit-mode .ce-block.is-button-block,
.page-edit-mode .ce-block.is-button-block > .ce-block__content,
.page-edit-mode .ce-block.is-button-block .editor-button {
    max-width: 100%;
}

.page-edit-mode .ce-block.is-button-block .button-resize-handle {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 14px;
    height: 14px;
    border-radius: 2px;
    border: 1px solid #9aa0a6;
    background: rgba(196, 199, 204, 0.9);
    cursor: nwse-resize;
    z-index: 2;
    pointer-events: auto;
}

/* 버튼 블록 선택 시 리사이즈 핸들이 잘리지 않도록 (모바일 overflow 규칙 예외) */
.page-edit-mode .ce-block.is-button-block > .ce-block__content {
    overflow: visible !important;
}

.page-edit-mode .ce-paragraph:focus,
.page-edit-mode .ce-header:focus {
    border-color: #1a73e8;
}

.page-edit-mode .ce-block__content,
.page-edit-mode .codex-editor__redactor {
    max-width: 100%;
}

.page-edit-mode .ce-block__content {
    border: 1px dashed #c4c7cc;
    border-radius: 6px;
    padding: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.page-edit-mode .editor-empty-hint {
    position: absolute;
    left: 12px;
    top: 120px;
    font-size: 13px;
    color: #9aa0a6;
    pointer-events: auto;
    cursor: text;
    user-select: none;
}

.page-edit-mode .editor-empty-hint.is-hidden {
    display: none;
}

.page-edit-mode .ce-block.is-title-block .ce-block__content {
    border: 1px dashed #c4c7cc;
    border-radius: 8px;
    padding: 6px 8px;
}

.page-edit-mode .ce-block.is-title-block .ce-header {
    font-size: 36px;
    margin: 0;
    line-height: 1.2;
    color: #202124;
}

.page-edit-mode .ce-block {
    max-width: 100%;
}

.page-edit-mode .ce-block__content {
    width: 100%;
    max-width: 100% !important;
    overflow-x: hidden;
    overflow-y: visible;
    resize: both;
    overflow: auto;
}

.page-edit-mode .ce-block.is-button-block > .ce-block__content {
    width: auto;
    height: auto;
    max-width: none !important;
    overflow: hidden;
    resize: none !important;
}

.page-edit-mode .codex-editor__redactor {
    overflow: visible;
}

.page-edit-mode .editor {
    overflow: visible;
}

.page-edit-mode .archive-layout-v1 .editor,
.page-edit-mode .archive-layout-v1 #editorjs {
    overflow: visible;
}

.page-edit-mode .archive-layout-v1 .codex-editor__redactor {
    overflow: hidden;
}

.text-box-menu {
    position: fixed;
    z-index: 2600;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
    display: none;
    min-width: 220px;
    width: 260px;
}

.text-box-menu.is-open {
    display: block;
}

.text-box-menu__title {
    font-size: 12px;
    font-weight: 600;
    color: #202124;
    margin-bottom: 8px;
}

.text-box-menu__box {
    position: relative;
    border-radius: 8px;
    padding: 18px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.text-box-menu__box--margin {
    background: #fbe7c6;
}

.text-box-menu__box--border {
    background: #f8d5c0;
    width: 100%;
}

.text-box-menu__box--padding {
    background: #d7f0d2;
    width: 100%;
}

.text-box-menu__box--content {
    background: #cfe2ff;
    width: 100%;
    min-height: 42px;
    display: grid;
    place-items: center;
}

.text-box-menu__label {
    position: absolute;
    top: 6px;
    left: 8px;
    font-size: 10px;
    color: #5f6368;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.text-box-menu__input {
    position: absolute;
    width: 44px;
    height: 22px;
    border: 1px solid #c4c7cc;
    border-radius: 4px;
    font-size: 11px;
    text-align: center;
    padding: 0;
    background: #fff;
}

.text-box-menu__input--top {
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
}

.text-box-menu__input--right {
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
}

.text-box-menu__input--bottom {
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

.text-box-menu__input--left {
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
}

.text-box-menu__content {
    font-size: 12px;
    color: #202124;
}

.text-box-menu__hint {
    margin-top: 8px;
    font-size: 11px;
    color: #5f6368;
}
.page-edit-mode .ce-block__content a {
    text-decoration: none;
}

.page-edit-mode .ce-block__content a:hover {
    text-decoration: underline;
}
.page-edit-mode .ce-block__content > .ce-paragraph,
.page-edit-mode .ce-block__content > .ce-header {
    max-width: 100% !important;
}

.ce-font-controls {
    padding: 10px 12px;
    border-bottom: 1px solid #e0e0e0;
    background: #fff;
    pointer-events: auto;
    position: relative;
    z-index: 2;
}

.ce-font-panel {
    display: grid;
    gap: 10px;
}

.ce-font-title {
    font-size: 12px;
    font-weight: 600;
    color: #202124;
}

.page-edit-mode .ce-inline-toolbar {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    padding: 10px;
    max-width: 320px;
}

.page-edit-mode .ce-inline-toolbar__dropdown,
.page-edit-mode .ce-inline-toolbar__buttons,
.page-edit-mode .ce-inline-toolbar__actions {
    border-radius: 10px;
}

.page-edit-mode .ce-inline-toolbar__buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 8px;
    background: #f8f9fa;
}

.page-edit-mode .ce-inline-tool {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.page-edit-mode .ce-conversion-toolbar {
    margin-top: 8px;
    padding: 10px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
}

.page-edit-mode .ce-conversion-toolbar__label {
    font-size: 12px;
    color: #5f6368;
    margin-bottom: 8px;
}

.page-edit-mode .ce-conversion-toolbar__tools {
    display: grid;
    gap: 6px;
}

.page-edit-mode .ce-conversion-tool {
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    background: #fff;
    padding: 6px 8px;
}

.ce-font-row {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.ce-font-row--full {
    grid-template-columns: 1fr;
    margin-bottom: 0;
}

.ce-font-row:last-child {
    margin-bottom: 0;
}

.ce-font-label {
    font-size: 12px;
    color: #5f6368;
}

.ce-font-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.ce-font-grid--align {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ce-font-field-wrap {
    display: grid;
    gap: 6px;
}

.ce-font-input {
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
}

.ce-font-field {
    width: 100%;
    font-size: 12px;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #dadce0;
    background: #fff;
}

.ce-font-btn {
    height: 30px;
    border-radius: 6px;
    border: 1px solid #dadce0;
    background: #fff;
    font-size: 12px;
    cursor: pointer;
}

.ce-font-color-row {
    display: grid;
    grid-template-columns: 32px 1fr 52px;
    gap: 8px;
    align-items: center;
}

.ce-font-field--hex {
    padding-right: 8px;
}

.ce-font-field--opacity {
    padding-right: 8px;
    text-align: right;
}

.ce-font-color {
    width: 100%;
    height: 30px;
    padding: 0;
    border-radius: 6px;
    border: 1px solid #dadce0;
    background: #fff;
}

.archive-layout-v1 .ce-delimiter {
    margin: 12px 0;
}

.archive-layout-v1 .editor-quote {
    border-left: 3px solid #202124;
    padding: 12px 16px;
    background: #f8f9fa;
}

.archive-layout-v1 .editor-quote-text {
    width: 100%;
    border: 1px solid #dadce0;
    border-radius: 6px;
    padding: 8px 10px;
    min-height: 90px;
    resize: vertical;
}

.archive-layout-v1 .editor-quote-caption {
    width: 100%;
    border: 1px solid #dadce0;
    border-radius: 6px;
    padding: 6px 10px;
    margin-top: 8px;
}

.archive-layout-v1 .editor-button {
    display: inline-flex;
}

.archive-layout-v1 .editor-button-preview,
.archive-layout-v1 .editor-button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 999px;
    background: #202124;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    width: fit-content;
}

.archive-layout-v1 .editor-button input,
.archive-layout-v1 .editor-button textarea {
    display: none !important;
}

.archive-layout-v1 .editor-link-card {
    display: grid;
    gap: 8px;
}

.archive-layout-v1 .editor-link-title,
.archive-layout-v1 .editor-link-url,
.archive-layout-v1 .editor-link-image,
.archive-layout-v1 .editor-link-desc {
    border: 1px solid #dadce0;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 13px;
}

.archive-layout-v1 .editor-link-desc {
    min-height: 80px;
    resize: vertical;
}

.archive-layout-v1 .editor-link-card-inner {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    background: #fff;
}

.archive-layout-v1 .editor-link-media {
    width: 120px;
    height: 80px;
    background: #e8eaed;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
}

.archive-layout-v1 .editor-link-body strong {
    display: block;
    font-size: 14px;
    margin-bottom: 6px;
}

.archive-layout-v1 .editor-link-body p {
    margin: 0 0 6px;
    font-size: 12.5px;
    color: #5f6368;
}

.archive-layout-v1 .editor-link-body span {
    font-size: 12px;
    color: #1a73e8;
}

.layout-canvas {
    border: 1px solid #dadce0;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.layout-canvas-toolbar {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.layout-canvas-btn {
    border: 1px solid #dadce0;
    background: #fff;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
}

.layout-canvas-area {
    position: relative;
    min-height: 320px;
    background: #fff;
}

.layout-canvas-item {
    position: absolute;
    border: 1px solid transparent;
    box-sizing: border-box;
}

.layout-canvas-item.is-selected {
    border-color: #1a73e8;
    box-shadow: 0 0 0 1px rgba(26, 115, 232, 0.2);
}

.layout-canvas-item.item-text {
    padding: 8px 10px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 14px;
    color: #202124;
}

.layout-canvas-item.item-image {
    background: #e8eaed;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
}

.layout-canvas-item.item-button button {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 999px;
    background: #202124;
    color: #fff;
    cursor: pointer;
}


/* 영상(embed) 블록 — 이미지처럼 딱 영상만 감싸는 영역, 실제 16:9 비율 유지 */
.archive-layout-v1 .ce-block:has(.embed-tool),
.archive-layout-v1 .ce-block:has(.embed-tool) .ce-block__content {
    margin: 0 !important;
    padding: 0 !important;
}
.archive-layout-v1 .post_content .codex-editor__redactor > .ce-block:has(.embed-tool) {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}
/* embed-tool = 16:9 비율 상자 (높이 확실히 있게 해서 iframe이 보이도록) */
.archive-layout-v1 .embed-tool {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 200px;
    overflow: hidden;
    border-radius: 8px;
}
/* Embed 툴: iframe에 embed-tool__content 클래스가 붙음 → 상자 안에 꽉 채움 */
.archive-layout-v1 .embed-tool .embed-tool__content {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 1;
}
/* 구조가 다를 수 있으므로 iframe 직접 지정 */
.archive-layout-v1 .embed-tool iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
    display: block !important;
}
/* 편집 모드(edit=1)에서만: 영상 클릭 시 재생·링크 이동 안 됨. 더블클릭/우클릭으로만 설정 모달 */
body.page-edit-mode .archive-layout-v1 .embed-tool iframe,
body.page-edit-mode .archive-layout-v1 .embed-tool .embed-tool__content,
body.page-edit-mode .archive-layout-v1 .embed-tool--link,
body.page-edit-mode .archive-layout-v1 .ce-block:has(.embed-tool) .embed-tool iframe,
body.page-edit-mode .archive-layout-v1 .ce-block:has(.embed-tool) .embed-tool__content,
body.page-edit-mode .archive-layout-v1 .ce-block:has(.embed-tool) a.embed-tool--link {
    pointer-events: none !important;
}
body.page-edit-mode .archive-layout-v1 .ce-block:has(.embed-tool) .ce-block__content,
body.page-edit-mode .archive-layout-v1 .ce-block:has(.embed-tool) {
    cursor: pointer;
}
/* 미리보기·일반 보기 모드: 영상 재생·유튜브 링크 클릭 가능 */
body:not(.page-edit-mode) .archive-layout-v1 .embed-tool iframe,
body:not(.page-edit-mode) .archive-layout-v1 .embed-tool .embed-tool__content,
body:not(.page-edit-mode) .archive-layout-v1 .embed-tool--link {
    pointer-events: auto !important;
}
/* embed-tool--loading일 때 프리로더는 숨기고 콘텐츠만 보이게 (로딩 후에도 흰화면 방지) */
.archive-layout-v1 .embed-tool--loading .embed-tool__preloader {
    display: none !important;
}
.archive-layout-v1 .embed-tool--loading .embed-tool__content {
    display: block !important;
}
/* embed 캡션 완전 제거 — 모든 문맥에서 적용 */
.archive-layout-v1 .embed-tool__caption,
.archive-layout-v1 .embed-tool .embed-tool__caption,
.archive-layout-v1 .embed-tool .cdx-input.embed-tool__caption,
.embed-tool__caption,
.embed-tool .embed-tool__caption,
.cdx-input.embed-tool__caption,
[data-placeholder="Enter a caption"].embed-tool__caption,
#editorjs .embed-tool__caption,
.post_content .embed-tool__caption,
.codex-editor .embed-tool__caption {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    width: 0 !important;
}
.archive-layout-v1 .ce-block:has(.embed-tool) .ce-block__content {
    padding: 0 !important;
    overflow: visible;
}

/* 영상 설정: 유튜브에서 열기(링크) 모드 — 썸네일+링크로 표시 */
.archive-layout-v1 .embed-tool--link {
    display: block !important;
    min-height: 0;
    margin: 12px 0;
}
.archive-layout-v1 .embed-tool--link img {
    width: 100%;
    height: auto;
    display: block;
    vertical-align: top;
}

/* 영상 설정 모달 */
body.embed-settings-open { overflow: hidden; }
.embed-settings-overlay .embed-settings-modal { animation: embed-modal-in 0.2s ease; }
@keyframes embed-modal-in {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

/* 로컬 영상 블록 */
.archive-layout-v1 .local-video-tool { margin: 12px 0; }
.archive-layout-v1 .local-video-tool video { border-radius: 8px; }
.archive-layout-v1 .local-video-tool__empty { color: #5f6368; }

.archive-layout-v1 .tc-table {
    border: 1px solid #dadce0;
}

.archive-layout-v1 .tc-row {
    border-bottom: 1px solid #dadce0;
}

.archive-layout-v1 .tc-cell {
    padding: 8px 10px;
}

.archive-layout-v1 .cdx-warning {
    border: 1px solid #dadce0;
    border-radius: 10px;
    padding: 12px 14px;
}

.archive-layout-v1 .post_aside {
    grid-column: 2;
    grid-row: 1 / -1;
    align-self: start;
    margin-top: 36px;
    margin-left: 50px;
    width: 100%;
    max-width: 810px;
    min-width: 262px;
    justify-self: end;
}
/* 편집 시 오른쪽 칼럼 (썸네일 100px 고정, card_text 가로만 넓게) */
.page-edit-mode .archive-layout-v1 .post_aside {
    max-width: 830px;
}

/* 헤더·카드목록·추가버튼이 같은 가로 길이(묶음 너비)를 쓰도록 */
.archive-layout-v1 .post_aside .relate_group {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    /* 카드 목록과 동일한 최소 너비(썸네일100+간격12+텍스트최소150=262) 확보 */
    min-width: 262px;
}
.archive-layout-v1 .post_aside .relate_group_header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    min-width: 100%;
    box-sizing: border-box;
}
.archive-layout-v1 .post_aside .relate_group_header h2 {
    flex: 1;
    min-width: 0;
}
.archive-layout-v1 .post_aside .aside-add-btn {
    width: 100%;
    min-width: 100%;
    margin-top: 16px !important;
    box-sizing: border-box;
}
.archive-layout-v1 .post_aside h2 {
    font-size: 14px;
    margin: 0 0 10px;
}

.archive-layout-v1 .post_aside .card_list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.archive-layout-v1 .card_list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

/* 보그 참고: 이미지 왼쪽·텍스트 오른쪽, 이미지 높이 = 텍스트 영역 높이(세로 동일) */
.archive-layout-v1 .card_item {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 12px;
    align-items: stretch;
    margin-bottom: 16px;
}
.archive-layout-v1 .post_aside .card_list .card_item:last-child {
    margin-bottom: 16px;
}
.archive-layout-v1 .post_aside .card_item .thumb-box {
    width: 100px;
    min-width: 100px;
    height: 100px;
    min-height: 100px;
    border-radius: 6px;
    background-color: #e8eaed;
    background-size: cover;
    background-position: center;
}
.archive-layout-v1 .post_aside .card_item .card_text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    /* 텍스트 영역이 정사각형처럼 보이지 않도록 가로 최소 1.5배(썸네일 높이 100px 기준 150px) 확보 */
    min-width: 150px;
}
.archive-layout-v1 .post_aside .card_item .card_text .category {
    font-size: 11px;
    color: #666;
    margin: 0 0 4px;
}
.archive-layout-v1 .post_aside .relate_group .card_text h3 {
    font-size: 12px !important;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 4px;
    color: #1a1a1a;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
/* 더블클릭 편집 시에도 크기 유지. 변수 있으면 그대로, 없으면 12px(인스펙터 크기 조절 반영) */
.page-edit-mode .archive-layout-v1 .post_aside .card_text h3[contenteditable="true"],
.page-edit-mode .archive-layout-v1 .post_aside .card_text h3:focus {
    font-size: var(--inspector-font-size, 12px) !important;
}
.page-edit-mode .archive-layout-v1 .post_aside .card_text .category[contenteditable="true"],
.page-edit-mode .archive-layout-v1 .post_aside .card_text .category:focus {
    font-size: var(--inspector-font-size, 11px) !important;
}
.page-edit-mode .archive-layout-v1 .post_aside .card_text .date[contenteditable="true"],
.page-edit-mode .archive-layout-v1 .post_aside .card_text .date:focus {
    font-size: var(--inspector-font-size, 10px) !important;
}
.archive-layout-v1 .post_aside .card_item .card_text .date {
    font-size: 10px;
    color: #9aa0a6;
    margin: 0;
}

/* 보기 모드: 링크 영역도 같은 그리드, 텍스트 높이 = 이미지 높이 */
.archive-layout-v1 .post_aside .card_item > a.card_item_link {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 12px;
    align-items: stretch;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}
.archive-layout-v1 .post_aside .card_item > a.card_item_link .thumb-box {
    width: 100px;
    min-width: 100px;
    height: 100px;
    min-height: 100px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
}
.archive-layout-v1 .post_aside .card_item > a.card_item_link .card_text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    /* 미리보기/보기 모드에서도 편집 모드와 동일하게 텍스트 영역 폭 확보 */
    min-width: 150px;
}
.archive-layout-v1 .post_aside .card_item > a.card_item_link:hover .card_text h3 {
    text-decoration: underline;
    text-underline-offset: 3px;
}
.archive-layout-v1 .post_aside .card_item > a.card_item_link:hover .card_text .category,
.archive-layout-v1 .post_aside .card_item > a.card_item_link:hover .card_text .date {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.page-edit-mode .archive-layout-v1 .post_aside .card_item {
    position: relative;
    padding-top: 28px;
}

.page-edit-mode .archive-layout-v1 .post_aside .aside-card-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 2;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    font-size: 20px;
    line-height: 1;
    color: #d93025;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-edit-mode .archive-layout-v1 .post_aside .aside-card-delete:hover {
    background: #fce8e6;
}

/* 함께 살펴볼 콘텐츠 — 썸네일 클릭 시 페이지 선택 모달 */
.aside-card-picker {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.aside-card-picker__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}
.aside-card-picker__modal {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    max-width: 420px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.aside-card-picker__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}
.aside-card-picker__header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}
.aside-card-picker__close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 24px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    border-radius: 4px;
}
.aside-card-picker__close:hover {
    background: #f0f0f0;
    color: #333;
}
.aside-card-picker__list {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.aside-card-picker__item {
    display: block;
    width: 100%;
    padding: 12px 14px;
    text-align: left;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.aside-card-picker__item:hover {
    background: #f5f5f5;
    border-color: #ccc;
}
.aside-card-picker__section {
    font-weight: 600;
    font-size: 14px;
}
.aside-card-picker__back {
    display: block;
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 8px;
    text-align: left;
    border: 1px dashed #ccc;
    border-radius: 8px;
    background: #f8f9fa;
    font-size: 13px;
    color: #5f6368;
    cursor: pointer;
}
.aside-card-picker__back:hover {
    background: #e8eaed;
    color: #202124;
}
.aside-card-picker__loading {
    margin: 0;
    font-size: 14px;
    color: #666;
}
.aside-card-picker__hint {
    padding: 12px 20px 16px;
    margin: 0;
    font-size: 12px;
    color: #666;
    border-top: 1px solid #f0f0f0;
}
.aside-card-picker__error,
.aside-card-picker__empty {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.archive-layout-v1 .thumb-box {
    width: 52px;
    height: 52px;
    background: #dfe3e7;
    border-radius: 4px;
}
.page-edit-mode .archive-layout-v1 .post_aside .thumb-box {
    cursor: pointer;
}
.page-edit-mode .archive-layout-v1 .post_aside .thumb-box:hover {
    outline: 2px solid rgba(26, 115, 232, 0.5);
    outline-offset: 2px;
}

.archive-layout-v1 .card_text .category {
    font-size: 11px;
    margin: 0 0 2px;
    color: #5f6368;
}

.archive-layout-v1 .card_text h3 {
    font-size: clamp(9px, calc(12px * var(--right-scale)), 12px);
    margin: 2px 0;
    line-height: 1.35;
}
/* style.css의 .article_section .relate_group h3 덮기 */
.archive-layout-v1 .post_aside .relate_group .card_text h3 {
    font-size: 12px !important;
}

.archive-layout-v1 .card_text .date {
    font-size: clamp(8px, calc(10px * var(--right-scale)), 10px);
    color: #9aa0a6;
    margin: 0;
}

/* 인스펙터에서 오른쪽 칼럼 텍스트 크기/행간/자간 조절 시 CSS 변수로 우선 적용 */
.archive-layout-v1 .post_aside .card_text .category.inspector-sized,
.archive-layout-v1 .post_aside .card_text h3.inspector-sized,
.archive-layout-v1 .post_aside .card_text .date.inspector-sized {
    font-size: var(--inspector-font-size, 1em) !important;
    line-height: var(--inspector-line-height, normal) !important;
    letter-spacing: var(--inspector-letter-spacing, normal) !important;
}
/* aside 카드 h3는 기본 12px 유지(1em 시 16px로 커지는 것 방지) */
.archive-layout-v1 .post_aside .card_text h3.inspector-sized {
    font-size: var(--inspector-font-size, 12px) !important;
}

/* 1280px 이하: 단일 칼럼만 — 왼쪽 본문만 꽉 차게, 오른쪽 칼럼(함께 살펴볼 콘텐츠) 숨김 */
@media (max-width: 1280px) {
    .article_section.archive-layout-v1,
    .archive-layout-v1 {
        grid-template-columns: 1fr;
        grid-template-rows: 0 1fr;
        padding: 20px 20px 32px;
        max-width: 100%;
        width: 100%;
        min-width: 0;
        min-height: 0;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    .archive-layout-v1 .post_share {
        display: none;
    }
    .archive-layout-v1 .post_content {
        grid-column: 1;
        grid-row: 1 / -1;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    /* 오른쪽 칼럼 폭 제거 — 본문·에디터·이미지가 화면 폭에 맞게 */
    .archive-layout-v1 .post_content .editor,
    .archive-layout-v1 .post_content .contt,
    .archive-layout-v1 #editorjs,
    .archive-layout-v1 .codex-editor__redactor,
    .archive-layout-v1 .ce-block,
    .archive-layout-v1 .ce-block__content,
    .archive-layout-v1 .image-tool,
    .archive-layout-v1 .image-tool__image,
    .archive-layout-v1 .image-tool__image-picture {
        max-width: 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }
    .archive-layout-v1 .post_content img,
    .archive-layout-v1 .image-tool__image img,
    .archive-layout-v1 .image-tool__image-picture img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
    }
    .archive-layout-v1 .ce-block.is-button-block .editor-button-link,
    .archive-layout-v1 .ce-block.is-button-block .editor-button-preview,
    .archive-layout-v1 .editor-button-link,
    .archive-layout-v1 .editor-button-preview {
        max-width: 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }
    .archive-layout-v1 .post_aside {
        display: none !important;
        visibility: hidden !important;
        position: absolute !important;
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
        overflow: hidden !important;
        padding: 0 !important;
        margin: 0 !important;
    }
}

/* 모바일: 보그 스타일 단일 컬럼 — 좌우 패딩 대칭, 본문/이미지가 화면 폭에 맞게 (잘림·오른쪽 쏠림 방지) */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
    .page-root {
        overflow-x: hidden;
        padding-top: 60px;
        max-width: 100% !important;
        width: 100% !important;
    }
    .article_section.archive-layout-v1,
    .archive-layout-v1 {
        padding: 20px 20px 32px !important;
        max-width: 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
    .archive-layout-v1 .post_content {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }
    /* 본문·에디터·이미지 전체를 뷰포트 폭에 맞춤 — 고정 폭(800px 등) 제거 */
    .archive-layout-v1 .post_content .editor,
    .archive-layout-v1 .post_content .contt,
    .archive-layout-v1 #editorjs,
    .archive-layout-v1 .codex-editor__redactor,
    .archive-layout-v1 .ce-block,
    .archive-layout-v1 .ce-block__content,
    .archive-layout-v1 .image-tool,
    .archive-layout-v1 .image-tool__image,
    .archive-layout-v1 .image-tool__image-picture {
        max-width: 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }
    /* 편집 모드: 버튼 블록 리사이즈 핸들 잘림 방지 */
    .page-edit-mode .archive-layout-v1 .ce-block.is-button-block > .ce-block__content {
        overflow: visible !important;
    }
    .archive-layout-v1 .image-tool__image,
    .archive-layout-v1 .image-tool__image-picture {
        overflow: visible !important;
        height: auto !important;
    }
    .archive-layout-v1 .post_content img,
    .archive-layout-v1 .image-tool__image img,
    .archive-layout-v1 .image-tool__image-picture img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
    }
    /* 버튼 블록: 인라인 width 800px 등 고정 폭 → 모바일에서 100%로 */
    .archive-layout-v1 .ce-block.is-button-block .editor-button-link,
    .archive-layout-v1 .ce-block.is-button-block .editor-button-preview,
    .archive-layout-v1 .editor-button-link,
    .archive-layout-v1 .editor-button-preview {
        max-width: 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }
    /* 제목: 크고 굵게, 아래 여백 넉넉 */
    .archive-layout-v1 .post_content .post_tit.pc {
        font-size: 28px;
        font-weight: 700;
        line-height: 1.3;
        margin: 0 0 12px;
    }
    .archive-layout-v1 .post_content .codex-editor__redactor {
        padding-bottom: 28px;
        gap: 0 !important;
    }
    /* 본문 텍스트: 읽기 좋은 크기·행간 (gap 0으로 이미지 사이 여백 제거) */
    .archive-layout-v1 .contt {
        gap: 0;
        font-size: 16px;
        line-height: 1.75;
        color: #1a1a1a;
    }
    .archive-layout-v1 .post_content .ce-paragraph {
        font-size: 16px;
        line-height: 1.75;
        margin: 0 0 4px;
    }
    .archive-layout-v1 .post_content .ce-header {
        font-size: 20px;
        font-weight: 600;
        margin: 20px 0 8px;
    }
    /* 블록 간 세로 간격 — 보그처럼 여유 있게 */
    .archive-layout-v1 .post_content .codex-editor__redactor > .ce-block {
        margin-top: 10px !important;
        margin-bottom: 10px !important;
    }
    .archive-layout-v1 .post_content .codex-editor__redactor > .ce-block.is-image-block,
    .archive-layout-v1 .post_content .codex-editor__redactor > .ce-block:has(.image-tool) {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    .archive-layout-v1 .post_content .codex-editor__redactor > .ce-block:first-child {
        margin-top: 0 !important;
    }
    .archive-layout-v1 .post_content .codex-editor__redactor > .ce-block:last-child {
        margin-bottom: 0 !important;
    }
    /* 이미지: 본문 컬럼 폭 안에서만 꽉 차게(풀블리드 아님), 이미지끼리는 간격 없음 — 보그 스타일 유지 */
    .archive-layout-v1 .post_content .editor .contt div img {
        margin-bottom: 0 !important;
    }
    .archive-layout-v1 .post_content .ce-block.is-image-block,
    .archive-layout-v1 .post_content .ce-block:has(.image-tool) {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .archive-layout-v1 .post_content .ce-block.is-image-block .image-tool__image,
    .archive-layout-v1 .post_content .ce-block:has(.image-tool) .image-tool__image {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0;
    }
    .archive-layout-v1 .post_content .ce-block.is-image-block .image-tool__image-picture,
    .archive-layout-v1 .post_content .ce-block.is-image-block img,
    .archive-layout-v1 .post_content .ce-block:has(.image-tool) .image-tool__image-picture,
    .archive-layout-v1 .post_content .ce-block:has(.image-tool) img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-width: 0;
        display: block !important;
    }
    /* 캡션: 편집 모드에서만 모바일 시 표시 (보기/인덱스에서는 숨김) */
    .page-edit-mode .archive-layout-v1 .post_content .image-tool__caption {
        display: block !important;
        font-size: 13px;
        line-height: 1.5;
        color: #666;
        margin-top: 8px;
    }
    /* 추천기사(오른쪽 칼럼): 본문 아래 — 보그 스타일 카드 리스트 */
    .archive-layout-v1 .post_aside {
        padding: 0 20px !important;
        margin-top: 40px !important;
        border-top: 1px solid #eee;
        padding-top: 28px !important;
    }
    .archive-layout-v1 .post_aside .relate_group {
        width: 100%;
        max-width: 100%;
    }
    .archive-layout-v1 .post_aside h2 {
        font-size: 18px;
        font-weight: 700;
        margin: 0 0 20px;
        color: #1a1a1a;
    }
    .archive-layout-v1 .post_aside .card_list {
        gap: 20px;
        list-style: none;
        padding: 0;
        margin: 0;
    }
    .archive-layout-v1 .post_aside .card_item {
        grid-template-columns: 120px 1fr;
        gap: 14px;
    }
    .archive-layout-v1 .post_aside .card_item > a.card_item_link {
        grid-template-columns: 120px 1fr;
        gap: 14px;
    }
    .archive-layout-v1 .post_aside .thumb-box {
        width: 120px;
        min-width: 120px;
        height: 120px;
        min-height: 120px;
        border-radius: 6px;
    }
    .archive-layout-v1 .post_aside .card_item > a.card_item_link .thumb-box {
        width: 120px;
        min-width: 120px;
        height: 120px;
        min-height: 120px;
    }
    .archive-layout-v1 .post_aside .relate_group .card_text h3 {
        font-size: 14px !important;
        -webkit-line-clamp: 3;
    }
    .archive-layout-v1 .post_aside .card_text .category.inspector-sized,
    .archive-layout-v1 .post_aside .card_text h3.inspector-sized,
    .archive-layout-v1 .post_aside .card_text .date.inspector-sized {
        font-size: var(--inspector-font-size, 1em) !important;
        line-height: var(--inspector-line-height, normal) !important;
        letter-spacing: var(--inspector-letter-spacing, normal) !important;
    }
}

@media (max-width: 480px) {
    .article_section.archive-layout-v1,
    .archive-layout-v1 {
        padding: 16px 0 24px;
    }
    .archive-layout-v1 .post_content {
        padding: 0 16px;
    }
    .archive-layout-v1 .post_content .post_tit.pc {
        font-size: 24px;
    }
    .archive-layout-v1 .post_content .ce-header {
        font-size: 18px;
    }
    .archive-layout-v1 .contt,
    .archive-layout-v1 .post_content .ce-paragraph {
        font-size: 15px;
    }
    .page-edit-mode .archive-layout-v1 .post_content .image-tool__caption {
        font-size: 12px;
    }
    .archive-layout-v1 .post_aside {
        padding: 0 16px !important;
        margin-top: 32px !important;
        padding-top: 24px !important;
    }
    .archive-layout-v1 .post_aside h2 {
        font-size: 16px;
        margin-bottom: 16px;
    }
    .archive-layout-v1 .post_aside .card_item {
        grid-template-columns: 90px 1fr;
        gap: 12px;
    }
    .archive-layout-v1 .post_aside .card_item > a.card_item_link {
        grid-template-columns: 90px 1fr;
        gap: 12px;
    }
    .archive-layout-v1 .post_aside .thumb-box,
    .archive-layout-v1 .post_aside .card_item > a.card_item_link .thumb-box {
        width: 90px;
        min-width: 90px;
        height: 90px;
        min-height: 90px;
    }
    .archive-layout-v1 .post_aside .relate_group .card_text h3 {
        font-size: 12px !important;
    }
    .archive-layout-v1 .post_aside .card_text .category.inspector-sized,
    .archive-layout-v1 .post_aside .card_text h3.inspector-sized,
    .archive-layout-v1 .post_aside .card_text .date.inspector-sized {
        font-size: var(--inspector-font-size, 1em) !important;
        line-height: var(--inspector-line-height, normal) !important;
        letter-spacing: var(--inspector-letter-spacing, normal) !important;
    }
}

.page-editor {
    position: fixed;
    right: 24px;
    top: 24px;
    width: 340px;
    max-height: calc(100vh - 48px);
    overflow: auto;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    padding: 16px;
    z-index: 50;
}

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.editor-header button {
    background: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 12px;
}

.editor-fields {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.editor-fields label {
    display: grid;
    gap: 6px;
    font-size: 12px;
    color: #5f6368;
}

.editor-fields input {
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #dadce0;
    font-size: 13px;
}

.editor-blocks-head {
    display: grid;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 12px;
    color: #5f6368;
}

.editor-add {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.editor-add button {
    background: #f1f3f4;
    border: 1px solid #dadce0;
    border-radius: 6px;
    padding: 5px 8px;
    cursor: pointer;
    font-size: 12px;
}

.editor-block {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    display: grid;
    gap: 8px;
    margin-bottom: 10px;
}

.editor-block textarea,
.editor-block input {
    width: 100%;
    border: 1px solid #dadce0;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 13px;
}

.editor-block textarea {
    min-height: 80px;
    resize: vertical;
}

.editor-block-actions {
    display: flex;
    gap: 6px;
}

.editor-block-actions button {
    border: 1px solid #dadce0;
    background: #fff;
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
}

/* Mobile nav (no box lines, gray text) — matches style.css */
.mobile-nav a,
.mobile-nav button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px 10px;
    margin: 2px 0;
    border: none !important;
    border-radius: 0;
    background: transparent !important;
    color: #5f6368 !important;
    font-weight: 500;
    text-decoration: none;
}
.mobile-nav .primary {
    background: transparent !important;
    color: #5f6368 !important;
    border: none !important;
}
