/* V25: the specified scenes fit the phone's visible viewport, including Safari chrome. */
@media (max-width: 800px) {
  .assembled-page #nav-dialog.rr-dialog[open] {
    height: var(--mobile-menu-height, 100dvh);
    max-height: var(--mobile-menu-height, 100dvh);
    min-height: 0;
  }
  .assembled-page .assembled-ferment[id],
  .assembled-page .assembled-dp-places[id] { scroll-margin-top: 0; }
  .assembled-page[data-page="home"] .rr-hero,
  .assembled-page .assembled-dp-places.dp-archive,
  .assembled-page[data-page="about"] .inner-v6-hero.story-hero,
  .assembled-page[data-page="locations"] .inner-v6-hero.locations-hero {
    height: var(--mobile-visible-height, 100svh);
    min-height: var(--mobile-visible-height, 100svh);
  }
  .assembled-page[data-page="home"] .rr-hero > img {
    width: var(--mobile-visible-height, 100svh);
    height: var(--mobile-visible-width, 100vw);
  }
  .assembled-page .assembled-stories {
    height: calc(var(--mobile-visible-height, 100svh) - 88px);
    --story-header-clearance: 88px;
  }
  .assembled-page .assembled-story-copy p {
    text-wrap: pretty;
    hyphens: auto;
    hyphenate-limit-chars: 6 3 3;
    -webkit-hyphenate-limit-before: 3;
    -webkit-hyphenate-limit-after: 3;
  }
  .assembled-page .assembled-story-link {
    margin-left: max(0px, calc((100% - var(--mobile-story-prose-width, 100%)) / 2));
  }
  .assembled-page .assembled-story-tools {
    --fitted-tools-width: min(var(--mobile-story-prose-width, calc(89% - 48px)), calc(89% - 48px));
    left: calc((89% - var(--fitted-tools-width)) / 2);
    width: var(--fitted-tools-width);
  }
  .assembled-page[data-page="about"] .v8-story-opening,
  .assembled-page[data-page="locations"] .locations-hero > .v8-addresses-picture {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
  }
  .assembled-page[data-page="about"] .v8-story-opening > img,
  .assembled-page[data-page="locations"] .locations-hero > .v8-addresses-picture > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .assembled-page .assembled-story-photo img {
    left: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    transform: none;
    object-fit: cover;
    object-position: 50% 50%;
  }
  .assembled-page .assembled-story-photo-44 img { object-position: 82% 50%; }
  .assembled-ferment .diagram-scene {
    --mobile-ring-step: clamp(8px, calc(var(--mobile-visible-height, 100svh) * .015), 13px);
    height: var(--mobile-visible-height, 100svh);
    min-height: var(--mobile-visible-height, 100svh);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    row-gap: clamp(18px, calc(var(--mobile-visible-height, 100svh) * .03), 28px);
    padding: 104px 20px 32px;
    scroll-margin-top: 0;
  }
  .assembled-ferment .diagram-stage {
    position: relative;
    min-width: 0;
    min-height: 0;
    grid-column: 1 / -1;
    grid-row: 3;
  }
  .assembled-ferment .diagram-core {
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--mobile-diagram-core, 160px);
    height: var(--mobile-diagram-core, 160px);
    transform: translate(-50%, -50%);
    margin: 0;
  }
  .assembled-ferment .ring-one { inset: calc(-1 * var(--mobile-ring-step)); }
  .assembled-ferment .ring-two { inset: calc(-2 * var(--mobile-ring-step)); }
  .assembled-ferment .ring-three { inset: calc(-3 * var(--mobile-ring-step)); }
  .assembled-ferment .ring-four { inset: calc(-4 * var(--mobile-ring-step)); }
}
@media (min-width: 661px) and (max-width: 800px) {
  .assembled-page .assembled-story-tools {
    --fitted-tools-width: min(var(--mobile-story-prose-width, 36%), 36%);
    left: calc(45% + (45% - var(--fitted-tools-width)) / 2);
  }
}
@media (max-width: 800px) and (max-height: 640px) {
  .assembled-ferment .diagram-scene { padding-top: 100px; padding-bottom: 24px; }
}
@media (max-width: 800px) and (max-height: 480px) and (orientation: landscape) {
  .assembled-ferment .diagram-scene {
    --mobile-ring-step: 6px;
    padding: 92px 20px 12px;
    row-gap: 8px;
  }
  .assembled-ferment .diagram-note { font-size: 28px; margin-bottom: 0; }
  .assembled-ferment .diagram-label { min-height: 36px; }
  .assembled-ferment .diagram-label h3 { margin-bottom: 2px; font-size: 12px; line-height: 1.25; }
  .assembled-ferment .diagram-label p { font-size: 12px; line-height: 1.3; }
}

/* Short inner pages keep the footer at the viewport floor without compressing
   long reading pages or changing the fixed header's content clearance. */
@media (max-width: 800px) {
  body.assembled-page.inner-v6-page {
    min-height: 100svh;
    min-height: var(--mobile-visible-height, 100svh);
    display: flex;
    flex-direction: column;
  }
  body.assembled-page.inner-v6-page > main {
    flex: 1 0 auto;
    width: 100%;
    min-width: 0;
  }
  body.assembled-page.inner-v6-page > .hermes-footer { flex: 0 0 auto; }
}
