/* A site's report card and the table of every card, written by card.py; copied into the workbook, its words for screen readers in English.
   Breakpoints, the only values of the media queries; for Tailwind, as they are in @theme:
     --breakpoint-sm: 40rem;
     --breakpoint-md: 48rem;
     --breakpoint-lg: 64rem;
     --breakpoint-xl: 80rem;
     --breakpoint-2xl: 96rem; */

:root {
  --color-ink: #1c1c1e;
  --color-muted: #5b5b61;
  --color-paper: #fbfaf7;
  --color-card: #fff;
  --color-line: #dedbd3;
  --color-link: #1d4ed8;
  /* Each grade's colour with a text colour that keeps 4.5:1 on it; the letter, not the colour, says the grade. */
  --color-grade-a: #17643a;
  --color-grade-b: #3f7a1c;
  --color-grade-c: #f0c13a;
  --color-grade-d: #e2802a;
  --color-grade-e: #b42318;
  --color-on-dark: #fff;
  --color-on-light: #1c1c1e;
  /* Tags: PARiSiAM's red, as its signature has it, and the brand colours of the technologies, as Simple Icons gives
     them, with white letters: on Astro's, PHP's and HTML's colours, white keeps only 3.8 to 4:1, a choice of the
     user's, below WCAG AA's 4.5:1. React's cyan takes a dark letter, white on it being unreadable; Wix, whose logo
     is black, takes black, not to be mistaken for WordPress's blue. */
  --color-tag-parisiam: #d62020;
  --color-tag-astro: #bc52ee;
  --color-tag-php: #777bb4;
  --color-tag-html: #e34f26;
  --color-tag-wordpress: #21759b;
  --color-tag-react: #61dafb;
  --color-tag-red: #c8102e;
  --color-tag-violet: #6d28d9;
  --color-tag-blue: #1d4ed8;
  --color-tag-green: #17643a;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-title: clamp(1.75rem, 1.2rem + 2.5vw, 2.75rem);
  --text-bar: clamp(1.25rem, 1rem + 1.25vw, 1.75rem);
  --spacing: 0.25rem;
  --spacing-container: 20px;
  --spacing-flow: 1em;
  --container-page: 64rem;
  --container-measure: 68ch;
  --radius-md: 0.5rem;
  --radius-lg: 0.875rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
  /* Below the card's sticky bar, a focused element or an anchor stays in view. */
  scroll-padding-block-start: 6rem;
}

body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font: var(--text-base) / 1.55 var(--font-sans);
  text-rendering: optimizeLegibility;
}

a {
  color: var(--color-link);
  text-underline-offset: 0.15em;
}

img {
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  line-height: 1.2;
  text-wrap: balance;
}

p,
li {
  text-wrap: pretty;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.wide {
  --container-page: 84rem;
}

.masthead,
main {
  max-width: var(--container-page);
  margin-inline: auto;
  padding-inline: var(--spacing-container);
}

.masthead {
  padding-block: calc(var(--spacing) * 10) calc(var(--spacing) * 6);
}

.masthead h1 {
  margin: 0;
  font-size: var(--text-title);
  overflow-wrap: anywhere;
}

.date {
  margin: 0;
  color: var(--color-muted);
  font-size: var(--text-sm);
}

/* The card's bar: back to the table, the site's name and the date, kept in view while the card scrolls. */
.bar {
  position: sticky;
  inset-block-start: 0;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: calc(var(--spacing) * 1) calc(var(--spacing) * 3);
  margin-block-end: calc(var(--spacing) * 8);
  padding-block: calc(var(--spacing) * 3);
  padding-inline: max(var(--spacing-container), (100% - var(--container-page)) / 2 + var(--spacing-container));
  border-block-end: 1px solid var(--color-line);
  background: var(--color-paper);
}

.bar h1 {
  margin: 0;
  font-size: var(--text-bar);
  overflow-wrap: anywhere;
}

.bar .date {
  margin-inline-start: auto;
}

.back {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-inline-start: calc(var(--spacing) * -2);
  border-radius: var(--radius-md);
  color: var(--color-ink);
  font-size: var(--text-xl);
  font-weight: 700;
  text-decoration: none;
}

.back:hover {
  background: var(--color-line);
}

.summary {
  max-width: var(--container-measure);
  margin-block: var(--spacing-flow) 0;
  font-size: var(--text-lg);
}

main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: calc(var(--spacing) * 12);
  padding-block-end: calc(var(--spacing) * 12);
}

main h2 {
  margin-block: 0 calc(var(--spacing) * 4);
  font-size: var(--text-xl);
}

/* The screenshots: the phone under the desktop on a phone, beside it once there is room. */
.shots {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: calc(var(--spacing) * 4);
  align-items: start;
  justify-items: center;
  max-width: 44rem;
}

.shot-phone {
  max-width: min(50%, 11rem);
}

.shots img {
  display: block;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-card);
}

@media (width >= 40rem) {
  .shots {
    grid-template-columns: 1fr minmax(0, 9rem);
  }

  .shot-phone {
    max-width: 100%;
  }
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr));
  gap: calc(var(--spacing) * 3) calc(var(--spacing) * 6);
  margin: 0;
}

.facts dt {
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.axes,
.points,
.presence {
  margin: 0;
  padding: 0;
  list-style: none;
}

.axes {
  display: grid;
  gap: calc(var(--spacing) * 3);
}

.axis {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: calc(var(--spacing) * 4);
  align-items: start;
  padding: calc(var(--spacing) * 4);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  background: var(--color-card);
}

.axis h3,
.rubric h3 {
  margin: 0;
  font-size: var(--text-lg);
}

.why {
  margin: calc(var(--spacing) * 1) 0 0;
  color: var(--color-muted);
  max-width: var(--container-measure);
}

.points {
  display: grid;
  gap: calc(var(--spacing) * 1);
  margin-block-start: calc(var(--spacing) * 2);
  max-width: var(--container-measure);
}

.points li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: calc(var(--spacing) * 2);
  align-items: start;
}

/* The sign before a point of the review, in a filled circle so that it does not read as a bullet, said in words
   to a screen reader. Drawn, not written: a "+" set in a font sits on its baseline, off the circle's centre. */
.points li::before {
  width: 1.375em;
  height: 1.375em;
  margin-block-start: 0.05em;
  border: 1px solid transparent;
  border-radius: 50%;
  --bar: linear-gradient(var(--color-on-dark) 0 0) center / 0.625em 0.125em no-repeat;
}

.points .good::before {
  content: "" / "Strength: ";
  background: var(--bar), linear-gradient(var(--color-on-dark) 0 0) center / 0.125em 0.625em no-repeat,
    var(--color-grade-a);
}

.points .bad::before {
  content: "" / "Weakness: ";
  background: var(--bar), var(--color-grade-e);
}

/* An axis's weak point: the grade it caps the axis to, in a circle of that grade's colour, the letter centred on
   its capitals where text-box is supported. */
.points .capped::before {
  content: none;
}

.cap {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-block-start: 0.05em;
  border: 1px solid transparent;
  border-radius: 50%;
  font-size: var(--text-sm);
  font-weight: 800;
  line-height: 1;
}

.cap > span {
  text-box: trim-both cap alphabetic;
}

@media (forced-colors: active) {
  .points li::before,
  .cap {
    border-color: CanvasText;
  }

  /* Forced colours drop the gradients that draw the signs: written instead. */
  .points .good::before {
    content: "+" / "Strength: ";
  }

  .points .bad::before {
    content: "−" / "Weakness: ";
  }
}

/* The weak points past the third, behind a native disclosure. */
.more-points summary {
  margin-block-start: calc(var(--spacing) * 2);
  color: var(--color-link);
  font-size: var(--text-sm);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
  list-style: none;
}

.more-points summary::-webkit-details-marker {
  display: none;
}

.more-points summary::after {
  content: " ▾" / "";
}

.more-points[open] summary::after {
  content: " ▴" / "";
}

.more-points .when-open,
.more-points[open] .when-closed {
  display: none;
}

.more-points[open] .when-open {
  display: inline;
}

.measured {
  margin: calc(var(--spacing) * 3) 0 0;
  color: var(--color-muted);
  font-size: var(--text-sm);
}

/* The grade: its letter, in a square of its colour, with a border that stays in forced colours. Positioned, so that
   its hidden label stays inside the table's scroll box rather than widening the page. */
.grade {
  position: relative;
  display: inline-grid;
  place-items: center;
  min-width: 2.5em;
  min-height: 2.5em;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  font-size: var(--text-xl);
  font-weight: 800;
  line-height: 1;
}

.cards .grade {
  min-width: 2em;
  min-height: 2em;
  font-size: var(--text-base);
}

.grade-a {
  background: var(--color-grade-a);
  color: var(--color-on-dark);
}

.grade-b {
  background: var(--color-grade-b);
  color: var(--color-on-dark);
}

.grade-c {
  background: var(--color-grade-c);
  color: var(--color-on-light);
}

.grade-d {
  background: var(--color-grade-d);
  color: var(--color-on-light);
}

.grade-e {
  background: var(--color-grade-e);
  color: var(--color-on-dark);
}

.grade-none {
  border-color: var(--color-line);
  color: var(--color-muted);
}

@media (forced-colors: active) {
  .grade {
    border-color: CanvasText;
  }
}

.verdict {
  max-width: var(--container-measure);
  margin-block: 0 calc(var(--spacing) * 6);
  font-size: var(--text-lg);
}

.rubrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
  gap: calc(var(--spacing) * 6);
}

.aside {
  max-width: var(--container-measure);
  margin-block: 0 calc(var(--spacing) * 4);
  color: var(--color-muted);
}

.presence {
  display: grid;
  gap: calc(var(--spacing) * 4);
  max-width: var(--container-measure);
}

.advice {
  margin: calc(var(--spacing) * 1) 0 0;
}

.tools {
  width: 100%;
  border-collapse: collapse;
  color: var(--color-ink);
}

.tools th,
.tools td {
  padding: calc(var(--spacing) * 2) calc(var(--spacing) * 3) calc(var(--spacing) * 2) 0;
  border-block-start: 1px solid var(--color-line);
  text-align: start;
  vertical-align: top;
}

.tools thead th {
  color: var(--color-muted);
  font-weight: 600;
}

.tools small {
  display: block;
  color: var(--color-muted);
  font-weight: 400;
}

/* A link that opens a new tab ends in a glyph, a plain arrow pointing up and right: a mask on an inline-block, which
   the link's underline does not run under, as it would under a character. Drawn, never read: the link's own words
   say it opens a new tab. As the foundation pattern of ~/PATTERNS draws it. */
a[target='_blank']::after {
  content: '';
  display: inline-block;
  inline-size: 0.8em;
  block-size: 0.8em;
  margin-inline-start: 0.2em;
  vertical-align: 0;
  background-color: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 19 19 5M7 5h12v12'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

/* In the system's colours, a background is the window's: the glyph keeps the links'. */
@media (forced-colors: active) {
  a[target='_blank']::after {
    forced-color-adjust: none;
    background-color: LinkText;
  }
}

/* The table of every card: it scrolls sideways on a phone, the site's name kept in view. */
.table-wrapper {
  overflow: auto;
  max-inline-size: 100%;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  background: var(--color-card);
}

.cards {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 100%;
}

.cards caption {
  padding: calc(var(--spacing) * 3) calc(var(--spacing) * 4);
  color: var(--color-muted);
  font-size: var(--text-sm);
  text-align: start;
}

.cards th,
.cards td {
  padding: calc(var(--spacing) * 2) calc(var(--spacing) * 2.5);
  border-block-start: 1px solid var(--color-line);
  text-align: center;
  white-space: nowrap;
}

.cards thead th {
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: normal;
  min-width: 6rem;
}

.cards tbody th {
  position: sticky;
  inset-inline-start: 0;
  background: var(--color-card);
  text-align: start;
}

/* The date smaller than the grades, its time below it. */
.cards .when {
  font-size: var(--text-sm);
}

.when span {
  display: block;
  color: var(--color-muted);
}

.cards small {
  display: block;
  color: var(--color-muted);
  font-weight: 400;
}

/* The tags of a site in the table of cards: round, to tell them from the square grades. */
.tags {
  white-space: nowrap;
}

.tag {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 1.75em;
  height: 1.75em;
  margin-inline: calc(var(--spacing) * 0.5);
  border: 2px solid transparent;
  border-radius: 50%;
  color: var(--color-on-dark);
  font-size: var(--text-sm);
  font-weight: 800;
  line-height: 1;
}

.tag-parisiam {
  background: var(--color-tag-parisiam);
}

.tag-astro {
  background: var(--color-tag-astro);
}

.tag-php {
  background: var(--color-tag-php);
}

.tag-html {
  background: var(--color-tag-html);
}

.tag-wordpress {
  background: var(--color-tag-wordpress);
}

.tag-react {
  background: var(--color-tag-react);
  color: var(--color-on-light);
}

.tag-wix {
  background: var(--color-ink);
}

.tag-red {
  background: var(--color-tag-red);
}

.tag-black {
  background: var(--color-ink);
}

.tag-violet {
  background: var(--color-tag-violet);
}

.tag-blue {
  background: var(--color-tag-blue);
}

.tag-green {
  background: var(--color-tag-green);
}

.tag-grey {
  background: var(--color-muted);
}

/* A tag after a site's name: smaller, not to weigh on the name, and square with rounded corners, to tell it from
   the round tags of the technologies. */
.tag-small {
  width: auto;
  min-width: 1rem;
  height: 1rem;
  margin-inline: calc(var(--spacing) * 1) 0;
  padding-inline: 0.2rem;
  border-width: 1px;
  border-radius: 0.25rem;
  font-size: 0.625rem;
  vertical-align: 0.15em;
}

@media (forced-colors: active) {
  .tag {
    border-color: CanvasText;
  }
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--spacing) * 2) calc(var(--spacing) * 6);
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.legend li {
  display: flex;
  align-items: center;
  gap: calc(var(--spacing) * 1);
}

/* The impression: its first sentence, then « Voir plus » for the rest, a native disclosure. */
.impression p,
.impression summary {
  max-width: var(--container-measure);
  margin: 0;
  font-size: var(--text-lg);
}

.impression summary {
  cursor: pointer;
  list-style: none;
}

.impression summary::-webkit-details-marker {
  display: none;
}

.impression .more {
  color: var(--color-link);
  font-size: var(--text-base);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  white-space: nowrap;
}

.impression details[open] .more {
  display: none;
}

.impression details p {
  margin-block-start: calc(var(--spacing) * 2);
}

.note {
  margin: calc(var(--spacing) * 3) 0 0;
  color: var(--color-muted);
  font-size: var(--text-sm);
}

/* Printed or saved as a PDF: no way back to a table, the bar in its place, every weak point shown. */
@media print {
  .back,
  .more-points summary,
  .impression .more {
    display: none;
  }

  .bar {
    position: static;
  }

  details::details-content {
    content-visibility: visible;
  }
}
