/*
 * The post cover already carries descriptive text in `img[alt]`. The theme
 * repeats it as a visible figcaption under the cover; the blog does not want
 * that caption. Hide only the cover caption, not future inline figures.
 */
#main-wrapper .post-meta div.mt-3.mb-3 > figcaption {
  display: none;
}

/*
 * Center the profile block. The theme left-aligns the avatar and the title;
 * on a narrow sidebar the avatar looks offset from the name.
 */
#sidebar .profile-wrapper {
  text-align: center;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

#sidebar #avatar {
  margin-left: auto;
  margin-right: auto;
}

#sidebar .site-title {
  margin-left: auto;
  margin-right: auto;
}

#sidebar .site-subtitle {
  text-align: center;
}

/*
 * Keep every sidebar-bottom control on one line (mode, GitHub, X, LinkedIn,
 * email and RSS). The theme's 2rem left padding and 13px gaps wrap the last
 * icon on a 260px sidebar.
 */
#sidebar .sidebar-bottom {
  flex-wrap: nowrap;
  justify-content: center;
  padding-left: 1rem;
  padding-right: 1rem;
}

#sidebar .sidebar-bottom > a:not(:last-child) {
  margin-right: 0.25rem;
}

#sidebar .sidebar-bottom .icon-border {
  margin-left: 0.35rem;
  margin-right: 0.35rem;
}

/*
 * Home only: give the post list one more Bootstrap column. The theme uses
 * 9/12 for the list and 3/12 for the right panels; on a wide screen that
 * leaves a lot of empty space around the cards. Posts, TOC and other pages
 * keep the theme's 9/3 split.
 */
@media (min-width: 1200px) {
  #main-wrapper .row:has(#post-list) > main.col-xl-9 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  #main-wrapper .row:has(#post-list) > aside.col-xl-3 {
    flex: 0 0 100%;
    max-width: 100%;
    margin-top: 1.5rem;
    padding-left: 0;
    padding-right: 0;
  }

  /* Move the two home panels below the posts, side by side. */
  #main-wrapper .row:has(#post-list) > aside#panel-wrapper .access {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

/*
 * Asciinema: self-hosted terminal recordings. One border/background shared by
 * every player; the player itself scales to the content width.
 */
.asciinema-wrapper {
  margin: 1.75rem 0;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.5rem;
  overflow: hidden;
  background: #121314;
}

.asciinema-wrapper .asciinema-player {
  width: 100%;
}

.asciinema-wrapper .asciinema-zoombar,
.asciinema-wrapper .asciinema-close,
.asciinema-wrapper .asciinema-expand {
  display: none;
}

@media (max-width: 575.98px), (hover: none) and (pointer: coarse) {
  .asciinema-wrapper .asciinema-expand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 0.75rem 0.75rem auto;
    padding: 0.35rem 0.8rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.35rem;
    background: transparent;
    color: var(--bs-body-color);
    font: inherit;
    font-size: 0.875rem;
  }
}

/*
 * The "Ampliar" overlay is a CSS pseudo-fullscreen. iPhone Safari does not
 * support Element.requestFullscreen for non-video content, so the native
 * player button cannot be relied on there. The overlay fills the viewport and
 * keeps a readable terminal width with horizontal scroll.
 */
.asciinema-wrapper.is-zoomed {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  margin: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
}

.asciinema-wrapper.is-zoomed .asciinema-zoombar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.75rem;
  background: #1f2429;
  color: #f8f9fa;
  font-size: 0.875rem;
}

.asciinema-wrapper.is-zoomed .asciinema-close {
  display: inline-flex;
  padding: 0.25rem 0.6rem;
  border: 1px solid #6c757d;
  border-radius: 0.35rem;
  background: transparent;
  color: #f8f9fa;
  font: inherit;
}

.asciinema-wrapper.is-zoomed .asciinema-scroll {
  flex: 1;
  overflow: auto;
}

.asciinema-wrapper.is-zoomed .asciinema-player {
  min-width: 720px;
}

.asciinema-wrapper.is-zoomed .asciinema-expand {
  display: none;
}

html.asciinema-zoom-open,
html.asciinema-zoom-open body {
  overflow: hidden;
}

.asciinema-wrapper .asciinema-fallback {
  margin: 0;
  padding: 1rem;
  color: #f8f9fa;
}

/*
 * Contact form (/about/#contacto). Black and white, built on the theme
 * variables so it works the same in light and dark mode. No JS of its own:
 * the POST goes to /contact.
 */
#contacto {
  scroll-margin-top: 5rem;
}

.contact-form {
  margin: 1.5rem 0 1.75rem;
  padding: 1.5rem;
  border: 1px solid var(--main-border-color);
  border-radius: 0.75rem;
  background: var(--card-bg);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}

.contact-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.contact-field--full {
  grid-column: 1 / -1;
}

.contact-field label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--label-color);
}

.contact-optional {
  font-weight: 400;
  color: var(--text-muted-color);
}

.contact-field input,
.contact-field textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--btn-border-color);
  border-radius: 0.5rem;
  background: var(--main-bg);
  color: var(--text-color);
  font: inherit;
  line-height: 1.5;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.contact-field textarea {
  min-height: 9rem;
  resize: vertical;
}

.contact-field input::placeholder,
.contact-field textarea::placeholder {
  color: var(--text-muted-color);
  opacity: 0.8;
}

.contact-field input:focus,
.contact-field textarea:focus {
  outline: none;
  border-color: var(--input-focus-border-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--input-focus-border-color) 22%, transparent);
}

.contact-help {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted-color);
}

.contact-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-turnstile {
  margin: 1rem 0 0.25rem;
  min-height: 65px;
}

.contact-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.contact-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.15rem;
  border: 0;
  border-radius: 0.5rem;
  background: var(--text-color);
  color: var(--main-bg);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.contact-submit:hover {
  opacity: 0.88;
}

.contact-submit:active {
  transform: translateY(1px);
}

.contact-submit:focus-visible {
  outline: 2px solid var(--link-color);
  outline-offset: 2px;
}

.contact-privacy {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted-color);
}

@media (max-width: 767.98px) {
  .contact-form {
    padding: 1.1rem;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .contact-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .contact-submit {
    justify-content: center;
    width: 100%;
  }
}

/*
 * PGP public key (/about/#contacto-cifrado). The card reuses the theme
 * variables to look the same in light and dark mode; without JS the
 * fingerprint stays selectable and the armored block inherits the theme's
 * copy button.
 */
#contacto-cifrado {
  scroll-margin-top: 5rem;
}

.pgp-card {
  margin: 1.5rem 0 1.1rem;
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--main-border-color);
  border-radius: 0.75rem;
  background: var(--card-bg);
}

.pgp-card__head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.pgp-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--main-border-color);
  border-radius: 50%;
  color: var(--text-color);
}

.pgp-card__title {
  margin: 0;
  font-weight: 600;
  line-height: 1.3;
}

.pgp-card__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1.25rem;
  margin: 1.25rem 0 0;
}

.pgp-card__row {
  margin: 0;
  min-width: 0;
}

.pgp-card__row--wide {
  grid-column: 1 / -1;
}

.pgp-card__meta dt {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted-color);
}

.pgp-card__meta dd {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  color: var(--text-color);
  overflow-wrap: anywhere;
}

.pgp-card__meta dd code {
  padding: 0;
  background: none;
  font-size: 0.82rem;
}

.pgp-card__fpr {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--text-color);
}

.pgp-card__note {
  margin: 1.1rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted-color);
}

.pgp-card__meta + .pgp-card__note {
  border-top: 1px solid var(--main-border-color);
  padding-top: 0.9rem;
}

.pgp-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.1rem;
}

.pgp-card__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--text-color);
  border-radius: 0.5rem;
  background: var(--text-color);
  color: var(--main-bg);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.pgp-card__btn:hover {
  color: var(--main-bg);
  opacity: 0.88;
}

.pgp-card__btn:active {
  transform: translateY(1px);
}

.pgp-card__btn--ghost {
  border-color: var(--btn-border-color);
  background: transparent;
  color: var(--text-color);
}

.pgp-card__btn--ghost:hover {
  border-color: var(--text-color);
  color: var(--text-color);
}

.pgp-card__btn:focus-visible {
  outline: 2px solid var(--link-color);
  outline-offset: 2px;
}

.pgp-key {
  margin: 0 0 1.75rem;
}

.pgp-key .highlight {
  font-size: 0.78rem;
}

@media (max-width: 767.98px) {
  .pgp-card {
    padding: 1.1rem;
  }

  .pgp-card__meta {
    grid-template-columns: 1fr;
  }

  .pgp-card__head {
    align-items: flex-start;
  }

  .pgp-card__fpr {
    font-size: 0.75rem;
  }

  .pgp-card__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .pgp-card__btn {
    justify-content: center;
  }
}

/* Article tables can hold long lists of services, formats or values. The
   theme forces one line per cell; wrapping is allowed so the table fits the
   column instead of forcing horizontal scrolling.

   Words wrap with `break-word` plus Spanish hyphenation (`lang="es"`), never
   `anywhere`: `anywhere` lets the browser shrink a column to one character,
   so numbers and words split letter by letter ("1.0/00./000", "Fil/as").
   Measured on the 381 tables of 128 posts (2026-11-22): split cells at
   1366 px went from 41 to 1, at 1024 px no table overflows, and the tables
   are 1.5 % shorter on desktop. The first column wraps too: kept on one line,
   a long label took half the width and squeezed the numeric columns. */
.content .table-wrapper > table th,
.content .table-wrapper > table td {
  white-space: normal;
  overflow-wrap: break-word;
  hyphens: auto;
  /* Only words of 7+ letters, 3 before and 4 after the hyphen: no "Te-mas",
     and "PowerBASIC" breaks as "Power-BASIC", not "PowerBA-SIC". Measured: no
     new overflow at 390-1366 px; at 360 px 85 tables scroll (93 before). */
  hyphenate-limit-chars: 7 3 4;
}

.content .table-wrapper > table code {
  overflow-wrap: anywhere;
}

.content .table-wrapper > table th:first-child,
.content .table-wrapper > table td:first-child {
  overflow-wrap: normal;
  word-break: normal;
  white-space: normal;
}

.content .table-wrapper > table td:first-child code {
  overflow-wrap: anywhere;
}

/* On a phone the nowrap first column above breaks 2-3 column tables whose
   first cell is a long identifier: at 360 px, `palmos-programming_recipies`
   took 244 px and left 46 and 41 px to the other columns, so every row grew
   to 1,000-1,500 px. Below 768 px the first column wraps and its code can
   break anywhere. Tables with 4+ columns keep scrolling (next rule). */
@media (max-width: 767.98px) {
  /* Headers and numbers must not split letter by letter ("Fic/he/ros",
     "63/2"): plain words only break when they cannot fit at all. */
  .content .table-wrapper > table:not(:has(thead th:nth-child(4))) th,
  .content .table-wrapper > table:not(:has(thead th:nth-child(4))) td {
    overflow-wrap: break-word;
    /* 16 px per side is a fifth of a phone screen lost to padding. */
    padding: 0.55rem 0.6rem;
  }

  .content .table-wrapper > table:not(:has(thead th:nth-child(4))) th:first-child,
  .content .table-wrapper > table:not(:has(thead th:nth-child(4))) td:first-child {
    white-space: normal;
    width: 38%;
  }

  /* Only identifiers in code may break anywhere. */
  .content .table-wrapper > table:not(:has(thead th:nth-child(4))) td:first-child code {
    overflow-wrap: anywhere;
  }
}

/* Comparisons with 4+ columns: on mobile, scrolling the table beats
   squeezing every cell until words break. 3-column tables still wrap text;
   6-column ones need more width to stay readable. */
@media (max-width: 767.98px) {
  .content .table-wrapper > table:has(thead th:nth-child(4)) {
    min-width: 48rem;
  }

  .content .table-wrapper > table:has(thead th:nth-child(6)) {
    min-width: 60rem;
  }

  /* The label column of a wide table used to stay on one line and fill the
     whole screen, so the first view showed labels and no data. Capped, it
     wraps and the first two data columns are visible next to it (measured at
     360/390 px: split cells 21 -> 7, no new scroll, tables 0.2 % taller). */
  .content .table-wrapper > table:has(thead th:nth-child(4)) th:first-child,
  .content .table-wrapper > table:has(thead th:nth-child(4)) td:first-child {
    min-width: 7.5rem;
    max-width: 10rem;
  }
}

/* /feeds/: long directory tables should wrap, not force horizontal scroll. */
.content:has(#feeds-directory) .table-wrapper > table {
  width: 100%;
}

.content:has(#feeds-directory) .table-wrapper > table th,
.content:has(#feeds-directory) .table-wrapper > table td {
  white-space: normal;
  overflow-wrap: break-word;
}

.content:has(#feeds-directory) .table-wrapper > table th:first-child,
.content:has(#feeds-directory) .table-wrapper > table td:first-child {
  width: 36%;
}

.content:has(#feeds-directory) .table-wrapper > table th:last-child,
.content:has(#feeds-directory) .table-wrapper > table td:last-child {
  width: 64%;
}

@media (max-width: 767.98px) {
  /* Stack the feeds table as cards so it does not need horizontal scroll. */
  .content:has(#feeds-directory) .table-wrapper {
    overflow-x: visible;
  }

  .content:has(#feeds-directory) .table-wrapper > table,
  .content:has(#feeds-directory) .table-wrapper > table tbody,
  .content:has(#feeds-directory) .table-wrapper > table tr,
  .content:has(#feeds-directory) .table-wrapper > table td {
    display: block;
    width: 100%;
  }

  .content:has(#feeds-directory) .table-wrapper > table thead {
    display: none;
  }

  .content:has(#feeds-directory) .table-wrapper > table tr {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--tb-border-color);
  }

  .content:has(#feeds-directory) .table-wrapper > table td {
    padding: 0.15rem 0;
    border: none;
  }

  .content:has(#feeds-directory) .table-wrapper > table td:first-child {
    font-weight: 600;
  }

  .content:has(#feeds-directory) .table-wrapper > table td:last-child {
    margin-top: 0.2rem;
    color: var(--text-muted-color);
  }
}

@media (min-width: 768px) {
  .content:has(#feeds-directory) > ul:first-of-type {
    columns: 2;
    column-gap: 2rem;
  }

  .content:has(#feeds-directory) > ul:first-of-type > li {
    break-inside: avoid;
  }
}

/* Editorial series: reciprocal box in each post and a list on the series page. */
.series-box {
  margin: 1.5rem 0 2rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--main-border-color);
  border-left: 4px solid var(--link-color);
  border-radius: 0.5rem;
  background: var(--card-bg);
}

.series-box__eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted-color);
}

.series-box__title {
  margin: 0.15rem 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.series-box__title a {
  text-decoration: none;
}

.series-box__meta {
  font-size: 0.85rem;
  color: var(--text-muted-color);
}

.series-box__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.series-box__nav a {
  text-decoration: none;
}

.series-box__nav span {
  color: var(--text-muted-color);
}

.series-box__all {
  display: inline-block;
  margin-top: 0.65rem;
  font-size: 0.9rem;
}

.series-list {
  margin: 1.5rem 0 2rem;
  padding: 0;
  list-style: none;
}

.series-list li {
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  gap: 0.75rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--tb-border-color);
}

.series-list__num {
  font-weight: 700;
  color: var(--link-color);
}

.series-list__title {
  font-weight: 600;
}

.series-list__title a {
  text-decoration: none;
}

.series-list__status {
  margin-top: 0.1rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted-color);
}

.series-list__summary {
  margin: 0.25rem 0 0;
  font-size: 0.92rem;
}

@media (max-width: 767.98px) {
  .series-box__nav {
    flex-direction: column;
    gap: 0.35rem;
  }
}

/* Local videos keep their real aspect ratio: the theme forces 16/9 and crops
   vertical recordings (emulator and phone demos). */
.embed-video.file {
  aspect-ratio: auto;
}

/* Series box: description, progress and dates on the links. */
.series-box__desc {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.88rem;
  color: var(--text-muted-color);
}

.series-box__progress {
  height: 4px;
  margin: 0.55rem 0 0.65rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--tb-border-color);
}

.series-box__progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--link-color);
}

.series-box__nav small {
  font-size: 0.75rem;
  color: var(--text-muted-color);
}

/* List covers: no shimmer. The image is the content, not a placeholder. */
#post-list .preview-img.shimmer {
  background: none;
}

#post-list .preview-img.shimmer::before {
  content: none;
  animation: none;
}

/* ---------------------------------------------------------------------------
 * Post audiovisual material ({{< post-media >}}).
 *
 * The block is rendered inside the post body and hoisted above the cover by a
 * tiny inline script. The player is a progressive enhancement: without JS the
 * native <audio> controls stay visible and the chips are ordinary links.
 * Mobile is the primary layout: full-width waveform, 44px touch targets and
 * full-viewport dialogs with safe-area insets.
 * ------------------------------------------------------------------------- */

.post-media {
  --pm-accent: var(--link-color);
  margin: 0 0 1.35rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--main-border-color);
  border-radius: 0.8rem;
  background: var(--card-bg);
  text-align: left;
  line-height: 1.2;
}

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

.pm-audio {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 56px;
}

.pm-play,
.pm-rate {
  flex: 0 0 auto;
  color: var(--text-color);
  background: var(--button-bg);
  border: 1px solid var(--btn-border-color);
  border-radius: 999px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pm-play {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
}

.pm-play svg {
  width: 22px;
  height: 22px;
}

.pm-icon-pause {
  display: none;
}

.post-media.is-playing .pm-icon-play {
  display: none;
}

.post-media.is-playing .pm-icon-pause {
  display: block;
}

.pm-play:hover,
.pm-play:focus-visible,
.pm-rate:hover,
.pm-rate:focus-visible {
  color: var(--pm-accent);
  border-color: var(--pm-accent);
}

.pm-wave {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.pm-wave:focus-visible {
  outline: 2px solid var(--pm-accent);
  outline-offset: 3px;
  border-radius: 0.35rem;
}

.pm-wave-svg {
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 40px;
  transform: translateY(-50%);
  overflow: visible;
  pointer-events: none;
}

.pm-wave-base,
.pm-wave-progress {
  fill: none;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.pm-wave-base {
  stroke: var(--text-color);
  stroke-width: 0.8;
  opacity: 0.22;
}

.pm-wave-progress {
  stroke: var(--pm-accent);
  stroke-width: 1.1;
}

.pm-wave-progress-svg {
  clip-path: inset(0 100% 0 0);
}

.pm-cursor {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--pm-accent);
  opacity: 0;
  pointer-events: none;
}

.post-media.is-playing .pm-cursor,
.pm-wave:focus-visible .pm-cursor {
  opacity: 1;
}

.pm-time {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted-color);
  white-space: nowrap;
}

.pm-time-sep {
  opacity: 0.6;
}

.pm-rate {
  min-width: 44px;
  height: 44px;
  padding: 0 0.35rem;
  display: inline-grid;
  place-items: center;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.pm-native {
  display: block;
  width: 100%;
}

/* The inline script of the shortcode adds `pm-js` before the first paint, so
   the custom player is painted directly; player.js (deferred) only wires it.
   Without JavaScript the native controls stay. */
.post-media .pm-play,
.post-media .pm-wave,
.post-media .pm-time,
.post-media .pm-rate {
  display: none;
}

.post-media.pm-js .pm-native {
  display: none;
}

.post-media.pm-js .pm-play {
  display: grid;
}

.post-media.pm-js .pm-wave {
  display: flex;
}

.post-media.pm-js .pm-time {
  display: inline-block;
}

.post-media.pm-js .pm-rate {
  display: inline-grid;
}

.pm-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 2px solid var(--btn-border-color);
  border-top-color: color-mix(in srgb, var(--text-color) 22%, transparent);
}

.pm-chips-label {
  flex: 0 0 auto;
  padding-right: 0.15rem;
  color: var(--text-muted-color);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  user-select: none;
}

.pm-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--btn-border-color);
  border-radius: 999px;
  background: var(--button-bg);
  color: var(--text-color);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.pm-chip svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.pm-chip:hover,
.pm-chip:focus-visible {
  color: var(--pm-accent);
  border-color: var(--pm-accent);
  text-decoration: none;
}

.pm-chip-label::before {
  content: attr(data-label);
}

.pm-chip-meta {
  color: var(--text-muted-color);
  font-size: 0.75rem;
  font-weight: 400;
}

.pm-chip-meta::before {
  content: attr(data-meta);
}

.pm-noscript {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted-color);
}

/* Dialogs ---------------------------------------------------------------- */

.pm-dialog {
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #0b0b0d;
  color: #fff;
  overscroll-behavior: contain;
}

.pm-dialog::backdrop {
  background: rgb(0 0 0 / 88%);
}

.pm-dialog-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 3.25rem 0.75rem 0.75rem;
  padding-top: calc(3.25rem + env(safe-area-inset-top));
  padding-right: calc(0.75rem + env(safe-area-inset-right));
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
  padding-left: calc(0.75rem + env(safe-area-inset-left));
}

.pm-dialog-video .pm-dialog-inner {
  padding: 3.5rem 1rem 1rem;
  padding-top: calc(3.5rem + env(safe-area-inset-top));
}

.pm-video-slot {
  width: min(1280px, 100%);
  aspect-ratio: 16 / 9;
  max-height: calc(100dvh - 7rem);
  overflow: hidden;
  border-radius: 0.45rem;
  background: #000;
}

.pm-video-slot video {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
}

.pm-close {
  position: absolute;
  top: calc(0.75rem + env(safe-area-inset-top));
  right: calc(0.75rem + env(safe-area-inset-right));
  z-index: 6;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 50%;
  background: rgb(255 255 255 / 8%);
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pm-close svg {
  width: 20px;
  height: 20px;
}

.pm-close:hover,
.pm-close:focus-visible {
  background: rgb(255 255 255 / 18%);
}

.pm-dialog-slides .pm-dialog-inner {
  flex-direction: column;
  gap: 0.65rem;
  padding-top: calc(3.25rem + env(safe-area-inset-top));
}

.pm-slides-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
}

.pm-slide-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.4rem;
  background: #000;
  box-shadow: 0 12px 48px rgb(0 0 0 / 55%);
  user-select: none;
  -webkit-user-drag: none;
}

.pm-arrow,
.pm-fs {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 50%;
  background: rgb(255 255 255 / 8%);
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pm-arrow svg {
  width: 22px;
  height: 22px;
}

.pm-fs svg {
  width: 20px;
  height: 20px;
}

.pm-arrow:hover,
.pm-arrow:focus-visible,
.pm-fs:hover,
.pm-fs:focus-visible,
.pm-close:hover,
.pm-close:focus-visible {
  background: rgb(255 255 255 / 18%);
}

.pm-fs.is-active {
  background: rgb(255 255 255 / 24%);
}

.pm-counter {
  min-width: 3.2rem;
  text-align: center;
  color: rgb(255 255 255 / 85%);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.pm-slides-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  overflow: hidden;
  background: rgb(255 255 255 / 18%);
}

.pm-slides-progress > span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--pm-accent);
  transition: width 0.2s ease;
}

.pm-slides-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
}

/* True fullscreen for the whole slide view (the dialog is already
 * full-viewport on phones; iOS does not expose the Fullscreen API for
 * non-video elements, so the button is hidden there). */
.pm-dialog-inner:fullscreen,
.pm-dialog-inner:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  background: #000;
}

.pm-dialog-inner:fullscreen .pm-slide-img,
.pm-dialog-inner:-webkit-full-screen .pm-slide-img {
  max-width: 100%;
  max-height: 100%;
}

.pm-lock,
.pm-lock body {
  overflow: hidden;
}

/* Phones: full-width waveform on its own row, controls stay at 44px. */
@media (max-width: 575.98px) {
  .post-media {
    padding: 0.65rem;
    border-radius: 0.65rem;
  }

  .pm-audio {
    flex-wrap: wrap;
    row-gap: 0.45rem;
    min-height: 104px;
  }

  .pm-play {
    order: 1;
  }

  .pm-time {
    order: 2;
    font-size: 0.74rem;
  }

  .pm-rate {
    order: 3;
    margin-left: auto;
  }

  .pm-wave {
    order: 4;
    flex: 1 1 100%;
    height: 52px;
  }

  .pm-chips {
    gap: 0.4rem;
  }

  .pm-chips-label {
    flex: 1 1 100%;
  }

  .pm-wave-svg {
    height: 48px;
  }

  .pm-native {
    order: 0;
    flex: 1 1 100%;
  }

  .pm-dialog-inner {
    padding-left: calc(0.35rem + env(safe-area-inset-left));
    padding-right: calc(0.35rem + env(safe-area-inset-right));
  }

  .pm-dialog-video .pm-dialog-inner {
    padding-left: 0.35rem;
    padding-right: 0.35rem;
  }

  .pm-close {
    top: calc(0.5rem + env(safe-area-inset-top));
    right: calc(0.5rem + env(safe-area-inset-right));
  }

  .pm-counter {
    font-size: 0.74rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pm-slides-progress > span {
    transition: none;
  }
}

/*
 * Social links on the "Acerca de" page: a centred row of large icons. Uses the
 * theme variables to follow light/dark mode.
 */
.about-social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: center;
  margin: 1.75rem 0 2.25rem;
}

.about-social__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  border: 1px solid var(--main-border-color);
  background-color: var(--card-bg);
  color: var(--text-color);
  transition: transform 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.about-social__link:hover {
  transform: translateY(-2px);
  color: var(--link-color);
  border-color: var(--link-color);
  text-decoration: none;
}

.about-social__link i {
  font-size: 1.6rem;
  line-height: 1;
}

@media (max-width: 576px) {
  .about-social__link {
    width: 3.1rem;
    height: 3.1rem;
  }

  .about-social__link i {
    font-size: 1.35rem;
  }
}

/* ---------------------------------------------------------------------------
   Contrast (WCAG 1.4.3 and 1.4.1). Measured with axe-core on 2026-11-11 against
   the build: the theme values (inherited from Chirpy) fall below 4.5:1. The
   custom properties are overridden instead of the selectors, so light, dark
   and automatic mode keep coming from one place.
   --------------------------------------------------------------------------- */

/* Light: code line numbers (#9e9e9e on #f6f8fa, 2.51:1) and muted text
   (#757575 on #f8f8f9, 4.34:1). #707070 gives 4.65:1 and 4.67:1. */
:root,
:root[data-bs-theme=light] {
  --highlight-lineno-color: #707070;
  --text-muted-color: #707070;
}

/* Dark: sidebar links (3.99:1 on #1e1e1e) and muted text on cards (#868686 on
   #292929, 3.99:1). #939393 clears 4.6:1 on every dark background the theme
   uses (#1b1b1e, #1e1e1e, #292929). */
:root[data-bs-theme=dark] {
  --sidebar-muted-color: #9a9a9a;
  --text-muted-color: #939393;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-bs-theme]) {
    --sidebar-muted-color: #9a9a9a;
    --text-muted-color: #939393;
  }
}

/* /categories/: the category name sits in a line of text and was told apart
   only by its colour (2.18:1 against the surrounding text). */
.card.categories .card-header a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* KaTeX display math (B-85). KaTeX never breaks a display formula, and the
   widest ones (an `aligned` block, a long definition) reach 500-900 px: with no
   width limit they stretched the whole post on a phone. Each formula now
   scrolls inside its own box, like code blocks and tables. The vertical padding
   keeps subscripts and radicals from being clipped by `overflow-y: hidden`. */
.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.25em 0;
}

/* -------------------------------------------------------------------------
 * Interactive figures (shortcode `fig`).
 *
 * A post figure is HTML, not an image: the markup is rendered server-side so
 * it reads without JavaScript and Google indexes the text; a ~2 KB module per
 * figure adds the behaviour when the reader scrolls to it.
 *
 * White/ink like the rest of the blog. The accent is semantic and appears only
 * where it encodes something: `--fig-a` for prompt processing and
 * `--fig-good` for the option that wins. No shadows, no rounded corners, no
 * decorative colour.
 * ------------------------------------------------------------------------- */

.fig {
  --fig-a: var(--link-color);
  --fig-good: #2f9e44;
  --fig-bad: #e03131;
  margin: 1.75rem 0;
  border: 1.5px solid var(--text-color);
  background: var(--card-bg);
  color: var(--text-color);
  font-size: 0.95rem;
  line-height: 1.45;
  text-align: left;
}

:root[data-bs-theme='dark'] .fig {
  --fig-good: #51cf66;
  --fig-bad: #ff6b6b;
}

:root[data-bs-theme='dark'] .fig-gauge__fill {
  background: color-mix(in srgb, var(--fig-a) 40%, transparent);
}

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

.fig p {
  margin: 0;
}

.fig__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0.75rem;
  border-bottom: 1.5px solid var(--text-color);
  flex-wrap: wrap;
}

.fig__name {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.fig__tag,
.fig__title,
.fig-label,
.fig-btn,
.fig-legend,
.fig-note {
  font-family: var(--code-font-family, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.fig__tag {
  font-weight: 700;
  border: 1px solid var(--text-color);
  padding: 0.05rem 0.35rem;
}

.fig__title {
  font-weight: 600;
}

.fig__stage {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 0.9rem;
}

.fig__caption {
  padding: 0.6rem 0.75rem 0.7rem;
  border-top: 1px solid var(--main-border-color);
  font-size: 0.86rem;
  color: var(--text-muted-color);
}

.fig__caption strong {
  color: var(--text-color);
}

.fig-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.fig-btns {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.fig-label {
  color: var(--text-muted-color);
}

.fig-btn {
  font: inherit;
  font-family: var(--code-font-family, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-color);
  background: transparent;
  border: 1px solid var(--main-border-color);
  padding: 0.3rem 0.55rem;
  cursor: pointer;
}

.fig-btn:hover {
  border-color: var(--text-color);
}

.fig-btn[aria-pressed='true'] {
  background: var(--text-color);
  border-color: var(--text-color);
  color: var(--card-bg);
}

.fig-btn:focus-visible {
  outline: 2px solid var(--link-color);
  outline-offset: 2px;
}

.fig-bar {
  display: flex;
  width: calc(var(--len, 100) * 1%);
  height: 26px;
  border: 1.5px solid var(--text-color);
  overflow: hidden;
  transition: width 0.25s ease;
}

.fig-bar__seg {
  width: calc(var(--w, 0) * 1%);
  transition: width 0.25s ease;
}

.fig-bar__seg--a {
  background: var(--fig-a);
}

.fig-bar__seg--b {
  background: var(--text-color);
}

.fig-row {
  display: grid;
  grid-template-columns: 3.4rem 1fr 4.2rem;
  align-items: center;
  gap: 0.6rem;
}

.fig-row__name {
  font-family: var(--code-font-family, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.75rem;
  font-weight: 700;
}

.fig-row__total {
  font-family: var(--code-font-family, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.78rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.fig-legend {
  display: flex;
  gap: 0.35rem 1rem;
  flex-wrap: wrap;
  color: var(--text-color);
  text-transform: none;
  letter-spacing: 0;
}

.fig-key {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.fig-swatch {
  width: 11px;
  height: 11px;
  border: 1px solid var(--text-color);
  display: inline-block;
}

.fig-swatch--a {
  background: var(--fig-a);
}

.fig-swatch--b {
  background: var(--text-color);
}

.fig-out {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--main-border-color);
}

.fig-out__pick {
  font-weight: 700;
  font-size: 1rem;
}

.fig-out__pick--good {
  color: var(--fig-good);
}

.fig-out__why {
  margin: 0;
  color: var(--text-muted-color);
  font-size: 0.9rem;
}

/* Bandwidth gauge: one `.fig-row` per format, the value outside the track. */
.fig-gauge {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

/* "166 tok/s" is wider than "2,8 s": a wider value column, the same in every
 * row (scale row included) so the tracks stay aligned. */
.fig-gauge .fig-row {
  grid-template-columns: 3.4rem 1fr 4.9rem;
}

.fig-gauge__track {
  position: relative;
  height: 26px;
  border: 1.5px solid var(--text-color);
}

.fig-gauge__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--v, 0) * 1%);
  background: color-mix(in srgb, var(--fig-a) 18%, transparent);
  transition: width 0.3s ease;
}

.fig-gauge__marker {
  position: absolute;
  top: -5px;
  bottom: -5px;
  left: calc(var(--v, 0) * 1%);
  width: 3px;
  margin-left: -1.5px;
  z-index: 2;
  background: var(--text-color);
  transition: left 0.3s ease;
}

.fig-gauge__scale {
  display: flex;
  justify-content: space-between;
  font-family: var(--code-font-family, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.68rem;
  color: var(--text-muted-color);
  white-space: nowrap;
}

.fig-swatch--fill {
  background: color-mix(in srgb, var(--fig-a) 18%, transparent);
}

.fig-swatch--marker {
  width: 3px;
  height: 14px;
  border: 0;
  background: var(--text-color);
}

/* Amber marks cost (graphrag-coste figure); rows with full system names need a wider label column.
 * `.fig .fig-row--wide` outranks the generic `.fig-row` rules, including their mobile override. */
.fig-swatch--warn {
  background: #f08c00;
}

.fig .fig-row--wide {
  grid-template-columns: 8.6rem 1fr 5.4rem;
}

.fig .fig-row--wide .fig-row__name {
  font-size: 0.72rem;
}

@media (max-width: 575.98px) {
  .fig .fig-row--wide {
    grid-template-columns: 7.6rem 1fr 4.4rem;
  }

  .fig .fig-row--wide .fig-row__name {
    font-size: 0.62rem;
  }
}

:root[data-bs-theme='dark'] .fig-swatch--fill {
  background: color-mix(in srgb, var(--fig-a) 40%, transparent);
}

/* Decision tree. */
.fig-tree__q {
  font-size: 1rem;
  font-weight: 600;
}

.fig-tree__q:not(.fig-tree__q--result) {
  min-height: 3.2em;
}

.fig-tree__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.fig-tree__step {
  font-family: var(--code-font-family, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.68rem;
  color: var(--text-muted-color);
}

@media (max-width: 575.98px) {
  .fig__stage {
    padding: 0.85rem 0.7rem;
  }

  .fig-row {
    grid-template-columns: 2.9rem 1fr 3.6rem;
    gap: 0.45rem;
  }

  .fig-gauge .fig-row {
    grid-template-columns: 2.9rem 1fr 4.7rem;
  }

  .fig__caption {
    padding: 0.55rem 0.7rem 0.6rem;
  }
}

/* Touch screens: buttons tall enough to hit with a thumb. */
@media (pointer: coarse) {
  .fig-btn {
    min-height: 40px;
    min-width: 44px;
    padding: 0.45rem 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fig-bar,
  .fig-bar__seg,
  .fig-gauge__fill,
  .fig-gauge__marker {
    transition: none;
  }
}

/* "Enlaza este artículo" box (B-91): copy-ready HTML link for other sites.
   Desktop only: on a phone nobody pastes HTML into their website, and the box
   would push the share block down. Same look as the series box. */
.link-snippet {
  display: none;
}

@media (min-width: 992px) {
  .link-snippet {
    display: block;
    margin: 2rem 0 1.5rem;
    padding: 1rem 1.15rem;
    border: 1px solid var(--main-border-color);
    border-left: 4px solid var(--link-color);
    border-radius: 0.5rem;
    background: var(--card-bg);
  }
}

.link-snippet__title {
  font-weight: 600;
  color: var(--heading-color);
}

.link-snippet__text {
  margin: 0.25rem 0 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted-color);
}

.link-snippet__row {
  display: flex;
  gap: 0.6rem;
  align-items: stretch;
}

.link-snippet__code {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--main-border-color);
  border-radius: 0.4rem;
  background: var(--main-bg);
  color: var(--text-color);
  font-family: var(--bs-font-monospace, monospace);
  font-size: 0.8rem;
  line-height: 1.45;
  resize: none;
}

.link-snippet__copy {
  flex: none;
  padding: 0 1rem;
  border: 1px solid var(--text-color);
  border-radius: 0.4rem;
  background: var(--text-color);
  color: var(--main-bg);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.link-snippet__copy:hover {
  opacity: 0.85;
}

/* ADT vs Asahi figure: three cards per node (what the Mac says, how to read
   it, what Asahi wrote), stacked on narrow screens. */
.fig-dt {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.fig-dt__card {
  border: 1px solid var(--main-border-color);
  padding: 0.55rem 0.6rem;
  min-width: 0;
}

.fig-dt__card pre {
  margin: 0.35rem 0 0;
  padding: 0;
  background: transparent;
  border: 0;
  font-family: var(--code-font-family, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.74rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text-color);
}

.fig-dt__verdict {
  margin-top: 0.6rem !important;
  padding: 0.4rem 0.6rem;
  border-left: 3px solid var(--fig-good);
  font-size: 0.86rem;
}

.fig-dt__verdict--warn {
  border-left-color: #f08c00;
}

.fig-dt__status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

@media (max-width: 720px) {
  .fig-dt {
    grid-template-columns: 1fr;
  }
}
