/* reveal-mobile-fixes.css — apply to all slide pages, phones only */
@media (max-width: 700px){
  /* Larger base for better legibility on phones */
  .reveal{ font-size: clamp(18px, 4.8vw, 22px); }
  /* Safe gutters so длинные строки не упираются в край */
  .reveal .slides{ padding: 0 22px 72px !important; overflow: visible !important; }
  .reveal section{ padding-left: 8px; padding-right: 8px; overflow: visible !important; }
  /* Чуть равномернее ритм текста */
  .reveal p, .reveal li{ line-height: 1.5; }
  .reveal h1, .reveal h2, .reveal h3{ line-height: 1.22; }
  .reveal h4, .reveal h5, .reveal h6{ line-height: 1.28; }
  /* Списки: компактнее маркерная колонка */
  .reveal ul, .reveal ol{ padding-left: 1.1em; margin-left: 0; }
}

/* v3 mobile fixes */
@media (max-width: 760px){
  .genbar{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
  .genbar input[type="text"], .genbar input{ flex:1 1 60%; min-width: 220px; }
  .genbar button{ flex: 0 0 auto; }
  .reveal section{ overflow: hidden; }
  .reveal section img, .reveal section video{
    display:block; max-width:100%; height:auto;
    max-height: calc(100vh - 96px);
    box-sizing: border-box;
  }
  section.timeline ul li{ font-size: 0.9em; line-height:1.25; }
  section.timeline h2{ margin-bottom: .4em; }
}

/* === Mobile autoscale & safe-area fixes (v19) === */
:root { --side-pad: 4vw; }

.reveal { width: 100%; height: 100svh; }

.reveal .slides {
  width: 100%;
  height: 100%;
  padding-left: max(var(--side-pad), env(safe-area-inset-left));
  padding-right: max(var(--side-pad), env(safe-area-inset-right));
  box-sizing: border-box;
}

.reveal .slides section,
.reveal .slides section h1,
.reveal .slides section h2,
.reveal .slides section p,
.reveal .slides section li {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
  line-height: 1.25;
}

/* Keep controls from overlapping content on tiny screens */
.reveal .controls, .reveal .playback {
  margin-bottom: max(8px, env(safe-area-inset-bottom));
}

/* v20 — helpers for autofit */
.reveal .slides section { transform-origin: top left; }
.reveal .slides section,
.reveal .slides section h1,
.reveal .slides section h2,
.reveal .slides section p,
.reveal .slides section li { 
  white-space: normal; 
  overflow-wrap: anywhere; 
  word-break: normal; 
  hyphens: auto;
}

