/* Guide figures (Read mode): the article frame, the figure panel, key facts, the exposure triangle,
   the "Keep going" card and the workflow strip. Loaded after public.css on every non-game guide.
   The frame applies to `.article-wrap.pk-article`, and also to any article wrap that holds a
   `.pk-fig-panel` (agency and rejection pages keep their pinned `<main>` markup this way).
   Every selector starts with `.pk-pub`, so nothing here can restyle another page. Figures are
   inline SVG drawn in the theme tokens; their static state is readable with no script. Spacing
   follows DESIGN.md (4/8/12/16/24/32/40). Motion: none, so reduced motion needs no rule. */

/* ── Key facts: three quiet cards under the title ── */
.pk-pub .pk-keyfacts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 0 0 32px; padding: 0; list-style: none; }
.pk-pub .pk-keyfacts li { margin: 0; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--s1);
  font-size: 14px; line-height: 1.55; color: var(--dim); }
.pk-pub .pk-keyfacts b { display: block; margin-bottom: 4px; font-size: 15px; font-weight: 600; color: var(--text); }
/* the guide's own `.article-wrap ul` and `li` rules are more specific, so these repeat the scope */
.pk-pub .article-wrap .pk-keyfacts { margin: 0 0 32px; padding: 0; list-style: none; }
.pk-pub .article-wrap .pk-keyfacts li { margin: 0; padding: 16px; }

/* ── Figure card ── */
.pk-pub .pk-fig { margin: 0; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--s1); }
.pk-pub .pk-fig-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 12px; }
.pk-pub .pk-fig-tag { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.pk-pub .pk-fig-title { font-size: 15px; font-weight: 600; color: var(--text); }
.pk-pub .pk-fig-stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: center; }
.pk-pub .pk-fig-stage--wide { grid-template-columns: minmax(0, 1fr); }
.pk-pub .pk-fig-iris { display: block; width: 100%; height: auto; }
.pk-pub .pk-fig-svg { display: block; width: 100%; height: auto; }
.pk-pub .pk-fig-housing { fill: var(--s2); stroke: var(--border2); stroke-width: 1; }
.pk-pub .pk-fig-blade { fill: var(--s3); stroke: var(--border2); stroke-width: .8; }
.pk-pub .pk-fig-iris [data-iris="opening"] { fill: rgba(var(--gold-rgb), .5); stroke: var(--gold); stroke-width: 1.2; }

.pk-pub .pk-fig-side { display: grid; gap: 12px; min-width: 0; }
.pk-pub .pk-fig-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 13px; line-height: 1.45; color: var(--text); }
.pk-pub .pk-fig-row b { font-size: 16px; font-weight: 600; }
.pk-pub .pk-fig-k { flex-basis: 100%; font-size: 12px; color: var(--dim); }
.pk-pub .pk-fig-bar { display: block; width: 100%; height: 10px; }
.pk-pub .pk-fig-track { fill: var(--s2); }
.pk-pub .pk-fig-fill { fill: var(--gold); }
.pk-pub .pk-fig-blur { display: block; width: 100%; height: auto; }
.pk-pub .pk-fig-disc { fill: rgba(var(--gold-rgb), .4); }
.pk-pub .pk-fig-subject { fill: var(--s3); stroke: var(--gold); stroke-width: 1.2; }

/* The stop ruler: the current stop is drawn in gold and bold */
.pk-pub .pk-fig-ruler { display: block; width: 100%; height: auto; margin-top: 16px; }
.pk-pub .pk-fig-axis { stroke: var(--border2); stroke-width: 1.2; }
.pk-pub .pk-tick line { stroke: var(--dim); stroke-width: 1; }
.pk-pub .pk-tick text { font-size: 11px; fill: var(--dim); text-anchor: middle; }
.pk-pub .pk-tick.is-on line { stroke: var(--gold); stroke-width: 2; }
.pk-pub .pk-tick.is-on text { fill: var(--text); font-weight: 600; }

/* Labels inside the diagrams */
.pk-pub .pk-fig-label { font-size: 11px; fill: var(--dim); text-anchor: middle; }
.pk-pub .pk-fig-label.is-strong { fill: var(--text); font-weight: 600; }

/* The sliders are native range inputs, so the keyboard and screen readers get them for free */
.pk-pub .pk-fig-ctl { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--text); }
.pk-pub .pk-fig-ctl > span { flex: 0 0 auto; min-width: 88px; }
.pk-pub .pk-fig-ctl input[type="range"] { flex: 1 1 auto; min-width: 0; min-height: 32px; accent-color: var(--gold); }
.pk-pub .pk-fig-ctl input[type="range"]:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.pk-pub .pk-fig figcaption { margin-top: 12px; font-size: 13px; line-height: 1.55; color: var(--dim); }

/* Three readouts side by side (depth of field: near, far, sharp zone) */
.pk-pub .pk-fig-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.pk-pub .pk-fig-trio div { padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--s2); min-width: 0; }
.pk-pub .pk-fig-trio span { display: block; font-size: 12px; color: var(--dim); }
.pk-pub .pk-fig-trio b { display: block; font-size: 15px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }

/* ── Depth of field ── */
.pk-pub .pk-dof-cam { fill: var(--s3); stroke: var(--border2); stroke-width: 1; }
.pk-pub .pk-dof-zone { fill: rgba(var(--gold-rgb), .22); }
.pk-pub .pk-dof-focus { stroke: var(--gold); stroke-width: 1.2; stroke-dasharray: 3 3; }
.pk-pub .pk-dof-subject { fill: var(--s3); stroke: var(--gold); stroke-width: 1.2; }

/* ── Shutter speed ── */
.pk-pub .pk-shut-frame { fill: var(--s2); stroke: var(--border2); stroke-width: 1; }
.pk-pub .pk-shut-slit { fill: rgba(var(--gold-rgb), .55); }
.pk-pub .pk-shut-subj { fill: var(--s3); stroke: var(--gold); stroke-width: 1; }

/* ── ISO ── */
.pk-pub .pk-iso-box { fill: var(--s2); stroke: var(--border2); stroke-width: 1; }
.pk-pub .pk-iso-fill { fill: rgba(var(--gold-rgb), .45); }
.pk-pub .pk-iso-amp { fill: var(--s3); stroke: var(--border2); stroke-width: 1; }
.pk-pub .pk-iso-frame { fill: var(--s2); stroke: var(--border2); stroke-width: 1; }
.pk-pub .pk-iso-pic { fill: var(--text); }
.pk-pub .pk-iso-eq { font-size: 13px; font-weight: 600; fill: var(--text); text-anchor: middle; }

/* ── Histogram: the bins, the clipped stripe and the black-to-white strip ── */
.pk-pub .pk-hist-bar { fill: var(--s3); stroke: var(--border2); stroke-width: .4; }
.pk-pub .pk-hist-clip { fill: url(#pk-fig-stripe); stroke: var(--gold); stroke-width: .6; }
.pk-pub .pk-hist-axis { stroke: var(--border2); stroke-width: 1; }

/* ── Article frame (opt-in). Phones and tablets keep the single column; the panel drops
   inline after the first paragraph. From 1180px the title and key facts span the top, and the
   prose sits beside a sticky figure panel. ── */
@media (min-width: 1180px) {
  .pk-pub .article-wrap:is(.pk-article, :has(> .pk-fig-panel)) { display: grid; grid-template-columns: minmax(0, 1fr) 380px; column-gap: 56px;
    align-items: start; max-width: 1180px; }
  .pk-pub .article-wrap:is(.pk-article, :has(> .pk-fig-panel)) > .article-breadcrumb,
  .pk-pub .article-wrap:is(.pk-article, :has(> .pk-fig-panel)) > h1,
  .pk-pub .article-wrap:is(.pk-article, :has(> .pk-fig-panel)) > .article-meta,
  .pk-pub .article-wrap:is(.pk-article, :has(> .pk-fig-panel)) > .pk-keyfacts,
  .pk-pub .article-wrap:is(.pk-article, :has(> .pk-fig-panel)) > .pk-flow { grid-column: 1 / -1; min-width: 0; }
  .pk-pub .article-wrap:is(.pk-article, :has(> .pk-fig-panel)) > * { min-width: 0; }
  .pk-pub .article-wrap:is(.pk-article, :has(> .pk-fig-panel)) > .pk-fig-panel { grid-column: 2; grid-row: 5 / span 60; position: sticky; top: 88px; margin: 0; }
  /* public.css gives a page with a `.toc` a TOC rail in column 2; the figure panel owns that column
     here, so the contents stay in the reading column. Same specificity as the rail, loaded later. */
  .pk-pub .article-wrap:is(.pk-article, :has(> .pk-fig-panel)) > .toc { grid-column: 1; grid-row: auto; position: static; margin: 0 0 32px; }
  .pk-pub .article-wrap:is(.pk-article, :has(> .pk-fig-panel)) > p,
  .pk-pub .article-wrap:is(.pk-article, :has(> .pk-fig-panel)) > ul,
  .pk-pub .article-wrap:is(.pk-article, :has(> .pk-fig-panel)) > ol { max-width: 720px; }
  .pk-pub .article-wrap:is(.pk-article, :has(> .pk-fig-panel)) > h2 { margin-top: 40px; }
}
@media (min-width: 1920px) {
  .pk-pub .article-wrap:is(.pk-article, :has(> .pk-fig-panel)) { max-width: 1280px; }
}
@media (max-width: 1179px) {
  .pk-pub .pk-fig-panel { margin: 24px 0; }
}
@media (min-width: 720px) {
  .pk-pub .pk-keyfacts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .pk-pub .pk-fig-stage { grid-template-columns: minmax(0, 1fr); }
  .pk-pub .pk-fig-trio { grid-template-columns: minmax(0, 1fr); }
}

/* ── Keep going: the panel for a guide with no figure of its own. Links to the game, the tool
   and the neighbouring guides, in the card style of the rest of the site. ── */
.pk-pub .pk-keep { margin: 0; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--s1); }
.pk-pub .pk-keep-title { margin: 0 0 12px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.pk-pub .pk-keep ul, .pk-pub .article-wrap .pk-keep ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pk-pub .pk-keep li, .pk-pub .article-wrap .pk-keep li { margin: 0; padding: 0; }
.pk-pub .pk-keep a { display: block; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--s2);
  font-size: 14px; line-height: 1.4; font-weight: 600; color: var(--text); text-decoration: none; }
.pk-pub .pk-keep a:hover { border-color: rgba(var(--gold-rgb), .55); }
.pk-pub .pk-keep a span { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: var(--dim); }
.pk-pub .pk-keep a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ── Workflow strip: four numbered stages across the page (one row from 720px) ── */
.pk-pub .pk-flow { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 0 0 32px; padding: 0; list-style: none; counter-reset: pkflow; }
.pk-pub .pk-flow li, .pk-pub .article-wrap .pk-flow li { position: relative; margin: 0; padding: 16px 16px 16px 56px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--s1); font-size: 14px; line-height: 1.55; color: var(--dim); counter-increment: pkflow; }
.pk-pub .pk-flow li::before { content: counter(pkflow); position: absolute; left: 16px; top: 16px; width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; border: 1px solid rgba(var(--gold-rgb), .55); color: var(--gold); font-size: 13px; font-weight: 600; }
.pk-pub .pk-flow b { display: block; margin-bottom: 4px; font-size: 15px; font-weight: 600; color: var(--text); }
@media (min-width: 720px) {
  .pk-pub .pk-flow { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pk-pub .pk-flow li, .pk-pub .article-wrap .pk-flow li { padding: 16px; padding-top: 56px; }
  .pk-pub .pk-flow li::before { left: 16px; top: 16px; }
}

/* ── Exposure triangle: one shared figure; the current guide's corner is marked ── */
.pk-pub .pk-tri { margin-top: 16px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--s1); }
.pk-pub .pk-tri svg { display: block; width: 100%; max-width: 260px; height: auto; margin: 0 auto; }
.pk-pub .pk-tri-shape { fill: none; stroke: var(--border2); stroke-width: 1.5; }
.pk-pub .pk-tri-node { fill: var(--s2); stroke: var(--dim); stroke-width: 1.5; }
.pk-pub .pk-tri-node.is-current { fill: var(--gold); stroke: var(--gold); }
.pk-pub .pk-tri text { font-size: 11px; fill: var(--dim); text-anchor: middle; }
.pk-pub .pk-tri text.is-current { fill: var(--text); font-weight: 600; }
.pk-pub .pk-tri p { margin: 12px 0 0; font-size: 13px; line-height: 1.55; color: var(--dim); }
.pk-pub .pk-tri a { color: var(--pk-link); text-decoration: underline; text-decoration-color: rgba(var(--gold-rgb), .45); text-underline-offset: 3px; }
.pk-pub .pk-tri a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

/* Left- and right-aligned diagram labels (the centred default is `.pk-fig-label` alone) */
.pk-pub .pk-fig-label.is-start { text-anchor: start; }
.pk-pub .pk-fig-label.is-end { text-anchor: end; }
/* Histogram stripe pattern (used by the clipped bar), theme tokens */
.pk-pub .pk-hist-stripe-bg { fill: var(--s2); }
.pk-pub .pk-hist-stripe-line { stroke: var(--gold); stroke-width: 1.2; }
.pk-pub .pk-fig-trio--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Static illustrations on the agency and IPTC guides (no script, so no data-pk-fig). */
.pk-pub .pk-sort-file { fill: var(--s2); stroke: var(--border2); stroke-width: 1.2; }
.pk-pub .pk-sort-line { fill: none; stroke: var(--border2); stroke-width: 1.2; }
.pk-pub .pk-sort-bin { fill: var(--s2); stroke: var(--gold); stroke-width: 1; }
.pk-pub .pk-sort-text { font-size: 11px; font-weight: 600; fill: var(--text); text-anchor: middle; }
.pk-pub .pk-sort-label { font-size: 10px; fill: var(--dim); text-anchor: middle; }
.pk-pub .pk-cab-body { fill: var(--s2); stroke: var(--border2); stroke-width: 1.2; }
.pk-pub .pk-cab-drawer { fill: var(--s1); stroke: var(--border2); stroke-width: 1; }
.pk-pub .pk-cab-handle { fill: var(--gold); }
.pk-pub .pk-cab-label { font-size: 12px; fill: var(--text); }
.pk-pub .pk-cab-tag { font-size: 10px; fill: var(--dim); text-anchor: end; text-transform: uppercase; letter-spacing: .04em; }
.pk-pub .pk-cab-tag.is-written { fill: var(--gold); }
