/* ==========================================================================
   PLANTILLA EDITORIAL DEFINITIVA - LAS ISLAS SIN NOMBRE
   Hoja de estilos modular y exclusiva para la página individual de artículos
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Fondo general */
.article-page-view {
  background-color: var(--bg-color, #fcfcfc);
  color: var(--text-color, #111111);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Contenedor general centrado (max-width de escritorio, nunca ancho fijo) */
.site-container,
.article-container,
.site-container-1160 {
  max-width: 1160px;
  width: calc(100% - 64px);
  margin-inline: auto;
}

/* Adaptación de la cabecera general */
.site-header {
  border-bottom: 1px solid var(--border-color, #e0e0e0);
  background: var(--bg-color, #fcfcfc);
  width: 100%;
}

.site-header .header-inner,
.site-header .header-inner-1160 {
  max-width: 1160px;
  width: calc(100% - 64px);
  margin-inline: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

/* CUADRÍCULA EDITORIAL (900px + 40px + 220px = 1160px en escritorio) */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 900px) 220px;
  gap: 0 40px;
  align-items: start;
  margin-top: 32px;
  margin-bottom: 60px;
}

/* En escritorio, .article-main y .article-main-col usan display: contents */
.article-main,
.article-main-col {
  display: contents;
}

/* Asignación de columnas en la cuadrícula de escritorio */
.article-breadcrumbs,
.article-date-badge,
.article-title,
.article-main-title,
.article-hero-figure,
.article-standfirst,
.article-lead-text,
.article-content,
.article-content-body,
.article-nav-row {
  grid-column: 1;
  width: 100%;
  max-width: 900px;
}

/* 1. MIGAS DE PAN (Alineadas a la izquierda) */
.article-breadcrumbs {
  font-family: var(--font-sans, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  font-size: 0.82rem;
  color: #666666;
  margin-bottom: 16px;
  letter-spacing: 0.02em;
  text-align: left;
}

.article-breadcrumbs a {
  color: #444444;
  text-decoration: none;
  transition: color 0.2s ease;
}

.article-breadcrumbs a:hover {
  color: var(--accent-color, #C83228);
  text-decoration: underline;
}

.article-breadcrumbs .sep {
  margin: 0 8px;
  color: #999999;
}

.article-breadcrumbs .current {
  color: #222222;
  font-weight: 500;
}

/* 2. FECHA (Alineada a la izquierda, sans en versales) */
.article-date-badge {
  font-family: var(--font-sans, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #555555;
  margin-bottom: 20px;
  text-align: left;
  display: block;
}

/* 3. TÍTULO (Centrado horizontalmente en escritorio, serif versátil) */
.article-title,
.article-main-title {
  font-family: var(--font-serif, 'Cinzel', 'Playfair Display', 'Merriweather', Georgia, serif);
  font-size: clamp(2.25rem, 4.2vw, 3.4rem);
  line-height: 1.06;
  font-weight: 700;
  color: #111111;
  text-align: center;
  margin: 0 0 40px 0;
  text-wrap: balance;
}

/* Ajuste fluido para títulos especialmente largos (Caso 4) */
.article-title.is-long-title,
.article-main-title.is-long-title {
  font-size: clamp(2.1rem, 3.6vw, 2.95rem);
  line-height: 1.1;
  margin-bottom: 40px;
}

/* 4. IMAGEN PRINCIPAL (PANORÁMICA O VERTICAL) */
.article-hero-figure {
  margin: 0 0 32px 0;
  padding: 0;
  overflow: hidden;
}

.article-hero,
.article-hero-img {
  width: 100%;
  height: 310px;
  object-fit: cover;
  object-position: center 42%;
  display: block;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

/* Imagen principal vertical (Caso 1: contenida, centrada, sin deformación ni fondos) */
.article-hero-figure.is-vertical {
  text-align: center;
  overflow: visible;
  margin-bottom: 36px;
}

.article-hero-figure.is-vertical .article-hero,
.article-hero-figure.is-vertical .article-hero-img {
  width: auto;
  max-width: 100%;
  max-height: 480px;
  height: auto;
  object-fit: contain;
  margin-inline: auto;
  display: block;
}

/* 5. ENTRADILLA O SUBTEXTO */
.article-standfirst,
.article-lead-text {
  font-family: var(--font-serif, 'Cinzel', 'Playfair Display', 'Merriweather', Georgia, serif);
  font-size: 1.48rem;
  line-height: 1.35;
  color: #222222;
  font-weight: 400;
  text-align: left;
  margin: 0 0 38px 0;
  padding: 0;
  background: transparent;
  border: none;
}

/* 6. CUERPO COMPLETO DEL ARTÍCULO */
.article-content,
.article-content-body {
  font-family: var(--font-serif, 'Cinzel', 'Playfair Display', 'Merriweather', Georgia, serif);
  font-size: 1.1875rem;
  line-height: 1.53;
  color: #111111;
  text-align: justify;
  text-align-last: left;
  text-justify: inter-word;
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: break-word;
}

.article-content p,
.article-content-body p {
  margin: 0 0 0.7em;
}

.article-content p:last-child,
.article-content-body p:last-child {
  margin-bottom: 0;
}

.article-content strong,
.article-content-body strong {
  font-weight: 700;
  color: #111111;
}

.article-content em,
.article-content-body em {
  font-style: italic;
}

.article-content a,
.article-content-body a {
  color: var(--accent-color, #C83228);
  text-decoration: underline;
}

.article-content blockquote,
.article-content-body blockquote {
  margin: 1.6em 0;
  padding: 0.5em 1.5em;
  border-left: 3px solid var(--accent-color, #C83228);
  font-style: italic;
  color: #333333;
}

/* Subtítulos internos */
.article-content h2,
.article-content-body h2,
.article-content h3,
.article-content-body h3,
.article-content .article-subtitle,
.article-content-body .article-subtitle {
  font-family: var(--font-serif, 'Cinzel', 'Playfair Display', 'Merriweather', Georgia, serif);
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.25;
  color: #111111;
  margin-top: 38px;
  margin-bottom: 16px;
  text-align: left;
}

/* Imágenes internas dentro del cuerpo (Caso 3) */
.article-content figure,
.article-content-body figure,
.article-inline-figure {
  margin: 32px 0;
  padding: 0;
  text-align: center;
  max-width: 100%;
}

.article-inline-figure img,
.article-content img,
.article-content-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin-inline: auto;
}

.article-inline-figure.inline-vertical img {
  max-height: 480px;
  width: auto;
  object-fit: contain;
}

.article-inline-figure figcaption,
.article-content figcaption,
.article-content-body figcaption {
  font-family: var(--font-sans, 'Inter', -apple-system, sans-serif);
  font-size: 0.82rem;
  color: #666666;
  margin-top: 8px;
  text-align: center;
  line-height: 1.4;
}

/* 7. COLUMNA AUXILIAR (220px en escritorio) */
.article-sidebar {
  grid-column: 2;
  grid-row: 4 / span 3;
  width: 220px;
}

/* Cuando no hay imagen principal, el lateral se alinea a la altura del cuerpo */
.article-page-view.no-hero .article-sidebar {
  grid-row: 3 / span 3;
}

.sidebar-section {
  border-top: 1px solid #E5E5E0;
  padding-top: 14px;
  margin-bottom: 28px;
}

.sidebar-heading {
  font-family: var(--font-sans, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #111111;
  margin: 0 0 10px 0;
}

.sidebar-cat-link {
  font-family: var(--font-sans, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
  font-size: 0.88rem;
  color: var(--accent-color, #C83228);
  text-decoration: none;
  display: inline-block;
  transition: color 0.2s;
}

.sidebar-cat-link:hover {
  text-decoration: underline;
}

.sidebar-tags-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-tags-list li a {
  font-family: var(--font-sans, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
  font-size: 0.85rem;
  color: var(--accent-color, #C83228);
  text-decoration: none;
  line-height: 1.35;
  transition: color 0.2s;
}

.sidebar-tags-list li a:hover {
  text-decoration: underline;
}

/* 8. NAVEGACIÓN CRONOLÓGICA */
.article-nav-row {
  border-top: 1px solid #E5E5E0;
  border-bottom: 1px solid #E5E5E0;
  margin-top: 28px;
  padding: 20px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.article-nav-item {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: inherit;
  transition: color 0.2s ease;
}

.article-nav-item.next {
  text-align: right;
}

.article-nav-item .nav-direction {
  font-family: var(--font-sans, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #888888;
}

.article-nav-item .nav-post-title {
  font-family: var(--font-serif, 'Cinzel', 'Playfair Display', Georgia, serif);
  font-size: 0.98rem;
  font-weight: 600;
  color: #111111;
  line-height: 1.35;
}

.article-nav-item:hover .nav-post-title {
  color: var(--accent-color, #C83228);
}

/* 9. BLOQUE RELACIONADOS */
.related-section,
.related-section-1160 {
  border-top: 1px solid #E5E5E0;
  margin-top: 60px;
  padding-top: 48px;
  padding-bottom: 70px;
}

.related-section-title {
  font-family: var(--font-serif, 'Cinzel', 'Playfair Display', Georgia, serif);
  font-size: 2.2rem;
  font-weight: 700;
  color: #111111;
  margin: 0 0 32px 0;
  text-align: left;
}

.related-grid,
.related-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
}

.related-card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: opacity 0.2s ease;
}

.related-card-link:hover {
  opacity: 0.9;
}

.related-card-media {
  width: 100%;
  aspect-ratio: 16 / 9.5;
  margin-bottom: 14px;
  overflow: hidden;
  background-color: #EFEFEA;
}

.related-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.related-card-link.no-image {
  padding-top: 12px;
  border-top: 1px solid #E5E5E0;
}

.related-card-meta {
  font-family: var(--font-sans, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.related-card-meta .meta-cat {
  color: var(--accent-color, #C83228);
}

.related-card-meta .meta-sep {
  color: #888888;
}

.related-card-meta .meta-date {
  color: #555555;
}

.related-card-title {
  font-family: var(--font-serif, 'Cinzel', 'Playfair Display', Georgia, serif);
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.3;
  color: #111111;
  margin: 0;
  transition: color 0.2s ease;
}

.related-card-link:hover .related-card-title {
  color: var(--accent-color, #C83228);
}

/* 10. PIE GENERAL */
.site-footer {
  border-top: 1px solid var(--border-color, #e0e0e0);
  background: var(--bg-color, #fcfcfc);
  padding: 30px 0;
  width: 100%;
}

.site-footer .footer-inner,
.site-footer .footer-inner-1160 {
  max-width: 1160px;
  width: calc(100% - 64px);
  margin-inline: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ==========================================================================
   11. ADAPTACIÓN RESPONSIVE: EN PANTALLAS INFERIORES A 1024 PX
   ========================================================================== */
@media (max-width: 1023px) {
  .site-container,
  .article-container,
  .site-container-1160 {
    width: calc(100% - 48px);
    max-width: none;
    margin-inline: auto;
  }

  .site-header .header-inner,
  .site-header .header-inner-1160 {
    width: calc(100% - 48px);
    max-width: none;
  }

  .main-nav .nav-links {
    display: none;
  }

  .menu-toggle-btn {
    display: flex;
  }

  .article-layout {
    display: block;
    margin-top: 24px;
    margin-bottom: 40px;
  }

  .article-main,
  .article-main-col,
  .article-content,
  .article-content-body,
  .article-standfirst,
  .article-lead-text,
  .article-sidebar {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .article-breadcrumbs,
  .article-date-badge,
  .article-title,
  .article-main-title,
  .article-hero-figure,
  .article-nav-row {
    max-width: none;
  }

  .article-sidebar {
    margin-top: 36px;
    margin-bottom: 24px;
    border-top: 1px solid #E5E5E0;
    padding-top: 20px;
  }

  .article-sidebar .sidebar-section {
    border-top: none;
    padding-top: 0;
    margin-bottom: 18px;
  }

  .sidebar-tags-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px 16px;
  }

  .related-grid,
  .related-grid-3 {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .site-footer .footer-inner,
  .site-footer .footer-inner-1160 {
    width: calc(100% - 48px);
    max-width: none;
    flex-direction: column;
    gap: 1.25rem;
    align-items: flex-start;
  }

  .footer-right {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
  }

  .footer-nav {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
}

/* ==========================================================================
   12. ADAPTACIÓN RESPONSIVE: EN PANTALLAS INFERIORES A 768 PX
   ========================================================================== */
@media (max-width: 767px) {
  .article-nav-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .article-nav-item.next {
    text-align: left;
  }

  .related-section,
  .related-section-1160 {
    margin-top: 40px;
    padding-top: 32px;
    padding-bottom: 50px;
  }
}

/* ==========================================================================
   13. ADAPTACIÓN RESPONSIVE: EN PANTALLAS INFERIORES A 600 PX
   ========================================================================== */
@media (max-width: 599px) {
  .site-container,
  .article-container,
  .site-container-1160,
  .site-header .header-inner,
  .site-header .header-inner-1160,
  .site-footer .footer-inner,
  .site-footer .footer-inner-1160 {
    width: calc(100% - 32px);
  }

  .article-title,
  .article-main-title {
    font-size: clamp(2.25rem, 11vw, 2.75rem);
    line-height: 1.05;
    text-align: center;
    margin-bottom: 24px;
  }

  .article-title.is-long-title,
  .article-main-title.is-long-title {
    font-size: clamp(1.85rem, 9.5vw, 2.35rem);
    line-height: 1.08;
    margin-bottom: 24px;
  }

  .article-hero,
  .article-hero-img {
    display: block;
    width: 100%;
    height: 210px;
    object-fit: cover;
    object-position: center;
  }

  .article-hero-figure.is-vertical .article-hero,
  .article-hero-figure.is-vertical .article-hero-img {
    max-height: 340px;
    height: auto;
  }

  .article-standfirst,
  .article-lead-text {
    font-size: 1.3rem;
    line-height: 1.4;
    margin-bottom: 24px;
  }

  .article-content,
  .article-content-body {
    font-size: 1.075rem;
    line-height: 1.55;
    text-align: justify;
    text-align-last: left;
    hyphens: auto;
    -webkit-hyphens: auto;
    overflow-wrap: break-word;
  }

  .related-grid,
  .related-grid-3 {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}
