/* Patrick Media - one stylesheet for every new page.
   Paper, ink, one typeface. No accent colour, no dark mode. */

/* ---------- Type: Inter Tight (OFL), self-hosted variable font, weights 400 to 700 ---------- */
@font-face {
  font-family: "Inter Tight";
  font-weight: 400 700;
  font-style: normal;
  font-display: block;
  src: url("/assets/fonts/inter-tight.woff2") format("woff2");
}

/* ---------- Tokens ---------- */
:root {
  --paper: #EEE9DF;
  --panel: #F4F0E8;
  --ink: #1C1A17;
  --ink-2: #5A554D;
  --rule: #1C1A17;
  --rule-25: rgba(28, 26, 23, .25);

  --font: "Inter Tight", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1280px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body, h1, h2, h3, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, video, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ---------- Paper grain: ~22% multiply over everything ---------- */
body.pm-grain::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: .22;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.11 0 0 0 0 0.10 0 0 0 0 0.09 0 0 0 1.2 -0.1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 240px 240px;
}

/* ---------- Shell gate: pm.js builds the header and footer, which would push the
   page down after first paint. Hide main and the footer until it has run
   (body.pm-ready); the animation is the failsafe if scripts never run. ---------- */
body.pm-grain:not(.pm-ready) main,
body.pm-grain:not(.pm-ready) footer[data-pm-footer] { visibility: hidden; animation: pm-reveal 0s 1.5s forwards; }
@keyframes pm-reveal { to { visibility: visible; } }

/* ---------- Ink: the SVG filter #pm-ink is injected by pm.js ---------- */
.pm-ink { filter: url(#pm-ink); }

/* ---------- Type scale ---------- */
h1, h2, h3 { font-weight: 700; line-height: 1.08; letter-spacing: -.02em; }
h1 { font-size: clamp(26px, 3.4vw, 44px); }
h2 { font-size: clamp(20px, 2.2vw, 28px); }
h3 { font-size: 16px; letter-spacing: -.01em; }
p { max-width: 62ch; }
.pm-secondary { color: var(--ink-2); }

/* Masthead */
.pm-mast {
  font-weight: 700;
  font-size: clamp(44px, 9vw, 120px);
  line-height: .92;
  letter-spacing: -.04em;
  margin: 0;
}

/* Labels: small, uppercase, tracked */
.pm-label,
.pm-dateline {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* Dateline: the thin newspaper strip under the masthead */
.pm-dateline {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 24px;
  padding: 8px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
}

/* Columns: newspaper layout, hairline between them */
.pm-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}
.pm-cols > * {
  padding: 0 24px;
  border-left: 1px solid var(--rule-25);
}
.pm-cols > :first-child { padding-left: 0; border-left: 0; }
.pm-cols > :last-child { padding-right: 0; }

/* ---------- CTA: pill button ---------- */
.pm-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 22px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.pm-cta:hover { background: transparent; color: var(--ink); }
.pm-cta:focus-visible,
a:focus-visible,
button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---------- Table: hairline rows, last cell right-aligned ---------- */
.pm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.4;
  text-align: left;
}
.pm-table th,
.pm-table td {
  padding: 12px 16px 12px 0;
  border-bottom: 1px solid var(--rule-25);
  vertical-align: top;
  font-weight: 400;
}
.pm-table th {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .08em;
  border-bottom-color: var(--rule);
}
.pm-table th:last-child,
.pm-table td:last-child { padding-right: 0; text-align: right; }

/* ---------- Works: hover peek, viewer dialog, notes ---------- */
.pm-table[data-works] tr[data-kind] { cursor: pointer; }
.pm-table[data-works] tr[data-kind]:hover td,
.pm-table[data-works] tr[data-kind]:focus-visible td { background: var(--panel); }
.pm-table[data-works] tr[data-kind]:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.pm-note { display: block; margin-top: 2px; font-size: 12px; line-height: 1.35; color: var(--ink-2); }

[data-pm-peek] {
  position: fixed;
  z-index: 60;
  width: 240px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--ink);
  pointer-events: none;
}
[data-pm-peek][hidden] { display: none; }
[data-pm-peek] img { width: 100%; height: auto; max-height: 300px; object-fit: contain; }

dialog.pm-viewer {
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 12px;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  overflow: auto;
}
dialog.pm-viewer::backdrop { background: rgba(28, 26, 23, .72); }
.pm-viewer__close {
  display: block;
  margin: 0 0 12px auto;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.pm-viewer__close:hover { background: var(--ink); color: var(--paper); }
.pm-viewer__body iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; background: var(--ink); }
.pm-viewer__body video { width: 100%; max-height: 74vh; background: var(--ink); }
.pm-viewer__body img { max-width: 100%; max-height: 74vh; width: auto; height: auto; margin: 0 auto; }
.pm-viewer__cap { margin-top: 12px; }
.pm-viewer__note { margin-top: 4px; font-size: 12px; color: var(--ink-2); max-width: none; }
.pm-viewer__note:empty { display: none; }

/* ---------- Small screens ---------- */
@media (max-width: 600px) {
  .pm-cols { grid-template-columns: 1fr; }
  .pm-cols > * {
    padding: 16px 0;
    border-left: 0;
    border-top: 1px solid var(--rule-25);
  }
  .pm-cols > :first-child { padding-top: 0; border-top: 0; }

  /* Table rows become stacked list items */
  .pm-table,
  .pm-table tbody,
  .pm-table tr,
  .pm-table td { display: block; width: 100%; }
  .pm-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .pm-table tr { padding: 12px 0; border-bottom: 1px solid var(--rule-25); }
  .pm-table td { padding: 2px 0; border: 0; text-align: left; }
  .pm-table td:last-child { padding-right: 0; text-align: left; color: var(--ink-2); }
}

/* Touch targets: standalone links get a 44px hit area on phones and tablets. */
@media (max-width: 800px) {
  [data-pm-header] nav a:not(.pm-cta),
  [data-pm-header] > a.pm-label,
  .pm-issue a,
  .pm-lead__actions a:not(.pm-cta),
  .pm-works__head a,
  .pm-jump a { display: inline-flex; align-items: center; min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .pm-cta { transition: none; }
}

/* Consent banner: consent.js draws it inside a shadow root, so its paper-token skin lives in pm.js (CONSENT_CSS). */
