/* The public tool pages (Pages/Metronome.cshtml, Tuner.cshtml, Drone.cshtml, TheoryMap.cshtml):
   docs/product/public-tools-decisions.md. The tool is the practice workspace's own card, drawn
   as it is alone on the stage, so its styles are the workspace's (css/pages/practice); the
   Theory Map is the map's own card (css/components/theory-helper.css). The heading band and the
   sections under the tool are the homepage's (css/components/homepage.css).
   This file is only what joins the two. */
@layer components {
  /* The heading band is short, so the tool is on the first screen (W-PUB-01, step 2). */
  .av-pt-top {
    padding: 28px 0 30px;
  }

  .av-pt-top .av-hp-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .av-pt-top .av-hp-eyebrow {
    font-size: 14px;
  }

  .av-pt-top .av-hp-display {
    font-size: 38px !important;
  }

  .av-pt-top .av-hp-lede {
    font-size: 18px;
  }

  /* The tool's card, white on the page's own background. */
  .av-pt-stage {
    background: var(--av-bg);
    padding: 28px 0 30px;
    font-family: 'Varela Round', sans-serif;
  }

  /* A page, not a window: the card is as tall as its tool, and nothing scrolls inside it. */
  .av-pt-stage .av-session-stage {
    display: block;
    max-width: 880px;
    margin: 0 auto;
  }

  .av-pt-stage--wide .av-session-stage {
    max-width: none;
  }

  .av-pt-stage .av-session-stage .av-tool__body {
    overflow: visible;
  }

  /* The Theory Map is its own card, with no outline where it sits in the app. Here it gets
     the outline and hard shadow the workspace gives a tool on its stage (.av-tool in
     session.css), so the four pages look alike. */
  .av-pt-stage .av-theory-helper {
    border: 2px solid rgba(15, 23, 42, 0.32);
    border-radius: var(--av-card-radius);
    box-shadow: 3px 3px 0 rgba(15, 23, 42, 0.12) !important;
  }

  /* On the workspace's stage the Metronome's Mode switch sits on the card's title line
     (session.css, from 992px). This card has no header, so it gets a line of its own. */
  @media (min-width: 992px) {
    .av-pt-stage .av-session-stage:not(.av-session-stage--split) > [data-tool="metronome"] .av-tool__body {
      padding-top: 68px;
    }

    .av-pt-stage .av-session-stage:not(.av-session-stage--split) > [data-tool="metronome"] .av-session-metro__mode {
      top: 14px;
    }
  }

  /* The Metronome keeps its tempo in a range input nobody sees (sr-only). The site's own
     `input[type="range"] { width: 100% }` makes that input as wide as the card, starting
     part-way across it, so the card had 110px of sideways scroll waiting for a focus or a
     scrollIntoView to use. Important, because that rule is outside the layers. */
  .av-pt-stage input.sr-only {
    width: 1px !important;
  }

  /* Lines that speak of a tune, the Theory Map or the Recorder beside the tool: none of them
     is here. */
  .av-pt-stage [data-drone="key-hint"],
  .av-pt-stage [data-tuner="from"],
  .av-pt-stage [data-playback="recorder-hint"] {
    display: none !important;
  }

  /* Right under the tool: what an account adds for it, and Sign up free (decision 9). As
     wide as the tool's card, so the two read as one piece. */
  .av-pt-join {
    max-width: 880px;
    margin: 14px auto 0;
    padding: 12px 14px 12px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px 20px;
    background: var(--av-card);
    border: 1px solid var(--av-border);
    border-radius: var(--av-card-radius);
  }

  .av-pt-stage--wide .av-pt-join {
    max-width: none;
  }

  /* Important: Bootstrap's own `p` margin is outside the layers and would win. */
  .av-pt-join p {
    margin: 0 !important;
    font-size: 17px;
    line-height: 1.4;
    color: var(--av-text);
  }

  .av-pt-join .btn {
    flex: none;
    white-space: nowrap;
    font-weight: 700;
  }

  /* The navbar's Sign up free: a button among links, so it is centred on their line. */
  .av-nav-join {
    display: flex;
    align-items: center;
    margin: 0 4px 0 10px;
  }

  .av-nav-join .btn {
    white-space: nowrap;
    font-weight: 700;
  }

  .av-pt-fine {
    margin: 14px 0 0 !important;
    font-size: 14.5px;
    line-height: 1.45;
    color: var(--av-muted);
  }

  .av-pt-broken {
    max-width: 560px;
    margin: 0 auto;
    padding: 16px 20px;
    background: var(--av-card);
    border: 2px solid var(--av-border);
    border-radius: var(--av-card-radius);
    text-align: center;
    color: var(--av-text);
  }

  .av-pt-broken[hidden] {
    display: none;
  }

  /* How to use it */
  .av-pt-steps {
    max-width: 940px;
    margin: 40px auto 0 !important;
    padding: 0 !important;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px 48px;
  }

  .av-pt-steps h3 {
    font-size: 19px !important;
    margin-bottom: 6px !important;
  }

  .av-pt-steps p {
    font-size: 16px !important;
    line-height: 1.5 !important;
    color: var(--av-muted);
  }

  /* What an account adds, beside the practice workspace */
  .av-pt-account {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 56px;
    align-items: center;
  }

  .av-pt-account__text {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }

  .av-pt-account__text > p:not(.av-pt-fine) {
    font-size: 18px !important;
    line-height: 1.5 !important;
  }

  .av-pt-account__text .av-pt-fine {
    margin-top: 0 !important;
  }

  @media (max-width: 991.98px) {
    /* In the opened menu the button sits at the left, under the links. */
    .av-nav-join {
      margin: 8px 0;
    }

    .av-pt-account {
      grid-template-columns: 1fr;
      gap: 36px;
    }
  }

  @media (max-width: 767.98px) {
    .av-pt-top {
      padding: 18px 0 20px;
    }

    .av-pt-top .av-hp-display {
      font-size: 28px !important;
    }

    .av-pt-top .av-hp-lede {
      font-size: 16px;
    }

    .av-pt-stage {
      padding: 14px 0 22px;
    }

    .av-pt-stage .av-hp-wrap {
      padding: 0 10px;
    }

    .av-pt-join {
      flex-direction: column;
      align-items: stretch;
      padding: 14px;
      text-align: center;
    }

    .av-pt-join p {
      font-size: 16px;
    }

    .av-pt-join .btn {
      min-height: 44px;
    }

    .av-pt-steps {
      grid-template-columns: 1fr;
      gap: 22px;
      margin-top: 28px !important;
    }
  }
}
