/* MAGAZINE page (from the magazine-page folder). Loaded after css/style.css on magazine.html only.
   The header, + menu, body, links and buttons come from style.css like every other page;
   this file only adds the magazine counter, page grid and full-screen page viewer. */
:root {
  --bg: #fff; --fg: #000; --dim: #6b6b6b; --nav: #767676; --red: #ff1a1a; --fill: #f3f3f3;
}
body.locked { overflow: hidden; }
button:focus-visible, a:focus-visible { outline: 1px solid var(--fg); outline-offset: 3px; }
[hidden] { display: none !important; }

/* Page */
.page-wide {
  max-width: 1760px; margin: 0 auto; padding-block: 40px 96px;
  padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px));
}
.mag-title { margin: 0; font-size: 14px; font-weight: 400; color: var(--fg); letter-spacing: 0.06em; }
.eyebrow { font-size: 14px; color: var(--dim); }

/* Issues + page grid */
.issues-run { display: flex; flex-direction: column; gap: 96px; }
.issue-block { display: flex; flex-direction: column; gap: 24px; }
.issue-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 24px; flex-wrap: wrap; border-bottom: 1px solid var(--fg); padding-bottom: 12px; font-size: 14px; }
.issue-head .name { font-size: 18px; }
.issue-note { font-size: 13px; line-height: 1.7; color: var(--dim); max-width: 68ch; }
.page-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 40px 24px; }   /* 8 per row (was 6, 2026-11-13); gaps unchanged */
.pg { display: flex; flex-direction: column; gap: 12px; text-align: left; width: 100%; min-width: 0; }
.pg-frame { width: 100%; max-width: 100%; aspect-ratio: 3 / 4; background: var(--fill); overflow: hidden; position: relative; }
.pg-frame img { display: block; width: 100%; height: 100%; object-fit: cover; transition: opacity .3s; }
.pg:hover .pg-frame img { opacity: .86; }
.pg-cap { display: flex; justify-content: space-between; gap: 8px; font-size: 8px;   /* was 11px at 6 per row; scaled with the smaller squares */ color: var(--dim); font-variant-numeric: tabular-nums; }
.ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px; font-size: 11px; color: var(--dim); background: var(--fill); }
.ph.cover { border: 1px solid var(--fg); background: var(--bg); color: var(--fg); flex-direction: column; gap: 6px; }
.ph.cover b { font-weight: 400; font-size: 13px; }

/* Full-screen page viewer (class renamed .viewer -> .mag-viewer; the Work page owns .viewer) */
.mag-viewer {
  position: fixed; inset: 0; z-index: 20; background: var(--bg);
  display: flex; flex-direction: column; gap: 16px;
  padding-block: calc(12px + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-bottom, 0px));
  padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px));
}
.v-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: 14px; min-height: 44px; }
.v-bar .where { display: flex; gap: 16px; flex-wrap: wrap; align-items: baseline; }
.v-bar .where .name { font-size: 18px; }
.v-close { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.v-manifesto { border-top: 1px solid var(--fg); padding-top: 14px; display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 8px 24px; font-size: 13px; line-height: 1.7; }
.v-manifesto .label { color: var(--dim); }
.v-manifesto .prose { max-width: 78ch; max-height: 6.8em; overflow: auto; }
.v-stage { flex: 1; min-height: 0; display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px; align-items: center; gap: 8px; }
.v-page { height: 100%; min-height: 0; display: flex; align-items: center; justify-content: center; position: relative; }
.v-page img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.v-page .ph-big { height: 100%; aspect-ratio: 3 / 4; max-width: 100%; position: relative; }
.v-arrow { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; }
.v-arrow:hover { color: var(--dim); }
.v-arrow[disabled] { opacity: .2; cursor: default; }
.v-foot { display: flex; align-items: center; gap: 16px; font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }
.v-ruler { flex: 1; height: 9px; display: flex; gap: 2px; align-items: flex-end; }
.v-ruler span { flex: 1; height: 5px; background: #d6d6d6; }
.v-ruler span.cover { height: 9px; }
.v-ruler span.on { background: var(--red); }

.preview-note { font-size: 11px; color: var(--dim); }

/* Full-screen view for a page that has no image yet: its grey placeholder, sized like a page (3:4) */
.lb-ph { position: relative; flex: none; outline: none; cursor: zoom-out; background: var(--fill); }
.lb-ph .ph { font-size: 14px; }
.lb-ph .ph.cover b { font-size: 18px; }

@media (max-width: 1100px) { .page-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }   /* was 4 */
@media (max-width: 760px) {
  .page-wide { padding-block: 24px 72px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .issues-run { gap: 72px; }
  .page-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 12px; }   /* was 3 */
  .mag-viewer { gap: 12px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .v-manifesto { grid-template-columns: minmax(0, 1fr); gap: 4px; font-size: 12px; }
  .v-manifesto .prose { max-height: 5.2em; }
  .v-stage { grid-template-columns: minmax(0, 1fr); position: relative; }
  .v-arrow { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.85); width: 44px; height: 44px; }
  .v-arrow.prev { left: 0; } .v-arrow.next { right: 0; }
}
@media (max-width: 480px) { .page-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }   /* was 2 */

.v-foot > span { white-space: nowrap; }
.v-ruler { min-width: 0; overflow: hidden; }
.v-ruler span { min-width: 0; }
/* With hundreds of pages the bar is a thin line with a red mark for where you are */
.v-ruler { gap: 0; align-items: center; height: 11px; }
.v-ruler span { height: 1px; background: #c8c8c8; }
.v-ruler span.cover { height: 7px; width: 1px; flex: 0 0 1px; background: #8a8a8a; }
.v-ruler span.on { height: 11px; flex: 0 0 2px; background: var(--red); }
