/* Mobile and tablet overrides for docs.fenecon.de */

/* Desktop: expand main content area to use available space */
@media screen and (min-width: 1024px) {
  main.article {
    width: 100%;
    max-width: none;
  }

  main.article > .content {
    max-width: none;
  }

  main.article > .content > .doc {
    max-width: 72rem;
    margin-left: 1.5rem;
    margin-right: 1.5rem;
  }

  main.article > .content > .toc.sidebar {
    margin-right: 1rem;
  }

  .toc.sidebar .toc-menu {
    margin-right: 0;
  }
}

/* Prevent media overflow in article content */
.doc img,
.doc svg,
.doc video,
.doc iframe {
  max-width: 100%;
  height: auto;
}

/* Keep wide data tables scrollable without affecting admonition tables or column widths */
.doc .tableblock {
  overflow-x: auto;
}

/* Hide the page title on the index/start page — content begins with the SVG banner */
.doc.index-page > h1.page:first-child {
  display: none;
}

/* Make welcome banners span the full available article content width */
.doc.index-page .imageblock > .content > img {
  width: 100%;
}

/* Add breathing room around the first index banner (more below than above) */
.doc.index-page .imageblock:first-of-type {
  margin-top: 0.75rem;
  margin-bottom: 1.5rem;
}

/* Prevent slight clipping of admonition badge at the top edge */
.doc .admonitionblock td.icon {
  top: 0.25rem;
}

@media screen and (max-width: 1023.5px) {
  .nav-container {
    width: min(88vw, 22rem);
  }

  .nav {
    height: calc(100vh - 6rem);
  }

  .nav-menu {
    padding: 0.75rem 0.75rem 1.25rem;
  }

  .nav-list {
    margin-left: 0.65rem;
  }

  .nav-item {
    margin-top: 0.35rem;
  }

  .nav-item-toggle {
    width: 1.6em;
    height: 1.6em;
    margin-left: -1.6em;
    margin-top: -0.1em;
  }

  .nav-link,
  .nav-text {
    display: inline-block;
    line-height: 1.35;
    padding: 0.15rem 0;
  }

  .doc {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .navbar-brand {
    min-width: 0;
    padding-left: 0.5rem;
  }

  .navbar-brand .navbar-item:first-child {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 56vw;
  }

  #docsearch {
    max-width: 40vw;
    overflow: hidden;
  }
}

@media screen and (max-width: 768.5px) {
  .navbar-brand .navbar-item:first-child {
    font-size: 1rem;
    max-width: 65vw;
  }

  .navbar-brand .navbar-item.search {
    display: none;
  }

  .doc {
    font-size: 1rem;
  }
}
