/* ============================================================
   lab.css … FOREST LAB（秘密基地）ページ専用
   青緑の「方眼の工作マット」の上で、紙・マスキングテープ・工具が散らかっているイメージです。
   ============================================================ */
:root { --mat: #2c9288; --mat-deep: #217c73; --paper: #fffdf5; --tape: rgba(242, 182, 50, .85); --tape-red: rgba(200, 38, 45, .82); --tape-blue: rgba(63, 111, 224, .78); }

/* ---- 方眼マット（背景） ---- */
body.lab main {
  position: relative;
  background-color: var(--mat);
  background-image:
    linear-gradient(rgba(255,255,255,.55) 2px, transparent 2px),           /* 太い線：5マスごと */
    linear-gradient(90deg, rgba(255,255,255,.55) 2px, transparent 2px),
    linear-gradient(rgba(255,255,255,.22) 1px, transparent 1px),           /* 細い線：1マス */
    linear-gradient(90deg, rgba(255,255,255,.22) 1px, transparent 1px),
    radial-gradient(ellipse at 20% 0%, rgba(255,255,255,.18), transparent 55%);
  background-size: 140px 140px, 140px 140px, 28px 28px, 28px 28px, 100% 100%;
  background-position: -1px -1px, -1px -1px, -1px -1px, -1px -1px, 0 0;
  color: var(--ink);
}
/* マットのふちの目盛り（定規） */
body.lab main::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 22px; z-index: 1; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.9) 0 2px, transparent 2px 28px) 0 100% / 100% 12px no-repeat,
    repeating-linear-gradient(90deg, rgba(255,255,255,.9) 0 2px, transparent 2px 140px) 0 100% / 100% 22px no-repeat;
  opacity: .7;
}

/* ---- ヒーロー ---- */
.lab-hero { position: relative; overflow: hidden; padding: clamp(64px, 9vw, 120px) 0 clamp(56px, 8vw, 100px); color: #fff; }
.lab-hero__inner { width: min(1120px, 100% - 40px); margin-inline: auto; position: relative; z-index: 2; }
.lab-hero .crumb { color: #fff; }
.lab-hero .crumb a { border-color: rgba(255,255,255,.6); }
.lab-hero__badge { display: inline-block; transform: rotate(-4deg); background: var(--yellow); color: var(--ink); font-weight: 900; font-size: .85rem; letter-spacing: .16em; padding: .25em 1.1em; border-radius: 6px; box-shadow: 3px 3px 0 rgba(0,0,0,.25); }
.lab-hero__title { margin-top: .4em; font-family: var(--font-display); font-weight: 400; font-size: clamp(3.2rem, 11vw, 9rem); line-height: 1; letter-spacing: -.01em; text-shadow: 5px 5px 0 var(--mat-deep); }
.lab-hero__title span { display: inline-block; }
.lab-hero__title span:nth-child(2) { color: var(--yellow); transform: rotate(-3deg); }
.lab-hero__sub { margin-top: 1em; font-family: var(--font-heading, "Zen Maru Gothic", sans-serif); font-weight: 900; font-size: clamp(1.2rem, 2.6vw, 1.9rem); }
.lab-hero__lead { margin-top: .8em; max-width: 34em; font-weight: 500; line-height: 1.9; }
.lab-hero__tools { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.tool { position: absolute; width: clamp(48px, 7vw, 96px); color: #fff; opacity: .92; filter: drop-shadow(3px 4px 0 rgba(0,0,0,.18)); }
.tool--scissors { right: 8%; top: 14%; transform: rotate(18deg); animation: tool-wag 5s ease-in-out infinite; }
.tool--pencil { right: 22%; bottom: 10%; width: clamp(80px, 11vw, 160px); transform: rotate(-24deg); }
.tool--ruler { right: 4%; bottom: 18%; width: clamp(90px, 12vw, 170px); transform: rotate(8deg); }
.tool--gear { right: 30%; top: 8%; color: var(--yellow); animation: gear-spin 18s linear infinite; }
.tool--star { right: 14%; top: 52%; width: clamp(28px, 4vw, 52px); color: var(--red); animation: tool-wag 3.6s ease-in-out infinite reverse; }
@keyframes tool-wag { 0%,100% { transform: rotate(14deg); } 50% { transform: rotate(26deg); } }
@keyframes gear-spin { to { transform: rotate(360deg); } }

/* ---- 紙のシート ---- */
.lab-block { padding: clamp(40px, 6vw, 80px) 0; position: relative; z-index: 2; }
.lab-title { display: flex; flex-wrap: wrap; align-items: center; gap: .4em 1em; margin-bottom: clamp(24px, 4vw, 44px); color: #fff; }
.lab-title__en { position: relative; font-family: var(--font-display); font-size: clamp(1.9rem, 4.6vw, 3.4rem); line-height: 1.1; text-shadow: 3px 3px 0 var(--mat-deep); }
.lab-title__no { display: inline-block; background: var(--red); color: #fff; font-family: var(--font-display); font-size: .8rem; padding: .2em .7em; border-radius: 4px; transform: rotate(-4deg); box-shadow: 2px 2px 0 rgba(0,0,0,.25); }
.lab-title__ja { font-weight: 900; font-size: .95rem; letter-spacing: .1em; background: rgba(255,255,255,.18); padding: .15em .9em; border-radius: 999px; }
.sheet { position: relative; background: var(--paper); border-radius: 6px; padding: clamp(20px, 3vw, 32px); box-shadow: 0 2px 0 rgba(0,0,0,.08), 0 14px 26px rgba(8,50,46,.28); }
.sheet::before { content: ""; position: absolute; top: -13px; left: 50%; width: 92px; height: 26px; margin-left: -46px; background: var(--tape); transform: rotate(-3deg); box-shadow: 0 1px 2px rgba(0,0,0,.15); clip-path: polygon(0 8%, 4% 0, 8% 10%, 12% 0, 100% 0, 100% 100%, 12% 100%, 8% 90%, 4% 100%, 0 92%); }
.sheet--red::before { background: var(--tape-red); }
.sheet--blue::before { background: var(--tape-blue); }
.sheet--tilt-l { transform: rotate(-1.4deg); }
.sheet--tilt-r { transform: rotate(1.2deg); }
.cut-line { border: 2px dashed rgba(29,43,46,.35); border-radius: 4px; padding: clamp(14px, 2vw, 22px); }

/* ---- 01 Instagram ---- */
.insta-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 36px); align-items: start; }
.insta-slot { min-height: 360px; display: grid; place-items: stretch; }
.insta-slot iframe { width: 100%; height: 520px; border: 0; border-radius: 4px; background: #fff; }
.insta-empty { display: grid; place-items: center; text-align: center; min-height: 360px; padding: 1.4em; border: 2px dashed rgba(29,43,46,.3); border-radius: 4px; font-size: .85rem; font-weight: 700; color: rgba(29,43,46,.6); background: repeating-linear-gradient(135deg, rgba(134,223,210,.2) 0 14px, transparent 14px 28px); }
.insta-empty small { display: block; font-weight: 500; margin-top: .6em; word-break: break-all; }
.lab-more { margin-top: 24px; text-align: center; }

/* ---- 02 ピックアップ（EC） ---- */
.pick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 36px); }
.pick { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); background: var(--paper); border-radius: 6px; padding: 14px 14px 20px; box-shadow: 0 2px 0 rgba(0,0,0,.08), 0 14px 26px rgba(8,50,46,.28); position: relative; transition: transform .4s cubic-bezier(.2,1.1,.3,1.3); }
.pick:nth-child(1) { transform: rotate(-1.6deg); } .pick:nth-child(2) { transform: rotate(1deg); } .pick:nth-child(3) { transform: rotate(-.8deg); }
.pick:hover, .pick:focus-visible { transform: rotate(0) translateY(-10px) scale(1.02); }
.pick::before { content: "PICK UP"; position: absolute; top: -12px; left: 14px; z-index: 3; background: var(--red); color: #fff; font-family: var(--font-display); font-size: .7rem; letter-spacing: .12em; padding: .25em .8em; border-radius: 4px; transform: rotate(-4deg); box-shadow: 2px 2px 0 rgba(0,0,0,.2); }
.pick .ph { aspect-ratio: 1; border-radius: 3px; }
.pick__shop { margin-top: 14px; font-size: .75rem; font-weight: 900; letter-spacing: .08em; color: var(--tiff-text); }
.pick__name { font-family: var(--font-heading, "Zen Maru Gothic", sans-serif); font-weight: 900; font-size: 1.1rem; line-height: 1.45; }
.pick__text { font-size: .86rem; color: var(--gray); margin-top: .2em; }
.pick__go { margin-top: auto; padding-top: 12px; font-weight: 900; color: var(--orange); }

/* ---- 03 ギャラリー（流れる帯） ---- */
.marquee { position: relative; overflow: hidden; padding: 28px 0; background: rgba(255,255,255,.14); border-block: 3px dashed rgba(255,255,255,.7); z-index: 2; }
.marquee__track { display: flex; width: max-content; animation: marquee 70s linear infinite; }
.marquee:hover .marquee__track, .marquee:focus-within .marquee__track { animation-play-state: paused; }
.marquee__list { display: flex; gap: 22px; padding-right: 22px; list-style: none; }
@keyframes marquee { to { transform: translateX(-50%); } }
.shot { display: block; width: 270px; padding: 10px 10px 0; background: var(--paper); border: 0; border-radius: 4px; box-shadow: 0 10px 20px rgba(8,50,46,.3); cursor: zoom-in; font: inherit; color: var(--ink); text-align: left; transition: transform .35s cubic-bezier(.2,1.1,.3,1.3); }
.marquee__list li:nth-child(odd) .shot { transform: rotate(-2deg); } .marquee__list li:nth-child(even) .shot { transform: rotate(1.8deg) translateY(10px); }
.shot:hover, .shot:focus-visible { transform: rotate(0) scale(1.07); }
.shot__img { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--tiff-light) repeating-linear-gradient(135deg, rgba(255,255,255,.45) 0 12px, transparent 12px 24px); display: grid; place-items: center; font-family: var(--font-display); color: rgba(29,43,46,.35); font-size: 1.6rem; }
.shot__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shot__cap { display: block; padding: 8px 2px 10px; font-weight: 900; font-size: .85rem; line-height: 1.4; }
.gallery-hint { margin-top: 14px; text-align: center; color: #fff; font-weight: 700; font-size: .85rem; }

@media (prefers-reduced-motion: reduce) {
  .marquee { overflow-x: auto; }
  .marquee__track { animation: none; }
  .tool { animation: none !important; }
}

/* ---- ポップアップ（ギャラリー・雑誌 共通） ---- */
dialog.pop { width: min(920px, 94vw); max-height: 92vh; padding: 0; border: 0; border-radius: 10px; background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px rgba(0,0,0,.5); overflow: auto; }
dialog.pop::backdrop { background: rgba(10, 38, 36, .72); }
.pop__close { position: absolute; top: 10px; right: 10px; z-index: 5; width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--ink); color: #fff; font-size: 1.3rem; cursor: pointer; transition: background .25s; }
.pop__close:hover { background: var(--red); }
.pop__img { display: block; width: 100%; max-height: 66vh; object-fit: contain; background: #e9f5f3; }
.pop__ph { display: grid; place-items: center; aspect-ratio: 16 / 9; background: var(--tiff-light) repeating-linear-gradient(135deg, rgba(255,255,255,.45) 0 14px, transparent 14px 28px); font-weight: 700; color: rgba(29,43,46,.5); }
.pop__body { padding: 20px 26px 28px; }
.pop__title { font-family: var(--font-heading, "Zen Maru Gothic", sans-serif); font-weight: 900; font-size: 1.3rem; }
.pop__text { margin-top: .5em; color: var(--gray); }

/* ---- 04 雑誌の試し読み ---- */
.mag-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); }
.mag-card { display: grid; grid-template-columns: minmax(120px, 190px) 1fr; gap: 24px; align-items: center; }
.mag-card__cover { aspect-ratio: 148 / 210; border-radius: 4px; box-shadow: 8px 10px 0 rgba(29,43,46,.18); }
.mag-card__title { font-family: var(--font-heading, "Zen Maru Gothic", sans-serif); font-weight: 900; font-size: 1.35rem; line-height: 1.35; }
.mag-card__text { margin: .5em 0 1em; font-size: .9rem; color: var(--gray); }
.mag-card .btn { cursor: pointer; font: inherit; font-weight: 700; }

/* 雑誌ビューア（右綴じ） */
.viewer { padding: 18px 18px 22px; background: #1d2b2e; color: #fff; }
.viewer__name { font-family: var(--font-heading, "Zen Maru Gothic", sans-serif); font-weight: 900; padding-right: 50px; margin-bottom: 10px; }
.viewer__stage { position: relative; display: flex; justify-content: center; align-items: stretch; gap: 0; min-height: 40vh; background: #0f1a1c; border-radius: 6px; padding: 14px; overflow: hidden; touch-action: pan-y; }
.viewer__page { flex: 0 0 auto; display: grid; place-items: center; min-width: 0; }
.viewer__page canvas { display: block; max-width: 100%; height: auto; box-shadow: 0 6px 20px rgba(0,0,0,.5); background: #fff; }
.viewer__page--empty { visibility: hidden; }
.viewer__spine { width: 2px; background: linear-gradient(rgba(255,255,255,.0), rgba(255,255,255,.35), rgba(255,255,255,0)); }
.viewer__stage.is-flip { animation: page-flip .35s ease; }
@keyframes page-flip { from { opacity: .2; transform: scale(.985); } to { opacity: 1; transform: none; } }
.viewer__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.viewer__btn { border: 0; border-radius: 999px; background: var(--tiff); color: var(--ink); font: inherit; font-weight: 900; padding: .6em 1.4em; cursor: pointer; transition: background .25s, opacity .25s; }
.viewer__btn:hover:not(:disabled) { background: #fff; }
.viewer__btn:disabled { opacity: .35; cursor: not-allowed; }
.viewer__count { font-weight: 700; font-size: .9rem; }
.viewer__msg { padding: 3em 1em; text-align: center; font-size: .92rem; line-height: 1.9; }
.viewer__msg a { color: var(--tiff); border-bottom: 1px solid currentColor; }
.viewer__help { margin-top: 10px; font-size: .78rem; opacity: .8; text-align: center; }

/* ---- ひみつ基地の一言 ---- */
.lab-note { margin-top: 20px; color: #fff; font-weight: 700; text-align: center; }

@media (max-width: 860px) {
  .insta-grid, .pick-grid, .mag-grid { grid-template-columns: 1fr; }
  .mag-card { grid-template-columns: 110px 1fr; gap: 16px; }
  .tool--pencil, .tool--ruler { display: none; }
  .shot { width: 220px; }
  .insta-slot iframe { height: 480px; }
  .viewer__btn { padding: .55em 1em; font-size: .85rem; }
  .sheet--tilt-l, .sheet--tilt-r, .pick:nth-child(n) { transform: none; }
}


/* ============================================================
   固定ブログ風レイアウト：「画像・ビューア」と「文章」を横に並べるセット
   .post … 左に大きな画像／ビューア、右に文章。.post--rev で左右を入れ替え。スマホでは縦に積みます。
   ============================================================ */
.post { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; margin-bottom: clamp(48px, 7vw, 88px); }
.post:last-child { margin-bottom: 0; }
.post--rev { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); }
.post--rev .post__img { order: 2; }
.post--mag { grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); align-items: start; }
.post__img { display: block; text-decoration: none; }
.post__img .ph { aspect-ratio: 4 / 3; border-radius: 3px; }
.post__img .insta-slot { min-height: 0; }
.post__body { color: #fff; }
.post__label { display: inline-block; background: var(--red); color: #fff; font-family: var(--font-display); font-size: .78rem; letter-spacing: .06em; padding: .2em .8em; border-radius: 2px; transform: rotate(-1.5deg); }
.post__title { margin-top: .6em; font-family: var(--font-heading, "Zen Maru Gothic", sans-serif); font-weight: 900; font-size: clamp(1.4rem, 2.8vw, 2.1rem); line-height: 1.4; text-shadow: 2px 2px 0 rgba(0,0,0,.18); }
.post__text { margin: .8em 0; font-weight: 500; line-height: 1.95; }
.post__body .btn { margin-top: .4em; }
.caption[hidden] { display: none; }
.viewer--inline { padding: clamp(14px, 2vw, 22px); background: #1d2b2e; color: #fff; }
.viewer--inline::before { background: var(--tape-red); }
.viewer__tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; padding-right: 0; }
.viewer__tab { border: 0; border-radius: 999px; padding: .45em 1.2em; background: rgba(255,255,255,.14); color: #fff; font: inherit; font-weight: 900; font-size: .85rem; cursor: pointer; transition: background .2s, color .2s; }
.viewer__tab:hover { background: rgba(255,255,255,.28); }
.viewer__tab.is-on { background: var(--yellow); color: var(--ink); }
.viewer--inline .viewer__name { padding-right: 0; }
.viewer--inline .viewer__stage { min-height: 280px; overflow: hidden; }
@media (max-width: 860px) {
  .post, .post--rev, .post--mag { grid-template-columns: minmax(0, 1fr); }
  .post--rev .post__img { order: 0; }
}
.shot__cap:empty { display: none; }

/* 雑誌ビューアの拡大表示 */
.viewer__zoom { margin-left: auto; }
.sheet.viewer.is-full, .viewer.viewer--inline.is-full { position: fixed !important; inset: 0 !important; width: auto !important; z-index: 9999; margin: 0 !important; max-width: none !important; overflow: auto; display: flex; flex-direction: column; border-radius: 0; transform: none !important; }
.viewer.is-full .viewer__stage { flex: 1; min-height: 0; }
.mag-lock, .mag-lock body { overflow: hidden; }

/* ズーム操作 */
.viewer__zoomtools { display: none; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.viewer.is-full .viewer__zoomtools { display: flex; }
.viewer__btn--sm { padding: .35em 1em; font-size: .9rem; }
.viewer__zoomval { min-width: 3.4em; text-align: center; font-weight: 900; }
.viewer__zoomhint { font-size: .78rem; opacity: .75; }
.viewer.is-full .viewer__stage { overflow: auto; justify-content: flex-start; }
.viewer.is-full .viewer__stage > :first-child { margin-left: auto; }
.viewer.is-full .viewer__stage > :last-child { margin-right: auto; }
.viewer__stage.is-zoomed { cursor: grab; }
.viewer__stage.is-drag { cursor: grabbing; user-select: none; }
.viewer.is-full .viewer__page canvas { max-width: none; }
.viewer.is-full .viewer__help { display: none; }
