/* 資料と写真の質感。各サイト共通で読み込む。
   .doc … 紙の資料   .ph … 写真   .shot … 「資料を撮った写真」の台 */
:root {
  --noise: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --noise-coarse: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='320'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.32' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --stain: radial-gradient(60% 40% at 12% 8%, rgba(120,84,30,.16), transparent 70%), radial-gradient(40% 30% at 92% 96%, rgba(120,84,30,.2), transparent 70%), radial-gradient(30% 20% at 78% 18%, rgba(120,84,30,.08), transparent 70%);
}

/* ---------- 紙の資料 ---------- */
.doc { position: relative; isolation: isolate; background: #f3ecdc; color: #25201a; padding: clamp(18px, 4vw, 40px); box-shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 10px 30px -12px rgba(30,20,10,.45), 0 2px 5px rgba(30,20,10,.18); line-height: 1.85; overflow: hidden; }
.doc::before { content: ""; position: absolute; inset: 0; background: var(--stain); z-index: -1; pointer-events: none; }
.doc::after { content: ""; position: absolute; inset: 0; background-image: var(--noise); mix-blend-mode: multiply; opacity: .24; pointer-events: none; z-index: 3; }
.doc > * { position: relative; }
.doc h1, .doc h2, .doc h3 { line-height: 1.4; }

/* 新聞の切り抜き(縦組み) */
.doc--news { background: #e6dcc2; color: #1f1c17; font-family: "Shippori Mincho", "Yu Mincho", "Hiragino Mincho ProN", serif; padding: 18px 16px; clip-path: polygon(0 1.2%, 3% 0, 34% .8%, 62% 0, 100% 1%, 99.4% 34%, 100% 71%, 99% 100%, 55% 99.2%, 21% 100%, 0 99%, .8% 52%); }
.doc--news .news__body { writing-mode: vertical-rl; text-orientation: mixed; height: var(--news-h, 21em); font-size: .88rem; line-height: 1.75; letter-spacing: .03em; text-align: justify; column-gap: 1.2em; margin-inline: auto; max-width: 100%; overflow: hidden; }
.doc--news .news__head { font-weight: 800; font-size: 1.5rem; line-height: 1.25; letter-spacing: .06em; margin: 0 0 0 .6em; padding-left: .5em; border-left: 3px double #1f1c17; }
.doc--news .news__sub { font-weight: 700; font-size: 1.02rem; margin: 0 0 0 .7em; }
.doc--news .news__body p { margin: 0; text-indent: 1em; }
.doc--news .news__meta { font: 500 .7rem/1.4 "Zen Kaku Gothic New", sans-serif; opacity: .75; margin-top: 10px; display: flex; justify-content: space-between; gap: 8px; }
.doc--news::after { opacity: .42; }

/* 謄写版(ガリ版) 1950〜60年代 */
.doc--mimeo { background: #ebe3cb; color: #232a66; font-family: "Yomogi", "Zen Kurenaido", "Klee One", cursive; letter-spacing: .04em; }
.doc--mimeo > * { filter: blur(.25px); }
.doc--mimeo::after { background-image: var(--noise), var(--noise-coarse); opacity: .3; }
.doc--mimeo h1, .doc--mimeo h2 { font-weight: 400; text-decoration: underline; text-decoration-style: double; text-underline-offset: .3em; }

/* 二色刷り 1970年代 */
.doc--nishoku { background: #efe6d0; color: #23211f; font-family: "Shippori Mincho", "Yu Mincho", serif; --spot: #c4432a; }
.doc--nishoku h1, .doc--nishoku h2, .doc--nishoku .spot { color: var(--spot); }

/* ワープロ 1990年代 */
.doc--wapro { background: #f4f1e8; color: #1c1c1c; font-family: "DotGothic16", "MS Gothic", monospace; letter-spacing: .02em; line-height: 1.9; }
.doc--wapro h1, .doc--wapro h2 { font-weight: 400; border-bottom: 1px solid currentColor; }

/* DTP 2000年代以降 */
.doc--dtp { background: #fbfaf6; color: #222; font-family: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif; }
.doc--dtp::before { opacity: .35; }

/* FAX(感熱紙) */
.doc--fax { background: #efede6; color: #1b1b1b; font-family: "Zen Kaku Gothic New", "MS Gothic", sans-serif; font-weight: 700; padding-top: 34px; }
.doc--fax > * { filter: contrast(1.6) blur(.22px); }
.doc--fax::before { background: repeating-linear-gradient(0deg, transparent 0 5px, rgba(0,0,0,.035) 5px 6px), linear-gradient(90deg, rgba(0,0,0,.09), transparent 6%, transparent 93%, rgba(0,0,0,.12)); z-index: 2; }
.doc--fax .fax__head { position: absolute; top: 8px; left: 12px; right: 12px; display: flex; justify-content: space-between; font: 400 .62rem/1 ui-monospace, Consolas, monospace; letter-spacing: .08em; opacity: .8; }

/* マイクロフィルム(白黒反転) */
.doc--micro { background: #0c0e0c; color: #dcdfd0; font-family: "Shippori Mincho", "Yu Mincho", serif; box-shadow: 0 0 0 1px #000, 0 0 60px rgba(0,0,0,.7) inset; }
.doc--micro::before { background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0,0,0,.75)), repeating-linear-gradient(90deg, transparent 0 137px, rgba(255,255,255,.07) 137px 138px, transparent 138px 311px); z-index: 2; }
.doc--micro::after { mix-blend-mode: screen; opacity: .35; }
.doc--micro > * { filter: blur(.3px); }

/* 手書き */
.hand { font-family: "Zen Kurenaido", "Yomogi", "Klee One", cursive; letter-spacing: .02em; }
.hand--pencil { color: #5a5a5a; opacity: .85; }
.hand--pen { color: #1d2a55; }
.hand--red { color: #b3261e; }
.stamp-seal { display: inline-grid; place-items: center; width: 2.6em; height: 2.6em; border: 2px solid #b3261e; border-radius: 50%; color: #b3261e; font: 700 .8em/1 "Shippori Mincho", serif; transform: rotate(-8deg); opacity: .8; mix-blend-mode: multiply; }

/* セロテープ・付箋・画鋲 */
.tape { position: absolute; width: 74px; height: 24px; background: rgba(226,205,140,.55); box-shadow: 0 1px 2px rgba(0,0,0,.12); z-index: 4; }
.fusen { position: absolute; background: #f6e36a; box-shadow: 0 3px 6px -2px rgba(0,0,0,.35); z-index: 4; padding: 6px 8px; font: 400 .8rem/1.3 "Zen Kurenaido", cursive; color: #333; }
.pin { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff8d7a, #b3261e 65%); box-shadow: 1px 3px 3px rgba(0,0,0,.4); z-index: 5; }

/* ---------- 写真 ---------- */
.ph { position: relative; margin: 0; isolation: isolate; overflow: hidden; background: #1a1714; line-height: 0; }
.ph > svg, .ph > img, .ph .ph-img { display: block; width: 100%; height: auto; }
.ph::after { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: var(--noise); mix-blend-mode: overlay; opacity: .6; z-index: 2; }
.ph figcaption, .ph + figcaption { line-height: 1.6; }

/* 1950年代 白黒の紙焼き(縁が波型) */
.ph--bw { padding: 5.5%; background: #ece5d3; filter: sepia(.18); box-shadow: 0 6px 18px -8px rgba(0,0,0,.5); clip-path: polygon(0% 1%,2% 0%,4% 1%,6% 0%,8% 1%,10% 0%,12% 1%,14% 0%,16% 1%,18% 0%,20% 1%,22% 0%,24% 1%,26% 0%,28% 1%,30% 0%,32% 1%,34% 0%,36% 1%,38% 0%,40% 1%,42% 0%,44% 1%,46% 0%,48% 1%,50% 0%,52% 1%,54% 0%,56% 1%,58% 0%,60% 1%,62% 0%,64% 1%,66% 0%,68% 1%,70% 0%,72% 1%,74% 0%,76% 1%,78% 0%,80% 1%,82% 0%,84% 1%,86% 0%,88% 1%,90% 0%,92% 1%,94% 0%,96% 1%,98% 0%,100% 1%,100% 99%,98% 100%,96% 99%,94% 100%,92% 99%,90% 100%,88% 99%,86% 100%,84% 99%,82% 100%,80% 99%,78% 100%,76% 99%,74% 100%,72% 99%,70% 100%,68% 99%,66% 100%,64% 99%,62% 100%,60% 99%,58% 100%,56% 99%,54% 100%,52% 99%,50% 100%,48% 99%,46% 100%,44% 99%,42% 100%,40% 99%,38% 100%,36% 99%,34% 100%,32% 99%,30% 100%,28% 99%,26% 100%,24% 99%,22% 100%,20% 99%,18% 100%,16% 99%,14% 100%,12% 99%,10% 100%,8% 99%,6% 100%,4% 99%,2% 100%,0% 99%); }
.ph--bw > svg, .ph--bw > img, .ph--bw [data-photo-slot] { filter: grayscale(1) contrast(1.15) brightness(1.02) blur(.5px); }
.ph--bw::after { opacity: .85; mix-blend-mode: multiply; }

/* 新聞の網点写真 */
.ph--halftone > svg, .ph--halftone > img, .ph--halftone [data-photo-slot] { filter: grayscale(1) contrast(1.6) brightness(1.1) blur(.6px); }
.ph--halftone::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background-image: radial-gradient(circle at 50% 50%, rgba(20,18,14,.85) 0 34%, transparent 36%); background-size: 3.2px 3.2px; mix-blend-mode: hard-light; opacity: .7; }
.ph--halftone { background: #d9cfb5; }

/* 1970年代 色褪せたカラー */
.ph--faded { padding: 4.5%; background: #f1ece0; box-shadow: 0 6px 18px -8px rgba(0,0,0,.5); }
.ph--faded > svg, .ph--faded > img, .ph--faded [data-photo-slot] { filter: sepia(.45) saturate(1.25) hue-rotate(-18deg) contrast(.86) brightness(1.08) blur(.45px); }
.ph--faded::before { content: ""; position: absolute; inset: 4.5%; z-index: 1; pointer-events: none; background: linear-gradient(120deg, rgba(255,120,90,.2), rgba(255,220,150,.12) 60%, rgba(255,90,120,.16)); mix-blend-mode: screen; }

/* 1990年代 日付入りコンパクトカメラ  data-stamp="'93  6 12" */
.ph--date > svg, .ph--date > img, .ph--date [data-photo-slot] { filter: saturate(1.15) contrast(1.05) blur(.35px); }
.ph--date[data-stamp]::before { content: attr(data-stamp); position: absolute; right: 5%; bottom: 5%; z-index: 3; font: 700 clamp(11px, 2.6vw, 17px)/1 "DotGothic16", ui-monospace, monospace; letter-spacing: .12em; color: #ff8a1f; text-shadow: 0 0 4px rgba(255,90,0,.9), 0 0 1px #ffb060; white-space: pre; }

/* 2000年代 初期デジカメ(粗い) */
.ph--digi > svg, .ph--digi > img, .ph--digi [data-photo-slot] { filter: contrast(.92) saturate(.85) blur(.7px); image-rendering: pixelated; }
.ph--digi::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 8px, transparent 8px 16px), repeating-linear-gradient(90deg, rgba(0,0,0,.03) 0 8px, transparent 8px 16px); }
.ph--digi::after { opacity: .9; }

/* スマホ写真 */
.ph--phone::after { opacity: .28; }

/* ---------- 資料を撮った写真(台) ---------- */
.shot { position: relative; padding: clamp(16px, 5vw, 44px); overflow: hidden; isolation: isolate; }
.shot > .doc, .shot > .ph { transform: rotate(var(--tilt, -1.6deg)); }
.shot::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 6; background: radial-gradient(90% 70% at 30% 20%, rgba(255,255,255,.14), transparent 60%), radial-gradient(120% 100% at 50% 50%, transparent 55%, rgba(0,0,0,.4)); }
.shot--tatami { background: repeating-linear-gradient(90deg, #b7a86a 0 3px, #a99b5e 3px 5px, #beb074 5px 8px), #b3a466; }
.shot--cork { background-color: #b78a57; background-image: var(--noise-coarse), radial-gradient(circle at 20% 30%, rgba(90,50,20,.35) 0 1.5px, transparent 2px), radial-gradient(circle at 70% 60%, rgba(60,30,10,.3) 0 2px, transparent 2.5px); background-size: auto, 23px 19px, 31px 27px; }
.shot--desk { background: linear-gradient(180deg, #5d4634, #46342680), repeating-linear-gradient(92deg, #6a4f3a 0 14px, #604732 14px 31px, #725641 31px 40px); }
.shot--box { background: #a98558; background-image: var(--noise-coarse), linear-gradient(90deg, rgba(0,0,0,.18), transparent 12%, transparent 86%, rgba(0,0,0,.22)); }
.shot--glass { background: #20231f; }

/* 拡大できるもの */
[data-zoom] { cursor: zoom-in; }
[data-zoom]:focus-visible { outline: 3px solid #2a7fff; outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) { .doc, .ph { transition: none !important; } }
