/* 모두호외 지면 스타일. newspaper.html 과 관리자 미리보기가 함께 쓴다. */
:root {
  --paper: #eeeeec; --ink: #000000; --ink-soft: #1c1c1c; --line: #77777a;
  --gothic: "Noto Sans KR", "Malgun Gothic", sans-serif;
  --myeongjo: "Noto Serif KR", "Batang", serif;
  --title-font: var(--myeongjo); --title-scale: 1; --text-scale: 1;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--myeongjo); color: var(--ink); min-height: 100dvh; padding: 0 !important; background: #9c9c99; word-break: keep-all; }
/* 종이: 펄프 섬유 + 잔입자 + 가로로 접힌 자국 + 겹쳐진 신문 가장자리 */
.sheet { position: relative; max-width: 600px; min-height: calc(100dvh - 14px); margin: 0 auto 14px; padding: 0 12px calc(20px + env(safe-area-inset-bottom, 0px) + var(--admob-banner-h, 0px)); background-color: var(--paper);
  background-image:
    linear-gradient(transparent 49.7%, rgba(0,0,0,.055) 49.97%, rgba(255,255,255,.4) 50.05%, transparent 50.4%),
    linear-gradient(90deg, rgba(0,0,0,.05), transparent 3%, transparent 97%, rgba(0,0,0,.05)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.09 .3' numOctaves='4' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .25 0 0 0 0 .25 0 0 0 0 .25 0 0 0 .13 -.03'/%3E%3C/filter%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .1 0 0 0 0 .1 0 0 0 0 .1 0 0 0 .11 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  box-shadow: 0 1px 0 #d8d8d5, 0 3px 0 #bdbdba, 0 4px 0 #dadad7, 0 6px 0 #b4b4b1, 0 7px 0 #d6d6d3, 0 9px 8px rgba(0,0,0,.35); }
.app-bottom-nav { display: none !important; }

header { padding: calc(6px + env(safe-area-inset-top, 0px)) 0 0; display: flex; align-items: center; min-height: 34px; }
header h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.app-back-btn { color: var(--ink) !important; }
#hdr-pts-auto { display: none !important; }

/* ── 제호: 가운데 큰 제목, 양옆 작은 박스 ── */
.masthead { display: grid; grid-template-columns: 66px 1fr 66px; align-items: center; gap: 6px; padding-bottom: 7px; }
.title { font: 900 calc(clamp(2.35rem, 12.4vw, 3.7rem) * var(--title-scale))/1.05 var(--title-font); text-align: center; white-space: nowrap; letter-spacing: .01em; overflow: hidden; }
.ear { display: block; min-height: 58px; border: 1px solid var(--ink); text-align: center; font-family: var(--gothic); color: inherit; padding: 3px 2px; line-height: 1.25; }
.ear:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.wx-ear { width: 100%; background: none; cursor: pointer; }
.ear small { display: block; font-size: .56rem; font-weight: 700; }
.wx-now { display: flex; align-items: center; justify-content: center; gap: 2px; min-height: 22px; }
.wx-now svg { display: block; width: 17px; height: 17px; }
.wx-now b { font-size: .86rem; font-weight: 800; }
.wx-sub { display: block; font-size: .56rem; font-weight: 700; white-space: nowrap; }
.ear.ad { border-width: 2px; display: flex; flex-direction: column; justify-content: center; }
.ear.ad b { font-size: .74rem; font-weight: 800; line-height: 1.2; }
.ear.ad small { font-size: .5rem; font-weight: 700; letter-spacing: -.03em; margin-top: 3px; white-space: nowrap; }

.infoline { display: flex; justify-content: center; gap: 6px; font: 500 .62rem var(--gothic); color: var(--ink-soft); border-top: 1px solid var(--ink); border-bottom: 2px solid var(--ink); padding: 3px 1px; white-space: nowrap; }
.infoline b { color: var(--ink); font-weight: 800; }

/* ── 제목 블록 ── */
.headline { font: 800 clamp(1.32rem, 6.4vw, 2rem)/1.28 var(--gothic); letter-spacing: -.045em; text-align: center; padding: 11px 0 10px; text-wrap: balance; }
.second { font: 800 clamp(1.14rem, 5.3vw, 1.65rem)/1.3 var(--gothic); letter-spacing: -.04em; text-align: center; padding: 11px 0 3px; text-wrap: balance; }
.second-sub { font: 700 calc(.74rem * var(--text-scale)) var(--gothic); text-align: center; color: var(--ink-soft); padding-bottom: 8px; }

/* ── 좁은 단 + 큰 사진 ── */
.main { display: grid; grid-template-columns: 27% 1fr; gap: 9px; padding-bottom: 9px; border-bottom: 1px solid var(--ink); }
.main.img-left { grid-template-columns: 1fr 27%; }
.main.img-left .side { order: 2; }
.main.no-img, .main.stack { grid-template-columns: 1fr; }
.main.stack .side { order: 2; }
.side { min-width: 0; }
.tag { font: 800 calc(.68rem * var(--text-scale)) var(--gothic); text-align: center; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 3px 0; margin-bottom: 6px; }
.deck { font: 800 calc(.78rem * var(--text-scale))/1.38 var(--gothic); letter-spacing: -.03em; margin-bottom: 7px; }
.news { font-size: calc(.72rem * var(--text-scale)); font-weight: 500; line-height: 1.58; text-align: justify; word-break: break-all; }
.photo { min-width: 0; }
.photo .shot { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.photo .shot img { display: block; width: 100%; height: auto; box-shadow: 0 0 0 1px rgba(0,0,0,.55); }
.photo figcaption { font: 500 calc(.66rem * var(--text-scale))/1.45 var(--gothic); color: var(--ink-soft); padding-top: 4px; }
.photo figcaption b { color: var(--ink); font-weight: 800; }

/* ── 기사 묶음 ── */
.cols { display: grid; grid-template-columns: 1fr; padding-top: 7px; border-top: 1px solid var(--line); }
.cols.has-img { grid-template-columns: 1fr 34%; }
.cols-list { display: grid; min-width: 0; }
.cols-list.n1 { grid-template-columns: 1fr; }
.cols-list.n2 { grid-template-columns: repeat(2, 1fr); }
.cols-list.n3 { grid-template-columns: repeat(3, 1fr); }
.art { min-width: 0; padding: 0 7px 7px; border-left: 1px solid var(--line); }
.n1 .art, .n2 .art:nth-child(odd), .n3 .art:nth-child(3n+1) { padding-left: 0; border-left: 0; }
.art.wide { grid-column: 1 / -1; padding: 7px 7px 7px 0; border-left: 0; border-top: 1px solid var(--line); }
.art h3 { font: 800 calc(.78rem * var(--text-scale))/1.35 var(--gothic); letter-spacing: -.03em; margin-bottom: 4px; }
.art a { color: inherit; }
.cartoon { min-width: 0; padding: 0 0 0 7px; border: 0; border-left: 1px solid var(--line); background: none; color: inherit; cursor: zoom-in; font-family: var(--gothic); text-align: center; align-self: start; }
.cartoon img { display: block; width: 100%; height: auto; }
.cartoon span { display: block; font-size: .6rem; font-weight: 700; margin-top: 4px; }
.blend { mix-blend-mode: multiply; }

/* ── 이미지·글·광고·구분선 블록 ── */
.pic { padding: 9px 0; text-align: center; }
.pic .shot { display: inline-block; max-width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; vertical-align: top; }
.pic .shot img { display: block; width: 100%; height: auto; }
.pic figcaption { font: 500 calc(.66rem * var(--text-scale))/1.45 var(--gothic); color: var(--ink-soft); padding-top: 4px; }
.txt { padding: 9px 0; }
.txt h3 { font: 800 calc(.92rem * var(--text-scale))/1.35 var(--gothic); letter-spacing: -.03em; margin-bottom: 4px; }
.txt.center { text-align: center; }
.txt.center .news { text-align: center; }
.np-ad { margin: 10px 0; padding: 10px 12px; border: 2px solid var(--ink); outline: 1px solid var(--ink); outline-offset: 2px; text-align: center; font-family: var(--gothic); }
.np-ad b { display: block; font-size: calc(1.1rem * var(--text-scale)); font-weight: 800; letter-spacing: -.03em; }
.np-ad span { display: block; font-size: calc(.74rem * var(--text-scale)); font-weight: 500; margin-top: 3px; }
.np-ad em { display: block; font-style: normal; font-size: calc(.78rem * var(--text-scale)); font-weight: 800; margin-top: 4px; }
.np-rule { border: 0; border-top: 2px solid var(--ink); margin: 9px 0; }

/* ── 축하합니다 ── */
.np-congrats { margin: 12px 0; padding: 10px 12px 11px; border-top: 3px double var(--ink); border-bottom: 3px double var(--ink); font-family: var(--gothic); text-align: center; }
.np-congrats h3 { font: 900 calc(1.12rem * var(--text-scale))/1.3 var(--myeongjo); letter-spacing: .08em; margin-bottom: 7px; }
.np-cg { padding: 6px 0; }
.np-cg + .np-cg { border-top: 1px dotted var(--line); }
.cg-shot { display: block; margin: 2px auto 7px; padding: 0; border: 0; background: none; cursor: zoom-in; }
.cg-shot img { display: block; width: 100%; height: auto; }
.np-cg.pos-bottom .cg-shot { margin: 7px auto 2px; }
.np-cg.pos-left, .np-cg.pos-right { display: flex; align-items: center; justify-content: center; gap: 10px; }
.np-cg.pos-right { flex-direction: row-reverse; }
.np-cg.pos-left .cg-shot, .np-cg.pos-right .cg-shot { flex: none; max-width: 70%; margin: 0; }
.np-cg.pos-left .np-cg-text, .np-cg.pos-right .np-cg-text { flex: 1; min-width: 0; text-align: left; }
.np-cg b { display: block; font-size: calc(.82rem * var(--text-scale)); font-weight: 800; line-height: 1.4; letter-spacing: -.02em; }
.np-cg p { font-size: calc(.74rem * var(--text-scale)); font-weight: 500; line-height: 1.5; margin-top: 2px; }

/* ── 오늘의 운세 ── */
.np-fortune { margin: 12px 0; padding-top: 9px; border-top: 3px double var(--ink); font-family: var(--gothic); }
.np-fortune h3 { font: 900 calc(1.3rem * var(--text-scale))/1.3 var(--myeongjo); letter-spacing: .06em; text-align: center; }
.np-fortune-dateline { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; padding-bottom: 7px; border-bottom: 2px solid var(--ink); }
.np-fortune-dateline .np-fortune-share { justify-self: end; }
.np-fortune-date { font-size: calc(.72rem * var(--text-scale)); font-weight: 700; text-align: center; white-space: nowrap; }
.np-fortune-share { padding: 3px 7px; border: 1px solid var(--ink); border-radius: 0; background: none; color: inherit; font: 800 .66rem var(--gothic); white-space: nowrap; cursor: pointer; }
.np-fortune-share:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.np-fortune-share:disabled { opacity: .5; }
.np-fortune-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); column-gap: 14px; }
.np-zd { display: flex; gap: 9px; padding: 8px 0; border-bottom: 1px dotted var(--line); }
.np-zd-face { flex: 0 0 56px; text-align: center; font-size: calc(.68rem * var(--text-scale)); font-weight: 800; }
.np-zd-face svg { display: block; width: 56px; height: 56px; margin-bottom: 1px; }
.np-zd-face span { display: block; }
.np-zd-face .np-fortune-share { margin-top: 4px; }
.np-zd-face .f { fill: var(--paper); }
.np-zd-face .s { fill: #c9c9c6; }
.np-zd-face .k { fill: currentColor; stroke: none; }
.np-zd p { flex: 1; min-width: 0; font-size: calc(.78rem * var(--text-scale)); font-weight: 500; line-height: 1.6; letter-spacing: -.02em; }
.np-zd b { font-weight: 800; white-space: nowrap; }
.np-fortune-note { padding-top: 4px; }
.np-fortune-note a { color: inherit; font-size: calc(.78rem * var(--text-scale)); font-weight: 800; }

/* ── 랭킹 기사 ── */
.np-rank { padding: 9px 0; font-family: var(--gothic); }
.np-rank h3 { font: 800 clamp(1.14rem, 5.3vw, 1.65rem)/1.3 var(--gothic); letter-spacing: -.04em; text-align: center; margin-bottom: 5px; text-wrap: balance; }
.np-rank .deck { text-align: center; }
.np-rank .news { font-family: var(--myeongjo); word-break: keep-all; margin-bottom: 7px; }
.np-rank-list { list-style: none; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); }
.np-rank-list li { display: flex; align-items: baseline; gap: 8px; padding: 5px 2px; font-size: calc(.82rem * var(--text-scale)); font-weight: 700; }
.np-rank-list li + li { border-top: 1px dotted var(--line); }
.np-rank-no { flex: 0 0 2.4rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.np-rank-name { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.np-rank-steps { flex: none; font-weight: 800; font-variant-numeric: tabular-nums; }
.np-rank-list li:first-child { font-size: calc(.95rem * var(--text-scale)); font-weight: 900; }
.np-rank-foot { display: flex; justify-content: space-between; gap: 8px; padding-top: 4px; font-size: .66rem; font-weight: 500; color: var(--ink-soft); }
.np-rank-foot a { color: inherit; font-weight: 800; }

/* ── 가로세로 낱말 퍼즐 ── */
.np-cw { margin: 12px 0; padding-top: 9px; border-top: 3px double var(--ink); font-family: var(--gothic); }
.np-cw h3 { font: 900 calc(1.3rem * var(--text-scale))/1.3 var(--myeongjo); letter-spacing: .03em; text-align: center; margin-bottom: 7px; }
.np-cw-entry { margin-bottom: 8px; }
.np-cw-now { min-height: 2.9em; font-size: calc(.8rem * var(--text-scale)); line-height: 1.45; word-break: keep-all; }
.np-cw-row { display: flex; gap: 6px; margin-top: 4px; }
.np-cw-row input { flex: 1; min-width: 0; padding: 8px; border: 1px solid var(--ink); border-radius: 0; background: rgba(255,255,255,.5); color: var(--ink); font: 700 16px var(--gothic); }
.np-cw-row button { flex: none; padding: 8px 16px; border: 0; background: var(--ink); color: var(--paper); font: 800 .84rem var(--gothic); cursor: pointer; }
.np-cw-grid { display: grid; grid-template-columns: repeat(15, 1fr); width: 100%; max-width: 480px; margin: 0 auto; border: 2px solid var(--ink); gap: 1px; background: #b4b4ae; }
.np-cw-block { display: block; aspect-ratio: 1; }
.np-cw-cell { position: relative; display: block; min-width: 0; aspect-ratio: 1; padding: 0; border: 0; border-radius: 0; background: #fbfbf6; box-shadow: 0 0 0 1px #222; color: #000; font: 700 clamp(.72rem, 3.5vw, 1.05rem)/1 var(--gothic); cursor: pointer; overflow: hidden; }
.np-cw-cell small { position: absolute; top: 0; left: 1px; font-size: clamp(.42rem, 1.8vw, .58rem); font-weight: 500; line-height: 1.1; }
.np-cw-cell span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding-top: 2px; }
.np-cw-cell.sel { background: #ffe9a8; }
.np-cw-cell.active { background: #ffcf4d; }
.np-cw-cell.wrong { color: #c81e1e; }
.np-cw-cell:focus-visible, .np-cw-clue:focus-visible, .np-cw-tools button:focus-visible, .np-cw-row button:focus-visible { outline: 2px solid #c81e1e; outline-offset: -2px; }
.np-cw-tools { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.np-cw-tools button { padding: 6px 10px; border: 1px solid var(--ink); border-radius: 0; background: none; color: inherit; font: 800 .74rem var(--gothic); cursor: pointer; }
.np-cw-msg { min-height: 1.4em; margin-top: 5px; font-size: calc(.8rem * var(--text-scale)); font-weight: 800; text-align: center; }
.np-cw-clues { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); column-gap: 14px; }
.np-cw-clues h4 { font-size: calc(.86rem * var(--text-scale)); font-weight: 800; padding: 6px 0 3px; border-bottom: 1px solid var(--ink); }
.np-cw-clues ol { list-style: none; margin: 0; padding: 0; }
.np-cw-clue { display: block; width: 100%; padding: 5px 2px; border: 0; border-bottom: 1px dotted var(--line); background: none; color: inherit; font: 500 calc(.76rem * var(--text-scale))/1.4 var(--gothic); text-align: left; word-break: keep-all; cursor: pointer; }
.np-cw-clue b { font-weight: 800; }
.np-cw-clue small { font-size: .9em; }
.np-cw-clue.on { background: #ffe9a8; color: #000; }
.np-cw-clue.done { text-decoration: line-through; opacity: .55; }

/* ── 오늘의 스도쿠 ── */
.np-clears { max-width: 420px; margin: 8px auto 6px; }
.np-clears:empty { display: none; }
.np-clears h4 { padding-bottom: 3px; font-size: calc(.82rem * var(--text-scale)); font-weight: 800; text-align: center; }
.np-sd { margin: 12px 0; padding-top: 9px; border-top: 3px double var(--ink); font-family: var(--gothic); }
.np-sd h3 { font: 900 calc(1.3rem * var(--text-scale))/1.3 var(--myeongjo); letter-spacing: .03em; text-align: center; margin-bottom: 8px; }
.np-sd-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 1px; width: 100%; max-width: 420px; margin: 0 auto; border: 2px solid var(--ink); background: #777; }
.np-sd-cell { box-sizing: border-box; min-width: 0; aspect-ratio: 1; padding: 0; border: 0; border-radius: 0; background: #fbfbf6; color: #000; font: 500 clamp(1rem, 5vw, 1.35rem)/1 var(--gothic); cursor: pointer; }
.np-sd-cell.given { font-weight: 800; }
.np-sd-cell.mine { color: #1a4f9c; font-weight: 700; }
.np-sd-cell.br { border-right: 2px solid var(--ink); }
.np-sd-cell.bb { border-bottom: 2px solid var(--ink); }
.np-sd-cell.peer { background: #e9e7dc; }
.np-sd-cell.same { background: #ffe9a8; }
.np-sd-cell.active { background: #ffcf4d; }
.np-sd-cell.wrong { color: #c81e1e; }
.np-sd-pad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; width: 100%; max-width: 420px; margin: 9px auto 0; }
.np-sd-pad button { padding: 10px 0; border: 1px solid var(--ink); border-radius: 0; background: #fbfbf6; color: #000; font: 800 1.05rem var(--gothic); cursor: pointer; }
.np-sd-pad button.full { opacity: .35; }
.np-sd-pad .np-sd-erase { font-size: .8rem; }
.np-sd-tools { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.np-sd-tools button { padding: 6px 10px; border: 1px solid var(--ink); border-radius: 0; background: none; color: inherit; font: 800 .74rem var(--gothic); cursor: pointer; }
.np-sd-cell:focus-visible, .np-sd-pad button:focus-visible, .np-sd-tools button:focus-visible { outline: 2px solid #c81e1e; outline-offset: -2px; }
.np-sd-msg { min-height: 1.4em; margin-top: 5px; font-size: calc(.8rem * var(--text-scale)); font-weight: 800; text-align: center; }

/* ── 사연 제보 ── */
.np-tip { margin-top: 14px; padding: 10px 12px 12px; border: 2px solid var(--ink); font-family: var(--gothic); }
.np-tip h3 { font-size: calc(1rem * var(--text-scale)); font-weight: 800; letter-spacing: -.03em; margin-bottom: 4px; }
.np-tip .news { font-family: var(--gothic); word-break: keep-all; text-align: left; }
.np-tip label { display: block; margin-top: 9px; font-size: .72rem; font-weight: 800; }
.np-tip textarea { display: block; width: 100%; margin-top: 3px; padding: 8px; border: 1px solid var(--ink); border-radius: 0; background: rgba(255,255,255,.5); color: var(--ink); font: 500 16px/1.45 var(--gothic); resize: vertical; }
.np-tip textarea:focus-visible, .np-tip button:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.np-tip-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 9px; }
#np-tip-msg { flex: 1; min-width: 0; font-size: .74rem; font-weight: 700; }
.np-tip button { flex: none; padding: 9px 14px; border: 0; background: var(--ink); color: var(--paper); font: 800 .82rem var(--gothic); cursor: pointer; }
.np-tip button:disabled { opacity: .5; }

.colophon { font: 500 .66rem/1.55 var(--gothic); color: var(--ink-soft); text-align: center; margin-top: 12px; padding-top: 7px; border-top: 2px solid var(--ink); }

/* 이미지 확대 */
#np-zoom { position: fixed; inset: 0; z-index: 2300; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.88); cursor: zoom-out; }
#np-zoom.on { display: flex; }
#np-zoom img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
body.locked { overflow: hidden; }
