/* =============================================================
   MOA News 2026 — Consolidated CSS (news.css + write.css + inline styles from skins)
   Modern, clean, maintainable front-end styles for all news plugin skins.
   Integrated and refactored for consistency across list, view, and write interfaces.
   Primary: #c0392b (deep red)
   All selectors scoped to .news-wrap or specific wrappers for isolation.
   Updates based on page analysis: Improved image handling, spacing, responsiveness, accessibility, and layout consistency to fix potential broken images, misalignments, and text overflows.
============================================================= */

:root {
  --color-primary:      #c0392b;
  --color-primary-dark: #a93226;
  --color-primary-dk:   #96281b;
  --color-accent:       #e74c3c;
  --color-text:         #1a1a2e;
  --color-text-light:   #6b7280;
  --color-text-lighter: #9ca3af;
  --color-bg:           #ffffff;
  --color-bg-soft:      #f9fafb;
  --color-bg-hover:     #f1f5f9;
  --color-border:       #e2e8f0;
  --color-border-strong:#cbd5e1;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;

  --font-base:  "Pretendard Variable", Pretendard, system-ui, sans-serif;
  --font-title:"Pretendard Variable", Pretendard, "Noto Serif KR", Georgia, serif;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --transition: 0.18s cubic-bezier(0.4,0,0.2,1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-primary:      #e74c3c;
    --color-primary-dark: #c0392b;
    --color-text:         #f1f5f9;
    --color-text-light:   #94a3b8;
    --color-text-lighter: #64748b;
    --color-bg:           #0f172a;
    --color-bg-soft:      #1e293b;
    --color-bg-hover:     #334155;
    --color-border:       #334155;
    --color-border-strong:#475569;
  }
}

/* ── Global Resets and Utilities ─────────────────────────────────────── */
.news-wrap, .write-wrap {
  font-family: var(--font-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.72;
  font-size: clamp(15px, 0.94rem + 0.12vw, 16px);
  letter-spacing: -0.01em;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  word-break: keep-all;
  box-sizing: border-box;
}

.news-wrap *, .news-wrap *::before, .news-wrap *::after,
.write-wrap *, .write-wrap *::before, .write-wrap *::after {
  box-sizing: border-box;
}

.news-wrap a, .write-wrap a {
  color: inherit;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  font-family: inherit;
  display: inline;
}

.news-wrap h1, .news-wrap h2, .news-wrap h3, .news-wrap h4, .news-wrap h5, .news-wrap h6,
.write-wrap h1, .write-wrap h2, .write-wrap h3, .write-wrap h4, .write-wrap h5, .write-wrap h6 {
  font-family: var(--font-base);
  color: var(--color-text);
  margin: 0;
  padding: 0;
  line-height: 1.4;
  font-weight: 700;
  border: none;
  background: none;
}

.news-wrap p, .write-wrap p { margin: 0; padding: 0; }
.news-wrap ul, .news-wrap ol, .write-wrap ul, .write-wrap ol { margin: 0; padding: 0; list-style: none; }
.news-wrap li, .write-wrap li { list-style: none; }
.news-wrap img, .write-wrap img { border: none; vertical-align: middle; max-width: 100%; height: auto; }
.news-wrap input, .news-wrap button, .news-wrap select, .news-wrap textarea,
.write-wrap input, .write-wrap button, .write-wrap select, .write-wrap textarea {
  font-family: var(--font-base);
  font-size: 14px;
  color: var(--color-text);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  line-height: normal;
  box-sizing: border-box;
}
.news-wrap button, .write-wrap button { cursor: pointer; background: none; border: none; padding: 0; }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ── Breaking News Bar ─────────────────────────────────────── */
.news-plugin-breaking, .breaking {
  background: linear-gradient(135deg, #dc2626 0%, #c0263e 100%);
  color: white;
  padding: 14px 20px;
  border-radius: var(--radius);
  margin: 0 0 1.8rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(220,38,38,0.22);
  position: relative;
  overflow: hidden;
}

.news-plugin-breaking::before, .breaking::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  animation: shine 4s linear infinite;
}

@keyframes shine {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%);   }
}

.news-plugin-breaking .breaking-label, .breaking-label {
  background: #fef08a;
  color: #b91c1c;
  padding: 0.35em 0.9em;
  border-radius: 5px;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.news-plugin-breaking .breaking-scroll {
  display: flex;
  gap: 16px;
  overflow: hidden;
  animation: news-scroll 30s linear infinite;
  white-space: nowrap;
}

.news-plugin-breaking .breaking-scroll a {
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
}

.news-plugin-breaking .breaking-scroll a:hover { text-decoration: underline; }
.news-plugin-breaking .breaking-sep { opacity: .5; color: #fff; }

@keyframes news-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .news-plugin-breaking .breaking-scroll { animation: none; }
}

@media (max-width: 780px) {
  .breaking { font-size: 0.94rem; padding: 12px 16px; }
}

@media (max-width: 520px) {
  .breaking { flex-direction: column; gap: 0.6rem; text-align: center; }
}

/* ── Card Components (Shared across list and view) ─────────────────────────── */
.card, .article-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
}

.card:hover, .article-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

.card-thumb, .card-thumb img {
  aspect-ratio: 16 / 9;
  background: var(--color-bg-soft);
  overflow: hidden;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.42s ease-out;
}

.card:hover .card-thumb img {
  transform: scale(1.06);
}

.card-body {
  padding: 1.1rem 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.card-title {
  font-size: 1.06rem;
  font-weight: 700;
  line-height: 1.38;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  font-size: 0.81rem;
  color: var(--color-text-light);
  margin-top: auto;
  padding-top: 0.8rem;
  border-top: 1px solid var(--color-border);
}

/* 1. 기사 뷰 전체 컨테이너 확장 */
.news-wrap .article-view {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 3rem 5% !important; /* 좌우 여백을 5%로 줄여 시원하게 배치 */
    box-sizing: border-box;
}

/* 2. 기사 헤더 및 본문 영역 확장 */
.news-wrap .article-header,
.news-wrap .article-content,
.news-wrap .article-footer {
    max-width: 1400px !important; /* 가독성을 위한 최대 가이드라인 (취향에 따라 1600px로 조정 가능) */
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* 3. 이전/다음 기사 네비게이션 (Article Navigation) 확장 */
.news-wrap .article-nav {
    max-width: 1400px !important;
    width: 100% !important;
    margin: 3rem auto !important;
    display: grid;
    grid-template-columns: 1fr 1fr; /* 좌우로 꽉 차게 배치 */
    gap: 1rem;
}

.news-wrap .nav-item {
    width: 100% !important;
    box-sizing: border-box;
}

/* 4. 댓글 영역 (Comment Section) 확장 */
.news-wrap .comment-section {
    max-width: 1400px !important;
    width: 100% !important;
    margin: 4rem auto !important;
    padding: 2rem;
    background-color: var(--color-bg-soft); /* 영역 구분을 위해 배경색 부여 */
    border-radius: var(--radius-lg);
}

/* 댓글 입력창 및 리스트 100% */
#news-comment-form, 
.comment-list {
    width: 100% !important;
}

.comment-item {
    width: 100% !important;
    max-width: 100% !important;
}

/* 5. 하단 버튼 및 목록 가기 영역 */
.news-wrap .view-buttons {
    max-width: 1400px !important;
    width: 100% !important;
    margin: 2rem auto !important;
    display: flex;
    justify-content: center;
}

/* ── Write Interface (write.skin.php) ──────────────────────────────────── */
.write-wrap {
  max-width: 1400px;
  padding: 24px 16px;
}

.write-wrap .write-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-primary);
}

.write-wrap .write-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: flex-start;
}

.write-wrap .form-group { margin-bottom: 14px; }
.write-wrap .form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
  color: #444;
  cursor: default;
}

.write-wrap .form-group .required { color: #e53935; }
.write-wrap .form-group .hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--color-text-light);
  margin-left: 4px;
}

.write-wrap .inp-full {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--color-border);
  border-radius: 5px;
  font-size: 14px;
  line-height: 1.5;
  transition: border-color .2s, box-shadow .2s;
}

.write-wrap .inp-full:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-ring);
}

.write-wrap textarea.inp-full { resize: vertical; min-height: 80px; }
.write-wrap select.inp-full {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23757575' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  cursor: pointer;
}

.write-wrap .chk-group {
  display: flex;
  flex-direction: column;
  gap: 12px;          /* 간격 조금 더 넓게 */
  user-select: none;  /* 텍스트 드래그 방지 */
}

.write-wrap .chk-group label.chk-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.5;
  padding: 4px 8px;   /* 클릭 영역 넓히기 */
  border-radius: 6px;
  transition: background 0.15s;
}

.write-wrap .chk-group label.chk-label:hover {
  background: var(--color-bg-hover);
}

.write-wrap .chk-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--color-primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* 포커스 시 시각적 피드백 */
.write-wrap .chk-group input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.write-wrap .meta-box {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  margin-bottom: 16px;
}

.write-wrap .meta-title, .write-wrap .meta-box h3, .write-wrap .meta-box h4 {
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 12px;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--color-border);
  color: #555;
  line-height: 1.4;
}

.write-wrap .current-thumb { margin-bottom: 10px; border-radius: 5px; overflow: hidden; }
.write-wrap .current-thumb img { width: 100%; height: auto; display: block; border-radius: 5px; }
.write-wrap .current-thumb p.hint, .write-wrap p.hint {
  font-size: 11px;
  color: var(--color-text-light);
  margin: 4px 0 0;
}

.write-wrap input[type="file"] {
  padding: 6px 0;
  border: none;
  background: none;
  font-size: 13px;
  cursor: pointer;
  width: 100%;
}

.write-wrap .seo-box {
  background: #f9f9f9;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-top: 16px;
}

.write-wrap .seo-box summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  list-style: none;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.write-wrap .seo-box summary::-webkit-details-marker { display: none; }
.write-wrap .seo-box summary::before { content: '▶'; font-size: 10px; }
.write-wrap .seo-box[open] summary::before { content: '▼'; font-size: 10px; }
.write-wrap .seo-box .form-group { margin-top: 12px; }

.write-wrap #se5-editor-wrap {
  border: 1px solid var(--color-border);
  border-radius: 5px;
  overflow: hidden;
}

.write-wrap .write-submit { display: flex; flex-direction: column; gap: 8px; }
.write-wrap .btn-submit-main {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  line-height: 1.4;
  transition: background .2s;
}

.write-wrap .btn-submit-main:hover { background: var(--color-primary-dk); }
.write-wrap .btn-submit-main:focus-visible { outline: 3px solid rgba(211,47,47,.4); }
.write-wrap .btn-submit-main:disabled { opacity: .6; cursor: not-allowed; }

.write-wrap .btn-cancel {
  display: block;
  text-align: center;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 14px;
  color: #666;
  background: #fff;
  cursor: pointer;
  line-height: 1.4;
  transition: background .15s;
}

.write-wrap .btn-cancel:hover { background: #f5f5f5; color: #444; }

@media (max-width: 900px) { .write-wrap .write-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .write-wrap { padding: 16px 12px; }
  .write-wrap .write-title { font-size: 18px; }
  .write-wrap .btn-submit-main { font-size: 15px; padding: 12px; }
}

/* ── List Skin (list.skin.php) ─────────────────────────────────────────── */
.news-wrap .cat-nav {
  display: flex;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 2px solid var(--color-border);
  flex-wrap: wrap;
  margin: 0;
}

.news-wrap .cat-nav a {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-light);
  border: 1px solid transparent;
  transition: background .2s, color .2s, border-color .2s;
}

.news-wrap .cat-nav a:hover,
.news-wrap .cat-nav a.active,
.news-wrap .cat-nav a[aria-current="page"] {
  background: var(--cat-color, var(--color-primary));
  color: #fff;
  border-color: var(--cat-color, var(--color-primary));
}

.news-wrap .cat-badge,
.news-wrap .badge-breaking,
.news-wrap .badge-exclusive,
.news-wrap .badge-featured,
.news-wrap .thumb-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  color: #fff;
  letter-spacing: .3px;
  line-height: 1.4;
  vertical-align: middle;
}

.news-wrap .badge-breaking, .news-wrap .thumb-badge.breaking { background: #e53935; }
.news-wrap .badge-exclusive, .news-wrap .thumb-badge.exclusive { background: #6a1b9a; }
.news-wrap .badge-featured { background: #f57f17; }

.news-wrap .headline-section {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--color-border);
}

.news-wrap .headline-card-big {
  display: block;
  color: inherit;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .2s;
  background: var(--color-bg);
}

.news-wrap .headline-card-big:hover,
.news-wrap .headline-card-big:focus-visible { transform: translateY(-2px); }

.news-wrap .hl-thumb {
  width: 100%;
  padding-top: 56.25%;
  background-size: cover;
  background-position: center;
  background-color: #e0e0e0;
}

.news-wrap .hl-info { padding: 16px; }
.news-wrap .hl-info h2 { font-size: 18px; line-height: 1.4; margin: 8px 0 6px; font-weight: 700; }
.news-wrap .hl-info p { font-size: 13px; color: var(--color-text-light); line-height: 1.5; margin: 0; }
.news-wrap .hl-date { font-size: 12px; color: var(--color-text-light); margin-top: 6px; display: block; }

.news-wrap .headline-sub { display: flex; flex-direction: column; gap: 10px; }
.news-wrap .headline-card-small {
  display: flex;
  gap: 10px;
  color: inherit;
  background: var(--color-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .2s;
}

.news-wrap .headline-card-small:hover,
.news-wrap .headline-card-small:focus-visible { transform: translateY(-1px); }

.news-wrap .hs-thumb {
  width: 100px;
  min-width: 100px;
  background-size: cover;
  background-position: center;
  background-color: #e0e0e0;
}

.news-wrap .hs-info { padding: 10px; flex: 1; min-width: 0; }
.news-wrap .hs-info h4 { font-size: 13px; line-height: 1.4; margin: 4px 0; font-weight: 600; }

.news-wrap .news-container {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  padding: 24px 0;
  align-items: flex-start;
}

.news-wrap .cat-heading {
  font-size: 18px;
  font-weight: 700;
  padding-left: 10px;
  margin: 0 0 16px;
  border-left: 4px solid currentColor;
}

.news-wrap .tag-info, .news-wrap .search-info {
  padding: 10px 0 16px;
  font-size: 14px;
  color: var(--color-text-light);
  margin: 0;
}

.news-wrap .search-info em { color: var(--color-primary); font-style: normal; font-weight: 600; }

.news-wrap .article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.news-wrap .article-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.12); }

.news-wrap .card-thumb {
  display: block;
  overflow: hidden;
  position: relative;
  padding-top: 56.25%;
  background: #e0e0e0;
}

.news-wrap .card-thumb img {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
  display: block;
  max-width: none;
}

.news-wrap .card-thumb:hover img { transform: scale(1.04); }
.news-wrap .thumb-badge { position: absolute; top: 8px; left: 8px; }

.news-wrap .card-body { padding: 14px; }
.news-wrap .card-meta { margin-bottom: 6px; }

.news-wrap .card-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 8px;
}

.news-wrap .card-title a {
  display: block;
  color: var(--color-text);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.4;
}

.news-wrap .card-title a:hover, .news-wrap .card-title a:focus-visible { color: var(--color-primary); }

.news-wrap .card-summary {
  font-size: 13px;
  color: var(--color-text-light);
  line-height: 1.5;
  margin: 0 0 8px;
}

.news-wrap .card-footer {
  font-size: 12px;
  color: var(--color-text-lighter);
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: auto;
}

.news-wrap .card-author { font-weight: 500; }
.news-wrap .card-date { opacity: .8; }
.news-wrap .card-view { display: flex; align-items: center; gap: 4px; }

.news-wrap .card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.news-wrap .tag {
  font-size: 12px;
  color: var(--color-primary);
  opacity: .75;
}

.news-wrap .tag:hover { opacity: 1; text-decoration: underline; }

.news-wrap .no-articles {
  text-align: center;
  padding: 40px 0;
  font-size: 16px;
  color: var(--color-text-light);
}

.news-wrap .news-sidebar { position: sticky; top: 20px; }

.news-wrap .sidebar-box {
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}

.news-wrap .sidebar-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 12px;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--color-border);
}

.news-wrap .search-bar {
  display: flex;
  align-items: center;
  gap: 4px;
}

.news-wrap .search-bar input {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.news-wrap .search-bar button {
  padding: 8px 12px;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.news-wrap .sidebar-article {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  align-items: flex-start;
}

.news-wrap .sidebar-article img {
  width: 70px;
  height: 46px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.news-wrap .sidebar-article a {
  font-size: 13px;
  line-height: 1.4;
  color: var(--color-text);
  display: block;
}

.news-wrap .sidebar-article a:hover { color: var(--color-primary); }

.news-wrap .sb-date {
  font-size: 12px;
  color: var(--color-text-lighter);
  display: block;
  margin-top: 4px;
}

.news-wrap .cat-list li {
  margin-bottom: 8px;
}

.news-wrap .cat-list a {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--color-text);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: background .2s;
}

.news-wrap .cat-list a:hover, .news-wrap .cat-list a.active {
  background: var(--color-bg-hover);
  color: var(--color-primary);
}

.news-wrap .cat-icon { font-size: 16px; }
.news-wrap .cat-count { font-size: 12px; color: var(--color-text-light); margin-left: auto; }

.news-wrap .btn-write {
  display: block;
  width: 100%;
  padding: 12px;
  background: var(--color-primary);
  color: #fff;
  text-align: center;
  border-radius: var(--radius);
  font-weight: 600;
  transition: background .2s;
}

.news-wrap .btn-write:hover { background: var(--color-primary-dark); }

/* ═══════════════════════════════════════════════════════════════
   MOA.AI.KR — 뉴스 기사 뷰 · 모던 에디토리얼 리디자인
   Design Direction: 세련된 한국형 디지털 매거진
   Fonts: Noto Serif KR (title) + Noto Sans KR (body)
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+KR:wght@400;600;700;900&family=Noto+Sans+KR:wght@300;400;500;700&display=swap');

/* ── CSS 변수 ──────────────────────────────────────────────────── */
:root {
  --font-serif: 'Noto Serif KR', 'KoPubWorld Batang', Georgia, serif;
  --font-sans:  'Noto Sans KR', 'Pretendard', 'Apple SD Gothic Neo', sans-serif;

  --ink:        #0d0d0d;
  --ink-mid:    #3a3a3a;
  --ink-light:  #6b7280;
  --ink-faint:  #9ca3af;

  --paper:      #fafaf8;
  --paper-warm: #f5f4f0;
  --paper-rule: #e8e6e1;

  --accent:     #c0392b;       /* 붉은 강조 — 속보/단독 느낌 */
  --accent-dim: rgba(192,57,43,.08);

  --col-max:    860px;
  --col-wide:   960px;

  --ease-out: cubic-bezier(.22,.61,.36,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
}

/* ── 다크모드 ──────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --ink:        #f0ede8;
    --ink-mid:    #c9c5be;
    --ink-light:  #8a847a;
    --ink-faint:  #5a554e;
    --paper:      #141410;
    --paper-warm: #1c1b17;
    --paper-rule: #2e2c27;
    --accent:     #e05c50;
    --accent-dim: rgba(224,92,80,.1);
  }
}

/* ── 리셋 & 기반 ───────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ════════════════════════════════════════════════════════════════
   1. 기사 뷰 컨테이너
   ════════════════════════════════════════════════════════════════ */
.news-wrap .article-view,
.news-wrap .board-view,
.view.skin-board-view {
  max-width: var(--col-max);
  width: 100%;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 6rem;
  animation: fadeUp .55s var(--ease-out) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (min-width: 768px) {
  .news-wrap .article-view,
  .news-wrap .board-view {
    padding: 4.5rem 2.5rem 7rem;
  }
}

@media (min-width: 1400px) {
  .news-wrap .article-view,
  .news-wrap .board-view {
    max-width: var(--col-wide);
    padding: 5rem 3rem 8rem;
  }
}

/* ════════════════════════════════════════════════════════════════
   2. 헤더 영역
   ════════════════════════════════════════════════════════════════ */
.news-wrap .article-header,
.view-header,
.board-head {
  margin-bottom: 3rem;
  text-align: left;
  position: relative;
}

/* 카테고리 뱃지 (속보 / 단독 / 주요) */
.news-wrap .article-category,
.article-badge,
.news-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-family: var(--font-sans);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  padding: .3rem .7rem;
  border-radius: 2px;
  margin-bottom: 1.2rem;
}

/* 제목 */
.news-wrap .article-title,
.view-title,
#bo_v_title,
h1.board-title {
  font-family: var(--font-serif);
  font-size: clamp(1.85rem, 5.5vw, 3rem);
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin: 0 0 1.6rem;
  word-break: keep-all;
  overflow-wrap: break-word;

  /* 제목 아래 섬세한 데코 라인 */
  padding-bottom: 1.6rem;
  border-bottom: 2px solid var(--paper-rule);
  position: relative;
}

.news-wrap .article-title::after,
h1.board-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 3rem;
  height: 2px;
  background: var(--accent);
}

/* 부제목 */
.news-wrap .article-subtitle {
  font-family: var(--font-sans);
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  font-weight: 400;
  line-height: 1.65;
  color: var(--ink-mid);
  margin: 0 0 2rem;
}

/* ════════════════════════════════════════════════════════════════
   3. 메타정보 (작성자·날짜·조회수)
   ════════════════════════════════════════════════════════════════ */
.news-wrap .article-meta,
.view-info,
#bo_v_info,
.board-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem 1.6rem;
  margin: 0 0 2.8rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--paper-rule);
  border-bottom: 1px solid var(--paper-rule);
  font-family: var(--font-sans);
  font-size: .875rem;
  color: var(--ink-light);
}

.news-wrap .meta-item,
.info-item {
  display: flex;
  align-items: center;
  gap: .4rem;
}

/* 구분점 */
.news-wrap .meta-item + .meta-item::before,
.info-item + .info-item::before {
  content: '·';
  color: var(--paper-rule);
  margin-right: -.8rem;        /* gap으로 보정 */
}

/* 저자명 */
.news-wrap .meta-author,
.author-name {
  font-weight: 600;
  color: var(--ink-mid);
}

/* 작성자 프로필 사진 */
.meta-author img,
.author-photo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--paper-rule);
  transition: transform .25s var(--ease-spring);
}

.meta-author img:hover,
.author-photo:hover {
  transform: scale(1.1);
}

/* ════════════════════════════════════════════════════════════════
   4. 대표 이미지 (Hero)
   ════════════════════════════════════════════════════════════════ */
.news-wrap .article-thumb,
.view-thumb,
.board-thumb {
  margin: 0 0 3rem;
  border-radius: 6px;
  overflow: hidden;
  position: relative;

  /* 미세한 그림자 레이어 */
  box-shadow:
    0 2px  4px rgba(0,0,0,.04),
    0 8px 20px rgba(0,0,0,.08),
    0 24px 48px rgba(0,0,0,.06);
}

.news-wrap .article-thumb img,
.view-thumb img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  aspect-ratio: 16 / 9;
  transition: transform .6s var(--ease-out);
}

.news-wrap .article-thumb:hover img,
.view-thumb:hover img {
  transform: scale(1.02);
}

/* 이미지 없을 때 */
.article-thumb:empty,
.view-thumb:empty {
  display: none;
}

/* ════════════════════════════════════════════════════════════════
   5. 리드 문단 / 요약
   ════════════════════════════════════════════════════════════════ */
.news-wrap .article-summary,
.lead,
#lead,
.bo_v_lead {
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  line-height: 1.8;
  font-weight: 400;
  color: var(--ink-mid);
  background: var(--paper-warm);
  padding: 1.6rem 2rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  margin: 0 0 2.8rem;
  position: relative;
}

.news-wrap .article-summary::before,
.lead::before {
  content: '"';
  font-family: Georgia, serif;
  font-size: 4rem;
  line-height: 1;
  color: var(--accent);
  opacity: .2;
  position: absolute;
  top: -.5rem;
  left: .8rem;
  pointer-events: none;
}

/* ════════════════════════════════════════════════════════════════
   6. 본문 영역
   ════════════════════════════════════════════════════════════════ */
.news-wrap .article-content,
#bo_v_con,
.board-content,
.view-content {
  font-family: var(--font-serif);
  font-size: clamp(1.025rem, 1.9vw, 1.1rem);
  line-height: 1.95;
  letter-spacing: -0.005em;
  color: var(--ink-mid);
}

/* 단락 */
.news-wrap .article-content p,
#bo_v_con p {
  margin: 0 0 1.9rem;
  word-break: keep-all;
}

/* 첫 단락 드롭캡 효과 */
.news-wrap .article-content > p:first-of-type::first-letter,
#bo_v_con > p:first-of-type::first-letter {
  font-family: var(--font-serif);
  font-size: 3.8rem;
  font-weight: 900;
  line-height: .75;
  float: left;
  margin: .12em .12em 0 0;
  color: var(--ink);
}

/* 소제목 h2 */
.news-wrap .article-content h2,
#bo_v_con h2,
article h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  margin: 3.5rem 0 1.3rem;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--paper-rule);
  letter-spacing: -.025em;
}

/* 소제목 h3 */
.news-wrap .article-content h3,
#bo_v_con h3 {
  font-family: var(--font-sans);
  font-size: clamp(1.1rem, 2.4vw, 1.3rem);
  font-weight: 700;
  color: var(--ink);
  margin: 2.6rem 0 1rem;
  letter-spacing: -.02em;
}

/* 강조 블록쿼트 */
.news-wrap .article-content blockquote,
#bo_v_con blockquote {
  margin: 2.5rem 0;
  padding: 1.4rem 2rem 1.4rem 1.8rem;
  background: var(--paper-warm);
  border-left: 3px solid var(--ink-faint);
  border-radius: 0 4px 4px 0;
  font-style: italic;
  color: var(--ink-mid);
}

/* 강조 텍스트 */
.news-wrap .article-content strong,
#bo_v_con strong {
  font-weight: 700;
  color: var(--ink);
}

/* 본문 링크 */
.news-wrap .article-content a,
#bo_v_con a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: opacity .2s;
}

.news-wrap .article-content a:hover,
#bo_v_con a:hover {
  opacity: .7;
}

/* 구분선 */
.news-wrap .article-content hr,
#bo_v_con hr {
  border: none;
  border-top: 1px solid var(--paper-rule);
  margin: 3rem 0;
}

/* 인라인 코드 */
.news-wrap .article-content code,
#bo_v_con code {
  font-size: .88em;
  background: var(--paper-warm);
  padding: .15em .4em;
  border-radius: 3px;
  border: 1px solid var(--paper-rule);
  font-family: 'Fira Code', 'JetBrains Mono', monospace;
}

/* ── 본문 이미지 ─────────────────────────────────────────────── */
.news-wrap .article-content img,
#bo_v_con img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2.8rem auto;
  border-radius: 4px;
  box-shadow:
    0 2px 6px rgba(0,0,0,.04),
    0 8px 24px rgba(0,0,0,.07);
  transition: box-shadow .3s var(--ease-out);
}

.news-wrap .article-content img:hover,
#bo_v_con img:hover {
  box-shadow:
    0 4px 12px rgba(0,0,0,.08),
    0 16px 40px rgba(0,0,0,.12);
}

/* 캡션 */
.news-wrap .article-content figure,
#bo_v_con figure,
.wp-caption {
  margin: 3rem auto;
  text-align: center;
}

.news-wrap figcaption,
.wp-caption-text {
  font-family: var(--font-sans);
  font-size: .82rem;
  color: var(--ink-faint);
  margin-top: .75rem;
  font-style: italic;
  letter-spacing: .01em;
}

/* ── 리스트 ──────────────────────────────────────────────────── */
.news-wrap .article-content ul,
.news-wrap .article-content ol,
#bo_v_con ul,
#bo_v_con ol {
  padding-left: 1.4rem;
  margin: 0 0 1.8rem;
}

.news-wrap .article-content li,
#bo_v_con li {
  margin-bottom: .5rem;
  line-height: 1.85;
}

/* ── 표 ──────────────────────────────────────────────────────── */
.news-wrap .article-content table,
#bo_v_con table {
  width: 100%;
  border-collapse: collapse;
  margin: 2.5rem 0;
  font-size: .9rem;
  font-family: var(--font-sans);
}

.news-wrap .article-content th,
#bo_v_con th {
  background: var(--paper-warm);
  font-weight: 700;
  text-align: left;
  padding: .7rem 1rem;
  border-bottom: 2px solid var(--paper-rule);
  color: var(--ink);
}

.news-wrap .article-content td,
#bo_v_con td {
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--paper-rule);
  color: var(--ink-mid);
  vertical-align: top;
}

.news-wrap .article-content tr:last-child td,
#bo_v_con tr:last-child td {
  border-bottom: none;
}

/* ════════════════════════════════════════════════════════════════
   7. 출처 / 태그 영역
   ════════════════════════════════════════════════════════════════ */
.news-wrap .article-source,
.article-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .75rem;
  margin: 3rem 0 0;
  padding-top: 2rem;
  border-top: 1px solid var(--paper-rule);
  font-family: var(--font-sans);
  font-size: .82rem;
  color: var(--ink-light);
}

.article-tags .tag-item {
  padding: .25rem .7rem;
  background: var(--paper-warm);
  border: 1px solid var(--paper-rule);
  border-radius: 2px;
  color: var(--ink-mid);
  text-decoration: none;
  transition: background .2s, color .2s, border-color .2s;
}

.article-tags .tag-item:hover {
  background: var(--accent-dim);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent);
}

/* ════════════════════════════════════════════════════════════════
   8. 공유 버튼 / 좋아요
   ════════════════════════════════════════════════════════════════ */
.news-wrap .article-actions,
.share-buttons,
.bo_v_share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  margin: 2.5rem 0;
  padding: 1.4rem 0;
  border-top: 1px solid var(--paper-rule);
  border-bottom: 1px solid var(--paper-rule);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem 1.1rem;
  border-radius: 3px;
  font-family: var(--font-sans);
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--paper-rule);
  background: transparent;
  color: var(--ink-mid);
  text-decoration: none;
  transition: all .2s var(--ease-out);
}

.share-btn:hover {
  background: var(--paper-warm);
  border-color: var(--ink-light);
  color: var(--ink);
  transform: translateY(-1px);
}

/* 좋아요 버튼 */
.like-btn,
.btn-like {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem 1.3rem;
  border-radius: 3px;
  font-family: var(--font-sans);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--paper-rule);
  background: transparent;
  color: var(--ink-light);
  transition: all .2s var(--ease-out);
}

.like-btn:hover,
.btn-like:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
  transform: translateY(-1px);
}

.like-btn.active,
.btn-like.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

/* ════════════════════════════════════════════════════════════════
   9. 이전 / 다음 기사
   ════════════════════════════════════════════════════════════════ */
.news-wrap .article-nav,
.view-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 3.5rem 0;
  background: var(--paper-rule);
  border: 1px solid var(--paper-rule);
  border-radius: 4px;
  overflow: hidden;
  max-width: var(--col-max);
  margin-left: auto;
  margin-right: auto;
}

.article-nav-item,
.nav-prev,
.nav-next {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: 1.2rem 1.5rem;
  background: var(--paper);
  text-decoration: none;
  transition: background .2s;
}

.article-nav-item:hover,
.nav-prev:hover,
.nav-next:hover {
  background: var(--paper-warm);
}

.nav-label {
  font-family: var(--font-sans);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
}

.nav-title {
  font-family: var(--font-serif);
  font-size: .95rem;
  color: var(--ink-mid);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nav-prev { border-right: none; text-align: left; }
.nav-next { text-align: right; }

@media (max-width: 520px) {
  .news-wrap .article-nav,
  .view-buttons {
    grid-template-columns: 1fr;
  }
}

/* ════════════════════════════════════════════════════════════════
   10. 관련 기사
   ════════════════════════════════════════════════════════════════ */
.news-wrap .related-articles {
  margin: 3.5rem auto 0;
  max-width: var(--col-max);
}

.related-articles .section-title {
  font-family: var(--font-sans);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 1.4rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}

.related-articles .section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--paper-rule);
}

.related-articles .related-list {
  display: grid;
  gap: 0;
  border: 1px solid var(--paper-rule);
  border-radius: 4px;
  overflow: hidden;
}

.related-articles .related-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.3rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--paper-rule);
  transition: background .18s;
}

.related-articles .related-item:last-child {
  border-bottom: none;
}

.related-articles .related-item:hover {
  background: var(--paper-warm);
}

.related-item .item-title {
  font-family: var(--font-sans);
  font-size: .95rem;
  font-weight: 500;
  color: var(--ink-mid);
  line-height: 1.4;
}

.related-item .item-date {
  font-size: .78rem;
  color: var(--ink-faint);
  white-space: nowrap;
  font-family: var(--font-sans);
}

/* ════════════════════════════════════════════════════════════════
   11. 댓글 섹션
   ════════════════════════════════════════════════════════════════ */
.news-wrap .comment-section {
  max-width: var(--col-max);
  margin: 3.5rem auto 0;
}

.comment-section .section-title {
  font-family: var(--font-sans);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 1.4rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}

.comment-section .section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--paper-rule);
}

/* 댓글 입력창 */
.comment-form textarea {
  width: 100%;
  padding: 1rem 1.2rem;
  border: 1px solid var(--paper-rule);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: .95rem;
  line-height: 1.6;
  resize: vertical;
  min-height: 100px;
  outline: none;
  transition: border-color .2s;
}

.comment-form textarea:focus {
  border-color: var(--ink-light);
}

/* 댓글 제출 버튼 */
.comment-form .btn-submit {
  display: inline-flex;
  align-items: center;
  padding: .6rem 1.5rem;
  margin-top: .75rem;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 3px;
  font-family: var(--font-sans);
  font-size: .87rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s, transform .2s var(--ease-spring);
}

.comment-form .btn-submit:hover {
  opacity: .82;
  transform: translateY(-1px);
}

/* 개별 댓글 */
.comment-item {
  padding: 1.3rem 0;
  border-bottom: 1px solid var(--paper-rule);
}

.comment-item:last-child {
  border-bottom: none;
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-bottom: .6rem;
  font-family: var(--font-sans);
  font-size: .82rem;
  color: var(--ink-faint);
}

.comment-author {
  font-weight: 700;
  color: var(--ink-mid);
}

.comment-body {
  font-family: var(--font-sans);
  font-size: .95rem;
  color: var(--ink-mid);
  line-height: 1.7;
}

/* ════════════════════════════════════════════════════════════════
   12. 하단 버튼
   ════════════════════════════════════════════════════════════════ */
.btn-list,
.btn-modify,
.btn-delete {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1.3rem;
  border-radius: 3px;
  font-family: var(--font-sans);
  font-size: .83rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: opacity .18s, transform .18s var(--ease-spring);
}

.btn-list {
  background: var(--paper-warm);
  color: var(--ink-mid);
  border: 1px solid var(--paper-rule);
}

.btn-modify {
  background: var(--ink);
  color: var(--paper);
}

.btn-delete {
  background: transparent;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}

.btn-list:hover,
.btn-modify:hover,
.btn-delete:hover {
  opacity: .78;
  transform: translateY(-1px);
}

/* ════════════════════════════════════════════════════════════════
   13. 스크롤 진행 바 (선택 — JS 필요)
   ════════════════════════════════════════════════════════════════ */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  width: var(--progress, 0%);
  z-index: 9999;
  transition: width .1s linear;
}

/* ════════════════════════════════════════════════════════════════
   14. 반응형 보강
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .news-wrap .article-content > p:first-of-type::first-letter,
  #bo_v_con > p:first-of-type::first-letter {
    /* 모바일에선 드롭캡 제거 */
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    float: none;
    margin: 0;
  }

  .news-wrap .article-meta,
  .view-info {
    gap: .4rem 1rem;
    font-size: .82rem;
  }
}

/* ════════════════════════════════════════════════════════════════
   15. 다크모드 세부 보강
   ════════════════════════════════════════════════════════════════ */
@media (prefers-color-scheme: dark) {
  .news-wrap .article-thumb,
  .view-thumb {
    box-shadow:
      0 2px 6px rgba(0,0,0,.25),
      0 12px 32px rgba(0,0,0,.4);
  }

  .news-wrap .article-content img,
  #bo_v_con img {
    box-shadow:
      0 2px 8px rgba(0,0,0,.3),
      0 10px 28px rgba(0,0,0,.4);
  }

  .btn-list {
    background: var(--paper-warm);
    border-color: var(--paper-rule);
  }

  .comment-form textarea {
    background: var(--paper-warm);
  }
}


/* ═══════════════════════════════════════════════════════════════
   MOA.AI.KR — 브레드크럼 내비게이션 (Variant C · 풀 와이드 바)
   article-view-modern.css 디자인 시스템과 통일
   ═══════════════════════════════════════════════════════════════ */

/* ── 래퍼 (진행 바 포함) ───────────────────────────────────────── */
.breadcrumb-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 2rem;
}

/* 하단 읽기 진행 바 */
.breadcrumb-wrapper .reading-bar {
  position: absolute;
  bottom: -1px;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(to right, var(--color-primary, #1a7f6e), #34d399);
  border-radius: 0 2px 2px 0;
  transition: width .15s linear;
  pointer-events: none;
}

/* ── 브레드크럼 컨테이너 ───────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 44px;
  background: var(--color-bg, #ffffff);
  border: 1px solid var(--color-border, #e4e0d8);
  border-radius: 6px;
  box-shadow:
    0 1px 3px rgba(0,0,0,.06),
    0 4px 12px rgba(0,0,0,.05);
  overflow: hidden;
  font-family: var(--font-sans, 'Noto Sans KR', sans-serif);
}

/* ── 목록 리셋 ─────────────────────────────────────────────────── */
.breadcrumb ol {
  display: contents;  /* li들이 flex 컨테이너(.breadcrumb)의 직계 자식처럼 동작 */
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ── 공통 li ───────────────────────────────────────────────────── */
.breadcrumb li {
  display: flex;
  align-items: center;
  white-space: nowrap;
  animation: bcFadeIn .4s var(--ease-out, cubic-bezier(.22,.61,.36,1)) both;
}

.breadcrumb li:nth-child(1) { animation-delay: .05s; }
.breadcrumb li:nth-child(2) { animation-delay: .13s; }
.breadcrumb li:nth-child(3) { animation-delay: .21s; }

@keyframes bcFadeIn {
  from { opacity: 0; transform: translateX(-5px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── 사선 구분자 (li 사이) ─────────────────────────────────────── */
.breadcrumb li + li {
  position: relative;
}

/* 기본 구분자(화살표) 제거 — 사선으로 대체 */
.breadcrumb li + li::before {
  content: '';
  display: block;
  position: relative;       /* absolute 아님 — flex flow 안에 포함 */
  width: 28px;
  height: 44px;
  flex-shrink: 0;
  background: none;         /* 기존 SVG 화살표 제거 */

  /* 사선 구분선 */
  border-right: 1px solid var(--color-border, #e4e0d8);
  transform: skewX(18deg);
  margin: 0 -1px 0 0;
  background-color: var(--color-bg, #ffffff);
  opacity: 1;               /* 기존 .35 덮어쓰기 */
}

/* ── 홈 버튼 (첫 번째 li) ──────────────────────────────────────── */
.breadcrumb li:first-child a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  text-decoration: none;
  color: var(--ink-soft, #7a7a8a);
  background: var(--color-bg-soft, #f7f5f0);
  border-right: 1px solid var(--color-border, #e4e0d8);
  transition: background .2s, color .2s, transform .3s cubic-bezier(.34,1.56,.64,1);
  padding: 0;
  font-weight: 400;
}

.breadcrumb li:first-child a::after {
  display: none;   /* 홈 버튼엔 언더라인 없음 */
}

.breadcrumb li:first-child a:hover {
  background: #e8e4dc;
  color: var(--ink, #111118);
  transform: scale(1.1);
}

/* 홈 아이콘 SVG (::before로 삽입) */
.breadcrumb li:first-child a::before {
  content: '';
  display: block;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a7a8a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z'/%3E%3Cpolyline points='9 22 9 12 15 12 15 22'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  transition: background-image .2s;
}

.breadcrumb li:first-child a:hover::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111118' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z'/%3E%3Cpolyline points='9 22 9 12 15 12 15 22'/%3E%3C/svg%3E");
}

/* 홈 텍스트 숨김 (아이콘만 표시) */
.breadcrumb li:first-child a span {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* ── 카테고리 li (중간 항목) ────────────────────────────────────── */
.breadcrumb li:not(:first-child):not(:last-child) a {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 0 1.1rem 0 1.4rem;   /* 사선 여백 보정 */
  height: 44px;
  text-decoration: none;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--color-primary, #1a7f6e);
  background: rgba(26,127,110,.06);
  border-right: 1px solid var(--color-border, #e4e0d8);
  transition: background .2s, color .2s;
}

.breadcrumb li:not(:first-child):not(:last-child) a::after {
  display: none;   /* 언더라인 슬라이드 제거 */
}

.breadcrumb li:not(:first-child):not(:last-child) a:hover {
  background: rgba(26,127,110,.13);
  color: var(--color-primary, #1a7f6e);
}

/* 카테고리 앞 칩 */
.breadcrumb li:not(:first-child):not(:last-child) a::before {
  content: attr(data-cat);   /* data-cat 속성으로 라벨 주입 가능 */
  display: none;             /* 기본 off; 필요시 inline-flex으로 변경 */
}

/* 카테고리 안 뱃지 스팬 */
.breadcrumb li:not(:first-child):not(:last-child) a .cat-chip {
  display: inline-flex;
  align-items: center;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--color-primary, #1a7f6e);
  background: rgba(26,127,110,.1);
  border: 1px solid rgba(26,127,110,.28);
  border-radius: 3px;
  padding: .18rem .55rem;
  transition: background .2s;
}

.breadcrumb li:not(:first-child):not(:last-child) a:hover .cat-chip {
  background: rgba(26,127,110,.2);
}

/* ── 현재 페이지 li (마지막 항목) ──────────────────────────────── */
.breadcrumb li:last-child {
  flex: 1;
  min-width: 0;
  padding: 0 1rem 0 1.4rem;  /* 사선 여백 보정 */
}

.breadcrumb li[aria-current='page'],
.breadcrumb li:last-child {
  font-size: .84rem;
  font-weight: 500;
  color: var(--ink-mid, #3a3a3a);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: unset;   /* 기존 22ch 덮어쓰기 — 남은 공간 전체 사용 */
}

/* 현재 페이지는 링크가 없으므로 a 스타일 불필요하나 혹시 있을 경우 */
.breadcrumb li:last-child a {
  color: var(--ink-mid, #3a3a3a);
  text-decoration: none;
  font-weight: 500;
  padding: 0;
}
.breadcrumb li:last-child a::after { display: none; }

/* ── 읽기 진행 원형 링 (선택 영역) ─────────────────────────────── */
.breadcrumb .progress-area {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 0 1rem 0 .5rem;
  flex-shrink: 0;
  border-left: 1px solid var(--color-border, #e4e0d8);
  margin-left: auto;
}

.breadcrumb .progress-area .progress-text {
  font-size: .7rem;
  color: var(--ink-dim, #b0aebb);
  white-space: nowrap;
}

.breadcrumb .progress-ring {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.breadcrumb .progress-ring circle {
  fill: none;
  stroke: var(--color-border, #e4e0d8);
  stroke-width: 2.5;
}

.breadcrumb .progress-ring .ring-fill {
  stroke: var(--color-primary, #1a7f6e);
  stroke-dasharray: 56.5;
  stroke-dashoffset: 56.5;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: stroke-dashoffset .15s linear;
}

/* ── 모바일 ─────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  /* 중간 항목(카테고리) 숨김 */
  .breadcrumb li:not(:first-child):not(:last-child) {
    display: none;
  }

  /* 현재 페이지 앞 사선 구분자 유지 */
  .breadcrumb li:last-child::before {
    content: '';
    display: block;
    width: 24px;
    height: 44px;
    flex-shrink: 0;
    border-right: 1px solid var(--color-border, #e4e0d8);
    transform: skewX(18deg);
    margin: 0 -1px 0 0;
    background-color: var(--color-bg, #ffffff);
    opacity: 1;
  }

  .breadcrumb .progress-area .progress-text {
    display: none;
  }
}

/* ── 다크모드 ──────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  .breadcrumb {
    background: var(--color-bg, #1c1b17);
    border-color: var(--color-border, #2e2c27);
    box-shadow:
      0 2px 8px rgba(0,0,0,.3),
      0 8px 24px rgba(0,0,0,.25);
  }

  .breadcrumb li + li::before {
    background-color: var(--color-bg, #1c1b17);
    border-right-color: var(--color-border, #2e2c27);
    /* 기존 dark SVG 오버라이드 불필요 (SVG 없음) */
    background-image: none;
  }

  .breadcrumb li:first-child a {
    background: rgba(255,255,255,.04);
    border-right-color: var(--color-border, #2e2c27);
  }

  .breadcrumb li:first-child a:hover {
    background: rgba(255,255,255,.09);
    color: var(--ink, #f0ede8);
  }

  .breadcrumb li:first-child a::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a847a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z'/%3E%3Cpolyline points='9 22 9 12 15 12 15 22'/%3E%3C/svg%3E");
  }

  .breadcrumb li:not(:first-child):not(:last-child) a {
    background: rgba(26,127,110,.08);
    border-right-color: var(--color-border, #2e2c27);
  }

  .breadcrumb li:not(:first-child):not(:last-child) a:hover {
    background: rgba(26,127,110,.16);
  }

  .breadcrumb li[aria-current='page'],
  .breadcrumb li:last-child {
    color: var(--ink-mid, #c9c5be);
  }

  .breadcrumb .progress-area {
    border-left-color: var(--color-border, #2e2c27);
  }

  .breadcrumb-wrapper .reading-bar {
    background: linear-gradient(to right, var(--color-primary, #1a7f6e), #34d399);
  }
}








/* ── Responsive Adjustments ────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .news-wrap .news-container { grid-template-columns: 1fr; }
  .news-wrap .write-grid { grid-template-columns: 1fr; }
  .news-wrap .article-meta { flex-direction: column; align-items: flex-start; }
  .news-wrap .article-actions { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 768px) {
  .news-wrap .headline-section { grid-template-columns: 1fr; }
  .news-wrap .article-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .news-wrap .related-list { grid-template-columns: 1fr; }
  .news-wrap .article-title { font-size: 1.5rem; }
  .news-wrap .article-subtitle { font-size: 1rem; }
  .news-wrap .article-content { font-size: 0.9375rem; }
  .news-wrap .comment-item.reply { margin-left: 1rem; }
}

/* ── Dark Mode Input Improvements ──────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  input, textarea, select {
    background: #1e293b;
    border-color: #475569;
    color: #e2e8f0;
  }
}

/* ── Accessibility and Fallbacks ────────────────────────────────────────── */
.news-wrap img[alt=""] { /* Fallback for missing alt */
  border: 1px dashed var(--color-border);
  padding: 0.5rem;
  text-align: center;
  content: "Image not available";
}

.news-wrap a:focus-visible,
.news-wrap button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}