@import url("/assets/css/editorial-layout.css?v=1");

html body article:is([data-cx-guide], .cx-kogei-composition) .cx-guide-section,
html body article:is([data-cx-guide], .cx-kogei-composition) .cx-guide-text,
html body article.cx-kogei-composition .cx-kogei-columns {
  margin-block-start: var(--ht-editorial-section-space);
}

html body article:is([data-cx-guide], .cx-kogei-composition) :is(.cx-guide-section, .cx-guide-text) > .cx-h,
html body article[data-cx-guide] .cx-guide-copy > .cx-h {
  max-width: none;
  margin: 0 0 0.65rem;
}

html body article[data-cx-guide] .cx-guide-figs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ht-editorial-action-gap);
  align-items: start;
  width: 100%;
  max-width: none;
  margin: 0.85rem 0 0;
}

html body article[data-cx-guide] .cx-guide-figs.cx-guide-single {
  grid-template-columns: minmax(0, 280px);
  justify-content: center;
}

html body article[data-cx-guide] .cx-guide-section .cx-plate {
  min-width: 0;
  padding: clamp(8px, 1vw, 14px);
}

html body article[data-cx-guide] .cx-guide-section .cx-shot {
  aspect-ratio: auto;
  width: 100%;
  height: auto;
  padding: 0;
}

html body article[data-cx-guide] .cx-guide-section .cx-shot img {
  position: static;
  display: block;
  width: 100%;
  height: auto;
  max-height: min(58vw, 280px);
  object-fit: contain;
  transform: none;
}

html body article[data-cx-guide] .cx-guide-figs .cx-shot.cx-id-zoom {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  margin-top: 8px;
  border-radius: 4px;
}

html body article[data-cx-guide] .cx-guide-figs .cx-shot.cx-id-zoom:not(.has-img) { display: none; }

html body article[data-cx-guide] .cx-guide-figs .cx-shot.cx-id-zoom img {
  position: absolute;
  max-height: none;
  left: calc(50% - 100% * var(--zx));
  top: calc(50% - 150% * var(--zy) * var(--zr, 1));
  transform-origin: calc(100% * var(--zx)) calc(100% * var(--zy));
  transform: scale(var(--zs, 2));
}

html body article[data-cx-guide] .cx-shot:not(.has-img)::after { display: none; }
html body article[data-cx-guide] .cx-shot:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
html body article[data-cx-guide] .cx-cap span[lang] { display: inline; font-size: 1.3em; }
html body article[data-cx-guide] .cx-q { margin: 18px 0 4px; font-size: 1.05em; }
html body article[data-cx-guide] .cx-a { margin: 0; }

html body article[data-cx-guide] figcaption :is(.cx-cap, .cx-cred, .cx-cred b) {
  text-transform: none !important;
  letter-spacing: normal !important;
}

html body article[data-cx-guide] figcaption .cx-cap {
  font-size: 0.95em !important;
  line-height: 1.45 !important;
}

html body article[data-cx-guide] .cx-guide-section .cx-plate figcaption > .cx-cred {
  display: inline-flex !important;
  gap: 0.25em 0.45em;
  align-items: baseline;
  overflow-wrap: anywhere;
  white-space: normal !important;
  flex-wrap: wrap !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

@media (min-width: 1024px) {
  html body article:is([data-cx-guide], .cx-kogei-composition) {
    --cx-read: min(100%, var(--ht-editorial-page-max));
  }

  html body article:is([data-cx-guide], .cx-kogei-composition) :is(.cx-head, .cx-body).cx-wrap {
    max-width: var(--ht-editorial-page-max);
    padding-inline: var(--ht-editorial-gutter);
  }

  html body article[data-cx-guide] .cx-guide-section,
  html body article.cx-kogei-composition .cx-kogei-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
    align-items: start;
    gap: var(--ht-editorial-columns-gap);
  }

  html body article.cx-kogei-composition .cx-kogei-columns > section { min-width: 0; }

  html body article:is([data-cx-guide], .cx-kogei-composition)
    :is(.cx-guide-copy, .cx-guide-text) > :is(p, ul, ol) {
    max-width: var(--ht-editorial-reading-max);
    margin-inline: 0;
  }

  html body article:is([data-cx-guide], .cx-kogei-composition) :is(.cx-standfirst, .cx-a) {
    max-width: var(--ht-editorial-reading-max);
  }

  html body article[data-cx-guide] .cx-faq {
    columns: 2;
    column-gap: var(--ht-editorial-columns-gap);
  }

  html body article[data-cx-guide] .cx-faq > .cx-h { column-span: all; }
  html body article[data-cx-guide] .cx-faq > .cx-q { break-after: avoid-column; }
  html body article[data-cx-guide] .cx-faq > .cx-a { break-inside: avoid-column; }

  /* Like Yellow Back, larger comparisons use the whole reading area. */
  html body article[data-cx-guide] .cx-guide-section:has(.cx-guide-figs > .cx-plate:nth-child(3)) {
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--ht-editorial-action-gap);
  }

  html body article[data-cx-guide] .cx-guide-figs:has(> .cx-plate:nth-child(3)) {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  }

  html body article[data-cx-guide] .cx-guide-figs:has(> .cx-plate:nth-child(3)) > .cx-plate {
    width: 100%;
    max-width: 340px;
    justify-self: center;
    box-sizing: border-box;
  }

  html body article[data-cx-guide] .cx-guide-figs { margin-top: 0; }
}

/* Codex articles: keep each comparison on the article axis.  This is scoped
   to the article hooks and does not change checklist or editorial pages. */
html body article:is([data-cx-guide], .cx-kogei-composition) :is(.cx-head, .cx-body).cx-wrap {
  max-width: var(--ht-editorial-page-max);
  padding-inline: var(--ht-editorial-gutter);
}

html body article[data-cx-guide] .cx-body.cx-wrap {
  column-count: 1 !important;
  column-width: auto !important;
}

html body article[data-cx-guide] .cx-guide-section,
html body article.cx-kogei-composition .cx-kogei-columns {
  display: block !important;
}

html body article.cx-kogei-composition .cx-kogei-columns > section + section {
  margin-block-start: var(--ht-editorial-section-space);
}

html body article[data-cx-guide] .cx-guide-section > .cx-h {
  max-width: none;
  margin: 0 0 0.65rem;
}

html body article[data-cx-guide] .cx-guide-copy {
  margin-top: clamp(10px, 1.2vw, 16px);
}

html body article:is([data-cx-guide], .cx-kogei-composition)
  :is(.cx-guide-copy, .cx-guide-text, .cx-kogei-columns) > :is(p, ul, ol) {
  max-width: 88ch;
  margin-inline: 0;
}

html body article[data-cx-guide] .cx-guide-figs,
html body article[data-cx-guide] .cx-guide-figs:has(> .cx-plate:nth-child(3)) {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: var(--ht-editorial-action-gap);
  align-items: start;
  width: 100%;
  max-width: none;
  margin: 0;
}

html body article[data-cx-guide] .cx-guide-figs.cx-guide-single {
  grid-template-columns: minmax(0, 1fr) !important;
  max-width: min(100%, 860px);
  margin-inline: auto;
  justify-content: start;
}

html body article[data-cx-guide] .cx-guide-figs:not(.cx-guide-single):has(> .cx-plate > .cx-id-zoom) {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)) !important;
}

html body article[data-cx-guide] .cx-guide-figs > .cx-plate {
  min-width: 0;
  width: 100%;
  max-width: none !important;
  margin: 0;
  justify-self: stretch !important;
  box-sizing: border-box;
}

/* Keep each loaded original/crop pair together with its own caption. */
html body article[data-cx-guide] .cx-guide-figs > .cx-plate:has(> .cx-id-zoom.has-img) {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  align-items: center;
  gap: 8px;
}

html body article[data-cx-guide] .cx-guide-figs > .cx-plate:has(> .cx-id-zoom.has-img) > figcaption {
  grid-column: 1 / -1;
}

html body article[data-cx-guide] .cx-guide-figs > .cx-plate:has(> .cx-id-zoom.has-img) > .cx-id-zoom { margin-top: 0; }

@media (min-width: 700px) {
  html body article[data-cx-guide] .cx-guide-figs:has(> .cx-plate:nth-child(3)):not(:has(> .cx-plate > .cx-id-zoom)) {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)) !important;
  }
}

html body article[data-cx-guide] .cx-guide-section .cx-shot:not(.cx-id-zoom) img {
  width: auto;
  max-width: 100%;
  max-height: clamp(200px, 36vw, 420px);
  margin-inline: auto;
}

/* The first article is the reference: its four original views remain one
   leading comparison, with pairs kept together on small screens. */
html body article[data-cx-guide] .cx-refs {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  max-width: none !important;
  gap: var(--ht-editorial-action-gap);
}

@media (min-width: 960px) {
  html body article[data-cx-guide] .cx-refs {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

html body article:is([data-cx-guide], .cx-kogei-composition)
  :is(.cx-body p, .cx-body li, .cx-facts dt, .cx-facts dd, figcaption, .cx-cred, .cx-cred b, .cx-run) {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif !important;
  letter-spacing: normal;
}

html body article[data-cx-guide] figcaption :is(.cx-cred, .cx-cred b, .cx-run) {
  font-size: 13px !important;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

html body article[data-cx-guide] figcaption .cx-cred {
  min-height: 44px;
  white-space: normal;
}

/* polish-20261112: guide credits and Quick answers.
   Photo credits are 44px rows; the prose-link underline from
   .cx-body a:not(.cx-ref) hung below them as a stray short rule.
   The first Quick answer drops its top margin (the heading carries the gap)
   so both Quick answers columns start level on desktop. Phones keep their
   spacing. The heading gap is a default at (0,3,0): it beats the page base
   .cx-body h2.cx-h but a page's own Quick answers rule (Topsun, Menko,
   Karuta) still wins. */
html body article[data-cx-guide] .cx-guide-section .cx-plate figcaption > a.cx-cred { border-bottom: 0; border-radius: 4px; }
html body article[data-cx-guide] .cx-plate figcaption > a.cx-cred:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
@media (min-width: 1024px) {
  :where(html body article[data-cx-guide]) .cx-body .cx-faq > .cx-h { margin-bottom: 28px; }
  html body article[data-cx-guide] .cx-faq > .cx-h + .cx-q { margin-top: 0; }
}
