/*
  Enunzia - blog.
  Se carga despues de styles.css y reutiliza sus tokens (colores, radios,
  sombras, tema oscuro). Aqui solo vive lo propio del blog: portada, articulo
  y los componentes que se pueden usar dentro de un post (content/blog/README.md).

  Mismos locks que la landing: azul = marca y accion primaria, teal = practicar
  en voz alta, verde/rojo solo en comparativas tipo feedback, cero em-dash.
  El CSP prohibe estilos inline: todo lo visual de un post sale de esta hoja.
*/

/* ============================================================
   1. ESTRUCTURA
   ============================================================ */
.bp-main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) clamp(20px, 5vw, 40px) clamp(56px, 8vw, 96px);
}
.en-nav-link[aria-current="page"] { color: var(--accent); background: var(--accent-tint); }

.bp-article { max-width: 760px; margin: 0 auto; }

.bp-crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 0.88rem; color: var(--muted);
}
.bp-crumbs a { color: var(--muted); text-decoration: none; font-weight: 600; }
.bp-crumbs a:hover { color: var(--accent); }

.bp-header { margin-top: 18px; }
.bp-header h1 { font-size: clamp(2rem, 4.6vw, 3rem); line-height: 1.08; }
.bp-meta {
  margin-top: 16px;
  display: flex; flex-wrap: wrap; gap: 6px 10px;
  font-size: 0.92rem; color: var(--muted);
}
.bp-meta span:first-child { color: var(--ink-soft); font-weight: 700; }

.bp-hero { margin: clamp(24px, 4vw, 36px) 0 0; }
.bp-hero img,
.bp-card img {
  display: block; width: 100%; height: auto;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  background: var(--surface-blue);
}
.bp-hero img {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
}

.bp-layout { margin-top: clamp(28px, 4vw, 40px); }

/* ============================================================
   2. INDICE DEL ARTICULO
   ============================================================ */
.bp-toc {
  padding: 18px 22px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
}
.bp-toc-title {
  font-size: 0.74rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent-strong);
}
.bp-toc ol { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.bp-toc li { color: var(--muted); font-size: 0.95rem; }
.bp-toc a { color: var(--ink-soft); text-decoration: none; font-weight: 600; }
.bp-toc a:hover { color: var(--accent); }

/* ============================================================
   3. CUERPO DEL ARTICULO
   ============================================================ */
.bp-body { margin-top: clamp(20px, 3vw, 28px); font-size: 1.075rem; line-height: 1.75; color: var(--ink); }
.bp-body > * + * { margin-top: 1.05em; }
.bp-body h2 {
  margin-top: 2.1em;
  font-size: clamp(1.45rem, 2.8vw, 1.85rem);
  line-height: 1.18;
  scroll-margin-top: 90px;
}
.bp-body h3 {
  margin-top: 1.7em;
  font-size: clamp(1.15rem, 2.1vw, 1.3rem);
  line-height: 1.25;
  scroll-margin-top: 90px;
}
.bp-body h2 + *, .bp-body h3 + * { margin-top: 0.7em; }
.bp-body p { color: var(--ink); }
.bp-body strong { color: var(--heading); font-weight: 750; }
/* En la landing, em es un realce azul; en un post marca las palabras en inglés y no debe parecer un enlace. */
.bp-body em, .bp-body i { font-style: italic; color: inherit; }
.bp-body a { color: var(--accent); font-weight: 650; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.bp-body a:hover { color: var(--accent-strong); }
.bp-body ul, .bp-body ol { padding-left: 1.3em; }
.bp-body li + li { margin-top: 0.45em; }
.bp-body li::marker { color: var(--accent); font-weight: 700; }
.bp-body blockquote {
  margin-left: 0; margin-right: 0;
  padding: 4px 0 4px 18px;
  border-left: 3px solid var(--accent-light);
  color: var(--ink-soft);
}
.bp-body code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.92em;
  padding: 2px 7px;
  border-radius: 8px;
  background: var(--surface-blue);
  color: var(--heading);
}
.bp-body hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

.bp-table { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); }
.bp-table table { width: 100%; border-collapse: collapse; font-size: 0.97rem; line-height: 1.5; }
.bp-table th, .bp-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.bp-table th { background: var(--surface-blue); color: var(--heading); font-weight: 800; white-space: nowrap; }
.bp-table tr:last-child td { border-bottom: 0; }
.bp-table th[align="center"], .bp-table td[align="center"] { text-align: center; }
.bp-table th[align="right"], .bp-table td[align="right"] { text-align: right; }

/* ============================================================
   4. COMPONENTES DE POST
   ============================================================ */

/* IPA en linea: <span class="bp-ipa">/θ/</span> */
.bp-ipa {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.95em;
  font-weight: 700;
  color: var(--accent-strong);
  white-space: nowrap;
}

/* Altavoz: lee el inglés con la voz del navegador (assets/blog.js) */
.bp-say {
  display: inline-grid; place-items: center;
  width: 1.55em; height: 1.55em;
  margin: 0 0.1em 0 0.25em;
  padding: 0;
  vertical-align: -0.3em;
  border: 1px solid var(--line-blue);
  border-radius: var(--pill);
  background: var(--accent-tint);
  color: var(--accent);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.bp-say::before {
  content: "";
  width: 62%; height: 62%;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9h3l4-3v12l-4-3H4z' fill='black'/%3E%3Cpath d='M15 9a4 4 0 0 1 0 6M17.5 7a7 7 0 0 1 0 10' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9h3l4-3v12l-4-3H4z' fill='black'/%3E%3Cpath d='M15 9a4 4 0 0 1 0 6M17.5 7a7 7 0 0 1 0 10' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.bp-say:hover { background: var(--accent); color: var(--accent-ink); }
.bp-say:active { transform: scale(0.92); }
.bp-say.is-speaking { background: var(--accent); color: var(--accent-ink); }
/* display: inline-grid gana al [hidden] del navegador: sin esto se verían sin JS. */
.bp-say[hidden] { display: none; }
.bp-say-unit { white-space: nowrap; }
.bp-table .bp-say { font-size: 0.95em; }
.bp-practice .bp-say { border-color: var(--teal-line); background: var(--surface); color: var(--teal); }
.bp-practice .bp-say:hover, .bp-practice .bp-say.is-speaking { background: var(--teal); color: #fff; }
@media (prefers-reduced-motion: reduce) {
  .bp-say { transition: none; }
  .bp-say:active { transform: none; }
}

/* Pares minimos */
.bp-pairs { display: grid; gap: 10px; }
.bp-pair {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-xs);
  background: var(--surface);
  border: 1px solid var(--line);
}
.bp-word { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 1.15rem; font-weight: 800; color: var(--heading); }
.bp-word .bp-ipa { font-size: 0.86rem; font-weight: 600; color: var(--muted); }
.bp-word:last-child { justify-content: flex-end; text-align: right; }
.bp-vs { font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }

/* Ficha de sonido */
.bp-sound {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 18px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
}
.bp-sound-sym {
  width: 64px; height: 64px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  background: var(--accent-tint);
  border: 1px solid var(--line-blue);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 1.6rem; font-weight: 800; color: var(--accent-strong);
}
.bp-sound-body { min-width: 0; display: grid; gap: 6px; }
.bp-sound-body > * { margin: 0; }
.bp-sound-name { font-weight: 800; color: var(--heading); }
.bp-sound-body p { font-size: 0.98rem; line-height: 1.6; color: var(--ink-soft); }

/* Como suena / como deberia sonar (semantica de feedback de la app) */
.bp-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bp-compare > div {
  padding: 14px 16px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line);
  background: var(--surface);
}
.bp-compare p { margin: 0; font-size: 0.98rem; line-height: 1.55; }
.bp-compare-label { font-size: 0.72rem !important; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.bp-compare .bad { border-color: var(--bad); background: var(--bad-bg); }
.bp-compare .bad .bp-compare-label { color: var(--bad); }
.bp-compare .good { border-color: var(--good); background: var(--good-bg); }
.bp-compare .good .bp-compare-label { color: var(--good); }

/* Nota o truco */
.bp-note {
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: var(--accent-tint);
  border: 1px solid var(--line-blue);
}
.bp-note > * { margin: 0; }
.bp-note > * + * { margin-top: 0.6em; }
.bp-note p { font-size: 1rem; line-height: 1.65; }

/* Practica en voz alta (teal: la accion de hablar, como en la app) */
.bp-practice {
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: var(--teal-tint);
  border: 1px solid var(--teal-line);
}
.bp-practice > * { margin: 0; }
.bp-practice > * + * { margin-top: 0.7em; }
.bp-practice-title { font-weight: 800; color: var(--teal) !important; }
.bp-practice ol, .bp-practice ul { padding-left: 1.2em; }
.bp-practice li { font-size: 1.02rem; }
.bp-practice li::marker { color: var(--teal); }
.bp-practice a { color: var(--teal); }

/* Figura dentro del post */
.bp-figure img { display: block; width: 100%; height: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.bp-figure figcaption { margin-top: 8px; font-size: 0.9rem; color: var(--muted); }

/* ============================================================
   5. CTA, AUTOR Y RELACIONADOS
   ============================================================ */
.bp-cta {
  position: relative; overflow: hidden;
  margin-top: clamp(40px, 6vw, 56px);
  padding: clamp(28px, 5vw, 44px);
  border-radius: var(--radius);
  background: linear-gradient(150deg, var(--accent) 0%, #1e40af 100%);
  color: #fff;
  text-align: center;
  box-shadow: var(--shadow-card);
}
html[data-theme="dark"] .bp-cta { background: linear-gradient(150deg, #1d4ed8 0%, #1e3a8a 100%); }
.bp-cta > * { margin: 0; }
.bp-cta-eyebrow { font-size: 0.74rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #cfe0ff; }
.bp-cta-title { margin-top: 8px; font-size: clamp(1.45rem, 3.4vw, 2rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; color: #fff; }
.bp-cta-text { margin: 12px auto 22px !important; max-width: 46ch; color: #e3edff; }

.bp-author {
  margin-top: 28px;
  display: flex; gap: 14px; align-items: flex-start;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
}
.bp-author-logo { width: 48px; height: 48px; border-radius: 12px; flex: none; }
.bp-author-name { font-weight: 800; color: var(--heading); }
.bp-author-text { margin-top: 4px; font-size: 0.95rem; color: var(--ink-soft); }

.bp-related { max-width: var(--maxw); margin: clamp(48px, 7vw, 72px) auto 0; }
.bp-related h2 { font-size: clamp(1.4rem, 2.6vw, 1.8rem); }
/* Con una o dos tarjetas, centradas bajo el artículo en vez de pegadas a la izquierda. */
.bp-related .bp-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 360px)); justify-content: center; }
.bp-related h2 { text-align: center; }

/* ============================================================
   6. PORTADA DEL BLOG Y TARJETAS
   ============================================================ */
.bp-index-head { max-width: 760px; }
.bp-index-head h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); line-height: 1.06; }
.bp-index-lead { margin-top: 16px; max-width: 60ch; font-size: 1.12rem; color: var(--ink-soft); }

.bp-section { margin-top: clamp(44px, 6vw, 64px); scroll-margin-top: 90px; }
.bp-section h2 { font-size: clamp(1.45rem, 2.8vw, 1.9rem); }
.bp-section-intro { margin-top: 8px; max-width: 62ch; color: var(--ink-soft); }
.bp-empty { margin-top: 40px; color: var(--muted); }

.bp-grid {
  list-style: none;
  margin: 22px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2.4vw, 24px);
}
.bp-card { display: flex; }
.bp-card-link {
  display: flex; flex-direction: column; width: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.bp-card-link:hover { transform: translateY(-3px); border-color: var(--accent-light); box-shadow: var(--shadow-card); }
.bp-card img { border-bottom: 1px solid var(--line); }
.bp-card-body { display: grid; gap: 8px; padding: 18px 20px 22px; }
.bp-card-kicker { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.bp-card-title { font-size: 1.12rem; font-weight: 800; line-height: 1.25; letter-spacing: -0.01em; color: var(--heading); }
.bp-card-desc {
  font-size: 0.94rem; line-height: 1.55; color: var(--ink-soft);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* ============================================================
   7. 404
   ============================================================ */
.bp-404 { max-width: 640px; padding: clamp(24px, 6vw, 64px) 0 0; }
.bp-404 h1 { font-size: clamp(2.1rem, 5vw, 3rem); }
.bp-404-actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }

/* ============================================================
   8. RESPONSIVE Y MOVIMIENTO
   ============================================================ */
@media (max-width: 1000px) {
  .bp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .bp-grid { grid-template-columns: 1fr; }
  .bp-body { font-size: 1.04rem; }
  .bp-compare { grid-template-columns: 1fr; }
  .bp-pair { grid-template-columns: 1fr; gap: 6px; }
  .bp-word:last-child { justify-content: flex-start; text-align: left; }
  .bp-vs { justify-self: start; }
  .bp-sound { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .bp-card-link { transition: none; }
  .bp-card-link:hover { transform: none; }
}

/* Autoría y método */
.bp-author-name a { color: inherit; text-decoration: none; }
.bp-author-name a:hover { color: var(--accent); }
.bp-method { max-width: 760px; }
