/*
 * VTL-4.1 mobile chrome with VTL-4.2 portrait popover stacking.
 * Portrait follows the authoritative is-timeline-vertical layout-mode class.
 * Compact landscape is constrained to landscape viewports no larger than
 * 960px wide and 540px high; horizontal timeline mode itself is unchanged.
 */

body.is-timeline-vertical .identity-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  overflow: visible;
}

body.is-timeline-vertical .top-overlay-layout {
  isolation: isolate;
}

body.is-timeline-vertical .filters-overlay {
  position: relative;
  z-index: 1;
}

body.is-timeline-vertical .wwk-header-tools {
  width: 100%;
  align-items: flex-start;
}

body.is-timeline-vertical .wwk-search {
  width: auto;
  min-width: 0;
  flex: 1 1 180px;
}

body.is-timeline-vertical .domain-filters,
body.is-timeline-vertical .utility-controls,
body.is-timeline-vertical .evidence-legend,
body.is-timeline-vertical .position-overlay,
body.is-timeline-vertical .topic-switcher-trigger,
body.is-timeline-vertical .topic-switcher-submenu {
  display: none;
}

body.is-timeline-vertical .filters-panel {
  padding: 5px 8px;
}

body.is-timeline-vertical .topic-switcher {
  height: auto;
  margin: 0;
  border-bottom: 0;
}

body.is-timeline-vertical .topic-switcher-scroll {
  height: auto;
  overflow: visible;
}

body.is-timeline-vertical .topic-switcher-list {
  width: 100%;
  min-width: 0;
  height: auto;
  padding: 1px 0;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 0 10px;
  white-space: normal;
}

body.is-timeline-vertical .topic-switcher-item {
  min-height: 34px;
}

body.is-timeline-vertical .topic-switcher-link,
body.is-timeline-vertical .topic-switcher-label {
  padding: 11px 3px;
}

@media (orientation: landscape) and (max-width: 960px) and (max-height: 540px) {
  .top-overlay-layout {
    grid-template-columns: minmax(300px, 42%) minmax(0, 1fr);
  }

  .top-controls-stack {
    display: block;
  }

  .identity-overlay {
    min-width: 0;
  }

  .wwk-header-tools {
    width: 100%;
    align-items: flex-start;
  }

  .wwk-search {
    width: auto;
    min-width: 140px;
    flex: 1 1 auto;
  }

  .domain-filters,
  .utility-controls,
  .evidence-legend,
  .position-overlay,
  .topic-switcher-trigger,
  .topic-switcher-submenu {
    display: none;
  }

  .filters-panel {
    padding: 5px 8px;
    display: block;
  }

  .topic-switcher {
    height: auto;
    margin: 0;
    border-bottom: 0;
  }

  .topic-switcher-scroll {
    height: auto;
    overflow: visible;
  }

  .topic-switcher-list {
    width: 100%;
    min-width: 0;
    height: auto;
    padding: 1px 0;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 0 10px;
    white-space: normal;
  }

  .topic-switcher-item {
    min-height: 30px;
  }

  .topic-switcher-link,
  .topic-switcher-label {
    padding: 9px 3px;
  }
}
