/* ===========================================
   Marked page: a scanned page's screenshot with an outline on each failing element.
   Same marks as the homepage client-site image: a marker yellow edge with a faint ink ring
   and an ink number disc. Mark colours are fixed because the screenshot is never themed.
   =========================================== */

@layer components {
  .marked-page {
    container-type: inline-size;
    margin: 0;

    .marked-page__canvas {
      position: relative;
    }

    /* One hairline around the picture, drawn as a shadow so it does not shift the picture under the outlines */
    .marked-page__clip {
      position: absolute;
      inset: 0;
      overflow: hidden;
      border-radius: var(--radius-sm);
      box-shadow: 0 0 0 1px var(--color-border);
    }

    .marked-page__image {
      position: absolute;
      display: block;
      max-width: none;
      height: auto;
    }

    .marked-page__marks {
      position: absolute;
      inset: 0;
    }

    .marked-page__mark {
      position: absolute;

      &::before {
        content: "";
        position: absolute;
        inset: -5px;
        border: 3px solid #FFD23F;
        border-radius: 6px;
        box-shadow: 0 0 0 1px rgb(19 35 63 / 0.35);
      }
    }

    /* The finding's number sits on its outline's top-left corner, clear of what the outline points at */
    .marked-page__number {
      position: absolute;
      top: -5px;
      left: -5px;
      z-index: 1;
      translate: -35% -35%;
      box-shadow: 0 0 0 2px #FFD23F;
    }
  }

  /* Long pages scroll inside the frame instead of pushing the findings far down */
  .marked-page--scrolls .marked-page__frame {
    max-height: min(40rem, 70vh);
    padding: var(--space-3);
    overflow-y: auto;
  }

  /* Number disc shared by the outlines and the findings they belong to */
  .marked-page__number,
  .marked-number {
    display: inline-grid;
    place-items: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.3rem;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    color: #FFFFFF;
    background: #13233F;
    border-radius: var(--radius-full);
  }

  /* Narrow pictures (phones): numbers and outlines shrink so they do not cover what they point at */
  @container (max-width: 40rem) {
    .marked-page .marked-page__number {
      min-width: 1.25rem;
      height: 1.25rem;
      padding: 0 0.2rem;
      font-size: 0.6875rem;
    }

    .marked-page .marked-page__mark::before {
      inset: -3px;
      border-width: 2px;
    }
  }
}
