/* =====================================================================
   임장왕 (salzip.kr) — 메인 스타일시트
   지역신문형 편집 디자인 / 흰 배경 중심 / 반응형
   ===================================================================== */

:root {
    --ink: #16181c;
    --ink-soft: #2f3540;
    --muted: #6b7280;
    --muted-light: #9aa1ac;
    --line: #e3e5e9;
    --line-strong: #c9ccd2;
    --paper: #ffffff;
    --paper-alt: #f7f7f5;
    --accent: #b3121b;
    --accent-dark: #8d0e15;
    --accent-soft: #fdf3f3;
    --blue: #1d4ed8;
    --teal: #0f766e;
    --radius: 3px;
    --shadow: 0 1px 2px rgba(16, 18, 22, .06), 0 8px 24px rgba(16, 18, 22, .04);
    --serif: "Nanum Myeongjo", "Noto Serif KR", "Apple SD Gothic Neo", "Malgun Gothic", Georgia, serif;
    --sans: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.65;
    letter-spacing: -0.01em;
    word-break: keep-all;
    overflow-wrap: break-word;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 { font-family: var(--serif); margin: 0; line-height: 1.3; letter-spacing: -0.02em; }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

::selection { background: #ffe3e4; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 820px; }

.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 999;
    background: var(--ink); color: #fff; padding: 10px 16px;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ============================== 헤더 ============================== */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }

.header-top {
    display: flex; align-items: center; justify-content: space-between;
    gap: 18px; padding: 22px 0 16px;
}

.brand { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.brand-logo {
    font-family: var(--serif); font-size: 34px; font-weight: 800;
    letter-spacing: -0.05em; color: var(--ink); line-height: 1;
    border-bottom: 4px solid var(--accent); padding-bottom: 6px;
}
.brand-logo:hover { color: var(--ink); }
.brand-logo img { max-height: 42px; width: auto; }
/*
  이미지 로고 모드.
  텍스트 로고용 밑줄(border-bottom)과 아래 여백은 이미지 아래에 남으면
  로고가 잘려 보이므로 제거하고, 대신 로고 자체 크기만 남깁니다.
*/
.brand-logo.has-img { border-bottom: 0; padding-bottom: 0; display: inline-flex; align-items: center; }
.brand-logo.has-img img { max-height: 46px; width: auto; display: block; }
.brand-tagline {
    font-size: 11px; color: var(--muted); letter-spacing: .12em;
    text-transform: uppercase; white-space: nowrap;
}

.header-tools { display: flex; align-items: center; gap: 10px; }

.search-form { display: flex; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.search-form input[type="search"] {
    border: 0; padding: 8px 12px; width: 190px; outline: none; background: #fff;
}
.search-form input[type="search"]:focus { background: var(--paper-alt); }
.search-form button {
    border: 0; background: var(--ink); color: #fff; padding: 0 14px; cursor: pointer;
    font-size: 13px; letter-spacing: .02em;
}
.search-form button:hover { background: var(--accent); }

.menu-toggle {
    display: none; border: 1px solid var(--line-strong); background: #fff;
    border-radius: var(--radius); padding: 8px 12px; cursor: pointer; font-size: 14px;
}

/* 주 내비게이션 */
.main-nav { border-top: 1px solid var(--line); }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.main-nav > .wrap > ul > li { position: relative; }
.main-nav > .wrap > ul > li > a {
    display: block; padding: 13px 20px; font-size: 15px; font-weight: 600;
    letter-spacing: -0.01em; white-space: nowrap;
}
.main-nav > .wrap > ul > li > a:hover,
.main-nav > .wrap > ul > li.is-active > a { color: var(--accent); }
.main-nav > .wrap > ul > li.is-active > a { box-shadow: inset 0 -3px 0 var(--accent); }

.nav-sub {
    position: absolute; left: 0; top: 100%; z-index: 60;
    min-width: 210px; background: #fff; border: 1px solid var(--line);
    box-shadow: var(--shadow); padding: 8px 0;
    display: none;
}
.main-nav li:hover > .nav-sub, .main-nav li:focus-within > .nav-sub { display: block; }
.nav-sub a { display: block; padding: 8px 16px; font-size: 13.5px; color: var(--ink-soft); }
.nav-sub a:hover { background: var(--paper-alt); color: var(--accent); }

/* ============================== 히어로 / 지면 ============================== */
.dateline {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 14px 0 10px; border-bottom: 3px solid var(--ink);
    font-size: 11.5px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase;
}
.dateline strong { color: var(--ink); letter-spacing: .14em; }

.masthead { padding: 26px 0 8px; text-align: center; border-bottom: 1px solid var(--line); }
.masthead h1 { font-size: clamp(28px, 4.2vw, 46px); font-weight: 800; letter-spacing: -0.035em; }
.masthead p { margin: 8px 0 0; font-size: 13px; color: var(--muted); }

/* 헤드라인 */
.headline {
    display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 32px; padding: 32px 0 30px; border-bottom: 1px solid var(--line);
}
.headline-media { position: relative; overflow: hidden; background: var(--paper-alt); border-radius: var(--radius); aspect-ratio: 16 / 10; }
.headline-media img { width: 100%; height: 100%; object-fit: cover; }
.headline-body { display: flex; flex-direction: column; justify-content: center; }
.headline-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 12px; font-weight: 700; color: var(--accent);
    letter-spacing: .08em; text-transform: uppercase; margin-bottom: 12px;
}
.headline-eyebrow::before { content: ""; width: 22px; height: 3px; background: var(--accent); }
.headline h2 { font-size: clamp(24px, 2.5vw, 34px); font-weight: 800; letter-spacing: -0.03em; }
.headline h2 a:hover { color: var(--accent); }
.headline .lead { margin: 14px 0 0; color: var(--ink-soft); font-size: 15.5px; line-height: 1.72; }
.headline-meta { margin-top: 18px; font-size: 12.5px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }

/* 주요 뉴스 (3열) */
.news-strip { padding: 28px 0; border-bottom: 1px solid var(--line); }
.section-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px; margin-bottom: 18px; padding-bottom: 10px; border-bottom: 2px solid var(--ink);
}
.section-head h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.03em; }
.section-head h2 .num { color: var(--accent); font-family: var(--sans); font-size: 12px; vertical-align: super; margin-right: 6px; }
.section-head .more { font-size: 12.5px; color: var(--muted); }
.section-head .more:hover { color: var(--accent); }

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

.card { display: flex; flex-direction: column; min-width: 0; }
.card-media {
    position: relative; overflow: hidden; background: var(--paper-alt);
    border-radius: var(--radius); aspect-ratio: 16 / 10; margin-bottom: 12px;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .card-media img { transform: scale(1.03); }
.card-cat {
    position: absolute; left: 0; bottom: 0;
    background: rgba(22, 24, 28, .84); color: #fff;
    font-size: 11px; padding: 4px 9px; letter-spacing: .04em;
}
.card h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.card:hover h3 { color: var(--accent); }
.card p { margin: 8px 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.card-meta { margin-top: auto; padding-top: 10px; font-size: 12px; color: var(--muted-light); display: flex; gap: 10px; }

/* 분야별 지면 */
.field-block { padding: 30px 0; border-bottom: 1px solid var(--line); }
.field-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.field-lead { grid-column: span 1; }

/* 지역/모니터링 주제 */
.monitor-block { padding: 30px 0; border-bottom: 1px solid var(--line); }
.monitor-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.monitor-card {
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px; background: #fff; transition: border-color .2s, box-shadow .2s;
}
.monitor-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.monitor-card .path { font-size: 11px; color: var(--muted-light); letter-spacing: .02em; }
.monitor-card h3 { font-size: 15.5px; font-weight: 700; margin-top: 6px; }
.monitor-card .count { margin-top: 10px; font-size: 12px; color: var(--muted); }
.live-dot {
    display: inline-block; width: 7px; height: 7px; border-radius: 50%;
    background: var(--accent); margin-right: 6px; vertical-align: middle;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .45; transform: scale(.86); }
}

/* 영상 섹션 */
/*
  전체 폭 배경 영상 섹션.
  ※ 예전에는 margin:0 -100vw + padding 100vw 로 화면 폭을 넘겼는데,
    이 기법은 문서의 스크롤 폭을 100vw 만큼 늘려 모바일에서 가로 스크롤을 만듭니다.
    이 요소는 body 바로 아래의 전체 폭 블록이므로 음수 마진이 필요 없습니다.
*/
.video-block { padding: 30px 0; border-bottom: 1px solid var(--line); background: var(--paper-alt); }
.video-inner { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.video-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.video-card { position: relative; }
/* a 태그는 기본이 inline 이라 aspect-ratio 가 먹지 않으므로 block 으로 고정합니다. */
.video-thumb { display: block; position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius); background: #000; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: .92; }
.video-thumb .play {
    position: absolute; inset: 0; display: grid; place-items: center;
    color: #fff; font-size: 34px; text-shadow: 0 2px 12px rgba(0,0,0,.5);
}
.video-card h3 { font-size: 15px; margin-top: 10px; font-weight: 700; }

/* 인기 목록 */
.rank-list { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.rank-list li { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.rank-list li:last-child { border-bottom: 0; }
.rank-list li::before {
    counter-increment: rank; content: counter(rank);
    font-family: var(--serif); font-size: 17px; font-weight: 800; color: var(--accent);
    min-width: 20px; line-height: 1.4;
}
.rank-list a { font-size: 14px; font-weight: 600; line-height: 1.5; }
.rank-list .meta { display: block; font-size: 11.5px; color: var(--muted-light); font-weight: 400; margin-top: 3px; }

/* ============================== 페이지 공통 ============================== */
.page-head { padding: 26px 0 20px; border-bottom: 3px solid var(--ink); }
.page-head h1 { font-size: clamp(23px, 3vw, 32px); font-weight: 800; letter-spacing: -0.035em; }
.page-head .desc { margin: 10px 0 0; color: var(--muted); font-size: 14px; max-width: 780px; }

.breadcrumb { font-size: 12.5px; color: var(--muted); padding: 14px 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--line-strong); }
.breadcrumb .current { color: var(--ink); font-weight: 600; }

.page-body { padding: 28px 0 60px; }
.layout-main { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 44px; align-items: start; }

/* 필터 탭 */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 22px; }
.filter-bar .label { font-size: 12px; color: var(--muted); margin-right: 4px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid var(--line-strong); background: #fff; color: var(--ink-soft);
    padding: 6px 13px; font-size: 13px; border-radius: 100px; transition: all .16s;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .n { font-size: 11.5px; opacity: .65; }

/* 목록형 기사 */
.list-articles { display: flex; flex-direction: column; }
.article-row {
    display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 20px;
    padding: 22px 0; border-bottom: 1px solid var(--line);
}
.article-row:first-child { padding-top: 0; }
.article-row .thumb { aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius); background: var(--paper-alt); }
.article-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.article-row .body { min-width: 0; }
.article-row h3 { font-size: 18.5px; font-weight: 700; letter-spacing: -0.025em; }
.article-row h3 a:hover { color: var(--accent); }
.article-row p { margin: 8px 0 0; color: var(--muted); font-size: 13.5px; }
.article-meta { margin-top: 10px; font-size: 12px; color: var(--muted-light); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.tag-type {
    display: inline-block; font-size: 11px; padding: 2px 7px;
    border-radius: 2px; background: var(--paper-alt); color: var(--ink-soft);
    border: 1px solid var(--line); font-weight: 600; letter-spacing: .02em;
}
.tag-type.t-youtube { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.tag-type.t-image, .tag-type.t-gallery { background: #eff6ff; color: #1d4ed8; border-color: #dbeafe; }
.tag-type.t-document { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.tag-type.t-link { background: #ecfdf5; color: #0f766e; border-color: #a7f3d0; }

.empty-state { padding: 60px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty-state strong { display: block; font-family: var(--serif); font-size: 18px; color: var(--ink); margin-bottom: 6px; }

/* 페이지네이션 */
.pager { display: flex; justify-content: center; gap: 6px; margin-top: 34px; flex-wrap: wrap; }
.pager-btn {
    min-width: 36px; padding: 8px 12px; text-align: center; font-size: 13px;
    border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink-soft); background: #fff;
}
.pager-btn:hover { border-color: var(--ink); color: var(--ink); }
.pager-btn.is-current { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 700; }

/* 사이드바 */
.sidebar { display: flex; flex-direction: column; gap: 26px; }
.side-panel { border-top: 2px solid var(--ink); padding-top: 14px; }
.side-panel h2 { font-size: 15px; font-weight: 800; margin-bottom: 12px; letter-spacing: -0.02em; }
.side-panel ul { list-style: none; margin: 0; padding: 0; }
.side-panel li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.side-panel li:last-child { border-bottom: 0; }
.side-panel li a { display: flex; justify-content: space-between; gap: 8px; }
.side-panel li .n { color: var(--muted-light); font-size: 12px; }
.tagcloud { display: flex; flex-wrap: wrap; gap: 7px; }
.tagcloud a {
    font-size: 12.5px; padding: 4px 10px; border: 1px solid var(--line);
    border-radius: 100px; color: var(--ink-soft);
}
.tagcloud a:hover { border-color: var(--accent); color: var(--accent); }

/* 타임라인 (히스토리) */
.timeline { list-style: none; margin: 0; padding: 0 0 0 20px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 20px 16px; }
.timeline li::before {
    content: ""; position: absolute; left: -27px; top: 4px;
    width: 10px; height: 10px; border-radius: 50%;
    background: #fff; border: 2px solid var(--line-strong);
}
.timeline li:first-child::before { border-color: var(--accent); background: var(--accent); }
.timeline .when { font-size: 11.5px; color: var(--muted-light); letter-spacing: .02em; }
.timeline .what { font-size: 13.5px; font-weight: 600; margin-top: 2px; }
.timeline .who { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

/* ============================== 콘텐츠 상세 ============================== */
/*
  관리자 로그인 상태에서만 보이는 기사 상단 편집 바.
  로그아웃 상태에서는 아예 렌더링되지 않으므로(jsp c:if) 읽는 사람의 지면에는 영향이 없습니다.
*/
.admin-edit-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; flex-wrap: wrap;
    margin: 14px 0 0; padding: 9px 12px;
    background: var(--accent-soft); border: 1px solid #f0cfd1;
    border-left: 3px solid var(--accent); border-radius: var(--radius);
}
.admin-edit-flag {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11.5px; font-weight: 700; letter-spacing: .04em;
    color: var(--accent-dark); text-transform: uppercase;
}
.admin-edit-flag::before {
    content: ""; width: 7px; height: 7px; border-radius: 50%;
    background: var(--accent); flex: none;
}
.admin-edit-bar .btn-row { margin-left: auto; }

.article-head { padding: 20px 0 0; }
.article-head h1 { font-size: clamp(25px, 3.4vw, 38px); font-weight: 800; letter-spacing: -0.035em; margin: 8px 0 0; }
.article-head .sub { margin: 14px 0 0; font-size: 16px; color: var(--ink-soft); line-height: 1.72; font-family: var(--serif); }
.article-byline {
    display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
    padding: 16px 0; margin-top: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
    font-size: 12.5px; color: var(--muted);
}
.article-byline .author { color: var(--ink); font-weight: 600; }

.article-figure { margin: 24px 0 0; }
.article-figure img { width: 100%; border-radius: var(--radius); }
.article-figure figcaption { margin-top: 8px; font-size: 12px; color: var(--muted); }

.prose { font-size: 16.5px; line-height: 1.85; color: var(--ink-soft); padding: 26px 0; }
.prose h2 {
    font-size: 21px; color: var(--ink); margin: 34px 0 12px;
    padding-left: 12px; border-left: 4px solid var(--accent);
}
.prose h3 { font-size: 18px; color: var(--ink); margin: 26px 0 10px; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 22px; }
.prose li { margin-bottom: 7px; }
.prose a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.prose blockquote {
    margin: 22px 0; padding: 14px 20px; background: var(--paper-alt);
    border-left: 3px solid var(--line-strong); color: var(--ink-soft); font-family: var(--serif);
}
.prose img { border-radius: var(--radius); margin: 18px 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 9px 11px; text-align: left; }
.prose th { background: var(--paper-alt); font-weight: 700; }

.embed-wrap { position: relative; aspect-ratio: 16 / 9; margin: 24px 0; background: #000; border-radius: var(--radius); overflow: hidden; }
.embed-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.source-box {
    margin: 26px 0 0; padding: 16px 18px; background: var(--paper-alt);
    border-radius: var(--radius); font-size: 13.5px;
}
.source-box strong { display: block; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.source-box a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }

.file-list { list-style: none; margin: 20px 0 0; padding: 0; }
.file-list li {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 14px; margin-bottom: 8px;
}
.file-list .name { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 9px; min-width: 0; }
.file-list .name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list .ext {
    font-size: 10.5px; font-weight: 800; letter-spacing: .02em;
    background: var(--ink); color: #fff; padding: 2px 6px; border-radius: 2px;
}
.file-list .size { font-size: 11.5px; color: var(--muted-light); white-space: nowrap; }

.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 22px 0; }
.gallery-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); }

.tag-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.tag-row a { font-size: 12.5px; color: var(--muted); border: 1px solid var(--line); padding: 4px 10px; border-radius: 100px; }
.tag-row a:hover { color: var(--accent); border-color: var(--accent); }

.related-block { margin-top: 34px; padding-top: 26px; border-top: 3px solid var(--ink); }
.related-block h2 { font-size: 17px; margin-bottom: 16px; }

.article-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; }
.article-nav a, .article-nav span {
    display: block; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 13px 16px; font-size: 13.5px;
}
.article-nav .label { display: block; font-size: 11px; color: var(--muted-light); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.article-nav .is-empty { color: var(--muted-light); }
.article-nav a:hover { border-color: var(--ink); }

/* ============================== 검색 ============================== */
.search-box-large { display: flex; border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden; }
.search-box-large input[type="search"] {
    flex: 1; border: 0; padding: 14px 18px; font-size: 16px; outline: none; min-width: 0;
}
.search-box-large button {
    border: 0; background: var(--ink); color: #fff; padding: 0 26px;
    font-size: 15px; font-weight: 700; cursor: pointer;
}
.search-box-large button:hover { background: var(--accent); }

.search-summary { margin: 22px 0 8px; font-size: 14px; color: var(--muted); }
.search-summary strong { color: var(--accent); }
mark { background: #ffe9a8; color: inherit; padding: 0 2px; border-radius: 2px; }

/* ============================== 푸터 ============================== */
.site-footer { margin-top: 60px; border-top: 3px solid var(--ink); background: var(--paper-alt); }
.footer-main { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 34px; padding: 38px 0 30px; }
.footer-brand .logo { font-family: var(--serif); font-size: 24px; font-weight: 800; letter-spacing: -0.04em; }
.footer-brand p { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.7; max-width: 380px; }
.footer-col h3 { font-family: var(--sans); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; font-weight: 700; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { padding: 4px 0; font-size: 13px; color: var(--ink-soft); }
.footer-bottom {
    border-top: 1px solid var(--line); padding: 16px 0 22px;
    font-size: 11.5px; color: var(--muted-light);
    display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}

/* ============================== 관리자 ============================== */
.admin-body { background: var(--paper-alt); }

.admin-login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.admin-login-card {
    width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line);
    border-radius: 4px; padding: 34px 30px 28px; box-shadow: var(--shadow);
}
.admin-login-card .brand-logo { font-size: 27px; display: inline-block; }
.admin-login-card h1 { font-size: 18px; margin: 18px 0 4px; }
.admin-login-card .hint { font-size: 12.5px; color: var(--muted); margin: 0 0 22px; }

.admin-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.admin-side { background: #14161a; color: #c8ccd4; padding: 22px 0; }
.admin-side .brand {
    display: block; padding: 0 20px 20px; font-family: var(--serif);
    font-size: 20px; font-weight: 800; color: #fff; letter-spacing: -0.04em;
    border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 14px;
}
.admin-side .brand span { display: block; font-family: var(--sans); font-size: 10px; letter-spacing: .16em; color: #7b8290; margin-top: 4px; font-weight: 500; }
.admin-side nav a {
    display: flex; align-items: center; justify-content: space-between;
    padding: 11px 20px; font-size: 13.5px; color: #b6bcc7; border-left: 3px solid transparent;
}
.admin-side nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.admin-side nav a.is-active { background: rgba(179,18,27,.16); border-left-color: var(--accent); color: #fff; font-weight: 600; }
.admin-side .side-foot { padding: 18px 20px 0; margin-top: 12px; border-top: 1px solid rgba(255,255,255,.08); font-size: 11.5px; color: #767d8a; }

.admin-main { min-width: 0; display: flex; flex-direction: column; }
.admin-top {
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 14px 26px; display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.admin-top h1 { font-family: var(--sans); font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.admin-top .who { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 12px; }
.admin-content { padding: 24px 26px 60px; }

.flash { padding: 11px 15px; border-radius: var(--radius); font-size: 13.5px; margin-bottom: 16px; }
.flash-ok { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.flash-err { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 16px 18px; }
.stat-card .label { font-size: 11.5px; color: var(--muted); letter-spacing: .04em; }
.stat-card .value { font-family: var(--serif); font-size: 27px; font-weight: 800; margin-top: 6px; letter-spacing: -0.03em; }
.stat-card .unit { font-family: var(--sans); font-size: 12px; color: var(--muted-light); margin-left: 3px; font-weight: 500; }
.stat-card.is-accent { border-left: 3px solid var(--accent); }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 4px; margin-bottom: 20px; }
.panel-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.panel-head h2 { font-family: var(--sans); font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.panel-body { padding: 18px; }
.panel-body.is-flush { padding: 0; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th, .data-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table th { background: var(--paper-alt); font-size: 11.5px; letter-spacing: .04em; color: var(--muted); font-weight: 700; white-space: nowrap; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfbfa; }
.data-table .num { color: var(--muted-light); font-size: 12px; }
.data-table .title-cell { max-width: 420px; }
.data-table .title-cell a { font-weight: 600; }
.data-table .title-cell a:hover { color: var(--accent); }

.badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 100px; font-weight: 700; letter-spacing: .01em; }
.badge-published { background: #ecfdf5; color: #047857; }
.badge-draft { background: #f3f4f6; color: #4b5563; }
.badge-private { background: #fffbeb; color: #b45309; }
.badge-deleted { background: #fef2f2; color: #b91c1c; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 16px; border-radius: var(--radius); border: 1px solid var(--line-strong);
    background: #fff; color: var(--ink-soft); font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all .16s; white-space: nowrap;
}
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-danger { background: #fff; border-color: #fecaca; color: #b91c1c; }
.btn-danger:hover { background: #fef2f2; border-color: #b91c1c; color: #b91c1c; }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.form-row { margin-bottom: 16px; }
.form-row.is-wide { grid-column: 1 / -1; }
.form-row label.lbl { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 6px; color: var(--ink-soft); }
.form-row .help { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.form-row .req { color: var(--accent); }

.input, .select, .textarea {
    width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius);
    padding: 10px 12px; background: #fff; outline: none; transition: border-color .16s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); }
.textarea { min-height: 110px; resize: vertical; line-height: 1.7; }
.textarea.is-body { min-height: 340px; font-family: ui-monospace, "D2Coding", Consolas, monospace; font-size: 13.5px; }
.check-row { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.check-row label { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; }

.cat-check-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 6px 10px; max-height: 230px; overflow-y: auto;
    border: 1px solid var(--line); border-radius: var(--radius); padding: 12px;
}
.cat-check-grid label { display: flex; align-items: center; gap: 7px; font-size: 13px; padding: 3px 0; cursor: pointer; }

.upload-zone {
    border: 2px dashed var(--line-strong); border-radius: 4px; padding: 26px 18px;
    text-align: center; color: var(--muted); cursor: pointer; transition: all .18s; background: #fff;
}
.upload-zone:hover, .upload-zone.is-drag { border-color: var(--accent); background: var(--accent-soft); }
.upload-zone strong { display: block; color: var(--ink); font-size: 14px; margin-bottom: 4px; }
.upload-zone small { font-size: 11.5px; }

.upload-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.upload-item { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; position: relative; background: #fff; }
.upload-item .preview { aspect-ratio: 1; background: var(--paper-alt); display: grid; place-items: center; overflow: hidden; }
.upload-item .preview img { width: 100%; height: 100%; object-fit: cover; }
.upload-item .preview .doc { font-size: 12px; font-weight: 800; color: var(--muted); }
.upload-item .meta { padding: 6px 8px; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item .del {
    position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: 0;
    border-radius: 50%; background: rgba(22,24,28,.78); color: #fff; cursor: pointer;
    font-size: 13px; line-height: 1; display: grid; place-items: center;
}
.upload-item .del:hover { background: var(--accent); }

.tree-list { list-style: none; margin: 0; padding: 0; }
.tree-list ul { list-style: none; margin: 0; padding-left: 22px; border-left: 1px dashed var(--line-strong); }
.tree-row {
    display: flex; align-items: center; gap: 10px; padding: 9px 6px;
    border-bottom: 1px solid var(--line); font-size: 13.5px;
}
.tree-row:hover { background: #fbfbfa; }
.tree-row .name { font-weight: 600; }
.tree-row .slug { font-size: 11.5px; color: var(--muted-light); font-family: ui-monospace, Consolas, monospace; }
.tree-row .flags { display: flex; gap: 5px; margin-left: auto; }
.flag { font-size: 10.5px; padding: 1px 6px; border-radius: 2px; background: var(--paper-alt); border: 1px solid var(--line); color: var(--muted); }
.flag.on { background: var(--accent-soft); border-color: #f5c2c4; color: var(--accent); }

.empty-row { padding: 34px; text-align: center; color: var(--muted); font-size: 13.5px; }

/* ============================== 반응형 ============================== */
@media (max-width: 1080px) {
    .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .monitor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .layout-main { grid-template-columns: minmax(0, 1fr) 260px; gap: 32px; }
}

@media (max-width: 900px) {
    .header-top { flex-wrap: wrap; }
    .search-form input[type="search"] { width: 140px; }
    .headline { grid-template-columns: 1fr; gap: 22px; }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .layout-main { grid-template-columns: minmax(0, 1fr); }
    .footer-main { grid-template-columns: 1fr 1fr; }
    .admin-shell { grid-template-columns: 1fr; }
    .admin-side { padding: 14px 0; }
    .admin-side nav { display: flex; overflow-x: auto; gap: 4px; padding: 0 12px; }
    .admin-side nav a { border-left: 0; border-bottom: 3px solid transparent; white-space: nowrap; padding: 9px 12px; }
    .admin-side nav a.is-active { border-left: 0; border-bottom-color: var(--accent); }
    .admin-side .side-foot { display: none; }
    .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    body { font-size: 14.5px; }
    .wrap { padding: 0 16px; }

    .header-top { padding: 16px 0 12px; gap: 12px; }
    .brand-logo { font-size: 25px; border-bottom-width: 3px; }
    /* 이미지 로고는 모바일에서 조금 작게 (텍스트 로고용 밑줄 규칙은 has-img 가 덮어씀) */
    .brand-logo.has-img img { max-height: 38px; }
    .brand-logo.has-img { border-bottom: 0; }
    .admin-edit-bar { margin-top: 10px; padding: 8px 10px; }
    .admin-edit-bar .btn-row { width: 100%; margin-left: 0; }
    .admin-edit-bar .btn { flex: 1 1 auto; }
    .brand-tagline { display: none; }
    .search-form { flex: 1; min-width: 0; }
    .search-form input[type="search"] { width: 100%; padding: 8px 10px; font-size: 13px; }
    .menu-toggle { display: block; }

    .main-nav { display: none; }
    .main-nav.is-open { display: block; }
    .main-nav > .wrap > ul { flex-direction: column; }
    .main-nav > .wrap > ul > li { border-bottom: 1px solid var(--line); }
    .main-nav > .wrap > ul > li > a { padding: 12px 4px; }
    .main-nav > .wrap > ul > li.is-active > a { box-shadow: none; }
    .nav-sub { position: static; display: block; border: 0; box-shadow: none; padding: 0 0 10px 10px; min-width: 0; }
    .nav-sub a { padding: 6px 4px; font-size: 13px; color: var(--muted); }

    .dateline { font-size: 10.5px; padding: 10px 0 8px; letter-spacing: .06em; }
    .masthead { padding: 18px 0 6px; }
    .masthead h1 { font-size: 27px; }

    .headline { padding: 20px 0 22px; }
    .headline h2 { font-size: 23px; }
    .headline .lead { font-size: 14.5px; }

    .grid-3, .grid-2, .field-grid, .video-grid, .monitor-grid, .gallery-grid { grid-template-columns: minmax(0, 1fr); }
    .section-head h2 { font-size: 17.5px; }

    /* 모바일: 뉴스 목록을 카드형(가로형) 레이아웃으로 */
    .article-row {
        grid-template-columns: 108px minmax(0, 1fr);
        gap: 13px; padding: 16px 0;
    }
    .article-row h3 { font-size: 15.5px; line-height: 1.42; }
    .article-row p { display: none; }
    .article-meta { margin-top: 7px; font-size: 11px; gap: 7px; }
    .article-row .thumb { aspect-ratio: 1; }

    .article-head h1 { font-size: 23px; }
    .article-head .sub { font-size: 15px; }
    .prose { font-size: 16px; padding: 20px 0; }
    .prose h2 { font-size: 19px; margin-top: 28px; }

    .footer-main { grid-template-columns: 1fr; gap: 22px; padding: 26px 0 20px; }
    .site-footer { margin-top: 40px; }

    .page-body { padding: 20px 0 44px; }
    .admin-content { padding: 16px 14px 48px; }
    .admin-top { padding: 11px 14px; }
    .panel-body { padding: 14px; }
    .data-table { font-size: 12.5px; }
    .data-table th, .data-table td { padding: 9px 10px; }
    .data-table .hide-sm { display: none; }
    .stat-card .value { font-size: 23px; }
    .article-nav { grid-template-columns: 1fr; }
    .search-box-large input[type="search"] { padding: 12px 13px; font-size: 15px; }
    .search-box-large button { padding: 0 16px; font-size: 14px; }
}

@media print {
    .site-header, .site-footer, .sidebar, .related-block, .article-nav, .pager, .filter-bar { display: none; }
    .layout-main { grid-template-columns: 1fr; }
    body { font-size: 12pt; }
}

/* 접근성: 모션 최소화 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
