/* styles/sections/feature-grid.css
 * Features band (Product Leadership WMfeQ, elnfQ, r0Vhxo): white with dither edges top and
 * bottom, the split section intro, then a feature grid between 1.5px ink rules. Row 1 is the
 * wide Work pipeline cell (text 360 beside its card); row 2 is three equal cells under a cool
 * rule, each a title, a body and a product card. Cell padding and rules follow each frame: on
 * M the second and third cells keep their 1px left rule and 20px inset, as mfzCv draws them.
 * Cards: Blocked first (pipeline rows), Velocity (metric list), Conflicts (spec and decision
 * cards with the "conflicts with" rule), and the nudge plus Monday brief. */
@layer sections {
  .feature-band {
    padding-block: 88px;
  }

  .feature-band__intro {
    --intro-heading-lh: round(nearest, 1.05em, 1px);
    --intro-lede-lh: round(nearest, 1.5em, 1px);
    margin-bottom: var(--space-32);
  }

  /* Pencil strokes sit inside the box: rules are drawn over the content edge, not added to it */
  .feature-grid {
    position: relative;
  }

  .feature-grid::after {
    content: "";
    position: absolute;
    inset: 0;
    border-block: 1.5px solid var(--ink);
    pointer-events: none;
  }

  .feature-cell {
    display: flex;
    flex-direction: column;
    gap: var(--space-12);
    padding: 40px 0 32px;
  }

  .feature-cell__text {
    display: flex;
    flex-direction: column;
    gap: var(--space-12);
    padding-top: 8px;
  }

  .feature-cell__title {
    margin: 0;
    font-family: var(--font-body);
    font-size: 17px;
    font-weight: 600;
    line-height: 20px;
    letter-spacing: 0;
    color: var(--app-ink);
  }

  .feature-cell__body {
    margin: 0;
    font-size: 16px;
    line-height: 24px;
    color: var(--ink-muted);
  }

  .feature-cell .shot-card {
    margin: 0;
  }

  .feature-cell--wide {
    gap: var(--space-32);
  }

  .feature-grid__row {
    display: flex;
    flex-direction: column;
    box-shadow: inset 0 1px var(--shot-rule-cool);
  }

  .feature-grid__row > .feature-cell:first-child {
    padding-right: 20px;
  }

  .feature-grid__row > .feature-cell + .feature-cell {
    padding-left: 20px;
    box-shadow: inset 1px 0 var(--shot-rule-cool);
  }

  .feature-grid__row > .feature-cell:nth-child(2) {
    padding-right: 20px;
  }

  .feature-band p,
  .feature-band ul,
  .feature-band dl,
  .feature-band dd {
    margin: 0;
  }

  /* Blocked first */
  .pipeline {
    padding: 0;
    list-style: none;
  }

  .pipeline-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "name source" "stage stage";
    row-gap: 4px;
    padding: 12px 18px;
    box-shadow: inset 0 -1px var(--shot-rule-cool);
  }

  .pipeline-row__name {
    grid-area: name;
    align-self: end;
    font-size: 13px;
    font-weight: 500;
    line-height: 16px;
  }

  .pipeline-row__stage {
    grid-area: stage;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    line-height: 13px;
    color: var(--app-ink-2);
  }

  .pipeline-row__source {
    grid-area: source;
    align-self: end;
    font-size: 11px;
    line-height: 13px;
    text-align: right;
    color: var(--app-ink-2);
  }

  .pipeline-row--flagged {
    background: var(--app-amber-soft);
  }

  .pipeline-row--flagged .pipeline-row__name {
    font-weight: 700;
  }

  .pipeline-row .pipeline-row__waiting {
    grid-column: 1 / -1;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
    color: var(--app-amber-ink);
  }

  .pipeline-row__waiting img {
    flex: none;
    display: block;
  }

  /* Velocity */
  .metric-list {
    display: flex;
    flex-direction: column;
    flex: 1;
  }

  .metric-list > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-height: calc(268px / 3);
    padding: 16px 18px;
  }

  .metric-list > div + div {
    box-shadow: inset 0 1px var(--shot-rule-cool);
  }

  .metric-list dt {
    font-size: 13px;
    line-height: 16px;
    color: var(--app-ink-2);
  }

  .metric-list dd {
    font-size: 20px;
    font-weight: 700;
    line-height: 24px;
    letter-spacing: -0.42px;
  }

  /* Conflicts */
  .conflict-pair {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 18px 20px;
  }

  .conflict-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 2px 0 2px 14px;
    box-shadow: inset 2px 0 var(--orange);
  }

  .conflict-card--decision {
    box-shadow: inset 2px 0 var(--ink);
  }

  .conflict-card__meta {
    font-size: 11px;
    line-height: 13px;
    color: var(--app-ink-2);
  }

  .conflict-card .conflict-card__title {
    margin-top: -8px;
    font-size: 13px;
    font-weight: 700;
    line-height: 16px;
  }

  .conflict-card__text {
    font-size: 13px;
    font-weight: 500;
    line-height: 19px;
  }

  .conflict-card--spec .conflict-card__text {
    color: var(--app-amber-ink);
  }

  .conflict-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 13px;
    color: var(--app-amber-ink);
  }

  .conflict-link__rule {
    flex: none;
    width: 24px;
    height: 1.5px;
  }

  /* Nudge and Monday brief */
  .brief-nudge {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 18px;
    box-shadow: inset 0 -1px var(--shot-rule-cool);
  }

  .brief-nudge__meta {
    flex: none;
    display: flex;
    white-space: nowrap;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    line-height: 13px;
    color: var(--app-ink-2);
  }

  .brief-nudge__text {
    font-size: 12px;
    line-height: 14px;
  }

  .brief-digest__head {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 60px;
    padding: 14px 18px;
    box-shadow: inset 0 -1px var(--shot-rule-cool);
  }

  .brief-digest__head > div {
    display: flex;
    flex-direction: column;
    gap: 1px;
  }

  .brief-digest__title {
    font-size: 14px;
    font-weight: 700;
    line-height: 17px;
  }

  .brief-digest__meta {
    font-size: 11px;
    line-height: 13px;
    color: var(--app-ink-2);
  }

  .brief-digest__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 18px 18px;
  }

  .brief-digest__lead {
    font-size: 14px;
    font-weight: 600;
    line-height: 17px;
  }

  .brief-digest__launches {
    padding: 0;
    list-style: none;
  }

  .brief-digest__launches > li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 28px;
    font-size: 13px;
    font-weight: 600;
    line-height: 16px;
  }

  .brief-digest__launches > li > span:first-child {
    display: flex;
    align-items: center;
    gap: 7px;
  }

  .brief-digest__slip {
    font-size: 12px;
    line-height: 14px;
    color: var(--app-amber-ink);
  }

  .brief-digest__call {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 0 1px var(--shot-rule-cool);
  }

  .brief-digest__ask {
    font-size: 13px;
    font-weight: 700;
    line-height: 16px;
  }

  .brief-digest__note {
    font-size: 12px;
    line-height: 14px;
    color: var(--app-ink-2);
  }

  /* The shot's button: product UI, not a control on this page */
  .brief-digest__assign {
    margin-top: 8px;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    background: var(--fern-app);
    font-size: 12px;
    font-weight: 600;
    line-height: 14px;
    color: var(--white);
  }

  @media (min-width: 900px) {
    .feature-band {
      padding-block: 144px;
    }

    .feature-band__intro {
      margin-bottom: var(--space-56);
    }

    .feature-cell {
      padding-bottom: 48px;
    }

    .feature-cell--wide {
      display: grid;
      grid-template-columns: 360px minmax(0, 1fr);
      align-items: start;
      gap: 56px;
    }

    .feature-grid__row {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .feature-grid__row > .feature-cell:first-child {
      padding-right: 32px;
    }

    .feature-grid__row > .feature-cell + .feature-cell {
      padding-left: 32px;
    }

    .feature-grid__row > .feature-cell:nth-child(2) {
      padding-right: 32px;
    }

    .feature-grid__row .feature-cell__body {
      min-height: 76px;
    }

    .feature-grid__row .shot-card {
      flex: 1;
    }

    .pipeline-row {
      grid-template-columns: minmax(0, 1fr) 90px 52px;
      grid-template-areas: "name stage source";
      align-items: center;
      row-gap: 8px;
    }

    .pipeline-row__name,
    .pipeline-row__source {
      align-self: center;
    }

    .pipeline-row .pipeline-row__waiting {
      align-items: center;
      margin-top: 0;
      line-height: 14px;
    }

    /* Label and figure share a baseline; the row stays centred in its cell (BRI-7805 J22) */
    .metric-list > div {
      flex: 1;
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-content: center;
      align-items: baseline;
      column-gap: var(--space-12);
    }

    .metric-list dd {
      font-size: 24px;
      line-height: 29px;
      letter-spacing: -0.5px;
    }

    .conflict-pair {
      gap: 8px;
      padding: 14px 18px;
    }

    .conflict-card {
      padding: 16px;
      border-radius: var(--radius-md);
      background: var(--app-amber-soft);
      box-shadow: inset 0 0 0 1px var(--shot-conflict-edge);
    }

    .conflict-card--decision {
      background: var(--white);
      box-shadow: inset 0 0 0 1px var(--shot-rule-cool);
    }

    .brief-nudge {
      flex-direction: row;
      align-items: center;
      gap: 10px;
    }

    .brief-nudge__meta {
      gap: 10px;
    }
  }

  @media (min-width: 1680px) {
    .feature-band {
      padding-block: 173px;
    }
  }

  /* Between 900 and the D frame the heading scales with the viewport (56 at 1440) and the lede gives way */
  @media (min-width: 900px) {
    .feature-band__intro {
      --intro-heading-size: min(var(--t-h1-size), 3.9vw);
      --intro-lede-measure: min(420px, 29.2vw);
    }
  }
}
