/* /magazine — the Retail Product Guide reader. Inherits styles.css tokens.
   Desktop: two-page spread with page turns. Phone: single column, swipe/scroll,
   no curl gimmick, big touch targets, tap to zoom. */

.mag-reader { padding-top: 96px; }

/* ── toolbar ── */
.mag-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 8px; padding-bottom: 12px; }
.mag-jump { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.mag-jump-label { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.mag-jump select { appearance: none; -webkit-appearance: none; font: 600 12.5px/1.2 var(--font-sans); letter-spacing: .04em; color: var(--ink); background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23141210' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center; border: 1px solid var(--line-2); border-radius: 100px; padding: 11px 38px 11px 18px; max-width: min(62vw, 360px); text-overflow: ellipsis; cursor: pointer; transition: border-color .25s var(--ease); }
.mag-jump select:hover, .mag-jump select:focus-visible { border-color: var(--red); outline: none; }
.mag-tools { display: flex; align-items: center; gap: 10px; }
.mag-count { font-size: 12px; font-weight: 700; letter-spacing: .14em; color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 6px; white-space: nowrap; }
.mag-tool { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 100px; border: 1px solid var(--line-2); background: var(--paper); color: var(--ink); cursor: pointer; text-decoration: none; transition: border-color .25s var(--ease), color .25s var(--ease); }
.mag-tool--text { width: auto; padding: 0 16px; font-size: 12px; font-weight: 700; letter-spacing: .14em; }
.mag-tool:hover, .mag-tool:focus-visible { border-color: var(--red); color: var(--red); outline: none; }
.mag-tool:active { transform: translateY(1px); }

/* ── stage ── */
.mag-stage { position: relative; background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: clamp(16px, 2.4vw, 32px) 0; }
.mag-stage.is-full { position: fixed; inset: 0; z-index: 200; padding: 16px; display: flex; align-items: center; justify-content: center; border: 0; background: var(--paper-2); }
.mag-stage.is-full .mag-arrow--prev { left: 24px; }
.mag-stage.is-full .mag-arrow--next { right: 24px; }
.mag-stage:fullscreen { background: var(--paper-2); }
.mag-frame { margin: 0 auto; width: min(100% - 2 * var(--gutter) - 2 * 64px, calc(var(--maxw) - 2 * var(--gutter)), calc((100vh - 190px) * 1.414)); }
.mag-book { width: 100%; }
.mag-fsbar { display: none; }
.mag-stage.is-full .mag-fsbar { display: flex; align-items: center; gap: 14px; position: absolute; top: 14px; right: 18px; z-index: 3; }
.mag-fscount { font-size: 12px; font-weight: 700; letter-spacing: .14em; color: var(--muted); font-variant-numeric: tabular-nums; }
.mag-exit { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 100px; border: 1px solid var(--line-2); background: var(--paper); color: var(--ink); font: 700 12px/1 var(--font-sans); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }
.mag-exit:hover, .mag-exit:focus-visible { border-color: var(--red); color: var(--red); outline: none; }
.mag-page { margin: 0; background: #fff; box-shadow: 0 1px 0 rgba(20,18,16,.06), 0 18px 40px -22px rgba(20,18,16,.35); }
.mag-page img { display: block; width: 100%; height: auto; cursor: zoom-in; }
.mag-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 100px; border: 1px solid var(--line-2); background: var(--paper); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: border-color .25s var(--ease), color .25s var(--ease), opacity .25s var(--ease); z-index: 2; }
.mag-arrow--prev { left: max(10px, calc((100vw - var(--maxw)) / 2 + var(--gutter) - 66px)); }
.mag-arrow--next { right: max(10px, calc((100vw - var(--maxw)) / 2 + var(--gutter) - 66px)); }
.mag-arrow:hover, .mag-arrow:focus-visible { border-color: var(--red); color: var(--red); outline: none; }
.mag-arrow:active { transform: translateY(-50%) scale(.96); }
.mag-arrow[disabled] { opacity: .3; pointer-events: none; }
.mag-hint { text-align: center; font-size: 12px; color: var(--muted); letter-spacing: .04em; margin: 14px 0 0; }
.mag-hint.is-hidden { display: none; }

/* page-flip owns the book on desktop */
.mag-stage.is-full .mag-frame { width: min(100% - 140px, calc((100vh - 32px) * 1.414)); }
.mag-book.is-flip .mag-page { box-shadow: none; }
.mag-book.is-flip .mag-page img { cursor: zoom-in; }
.stf__parent { margin: 0 auto; }
.stf__block { box-shadow: none; }
/* shadow belongs to the paper, not the frame: a closed book only shadows its cover */
.stf__item { box-shadow: 0 18px 40px -22px rgba(20,18,16,.45), 0 1px 0 rgba(20,18,16,.06); background: #fff; }

/* ── phone: swipe reader. One page per screen width, native scroll-snap, swipe to turn. ── */
@media (max-width: 899px) {
  .mag-reader { padding-top: 84px; }
  .mag-frame { width: 100%; }
  .mag-toolbar { position: sticky; top: 60px; z-index: 90; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding-top: 10px; padding-bottom: 10px; }
  .mag-jump-label { display: none; }
  .mag-count { margin-right: 2px; }
  #mag-full { display: none; }
  .mag-jump { flex: 1; min-width: 0; }
  .mag-jump select { max-width: 100%; width: 100%; }
  .mag-stage { padding: 12px 0 8px; border-top: 0; }
  .mag-book { width: 100%; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .mag-book::-webkit-scrollbar { display: none; }
  .mag-page { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; margin: 0; padding: 0 var(--gutter); box-sizing: border-box; background: transparent; box-shadow: none; }
  .mag-page img { box-shadow: 0 1px 0 rgba(20,18,16,.06), 0 14px 32px -20px rgba(20,18,16,.35); background: #fff; }
  .mag-arrow { display: none; }
  .mag-hint { padding: 0 var(--gutter); }
}
@media (min-width: 900px) {
  .mag-arrow { display: inline-flex; }
}

/* ── zoom dialog: a full-screen reader. Page fits the screen, tap the right/left third to turn,
   swipe to turn, pinch to zoom (browser-native), X or the back gesture to leave. ── */
.mag-zoom { border: 0; padding: 0; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; height: 100dvh; background: #141210; color: #fff; overflow: hidden; }
.mag-zoom::backdrop { background: #141210; }
.mag-zoom-scroll { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 8px 8px calc(84px + env(safe-area-inset-bottom, 0px)); padding-top: calc(8px + env(safe-area-inset-top, 0px)); touch-action: pan-x pan-y pinch-zoom; user-select: none; -webkit-user-select: none; }
.mag-zoom-scroll img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; margin: 0; box-shadow: 0 10px 40px rgba(0,0,0,.5); -webkit-user-drag: none; }
.mag-zoom-scroll img.is-turning { animation: mag-turn .22s var(--ease); }
@keyframes mag-turn { from { opacity: .35; transform: translateX(var(--dir, 12px)); } to { opacity: 1; transform: none; } }
.mag-zoom-close { position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; width: 44px; height: 44px; border-radius: 100px; border: 1px solid rgba(255,255,255,.3); background: rgba(20,18,16,.6); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; z-index: 3; }
.mag-zoom-close:hover, .mag-zoom-close:focus-visible { border-color: #fff; outline: none; }
.mag-zoom-bar { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 6px; border-radius: 100px; background: rgba(20,18,16,.72); border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(8px); z-index: 3; }
.mag-zoom-nav { width: 44px; height: 44px; border-radius: 100px; border: 1px solid rgba(255,255,255,.3); background: transparent; color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.mag-zoom-nav:hover, .mag-zoom-nav:focus-visible { border-color: #fff; outline: none; }
.mag-zoom-nav[disabled] { opacity: .3; pointer-events: none; }
.mag-zoom-count { color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .14em; font-variant-numeric: tabular-nums; min-width: 64px; text-align: center; }
.mag-zoom-tip { position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); white-space: nowrap; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.9); background: rgba(20,18,16,.72); border: 1px solid rgba(255,255,255,.18); border-radius: 100px; padding: 8px 14px; pointer-events: none; transition: opacity .6s var(--ease); z-index: 2; }
.mag-zoom-tip.is-gone { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .mag-zoom-scroll img.is-turning { animation: none; } }

/* ── text list ── */
.mag-lines { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: clamp(22px, 3vw, 36px) clamp(26px, 4vw, 56px); }
.mag-line { border-top: 2px solid var(--line, var(--line-2)); padding-top: 16px; }
.mag-line-head { display: grid; grid-template-columns: 10px 1fr auto; grid-template-rows: auto auto; column-gap: 12px; align-items: baseline; color: var(--ink); text-decoration: none; }
.mag-line-chip { grid-row: 1 / 3; width: 10px; height: 10px; border-radius: 50%; background: var(--line); align-self: center; }
.mag-line-name { font-family: var(--font-display); font-size: 26px; font-weight: 500; line-height: 1.05; }
.mag-line-name b { font-weight: 500; }
.mag-line-brand { font-family: var(--font-sans); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-left: 8px; }
.mag-line-hair { grid-column: 2; font-size: 13px; color: var(--ink-soft); margin-top: 4px; }
.mag-line-pg { grid-column: 3; grid-row: 1 / 3; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); align-self: center; transition: color .25s var(--ease); }
.mag-line-head:hover .mag-line-pg, .mag-line-head:focus-visible .mag-line-pg { color: var(--red); }
.mag-line-head:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; border-radius: 2px; }
.mag-products { list-style: none; margin: 14px 0 0; padding: 0; }
.mag-products li { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.mag-prod-name { font-weight: 600; }
.mag-prod-size { font-size: 12px; color: var(--muted); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.mag-prod-price { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mag-prod-price small { font-weight: 500; color: var(--muted); }
.mag-note { margin-top: clamp(28px, 4vw, 44px); font-size: 12.5px; color: var(--muted); max-width: 60ch; line-height: 1.6; }
.mag-note a { color: var(--red); }

@media (prefers-reduced-motion: reduce) { .mag-tool, .mag-arrow, .mag-jump select { transition: none; } }
