/*
 * Responsible for: how each screen lays out the kit's pieces: "Your inbox now", the plain page behind
 * "Your Map", and the folder of the demo that holds the overview and the cleanup (the overview's own
 * layout is in screens-overview.css).
 *
 * Must never: restyle a kit piece from here, or give a part of a screen a size that depends on what
 * is inside it. A reading, a slider and a switch of tabs all change what a part shows; none of them
 * may move a part.
 */

@layer screens {
  /* A plain page of words */
  .ia-plain {
    max-width: 44rem;
  }

  .ia-plain__lead {
    margin-block: var(--s-4) var(--s-5);
    color: var(--muted);
    font-size: var(--t-lg);
  }

  /* One button for each mail service signing in is open with: side by side where there is room, one under the other where not */
  .ia-plain__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3) var(--s-4);
  }

  /* Your inbox now */
  .ia-now__head {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    margin-bottom: var(--s-4);
  }

  .ia-now__title {
    font: 400 var(--t-2xl) / 1.15 var(--serif);
  }

  .ia-now__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-3) var(--s-4);
  }

  .ia-now__note {
    color: var(--muted);
    font-size: var(--t-sm);
  }

  .ia-now__mail {
    flex: 1 1 0;
    min-height: 420px;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
  }

  /* On a phone the page is one window tall at least and the mail app takes whatever the title and its buttons leave, so a
     button or a switch added above it never pushes it past the window's end. */
  @media (max-width: 899px) {
    .ia-now {
      display: flex;
      flex-direction: column;
      min-height: calc(100dvh - var(--ia-head));
    }
  }

  @media (min-width: 900px) {
    .ia-now__head {
      flex: 0 0 auto;
    }

    .ia-now__mail {
      flex: 1 1 0;
      min-height: 0;
    }
  }

  /* The demo's folder: both views live inside it and one is shown. */
  .ia-demo__body {
    min-width: 0;
  }

  /* The end of the demo's tab row: the look of the example inbox, and on the cleanup tab the Put everything back button. */
  .ia-demo__aside {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--s-2) var(--s-3);
  }

  /* Nothing to show, or what it holds is hidden: no empty line. */
  .ia-demo__aside[hidden],
  .ia-demo__aside:not(:has(> :not([hidden]))) {
    display: none;
  }

  /* On a phone the strip is the folder's first line: the look on the left, Put everything back on the right, on a line of its own if they do not fit. */
  @media (max-width: 899px) {
    .ia-demo__aside {
      flex: 1 1 100%;
      justify-content: space-between;
    }

    .ia-demo__aside > .ia-btn {
      padding-inline: var(--s-3);
      white-space: nowrap;
    }
  }

  /* The demo's tabs fill the window's height on a laptop, whichever of them is shown. */
  @media (min-width: 900px) {
    .ia-demo__body,
    .ia-overview,
    .ia-cleanup {
      height: 100%;
    }
  }
}
