﻿.admin-actions {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
    white-space: nowrap;
}

/* ==========================================
   콘텐츠 편집 페이지 스타일
   ========================================== */

/* 인쇄용 스타일 */
@media print {
    body {
        background-color: #fff !important;
    }

    .txtBox {
        background-color: #fff !important;
        padding: 20px !important;
        color: #333 !important;
    }

    .txtBox * {
        color: #333 !important;
    }

    .no-print {
        display: none !important;
    }

    .content-image {
        page-break-inside: avoid;
        margin: 20px auto !important;
        text-align: center !important;
        display: block !important;
    }

    .content-image img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    /* 각 이미지 타입별 원래 크기 유지 */
    .content-image-large {
        max-width: 50% !important;
        width: 50% !important;
    }

    .content-image-medium {
        max-width: 30% !important;
        width: 30% !important;
    }

    .content-image-small {
        max-width: 20% !important;
        width: 20% !important;
    }

    /* 전체그림은 100% 유지 */
    .content-image:not(.content-image-large):not(.content-image-medium):not(.content-image-small) {
        max-width: 100% !important;
        width: 100% !important;
    }

    .content-table {
        page-break-inside: avoid;
    }

    @page {
        margin: 15mm;
    }
}

/* 콘텐츠 영역 스타일 */
.txtBox {
    padding: 20px;
    line-height: 1.8;
    color: #333;
    background-color: #fafafa !important;
    font-size: 16px !important;
}

/* 일반 문장 스타일 (표와 동일한 서체와 크기) */
.txtBox p {
    font-size: 16px !important;
    color: #333 !important;
    margin: 10px 0 !important;
    line-height: 1.8 !important;
}

/* 공유 버튼 스타일은 header-share.css로 이동됨 */

/* 큰제목 (h2) */
.content-big-title {
    font-size: 24px !important;
    font-weight: bold !important;
    color: #17479e !important;
    margin: 60px 0 20px 0 !important;
    padding-bottom: 10px !important;
    border-bottom: 2px solid #17479e !important;
}

/* 중간제목 (h3) */
.content-middle-title {
    font-size: 20px !important;
    font-weight: bold !important;
    color: #17479e !important;
    margin: 40px 0 15px 0 !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid #17479e !important;
    background-color: transparent !important;
    background: none !important;
}

.content-middle-title::before,
.content-middle-title::after {
    background-color: transparent !important;
    background: none !important;
}

/* 작은제목 (h4) */
.content-small-title {
    font-size: 18px !important;
    font-weight: bold !important;
    color: #555 !important;
    margin: 20px 0 12px 0 !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
}

/* 콘텐츠 영역 내 일반 제목 태그 스타일 통일 (청색 계열) */
.content h2,
.txtBox h2,
#content-container h2,
#location-content-container h2,
.content h3,
.txtBox h3,
#content-container h3,
#location-content-container h3 {
    color: #17479e !important;
}

/* 작은제목(h4)은 진회색 유지 */
.content h4,
.txtBox h4,
#content-container h4,
#location-content-container h4 {
    color: #555 !important;
}

/* 콘텐츠 영역 내 h2 스타일 */
.content h2,
.txtBox h2,
#content-container h2,
#location-content-container h2 {
    font-weight: bold !important;
    border-bottom: 2px solid #17479e !important;
    padding-bottom: 10px !important;
    margin: 40px 0 20px 0 !important;
}

/* 콘텐츠 영역 내 h3 스타일 */
.content h3,
.txtBox h3,
#content-container h3,
#location-content-container h3 {
    font-weight: bold !important;
    border-bottom: 1px solid #17479e !important;
    padding-bottom: 8px !important;
    margin: 30px 0 15px 0 !important;
}

/* 콘텐츠 영역 내 h4 스타일 (진회색 유지) */
.content h4,
.txtBox h4,
#content-container h4,
#location-content-container h4 {
    font-weight: bold !important;
    margin: 20px 0 12px 0 !important;
    color: #555 !important;
}

/* 표 스타일 */
.content-table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 20px 0 !important;
    font-size: 16px !important;
}

.content-table tr {
    line-height: 1.6 !important;
}

.content-table td {
    padding: 7px 10px !important;
    border: 1px solid #ddd !important;
    text-align: left !important;
    font-size: 16px !important;
    line-height: 1.6 !important;
    word-break: normal !important;
    word-wrap: break-word !important;
    white-space: normal !important;
}

.content-table td .content-image,
.content-table th .content-image {
    display: block;
    margin: 0 auto;
    text-align: center;
}

.content-table td .content-image img,
.content-table th .content-image img {
    max-width: 100%;
    height: auto;
}

/* 픽셀 단위 그림: 표 안에서도 정확한 크기 유지 (인라인 스타일의 !important가 적용되도록 CSS 규칙 제외) */
.content-table td .content-image[class*="content-image-px-"] img,
.content-table th .content-image[class*="content-image-px-"] img {
    /* 인라인 스타일의 width, min-width, max-width !important가 우선하도록 CSS 규칙 제거 */
    max-width: none !important;
    width: auto !important;
    min-width: auto !important;
}

.content-table th {
    padding: 7px 10px !important;
    border: 1px solid #ddd !important;
    background-color: #f5f5f5 !important;
    font-weight: bold !important;
    text-align: center !important;
    font-size: 16px !important;
    line-height: 1.6 !important;
    white-space: nowrap !important;  /* 굵게 처리된 열은 줄바꿈 방지 */
}

/* 이미지 스타일 */
.content-image {
    margin: 20px 0 !important;
    text-align: center !important;
}

.content-image img {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    margin: 0 auto !important;
}

/* 픽셀 단위 그림: 인라인 스타일의 !important가 적용되도록 기본 규칙 제외 */
.content-image[class*="content-image-px-"] img {
    /* 인라인 스타일의 width, min-width, max-width !important가 우선하도록 CSS 규칙 제거 */
    max-width: none !important;
    width: auto !important;
    min-width: auto !important;
}

/* 기본 그림 태그: 원래 폭 유지, 100%보다 크면 100%로 축소 */
.content-image:not(.content-image-10):not(.content-image-20):not(.content-image-30):not(.content-image-40):not(.content-image-50):not(.content-image-60):not(.content-image-70):not(.content-image-80):not(.content-image-90):not(.content-image-100-fixed):not(.content-image-large):not(.content-image-medium):not(.content-image-small) img {
    width: auto !important;
    max-width: 100% !important;
}

/* 전체그림 (100% 고정) */
.content-image-100-fixed {
    width: 100% !important;
    margin: 20px 0 !important;
}

.content-image-100-fixed img {
    width: 100% !important;
    max-width: 100% !important;
}

/* 새로운 그림 크기 (10% 단위) */
.content-image-10 {
    max-width: 10% !important;
    margin: 20px auto !important;
}

.content-image-10 img {
    max-width: 100% !important;
}

.content-image-20 {
    max-width: 20% !important;
    margin: 20px auto !important;
}

.content-image-20 img {
    max-width: 100% !important;
}

.content-image-30 {
    max-width: 30% !important;
    margin: 20px auto !important;
}

.content-image-30 img {
    max-width: 100% !important;
}

.content-image-40 {
    max-width: 40% !important;
    margin: 20px auto !important;
}

.content-image-40 img {
    max-width: 100% !important;
}

.content-image-50 {
    max-width: 50% !important;
    margin: 20px auto !important;
}

.content-image-50 img {
    max-width: 100% !important;
}


.content-image-60 {
    max-width: 60% !important;
    margin: 20px auto !important;
}

.content-image-60 img {
    max-width: 100% !important;
}

.content-image-70 {
    max-width: 70% !important;
    margin: 20px auto !important;
}

.content-image-70 img {
    max-width: 100% !important;
}

.content-image-80 {
    max-width: 80% !important;
    margin: 20px auto !important;
}

.content-image-80 img {
    max-width: 100% !important;
}

.content-image-90 {
    max-width: 90% !important;
    margin: 20px auto !important;
}

.content-image-90 img {
    max-width: 100% !important;
}

/* 그림자 효과 */
.content-image-shadow img {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3) !important;
    border-radius: 4px !important;
}


/* 큰그림삽입 (50% 폭) - 하위 호환 */
.content-image-large {
    max-width: 50% !important;
    margin: 20px auto !important;
}

.content-image-large img {
    max-width: 100% !important;
}

/* 중간그림삽입 (30% 폭) - 하위 호환 */
.content-image-medium {
    max-width: 30% !important;
    margin: 20px auto !important;
}

.content-image-medium img {
    max-width: 100% !important;
}

/* 작은그림삽입 (20% 폭) - 하위 호환 */
.content-image-small {
    max-width: 20% !important;
    margin: 20px auto !important;
}

.content-image-small img {
    max-width: 100% !important;
}

/* 캡션 스타일 */
.content-caption {
    text-align: center !important;
    font-size: inherit !important;
    color: #1a3d8f !important;
    margin: 10px 0 20px 0 !important;
    font-style: normal !important;
}

.txtBox .content-caption,
.print-content-area .content-caption {
    color: #1a3d8f !important;
}

/* 여러 이미지를 한 줄에 나란히 배치 */
.content-images-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 15px !important;
    margin: 20px 0 !important;
    justify-content: center !important;
    align-items: flex-start !important;
}

.content-image-inline {
    flex: 1 1 auto !important;
    min-width: 150px !important;
    margin: 0 !important;
}

.content-image-inline img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
}

/* 2개 이미지: 각각 50% */
.content-images-2 .content-image-inline {
    max-width: calc(50% - 8px) !important;
    flex: 0 0 calc(50% - 8px) !important;
}

/* 3개 이미지: 각각 33.33% */
.content-images-3 .content-image-inline {
    max-width: calc(33.333% - 10px) !important;
    flex: 0 0 calc(33.333% - 10px) !important;
}

/* 4개 이미지: 각각 25% (4등분) */
.content-images-4 .content-image-inline {
    max-width: calc(25% - 12px) !important;
    flex: 0 0 calc(25% - 12px) !important;
}

/* 다운로드 링크 스타일 */
.content-download {
    margin: 15px 0 !important;
    padding: 10px !important;
    background-color: #f9f9f9 !important;
    border: 1px solid #ddd !important;
    border-radius: 3px !important;
}

.content-download a {
    color: #17479e !important;
    text-decoration: none !important;
}

.content-download a:hover {
    text-decoration: underline !important;
}

/* 일반 텍스트 스타일 (표와 동일한 서체와 크기) */
.content-normal-text {
    margin: 10px 0 !important;
    line-height: 1.8 !important;
    color: #333 !important;
    font-size: 16px !important;
}

/* 리스트 스타일 */
.content-list {
    margin: 15px 0 !important;
    padding-left: 20px !important;
}

.content-list li {
    margin: 8px 0 !important;
    line-height: 1.6 !important;
}

/* bg_vline 제거 */
.bg_vline {
    display: none !important;
}

/* 콘텐츠 배경 회색 제거 및 padding 제거 */
.studyBox section {
    background-color: transparent !important;
    background: none !important;
    padding: 0 !important;
}

/* stitle 제거 */
.stitle {
    background-color: transparent !important;
    background: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    line-height: 0 !important;
    overflow: hidden !important;
}

.stitle::before,
.stitle::after {
    background-color: transparent !important;
    background: none !important;
}

/* 상단 알림 레이어 스타일 */
.top-notification {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #17479e;
    color: #fff;
    padding: 15px 20px;
    text-align: center;
    font-size: 14px;
    line-height: 1.6;
    z-index: 10000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transform: translateY(-100%);
    transition: transform 0.3s ease-in-out;
}

.top-notification.show {
    transform: translateY(0);
}

.top-notification .close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.top-notification .close-btn:hover {
    opacity: 1;
}

/* 콘텐츠 구분선 스타일 (하이픈 10개 이상) - 각주 구분선처럼 좌측 정렬 */
.content-divider {
    width: 150px;
    height: 1px;
    background-color: #999;
    border: none;
    margin: 20px 0;
    padding: 0;
    display: block;
    text-align: left;
    margin-left: 0;
    margin-right: auto;
}

/* 타임라인 스타일 */
.content-timeline {
    position: relative;
    padding: 40px 0;
    margin: 40px 0;
    max-width: 100%;
}

.timeline-top-arrow {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 60px;
    height: 40px;
    background: #2196F3;
    border-radius: 50% 50% 0 0;
    z-index: 100;
    clip-path: polygon(20% 100%, 50% 0%, 80% 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    line-height: 1;
    padding-top: 8px;
    font-weight: bold;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ddd;
    transform: translateX(-50%);
    z-index: 1;
}

.timeline-item {
    position: relative;
    margin: 40px 0;
    display: flex;
    align-items: center;
    min-height: 60px;
}

.timeline-year {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: #2196F3;
    color: #fff;
    padding: 4px 12px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 16px;
    z-index: 2;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.timeline-content {
    width: 45%;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.8;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.timeline-item.left {
    flex-direction: row;
}

.timeline-item.left .timeline-content {
    margin-right: auto;
    margin-left: 0;
    text-align: left;
}

.timeline-item.right {
    flex-direction: row-reverse;
}

.timeline-item.right .timeline-content {
    margin-left: auto;
    margin-right: 0;
    text-align: right;
}

.timeline-content p {
    margin: 5px 0;
    font-size: 14px !important;
    line-height: 1.8 !important;
}

.timeline-content strong {
    font-weight: bold;
    color: #333;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    /* 모바일 공유 버튼 스타일은 header-share.css로 이동됨 */

    /* 모바일에서 콘텐츠 변경이력 숨김 */
    .admin-history-panel {
        display: none !important;
    }
    .content-timeline {
        padding: 30px 0;
    }

    .timeline-line {
        left: 30px;
    }

    .timeline-year {
        left: 30px;
        transform: translateX(-50%);
    }

    .timeline-item {
        flex-direction: column;
        align-items: flex-start;
        padding-left: 60px;
    }

    .timeline-item.left .timeline-content,
    .timeline-item.right .timeline-content {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        text-align: left;
    }
}

/* 관리자 액션 버튼 스타일 */
.admin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: filter 0.2s ease, opacity 0.2s ease;
}

.admin-btn i {
    font-size: 14px;
}

.admin-btn--primary {
    background: #6f4c3e;
    color: #fff;
}

.admin-btn--primary:hover,
.admin-btn--primary:focus {
    filter: brightness(0.95);
}

.admin-btn--danger {
    background: #8f2f24;
    color: #fff;
}

.admin-btn--danger:hover,
.admin-btn--danger:focus {
    filter: brightness(0.95);
}

.admin-btn--muted {
    background: #b9a58f;
    color: #fff;
    cursor: not-allowed;
}

.admin-btn--muted:hover,
.admin-btn--muted:focus {
    filter: none;
}

.admin-btn--static {
    cursor: default;
    background: #cfc4b6;
    color: #5b4638;
}

.admin-btn--static:hover,
.admin-btn--static:focus {
    filter: none;
}

.print-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 6px;
    background: #17479e;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    border: none;
    transition: filter 0.2s ease;
}

.print-btn:hover,
.print-btn:focus {
    filter: brightness(0.9);
}

.print-btn--disabled {
    background: #d7dbe4;
    color: #666;
    border: none;
}

.admin-section {
    margin-top: 30px;
    padding: 25px 24px 24px;
    border: 1px solid #cbb59f;
    border-radius: 10px;
    background: #f9f3ed;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.5);
}

.admin-section h4 {
    margin: 0 0 14px 0;
    font-size: 16px;
    color: #5b4638;
    font-weight: 700;
}

.admin-section table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #fff;
    border: 1px solid #d9c7b4;
}

.admin-section thead tr {
    background: #e6d5c3;
    color: #4a372b;
}

.admin-section th,
.admin-section td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #e7d8c9;
}

.admin-section tbody tr:nth-child(odd) {
    background: #fdf8f3;
}

.admin-section tbody tr:last-child td {
    border-bottom: none;
}

.admin-history-empty {
    margin: 12px 0 0 0;
    color: #8a7665;
    font-size: 12px;
    text-align: center;
}

.admin-history-note {
    margin-top: 12px;
    color: #9c846f;
    font-size: 12px;
    text-align: left;
}

.admin-history-panel tbody tr:hover {
    background: #f3eadf;
}

.js-history-preview-row {
    cursor: pointer;
}

.js-history-preview-row.history-deleted {
    position: relative;
    opacity: 0.6;
}

.js-history-preview-row.history-deleted::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    background: #c0392b;
    z-index: 1;
    pointer-events: none;
}

.js-history-preview-row.history-deleted td {
    text-decoration: line-through;
    color: #999;
}

.js-history-preview-row.history-deleted {
    cursor: not-allowed;
}

.admin-history-alert {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 12px;
    border: 1px solid transparent;
}

.admin-history-alert--success {
    background: #f1f8f4;
    border-color: #b8e0c5;
    color: #2e6b3f;
}

.admin-history-alert--error {
    background: #fdf1f0;
    border-color: #f0b4ad;
    color: #8a2f1c;
}

/* 로그인 링크 스타일 */
.content-login-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

#content-container .content-big-title:first-of-type,
#content-container .content-middle-title:first-of-type,
#content-container .content-small-title:first-of-type {
    margin-top: 20px !important;
}

.print-content-area .content-big-title:first-of-type,
.print-content-area .content-middle-title:first-of-type,
.print-content-area .content-small-title:first-of-type {
    margin-top: 20px !important;
}
