/* News Magazine X 디자인 1:1 포팅 + theme_mods customizer 보강.
   R-D1: 콘텐츠 max-width + 좌우 광고 슬롯
   R-D2: 토픽 이미지 40% float-left + 본문 텍스트 wrap
   R-D3: 카테고리 정확 표시명 (각 _index.md) */

:root {
  --newsx-bg:           #ffffff;
  --newsx-text:         #1a1a1a;
  --newsx-text-body:    #2c2c2c;
  --newsx-text-muted:   #6b6b6b;
  --newsx-border:       #e5e5e5;
  --newsx-link:         #1a1a1a;
  --newsx-link-hover:   #a06d2e;     /* 호버 = 골드 (로고 컬러) */
  --newsx-accent:       #a06d2e;     /* 강조 = 골드 (로고 컬러) */
  --newsx-badge-bg:     #a06d2e;     /* 카테고리 뱃지 골드 (로고 컬러) */
  --newsx-accent-soft:  rgba(160,109,46,.10);  /* 본문 링크 호버 배경 */
  --newsx-header-bg:    #ffffff;
  --newsx-footer-bg:    #1a1a1a;
  --newsx-footer-text:  #cccccc;

  --newsx-page-max:     1320px;
  --newsx-content-max:  760px;
  --newsx-ad-width:     220px;

  --newsx-font:         "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --newsx-font-display: "Encode Sans Condensed", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--newsx-font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--newsx-text);
  background: var(--newsx-bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--newsx-link); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--newsx-link-hover); }
img { max-width: 100%; height: auto; display: block; }

.newsx-container {
  max-width: var(--newsx-page-max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ============ HEADER (full width) ============ */
.newsx-site-header {
  background: var(--newsx-header-bg);
  padding: 0;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  border-bottom: 0;
  text-align: center;     /* 자식 inline 요소 가운데 정렬 — 가장 단순 보장 */
}
/* 헤더 안 모든 컨테이너를 단순 블록 + 가운데 정렬 강제 (정렬 어긋남 방지) */
.newsx-site-header .newsx-row,
.newsx-site-header .newsx-row-inner,
.newsx-site-header .newsx-site-identity,
.newsx-site-header .newsx-site-title-link {
  display: block !important;
  width: 100%;
  max-width: none;
  text-align: center !important;
  margin: 0;
  padding: 0;
}
.newsx-site-header > div { border: 0 !important; }

.newsx-site-header::after {
  content: '';
  display: block;
  height: 4px;
  margin-top: 4px;
  background: linear-gradient(
    90deg,
    #1a2845 0%, #1a2845 48%,
    #a06d2e 52%, #a06d2e 100%
  );
}
.newsx-site-identity .newsx-site-logo {
  display: inline-block;       /* text-align: center 영향 받음 */
  height: 48px; width: auto;
  max-width: 320px; object-fit: contain;
  margin: 16px 0;              /* 상하 16px, 좌우는 text-align center 가 처리 */
  padding: 0;
  vertical-align: top;
}
/* 그라데이션 바 아래 콘텐츠 영역 패딩도 압축 */
#content.site-content { padding: 18px 0 50px; }

@media (max-width: 640px) {
  .newsx-site-identity .newsx-site-logo { height: 36px; margin: 12px 0; }
  .newsx-site-header::after { margin-top: 0; height: 3px; }
}
.newsx-site-identity .newsx-site-title {
  display: block;
  font-family: var(--newsx-font-display);
  font-size: 28px; font-weight: 800; letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--newsx-text);
  line-height: 1;
  border-bottom: 2px solid var(--newsx-text);
  padding-bottom: 4px;
  display: inline-block;
}
.newsx-site-identity .newsx-site-description {
  display: block;
  font-size: 12px; color: var(--newsx-text-muted);
  letter-spacing: .5px;
  margin-top: 6px;
  font-weight: 400;
}

.newsx-primary-menu .newsx-menu {
  display: flex; gap: 20px; list-style: none; margin: 0; padding: 0;
}
.newsx-primary-menu .menu-item > a {
  font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px;
  padding: 8px 0; display: block;
}
.newsx-primary-menu .menu-item:hover > a { color: var(--newsx-link-hover); }
.newsx-primary-menu .menu-item-has-children { position: relative; }
.newsx-primary-menu .sub-menu {
  display: none; position: absolute; top: 100%; right: 0; min-width: 240px;
  background: #fff; border: 1px solid var(--newsx-border);
  list-style: none; padding: 8px 0; margin: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,.08); z-index: 10;
}
.newsx-primary-menu .menu-item-has-children:hover .sub-menu { display: block; }
.newsx-primary-menu .sub-menu .menu-item > a {
  padding: 8px 16px; text-transform: none; font-weight: 400;
  display: flex; justify-content: space-between; gap: 12px;
}
.newsx-menu-count { font-size: 11px; color: var(--newsx-text-muted); }

/* ============ R-D1: PAGE WRAP — 3-column grid (left-ad | content | right-ad) ============ */
#content.site-content {
  padding: 30px 0 50px;
}
.newsx-page-wrap {
  max-width: var(--newsx-page-max);
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: var(--newsx-ad-width) minmax(0, 1fr) var(--newsx-ad-width);
  gap: 30px;
  align-items: start;
}
.newsx-content-area {
  max-width: var(--newsx-content-max);
  width: 100%;
  justify-self: center;
}
.ad-slot {
  position: sticky;
  top: 90px;            /* sticky 헤더 아래 */
  align-self: start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;     /* 위젯이 길면 내부 스크롤 */
}
.ad-slot::-webkit-scrollbar { width: 4px; }
.ad-slot::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }
.ad-slot-inner { padding: 0; }

/* 작은 화면: 광고 슬롯 숨김, 콘텐츠만 풀폭 */
@media (max-width: 1100px) {
  .newsx-page-wrap {
    grid-template-columns: 1fr;
    max-width: 760px;
  }
  .ad-slot { display: none; }
}

/* 광고/사이드바 위젯 */
.newsx-side-widget {
  background: #fafafa; border: 1px solid var(--newsx-border);
  padding: 16px; margin-bottom: 20px;
}
.newsx-widget-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px;
  font-weight: 700; color: var(--newsx-text);
  margin: 0 0 12px;
  padding-bottom: 8px; border-bottom: 2px solid var(--newsx-accent);
}
.newsx-side-list { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.newsx-side-list li {
  padding: 8px 0; border-bottom: 1px solid #ececec;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.newsx-side-list li:last-child { border-bottom: 0; }
.newsx-side-list .count {
  font-size: 11px; color: var(--newsx-text-muted);
  background: #eee; padding: 2px 6px; border-radius: 2px;
}
/* 사이드바 카테고리 텍스트는 음영 제거 — 일반 링크처럼 표시 */
.newsx-side-list .newsx-side-cat {
  background: transparent !important;
  color: var(--newsx-text);
  padding: 0;
  font-size: 13px; font-weight: 600;
  letter-spacing: 0; text-transform: none;
  border-radius: 0;
  display: inline;
}
.newsx-side-list .newsx-side-cat:hover {
  color: var(--newsx-link-hover);
  background: transparent !important;
}
.newsx-side-list-recent li { display: block; }
.newsx-side-list-recent a {
  font-weight: 600; line-height: 1.35; display: block;
}
.newsx-side-list-recent time {
  font-size: 11px; color: var(--newsx-text-muted);
  margin-top: 2px; display: block;
}

.newsx-ad-placeholder {
  text-align: center; min-height: 600px;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  color: #aaa; background: #f4f4f4; border-style: dashed;
}
.newsx-ad-label {
  font-size: 10px; letter-spacing: 2px;
  background: #fff; padding: 2px 6px; border: 1px solid #ddd;
}
.newsx-ad-placeholder p { font-size: 12px; margin: 8px 0 0; color: #999; }

/* ============ HOME: Hero Slider (1-column, auto-rotate) ============ */
.newsx-row { padding: 0 0 30px; }

.hero-slider {
  position: relative;
  margin: 0 0 36px;
  background: #fff;
  /* overflow 는 track 으로 이동 — 도트 scale 효과가 잘리지 않게 */
}
.hero-slider-track {
  display: flex;
  overflow: hidden;
  transition: transform .5s ease;
  will-change: transform;
}
.hero-slide {
  flex: 0 0 100%;
  min-width: 0;
}
.hero-slide-link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.hero-image {
  position: relative;
  padding-bottom: 52%;
  background: #f0f0f0;
  overflow: hidden;
}
.hero-image img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero-content { padding: 18px 4px 8px; }
.hero-content .newsx-category-link { margin-bottom: 8px; }
.hero-title {
  font-family: var(--newsx-font-display);
  font-size: 30px; line-height: 1.2; font-weight: 800;
  margin: 8px 0 6px;
  color: var(--newsx-text);
  letter-spacing: -.3px;
}
.hero-slide-link:hover .hero-title { color: var(--newsx-link-hover); }
.hero-author {
  font-size: 13px; color: var(--newsx-text-muted);
  display: block; margin-top: 4px;
}
.hero-summary {
  font-size: 14px; line-height: 1.55;
  color: var(--newsx-text-muted);
  margin: 10px 0 0;
}
@media (max-width: 640px) {
  .hero-title { font-size: 22px; }
  .hero-image { padding-bottom: 60%; }
}

/* Slider arrows — over image, faded */
.hero-prev, .hero-next {
  position: absolute;
  top: 26%;
  width: 44px; height: 44px;
  background: rgba(0,0,0,.35); color: #fff;
  border: 0; border-radius: 50%;
  font-size: 28px; line-height: 1; cursor: pointer;
  opacity: 0; transition: opacity .2s ease, background .2s;
  z-index: 2;
}
.hero-slider:hover .hero-prev,
.hero-slider:hover .hero-next { opacity: .75; }
.hero-prev:hover, .hero-next:hover { background: rgba(0,0,0,.7); opacity: 1; }
.hero-prev { left: 14px; }
.hero-next { right: 14px; }

/* Slider dots */
.hero-dots {
  display: flex; justify-content: center; gap: 8px;
  margin-top: 12px;
}
.hero-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #ddd; border: 0; padding: 0; cursor: pointer;
  transition: background .15s, transform .15s;
}
.hero-dot.is-active { background: var(--newsx-accent); transform: scale(1.2); }

.newsx-section-title {
  font-family: var(--newsx-font-serif);
  font-size: 22px; font-weight: 700;
  border-bottom: 3px solid var(--newsx-text);
  padding-bottom: 10px; margin: 30px 0 24px;
  position: relative;
}
.newsx-section-title::after {
  content: ''; position: absolute; bottom: -3px; left: 0; width: 60px;
  height: 3px; background: var(--newsx-accent);
}

/* ============ POST CARDS — 2-column (More Stories / 카테고리 페이지) ============ */
.newsx-grid-layout-grid-2,
.newsx-grid-layout-grid-3 {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px;
}
@media (max-width: 640px) {
  .newsx-grid-layout-grid-2,
  .newsx-grid-layout-grid-3 { grid-template-columns: 1fr; }
}

.newsx-grid-item { background: #fff; transition: transform .2s ease; }
.newsx-grid-item:hover { transform: translateY(-2px); }
.newsx-grid-item.size-large .newsx-post-title { font-size: 26px; line-height: 1.2; }
.newsx-grid-item.size-small .newsx-post-title { font-size: 15px; line-height: 1.35; }
.newsx-grid-item.size-grid  .newsx-post-title { font-size: 18px; line-height: 1.3; }

.newsx-grid-media {
  overflow: hidden;
  position: relative; padding-bottom: 56.25%;
  background: #f0f0f0;
}
.newsx-magazine-layout-1-3 > article.size-large .newsx-grid-media { padding-bottom: 62.5%; }

.newsx-grid-media a, .newsx-grid-media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.newsx-grid-media img { object-fit: cover; transition: transform .3s ease; }
.newsx-grid-item:hover .newsx-grid-media img { transform: scale(1.03); }

/* 2열 그리드: 한 줄에 카드 2개. 카드 자체는 세로 (이미지 위 / 텍스트 아래) */
.newsx-grid-layout-grid-2 .newsx-grid-item,
.newsx-grid-layout-grid-3 .newsx-grid-item {
  display: block;
  padding: 0;
}
.newsx-grid-layout-grid-2 .newsx-grid-item .newsx-grid-media,
.newsx-grid-layout-grid-3 .newsx-grid-item .newsx-grid-media {
  margin: 0 0 14px;
  padding-bottom: 56.25%;  /* 16:9 */
  position: relative;
}
.newsx-grid-layout-grid-2 .newsx-grid-item .newsx-grid-below-media,
.newsx-grid-layout-grid-3 .newsx-grid-item .newsx-grid-below-media {
  padding: 0;
}
.newsx-grid-layout-grid-2 .newsx-grid-item .newsx-post-excerpt,
.newsx-grid-layout-grid-3 .newsx-grid-item .newsx-post-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 8px 0 8px;
  font-size: 13px;
  line-height: 1.55;
}

.newsx-post-categories { margin-bottom: 10px; display: inline-flex; flex-wrap: wrap; gap: 6px; }
.newsx-category-link {
  display: inline-block;
  font-family: var(--newsx-font-display);
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  padding: 5px 10px; background: var(--newsx-badge-bg); color: #fff !important;
  border-radius: 4px;
  text-transform: uppercase;
  line-height: 1.2;
}
.newsx-category-link:hover { background: #1a2845; }   /* hover 시 네이비 */

/* 모든 카테고리 뱃지 동일한 골드 (로고 컬러) */
.newsx-category-link.newsx-cat-ancient-world,
.newsx-category-link.newsx-cat-classical,
.newsx-category-link.newsx-cat-middle-ages,
.newsx-category-link.newsx-cat-modern-era,
.newsx-category-link.newsx-cat-asia-east,
.newsx-category-link.newsx-cat-wars,
.newsx-category-link.newsx-cat-industries-tech,
.newsx-category-link.newsx-cat-arts-ideas,
.newsx-category-link.newsx-cat-figures,
.newsx-category-link.newsx-cat-myths-mysteries,
.newsx-category-link.newsx-cat-lost-archives { background: var(--newsx-badge-bg); }

.newsx-post-title {
  font-family: var(--newsx-font-display);
  font-weight: 700; margin: 6px 0 10px;
  letter-spacing: -.3px;
}
.newsx-post-title a { color: var(--newsx-text); }
.newsx-post-title a:hover { color: var(--newsx-link-hover); }

.newsx-post-meta {
  font-size: 13px; color: var(--newsx-text-muted);
  display: flex; flex-wrap: wrap; gap: 0; margin-top: 8px;
  align-items: baseline;
}
.newsx-post-meta > span { display: inline-flex; align-items: baseline; }
.newsx-post-meta > span + span::before {
  content: '|'; margin: 0 10px; opacity: .4; font-weight: 300;
}
.newsx-post-meta a { color: var(--newsx-text-muted); }
.newsx-post-meta a:hover { color: var(--newsx-link-hover); }

.newsx-post-excerpt {
  margin-top: 10px; font-size: 13px; line-height: 1.6;
  color: var(--newsx-text-muted);
}

/* ============ SINGLE POST ============ */
.newsx-single-wrap {
  padding: 30px 0;
  max-width: var(--newsx-content-max);
  margin: 0 auto;
  display: block !important;       /* theme 의 flex 레이아웃 무력화 (1열 강제) */
}
.newsx-single-wrap > * { display: block; width: 100%; }
.newsx-single-post-header { margin-bottom: 28px; }
.newsx-single-post-header .newsx-post-categories { margin-bottom: 16px; }
.newsx-single-post-header .newsx-post-title {
  font-size: 36px; line-height: 1.2; margin: 0 0 16px;
  font-family: var(--newsx-font-display);
  font-weight: 800; letter-spacing: -.5px;
}
.newsx-single-post-header .newsx-post-subtitle {
  font-size: 17px; color: var(--newsx-text-muted);
  font-style: italic;
  line-height: 1.6; margin: 0 0 16px;
}
.newsx-single-thumbnail {
  margin: 24px 0;
  position: relative; padding-bottom: 56.25%;
  background: #f0f0f0;
}
.newsx-single-thumbnail img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
@media (max-width: 768px) {
  .newsx-single-post-header .newsx-post-title { font-size: 28px; }
}

.newsx-post-content {
  font-family: var(--newsx-font);
  font-size: 17px; line-height: 1.75; color: var(--newsx-text-body);
}
.newsx-post-content h2 {
  font-family: var(--newsx-font-display);
  font-size: 26px; font-weight: 700;
  margin: 44px 0 18px;
  letter-spacing: -.3px;
  color: var(--newsx-text);
  clear: both;
}
.newsx-post-content h2:first-of-type { margin-top: 28px; }
.newsx-post-content h3 { font-size: 20px; margin: 26px 0 10px; font-family: var(--newsx-font-display); font-weight: 700; }
.newsx-post-content p { margin: 0 0 1.1em; }
.newsx-post-content a { color: var(--newsx-accent); text-decoration: underline; text-underline-offset: 3px; }
.newsx-post-content a:hover { background: var(--newsx-accent-soft); }
.newsx-post-content blockquote {
  border-left: 3px solid var(--newsx-text);
  margin: 22px 0; padding: 6px 0 6px 18px;
  font-style: italic; color: var(--newsx-text-muted);
}
.newsx-post-content em { font-style: italic; }
.newsx-post-content strong { font-weight: 700; color: var(--newsx-text); }

/* 토픽 이미지 — 본문 1열 배치, 캡션 가운데 italic (원본 디자인) */
.newsx-post-content figure.topic-image {
  margin: 22px 0;
  padding: 0;
}
.newsx-post-content figure.topic-image img {
  width: 100%; height: auto; display: block;
  border-radius: 0;
}
.newsx-post-content figure.topic-image figcaption {
  font-size: 15px;            /* 본문 17px - 2px */
  color: var(--newsx-text-muted);
  font-style: italic;
  margin: 0;
  padding: 6px 0 0;           /* 이미지에 붙임 */
  line-height: 1.4;
  text-align: center;
}

/* ============ POST 하단: 공유 + 네비게이션 ============ */
.newsx-post-sharing {
  margin: 40px 0 24px;
  padding: 18px 0;
  border-top: 1px solid var(--newsx-border);
  border-bottom: 1px solid var(--newsx-border);
}
.newsx-post-sharing .sharing-icons {
  display: flex; gap: 14px; align-items: center;
}
.newsx-post-sharing .sharing-icons a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  color: var(--newsx-text);
  transition: color .15s ease, transform .15s ease;
  background: transparent;
  border-radius: 50%;
}
.newsx-post-sharing .sharing-icons a:hover {
  color: var(--newsx-accent);
  transform: translateY(-1px);
  background: transparent;
}
.newsx-post-sharing .newsx-svg-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
}
.newsx-post-sharing svg { width: 18px; height: 18px; fill: currentColor; }
.newsx-post-sharing .copy-share.is-copied { color: var(--newsx-accent); }

/* 이전/다음 글 네비 */
.newsx-post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 8px 0 50px;
}
.newsx-post-nav .nav-link {
  display: flex; flex-direction: column;
  padding: 18px;
  border: 1px solid var(--newsx-border);
  text-decoration: none;
  color: var(--newsx-text);
  transition: border-color .15s, transform .15s;
  min-height: 96px;
}
.newsx-post-nav .nav-link:hover {
  border-color: var(--newsx-accent);
  transform: translateY(-1px);
}
.newsx-post-nav .nav-link.nav-next { text-align: right; }
.newsx-post-nav .nav-label {
  font-family: var(--newsx-font-display);
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--newsx-text-muted);
  margin-bottom: 8px;
}
.newsx-post-nav .nav-title {
  font-family: var(--newsx-font-display);
  font-size: 15px; font-weight: 700; line-height: 1.35;
  color: var(--newsx-text);
}
.newsx-post-nav .nav-link:hover .nav-title { color: var(--newsx-accent); }
.newsx-post-nav .nav-link.is-empty {
  opacity: 0; pointer-events: none;
  border: 0;
}
@media (max-width: 640px) {
  .newsx-post-nav { grid-template-columns: 1fr; }
}

.newsx-post-tags {
  margin-top: 50px; padding-top: 22px;
  border-top: 1px solid var(--newsx-border);
  font-size: 13px;
  clear: both;
}
.newsx-tags-label { color: var(--newsx-text-muted); margin-right: 8px; }
.newsx-tag-link {
  display: inline-block; padding: 4px 9px; margin-right: 4px;
  background: #f4f4f4; border-radius: 2px;
  font-size: 11px; font-weight: 600;
}
.newsx-tag-link:hover { background: var(--newsx-accent); color: #fff; }

/* ============ ARCHIVE / CATEGORY ============ */
.newsx-archive-header {
  text-align: center; padding: 30px 0;
  border-bottom: 2px solid var(--newsx-text);
  margin-bottom: 30px;
}
.newsx-archive-prefix {
  display: block; font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--newsx-text-muted); margin-bottom: 6px;
}
.newsx-archive-title {
  font-family: var(--newsx-font-serif);
  font-size: 38px; font-weight: 700; margin: 0;
}
.newsx-archive-meta { color: var(--newsx-text-muted); margin-top: 6px; font-size: 13px; }

/* ============ FOOTER ============ */
.newsx-site-footer {
  background: var(--newsx-footer-bg);
  color: var(--newsx-footer-text);
  padding: 30px 0 24px;
  margin-top: 60px;
  border-top: 0;             /* 푸터 위 가로줄 제거 */
}
/* theme 의 .newsx-site-footer > div { border-* } 도 제거 */
.newsx-site-footer,
.newsx-site-footer > div,
.newsx-site-footer * { border: 0 !important; }
.newsx-site-footer .newsx-row,
.newsx-site-footer .newsx-row-inner {
  padding: 0 20px;
}
.newsx-site-footer a { color: #fff; }
.newsx-site-footer a:hover { color: var(--newsx-accent); }
.newsx-footer-menu {
  list-style: none; margin: 0 0 14px; padding: 0;
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 28px;
  font-family: var(--newsx-font-display);
  font-size: 13px; font-weight: 600; letter-spacing: .5px;
  text-transform: uppercase;
}
.newsx-footer-menu li { display: inline-block; }
.newsx-copyright {
  text-align: center; margin: 0; font-size: 12px; color: #888;
  letter-spacing: .3px;
}

/* ============ PAGINATION — 화살표/숫자 버튼 동일 사이즈 ============ */
.pagination {
  display: flex; justify-content: center; gap: 4px;
  margin: 40px 0 10px;
  list-style: none; padding: 0;
  flex-wrap: wrap;
}
.pagination .page-item .page-link {
  display: inline-flex;
  align-items: center; justify-content: center;
  min-width: 36px; height: 36px;
  padding: 0 10px;
  border: 1px solid var(--newsx-border);
  font-weight: 600; font-size: 13px;
  background: #fff;
  color: var(--newsx-text);
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  box-sizing: border-box;
}
.pagination .page-item .page-link span {
  font-size: 14px; line-height: 1; display: inline-block;
}
.pagination .page-item.active .page-link {
  background: var(--newsx-text); color: #fff; border-color: var(--newsx-text);
  pointer-events: none;
}
.pagination .page-item .page-link:hover {
  background: var(--newsx-text); color: #fff; border-color: var(--newsx-text);
}
.pagination .page-item.disabled { display: none; }

/* ============ Back to Top — 본문 우측 하단 (fixed) ============ */
#back-to-top {
  position: fixed;
  bottom: 28px;
  /* 광고 슬롯(220px) 시작 직전, 약 30px gap. 화면 좁으면 우측 끝 가까이 */
  right: max(28px, calc((100vw - var(--newsx-page-max)) / 2 + var(--newsx-ad-width) + 30px));
  width: 44px; height: 44px;
  border: 0; border-radius: 50%;
  background: var(--newsx-accent);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, background .2s ease;
  z-index: 90;
  display: inline-flex; align-items: center; justify-content: center;
}
#back-to-top:hover { background: #1a2845; }
#back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
}
#back-to-top svg { width: 20px; height: 20px; }
#back-to-top[hidden] { display: none; }
@media (max-width: 1100px) {
  /* 광고 슬롯 안 보이는 화면에선 단순 우측 28px */
  #back-to-top { right: 20px; bottom: 20px; }
}
