/* =========================================================================
   Fraunces en los títulos de las notas + firmas múltiples + feed de autores.
   Se carga después de style.min.css (ver inc/autores.php).
   ========================================================================= */

/* Fraunces variable, recortada a latín. Ejes vivos: opsz, wght, SOFT (WONK fijo en 0). */
@font-face {
  font-family: 'Fraunces';
  src: url('../fonts/Fraunces/Fraunces-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('../fonts/Fraunces/Fraunces-Italic-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --nm-font-titulo: 'Fraunces', Georgia, 'Times New Roman', serif;
  /* Mismo ajuste que tropacirca.com: SOFT 30 y tamaño óptico automático. */
  --nm-titulo-soft: "SOFT" 30;
  --nm-titulo-peso: 600;
}

/* ----- Títulos de notas ----- */
.single-post .post-title,
.single-post-infinite .post-title,
.post .post-content h3,
.post .post-content h3 a,
.hero-title,
.featured-story-title,
.related-post h4,
.related-post h4 a,
.trending-title,
.trending-title a,
.nm-autores-title,
.author-header .author-name {
  font-family: var(--nm-font-titulo) !important;
  font-weight: var(--nm-titulo-peso) !important;
  font-optical-sizing: auto;
  font-variation-settings: var(--nm-titulo-soft);
  letter-spacing: -0.015em;
}

/* Poppins 900 a 34px ocupaba lo mismo que Fraunces 600 a ~36px; se compensa el interlineado. */
.single-post .post-title,
.single-post-infinite .post-title,
.hero-title,
.nm-autores-title,
.author-header .author-name {
  line-height: 1.12 !important;
  letter-spacing: -0.02em;
}
.post .post-content h3,
.post .post-content h3 a {
  line-height: 1.15 !important;
}

/* ----- Firma con varios autores ----- */
.nm-avatar-stack {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: 12px;
}
.nm-avatar-stack .post-avatar-link {
  display: inline-flex;
  position: relative;
}
.nm-avatar-stack .post-avatar-link + .post-avatar-link {
  margin-left: -14px;
}
.nm-avatar-stack .post-avatar {
  margin-right: 0 !important;
  border: 2px solid var(--background-color, #000);
  box-sizing: border-box;
  object-fit: cover;
}
.nm-avatar-stack .post-avatar-link:nth-child(1) { z-index: 3; }
.nm-avatar-stack .post-avatar-link:nth-child(2) { z-index: 2; }
.nm-avatar-stack .post-avatar-link:nth-child(3) { z-index: 1; }

.nm-post-authors {
  font-weight: 700;
  color: var(--text-secondary, #71767b);
}
.nm-post-authors .post-author:hover,
.post-author:hover {
  color: var(--primary-color, #e53935);
}

/* ----- Encabezado del archivo de autor ----- */
.author-header .author-name {
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
}
.author-header .author-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-secondary, #71767b);
}
.author-header .author-stats a {
  color: var(--primary-color, #e53935);
  font-weight: 600;
  text-decoration: none;
}
.author-header .author-stats a:hover { text-decoration: underline; }

/* ----- Feed de autores (/autores/) ----- */
.nm-autores-header {
  padding: 8px 0 20px;
  border-bottom: 1px solid var(--border-color, #2f3336);
  margin-bottom: 20px;
}
.nm-autores-title {
  font-size: clamp(2.2rem, 4.4vw, 3.4rem);
  margin: 0;
  color: var(--text-color, #e7e9ea);
}
.nm-autores-title::after {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  margin-top: 14px;
  background: var(--primary-color, #e53935);
  border-radius: 2px;
}
.nm-autores-intro,
.nm-autores-intro p {
  margin: 12px 0 0;
  max-width: 60ch;
  color: var(--text-secondary, #71767b);
  font-size: 15px;
  line-height: 1.55;
}

.nm-autores-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.nm-autor-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  background: var(--surface-color, #16181c);
  border: 1px solid var(--border-color, #2f3336);
  border-radius: 16px;
  transition: border-color .2s ease, transform .2s ease;
}
.nm-autor-card:hover {
  border-color: var(--primary-color, #e53935);
}

.nm-autor-head {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}
.nm-autor-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--hover-color, #1d1f23);
  box-shadow: 0 0 0 2px var(--surface-color, #16181c), 0 0 0 4px var(--border-color, #2f3336);
  transition: box-shadow .2s ease;
}
.nm-autor-card:hover .nm-autor-avatar {
  box-shadow: 0 0 0 2px var(--surface-color, #16181c), 0 0 0 4px var(--primary-color, #e53935);
}
.nm-autor-id {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.nm-autor-name {
  font-family: var(--nm-font-titulo);
  font-weight: var(--nm-titulo-peso);
  font-variation-settings: var(--nm-titulo-soft);
  font-optical-sizing: auto;
  font-size: 1.45rem;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--text-color, #e7e9ea);
}
.nm-autor-head:hover .nm-autor-name { color: var(--primary-color, #e53935); }
.nm-autor-count {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--primary-color, #e53935);
}

.nm-autor-bio {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary, #71767b);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nm-autor-ultima {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color, #2f3336);
  text-decoration: none;
  color: inherit;
}
.nm-autor-ultima-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-secondary, #71767b);
}
.nm-autor-ultima-title {
  font-family: var(--nm-font-titulo);
  font-style: italic;
  font-weight: 500;
  font-variation-settings: var(--nm-titulo-soft);
  font-optical-sizing: auto;
  font-size: 1.05rem;
  line-height: 1.3;
  color: var(--text-color, #e7e9ea);
}
.nm-autor-ultima:hover .nm-autor-ultima-title {
  text-decoration: underline;
  text-decoration-color: var(--primary-color, #e53935);
  text-underline-offset: 3px;
}

@media (max-width: 600px) {
  .nm-autores-grid { grid-template-columns: 1fr; gap: 12px; }
  .nm-autor-card { padding: 16px; }
  .nm-autor-avatar { width: 60px; height: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  .nm-autor-card, .nm-autor-avatar { transition: none; }
}
