/* =========================================================
   무경일보 · 공용 스타일
   색·글꼴은 아래 변수만 바꾸면 사이트 전체에 반영됩니다.
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Special+Elite&family=Playfair+Display:wght@400;700;900&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Merriweather:wght@300;400;700;900&family=Crimson+Text:wght@400;600;700&family=Nanum+Myeongjo:wght@400;700;800&family=Nanum+Gothic+Coding:wght@400;700&display=swap');

:root {
  --ink: #1a1a1a;
  --ink-2: #2a2a2a;
  --ink-3: #3a3a3a;
  --gray: #555555;
  --gray-2: #888888;
  --paper: #e0e0e0;
  --paper-2: #d0d0d0;
  --paper-3: #f5f5f5;
  --red: #C41E3A;
  --red-dark: #8B0000;
  --night: #0a0a0a;

  --serif-ko: "Nanum Myeongjo", "Batang", serif;
  --headline: "Playfair Display", "Nanum Myeongjo", Georgia, serif;
  --news: "Merriweather", "Nanum Myeongjo", Georgia, serif;
  --body-serif: Georgia, "Times New Roman", "Nanum Myeongjo", serif;
  --type: "Special Elite", "Courier New", "Nanum Gothic Coding", monospace;
  --mono: "Courier New", Courier, "Nanum Gothic Coding", monospace;

  --noise: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='5'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --noise-dark: url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  overflow-x: clip;
  background: var(--ink);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 700; }
[hidden] { display: none !important; }

/* ---------- 공용 질감 ---------- */
.paper { position: relative; background: var(--paper); }
.paper::before {               /* 종이 결 */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image: var(--noise); opacity: .35; mix-blend-mode: multiply;
}
:where(.paper > *) { position: relative; z-index: 1; }
.night { background-color: var(--night); background-image: var(--noise-dark); }

/* 신문 사진 망점(하프톤) */
.halftone { position: relative; overflow: hidden; }
.halftone::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(0,0,0,.35) 1px, transparent 1.3px);
  background-size: 3px 3px; mix-blend-mode: multiply; opacity: .55;
}

/* 먼지 입자 (js가 생성) */
.dust { position: fixed; width: 4px; height: 4px; border-radius: 50%; pointer-events: none; z-index: 1;
  background: #d8d0c0; opacity: 0; animation: dust linear infinite; }
@keyframes dust { 0% { transform: translateY(0); opacity: .25; } 50% { opacity: .45; } 100% { transform: translateY(-200px); opacity: 0; } }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes zoomIn { from { opacity: 0; transform: scale(1.1); } to { opacity: 1; transform: none; } }
@keyframes slideL { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: none; } }
@keyframes slideR { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: 0; } }
.rise { animation: riseIn .6s ease-out both; }

/* =========================================================
   상단 신문 머리 (사건파일·세계관·지도·갤러리 공통)
   ========================================================= */
.masthead {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper); color: var(--ink);
  border-bottom: 4px double var(--ink);
  box-shadow: 0 6px 20px rgba(0,0,0,.6);
}
.masthead::before { content: ""; position: absolute; inset: 0; background-image: var(--noise); opacity: .35; mix-blend-mode: multiply; pointer-events: none; }
.masthead-inner {
  position: relative; max-width: 1280px; margin: 0 auto; padding: 8px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.masthead-logo img { height: 34px; width: auto; }
.masthead-date { font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--ink-3); letter-spacing: .05em; }
.masthead nav, .news-nav { display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 2px; }
.masthead nav a, .news-nav a, .news-nav span.here {
  font-family: var(--serif-ko); font-weight: 800; font-size: 14px; letter-spacing: .1em;
  padding: 4px 10px; color: var(--ink-3); transition: color .2s, background .2s;
}
.masthead nav a:hover, .news-nav a:hover { color: var(--red); }
.masthead nav a.on { background: var(--ink); color: var(--paper); }
.masthead nav i, .news-nav i { font-style: normal; color: var(--gray-2); margin: 0 2px; }
.news-nav span.here { opacity: .5; cursor: default; }
@media (max-width: 640px) {
  .masthead-inner { justify-content: center; }
  .masthead-date { display: none; }
  .masthead nav a { font-size: 12px; padding: 3px 6px; }
}

/* 지면 표시 띠 (각 면 상단) */
.section-tag {
  display: flex; align-items: center; gap: 12px; max-width: 1280px; margin: 0 auto 20px;
  font-family: var(--serif-ko); color: #bdbdbd; font-size: 12px; letter-spacing: .3em;
}
.section-tag::before, .section-tag::after { content: ""; flex: 1; height: 0; border-top: 1px solid #555; border-bottom: 1px solid #555; padding-top: 2px; }

/* =========================================================
   배경음악 버튼
   ========================================================= */
.bgm { position: fixed; right: 24px; bottom: 24px; z-index: 100; display: flex; align-items: center; gap: 12px; }
.bgm-btn {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.4); background: rgba(26,26,26,.7); backdrop-filter: blur(4px);
  box-shadow: 0 4px 12px rgba(0,0,0,.5); transition: transform .2s, background .3s;
}
.bgm-btn:hover { transform: scale(1.1); background: rgba(42,42,42,.9); }
.bgm-btn svg { width: 20px; height: 20px; color: #fff; }
.bgm-btn .off { display: none; }
.bgm.muted .on { display: none; }
.bgm.muted .off { display: block; opacity: .7; }
.bgm-vol {
  display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-radius: 999px;
  background: rgba(26,26,26,.9); border: 1px solid rgba(255,255,255,.3);
  opacity: 0; transform: translateX(20px); pointer-events: none; transition: .25s;
}
.bgm:hover .bgm-vol { opacity: 1; transform: none; pointer-events: auto; }
.bgm-vol input { width: 96px; accent-color: #fff; }
.bgm-vol span { color: #fff; font: 12px var(--mono); min-width: 2.5em; }

/* =========================================================
   공용 확대 보기
   ========================================================= */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.9); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fadeIn .2s; }
.lightbox-close { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; display: grid; place-items: center; background: var(--ink-3); border: 2px solid #fff; color: #fff; z-index: 2; }
.lightbox-close:hover { background: var(--gray); }
.lightbox-close svg { width: 22px; height: 22px; }
