/* Native media capture is intentionally a separate mobile action: browsers
   may replace file browsing when `capture` is present. */
.mobile-file-picker {
  display: none !important;
}

@media (hover: none) and (pointer: coarse) {
  .mobile-file-picker {
    display: flex !important;
  }
}

@media (max-width: 1000px) {
  .dropmenu-current {
    .icon.cur {
      display: none;
    }
  }
}

@media (max-width: 800px) {
  #logozone,
  #mainlogo {
    width: 5em !important;
  }
}

@media (max-width: 650px) {
  .dropmenu-current {
    .icon.cur {
      display: inline !important;
      font-size: 1em;
      opacity: 1 !important;
    }
  }
  span.dropmenu-label {
    display: none;
  }
}

/* *************** Global grid ***************
******************************************** */

@media (orientation: portrait) {
  #platform {
    --sidebar-width: 0;
    --inspector-width: 0;
  }

  #profile-panel {
    grid-area: initial;
    overflow: hidden;
    width: calc(100% * var(--sidebar-open));
    height: calc(100% - var(--header-height));
    position: absolute;
    top: var(--header-height);
    left: 0;
  }
  #inspector {
    padding-top: 2.5em;
    position: absolute;
    height: 100%;
    width: 100%;
    grid-area: canvas;
    margin-left: 0;

    transition: width var(--spd-insp) ease;
    #inspector-inner {
      max-height: 100%;
    }

    #toggle-inspector {
      display: block;
      transform: rotateZ(180deg);
      position: absolute;
      right: 1.25em;
      top: 0.5em;
      z-index: 99999;
      background-color: var(--power-ui01-color);
      color: white;
      border: none;
      border-radius: var(--inner-border-radius);
      padding: 0.5em;
      .icon {
        font-size: 1em;
      }
    }
    &:not(.mobile-open) {
      width: 0;
      overflow: visible;

      #toggle-inspector {
        transform: rotateZ(0deg) translateX(calc(100% + 1.75em));
      }
    }
    &:has(#inspector-inner:empty) {
      display: none;
    }
  }
}

/* *************** Library *******************
******************************************** */

@media (orientation: portrait) {
  #library-content {
    --library-grid-minwidth: 7em;
    .library-item .hov {
      display: none;
    }
    &.list {
      .library-item-infos {
        display: flex;
        align-items: start;
      }
      .library-item-buttons {
        font-size: 0.6em;
        .buttomsim {
          aspect-ratio: 1/3;
        }
      }
    }
    &.cards {
      row-gap: 1em;
      .library-item-buttons {
        font-size: 0.7em;
        top: initial;
        right: initial;
        flex-direction: row;
        position: relative;
        display: flex;
        background: none;
        .icon {
          font-size: 0.7em;
          opacity: 0.7;
          color: white;
        }
      }
      .library-item {
        box-shadow: 0em 0.5em 1em rgba(0, 0, 0, 0.389);
      }
      .library-item::after {
        display: none;
      }
      .library-item-infos {
        min-height: 2em;
      }
    }
  }
  .library-item-infos .library-item-title {
    font-size: 0.5em;
  }
  #library-menu {
    position: absolute;
    z-index: 9999;
    width: 100%;
    height: 100%;
    max-height: 100%;
    top: var(--library-height-closed);
    left: 0;
    overflow: hidden;
    overflow-y: scroll;
    background: var(--background-main);
    opacity: 1;
    pointer-events: all;

    transition:
      max-height var(--spd-insp) ease,
      opacity var(--spd-insp) ease;

    &:not(.open) {
      max-height: 0;
      pointer-events: none;
      opacity: 0;
    }
    .library-menu-add {
      display: flex;
    }
  }

  #library-header {
    #toggle-library-menu {
      display: block;
      aspect-ratio: 1;
      height: calc(100% - 1.5em);
      margin: 0 0.85em 0 0;
      border: none;
      color: white;
      background: none;
      position: relative;
    }
  }
}
