/**
 * Native P5 fullbleed document shell.
 * No Astra / Elementor / Element Pack / Content Views dependency.
 * Content styling lives in portfolio.css / series.css.
 */

/* Metric-compatible fallback for Graphik swap (canary/P5 only).
   Tuned so H1 "Портфолио" width stays near Graphik (~349px @ 28px / 390vw). */
@font-face {
  font-family: "Graphik Fallback";
  src: local("Helvetica Neue"), local("Helvetica"), local("Arial");
  size-adjust: 114%;
  ascent-override: 92%;
  descent-override: 22%;
  line-gap-override: 0%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body.bp5-doc {
  margin: 0;
  min-width: 0;
  overflow-x: clip;
  background: #f4f2ee;
  color: #1a1916;
  --font-stack: "Graphik", "Graphik Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: var(--font-stack);
  --font-body: var(--font-stack);
  --font-ui: var(--font-stack);
  /* Canary/P5 only: pull Global Shell chrome onto the same metric fallback so
     Slow-4G Graphik swap does not shift .gs-nav / panel text (~0.024 CLS).
     Does not modify bagmutskiy-global-shell/shell.css. */
  --gs-font-ui: "Graphik", "Graphik Fallback", system-ui, -apple-system, sans-serif;
  --gs-font-body: "Graphik", "Graphik Fallback", system-ui, -apple-system, sans-serif;
  font-family: var(--font-body);
}

body.bp5-doc.admin-bar {
  /* WP admin bar offset; Global Shell also accounts for this. */
  scroll-padding-top: 32px;
}

@media screen and (max-width: 782px) {
  body.bp5-doc.admin-bar {
    scroll-padding-top: 46px;
  }
}

.bp5-shell {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}

main.bp5-shell:focus {
  outline: none;
}

main.bp5-shell:focus-visible {
  outline: 2px solid #1a3a32;
  outline-offset: 4px;
}

.bp5-shell .pf,
.bp5-shell .sr {
  min-width: 0;
  max-width: 100%;
}

/* Reserve layout space from intrinsic width/height attrs (CLS). */
.bp5-shell img[width][height] {
  height: auto;
}

.bp5-shell a:focus-visible,
.bp5-shell button:focus-visible,
.bp5-shell summary:focus-visible,
.bp5-shell [tabindex]:focus-visible {
  outline: 2px solid #1a3a32;
  outline-offset: 3px;
}

.bp5-shell .pf-skip:focus,
.bp5-shell .sr-skip:focus {
  position: static;
  width: auto;
  height: auto;
  clip: auto;
  overflow: visible;
}

@media (prefers-reduced-motion: reduce) {
  .bp5-shell *,
  .bp5-shell *::before,
  .bp5-shell *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Missing-media fallback for broken figures */
.bp5-shell figure.bp5-missing {
  display: grid;
  place-items: center;
  min-height: 12rem;
  background: #ece9e3;
  color: #5c5a55;
  border: 1px dashed #d9d4cb;
}

.bp5-shell figure.bp5-missing::after {
  content: attr(data-fallback);
  font: 400 0.875rem/1.4 Graphik, system-ui, sans-serif;
  padding: 1rem;
  text-align: center;
}

/* Pagination notice (when page/2 mirrors hub) */
.bp5-pagination-note {
  margin: 0 auto 1.5rem;
  max-width: min(90rem, 100%);
  padding: 0 1.25rem;
  font: 400 0.875rem/1.45 Graphik, system-ui, sans-serif;
  color: #5c5a55;
}
