/* ---------------------------------------------------------------------------
   responsive.css — responsiveness + accessibility overlay.
   Loaded after bold.css + portal.css. The design prototypes were locked to a
   fixed 1440px desktop width; this layer makes them work from 375px up, and
   adds the a11y utilities the server-rendered templates rely on.
   --------------------------------------------------------------------------- */

/* --- layout: collapse the multi-column sections --------------------------- */
@media (max-width: 980px) {
  .hero-grid,
  .solution-grid { grid-template-columns: 1fr !important; gap: 32px !important; }
  .footer-grid { grid-template-columns: 1fr 1fr !important; }
  .shell { padding-left: 24px !important; padding-right: 24px !important; }
  .section { padding-left: 0 !important; padding-right: 0 !important; }
}

@media (max-width: 640px) {
  .portal-rail { flex-wrap: wrap; gap: 8px 14px; padding: 12px 0 !important; }
  .portal-rail .r-right { display: none; }
  .manual-head { flex-direction: column; }
  .footer-grid { grid-template-columns: 1fr !important; }
  .hero-h { font-size: clamp(28px, 7vw, 44px) !important; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .tbl-clean { display: block; overflow-x: auto; white-space: nowrap; }
  .manual-step { grid-template-columns: 36px 1fr !important; }
}

/* --- accessibility: tap targets >= 44px (scorecard G1/G2) ----------------- */
.btn,
.view-btn,
.portal-nav a,
.pin-form button,
.pin-form input { min-height: 44px; }

/* --- screen-reader-only utility ------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* keep focus visible everywhere (scorecard G4) */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- step photos: real images + captioned placeholders -------------------- */
.step-gallery { align-items: flex-start; }
.step-photo { margin: 0; }
.step-photo img { max-width: 180px; width: 100%; border-radius: 6px; display: block; }
.step-photo figcaption { margin-top: 4px; font-size: 11px; }

.step-photo-placeholder {
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  min-width: 130px; max-width: 200px; min-height: 92px;
  padding: 10px 12px;
  border: 1px dashed var(--rule-2); border-radius: 6px;
  background: var(--paper-2);
}
.step-photo-placeholder .photo-role {
  font: 700 9px/1 'JetBrains Mono', monospace;
  letter-spacing: .12em; color: var(--accent);
}
.step-photo-placeholder .photo-caption { font-size: 11px; color: var(--mute); line-height: 1.4; }
.step-photo-placeholder.step-photo-dont { border-color: var(--neg); }
.step-photo-placeholder.step-photo-dont .photo-role { color: var(--neg); }

/* --- manual viewer: real photos fill the design's .imgph2 box ------------- */
/* `manual-views.js` adds `.has-img` when a step photo has a real file; the
   <img> fills the placeholder box (which is position:relative; overflow:hidden
   in portal.css), with the role tag kept overlaid. */
.imgph2.has-img { padding: 0; }
.imgph2.has-img > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* print: A4 chapter output (scorecard G8) — drop chrome, keep the manual */
@media print {
  .portal-rail, .layout-toggle, footer, .accent-rail { display: none !important; }
  .view-pane:not(.on) { display: none !important; }
  .article-step, .sbs-stage, .ref-row { break-inside: avoid; }
  body { background: #fff; color: #000; }
}
