/* Editorial pages: one quiet text column on the home's fog.
   Write plain HTML inside <main class="edito">: headings, paragraphs, lists,
   code, quotes are styled by element, no classes needed. The only class is
   .figures, for a row of key numbers (a <dl>). */

/* ── Header and footer ─────────────────────────────────────────────────── */
.site {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 32px 44px;
}

.site a {
  color: inherit;
  text-decoration: none;
}

.site .home {
  font-size: 22px;
  font-weight: 500;
}

.site nav {
  display: flex;
  gap: 28px;
  font-size: 16px;
  font-weight: 300;
}

.site nav a {
  color: var(--ink-soft);
}

.site nav a:hover,
.site nav a[aria-current="page"] {
  color: var(--ink);
}

.site a:focus-visible,
.edito a:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 3px;
}

.edito + footer {
  max-width: 38rem;
  margin: 0 auto;
  padding: 72px 20px 48px;
  font-size: 15px;
  font-weight: 300;
  color: var(--ink-soft);
}

.edito + footer p {
  margin: 1.6rem 0 0;
}

/* Back to the home page: the one button of an editorial page. */
.edito + footer .back {
  display: inline-block;
  padding: 0.55em 1.2em;
  border: 1px solid rgba(47, 51, 56, 0.35);
  border-radius: 2px;
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.2s, background-color 0.2s;
}

.edito + footer .back:hover {
  border-color: var(--ink);
  background: rgba(255, 255, 255, 0.35);
}

.edito + footer .back:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 3px;
}

/* ── Text column ───────────────────────────────────────────────────────── */
.edito {
  max-width: 38rem;
  margin: 0 auto;
  padding: 7vh 20px 0;
  font-size: 1.125rem;
  font-weight: 300;
  line-height: 1.7;
}

.edito h1 {
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 4rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

/* The paragraph right under the title is its lead, set like the home tagline. */
.edito h1 + p {
  margin: 0.6em 0 0;
  font-size: 1.35rem;
  font-style: italic;
  line-height: 1.5;
  color: var(--ink-soft);
}

.edito h2 {
  margin: 3.2rem 0 0.8rem;
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1.25;
}

.edito h3 {
  margin: 2.2rem 0 0.5rem;
  font-size: 1.2rem;
  font-weight: 400;
  font-style: italic;
}

.edito p {
  margin: 0 0 1.1em;
}

.edito ul,
.edito ol {
  margin: 0 0 1.1em;
  padding-left: 1.3em;
}

.edito li {
  margin-bottom: 0.45em;
}

.edito li::marker {
  color: var(--ink-soft);
}

.edito strong {
  font-weight: 500;
}

.edito a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--ink-soft);
  text-underline-offset: 0.2em;
}

.edito a:hover {
  text-decoration-color: var(--ink);
}

.edito code {
  font-family: var(--mono);
  font-size: 0.82em;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  background: rgba(47, 51, 56, 0.06);
}

.edito pre {
  margin: 0 0 1.3em;
  padding: 1rem 1.2rem;
  white-space: pre-wrap;     /* long lines wrap instead of scrolling sideways */
  overflow-wrap: anywhere;
  border-radius: 4px;
  background: rgba(47, 51, 56, 0.06);
  font-size: 0.95rem;
  line-height: 1.6;
}

.edito pre code {
  padding: 0;
  background: none;
}

.edito blockquote {
  margin: 1.6em 0;
  padding-left: 1.2em;
  border-left: 1px solid var(--ink-soft);
  font-style: italic;
  color: var(--ink-soft);
}

.edito hr {
  height: 1px;
  margin: 3rem 0;
  border: 0;
  background: rgba(107, 111, 117, 0.35);
}

/* ── Key figures ───────────────────────────────────────────────────────── */
.edito .figures {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 28px 2rem;
  margin: 3rem 0 0.5rem;
}

/* Two figures sit side by side instead of at both ends of the column. */
.edito .figures:has(> div:nth-child(2):last-child) {
  justify-content: flex-start;
  column-gap: 5rem;
}

/* Right under a heading, the row needs less air above it. */
.edito h2 + .figures {
  margin-top: 1.2rem;
}

.edito .figures + p {
  margin-top: 1.5rem;
}

.edito .figures div {
  max-width: 10.5rem;
  display: flex;
  flex-direction: column-reverse; /* number above, label below; dt stays first in the markup */
  justify-content: flex-end;      /* pack to the top, so the numbers line up */
}

.edito .figures dd {
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 300;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.edito .figures dt {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--ink-soft);
}

/* ── Sample report ───────────────────────────────────────────────────────
   <figure class="report"> with a <figcaption> and an <ol> of findings; each
   <li class="critical|high|medium"> holds a .severity tag and a <div> (title in
   <strong>, explanation, then a p.fix). */
.edito .report {
  margin: 1.6rem 0 1.4rem;
  padding: 1.3rem 1.5rem 0.4rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 1px rgba(47, 51, 56, 0.08);
}

.edito .report figcaption {
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
  font-weight: 400;
}

.edito .report figcaption span {
  margin-left: 0.5em;
  font-style: italic;
  font-weight: 300;
  color: var(--ink-soft);
}

.edito .report ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.edito .report li {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0 1rem;
  margin: 0;
  padding: 0.9rem 0;
  border-top: 1px solid rgba(107, 111, 117, 0.2);
  font-size: 0.98rem;
  line-height: 1.55;
}

.edito .report li p {
  margin: 0.2rem 0 0;
}

.edito .report .fix {
  color: var(--ink-soft);
  font-style: italic;
}

/* Severity: a dot and a word; rust for critical, the only colour in the block. */
.edito .report .severity {
  font-size: 0.85rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

.edito .report .severity::before {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-right: 0.45em;
  border-radius: 50%;
  vertical-align: 0.1em;
  background: currentColor;
}

.edito .report .critical .severity {
  color: var(--rust);
  font-weight: 400;
}

.edito .report .high .severity {
  color: var(--ink);
}

@media (max-width: 640px) {
  .edito .report {
    padding: 1rem 1rem 0.2rem;
  }

  .edito .report li {
    grid-template-columns: 1fr;
  }
}

/* ── Live log ──────────────────────────────────────────────────────────────
   <ol class="log">: one entry per line, newest first. Entries in progress
   (li.is-active) read "Now", with a slow pulse. Each entry: .when, .what, .where. */
.edito .log {
  list-style: none;
  margin: 1.4rem 0 1.1em;
  padding: 0;
}

.edito .log li {
  display: grid;
  grid-template-columns: 4.5rem 1fr auto;
  gap: 0 1.2rem;
  align-items: baseline;
  margin: 0;
  padding: 0.7rem 0;
  border-top: 1px solid rgba(107, 111, 117, 0.22);
}

.edito .log li:last-child {
  border-bottom: 1px solid rgba(107, 111, 117, 0.22);
}

.edito .log .when {
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}

.edito .log .where {
  font-size: 0.95rem;
  font-style: italic;
  color: var(--ink-soft);
  text-align: right;
}

/* Tasks in progress: darker, with a dot that breathes like the buoy's light. */
.edito .log li.is-active .when,
.edito .log li.is-active .what {
  color: var(--ink);
  font-weight: 400;
}

.edito .log li.is-active .when::before {
  content: "";
  display: inline-block;
  width: 0.45em;
  height: 0.45em;
  margin-right: 0.45em;
  border-radius: 50%;
  background: var(--rust);
  vertical-align: 0.12em;
  animation: log-pulse 2.8s ease-in-out infinite;
}

/* Right under the key figures, the log is condensed: a small live ticker. */
.edito .figures + .log {
  margin: 1.6rem 0 0;
}

.edito .figures + .log li {
  padding: 0.18rem 0;
  font-size: 0.9rem;
  line-height: 1.55;
}

.edito .figures + .log .when,
.edito .figures + .log .where {
  font-size: 0.8rem;
}

/* New entries, on refresh, come in from above. */
.edito .log li.is-new {
  animation: log-in 0.8s ease-out both;
}

@keyframes log-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

@keyframes log-in {
  from { opacity: 0; transform: translateY(-0.4rem); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .edito .log li.is-active .when::before,
  .edito .log li.is-new {
    animation: none;
  }
}

@media (max-width: 640px) {
  .edito .log li {
    grid-template-columns: 4rem 1fr;
  }

  .edito .log .where {
    grid-column: 2;
    text-align: left;
  }
}

@media (max-width: 640px) {
  .site {
    padding: 22px 20px;
  }

  .site nav {
    gap: 18px;
    font-size: 15px;
  }
}
