/* styles/sections/role-switcher.css
 * Careers "Open roles": the section head over the Roles Grid, an aside (ROLES switcher,
 * CONTENTS of the selected role, the fern Apply link) beside the role body. Frames oZhqi
 * (1440), TuC8u (390), e6DVc (1920). D: aside 320, gap 120, body 680; W: 360, 200, 860.
 * Between 900 and 1440 the aside gives way to 240 and the gap stays 9.375% of the row (120 of
 * 1280). M stacks the aside over the body 40 apart; CONTENTS is not drawn on M and does not
 * render below 900, so the Apply link sits 28 under the switcher. From D the aside stays in
 * view while the document scrolls past it. Selected and current entries take the fern 2px
 * rule and fern text (primitives HmWBl index fern); the rest are muted. No board draws a
 * switcher or Contents hover, so they have none (actions bMiHw: link hovers never change the
 * text); state changes ease over 120ms (--dur-fast). js/careers.js
 * turns the switcher into tabs and hides the other role's body, Contents and Apply link. */
@layer sections {
  .roles-section {
    padding-block: 96px;
  }

  .roles-section__inner {
    display: flex;
    flex-direction: column;
    gap: 72px;
  }

  .roles-section__intro {
    --intro-gap: var(--space-20);
    --intro-heading-size: 36px;
    --intro-heading-lh: round(nearest, 1.05em, 1px);
    --intro-heading-ls: -0.02em;
    --intro-lede-pad: 0px;
    --intro-lede-size: 17px;
    --intro-lede-lh: round(nearest, 1.5em, 1px);
    --intro-lede-color: var(--ink-2);
    padding-bottom: var(--space-40);
    box-shadow: inset 0 -1px var(--line);
  }

  .roles-section__intro .section-intro__lede {
    max-width: 640px;
  }

  /* A deeplink below 900 scrolls here (js/careers.js); clear the sticky nav as [id] targets do. */
  .roles-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-40);
    scroll-margin-top: calc(var(--nav-h) + 16px);
  }

  .role-aside {
    display: flex;
    flex-direction: column;
    gap: 28px;
    align-items: flex-start;
  }

  .role-aside > .role-switcher {
    align-self: stretch;
  }

  .role-aside__label {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    line-height: 24px;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    color: var(--ink-55);
  }

  .role-switcher__list {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .role-switcher__item {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding: 14px 0 14px 16px;
    box-shadow: inset 1px 0 var(--line);
    color: var(--ink);
    text-decoration: none;
    transition: color var(--dur-fast), box-shadow var(--dur-fast);
  }

  .role-switcher__title {
    font-size: 16px;
    font-weight: 600;
    line-height: round(nearest, 1.2em, 1px);
  }

  .role-switcher__meta {
    font-size: 14px;
    line-height: round(nearest, 1.2em, 1px);
    color: var(--ink-55);
  }

  .role-switcher__item[data-selected],
  .role-switcher__item[aria-selected="true"] {
    box-shadow: inset 2px 0 var(--fern);
    color: var(--fern);
  }


  /* Contents: drawn on D and W only. */
  .role-contents {
    display: none;
  }

  .role-contents__list {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .role-contents__link {
    display: flex;
    align-items: baseline;
    gap: var(--space-10);
    padding: 6px 0 6px 14px;
    font-size: 15px;
    line-height: round(nearest, 1.4em, 1px);
    color: var(--ink-2);
    text-decoration: none;
    transition: color var(--dur-fast), box-shadow var(--dur-fast);
  }

  .role-contents__num {
    flex: none;
    transition: color var(--dur-fast);
    width: 22px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    line-height: round(nearest, 1.2em, 1px);
    color: var(--ink-55);
  }

  .role-contents__link[aria-current="true"] {
    padding-left: 12px;
    box-shadow: inset 2px 0 var(--fern);
  }

  .role-contents__link[aria-current="true"],
  .role-contents__link[aria-current="true"] .role-contents__num {
    color: var(--fern);
  }

  /* A flex box, so the paragraph is the link's 18px line, as the frame's Apply Link is. */
  .role-aside__apply {
    display: flex;
    margin: 0;
  }

  .role-aside__apply[hidden] {
    display: none;
  }

  .role-panels {
    min-width: 0;
  }

  @media (min-width: 900px) {
    .roles-section {
      padding-block: 128px;
    }

    .roles-section__intro {
      --intro-heading-size: 56px;
      --intro-lede-size: 18px;
    }

    .roles-grid {
      display: grid;
      grid-template-columns: minmax(240px, 320px) minmax(0, 680px);
      column-gap: 9.375%;
      align-items: start;
    }

    .role-aside {
      position: sticky;
      top: calc(var(--nav-h) + var(--space-24));
      gap: var(--space-40);
    }

    .role-contents {
      display: block;
      align-self: stretch;
    }

    .role-contents[hidden] {
      display: none;
    }
  }

  @media (min-width: 1680px) {
    .roles-section {
      padding-block: 160px;
    }

    .roles-section__intro {
      --intro-heading-size: 72px;
    }

    .roles-grid {
      grid-template-columns: 360px 860px;
      column-gap: 200px;
    }
  }

  @media (forced-colors: active) {
    .roles-section__intro {
      border-bottom: 1px solid;
    }

    .role-switcher__item,
    .role-contents__link[aria-current="true"] {
      border-left: 1px solid;
    }

    .role-switcher__item[aria-selected="true"] {
      border-left-width: 3px;
    }
  }
}
