/* ═══════════════════════════════════════════════════════════════════
   Blog Editorial CSS — WorldBrain Design System
   Violeta/Naranja palette, light/dark, responsive, accessible
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --ed-violet: #7c3aed;
  --ed-violet-light: #a78bfa;
  --ed-orange: #f97316;
  --ed-orange-light: #fdba74;
  --ed-bg: #0c0a1d;
  --ed-bg-card: #1a1a2e;
  --ed-text: #f1f5f9;
  --ed-text-secondary: #94a3b8;
  --ed-border: rgba(124, 58, 237, 0.2);
  --ed-radius: 1rem;
  --ed-transition: 0.3s ease;
}

.light-mode {
  --ed-bg: #f8fafc;
  --ed-bg-card: #ffffff;
  --ed-text: #1e293b;
  --ed-text-secondary: #64748b;
  --ed-border: rgba(124, 58, 237, 0.15);
}



/* ─── Hero Editorial ─── */
.ed-hero {
  padding: 10rem 1.5rem 4rem;
  text-align: center;
  background: linear-gradient(135deg, rgba(124,58,237,0.08) 0%, var(--ed-bg) 100%);
}

.ed-hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: var(--ed-text);
  margin-bottom: 1rem;
}

.ed-hero p {
  color: var(--ed-text-secondary);
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.15rem;
}

/* ─── Featured Card ─── */
.ed-card--featured {
  border: 2px solid var(--ed-violet);
  box-shadow: 0 0 24px rgba(124, 58, 237, 0.15);
}

/* ─── Search & Filters ─── */
.ed-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.ed-search-input {
  flex: 1 1 200px;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--ed-border);
  background: var(--ed-bg-card);
  color: var(--ed-text);
  font-size: 1rem;
}

.ed-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ed-chips button {
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  border: 1px solid var(--ed-border);
  background: transparent;
  color: var(--ed-text);
  cursor: pointer;
  font-size: 0.875rem;
  transition: background var(--ed-transition), color var(--ed-transition);
}

.ed-chips button[aria-pressed="true"] {
  background: var(--ed-violet);
  color: #fff;
  border-color: var(--ed-violet);
}

.ed-view-toggle {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--ed-border);
  background: transparent;
  color: var(--ed-text);
  cursor: pointer;
}

/* ─── Editorial Layout ─── */
.ed-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2rem;
  padding: 0 1.5rem 3rem;
  max-width: 1200px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .ed-layout {
    grid-template-columns: 1fr;
  }
}

.ed-main-column {
  min-width: 0;
}

/* ─── Feed Layout ─── */
.ed-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ed-feed[data-view="compact"] .ed-card {
  grid-template-columns: 1fr 100px;
}

/* ─── Cards ─── */
.ed-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 1rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--ed-border);
  align-items: start;
}

/* El filtro por tema, el buscador y "Guardados" ocultan tarjetas con
   card.hidden = true, pero `display: grid` de arriba gana sobre el
   [hidden] del navegador, así que no se ocultaba ninguna y los filtros
   no hacían nada. Con 71 tarjetas eso deja el buscador inservible. */
.ed-card[hidden],
.ed-featured[hidden] {
  display: none !important;
}

.ed-card-copy {
  min-width: 0;
}

.ed-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--ed-text-secondary);
  margin-bottom: 0.5rem;
}

.ed-card-category {
  color: var(--ed-violet);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.ed-card-read-time {
  color: var(--ed-text-secondary);
}

.ed-card h2 {
  font-size: 1.15rem;
  color: var(--ed-text);
  margin: 0 0 0.5rem;
  line-height: 1.4;
}

.ed-card h2 a {
  color: inherit;
  text-decoration: none;
}

.ed-card h2 a:hover {
  color: var(--ed-violet);
}

.ed-card p {
  color: var(--ed-text-secondary);
  margin: 0;
  line-height: 1.6;
  font-size: 0.95rem;
}

.ed-card-media {
  display: block;
  border-radius: 0.5rem;
  overflow: hidden;
}

.ed-card-media img {
  width: 190px;
  height: 125px;
  object-fit: cover;
  display: block;
  border-radius: 0.5rem;
}

.ed-card [data-bookmark] {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--ed-text-secondary);
  padding: 0.25rem;
  grid-column: 1 / -1;
  justify-self: start;
}

.ed-card [data-bookmark][aria-pressed="true"] {
  color: var(--ed-orange);
}

/* ─── Aside ─── */
.ed-aside {
  padding: 0;
}

.ed-aside-inner {
  position: sticky;
  top: 6rem;
  padding: 1.5rem;
  background: var(--ed-bg-card);
  border-radius: var(--ed-radius);
  border: 1px solid var(--ed-border);
}

/* ─── Article Reading Typography ─── */
.blog-content {
  font-family: Georgia, 'Times New Roman', serif;
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.8;
  color: var(--ed-text);
}

/* ─── Featured Article ─── */
.ed-featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 2rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  align-items: center;
}

.ed-featured-media {
  display: block;
  border-radius: var(--ed-radius);
  overflow: hidden;
}

.ed-featured-media img {
  width: 100%;
  height: auto;
  display: block;
}

.ed-featured-body h2 {
  font-size: 1.75rem;
  margin: 0 0 1rem;
  color: var(--ed-text);
}

.ed-featured-body h2 a {
  color: inherit;
  text-decoration: none;
}

.ed-featured-body p {
  color: var(--ed-text-secondary);
  line-height: 1.6;
}

/* ─── Live region ─── */
.ed-live {
  padding: 0 1.5rem;
  color: var(--ed-text-secondary);
  font-size: 0.9rem;
  min-height: 1.5rem;
}

/* ─── Hover for fine pointer ─── */
@media (pointer: fine) and (hover: hover) {
  .ed-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(124, 58, 237, 0.18);
  }

  .ed-chips button:hover {
    background: rgba(124, 58, 237, 0.1);
  }

  .ed-view-toggle:hover {
    background: rgba(124, 58, 237, 0.1);
  }

  .ed-article-toolbar button:hover {
    background: rgba(124, 58, 237, 0.1);
  }
}

/* ─── Hover None — neutralize hover effects ─── */
@media (hover: none) {
  .ed-card:hover {
    transform: none;
    box-shadow: none;
  }

  .ed-chips button:hover {
    background: transparent;
  }

  .ed-view-toggle:hover {
    background: transparent;
  }

  .ed-article-toolbar button:hover {
    background: transparent;
  }
}

/* ─── Responsive: 1200px ─── */
@media (min-width: 1200px) {
  .ed-layout {
    max-width: 1200px;
  }
}

/* ─── Responsive: 900px ─── */
@media (max-width: 900px) {
  .ed-card {
    grid-template-columns: minmax(0, 1fr) 120px;
  }

  .ed-card-media img {
    width: 120px;
    height: 80px;
  }
}

/* ─── Responsive: 640px ─── */
@media (max-width: 640px) {
  .ed-layout {
    padding: 0 1rem 2rem;
  }

  .ed-card {
    grid-template-columns: 1fr;
  }

  .ed-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .ed-hero {
    padding: 8rem 1rem 3rem;
  }

  .ed-featured {
    grid-template-columns: 1fr;
  }
}

/* ─── Responsive: 400px ─── */
@media (max-width: 400px) {
  .ed-hero h1 {
    font-size: 1.75rem;
  }

  .ed-card-body {
    padding: 1rem;
  }

  .ed-chips button {
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
  }
}

/* ─── Focus Visible ─── */
:focus-visible {
  outline: 3px solid var(--ed-violet);
  outline-offset: 2px;
}

/* ─── Pointer Coarse (touch) ─── */
@media (pointer: coarse) {
  .ed-chips button {
    min-height: 44px;
    min-width: 44px;
  }

  .ed-card [data-bookmark] {
    min-height: 44px;
    min-width: 44px;
  }

  .ed-article-toolbar button {
    min-height: 44px;
  }
}

/* ─── Reduced Motion ─── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── Forced Colors ─── */
@media (forced-colors: active) {
  .ed-card {
    border: 2px solid CanvasText;
  }

  .ed-chips button[aria-pressed="true"] {
    background: Highlight;
    color: HighlightText;
  }

  .ed-progress-bar {
    background: Highlight;
  }
}

/* ─── Print ─── */
@media print {
  .ed-toolbar,
  .ed-view-toggle,
  .ed-progress,
  .ed-article-toolbar {
    display: none;
  }

  .ed-card {
    break-inside: avoid;
    border: 1px solid #ccc;
  }

  .ed-feed {
    display: block;
  }

  .ed-feed .ed-card {
    margin-bottom: 1rem;
  }
}

/* ─── Safe Area (notch devices) ─── */
@supports (padding: env(safe-area-inset-left)) {
  .ed-toolbar {
    padding-left: calc(1.5rem + env(safe-area-inset-left));
    padding-right: calc(1.5rem + env(safe-area-inset-right));
  }

  .ed-feed {
    padding-left: calc(1.5rem + env(safe-area-inset-left));
    padding-right: calc(1.5rem + env(safe-area-inset-right));
  }
}

/* ═══════════════════════════════════════════════════════════════════
   Article Enhancements over blog.min.css
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Progress Bar ─── */
.ed-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(124, 58, 237, 0.1);
  z-index: 9998;
}

.ed-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--ed-violet), var(--ed-orange));
  width: 0%;
  transition: width 0.15s linear;
}

/* ─── Article Toolbar ─── */
.ed-article-toolbar {
  position: fixed;
  top: 50%;
  left: 1.5rem;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  /* stretch, no center: con center cada botón tomaba el ancho de su
     texto y el rail quedaba con el borde dentado. */
  align-items: stretch;
  padding: 0.75rem;
  background: var(--ed-bg-card);
  border: 1px solid var(--ed-border);
  border-radius: var(--ed-radius);
  z-index: 900;
}

.ed-article-toolbar a,
.ed-article-toolbar button {
  display: inline-flex;
  align-items: center;
  /* Texto centrado dentro de botones ya igualados por stretch. */
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--ed-border);
  background: var(--ed-bg-card);
  color: var(--ed-text);
  cursor: pointer;
  font-size: 0.875rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--ed-transition);
}

.ed-article-toolbar button[aria-pressed="true"] {
  background: var(--ed-violet);
  color: #fff;
  border-color: var(--ed-violet);
}

@media (max-width: 1100px) {
  .ed-article-toolbar {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    transform: none;
    flex-direction: row;
    justify-content: center;
    border-radius: 0;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
    z-index: 900;
  }

  body {
    padding-bottom: calc(4rem + env(safe-area-inset-bottom));
  }
}

/* ═══════════════════════════════════════════════════════════════════
   Final editorial polish
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --ed-toolbar-bg: rgba(12, 10, 29, 0.92);
  --ed-surface-soft: rgba(255, 255, 255, 0.035);
  /* Medida de lectura compartida por el hero y el cuerpo del artículo. */
  --ed-measure: 760px;
  /* Acento SOLO para texto: el violeta base no alcanza 4.5:1 sobre el
     fondo oscuro, así que en tema oscuro se usa la variante clara.
     Medido: 6.3:1 sobre --ed-bg-card, 7.2:1 sobre --ed-bg. */
  --ed-accent-text: var(--ed-violet-light);
}

html.light-mode {
  /* En claro se invierte: la variante clara daría 2.6:1 sobre #f8fafc.
     El violeta base mide 5.5:1 sobre --ed-bg y 5.7:1 sobre blanco. */
  --ed-accent-text: var(--ed-violet);
}

html.light-mode {
  --ed-toolbar-bg: rgba(248, 247, 255, 0.94);
  --ed-surface-soft: rgba(124, 58, 237, 0.045);
}

.ed-blog-main {
  min-height: 100vh;
  overflow-x: clip;
  color: var(--ed-text);
  background: var(--ed-bg);
}

.ed-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  text-align: left;
  border-bottom: 1px solid var(--ed-border);
}

.ed-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 34rem;
  height: 34rem;
  top: 2rem;
  right: -8rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.2), transparent 68%);
  pointer-events: none;
}

.ed-hero .container {
  max-width: 1200px;
}

.ed-hero p {
  margin: 0;
}

.ed-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1rem;
  color: var(--ed-violet-light);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ed-kicker::before {
  content: "";
  width: 1.75rem;
  height: 2px;
  background: linear-gradient(90deg, var(--ed-violet), var(--ed-orange));
}

.ed-hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.75rem;
  padding: 0;
  margin: 1.5rem 0 0;
  list-style: none;
  color: var(--ed-text-secondary);
  font-size: 0.875rem;
}

.ed-hero-facts li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.ed-hero-facts li::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--ed-orange);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.12);
}

.ed-featured {
  padding-top: 3.25rem;
  padding-bottom: 3.25rem;
  border-bottom: 1px solid var(--ed-border);
}

.ed-featured-media {
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.ed-featured-media img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.ed-featured-body {
  max-width: 34rem;
}

.ed-featured-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.9rem;
  color: var(--ed-text-secondary);
  font-size: 0.78rem;
}

.ed-toolbar {
  position: sticky;
  top: 5.5rem;
  z-index: 50;
  max-width: 1200px;
  margin: 0 auto 1.25rem;
  padding: 1rem 1.5rem;
  background: var(--ed-toolbar-bg);
  border-bottom: 1px solid var(--ed-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.ed-toolbar [role="search"] {
  flex: 1 1 15rem;
}

.ed-search-input {
  width: 100%;
  min-height: 44px;
}

.ed-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.ed-toolbar-actions button {
  min-height: 42px;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--ed-border);
  border-radius: 999px;
  background: transparent;
  color: var(--ed-text);
  font: inherit;
  font-size: 0.84rem;
  cursor: pointer;
}

.ed-toolbar-actions button[aria-pressed="true"] {
  color: #fff;
  background: var(--ed-violet);
  border-color: var(--ed-violet);
}

.ed-live,
[data-empty-state],
.ed-no-js {
  max-width: 1200px;
  margin-right: auto;
  margin-left: auto;
}

[data-empty-state],
.ed-no-js {
  padding: 1.25rem 1.5rem;
  color: var(--ed-text-secondary);
  text-align: center;
  background: var(--ed-surface-soft);
  border: 1px dashed var(--ed-border);
  border-radius: var(--ed-radius);
}

[data-empty-state] {
  margin-bottom: 1.5rem;
}

.ed-feed-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.25rem 0 1.25rem;
  border-bottom: 1px solid var(--ed-border);
}

.ed-feed-heading h2,
.ed-aside h2 {
  margin: 0;
  color: var(--ed-text);
  font-family: var(--font-heading, "Space Grotesk", sans-serif);
}

.ed-feed-heading h2 {
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.ed-card {
  position: relative;
  background: transparent;
  transition: background-color var(--ed-transition), transform var(--ed-transition), box-shadow var(--ed-transition);
}

.ed-card:first-child {
  border-top: 0;
}

.ed-card h2 {
  font-size: clamp(1.12rem, 2vw, 1.32rem);
}

.ed-card-media img {
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.ed-aside-inner {
  top: 10.5rem;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.ed-aside-section {
  padding: 1.35rem 0;
  border-top: 1px solid var(--ed-border);
}

.ed-aside-section h2 {
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.ed-aside-section p {
  margin: 0;
  color: var(--ed-text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

.ed-library-count {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--ed-text);
  font-size: 1.6rem;
  font-weight: 700;
}

.ed-topic-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.ed-topic-list span {
  padding: 0.4rem 0.65rem;
  color: var(--ed-text-secondary);
  font-size: 0.78rem;
  border: 1px solid var(--ed-border);
  border-radius: 999px;
}

/* Reading view */
.blog-post-hero {
  /* Sin padding horizontal: el inset lo aplica .blog-post-header, igual
     que .blog-content lo aplica en su propia caja. Si el hero insetea
     por fuera y el cuerpo por dentro, los bordes solo coinciden por
     casualidad a un ancho concreto. */
  padding: 10.5rem 0 5.5rem;
  text-align: left;
  background:
    radial-gradient(circle at 78% 20%, rgba(124, 58, 237, 0.18), transparent 35%),
    linear-gradient(180deg, var(--ed-bg-card), var(--ed-bg));
  border-bottom: 1px solid var(--ed-border);
}

/* El hero y el cuerpo comparten medida Y padding, así que el borde
   izquierdo del título coincide con el del texto en cualquier ancho.
   El padding explícito anula el de .container (24px/16px), que era
   la causa del desfase de 16px en móvil. */
.blog-post-header {
  max-width: var(--ed-measure, 760px);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.blog-post-title {
  /* 18ch partía los títulos largos en 4-5 líneas; 30ch respeta la
     medida óptima sin fragmentar el titular. */
  max-width: 30ch;
  margin-right: auto;
  font-size: clamp(2.1rem, 5vw, 3.75rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.blog-post-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

.blog-post-cover {
  width: calc(100% - 2rem);
  max-width: 1040px;
  height: min(52vw, 520px);
  min-height: 320px;
  margin-top: -2.5rem;
  border: 1px solid var(--ed-border);
}

.blog-content {
  max-width: var(--ed-measure, 760px);
  margin-inline: auto;
  padding: 0 1.5rem 7rem;
  color: var(--ed-text);
  font-size: clamp(1.05rem, 1.3vw, 1.15rem);
  line-height: 1.75;
}

.blog-content h2,
.blog-content h3,
.blog-cta-box,
.blog-author {
  font-family: var(--font-heading, "Space Grotesk", sans-serif);
}

.blog-content p,
.blog-content li {
  color: var(--ed-text);
}

.blog-content blockquote {
  color: var(--ed-text);
  background: var(--ed-surface-soft);
  border-left-color: var(--ed-violet);
}

.blog-cta-box {
  background: linear-gradient(145deg, rgba(124, 58, 237, 0.13), rgba(249, 115, 22, 0.06));
  border-color: var(--ed-border);
}

.blog-author {
  padding: 1.5rem;
  background: var(--ed-surface-soft);
  border: 1px solid var(--ed-border);
  border-radius: var(--ed-radius);
}

/* El nombre del autor pasó de h4 a h3 para no saltar niveles de
   encabezado; conserva su escala de etiqueta, no de sección. */
.blog-author h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  line-height: 1.3;
  font-weight: 600;
  color: var(--ed-text);
}

.blog-author h3::after {
  content: none;
}

@media (pointer: fine) and (hover: hover) {
  .ed-card:hover {
    background: var(--ed-surface-soft);
  }

  .ed-card:hover .ed-card-media img,
  .ed-featured:hover .ed-featured-media img {
    transform: scale(1.025);
  }

  .ed-toolbar-actions button:hover {
    background: var(--ed-surface-soft);
  }
}

@media (max-width: 1100px) {
  .ed-aside-inner {
    position: static;
  }
}

@media (max-width: 640px) {
  .ed-hero {
    text-align: left;
  }

  .ed-hero::before {
    width: 20rem;
    height: 20rem;
  }

  .ed-featured {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  .ed-toolbar {
    top: 4.75rem;
    padding: 0.8rem 1rem;
  }

  /* min-width: 0 es lo que faltaba. Con flex-wrap: nowrap los chips tienen
     un min-content de ~464px y, al ser min-width: auto por defecto, no podían
     encogerse: eso inflaba el ancho de la línea flex y, vía
     align-items: stretch, arrastraba al buscador fuera de la pantalla
     (90px de desborde a 390px, 139px a 414px). Ahora los chips se ajustan al
     ancho disponible y su propio overflow-x da el scroll horizontal previsto. */
  .ed-toolbar > * {
    min-width: 0;
    max-width: 100%;
  }

  /* En fila, `flex: 1 1 15rem` sobre el buscador significa "al menos 240px de
     ancho". Al pasar a columna ese basis se interpreta como ALTURA, así que el
     envoltorio del input reservaba 240px de alto para un campo de 44px y dejaba
     ~196px de hueco vacío bajo el buscador. Va en este bloque y no en el de
     640px de más arriba porque la regla base está después en el archivo y
     ganaba por orden de cascada. */
  .ed-toolbar [role="search"] {
    flex: 0 0 auto;
  }

  .ed-chips {
    flex-wrap: nowrap;
    padding-bottom: 0.3rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    min-width: 0;
  }

  .ed-toolbar-actions {
    margin-left: 0;
  }

  .ed-card {
    grid-template-columns: minmax(0, 1fr) 96px;
    padding: 1.2rem 0;
  }

  .ed-card p {
    display: none;
  }

  .ed-card-media img {
    width: 96px;
    height: 76px;
  }

  .ed-card [data-bookmark] {
    grid-column: 1;
  }

  .blog-post-hero {
    padding: 8.5rem 1rem 4rem;
  }

  .blog-post-title {
    font-size: clamp(2.2rem, 12vw, 3.15rem);
  }

  .blog-post-cover {
    width: 100%;
    min-height: 240px;
    height: 58vw;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .blog-content {
    padding-right: 1.15rem;
    padding-left: 1.15rem;
  }
}

@media (max-width: 400px) {
  .ed-hero-facts {
    display: grid;
  }

  .ed-toolbar-actions {
    width: 100%;
  }

  .ed-toolbar-actions button {
    flex: 1;
  }

  .ed-card-meta {
    gap: 0.4rem;
  }
}

/* ===== Bloques del artículo SEO (60 posts): respuesta rápida, FAQ, fuentes ===== */
.ed-quick-answer {
  background: var(--ed-bg-card);
  border: 1px solid var(--ed-border);
  border-left: 4px solid var(--ed-violet);
  border-radius: var(--ed-radius);
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
}

.ed-quick-answer h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ed-accent-text);
  /* Es un H2 por jerarquía de documento, pero visualmente es una
     etiqueta del bloque: no debe competir con los H2 de sección. */
  font-size: 1.05rem;
  line-height: 1.3;
  letter-spacing: 0.01em;
  margin: 0 0 0.75rem;
  padding: 0;
}

.ed-quick-answer h2::after {
  content: none;
}

.ed-quick-answer p {
  margin: 0;
  color: var(--ed-text);
}

.ed-faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

.ed-faq-item {
  background: var(--ed-bg-card);
  border: 1px solid var(--ed-border);
  border-radius: var(--ed-radius);
  padding: 1.25rem 1.5rem;
  transition: border-color var(--ed-transition);
}

.ed-faq-item:hover {
  border-color: var(--ed-violet-light);
}

.ed-faq-item h3 {
  margin: 0 0 0.5rem;
  color: var(--ed-text);
  /* La pregunta debe pesar más que la respuesta: antes iba a 1rem,
     por debajo del cuerpo del artículo, e invertía la jerarquía. */
  font-size: 1.0625rem;
  line-height: 1.4;
  font-weight: 600;
  text-wrap: balance;
}

.ed-faq-item p {
  margin: 0;
  color: var(--ed-text-secondary);
  line-height: 1.7;
}

.ed-sources-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.ed-sources-list li {
  font-size: 0.9rem;
  color: var(--ed-text-secondary);
  padding-left: 1.25rem;
  position: relative;
}

.ed-sources-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--ed-accent-text);
}

.ed-sources-list a {
  color: var(--ed-accent-text);
  text-decoration: none;
  font-weight: 500;
}

.ed-sources-list a:hover {
  text-decoration: underline;
}

/* ===== Accesibilidad: focus visible en todo el artículo =====
   Sin esto, navegar el artículo con teclado no mostraba dónde
   estaba el foco en los enlaces de fuentes ni en el CTA. */
.blog-content a:focus-visible,
.ed-sources-list a:focus-visible,
.blog-cta-box a:focus-visible,
.ed-article-toolbar a:focus-visible,
.ed-article-toolbar button:focus-visible {
  outline: 2px solid var(--ed-violet-light);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ===== Imágenes: reservar espacio para evitar reflow (CLS) ===== */
.blog-post-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ===== Ajustes responsive del artículo ===== */
@media (max-width: 900px) {
  .blog-post-hero {
    padding: 8rem 0 3.5rem;
  }

  .blog-post-header {
    padding-inline: 1.25rem;
  }

  .blog-content {
    padding-inline: 1.25rem;
  }

  .blog-post-title {
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .blog-post-hero {
    padding: 7rem 0 2.75rem;
  }

  /* Ambos al mismo valor: es lo que mantiene alineado el título con el
     cuerpo del texto en móvil. */
  .blog-post-header,
  .blog-content {
    padding-inline: 1.15rem;
  }

  .blog-content {
    padding-bottom: 4.5rem;
    line-height: 1.7;
  }

  .blog-post-cover {
    width: 100%;
    min-height: 210px;
    height: 46vw;
    margin-top: -1.25rem;
    border-radius: 0;
    border-inline: 0;
  }

  .ed-quick-answer,
  .ed-faq-item {
    padding: 1.1rem 1.15rem;
  }

  .blog-post-meta {
    gap: 0.5rem 1rem;
    font-size: 0.9rem;
  }
}
