/* Base blog styles — consumes tokens.css variables. Portado pixel-perfect de
 * claude-design/project/{TopBar,BlogScreen,ArticuloScreen,ThemeSwitch}.dc.html
 * (no del markup React actual), 006-blog-server-render T006. */

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
}

body {
  overflow-x: hidden;
  margin: 0;
  background: var(--bg);
  color: var(--t1);
  font-family: var(--font-body);
  transition:
    background 0.3s ease,
    color 0.3s ease;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
}

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

button {
  font-family: inherit;
}

img {
  max-width: 100%;
  display: block;
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.by-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--frame);
}

/* --- TopBar --------------------------------------------------------- */

.by-topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  transition:
    background 0.3s ease,
    border-color 0.3s ease;
}

.by-topbar__brand {
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.by-topbar__title {
  font: 800 21px/1 var(--font-heading);
  color: var(--t1);
  letter-spacing: -0.02em;
}

/* --- Theme switch ----------------------------------------------------- */

.by-theme-switch {
  position: relative;
  width: 66px;
  height: 34px;
  flex: none;
  border-radius: 999px;
  border: 1px solid var(--border2);
  background: var(--surface3);
  cursor: pointer;
  padding: 0;
  transition:
    background 0.3s ease,
    border-color 0.3s ease;
}

.by-theme-switch__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.3, 0.5, 1);
}

:root[data-theme="dark"] .by-theme-switch__knob {
  transform: translateX(32px);
}

.by-theme-switch__moon {
  display: none;
}

:root[data-theme="dark"] .by-theme-switch__sun {
  display: none;
}

:root[data-theme="dark"] .by-theme-switch__moon {
  display: block;
}

/* --- Footer ------------------------------------------------------------ */

.by-footer {
  padding: 44px 56px 34px;
  margin-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.by-footer__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.by-footer__title {
  font: 800 16px/1 var(--font-heading);
  color: var(--t1);
  letter-spacing: -0.02em;
}

.by-footer__tagline {
  font: 500 13px/1 var(--font-body);
  color: var(--t4);
}

.by-footer__legal {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.by-footer__legal a {
  font: 600 13px/1 var(--font-body);
  color: var(--t3);
  text-decoration: none;
}

.by-footer__legal a:hover {
  color: var(--greenTx);
}

.by-main {
  flex: 1;
}

.by-section-padding {
  padding-left: 56px;
  padding-right: 56px;
}

@media (max-width: 640px) {
  .by-section-padding,
  .by-topbar,
  .by-footer {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* --- Article card / grid ------------------------------------------------ */

.by-article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 26px;
}

/* Related articles ("Sigue leyendo"): 2x2, then a single column on phones.
 *
 * The count is even on purpose (RELATED_ARTICLES_LIMIT = 4) so both states
 * divide exactly and no card is ever left alone in a half-empty row. That is
 * what keeps this to two breakpoints and ONE card design — with an odd count
 * the tablet width needed a separate horizontal card variant, which had to
 * override the 16/9 cover and depended on being declared after
 * .by-article-card; both of those broke in review. If the limit ever goes back
 * to an odd number, this grid needs rethinking, not just a new track count.
 *
 * Deliberately not auto-fill: auto-fill keeps the empty tracks it creates, so
 * on a wide viewport the cards hugged the left of a 6-track grid with ~900px of
 * dead space beside them. The block is capped to the article's column in
 * article.html, which keeps these two tracks at ~381px on any desktop.
 *
 * (The design bundle's ArticuloScreen.dc.html shows a 3-up; 4-across was
 * measured at that width and left 132px for the title, running 4-6 lines.) */
.by-article-grid--compact {
  grid-template-columns: repeat(2, 1fr);
}

/* 640px is the same breakpoint .by-section-padding uses to drop to 20px gutters. */
@media (max-width: 640px) {
  .by-article-grid--compact {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.by-article-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 22px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 44px -38px var(--shadowLg);
  transition:
    background 0.3s ease,
    border-color 0.3s ease;
}

/* Card cover: 16:9 like the article hero and the stored file itself, so the
 * same image is framed identically on every surface. Driven by aspect-ratio
 * rather than a fixed pixel height, which would have re-cropped the cover to
 * a different ratio in every grid column width. */
.by-article-card__cover {
  position: relative;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
}

.by-article-card__cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.by-article-card__body {
  padding: 24px 24px 26px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.by-article-card--compact .by-article-card__body {
  padding: 22px 22px 24px;
}

.by-article-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.by-article-card--compact .by-article-card__meta {
  margin-bottom: 12px;
}

.by-badge {
  display: inline-flex;
  align-items: center;
  font: 800 11px/1 var(--font-body);
  padding: 7px 11px;
  border-radius: 999px;
}

.by-article-card__reading-time {
  font: 600 12.5px/1 var(--font-body);
  color: var(--t4);
}

.by-article-card__title {
  margin: 0 0 10px;
  font: 700 20px/1.25 var(--font-heading);
  color: var(--t1);
  letter-spacing: -0.01em;
}

.by-article-card--compact .by-article-card__title {
  margin: 0;
  font-size: 18px;
}

.by-article-card__excerpt {
  margin: 0 0 20px;
  font: 400 14.5px/1.55 var(--font-body);
  color: var(--t3);
}

.by-article-card__footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.by-article-card__date {
  font: 500 12.5px/1 var(--font-body);
  color: var(--t4);
}

/* --- Category accent classes (badge + cover) --------------------------- */

.by-accent-optim .by-badge {
  background: var(--cat-optim-badgeBg);
  color: var(--cat-optim-badgeTx);
}
.by-accent-optim .by-article-card__cover {
  background-image: var(--cat-optim-cover);
}

.by-accent-tuto .by-badge {
  background: var(--cat-tuto-badgeBg);
  color: var(--cat-tuto-badgeTx);
}
.by-accent-tuto .by-article-card__cover {
  background-image: var(--cat-tuto-cover);
}

.by-accent-expli .by-badge {
  background: var(--cat-expli-badgeBg);
  color: var(--cat-expli-badgeTx);
}
.by-accent-expli .by-article-card__cover {
  background-image: var(--cat-expli-cover);
}

.by-accent-general .by-badge {
  background: var(--cat-general-badgeBg);
  color: var(--cat-general-badgeTx);
}
.by-accent-general .by-article-card__cover {
  background-image: var(--cat-general-cover);
}

/* --- Archived pill + collapsible note (hide_from_listing articles) ------ */

.by-archived-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 800 11px/1 var(--font-body);
  padding: 7px 11px 7px 9px;
  border-radius: 999px;
  background: var(--surface2);
  color: var(--t3);
  border: 1px solid var(--border3);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.by-archived-pill:hover,
.by-archived-pill:focus-visible {
  color: var(--t2);
}

.by-archived-pill:focus-visible {
  outline: 2px solid var(--greenTx);
  outline-offset: 2px;
}

.by-archived-pill__chevron {
  transition: transform 0.2s ease;
}

.by-archived-pill[aria-expanded="true"] .by-archived-pill__chevron {
  transform: rotate(180deg);
}

.by-archived-note {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.22s ease;
}

.by-archived-note.is-open {
  grid-template-rows: 1fr;
}

/* Direct grid child collapses via the row track; overflow hides its content
 * while the track is 0fr. The padded box lives one level deeper so its own
 * padding/border don't leak while collapsed. */
.by-archived-note__inner {
  overflow: hidden;
  min-height: 0;
}

.by-archived-note.is-open .by-archived-note__inner {
  margin-bottom: 20px;
}

.by-archived-note__inner p {
  margin: 0;
  padding: 12px 15px;
  background: var(--surface2);
  border: 1px solid var(--border3);
  border-radius: 12px;
  color: var(--t3);
  font: 400 13.5px/1.55 var(--font-body);
}

.by-archived-note__inner strong {
  color: var(--t1);
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  .by-archived-pill,
  .by-archived-pill__chevron,
  .by-archived-note {
    transition: none;
  }
}

/* --- Empty state --------------------------------------------------------- */

.by-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 60px 20px;
  text-align: center;
}

.by-empty-state__title {
  margin: 0;
  font: 700 18px/1.4 var(--font-heading);
  color: var(--t1);
}

.by-empty-state__hint {
  margin: 0;
  font: 400 14.5px/1.5 var(--font-body);
  color: var(--t3);
}

/* --- Share controls ------------------------------------------------------ */

.by-share-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.by-share-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--t2);
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}

.by-share-btn--copied {
  background: rgba(22, 163, 74, 0.1);
  border-color: #16a34a;
  color: #16a34a;
}

.by-share-btn svg {
  pointer-events: none;
}

/* Copy button icon swap: link by default, check once copied. */
.by-share-icon--check {
  display: none;
}

.by-share-btn--copied .by-share-icon--link {
  display: none;
}

.by-share-btn--copied .by-share-icon--check {
  display: block;
}

/* --- Reading progress bar ------------------------------------------------- */

.by-reading-progress {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 5px;
  background: var(--track);
}

.by-reading-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, #12b981, #3dd07e);
  width: 0%;
  transition: width 0.08s linear;
}

/* --- Core "Resumen" block -------------------------------------------------- */

/* Same device as the in-body `core-callout`: avatar in the margin, a green
 * rule and the shared eyebrow, no card. It used to be a filled card, which
 * is exactly what the content blocks stopped being — and both are Core
 * talking, so they cannot look like two different things. The type stays
 * bigger here: this is the article's opening, not an aside. */
.by-core-block {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 40px;
}

/* The text column, i.e. everything but the avatar (which the template wraps
 * in its own div so it can stay `flex:none`). */
.by-core-block > div:last-child {
  border-left: 2px solid color-mix(in srgb, var(--green) 45%, transparent);
  padding-left: 18px;
}

.by-core-block__label {
  font: 800 11px/1 var(--font-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--greenTx);
  margin-bottom: 10px;
}

.by-core-block__text {
  margin: 0;
  font: 500 16.5px/1.6 var(--font-body);
  color: var(--t2);
}

/* --- Article body -------------------------------------------------------- */

.by-article-body {
  max-width: 760px;
  margin: 0 auto;
  font: 400 16.5px/1.75 var(--font-body);
  color: var(--t2);
}

.by-article-body h2,
.by-article-body h3 {
  color: var(--t1);
  margin-top: 2em;
}

.by-article-body img {
  border-radius: 16px;
}

.by-article-body a {
  color: var(--greenTx);
  text-decoration: underline;
}

/* Brand content blocks (div[data-block], sanitizer.py ALLOWED_CLASSES) —
 * numbered steps, stat cards and Core callouts embedded in article bodies
 * (claude-design/project/ArticuloScreen.dc.html "pasos"/"stats"/"aviso de
 * Core" sections). */

/* One card with a timeline inside: a rail joins the numbered circles down the
 * left gutter. The card is what separates the block from the prose; the rail is
 * what makes it read as a sequence instead of as one more key-value sheet
 * (`specs` is usually a scroll away in the same article). Deliberately no
 * per-step separator — the rail already does that job, and a hairline crossing
 * it chops the rail up and drags the block back towards looking like `specs`. */
.by-article-body div[data-block="steps"] {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 24px 26px;
  margin: 28px 0;
}

/* Not a flex container: the step's text is a bare run of inline nodes
 * (<strong>, <em>, text) that the sanitizer won't let us wrap, so flex would
 * promote each one to its own column. The number is taken out of the flow with
 * position instead, and padding-left reserves its gutter. */
.by-article-body div[data-block="steps"] div.step {
  position: relative;
  padding: 0 0 22px 44px;
  font: 500 14.5px/1.6 var(--font-body);
  color: var(--t2);
}

.by-article-body div[data-block="steps"] div.step:last-child {
  padding-bottom: 0;
}

/* The rail belongs to each step and reaches down to the next circle, so it
 * stretches with that step's own height. Tinted green rather than --border2:
 * the border tokens are so light that in the light theme the rail vanished and
 * the steps read as four unconnected numbers. */
.by-article-body div[data-block="steps"] div.step::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 32px;
  bottom: 2px;
  width: 2px;
  background: color-mix(in srgb, var(--green) 32%, transparent);
}

/* The last step has nothing to join. */
.by-article-body div[data-block="steps"] div.step:last-child::before {
  display: none;
}

.by-article-body span.step-number {
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 800 13px/1 var(--font-heading);
}

/* The gain lives in its own column on the right, flush to the edge and one
 * fixed width for every step, so the badges line up down the block instead
 * of shifting with the length of each label. Absolutely positioned for the
 * same reason as the number: the step's text is a bare run of inline nodes
 * with no wrapper to push the badge against. Only the steps that carry one
 * reserve the gutter — hence the :has(). */
.by-article-body div[data-block="steps"] div.step:has(span.step-gain) {
  padding-right: 96px;
}

.by-article-body span.step-gain {
  position: absolute;
  right: 0;
  top: 1px;
  width: 84px;
  padding: 5px 8px;
  text-align: center;
  white-space: nowrap;
  font: 800 11px/1 var(--font-body);
  color: var(--cat-optim-badgeTx);
  background: var(--cat-optim-badgeBg);
  border-radius: 999px;
}

/* On a phone the right-hand column is unaffordable: 84px of badge plus the
 * number's gutter leaves the text around 110px on a 360px screen, which
 * wraps every step into a tower. Below that width the badge drops under the
 * step, starting at the text's own left edge (left: 44px is exactly the
 * step's padding-left, so badge and text share a margin). It stays absolute
 * — the badge is written before the text, so putting it back in the flow
 * would place it above the step, not below — and the step reserves a band at
 * the foot for it: 22px of the usual inter-step gap plus the badge's own
 * height and breathing room. */
@media (max-width: 560px) {
  .by-article-body div[data-block="steps"] div.step:has(span.step-gain) {
    padding-right: 0;
    padding-bottom: 53px;
  }

  .by-article-body div[data-block="steps"] div.step:has(span.step-gain):last-child {
    padding-bottom: 31px;
  }

  .by-article-body span.step-gain {
    top: auto;
    right: auto;
    bottom: 22px;
    left: 44px;
    width: auto;
    text-align: left;
  }

  .by-article-body
    div[data-block="steps"]
    div.step:has(span.step-gain):last-child
    span.step-gain {
    bottom: 0;
  }
}

/* stat-card: no card at all. The figure carries the block on typographic
 * scale — a brand-green rule on top, the number big in the heading face with
 * tabular figures (so a row of them lines up digit by digit), the label
 * under it. Boxing a number never made it louder: the box was the same one
 * steps, specs and versus already wore, so nothing stood out. */
.by-article-body div[data-block="stat-card"] {
  border-top: 3px solid var(--green);
  padding: 16px 0 0;
  margin: 28px 0;
}

/* Reads as one strip of instruments rather than N repeated cards: no card to
 * separate, each column's own rule does that job. Row gap still needed for
 * when the grid wraps. */
.by-article-body div[data-block="stat-grid"] {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 26px 32px;
  margin: 28px 0;
}

.by-article-body div[data-block="stat-grid"] div[data-block="stat-card"] {
  margin: 0;
}

.by-article-body span.stat-value {
  display: block;
  font: 800 54px/1 var(--font-heading);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--green);
  margin-bottom: 10px;
}

/* Smaller inside the grid: three 54px numbers side by side stop reading as a
 * highlight and start reading as a headline. */
.by-article-body div[data-block="stat-grid"] span.stat-value {
  font-size: 42px;
}

.by-article-body span.stat-label {
  display: block;
  font: 500 14px/1.45 var(--font-body);
  color: var(--t2);
}

/* Core speaks from the margin, not from a box: his avatar, a green rule and
 * a label that finally names him. The speech bubble was one more rounded
 * card on a page full of them, which flattened the one block that is a
 * voice — and nothing told the reader who the green character even was.
 * (Avatar: claude-design/project/Core.dc.html "wink" expression, inlined as
 * an SVG data URI — the sanitizer only allows a single <div> here, so Core
 * is a pseudo-element rather than a sibling markup node.) */
.by-article-body div[data-block="core-callout"] {
  position: relative;
  border-left: 2px solid color-mix(in srgb, var(--green) 45%, transparent);
  padding-left: 18px;
  margin: 38px 0 30px 58px;
  font: 500 15px/1.6 var(--font-body);
  color: var(--t2);
}

/* Anchored to the top, not the bottom: the label sits above the first line
 * and Core has to line up with it to read as its speaker. */
.by-article-body div[data-block="core-callout"]::before {
  content: "";
  position: absolute;
  left: -58px;
  top: 0;
  width: 40px;
  height: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 58 58'%3E%3Crect x='26' y='2' width='6' height='8' rx='3' fill='%23FFC24B'/%3E%3Crect x='6' y='6' width='46' height='46' rx='15' fill='%2312B981'/%3E%3Crect x='15' y='14' width='28' height='24' rx='9' fill='%23fff'/%3E%3Ccircle cx='24' cy='26' r='3.4' fill='%2312B981'/%3E%3Cpath d='M32 26 h6' stroke='%2312B981' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
}

/* The label rides ::after only because the avatar already took ::before —
 * it is absolutely positioned, so source order is irrelevant. Generated
 * text, like "A FAVOR", "VS" and "⚠" elsewhere in this file. */
.by-article-body div[data-block="core-callout"]::after {
  content: "Core al habla";
  position: absolute;
  top: -22px;
  left: 18px;
  font: 800 11px/1 var(--font-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--greenTx);
}

/* pros-cons: two side-by-side cards, "A favor" / "En contra" — headings
 * are generated from CSS so the block's markup stays minimal. Each side is
 * tinted in its own colour and its bullets replaced by ✓ / ✕: the two
 * identical grey cards made the reader parse the heading to know which
 * column they were in, which is exactly the work this block exists to save. */
.by-article-body div[data-block="pros-cons"] {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 28px 0;
}

.by-article-body div[data-block="pros-cons"] > div {
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 20px 22px;
  font: 500 14.5px/1.55 var(--font-body);
  color: var(--t2);
}

.by-article-body div[data-block="pros-cons"] div.pros {
  background: color-mix(in srgb, var(--green) 9%, var(--surface));
  border-color: color-mix(in srgb, var(--green) 30%, transparent);
}

.by-article-body div[data-block="pros-cons"] div.cons {
  background: color-mix(in srgb, #d4736a 9%, var(--surface));
  border-color: color-mix(in srgb, #d4736a 32%, transparent);
}

.by-article-body div[data-block="pros-cons"] span.pc-title {
  display: block;
  font: 800 12px/1 var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.by-article-body div[data-block="pros-cons"] div.pros span.pc-title {
  color: var(--greenTx);
}

.by-article-body div[data-block="pros-cons"] div.cons span.pc-title {
  color: #d4736a;
}

.by-article-body div[data-block="pros-cons"] ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.by-article-body div[data-block="pros-cons"] li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 10px;
}

.by-article-body div[data-block="pros-cons"] div.pros li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  font: 800 14px/1.55 var(--font-body);
  color: var(--greenTx);
}

.by-article-body div[data-block="pros-cons"] div.cons li::before {
  content: "✕";
  position: absolute;
  left: 0;
  top: 0;
  font: 800 13px/1.6 var(--font-body);
  color: #d4736a;
}

/* verdict: highlighted final recommendation — brand-green tinted card with
 * the text set in the heading face so it reads as the article's takeaway.
 * It closes the article, so it is deliberately the loudest block on the
 * page: the label is a solid stamp riding the top edge of the card. */
.by-article-body div[data-block="verdict"] {
  position: relative;
  background: var(--cat-optim-cover);
  border: 1px solid var(--chipBorder);
  border-radius: 16px;
  padding: 32px 26px 26px;
  margin: 28px 0;
  font: 700 22px/1.4 var(--font-heading);
  color: var(--t1);
}

.by-article-body div[data-block="verdict"] span.verdict-label {
  position: absolute;
  top: -12px;
  left: 24px;
  background: var(--green);
  color: #fff;
  padding: 7px 13px;
  border-radius: 999px;
  font: 800 11px/1 var(--font-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* versus: head-to-head comparison, optional .winner gets the green border
 * — the "VS" separator is generated so the markup stays two plain divs. */
.by-article-body div[data-block="versus"] {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: stretch;
  margin: 28px 0;
}

.by-article-body div[data-block="versus"] div.vs-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
}

/* The winner has to be readable at a glance, from across the page: a ring
 * plus a tint, not a 1px border swap that only shows up on inspection. The
 * ring is a shadow so it does not change the box and misalign the two
 * columns by a pixel. */
.by-article-body div[data-block="versus"] div.vs-item.winner {
  box-shadow: 0 0 0 2px var(--green);
  background: color-mix(in srgb, var(--green) 7%, var(--surface));
}

.by-article-body div[data-block="versus"]::before {
  content: "VS";
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border2);
  font: 800 12px/1 var(--font-heading);
  color: var(--t3);
}

.by-article-body div[data-block="versus"] div.vs-item:first-child {
  grid-column: 1;
  grid-row: 1;
}

.by-article-body div[data-block="versus"] div.vs-item:last-child {
  grid-column: 3;
  grid-row: 1;
}

.by-article-body span.vs-badge {
  display: inline-block;
  font: 800 10px/1 var(--font-body);
  letter-spacing: 0.08em;
  color: #fff;
  background: var(--green);
  padding: 5px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.by-article-body span.vs-name {
  display: block;
  font: 800 19px/1.2 var(--font-heading);
  color: var(--t1);
  margin-bottom: 6px;
}

.by-article-body span.vs-desc {
  display: block;
  font: 500 14px/1.4 var(--font-body);
  color: var(--t2);
}

/* warning: serious caution notice (data loss, irreversible actions) —
 * distinct from core-callout: objective, not in Core's voice. The ⚠ icon
 * is generated so the markup stays a single text div. */
.by-article-body div[data-block="warning"] {
  display: flex;
  gap: 16px;
  align-items: center;
  background: color-mix(in srgb, var(--yellow) 13%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--yellow) 45%, transparent);
  border-radius: 16px;
  padding: 20px 22px;
  margin: 28px 0;
  font: 500 14.5px/1.5 var(--font-body);
  color: var(--t2);
}

/* The amber tints the whole block instead of being a 4px edge on yet another
 * grey card: a caution notice has to be recognizable before it is read. */
.by-article-body div[data-block="warning"]::before {
  content: "⚠";
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--yellow);
  color: #3a2c05;
  font-size: 16px;
  line-height: 1;
}

/* quote: pull-quote led by a short green kicker rule and set large. The old
 * left accent bar was the same device `warning` used, so the two read as
 * variants of one block; the rule above frees the text to run full width. */
.by-article-body div[data-block="quote"] {
  margin: 34px 0;
  padding: 0;
}

.by-article-body div[data-block="quote"]::before {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  border-radius: 2px;
  background: var(--green);
  margin-bottom: 16px;
}

.by-article-body span.quote-text {
  display: block;
  font: 700 24px/1.42 var(--font-heading);
  color: var(--t1);
}

.by-article-body span.quote-source {
  display: block;
  margin-top: 14px;
  font: 700 11px/1 var(--font-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--t4);
}

/* specs: key-value tech sheet rows inside a single card. */
.by-article-body div[data-block="specs"] {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 8px 24px;
  margin: 28px 0;
}

.by-article-body div[data-block="specs"] div.spec-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font: 500 14px/1.4 var(--font-body);
}

.by-article-body div[data-block="specs"] div.spec-row:last-child {
  border-bottom: none;
}

.by-article-body span.spec-key {
  color: var(--t2);
}

/* Tabular figures on both value columns: proportional digits made the
 * numbers wander from row to row in a block whose whole point is comparing
 * them down the column. */
.by-article-body span.spec-val {
  color: var(--t1);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* specs de dos columnas de valor (bajada/subida, antes/después…): el bloque
 * pasa a ser la rejilla y las filas a `display: contents`, para que las tres
 * columnas queden alineadas entre filas — con una rejilla por fila cada una se
 * dimensionaría sola y los números bailarían de una fila a otra. A cambio la
 * fila deja de generar caja, así que el borde inferior se pinta en cada celda.
 * Todo va detrás de :has() para no tocar el `specs` de una sola columna. */
.by-article-body div[data-block="specs"]:has(span.spec-val2) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  column-gap: 20px;
}

.by-article-body div[data-block="specs"]:has(span.spec-val2) div.spec-row {
  display: contents;
}

.by-article-body div[data-block="specs"]:has(span.spec-val2) div.spec-row > span {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.by-article-body div[data-block="specs"]:has(span.spec-val2) div.spec-row:last-child > span {
  border-bottom: none;
}

/* Subtítulo de grupo: ocupa el ancho entero de la rejilla y parte la ficha en
 * secciones cuando tiene filas de sobra. No es una `spec-row` — no lleva celdas
 * y por eso puede saltarse las tres columnas. */
/* Same eyebrow the other blocks use (11px/800/0.12em, brand green): the
 * sheet's sections and the page's labels should speak one language. */
.by-article-body div[data-block="specs"] div.spec-group {
  grid-column: 1 / -1;
  padding: 24px 0 10px;
  font: 800 11px/1 var(--font-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--greenTx);
}

.by-article-body div[data-block="specs"] div.spec-group:first-child {
  padding-top: 12px;
}

/* La cabecera nombra las dos columnas. Es obligatoria en esta variante: dos
 * cifras sueltas por fila no se distinguen sin ella (`blocks.md`). */
.by-article-body div[data-block="specs"] div.spec-head > span {
  font: 800 11px/1.4 var(--font-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--t4);
}

.by-article-body span.spec-val2 {
  color: var(--t1);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

@media (max-width: 640px) {
  .by-article-body div[data-block="specs"]:has(span.spec-val2) {
    column-gap: 12px;
  }
}

/* lineup: what each option includes — an owner and the set of names it
 * covers, rendered as chips. Exists for the content that is genuinely a
 * roster and reads as a phone directory when forced into prose: seventeen
 * channel names across two sentences, a list of supported GPUs, the formats
 * an app opens. The owner is the scannable anchor; the chips are meant to be
 * skimmed, not read in order. */
.by-article-body div[data-block="lineup"] {
  display: grid;
  gap: 8px;
  margin: 28px 0;
}

/* The card is neutral and the owner carries the colour, as a solid green
 * pill at the head of its own row of chips. It used to be a green tinted
 * card, which put two green cards on any page that also had a `verdict` —
 * same palette, same weight, competing for the same attention. Now the
 * tinted card is the verdict's alone. */
/* flex + gap and NOT margins on the chips: a wrapped inline-block layout
 * leaves the last row's margin-bottom hanging inside the card, which stacks
 * onto the padding and reads as dead space at the foot of every group. With
 * gap there is no trailing margin to absorb. */
.by-article-body div[data-block="lineup"] div.lineup-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 14px 16px;
}

/* A solid green pill leading its own row: white on --green is the same
 * figure/ground the `verdict` stamp and the `versus` badge use, so the three
 * "this is the label" marks across the article are one device. */
.by-article-body div[data-block="lineup"] span.lineup-owner {
  display: inline-block;
  font: 800 12px/1 var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--green);
  color: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  margin: 0 4px 0 0;
}

/* The chips carry the content, so they stay in the highest-contrast text
 * colour: seventeen names in brand green would be a wall of green, and these
 * are meant to be read. The colour lives in the card and the owner. */
.by-article-body div[data-block="lineup"] span.lineup-item {
  display: inline-block;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 999px;
  padding: 5px 12px;
  margin: 0;
  font: 600 13px/1.3 var(--font-body);
  color: var(--t2);
}

/* Cover image: the stored file is already normalized to a fixed 1600x900
 * (16:9) by normalize_cover_image, so we render it at its native ratio via
 * aspect-ratio — no fixed pixel height that would re-crop it at wider column
 * widths. object-fit:cover guards the covers stored before the canonical
 * format moved to 16:9 (they're 1.91:1 and get a few px trimmed off the
 * sides) and any legacy/un-normalized one. */
.by-article-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 22px;
}

.by-article-body figure.article-image {
  margin: 28px 0;
  text-align: center;
}

/* Body images keep their natural size and aspect ratio (they're stored with
 * aspect ratio preserved, longer side <=1600px). Cap at the column width so
 * large images don't overflow, but never upscale small ones. Applies to both
 * figure-wrapped images and bare markdown ![]() images. */
.by-article-body figure.article-image img,
.by-article-body > p img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

.by-article-body figcaption.article-image-caption {
  margin-top: 8px;
  font: 500 13px/1.5 var(--font-body);
  color: var(--t4);
  text-align: center;
}

/* Affiliate disclosure — constitution I, kept visible next to affiliate
 * links whenever body_html includes one (rendered from stored HTML). */
.by-affiliate-notice {
  display: inline-block;
  margin-top: 4px;
  font: 600 12px/1.4 var(--font-body);
  color: var(--t4);
}
