/* Шрифт: на Readymag стоял Adobe Fonts (kit "sftn"), его лицензия не переносится.
   Замена — Hanken Grotesk (SIL OFL), лежит локально: без запросов к сторонним CDN (GDPR). */
@font-face { font-family: sftn; src: url(/assets/fonts/hanken-grotesk-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: sftn; src: url(/assets/fonts/hanken-grotesk-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }

html, body { margin: 0; height: 100%; overflow: hidden; background: #fff; min-width: 0 !important; }
.mag { min-width: 0 !important; }
body { font-family: sftn, "Helvetica Neue", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }

.mag, .mag .mag-pages-container, .mag .mag-pages-container .container {
  position: fixed !important; inset: 0 !important; width: auto !important; height: auto !important;
  overflow: hidden; transform: none !important; margin: 0 !important; }
.mag .mag-pages-container .container article.page[data-mode] {
  position: absolute !important; inset: 0 !important; width: auto !important; height: auto !important;
  overflow: hidden; transform: none !important; opacity: 1 !important; visibility: visible !important; display: none !important; }
html[data-mode="desktop"] .mag .mag-pages-container .container article.page[data-mode="desktop"],
html[data-mode="phone"] .mag .mag-pages-container .container article.page[data-mode="phone"] { display: block !important; }

/* Фиксированные слои масштабируются скриптом через zoom, размеры задаёт он же */
.mag .mag-pages-container .container .page .fixed-position-container,
.mag .mag-pages-container .container .page .fixed-position-container-top { right: auto; bottom: auto; }
.mag .mag-pages-container .container .page .content-scroll-wrapper { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

/* Слайдшоу */
.common-slideshow .images-wrapper .image { cursor: pointer; }
.common-slideshow .arrow-middle { cursor: pointer; }

/* Лайтбокс */
.rm-lightbox { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.235); cursor: zoom-out; opacity: 0; transition: opacity .25s ease; }
.rm-lightbox.open { opacity: 1; }
.rm-lightbox img { max-width: 92vw; max-height: 92vh; object-fit: contain; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.rmwidget.widget-picture img.viewable { cursor: zoom-in; }

a:focus-visible, [role=button]:focus-visible, .widget-button:focus-visible { outline: 2px solid #4299e1; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .animation-container { animation-duration: 1ms !important; }
  .common-slideshow .images-wrapper .image { transition: none !important; }
}

/* Переносы строк зафиксированы по оригиналу (<br data-rb>), браузер сам не переносит:
   замена шрифта на ~1% шире Adobe-оригинала и иначе сдвинула бы строки */
.text-viewer p[data-l] { white-space: nowrap !important; }
/* Строка шире рамки при text-align:right/center вылезает только вправо. Flex-обёртка
   (span.rb-w из build.py) уводит переполнение влево / поровну — край остаётся ровным. */
.text-viewer p[data-l].align-right,
.text-viewer p[data-l].align-center { display: flex; }
.text-viewer p[data-l].align-right { justify-content: flex-end; }
.text-viewer p[data-l].align-center { justify-content: center; }
.text-viewer p[data-l] > .rb-w { flex: none; }
