/* =============================================================================
   articulo.v1.css — Página de artículo + botón guardar en cards
   ============================================================================= */

.articulo-main {
  background: #f4f4f1;
  padding: 24px 20px 60px;
}
.articulo {
  max-width: 1440px;   /* mismo ancho que la portada */
  margin: 0 auto;
  background: transparent;   /* sin recuadro blanco: se integra con el fondo */
  border: 0;
  padding: 28px 40px 40px;
}

/* ---- Cabecera del artículo (dentro de la columna izquierda 2/3) ---- */
.articulo-head { margin: 0 0 24px; }
.articulo-categoria {
  font-family: "Inter", sans-serif;
  font-size: 0.74rem;
  font-weight: 800;
  color: #1f3828;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 14px;
}
.articulo-categoria a { color: inherit; text-decoration: none; }
.articulo-categoria a:hover { text-decoration: underline; }

.articulo-titulo {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 2.3rem;
  font-weight: 900;
  color: #1a1f23;
  line-height: 1.1;
  letter-spacing: -0.018em;
  margin: 0 0 16px;
}
.articulo-lede {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.2rem;
  font-style: italic;
  color: #3a3f43;
  line-height: 1.5;
  margin: 0 0 22px;
}
.articulo-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Inter", sans-serif;
  font-size: 0.88rem;
  color: #565d62;
  padding-top: 16px;
  border-top: 1px solid #ececec;
  flex-wrap: wrap;
}
.articulo-meta strong { color: #1a1f23; font-weight: 700; }
.articulo-meta .meta-sep { color: #c8c8c2; }
.articulo-meta time { font-variant-numeric: tabular-nums; }

/* Acciones (compartir + guardar) en la cabecera del artículo */
.articulo-actions {
  margin-left: auto;
  display: inline-flex;
  gap: 8px;
}
.save-article-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #ffffff;
  border: 1px solid #1f3828;
  color: #1f3828;
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background .15s ease, color .15s ease;
}
.save-article-btn:hover { background: #1f3828; color: #ffffff; }
.save-article-btn.is-saved { background: #1f3828; color: #ffffff; }
.save-article-btn.is-saved svg { fill: #ffffff; }
/* Botón compartir (mismo estilo, sin funcionalidad por ahora) */
.share-btn { /* idéntico a save-article-btn — hereda todos los estilos */ }

/* ---- Foto principal (dentro de la columna izquierda) ---- */
.articulo-foto {
  margin: 0 0 28px;
  padding: 0;
}
.articulo-foto img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  max-height: 460px;       /* tope para que no domine en columnas anchas */
  object-fit: cover;
}
@media (max-width: 880px) {
  .articulo-foto img { aspect-ratio: 3 / 2; max-height: 320px; }
}

/* ---- Layout: cuerpo flexible + sidebar fijo 300px ---- */
.articulo-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  align-items: start;
  margin: 0;          /* ocupa todo el ancho del .articulo (max 1440px) */
}
@media (max-width: 980px) {
  .articulo-layout { grid-template-columns: 1fr; gap: 32px; }
  .articulo { padding: 28px 22px 36px; }
  .articulo-titulo { font-size: 1.9rem; }
  .articulo-lede { font-size: 1.05rem; }
  /* En móvil el anuncio vuelve a ser estático (sticky molestaría al leer) */
  .articulo-aside { align-self: auto; }
  .aside-ad { position: static; }
}

/* ---- Cuerpo del artículo (ocupa toda la columna izquierda) ---- */
.articulo-cuerpo {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.12rem;
  color: #1a1f23;
  line-height: 1.72;
  min-width: 0;          /* permite que el contenido se ajuste a la columna del grid */
}

/* Entradilla: más grande, color editorial, separada del cuerpo */
.articulo-cuerpo .lead {
  font-size: 1.3rem;
  font-weight: 600;
  color: #1a1f23;
  line-height: 1.5;
  margin: 0 0 32px;
  padding-bottom: 26px;
  border-bottom: 1px solid #d8d8d2;
}

.articulo-cuerpo p {
  margin: 0 0 22px;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  -webkit-hyphens: auto;
  word-spacing: 0.02em;
  overflow-wrap: break-word;
}
.articulo-cuerpo h2,
.articulo-cuerpo h3 { text-align: left; }
/* Idioma para que el guionado funcione correctamente */
.articulo-cuerpo { hyphenate-character: "-"; }

/* H2: con filete verde corto encima, como ladillo editorial */
.articulo-cuerpo h2 {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.55rem;
  font-weight: 800;
  color: #1a1f23;
  letter-spacing: -0.015em;
  line-height: 1.22;
  margin: 44px 0 18px;
  padding-top: 14px;
  position: relative;
}
.articulo-cuerpo h2::before {
  content: "";
  display: block;
  width: 38px;
  height: 3px;
  background: #1f3828;
  position: absolute;
  top: 0;
  left: 0;
}

.articulo-cuerpo h3 {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.2rem;
  font-weight: 800;
  color: #1a1f23;
  margin: 30px 0 12px;
}

/* Cita destacada: con comilla decorativa grande verde */
.articulo-cuerpo blockquote {
  position: relative;
  margin: 36px 0;
  padding: 12px 32px 12px 56px;
  background: transparent;
  border-left: 3px solid #1f3828;
  font-family: "Source Serif 4", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 1.32rem;
  color: #1a1f23;
  line-height: 1.45;
}
.articulo-cuerpo blockquote::before {
  content: "\201C";        /* “ */
  position: absolute;
  left: 14px;
  top: -2px;
  font-family: Georgia, "Source Serif 4", serif;
  font-size: 4.2rem;
  font-style: normal;
  line-height: 1;
  color: #1f3828;
  opacity: 0.22;
  pointer-events: none;
}
.articulo-cuerpo blockquote p { margin: 0; }

.articulo-cuerpo a {
  color: #1f3828;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.articulo-cuerpo a:hover { text-decoration-thickness: 2px; }
.articulo-cuerpo strong { font-weight: 700; color: #1a1f23; }
.articulo-cuerpo em { font-style: italic; }

/* Listas */
.articulo-cuerpo ul, .articulo-cuerpo ol {
  margin: 0 0 22px;
  padding-left: 24px;
}
.articulo-cuerpo li {
  margin: 0 0 8px;
  line-height: 1.6;
}

/* Refuerzos tipográficos en pantallas anchas */
@media (min-width: 1100px) {
  .articulo-cuerpo { font-size: 1.15rem; line-height: 1.75; }
  .articulo-cuerpo .lead { font-size: 1.38rem; }
  .articulo-cuerpo h2 { font-size: 1.7rem; }
}
.placeholder-body {
  color: #8a9094;
  background: #f9f9f6;
  border-left: 3px solid #c8c8c2;
  padding: 14px 18px;
}

.articulo-footer {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid #ececec;
  font-family: "Inter", sans-serif;
  font-size: 0.88rem;
  color: #8a9094;
}
.articulo-footer a { color: #1f3828; text-decoration: none; font-weight: 600; }
.articulo-footer a:hover { text-decoration: underline; }

/* ---- Aside (1/3) ---- */
.articulo-aside {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-self: stretch;   /* la columna ocupa el alto del artículo → el anuncio puede acompañar el scroll */
}
.aside-head {
  font-family: "Inter", sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  color: #1f3828;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid #1f3828;
}
/* Cards del sidebar: compactas (miniatura 84×60 izquierda + texto derecha) */
.rel-card {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid #ececec;
  text-decoration: none;
  color: inherit;
}
.rel-card:last-of-type { border-bottom: 0; }
.rel-card:hover .rel-title { color: #1f3828; }
.rel-img {
  width: 84px;
  height: 60px;
  background: #f4f4f1;
  overflow: hidden;
}
.rel-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.rel-cat {
  font-family: "Inter", sans-serif;
  font-size: 0.64rem;
  font-weight: 800;
  color: #1f3828;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 6px;
  line-height: 1;          /* sin interlineado: la etiqueta queda a ras del borde superior de la foto */
}
.rel-title {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 0.92rem;
  font-weight: 700;
  color: #1a1f23;
  line-height: 1.3;
  margin: 0;
  transition: color .15s ease;
}
.aside-empty {
  color: #8a9094;
  font-style: italic;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 0.9rem;
}
.aside-ad {
  position: sticky;       /* acompaña el scroll dentro de su columna (desktop) */
  top: 140px;             /* por debajo de la cabecera fija */
  background: #f4f4f1;
  border: 1px dashed #c8c8c2;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: "Inter", sans-serif;
  color: #8a9094;
}
.aside-ad img { width: 100%; height: auto; max-height: 250px; object-fit: cover; }
.aside-ad .ad-slot-content { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; }
.aside-ad .ad-slot-size { font-weight: 700; }

/* =============================================================================
   BOTÓN GUARDAR — visible solo al pasar el cursor por encima de la card.
   Tamaño compacto, fondo blanco, icono verde corporativo.
   ============================================================================= */
.card { position: relative; }

/* Etiqueta de categoría con altura fija idéntica al botón guardar (26px) */
.ph-cat {
  height: 26px;
  padding: 0 10px;
  font-size: 0.64rem;
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  line-height: 1;
}
/* Botón guardar: dentro de la imagen (.ph), alineado a la altura de la etiqueta.
   Caja blanca SIN borde, icono verde corporativo. */
.card .ph { position: relative; }      /* contexto de posicionamiento */
.card .card-save {
  position: absolute;
  top: 8px;            /* mismo top que .ph-cat */
  right: 8px;
  width: 26px;
  height: 26px;        /* caja cuadrada 26×26, a la altura de la etiqueta */
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
  cursor: pointer;
  color: #1f3828;      /* icono verde */
  z-index: 4;
  padding: 0;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity .18s ease, transform .18s ease,
              background .15s ease, color .15s ease;
}
.card .card-save svg { display: block; width: 14px; height: 14px; }

/* Aparece al hover de la card entera */
.card:hover .card-save,
.card:focus-within .card-save,
.card .card-save.is-saved {
  opacity: 1;
  transform: translateY(0);
}
/* También al pasar el cursor solo por la imagen */
.card .ph:hover .card-save {
  opacity: 1;
  transform: translateY(0);
}

/* Hover sobre el propio icono: fondo blanco, icono verde corporativo */
.card .card-save:hover,
.card .card-save:focus-visible {
  background: #ffffff;
  color: #1f3828;
}

/* Guardado (clic): fondo blanco, icono verde corporativo relleno */
.card .card-save.is-saved { background: #ffffff; color: #1f3828; }
.card .card-save.is-saved svg { fill: #1f3828; }

/* Toast simple para feedback de guardado */
.save-toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%) translateY(20px);
  background: #1f3828;
  color: #ffffff;
  font-family: "Inter", sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 12px 22px;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 1000;
}
.save-toast.is-error { background: #8a0e2c; }
.save-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =============================================================================
   Visibilidad según sesión (refuerzo: si JS marca body.sf-logged / sf-guest,
   CSS oculta el bloque correspondiente aunque "hidden" no se haya aplicado).
   ============================================================================= */
body.sf-logged [data-only-guest]  { display: none !important; }
body.sf-guest  [data-only-logged] { display: none !important; }

/* =============================================================================
   WIDGET STATS (logueado) — sustituye al newsletter mini
   ============================================================================= */
.widget-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: #ffffff;
  border: 1px solid #d8d8d2;
  padding: 12px;
  align-items: center;
}
.widget-stats .stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px 6px;
  text-decoration: none;
  color: inherit;
  border-right: 1px solid #ececec;
  transition: background .15s ease;
}
.widget-stats .stat-item:last-child { border-right: 0; }
.widget-stats .stat-item:hover { background: #f9f9f6; }

/* Número + icono en la misma fila (a la misma altura) */
.widget-stats .stat-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1;
}
.widget-stats .stat-num {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.7rem;
  font-weight: 900;
  color: #1f3828;
  line-height: 1;
  letter-spacing: -0.01em;
}
.widget-stats .stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1f3828;
}
.widget-stats .stat-icon svg { display: block; }

/* Etiqueta debajo */
.widget-stats .stat-label {
  font-family: "Inter", sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  color: #565d62;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.widget-stats .stat-item:hover .stat-num,
.widget-stats .stat-item:hover .stat-icon { color: #2a4a35; }

@media (max-width: 560px) {
  .widget-stats .stat-num   { font-size: 1.35rem; }
  .widget-stats .stat-icon svg { width: 18px; height: 18px; }
  .widget-stats .stat-label { font-size: 0.6rem; }
}

/* =============================================================================
   ÍNDICE LATERAL DEL ARTÍCULO — minimalista de puntos
   Solo se ven puntos. El subtítulo activo (por scroll) o el del punto sobre el
   que se pasa el cursor aparece como etiqueta superpuesta a la IZQUIERDA, sin
   alterar la separación fija entre puntos. Solo en monitores anchos (≥1860px).
   --toc-row: distancia fija entre puntos (= line-height de la etiqueta, para que
   cada línea de texto ocupe exactamente una fila y el cálculo de solape sea exacto).
   ============================================================================= */
.articulo-toc { display: none; }

@media (min-width: 1860px) {
  .articulo-toc {
    display: block;
    position: fixed;
    top: 150px;        /* arriba, no centrado */
    left: 36px;        /* pegado a la parte izquierda */
    right: auto;
    width: 30px;       /* zona de hover de los puntos (etiqueta crece a la derecha) */
    z-index: 20;
  }
}

.articulo-toc {
  --toc-row: 25px;   /* separación fija entre puntos (un pelín más grande) */
}
.articulo-toc .toc-list { list-style: none; margin: 0; padding: 0; }

.articulo-toc .toc-item {
  position: relative;
  height: var(--toc-row);   /* altura fija → puntos siempre equidistantes */
}

.articulo-toc .toc-link {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 210px;             /* zona de hover: incluye el punto Y el subtítulo */
  display: block;
  text-decoration: none;
}

/* Punto: a la izquierda (estructura ". subtítulo"), centrado en su fila */
.articulo-toc .toc-dot {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c2c2bc;
  transition: background .15s ease, transform .15s ease;
}

/* Etiqueta: superpuesta, NO ocupa espacio (no separa los puntos).
   A la derecha del punto, crece hacia la derecha. */
.articulo-toc .toc-text {
  position: absolute;
  left: 18px;
  top: 0;
  width: 185px;
  text-align: left;
  line-height: var(--toc-row);  /* cada línea = una fila */
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 0.98rem;
  font-weight: 600;
  color: #1f3828;
  opacity: 0;
  pointer-events: none;         /* no bloquea el hover de los puntos */
  transition: opacity .18s ease;
}

/* Activo (scroll) o mostrado por hover: punto verde + etiqueta visible */
.articulo-toc .toc-item.is-shown .toc-dot {
  background: #1f3828;
  transform: translateY(-50%) scale(1.25);
}
.articulo-toc .toc-item.is-shown .toc-text {
  opacity: 1;
}

/* Desplazamiento del ancla para que el título no quede pegado al borde superior */
.articulo-cuerpo h2,
.articulo-cuerpo h3 { scroll-margin-top: 96px; }

/* =============================================================================
   COMENTARIOS
   ============================================================================= */
.comentarios {
  max-width: 820px;
  margin: 52px 0 0;
  padding-top: 34px;
  border-top: 1px solid #d8d8d2;
}
.comentarios-head {
  font-family: "Inter", sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: #1a1f23;
  letter-spacing: 0.01em;
  margin: 0 0 22px;
}
.comentarios-count { color: #8a9094; font-weight: 700; }

/* Caja de escribir */
.com-compose { margin-bottom: 26px; }
.com-form { margin: 0; }
.com-form textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  min-height: 70px;
  padding: 12px 14px;
  border: 1px solid #d8d8d2;
  background: #ffffff;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1rem;
  color: #1a1f23;
  line-height: 1.5;
}
.com-form textarea:focus { outline: none; border-color: #1f3828; }
.com-form-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 10px;
}
.com-counter {
  font-family: "Inter", sans-serif;
  font-size: 0.74rem;
  color: #a2a8ac;
  margin-right: auto;
}
.com-btn {
  display: inline-block;
  background: #1f3828;
  color: #ffffff;
  border: 0;
  cursor: pointer;
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 9px 20px;
  text-decoration: none;
}
.com-btn:hover { background: #2a4a35; }
.com-btn:disabled { background: #8a9094; cursor: not-allowed; }
.com-msg {
  font-family: "Inter", sans-serif;
  font-size: 0.82rem;
  color: #8a0e2c;
  margin: 8px 0 0;
}

/* Aviso para invitados / no verificados */
.com-gate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 20px;
  border: 1px solid #d8d8d2;
  background: #f9f9f6;
}
.com-gate p {
  margin: 0;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 0.98rem;
  color: #3a3f43;
}

/* Lista */
.com-loading, .com-empty {
  font-family: "Source Serif 4", Georgia, serif;
  font-style: italic;
  color: #8a9094;
  margin: 0;
  padding: 8px 0;
}
.com-item {
  padding: 18px 0;
  border-top: 1px solid #ececec;
}
.com-list > .com-item:first-child { border-top: 0; }
.com-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}
.com-author {
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: #1a1f23;
}
.com-dot { color: #c8c8c2; }
.com-time {
  font-family: "Inter", sans-serif;
  font-size: 0.78rem;
  color: #8a9094;
}
.com-body {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1rem;
  color: #1a1f23;
  line-height: 1.6;
  margin: 0 0 8px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.com-actions { display: flex; gap: 16px; }
.com-action {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: "Inter", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #1f3828;
}
.com-action:hover { text-decoration: underline; }
.com-action.com-del { color: #8a0e2c; }
.com-deleted {
  font-family: "Source Serif 4", Georgia, serif;
  font-style: italic;
  color: #a2a8ac;
  margin: 0;
}

/* Respuestas: indentadas con filete a la izquierda */
.com-children { margin-top: 6px; }
.com-reply {
  margin-left: 24px;
  padding-left: 18px;
  border-top: 0;
  border-left: 2px solid #ececec;
  padding-top: 14px;
  padding-bottom: 4px;
}
.com-replyform:not(:empty) { margin-top: 12px; }

@media (max-width: 560px) {
  .com-reply { margin-left: 12px; padding-left: 12px; }
  .com-gate { flex-direction: column; align-items: flex-start; }
}

/* =============================================================================
   Anuncios ligados a su sección: si se oculta la sección, su anuncio también.
   ============================================================================= */
body.hide-finanzas      .ad-band[data-ad-after="finanzas"],
body.hide-internacional .ad-band[data-ad-after="internacional"] { display: none; }
