/* ==========================================================================
   Misho planner responsive layout
   --------------------------------------------------------------------------
   Live's app.css is mobile-first: below 48em (768px) the week grid collapses to
   one full-width day, the column picker and dropdown toolbar actions disappear,
   and the wordmark swaps to its non-editable clone below 439px. These rules
   reproduce those breakpoints on the local clone.
   ========================================================================== */

/* Non-editable wordmark used when the logo input is hidden on phones. */
.app-logo__clone {
  display: none;
  max-width: 14.5em;
  overflow: hidden;
  font-family: var(--ff-logo);
  font-size: 1.1111rem;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: normal;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--accent-highlight);
}

/* ---- Tablet / phone: one full-width day, simplified chrome ---- */
@media (max-width: 48em) {
  /* Live's grid gutter comes from the todo outer margin on mobile, not the
     wrapper padding used on desktop. */
  .grid-wrapper {
    padding: 0;
  }

  /* The someday strip shows one list at a time, like live's 100%-wide
     secondary grid items. */
  .someday-lists {
    padding: 0;
  }
  .grid__item--secondary {
    flex: 0 0 calc(100% / var(--someday-columns, 1));
    width: calc(100% / var(--someday-columns, 1));
    min-width: 0;
  }
  .grid__item--secondary.grid__item--is-dragging-over {
    flex: 0 0 calc(200% / var(--someday-columns, 1));
    width: calc(200% / var(--someday-columns, 1));
  }
  .someday-toolbar {
    padding: 0 0.8889rem;
  }

  /* Live's overlay sidebars keep the mobile todo gutter on the outside. */
  .sidebar,
  .sidebar.sidebar--recurring,
  .sidebar--details {
    max-width: calc(100vw - var(--todo-outer-margin));
  }

  /* Header: live switches to auto/1fr/auto so the centre logo can breathe. */
  .app-header__container {
    grid-template-columns: auto 1fr auto;
    gap: 0.5556rem;
  }
  .app-header__item {
    min-width: 8.8889rem;
  }
  .app-header__item--logo {
    min-width: 0;
  }
  .app-logo__input {
    max-width: 14.5em;
  }

  /* Footer: keep the column picker available on phones; the dropdown-menu
     actions still collapse so the toolbar fits. */
  .app-footer-toolbar {
    gap: 0.2778rem;
  }
  .app-footer-toolbar__item {
    min-width: 0;
  }
  .app-footer-toolbar__item:nth-child(2) {
    gap: 0.2778rem;
  }
  .app-footer-toolbar__item:nth-child(2) .ui-segmented-control {
    gap: 0.1111rem;
  }
  .app-footer-toolbar__item > .dropdown-menu-wrap > .ui-button,
  .app-footer-toolbar__item > .dropdown-menu-wrap > .tooltip-wrap {
    display: none;
  }

  /* The 3-day jump buttons collapse away on phones (`.app__button--jump`). */
  .app-header [aria-label="Back 3 days"],
  .app-header [aria-label="Forward 3 days"] {
    display: none;
  }

  /* Keep the compact mobile arrow treatment, but still reveal it only when
     the day list is hovered (also important in the 1-column layout). The
     3-day jump stays hidden (`.app__button--jump`). */
  .arrow-nav {
    top: 0.1111rem;
    gap: 0;
    padding: 0;
    background: transparent;
  }
  .arrow-nav--left {
    left: 0;
    border-radius: 0;
  }
  .arrow-nav--right {
    right: 0;
    border-radius: 0;
  }
  .arrow-nav .ui-button {
    width: 1.3333rem;
    height: 1.3333rem;
    min-width: 1.3333rem;
    background: transparent;
  }
  .arrow-nav .ui-button .ui-icon {
    width: 1.3333rem;
    height: 1.3333rem;
  }
  .arrow-nav .ui-button:nth-child(2) {
    display: none;
  }
}

/* ---- Small phones: trim the logo input and secondary header actions ---- */
@media (max-width: 439px) {
  .app-logo__input {
    display: none;
  }
  .app-logo__clone {
    display: inline;
  }

  /* Live hides Go to Date / Display Mode at this width. */
  [aria-label="Calendar"],
  [aria-label="Display Mode"] {
    display: none;
  }
  .app-header__item {
    min-width: 0;
  }
}
