/* ============================================================
   pages.css — estilos específicos de cada vista
   ============================================================ */

/* Hero genérico
   ============================================================ */

.hero {
  position: relative;
  padding: 8px 0 24px;
}

.see-all {
  margin-top: 10px;
}

/* Página no encontrada
   ============================================================ */

.not-found {
  padding: 60px 20px;
  text-align: center;
}

.not-found h2 {
  color: var(--state-error-emphasis);
  font-size: 2.4rem;
}

/* ============================================================
   Banner reutilizable de páginas internas
   ============================================================ */

.page-hero {
  width: 100%;
  margin: 0 0 48px;
}

.page-hero-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1672 / 941;
  overflow: hidden;
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-panel);
}

.page-hero-media.is-empty {
  background:
    linear-gradient(
      135deg,
      rgba(var(--accent-primary-rgb), 0.08),
      transparent 55%
    ),
    var(--surface-card);
  border-style: dashed;
}

.page-hero-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 45% center;
}

.page-hero-title {
  margin: 24px 0 10px;
  color: var(--text-h1);
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.05;
}

/* Título principal centrado (reader de capítulo) */
.page-title-center {
  text-align: center;
}

.page-hero-description {
  max-width: 75ch;
  margin: 0;
  color: var(--text-body);
  font-size: 1rem;
  line-height: 1.7;
}

/* Introducción exclusiva de Una Tierra Sin Goku
   ============================================================ */

.chapter-introduction {
  width: min(100%, 75ch);
  margin: -20px 0 48px;
}

.chapter-introduction-title {
  margin: 0 0 1rem;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.12;
}

.chapter-introduction-content {
  color: var(--text-body);
  font-size: 1rem;
  line-height: 1.75;
}

.chapter-introduction-content p {
  margin: 0;
}

.chapter-introduction-content p + p {
  margin-top: 1.2rem;
}

@media (max-width: 700px) {
  .page-hero {
    margin-bottom: 36px;
  }

  .page-hero-media {
    border-radius: var(--radius-sm);
  }

  .page-hero-title {
    margin-top: 18px;
    font-size: clamp(1.8rem, 9vw, 2.5rem);
  }

  .page-hero-description {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .chapter-introduction {
  margin-top: -12px;
  margin-bottom: 36px;
  }

  .chapter-introduction-title {
    font-size: clamp(1.45rem, 7vw, 1.9rem);
  }

  .chapter-introduction-content {
    font-size: 0.95rem;
    line-height: 1.65;
  }
}

/* ============================================================
   Home — Hero principal
   ============================================================ */

.hero-section {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1672 / 941;
  width: auto;
  min-height: 0;
  margin: -12px -12px 40px;
  overflow: hidden;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-align: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  opacity: 1;
  filter: none;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 40px 24px;
  background: rgba(
    var(--smoke-deep-rgb),
    0.60
  );
}

.hero-title {
  position: relative;
  z-index: 2;
  margin: 0;
  color: var(--text-h1);
  font-size: clamp(3rem, 6vw, 4.8rem);
  opacity: 1;
  text-shadow:
    0 2px 3px rgba(var(--smoke-deep-rgb), 0.95),
    0 0 10px rgba(var(--smoke-deep-rgb), 0.85),
    2px 2px 0 rgba(var(--shadow-color-rgb), 0.75);
}

.hero-subtitle {
  margin: 0;
  color: var(--text-caption);
  font-family: var(--font-body);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ============================================================
   Home — Secciones del hub
   ============================================================ */

.home-section {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.home-section:last-child {
  border-bottom: none;
}

@media (min-width: 769px) {
  .home-section h2 {
    font-size: clamp(2.4rem, 3.8vw, 3.4rem);
  }
}

.home-section-split {
  display: grid;
  grid-template-columns: 260px 1fr;
  align-items: center;
  gap: 30px;
  min-height: min(55vh, 460px);
}

.home-section-reverse {
  grid-template-columns: 1fr 260px;
}

.home-section-reverse .home-section-cover-link {
  order: 2;
}

.home-section-cover-link {
  display: block;
  width: 260px;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-panel);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.home-section-cover-link:hover {
  border-color: var(--accent-primary);
  box-shadow:
    var(--shadow-panel),
    0 0 18px rgba(var(--accent-primary-rgb), 0.18);
  transform: translateY(-4px);
}

.home-section-cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.home-section-desc {
  max-width: 60ch;
  color: var(--text-body);
  line-height: 1.6;
}

.home-section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

#section-hero,
#section-about,
#section-utsg,
#section-stories,
#section-forum {
  scroll-margin-top: calc(76px + 1rem);
}

@media (min-width: 1051px) {
  #section-hero,
  #section-about,
  #section-utsg,
  #section-stories,
  #section-forum {
    scroll-margin-top: calc(var(--header-desktop-height) + 1rem);
  }
}

@media (min-width: 901px) and (max-width: 1050px) {
  #section-hero,
  #section-about,
  #section-utsg,
  #section-stories,
  #section-forum {
    scroll-margin-top: calc(124px + 1rem);
  }
}

@media (max-width: 900px) {
  #comments-section,
  #section-hero,
  #section-about,
  #section-utsg,
  #section-stories,
  #section-forum {
    scroll-margin-top: calc(72px + 1rem);
  }
}

/* Home — Canal de YouTube
   ============================================================ */

.youtube-section {
  text-align: left;
}

.youtube-section h2 {
  margin-bottom: 24px;
}

.youtube-frame {
  position: relative;
  width: min(100%, 900px);
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--radius-md);
  background: transparent;
  box-shadow: none;
}

.youtube-video,
.youtube-frame-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.youtube-video {
  z-index: 1;
  display: block;
  inset: auto;
  top: 9%;
  left: 3%;
  width: 94%;
  height: 85%;
  border: 0;
}

.youtube-frame-image {
  z-index: 2;
  display: block;
  object-fit: fill;
  pointer-events: none;
}

.youtube-actions {
  display: flex;
  justify-content: center;
  margin: 24px 0 0;
}

/* Home responsive
   ============================================================ */

@media (max-width: 700px) {
  .home-section-split,
  .home-section-reverse {
    grid-template-columns: 1fr;
  }

  .home-section-reverse .home-section-cover-link {
    order: 0;
  }

  .home-section-cover-link {
    width: min(260px, 100%);
    margin: 0 auto;
  }

  .home-section-body {
    min-width: 0;
  }

  .youtube-frame {
    width: 100%;
    border-radius: var(--radius-sm);
  }

  .youtube-section h2 {
    margin-bottom: 18px;
  }

}
/* ============================================================
   Detalle de una página del cómic
   ============================================================ */

.page-detail-image-btn {
  padding: 0;
  background: none;
  border: none;
  cursor: zoom-in;
}

.page-detail-image {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 80vh;
  aspect-ratio: 7 / 10;
  object-fit: contain;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-panel);
}

@media (max-width: 768px) {
  .hero-section {
    aspect-ratio: 1672 / 941;
    margin:
      0
      0
      32px;
    border-radius: 0;
  }

  .hero-overlay {
    padding: 24px 16px;
  }

  .hero-title {
    font-size: clamp(1.6rem, 8vw, 2.4rem);
  }
}

/* Home — Animación por letras del título del HERO
   ============================================================ */

.hero-overlay .hero-title {
  font-kerning: none;
}

/* El degradado pasa temporalmente a las letras individuales. */
.hero-overlay .hero-title.is-letter-animated {
  background-image: none;
  color: var(--cta-primary);
  -webkit-text-fill-color: var(--cta-primary);
}

.hero-overlay .hero-title .hero-word {
  display: inline-block;
  white-space: nowrap;
  overflow: visible;
}

.hero-overlay .hero-title .hero-letter {
  display: inline-block;
  line-height: inherit;

  /* Espacio para acentos y trazos inclinados de Bangers. */
  padding: 0.1em 0.14em;
  margin: -0.1em -0.14em;

  color: var(--cta-primary);
  -webkit-text-fill-color: var(--cta-primary);

  background-repeat: no-repeat;
  background-clip: text;
  -webkit-background-clip: text;

  text-shadow: none;
}