
/* ===== styles/palette.css ===== */
/* ============================================================
   palette.css — identidad visual Balanced
   ============================================================ */

:root {
  /* Fondos
     ========================================================== */

  --bg-primary: #062b20;
  --bg-secondary: #0a3528;

  /* Atmósfera
     ========================================================== */

  --smoke-black-rgb: 0, 0, 0;
  --smoke-deep-rgb: 6, 10, 8;
  --smoke-green-black-rgb: 3, 24, 17;

  /* Divisores
     ========================================================== */

  --divider: #ffe600;
  --divider-rgb: 255, 230, 0;

  --divider-glow: #fff6a3;
  --divider-glow-rgb: 255, 246, 163;

  /* Botones y CTAs
     ========================================================== */

  --cta-primary: #ffe600;
  --cta-primary-rgb: 255, 230, 0;
  --cta-primary-text: #062b20;

  --cta-secondary: #f3f1e8;
  --cta-secondary-rgb: 243, 241, 232;
  --cta-secondary-text: #062b20;

  /* Iconos
     ========================================================== */

  --icon-primary: #ffe600;

  /* Estados hover
     ========================================================== */

  --hover-primary: #f3e96b;
  --hover-secondary: #d4d8d2;

  /* Tipografía
     ========================================================== */

  --text-h1: #f3f1e8;
  --text-h2: #e8f0e9;
  --text-h3: #d4d8d2;

  --text-body: #fbfbf8;
  --text-muted: #7f9187;
  --text-caption: #91a399;

  /* Acentos decorativos
     ========================================================== */

  --accent-primary: #f3e96b;
  --accent-primary-rgb: 243, 233, 107;

  --accent-secondary: #7f9187;

  --accent-display-green: #6fd6a8;
  --accent-display-green-rgb: 111, 214, 168;

  /* Degradado compartido por títulos e iconos destacados.
     ========================================================== */

  --display-text-gradient:
    linear-gradient(
      100deg,
      var(--accent-display-green) 0%,
      var(--accent-display-green) 15%,
      var(--accent-primary) 45%,
      var(--cta-primary) 100%
    );

  /* Superficies
     ========================================================== */

  --surface-card: #0d3227;
  --surface-elevated: #124234;
  --surface-deep: #08281e;

  --border-subtle: #1a4a3a;
  --border-emphasis: #2b6550;

  /* Formularios
     ========================================================== */

  --form-background: #0d3227;
  --form-border: #1a4a3a;
  --form-focus: #ffe600;

  /* Estados funcionales
     Estos colores conservan su significado en toda la aplicación.
     ========================================================== */

  --state-error: #a53a3a;
  --state-error-emphasis: #d4574f;
  --danger: #c0392b;

  --state-success: #55b887;
  --state-warning: #e8bd57;
  --state-disabled: #6e7f75;

  /* Sombras y overlays neutrales
     ========================================================== */

  --shadow-color-rgb: 0, 0, 0;
}


/* ===== styles/base.css ===== */
/* ============================================================
   base.css — reset, tipografía y estilos globales
   ============================================================ */

/* Fuentes locales
   ============================================================ */

@font-face {
  font-family: 'Bangers';
  src:
    url('../../assets/fonts/bangers/bangers-regular.ttf')
    format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Nunito Sans';
  src:
    url('../../assets/fonts/nunito-sans/nunito-sans-variable.ttf')
    format('truetype');
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
}

@font-face {
  font-family: 'Nunito Sans';
  src:
    url('../../assets/fonts/nunito-sans/nunito-sans-italic-variable.ttf')
    format('truetype');
  font-style: italic;
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  /* Tipografías
     ========================================================== */

  --font-display:
    'Bangers',
    Impact,
    Haettenschweiler,
    'Arial Narrow Bold',
    sans-serif;

  --font-body:
    'Nunito Sans',
    system-ui,
    -apple-system,
    'Segoe UI',
    Arial,
    sans-serif;

  /* Geometría
     ========================================================== */

  --radius-sm: 6px;
  --radius-md: 12px;

  /* Sombras estructurales
     El color se obtiene desde palette.css.
     ========================================================== */

  --shadow-panel:
    0 10px 30px
    rgba(var(--shadow-color-rgb), 0.45);

  /* capas globales de la página, de abajo hacia arriba.
     los z-index chicos (0 a 60) son locales a cada componente
     y no se nombran.
     ========================================================== */

  --z-header: 500;
  --z-back-to-top: 900;
  --z-sidebar: 1000;
  --z-lightbox: 3000;
  --z-modal: 3100;
}

/* Reset global
   ============================================================ */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background-color: var(--bg-primary);
  color: var(--text-body);
  font-family: var(--font-body);
}

/*
 * Blindaje del atributo [hidden]: cualquier componente que le agregue su
 * propio "display" a un elemento (ej: .story-reader-settings-panel con
 * display:flex) puede sin querer pisar la regla por defecto del navegador
 * que hace [hidden] { display: none }, porque tienen la misma
 * especificidad y la del componente suele venir despues en la cascada.
 * Con !important acá, [hidden] siempre gana, sin importar qué display le
 * pongas a la clase.
 */
[hidden] {
  display: none !important;
}

/* Elementos multimedia
   ============================================================ */

img {
  display: block;
  max-width: 100%;
}

/* Enlaces
   ============================================================ */

a {
  color: inherit;
}

/* Encabezados
   ============================================================ */

h1,
h2,
h3 {
  margin: 0 0 0.4em;
  font-family: var(--font-display);
  letter-spacing: 0.5px;
  line-height: 1.05;
}

h1 {
  color: var(--text-h1);
}

h2 {
  color: var(--text-h2);
}

h3 {
  color: var(--text-h3);
}

/* Accesibilidad: movimiento reducido
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Accesibilidad: foco visible
   ============================================================ */

a:focus-visible,
button:focus-visible,
img:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--form-focus);
  outline-offset: 2px;
}


/* ===== styles/layout.css ===== */
/* ============================================================
   layout.css — estructura general de la pagina
   ============================================================ */

/* IMPORTANTE: el sticky va en el CONTENEDOR (#header-outlet), no en
   .site-header. Si el padre mide lo mismo que el hijo, sticky no tiene
   margen para "pegarse" y no hace nada (ver bug que encontramos). */
#header-outlet {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
}

.site-header {
  display: grid;
  grid-template-columns:
    minmax(130px, 1fr)
    auto
    minmax(110px, 1fr);
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
  min-height: 76px;
  padding: 12px clamp(16px, 3vw, 36px);

  background-color: var(--bg-primary);
  background-image: url("../../assets/backgrounds/header-bg.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;

  border-bottom: 3px solid var(--divider);
  color: var(--text-body);
}

.mobile-menu-toggle {
  display: none;
}

.site-logo {
  justify-self: start;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: clamp(130px, 12vw, 170px);
  height: 52px;
  overflow: hidden;
  color: var(--accent-primary);
  text-decoration: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.site-logo:focus-visible {
  outline: 3px solid var(--form-focus);
  outline-offset: 3px;
}

.site-logo:hover {
  opacity: 0.85;
  transform: translateY(-2px);
}

.site-logo-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left center;
}

.header-nav {
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  margin: 0;
}

.header-nav a {
  --nav-button-surface: rgba(var(--smoke-green-black-rgb), 0.76);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 5px 12px;
  background: var(--nav-button-surface);
  border: 2px solid rgba(var(--accent-display-green-rgb), 0.32);
  border-radius: var(--radius-sm);
  color: var(--text-body);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease;
}

.header-nav a span {
  display: inline-block;
  padding-block: 0.1em 0.04em;
  padding-inline: 0.03em 0.14em;
  color: var(--text-body);
  -webkit-text-fill-color: var(--text-body);
}

.header-nav a:hover,
.header-nav a:focus-visible {
  border-color: var(--accent-primary);
}

@supports ((mask-composite: exclude) or (-webkit-mask-composite: xor)) {
  .header-nav a::before {
    content: '';
    position: absolute;
    inset: -2px;
    border: 2px solid transparent;
    border-radius: inherit;
    background: var(--display-text-gradient) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
  }

  .header-nav a:hover,
  .header-nav a:focus-visible {
    border-color: transparent;
  }

  .header-nav a:hover::before,
  .header-nav a:focus-visible::before {
    opacity: 1;
  }
}

.header-nav a:hover span,
.header-nav a:focus-visible span {
  color: var(--accent-primary);
  -webkit-text-fill-color: var(--accent-primary);
}

@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .header-nav a:hover span,
  .header-nav a:focus-visible span {
    background-image: var(--display-text-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
}

.header-nav a:focus-visible {
  outline: 2px solid var(--form-focus);
  outline-offset: 2px;
}

@media (max-width: 1050px) {
  .site-header {
    grid-template-columns: minmax(130px, 1fr) auto;
    grid-template-areas:
      "logo tools"
      "navigation navigation";
    row-gap: 10px;
    min-height: 124px;
  }

  .site-logo {
    grid-area: logo;
  }

  .header-nav {
    grid-area: navigation;
    width: 100%;
  }

  .header-tools {
    grid-area: tools;
  }
}

.header-tools {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
}

.language-picker {
  position: relative;
  flex: 0 0 auto;
}

.language-picker-trigger {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 44px;
  min-height: 50px;
  padding: 5px 7px;
  background: rgba(255, 255, 255, 0.04);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(2px);
  border-radius: 10px;
  color: var(--text-h1);
  cursor: pointer;
  list-style: none;
  box-shadow: 0 6px 12px rgba(var(--smoke-black-rgb), 1.34);
}

.language-picker-trigger::-webkit-details-marker {
  display: none;
}

.language-picker-trigger:focus-visible {
  outline: 3px solid var(--form-focus);
  outline-offset: 2px;
}

.language-picker-icon {
  display: block;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: contain;
}

@media (min-width: 1051px) {
  .language-picker {
    transform: translateY(4px);
  }
}

.language-picker-current {
  display: inline-block;
  padding: 1px 4px;
  background: var(--cta-primary);
  border-radius: 4px;
  color: var(--cta-primary-text);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.language-picker-options {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  display: grid;
  gap: 4px;
  min-width: 86px;
  padding: 6px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-panel);
}

.language-picker:not([open]) .language-picker-options {
  display: none;
}

.language-picker-option {
  min-height: 36px;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-h1);
  font-family: var(--font-body);
  font-weight: 700;
  cursor: pointer;
}

.language-picker-option:hover,
.language-picker-option:focus-visible {
  border-color: var(--hover-primary);
}

.language-picker-option.is-active {
  background: var(--cta-primary);
  border-color: var(--cta-primary);
  color: var(--cta-primary-text);
}

.app-body {
  --aside-width: 220px;
  --aside-gap: clamp(1.5rem, 3vw, 3rem);

  display: grid;
  grid-template-columns:
    minmax(0, 1100px)
    var(--aside-width);
  align-items: start;
  justify-content: center;
  gap: var(--aside-gap);
  width: 100%;
  padding:
    0
    clamp(1rem, 3vw, 3rem)
    clamp(3rem, 6vw, 5rem);
  background-image:
    linear-gradient(
      90deg,
      rgba(var(--smoke-black-rgb), 0.86) 0%,
      rgba(var(--smoke-deep-rgb), 0.62) 13%,
      rgba(var(--smoke-green-black-rgb), 0.22) 27%,
      transparent 40%,
      transparent 60%,
      rgba(var(--smoke-green-black-rgb), 0.22) 73%,
      rgba(var(--smoke-deep-rgb), 0.62) 87%,
      rgba(var(--smoke-black-rgb), 0.86) 100%
    ),
    url('../../assets/decorations/pre-footer.png');
  background-position: center, center bottom;
  background-repeat: no-repeat, no-repeat;
  background-size: 100% 100%, 100% auto;
}

.sidebar {
  position: fixed;
  top: 76px;
  bottom: 0;
  left: 0;
  z-index: var(--z-sidebar);
  width: 190px;
  flex-shrink: 0;
  background-color: var(--bg-secondary);
  background-image:
    linear-gradient(
    rgba(var(--smoke-green-black-rgb), 0.10),
    rgba(var(--smoke-green-black-rgb), 0.10)
    ),
    url('../../assets/backgrounds/sidebar-bg.jpg');
  background-position: center top;
  background-repeat: no-repeat;
  background-size: cover;
  border-top: 3px solid var(--border-subtle);
  border-right: 3px solid var(--border-subtle);
  transform: translateX(-100%);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.sidebar-scroll {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
}

.sidebar.open {
  transform: translateX(0);
  box-shadow:
    var(--shadow-panel),
    inset -8px 0 12px -8px rgba(var(--divider-rgb), 0.28);
}

.sidebar-blade-edge {
  position: absolute;
  top: 0;
  right: -3px;
  bottom: 0;
  z-index: 2;
  width: 3px;
  background: var(--accent-primary);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.sidebar.open .sidebar-blade-edge {
  opacity: 1;
}

.sidebar-close-flap {
  position: absolute;
  top: 20px;
  left: calc(100% + 3px);
  right: auto;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 64px;
  padding: 0;
  background-color: var(--surface-card);
  border: 2px solid var(--accent-primary);
  border-left: none;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  transform: none;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    width 0.2s ease;
}

.sidebar-flap-icon {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
  pointer-events: none;
  transition: transform 0.2s ease;
}

.sidebar-close-flap:hover {
  width: 52px;
  background-color: var(--surface-elevated);
}

.sidebar-close-flap:hover .sidebar-flap-icon {
  transform: scale(1.08);
}

.sidebar-close-flap:focus-visible {
  outline: 3px solid var(--form-focus);
  outline-offset: 3px;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

.sidebar a {
  color: var(--text-h1);
  text-decoration: none;
  display: block;
  padding: 12px 18px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  letter-spacing: 0.5px;
  border-left: 3px solid transparent;
}

.sidebar a:hover {
  background-color: var(--surface-elevated);
  color: var(--hover-primary);
}

.sidebar a.is-active {
  color: var(--accent-primary);
  border-left-color: var(--accent-primary);
  background-color: var(--surface-elevated);
}

.sidebar-language-switcher {
  display: none;
}

main.content {
  width: 100%;
  min-width: 0;
  max-width: 1100px;
  margin: 0;
  padding: 32px clamp(16px, 4vw, 48px);
}

/*
 * Header y sidebar responsive
 * ============================================================
 */

/* Tablets horizontales: header distribuido en dos filas */
@media (min-width: 901px) and (max-width: 1050px) {
  .sidebar {
    top: 124px;
  }
}

/* Tablets verticales y teléfonos */
@media (max-width: 900px) {

  .site-header {
    grid-template-columns: 72px minmax(0, 1fr) 72px;
    grid-template-areas: "menu logo tools";
    align-items: center;
    gap: 8px;
    min-height: 72px;
    padding: 10px 12px;
  }

  .mobile-menu-toggle {
    display: flex;
    grid-area: menu;
    align-items: center;
    justify-content: center;
    justify-self: start;
    width: 40px;
    height: 40px;
    padding: 0;
    background: var(--surface-deep);
    border: 2px solid var(--cta-primary);
    border-radius: var(--radius-sm);
    color: var(--icon-primary);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
  }

  .mobile-menu-toggle:hover {
    border-color: var(--hover-primary);
    color: var(--hover-primary);
  }

  .mobile-menu-toggle[aria-expanded="true"],
  .mobile-menu-toggle[aria-expanded="true"]:hover {
    background: var(--surface-deep);
    border-color: var(--border-emphasis);
    color: var(--text-h1);
  }

  .sidebar-close-flap {
    display: none;
  }
  /*
   * La navegación principal se oculta porque estas opciones
   * ya están disponibles en el sidebar.
   */
  .header-nav {
    display: none;
  }

  .site-logo {
    grid-area: logo;
    justify-self: center;
    width: min(140px, 36vw);
    height: 48px;
  }

  .site-logo-image {
    object-position: center;
  }

  .header-tools {
    grid-area: tools;
    justify-self: end;
    gap: 8px;
  }

  .header-tools .language-picker {
    display: none;
  }

  .sidebar-language-switcher {
    display: grid;
    gap: 6px;
    padding: 4px 18px 12px;
    border-bottom: 1px solid var(--border-subtle);
  }

  .sidebar-language-label {
    color: var(--text-h1);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 700;
  }

  .sidebar-language-options {
    display: flex;
    gap: 6px;
  }

  .sidebar-language-option {
    flex: 0 0 64px;
    min-height: 40px;
    background: var(--surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-h1);
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
  }

  .sidebar-language-option:hover,
  .sidebar-language-option:focus-visible {
    border-color: var(--hover-primary);
  }

  .sidebar-language-option.is-active {
    background: var(--cta-primary);
    border-color: var(--cta-primary);
    color: var(--cta-primary-text);
  }

  /*
   * El sidebar comienza debajo del nuevo header compacto.
   */
  .sidebar {
    top: 72px;
    width: min(280px, calc(100vw - 44px));
  }

  main.content {
    padding-top: 32px;
  }
}

@media (max-width: 480px) {
  .site-header {
    grid-template-columns: 66px minmax(0, 1fr) 66px;
    padding-inline: 8px;
  }

  .site-header .auth-widget-open-modal {
  margin-top: 0;
  padding: 6px 5px;
  font-size: 0.72rem;
  white-space: nowrap;
}

  .site-logo {
    width: min(120px, 36vw);
    height: 42px;
  }

  .header-tools {
    gap: 6px;
  }
}

/* --- Acordeon del sidebar ("Una Tierra Sin Goku" -> lista de capitulos) --- */
.sidebar-accordion {
  display: flex;
  flex-direction: column;
}

.sidebar-accordion-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  color: var(--text-h1);
  text-decoration: none;
  padding: 12px 18px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  text-align: left;
}

.sidebar-accordion-toggle:hover {
  background-color: var(--surface-elevated);
  color: var(--hover-primary);
}

.sidebar-accordion.is-expanded .sidebar-accordion-toggle {
  color: var(--accent-primary);
  border-left-color: var(--accent-primary);
  background-color: var(--surface-elevated);
}

.sidebar-accordion-arrow {
  transition: transform 0.2s ease;
}

.sidebar-accordion.is-expanded .sidebar-accordion-arrow {
  transform: rotate(90deg);
}

.sidebar-submenu {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}

.sidebar-submenu-inner {
  min-height: 0;
  overflow: hidden;
}

.sidebar-accordion.is-expanded .sidebar-submenu {
  grid-template-rows: 1fr;
}

.sidebar-submenu-viewall,
.sidebar-submenu-link {
  display: block;
  padding: 9px 18px 9px 30px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-body);
  text-decoration: none;
  border-left: 3px solid transparent;
}

.sidebar-submenu-viewall {
  color: var(--accent-primary);
  font-weight: 700;
}

.sidebar-submenu-link:hover,
.sidebar-submenu-viewall:hover {
  background-color: var(--surface-deep);
  color: var(--hover-primary);
}

.sidebar-submenu-link.is-active {
  color: var(--accent-primary);
  border-left-color: var(--accent-primary);
  background-color: var(--surface-deep);
}
/* Contenido complementario
   ========================================================================== */

.complementary-aside {
  position: sticky;
  top: calc(76px + 2rem);
  align-self: start;
  width: var(--aside-width);
  min-width: 0;
}

.complementary-aside-inner {
  width: 100%;
}

.complementary-aside-label {
  margin: 0 0 0.65rem;
  color: var(--text-caption);
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.aside-ad {
  display: block;
  overflow: hidden;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-body);
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.aside-ad:hover,
.aside-ad:focus-visible {
  border-color: var(--cta-primary);
  box-shadow: 0 0 18px rgba(var(--cta-primary-rgb), 0.35);
}

.aside-ad-video {
  display: block;
  width: 100%;
  height: auto;
}

.aside-ad-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  line-height: 1.3;
}

.aside-ad-text strong {
  color: var(--cta-primary);
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.5px;
}

@media (max-width: 1200px) {
  .aside-ad-video {
    max-height: 240px;
    object-fit: cover;
  }
}

/* Pantallas donde no entran cómodamente ambos bloques de contenido */

@media (max-width: 1200px) {
  .app-body {
    grid-template-columns: minmax(0, 1100px);
  }

  .complementary-aside {
    position: static;
    width: min(100%, 728px);
    margin: 0 auto;
    padding:
      0
      clamp(16px, 4vw, 48px)
      2rem;
  }

  .complementary-aside-inner {
    width: 100%;
  }

}

/* Teléfonos */

@media (max-width: 768px) {
  .app-body {
    display: block;
    padding: 0 0 2rem;
    background-image:
      linear-gradient(
        90deg,
        rgba(var(--smoke-black-rgb), 0.58),
        transparent 25%,
        transparent 75%,
        rgba(var(--smoke-black-rgb), 0.58)
      ),
      url('../../assets/decorations/pre-footer.png');
    background-size: 100% 100%, max(100%, 800px) auto;
  }

  .complementary-aside {
    width: 100%;
    padding:
      0
      clamp(16px, 4vw, 48px)
      2rem;
  }

}

/* Botón flotante para volver arriba
   ========================================================================== */

.back-to-top-button {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: var(--z-back-to-top);

  display: flex;
  align-items: center;
  justify-content: center;

  width: 72px;
  height: 72px;
  padding: 0;

  appearance: none;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  box-shadow: none;

  cursor: pointer;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(16px) scale(0.9);

  transition:
    opacity 0.2s ease,
    visibility 0.2s ease,
    transform 0.2s ease;
}

.back-to-top-button.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.back-to-top-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;

  filter:
    drop-shadow(
      0 4px 6px
      rgba(var(--shadow-color-rgb), 0.65)
    );

  transition: filter 0.2s ease;
}

.back-to-top-button:hover .back-to-top-image,
.back-to-top-button:focus-visible .back-to-top-image {
  filter:
    drop-shadow(
      0 4px 6px
      rgba(var(--shadow-color-rgb), 0.65)
    )
    drop-shadow(
      0 0 5px
      rgba(var(--accent-primary-rgb), 0.20)
    );
}

.back-to-top-button:focus-visible {
  outline: 3px solid var(--form-focus);
  outline-offset: 4px;
}

/* Footer
   ========================================================================== */

.site-footer {
  position: relative;
  width: 100%;
  margin-left: 0;
  padding:
    3rem
    clamp(1.25rem, 4vw, 4rem)
    1.5rem;
  background:
    radial-gradient(
      circle at 50% 20%,
      rgba(var(--accent-primary-rgb), 0.1),
      transparent 40%
    ),
    var(--bg-secondary);
  border-top: 3px solid var(--divider);
  color: var(--text-body);
  text-align: center;
}

.site-footer-inner {
  display: grid;
  grid-template-columns:
    minmax(240px, 1.5fr)
    repeat(2, minmax(160px, 1fr));
  align-items: start;
  justify-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  width: min(1200px, 100%);
  margin: 0 auto;
  text-align: center;
}

/* Marca y descripción
   ========================================================================== */

.footer-brand {
  width: 100%;
  text-align: center;
}

.footer-brand h2,
.footer-column h3 {
  margin-top: 0;
  text-align: center;
  color: var(--text-h2);
}

.footer-brand h2 {
  margin-bottom: 1rem;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: 0.04em;
}

.footer-brand p {
  max-width: 52ch;
  margin: 0 auto;
  color: var(--text-body);
  line-height: 1.7;
  text-align: center;
}

/* Columnas
   ========================================================================== */

.footer-column {
  width: 100%;
  text-align: center;
}

.footer-column h3 {
  margin-bottom: 1rem;
  font-size: 1.6rem;
}

/* Navegación
   ========================================================================== */

.footer-links {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: center;
}

.footer-links li {
  width: 100%;
  text-align: center;
}

.footer-links a,
.footer-social-link {
  color: var(--text-body);
  text-decoration: none;
  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

.footer-links a {
  display: inline-block;
}

.footer-links a:hover,
.footer-links a:focus-visible,
.footer-social-link:hover,
.footer-social-link:focus-visible {
  color: var(--hover-primary);
}

/* Redes sociales
   ========================================================================== */

.footer-social-links {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
}

.footer-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.footer-social-link:hover,
.footer-social-link:focus-visible {
  border-color: var(--hover-primary);
}

.footer-social-icon {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* Franja inferior
   ========================================================================== */

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  width: min(1200px, 100%);
  margin: 2.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.8rem;
  text-align: center;
}

.footer-bottom p {
  margin: 0;
  text-align: center;
}

.footer-credit {
  display: block;
  margin-top: 0.35rem;
}

.footer-credit a {
  color: var(--text-h2);
  text-underline-offset: 2px;
}

.footer-credit a:hover,
.footer-credit a:focus-visible {
  color: var(--hover-primary);
}

.footer-legal-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  color: var(--text-caption);
}

.footer-legal-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-h3);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.footer-legal-link:hover,
.footer-legal-link:focus-visible {
  background: var(--surface-elevated);
  border-color: var(--hover-primary);
  color: var(--hover-primary);
  transform: translateY(-2px);
}

/* Tablets
   ========================================================================== */

@media (max-width: 768px) {
  .site-footer {
    padding:
      2.5rem
      clamp(1.25rem, 4vw, 4rem)
      1.5rem;
  }

  .site-footer-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.5rem 2rem;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

/* Teléfonos
   ========================================================================== */

@media (max-width: 520px) {
  .site-footer {
    padding: 2.5rem 1.25rem 1.5rem;
  }

  .site-footer-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .footer-brand {
    grid-column: auto;
  }

  .footer-bottom {
    gap: 1rem;
  }

  .back-to-top-button {
    right: 1rem;
    bottom: 1rem;
    width: 60px;
    height: 60px;
  }
}

/* Accesibilidad: movimiento reducido
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .footer-links a,
  .footer-social-link {
    transition: none;
  }
  .back-to-top-button,
  .back-to-top-image {
    transition: none;
  }

}

@media (min-width: 1051px) {
  :root {
    --header-desktop-height: 96px;
  }

  .site-header {
    min-height: var(--header-desktop-height);
  }

  .sidebar {
    top: var(--header-desktop-height);
  }

  .complementary-aside {
    top: calc(var(--header-desktop-height) + 2rem);
  }
}


/* ===== styles/components/states.css ===== */
/* components/states.css */

/* ============================================================
   components.css — piezas reutilizables (cards, botones, nav)
   ============================================================ */

/* Estados generales
   ============================================================ */

  .loading {
  display: block;
  min-height: 100vh;
  padding-top: 40px;
  color: var(--text-muted);
  font-family: var(--font-body);
}

/* Imagen sin una extensión válida
   ============================================================ */

.img-broken {
  min-height: 120px;
  background:
    repeating-linear-gradient(
      45deg,
      var(--surface-elevated),
      var(--surface-elevated) 10px,
      var(--surface-card) 10px,
      var(--surface-card) 20px
    );
}


/* ===== styles/components/chapter-cards.css ===== */
/* components/chapter-cards.css */

/* Grilla de portadas: Home y capítulos
   ============================================================ */

.portadas {
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(190px, 1fr)
  );
  gap: 22px;
  margin-top: 20px;
}

.portadas .portada-card {
  position: relative;
  display: block;
  overflow: hidden;
  padding: 10px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: inherit;
  text-align: center;
  text-decoration: none;
}

/*
 * Textura de puntos inspirada en una trama de cómic.
 * El color se obtiene del acento principal de Balanced.
 */

.portadas .portada-card::before {
  position: absolute;
  inset: 0;
  content: '';
  background-image:
    radial-gradient(
      rgba(var(--accent-primary-rgb), 0.12) 1px,
      transparent 1px
    );
  background-size: 8px 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.portadas .portada-card:hover::before {
  opacity: 1;
}

.portadas .portada-card img {
  display: block;
  width: 100%;
  border-radius: var(--radius-sm);
  transition: transform 0.25s ease;
  aspect-ratio: 7 / 10;
  object-fit: cover;
  object-position: center top;
}

.portadas .portada-card:hover img {
  transform: scale(1.04);
}

.portadas p {
  margin: 10px 0 2px;
  color: var(--text-caption);
  font-family: var(--font-body);
  font-size: 0.9rem;
}

/* Card de capitulo bloqueado (Patreon)
   ============================================================ */

.chapter-lock-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 7 / 10;
  overflow: hidden;
  background: var(--surface-deep);
  border-radius: var(--radius-sm);
}

.chapter-lock-cover-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: blur(6px) brightness(0.6);
  transform: scale(1.04);
  transition:
    filter 0.25s ease,
    transform 0.25s ease;
}

.chapter-card-locked:hover .chapter-lock-cover-image,
.chapter-card-locked:focus-visible .chapter-lock-cover-image {
  filter: blur(8px) brightness(0.4);
  transform: scale(1.08);
}

.chapter-lock-icon,
.chapter-lock-patreon {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease;
}

.chapter-lock-icon {
  width: clamp(88px, 50%, 145px);
  height: auto;
  max-width: 52%;
  filter: none;
  opacity: 1;
  pointer-events: none;
}

.chapter-lock-patreon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0;
  white-space: nowrap;
}

.portadas .portada-card .chapter-lock-patreon-icon {
  display: block;
  width: 32px;
  height: 32px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  object-position: center;
  border-radius: 4px;
}

.portadas .portada-card:hover .chapter-lock-patreon-icon {
  transform: none;
}

.chapter-lock-patreon-label {
  padding: 6px 16px;
  background: #000000;
  border-radius: 999px;
}

.chapter-card-locked:hover .chapter-lock-icon,
.chapter-card-locked:focus-visible .chapter-lock-icon {
  opacity: 0;
}

.chapter-card-locked:hover .chapter-lock-patreon,
.chapter-card-locked:focus-visible .chapter-lock-patreon {
  opacity: 1;
}

/* En pantallas tactiles, la indicacion de Patreon permanece visible. */
@media (hover: none) {
  .chapter-lock-cover {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
  }

  .chapter-card-locked .chapter-lock-cover-image {
    position: absolute;
    inset: 0;
  }

  .portadas .portada-card .chapter-lock-icon,
  .page-grid .chapter-lock-icon {
    position: relative;
    top: auto;
    left: auto;
    width: min(58%, 120px);
    max-width: none;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    transform: none;
    opacity: 1;
  }

  .portadas .portada-card:hover .chapter-lock-icon,
  .portadas .portada-card:focus-visible .chapter-lock-icon,
  .page-grid .chapter-card-locked:hover .chapter-lock-icon,
  .page-grid .chapter-card-locked:focus-visible .chapter-lock-icon {
    transform: none;
    opacity: 1;
  }

  .portadas .portada-card .chapter-lock-patreon-icon,
  .page-grid .chapter-lock-patreon-icon {
    width: 38px;
    height: 38px;
  }

  .chapter-card-locked .chapter-lock-patreon {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    opacity: 1;
  }

  .chapter-card-locked:hover .chapter-lock-cover-image,
  .chapter-card-locked:focus-visible .chapter-lock-cover-image {
    filter: blur(6px) brightness(0.6);
    transform: scale(1.04);
  }

  .portadas .chapter-card-locked:hover::before {
    opacity: 0;
  }
}

/* Card de capitulo: overlay de Ver/Leer + etiqueta de paginas bloqueadas
   ============================================================ */

.chapter-card-cover {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
}

.chapter-card-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.chapter-card:hover .chapter-card-overlay,
.chapter-card.is-revealed .chapter-card-overlay {
  opacity: 1;
  pointer-events: auto;
}

.chapter-card-action {
  margin-top: 0;
  padding: 8px 18px;
  font-size: 0.8rem;
  white-space: nowrap;
}

.chapter-card-locked-label {
  margin: 2px 0 0;
  font-family: var(--font-body);
  font-size: 0.75rem;
}

.chapter-card-locked-label.is-locked {
  color: var(--state-error);
}

.chapter-card-locked-label.is-unlocked {
  color: var(--state-success);
}

/* Miniaturas bloqueadas dentro de "Ver capitulo"
   ============================================================ */

.page-thumb-locked {
  display: block;
}


/* ===== styles/components/locked-notice.css ===== */
/* components/locked-notice.css */

/* Aviso de capitulo bloqueado (acceso directo por URL)
   ============================================================ */

.locked-chapter-notice {
  max-width: 480px;
  margin: 60px auto;
  padding: 40px 24px;
  text-align: center;
}

.locked-chapter-notice .locked-chapter-icon {
  display: block;
  width: clamp(180px, 34vw, 240px);
  max-width: 100%;
  height: auto;
  margin: 0 auto 16px;
  object-fit: contain;
}

.locked-chapter-notice h2 {
  margin-bottom: 10px;
  color: var(--text-h2);
}

.locked-chapter-notice p {
  margin-bottom: 20px;
  color: var(--text-body);
  font-family: var(--font-body);
}


/* ===== styles/components/buttons.css ===== */
/* components/buttons.css */

/* Botones tipo link
   ============================================================ */

.btn-link {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 20px;
  background: var(--cta-primary);
  border-radius: var(--radius-sm);
  color: var(--cta-primary-text);
  font-family: var(--font-body);
  font-weight: 700;
  text-decoration: none;
  transition:
    background-color 0.15s ease,
    transform 0.15s ease;
}

.btn-link:hover {
  background: var(--hover-primary);
  transform: translateY(-2px);
}

/* Variante luminosa reutilizable para los CTA principales. */
.btn-link--glow {
  background-color: var(--bg-primary);
  border: 1px solid var(--cta-primary);
  color: var(--cta-primary);
  box-shadow:
    inset 0 0 14px rgba(var(--cta-primary-rgb), 0.10),
    0 0 8px rgba(var(--cta-primary-rgb), 0.13);
  transition:
    background-color 0.22s ease,
    color 0.22s ease,
    box-shadow 0.22s ease;
}

.btn-link--glow:hover {
  background-color: var(--bg-primary);
  color: var(--cta-primary);
  transform: none;
  box-shadow:
    inset 0 0 14px rgba(var(--cta-primary-rgb), 0.10),
    0 0 8px rgba(var(--cta-primary-rgb), 0.13);
}

@media (hover: hover) and (pointer: fine) {
  .btn-link--glow:hover {
    background-color: var(--cta-primary);
    color: var(--cta-primary-text);
    box-shadow:
      0 0 8px rgba(var(--cta-primary-rgb), 0.8),
      0 0 22px rgba(var(--cta-primary-rgb), 0.58),
      0 0 42px rgba(var(--cta-primary-rgb), 0.25),
      inset 0 1px 8px rgba(var(--divider-glow-rgb), 0.45);
  }
}

.btn-link--glow:focus-visible {
  background-color: var(--cta-primary);
  color: var(--cta-primary-text);
  transform: none;
  box-shadow:
    0 0 8px rgba(var(--cta-primary-rgb), 0.8),
    0 0 22px rgba(var(--cta-primary-rgb), 0.58),
    0 0 42px rgba(var(--cta-primary-rgb), 0.25),
    inset 0 1px 8px rgba(var(--divider-glow-rgb), 0.45);
  outline: 2px solid var(--divider-glow);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .btn-link--glow {
    transition: none;
  }
}

/* Botón secundario
   ============================================================ */

.btn-link-secondary {
  background: transparent;
  border: 1px solid var(--cta-secondary);
  color: var(--cta-secondary);
  transition:
    background-color 0.22s ease,
    color 0.22s ease,
    box-shadow 0.22s ease;
}

/* sin movimiento: se ilumina en blanco, como el glow amarillo. */
.btn-link-secondary:hover,
.btn-link-secondary:focus-visible {
  background: var(--hover-secondary);
  border-color: var(--hover-secondary);
  color: var(--cta-secondary-text);
  transform: none;
  box-shadow:
    0 0 6px rgba(var(--cta-secondary-rgb), 0.4),
    0 0 16px rgba(var(--cta-secondary-rgb), 0.18);
}


/* ===== styles/components/titles.css ===== */
/* components/titles.css */

/* Títulos principales y secundarios
   ============================================================ */

.content h1,
.content h2,
.site-footer h2,
.comments-section-title {
  display: inline-block;
  max-width: 100%;
  padding-block: 0.1em 0.04em;
  padding-inline: 0.03em 0.14em;
  color: var(--cta-primary);
  -webkit-text-fill-color: var(--cta-primary);
  -webkit-text-stroke: 0;
  line-height: 1.12;
  text-shadow: none;
}

@supports (
  (background-clip: text) or
  (-webkit-background-clip: text)
) {
  .content h1,
  .content h2,
  .site-footer h2,
  .comments-section-title {
    background-image: var(--display-text-gradient);
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
}


/* ===== styles/components/support-welcome.css ===== */
/* Cartel de bienvenida */
html.support-welcome-lock {
  overflow: hidden;
}

.support-welcome-overlay {
  display: none;
}

.support-welcome-overlay.is-open {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
  overflow-y: auto;
  background: rgba(var(--smoke-deep-rgb), 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.support-welcome-panel {
  position: relative;
  width: min(100%, 820px);
  margin-block: auto;
  text-align: center;
}

.support-welcome-art {
  display: grid;
  place-items: center;
  min-height: clamp(180px, 35vh, 330px);
}

.support-welcome-art img {
  display: block;
  width: min(100%, 430px);
  height: auto;
}

.support-welcome-content {
  position: relative;
  padding: 8px 20px 24px;
}

.support-welcome-languages {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.support-welcome-languages button {
  min-width: 44px;
  min-height: 40px;
  border: 1px solid var(--cta-primary);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-body);
  cursor: pointer;
}

.support-welcome-languages button[aria-pressed="true"] {
  background: var(--cta-primary);
  color: var(--cta-primary-text);
}

.support-welcome-title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.1;
  color: var(--cta-primary);
}

@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .support-welcome-title {
    background: var(--display-text-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
}

.support-welcome-intro,
.support-welcome-invite {
  max-width: 620px;
  margin: 0 auto 12px;
  color: var(--text-body);
}

.support-welcome-content > .btn-link {
  margin: 12px 6px 0;
}

.support-welcome-content > [data-support-donate] {
  appearance: none;
  border: 0;
  cursor: pointer;
}

@media (max-width: 640px) {
  .support-welcome-overlay {
    padding: 12px;
  }

  .support-welcome-art {
    min-height: 0;
  }

  .support-welcome-art img {
    width: min(100%, 240px);
  }

  .support-welcome-content {
    padding-inline: 8px;
  }

  .support-welcome-content > .btn-link {
    display: block;
    width: min(100%, 320px);
    margin: 10px auto 0;
  }
}
body.donation-details-lock {
  overflow: hidden;
}

.donation-details-overlay {
  display: none;
}

.donation-details-overlay.is-open {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(var(--smoke-deep-rgb), 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.donation-details-panel {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  align-items: center;
  gap: 28px;
  width: min(100%, 860px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 28px;
  border: 1px solid var(--cta-primary);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-body);
}

.donation-details-art img {
  display: block;
  width: 100%;
  height: auto;
}

.donation-details-content {
  min-width: 0;
  text-align: center;
}

.donation-details-options {
  display: grid;
  gap: 12px;
  margin-block: 24px;
}

.donation-details-option {
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

@media (max-width: 700px) {
  .donation-details-panel {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 20px;
  }

  .donation-details-art img {
    width: min(100%, 144px);
    margin-inline: auto;
  }
}


/* ===== styles/components/pagination.css ===== */
/* components/pagination.css */

/* Paginación del lector
   ============================================================ */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  margin: 36px 0;
  font-size: 2.4rem;
}

.pagination a {
  color: var(--icon-primary);
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
}

.pagination a:hover {
  display: inline-block;
  color: var(--hover-primary);
  transform: scale(1.2);
}

.pagination a.is-disabled {
  color: var(--state-disabled);
  pointer-events: none;
}

.pagination--flanked {
  justify-content: space-between;
  gap: 16px;
}

.pagination-side {
  display: flex;
  align-items: center;
  gap: 26px;
}

.pagination-center {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
}
.pagination--overlay .pagination-center {
  flex: 0 1 auto;
  min-width: 0;
  width: min(100%, 56vh);
  position: relative;
  display: flex;
  justify-content: center;
}

.pagination--overlay .pagination-side {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  gap: 14px;
  z-index: 2;
}

/* Pager numérico para listas extensas
   ============================================================ */

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.pager button {
  min-width: 40px;
  min-height: 40px;
  padding: 0 12px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-body);
  font-family: var(--font-body);
  cursor: pointer;
}

.pager button:hover {
  border-color: var(--hover-primary);
  color: var(--hover-primary);
}

.pager button.is-active {
  background: var(--cta-primary);
  border-color: var(--cta-primary);
  color: var(--cta-primary-text);
}

@media (max-width: 560px) {
  .pager button {
    min-width: 44px;
    min-height: 44px;
  }
}

/* Navegación entre capítulos
   ============================================================ */
/* se usa junto con btn-link btn-link--glow (el botón del home).
   tamaño fijo = el que tenía al pasar el mouse (el .pagination a:hover lo agrandaba 1.2x). */
.chapter-nav-back {
  margin-top: 0;
  font-size: 1.08rem;
  white-space: nowrap;
}

.pagination a.chapter-nav-back {
  color: var(--cta-primary);
  transform: none;
}

/* al rellenarse de amarillo, el texto pasa al verde oscuro (igual que el botón del home). */
.pagination a.chapter-nav-back:hover,
.pagination a.chapter-nav-back:focus-visible {
  color: var(--cta-primary-text);
  transform: none;
}

@media (max-width: 480px) {
  .chapter-nav-back {
    padding: 8px 10px;
    font-size: 0.78rem;
  }
}


/* ===== styles/components/swipe-hint.css ===== */
/* components/swipe-hint.css */

/* Cartel de "hace swipe para leer" (una sola vez, mobile)
   ============================================================ */

.swipe-hint-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
  animation: swipe-hint-fade-in 0.4s ease;
}

.swipe-hint-character {
  display: block;
  width: min(116px, 29vw);
  max-height: 120px;
  object-fit: contain;
}

.swipe-hint-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  max-width: 100%;
}

.swipe-hint-hand {
  display: block;
  width: min(78px, 20vw);
  height: auto;
  object-fit: contain;
  animation: swipe-hand-gesture 2s ease-in-out 0.35s 3;
}

.swipe-hint-text {
  margin: 0;
  width: 100%;
  padding: 0.12em 0.05em;
  color: var(--cta-primary);
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  line-height: 1.2;
  text-align: center;
}

@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .swipe-hint-text {
    background-image: var(--display-text-gradient);
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
}

@keyframes swipe-hint-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes swipe-hand-gesture {
  0%, 100% {
    transform: translateX(0);
  }
  35% {
    transform: translateX(18px);
  }
  70% {
    transform: translateX(-18px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .swipe-hint-overlay,
  .swipe-hint-hand {
    animation: none;
  }
}

@media (min-width: 641px) {
  .swipe-hint-overlay {
    display: none;
  }
}


/* ===== styles/components/links.css ===== */
/* components/links.css */

/* Enlace externo a Amilova y avisos
   ============================================================ */

.amilova-link {
  margin-top: 40px;
  font-family: var(--font-body);
  font-size: 1.2rem;
  text-align: center;
}

.amilova-link a {
  color: var(--accent-primary);
  font-weight: bold;
}

.amilova-link a:hover {
  color: var(--hover-primary);
}

/* Enlace para volver a la vista anterior
   ============================================================ */

.back-link { 
  font-family: var(--font-display);
  font-size: 1.1rem; 
  letter-spacing: .5px; 
}

/* un solo estilo para todos los "← volver…" (incluye el centro legal). */
.back-link a,
.legal-center-link {
  width: fit-content;
  color: var(--accent-primary);
  font-weight: 800;
  font-family: inherit;
  text-decoration: none;
}

.back-link a:hover,
.legal-center-link:hover {
  color: var(--hover-primary);
  text-decoration: underline;
}


/* ===== styles/components/about.css ===== */
/* components/about.css */

/* Sección About
   ============================================================ */

.about-text {
  margin-bottom: 1.1em;
  color: var(--text-body);
  line-height: 1.7;
}

/* Bloque About
   Foto y contenido utilizado en /about y en el Home
   ============================================================ */

.about-block {
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: start;
  gap: 26px;
}

.about-photo {
  width: 100%;
  margin-top: 1rem;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 2px solid var(--accent-primary);
  border-radius: var(--radius-md);
}

@media (max-width: 560px) {
  .about-block {
    grid-template-columns: 1fr;
  }

  .about-photo {
    max-width: 160px;
    margin: 0 auto;
  }
}

.about-links-and-support {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px 24px;
}

#section-about .about-links-and-support {
  max-width: 540px;
  margin-inline: auto;
}

.about-support-action {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

#section-about .about-support-action {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: fit-content;
  max-width: 100%;
  margin: 16px auto 0;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  box-shadow: 0 4px 16px rgba(var(--smoke-black-rgb), 0.24);
}

#section-about .about-support-action::before {
  content: "";
  position: absolute;
  inset: -100%;
  z-index: 0;
  background: conic-gradient(
    var(--accent-display-green) 0deg,
    var(--accent-primary) 120deg,
    var(--cta-primary) 240deg,
    var(--accent-display-green) 360deg
  );
  animation: donation-border-spin 6s linear infinite;
  pointer-events: none;
}

#section-about .about-support-action::after {
  content: "";
  position: absolute;
  inset: 4px;
  z-index: 1;
  border-radius: calc(var(--radius-md) - 4px);
  background: var(--bg-primary);
  pointer-events: none;
}

#section-about .about-support-action > * {
  position: relative;
  z-index: 2;
}

@keyframes donation-border-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  #section-about .about-support-action::before {
    animation: none;
  }
}

.about-support-image {
  display: block;
  width: 80px;
  height: 120px;
  flex: 0 0 80px;
  object-fit: contain;
}

.about-support-trigger {
  margin-top: 0;
  cursor: pointer;
}

@media (max-width: 560px) {
  .about-support-action {
    justify-content: center;
  }

  .about-support-image {
    width: 64px;
    height: 96px;
    flex-basis: 64px;
  }
}


/* ===== styles/components/social.css ===== */
/* components/social.css */

/* Redes sociales
   ============================================================ */

.social-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 540px;
  margin-top: 30px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  gap: 8px;
  padding: 10px 18px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-h3);
  font-family: var(--font-body);
  font-size: 0.9rem;
  text-decoration: none;
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.social-link:hover {
  border-color: var(--hover-primary);
  color: var(--hover-primary);
  transform: translateY(-2px);
}

.social-icon {
  display: block;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  object-fit: contain;
}

.social-icon[src$="patreon-icon.png"],
.footer-social-icon[src$="patreon-icon.png"] {
  border-radius: 4px;
}

@media (max-width: 560px) {
  .social-link {
    flex-direction: column;
    gap: 4px;
    padding: 8px 4px;
    font-size: 0.8rem;
    text-align: center;
  }
}


/* ===== styles/components/page-grid.css ===== */
/* components/page-grid.css */

/* Grilla de páginas dentro de un capítulo
   ============================================================ */

.page-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(130px, 1fr)
  );
  gap: 14px;
  margin-top: 20px;
}

.page-thumb {
  overflow: hidden;
  padding: 0;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}

.page-thumb:hover {
  border-color: var(--hover-primary);
  transform: translateY(-2px);
}

.page-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 7 / 10;
  object-fit: contain;
}


/* ===== styles/components/lightbox.css ===== */
/* components/lightbox.css */

/* Lightbox
   ============================================================ */

body.lightbox-lock {
  overflow: hidden;
}

.lightbox-overlay {
  display: none;
}

.lightbox-overlay.is-open {
  position: fixed;
  inset: 0;
  z-index: var(--z-lightbox);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    rgba(var(--smoke-deep-rgb), 0.93);
}

.lightbox-body {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 10px;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-page {
  position: relative;
  max-width: 90vw;
  max-height: 82vh;
}

.lightbox-page > img {
  display: block;
  max-width: 90vw;
  max-height: 82vh;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-panel);
}

.lightbox-counter {
  margin: 0;
  color: var(--cta-primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
}

.lightbox-continuation {
  margin: 0;
  color: var(--text-body);
  font-size: 0.85rem;
  line-height: 1.3;
  text-align: center;
}

.lightbox-continuation--next {
  color: var(--accent-display-green);
}

/* Botón para cerrar el lightbox
   ============================================================ */

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 6;
  padding: 0;
  background: none;
  border: none;
  color: var(--text-h1);
  font-size: 1.6rem;
  cursor: pointer;
  transition:
    color 0.15s ease,
    transform 0.15s ease;
}

.lightbox-close:hover {
  color: var(--hover-primary);
  transform: scale(1.1);
}

@media (max-width: 640px) {
  .lightbox-overlay.is-open {
    display: grid;
    grid-template-columns: minmax(48px, 1fr) auto minmax(48px, 1fr);
    grid-auto-rows: max-content;
    align-content: center;
    gap: 8px;
    padding: 12px;
  }

  .lightbox-body {
    display: contents;
  }

  .lightbox-page {
    order: 1;
    grid-column: 1 / -1;
    justify-self: center;
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 120px);
  }

  .lightbox-page > img {
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 120px);
  }

  .lightbox-navigation-hint {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 100%;
    padding: clamp(12px, 5vw, 24px);
    background: rgba(var(--smoke-black-rgb), 0.55);
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
  }

  .lightbox-navigation-hint-reader {
    display: block;
    width: min(116px, 29vw);
    max-height: 120px;
    object-fit: contain;
  }

  .lightbox-navigation-hint-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
  }

  .lightbox-navigation-hint .swipe-hint-text {
    display: block;
    font-size: clamp(1.6rem, 6vw, 2.2rem);
  }

  .lightbox-navigation-hint-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
  }

  .lightbox-navigation-hint-icons img {
    width: clamp(32px, 10vw, 44px);
    height: clamp(32px, 10vw, 44px);
    object-fit: contain;
  }

  .lightbox-arrow-prev {
    order: 2;
    grid-column: 1;
    justify-self: start;
  }

  .lightbox-counter {
    order: 3;
    grid-column: 2;
    align-self: center;
  }

  .lightbox-continuation {
    order: 5;
    grid-column: 1 / -1;
    justify-self: center;
    max-width: calc(100vw - 24px);
  }

  .lightbox-arrow-next {
    order: 4;
    grid-column: 3;
    justify-self: end;
  }
}



/* ===== styles/components/tabs-sort.css ===== */
/* components/tabs-sort.css */

/* Pestañas de cuentos y Orden asc y desc
   ============================================================ */

.tab-group {
  display: flex;
  gap: 10px;
  margin: 18px 0 6px;
}

.tab-button {
  padding: 8px 18px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.tab-button:hover {
  border-color: var(--hover-primary);
  color: var(--hover-primary);
}

.tab-button.is-active {
  background: var(--cta-primary);
  border-color: var(--cta-primary);
  color: var(--cta-primary-text);
  font-weight: 700;
}

.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Título y controles de la lista de capítulos
   ============================================================ */

.chapter-list-heading {
  margin: 0;
  font-size: clamp(1.4rem, 2.2vw, 1.7rem);
}

.chapter-list-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chapter-list-controls .pager {
  margin-top: 0;
  flex-wrap: nowrap;
}

.chapter-list-controls .filter-menu-toggle {
  min-height: 40px;
}

@media (max-width: 560px) {
  .section-heading-row {
    flex-wrap: wrap;
  }

  .chapter-list-controls {
    width: 100%;
    justify-content: space-between;
  }

  .chapter-list-controls .filter-menu-toggle {
    min-height: 44px;
  }
}

.section-heading-row {
  scroll-margin-top: calc(72px + 1rem);
}

@media (min-width: 901px) and (max-width: 1050px) {
  .section-heading-row {
    scroll-margin-top: calc(124px + 1rem);
  }
}

@media (min-width: 1051px) {
  .section-heading-row {
    scroll-margin-top: calc(var(--header-desktop-height) + 1rem);
  }
}

.sort-toggle-btn {
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--icon-primary);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.sort-toggle-btn:hover {
  border-color: var(--hover-primary);
  color: var(--hover-primary);
  transform: scale(1.1);
}

.sort-toggle-btn.is-desc {
  color: var(--accent-secondary);
  transform: scaleY(-1);
}

.sort-toggle-btn.is-desc:hover {
  border-color: var(--hover-primary);
  color: var(--hover-primary);
  transform: scaleY(-1) scale(1.1);
}

/* Variante con texto del botón de ordenar (.sort-toggle-btn) */
.sort-toggle-btn.has-label {
  padding: 6px 14px;
  font-family: var(--font-body);
  font-size: 0.85rem;
}

/* ============================================================
   Menú de filtros de capítulos (ChapterFilterMenuView)
   ============================================================ */

.filter-menu {
  position: relative;
}

.filter-menu-toggle {
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-body);
  font: 0.85rem var(--font-body);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    color 0.15s ease;
}

.filter-menu-toggle::after {
  content: '▾';
  display: inline-block;
  margin-left: 8px;
  transition: transform 0.15s ease;
}

.filter-menu.is-open .filter-menu-toggle::after {
  transform: rotate(180deg);
}

.filter-menu-toggle:hover,
.filter-menu.is-open .filter-menu-toggle {
  border-color: var(--hover-primary);
  color: var(--hover-primary);
}

.filter-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(340px, 90vw);
  padding: 16px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-panel);
}

.filter-menu-panel[hidden] {
  display: none;
}

.filter-menu-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-menu-label {
  color: var(--text-body);
  font: 0.75rem var(--font-body);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.8;
}

.filter-segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-segmented-btn,
.filter-menu-clear {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-body);
  font: 0.85rem var(--font-body);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    color 0.15s ease;
}

.filter-segmented-btn:hover:not(:disabled),
.filter-menu-clear:hover:not(:disabled) {
  border-color: var(--hover-primary);
  color: var(--hover-primary);
}

.filter-segmented-btn.is-active {
  border-color: var(--accent-secondary);
  color: var(--accent-secondary);
}

.filter-segmented-btn:disabled,
.filter-menu-clear:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.filter-menu-select {
  width: 100%;
  padding: 7px 8px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-body);
  font: 0.85rem var(--font-body);
}

.filter-menu-select:hover {
  border-color: var(--hover-primary);
}

.filter-menu-toggle:focus-visible,
.filter-segmented-btn:focus-visible,
.filter-menu-clear:focus-visible,
.filter-menu-select:focus-visible {
  outline: 2px solid var(--hover-primary);
  outline-offset: 2px;
}

.filter-menu-clear {
  align-self: flex-start;
}

/* Sin resultados con los filtros activos */
.chapter-list-empty {
  grid-column: 1 / -1;
  padding: 24px 0;
  color: var(--text-body);
  text-align: center;
  opacity: 0.8;
}

/* Capítulo marcado desde "Ir a capítulo" */
.portada-card.is-highlighted {
  border-radius: var(--radius-md);
  outline: 3px solid var(--accent-secondary);
  outline-offset: 4px;
  animation: chapter-highlight-pulse 0.9s ease-in-out 2;
}

@keyframes chapter-highlight-pulse {
  50% {
    outline-color: var(--hover-primary);
  }
}

@media (prefers-reduced-motion: reduce) {
  .portada-card.is-highlighted {
    animation: none;
  }
}

/* En celular el panel ocupa el ancho de la fila del título */
@media (max-width: 560px) {
  .section-heading-row {
    position: relative;
  }

  .filter-menu {
    position: static;
  }

  .filter-menu-panel {
    left: 0;
    right: 0;
    width: auto;
  }
}


/* ===== styles/components/site-cards.css ===== */
/* components/site-cards.css */

/* Cards de sitios recomendados
   ============================================================ */

.site-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(220px, 1fr)
  );
  gap: 16px;
  margin-top: 18px;
}

.site-card {
  display: block;
  padding: 16px 18px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition:
    border-color 0.15s ease,
    transform 0.15s ease;
}

.site-card:hover {
  border-color: var(--hover-primary);
  transform: translateY(-2px);
}

.site-card-name {
  margin: 0 0 6px;
  color: var(--accent-primary);
  font-family: var(--font-body);
  font-weight: 700;
}

.site-card-desc {
  margin: 0;
  color: var(--text-body);
  font-size: 0.88rem;
  line-height: 1.5;
}

.site-card-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 10px;
  background: var(--border-subtle);
  border-radius: 999px;
  color: var(--text-caption);
  font-size: 0.7rem;
  text-transform: uppercase;
}

/* Tarjeta "Proximamente": mismo aspecto, pero sin comportamiento de link */
.site-card-soon {
  opacity: 0.7;
  cursor: default;
}

.site-card-soon:hover {
  border-color: var(--border-subtle);
  transform: none;
}


/* ===== styles/components/comments.css ===== */
/* components/comments.css */

/* Discusión y comentarios del foro
   ============================================================ */

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
  padding: 0;
  list-style: none;
}

.comment-item {
  padding: 12px 16px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.comment-author {
  margin: 0 0 4px;
  color: var(--accent-primary);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
}

.comment-text {
  margin: 0;
  color: var(--text-body);
  line-height: 1.5;
  white-space: pre-wrap;
}

.comments-empty {
  color: var(--text-muted);
  font-style: italic;
}

/* Formulario de comentarios
   ============================================================ */

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 500px;
}

.comment-form input,
.comment-form textarea {
  padding: 10px 12px;
  background: var(--form-background);
  border: 1px solid var(--form-border);
  border-radius: var(--radius-sm);
  color: var(--text-h1);
  font-family: var(--font-body);
  resize: vertical;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.comment-form input::placeholder,
.comment-form textarea::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--form-focus);
  box-shadow:
    0 0 0 1px
    rgba(var(--cta-primary-rgb), 0.2);
}

.comment-form button {
  align-self: flex-start;
  border: none;
  cursor: pointer;
}

.comment-post-language {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--text-body);
  font: 0.85rem var(--font-body);
}

.comment-post-language > span {
  flex: 1 1 230px;
}

.comment-post-language .filter-menu-select {
  flex: 0 0 auto;
  width: 112px;
  min-height: 36px;
}

.comments-login-prompt {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.85rem;
}

/* Borrar comentario (solo admin)
   ============================================================ */

.comment-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  background: var(--accent-primary);
  border: none;
  border-radius: 4px;
  color: var(--cta-primary-text);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.comment-delete-btn:hover {
  transform: scale(1.08);
}

/* Comentario borrado
   ============================================================ */

.comment-item-deleted {
  opacity: 0.7;
}

.comment-text-deleted {
  color: var(--text-muted);
  font-style: italic;
}

/* Avatar en comentarios
   ============================================================ */

.comment-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-item-header .comment-author {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* aire entre la cabecera (con los botones de moderación) y el texto recortado */
.comment-main > .comment-item-header + .clamp {
  margin-top: 4px;
}

.comment-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.comment-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.comment-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cta-primary);
  color: var(--cta-primary-text);
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
}

/* Fecha en comentarios
   ============================================================ */

.comment-date {
  color: var(--text-muted);
  font-size: 0.7rem;
  white-space: nowrap;
}

.recent-comments-title {
  margin: 4px 0 12px;
  color: var(--text-caption);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
}

/* Respuestas a comentarios
   ============================================================ */

.comment-item-actions {
  display: flex;
  margin-top: 4px;
}

.comment-reply-btn,
.comment-report-btn {
  padding: 5;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.75rem;
  cursor: pointer;
  text-decoration: underline;
}

.comment-report-done {
  color: var(--text-caption);
  font-family: var(--font-body);
  font-size: 0.75rem;
}

.comment-report-btn,
.comment-report-done {
  margin-left: auto;
  margin-right: 12px;
}

/* Comentario destacado (viene de una denuncia: ?comment=ID) */
.comment-item.is-highlighted > .comment-body {
  animation: comment-highlight 3.5s ease-out;
}

@keyframes comment-highlight {
  0%,
  60% {
    box-shadow:
      0 0 0 2px var(--cta-primary),
      0 0 18px rgba(var(--cta-primary-rgb), 0.45);
  }
  100% {
    box-shadow:
      0 0 0 2px transparent,
      0 0 0 transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .comment-item.is-highlighted > .comment-body {
    animation: none;
    box-shadow: 0 0 0 2px var(--cta-primary);
  }
}

.comment-reply-btn:hover {
  color: var(--hover-primary);
}

.comment-replies {
  margin: 8px 0 0 32px;
  padding: 0;
  list-style: none;
  border-left: 2px solid var(--border-subtle);
}

.comment-item-reply {
  padding-left: 12px;
}

.comment-reply-form {
  margin-top: 8px;
}

/* Me gusta en comentarios
   ============================================================ */

.comment-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
}

.comment-like-btn.is-liked {
  color: var(--accent-primary);
}

.comment-like-count {
  font-family: var(--font-body);
}

/* Filtro de idioma de comentarios */
.comments-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 0 0 12px;
}

/* El selector del header baja 4px en desktop; acá va a ras */
.comments-toolbar .language-picker {
  transform: none;
}

/* los dos controles de la barra (orden e idioma) miden lo mismo: 58 x 32 px */
.comments-toolbar .sort-toggle-btn,
.comments-toolbar .language-picker-trigger {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  min-width: 58px;
  height: 32px;
  min-height: 32px;
  padding: 0;
}

.comments-toolbar .language-picker-trigger {
  flex-direction: row;
  gap: 6px;
}

/* acá el filtro muestra solo texto; el selector del header conserva su planeta */
.comments-toolbar .language-picker-icon {
  display: none;
}

.comment-replies-bar {
  list-style: none;
  margin: -4px 0 0 32px;
}

.comment-replies-toggle,
.clamp-more {
  padding: 0;
  background: none;
  border: none;
  color: var(--cta-primary);
  font-family: var(--font-body);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
}

.comment-replies-toggle:hover,
.clamp-more:hover {
  color: var(--hover-primary);
}

.comments-more {
  display: flex;
  justify-content: center;
  margin: 0 0 16px;
}

.comment-lang-badge {
  padding: 1px 6px;
  border: 1px solid var(--text-caption);
  border-radius: var(--radius-sm);
  color: var(--text-caption);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* Moderación de comentarios (solo admin) y aviso de cuenta baneada
   ============================================================ */

.comment-banned-badge {
  padding: 1px 6px;
  border: 1px solid var(--state-error-emphasis);
  border-radius: 4px;
  color: var(--state-error-emphasis);
  font-family: var(--font-body);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.comment-ban-btn {
  padding: 2px 8px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.68rem;
  white-space: nowrap;
  cursor: pointer;
}

.comment-ban-btn:hover {
  border-color: var(--state-error-emphasis);
  color: var(--state-error-emphasis);
}

.comment-ban-btn.is-banned:hover {
  border-color: var(--state-success);
  color: var(--state-success);
}

.comments-banned-notice {
  margin: 12px 0;
  color: var(--state-error-emphasis);
  font-family: var(--font-body);
  font-size: 0.85rem;
}

/* Mail del autor, al lado del nombre (solo lo ve el admin) */
.comment-author-email {
  margin-left: 8px;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 400;
}

/* "Ir a comentarios": solo mobile */
.sort-toggle-btn.comments-jump {
  display: block;
  margin: 4px 0 16px auto;
}

@media (min-width: 769px) {
  .sort-toggle-btn.comments-jump {
    display: none;
  }
}

.comments-section-title {
  margin-top: 3rem;
}

.comments-section-title:focus {
  outline: none;
}


/* ===== styles/components/story-text.css ===== */
/* components/story-text.css */

/* Lectura de un cuento (texto corrido)
   ============================================================ */

.story-body {
  max-width: 70ch;
  margin: 18px auto 30px;
  color: var(--text-body);
  font-family: var(--font-body);
  line-height: 1.7;
}

.story-body p {
  margin: 0 0 1.1em;
}

.story-body p:last-child {
  margin-bottom: 0;
}

/* Texto de presentacion de la coleccion Alterra
   ============================================================ */



/* ===== styles/components/auth.css ===== */
/* components/auth.css */

/* Auth widget (Header) + modal de login/registro
   ============================================================ */

.auth-widget-open-modal {
  padding: 6px 16px;
  font-size: 0.78rem;
}

.auth-widget-logout {
  padding: 8px 14px;
  border: 2px solid var(--cta-primary);
  border-radius: 999px;
  font-size: 0.75rem;
  cursor: pointer;
}

.auth-widget-logout:hover {
  background-color: var(--bg-primary);
  color: var(--cta-primary);
}

@media (hover: hover) and (pointer: fine) {
  .auth-widget-logout:hover {
    background-color: var(--surface-elevated);
    box-shadow: none;
  }
}

.auth-widget-logout:focus-visible {
  background-color: var(--surface-elevated);
  color: var(--cta-primary);
  box-shadow: none;
}

body.auth-modal-lock {
  overflow: hidden;
}

.auth-modal-overlay {
  display: none;
}

.auth-modal-overlay.is-open {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(var(--smoke-deep-rgb), 0.93);
}

.auth-modal {
  position: relative;
  width: 100%;
  max-width: 360px;
  padding: 32px 28px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-panel);
}

.auth-modal--split {
  display: grid;
  grid-template-columns: minmax(0, 42%) minmax(0, 58%);
  max-width: 820px;
  max-height: calc(100dvh - 40px);
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  --auth-visual-image: url('../../assets/auth/auth-login-img.jpg');
}

.auth-modal--register {
  --auth-visual-image: url('../../assets/auth/auth-register-img.jpg');
}

.auth-modal--split::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 42%;
  z-index: 2;
  width: 96px;
  transform: translateX(-50%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(var(--smoke-deep-rgb), 0.72) 50%,
    transparent
  );
  pointer-events: none;
}

.auth-modal--split .auth-modal-background {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--bg-secondary);
  pointer-events: none;
}

.auth-modal--split .auth-modal-visual {
  position: relative;
  z-index: 1;
  min-height: 430px;
  background-color: var(--surface-deep);
}

.auth-modal--split .auth-modal-visual::before {
  content: "";
  position: absolute;
  inset: 10%;
  border: 1px solid var(--border-emphasis);
  border-radius: var(--radius-sm);
  background-image:
    linear-gradient(
      rgba(var(--smoke-green-black-rgb), 0.42),
      rgba(var(--smoke-green-black-rgb), 0.42)
    ),
    var(--auth-visual-image);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.auth-modal--split .auth-modal-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 44px 36px 34px;
  background-color: var(--bg-secondary);
  background-image:
    linear-gradient(
      rgba(var(--smoke-green-black-rgb), 0.50),
      rgba(var(--smoke-green-black-rgb), 0.50)
    ),
    url('../../assets/auth/auth-login-bg.jpg');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

.auth-modal--split .auth-modal-close {
  z-index: 2;
}

.auth-modal-heading {
  margin-bottom: 18px;
}

.auth-modal-heading-title {
  margin: 0 0 6px;
  color: var(--accent-primary);
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1.1;
}

.auth-modal-heading-description {
  margin: 0;
  color: var(--text-caption);
  font-family: var(--font-body);
  font-size: 0.85rem;
  line-height: 1.5;
}

.auth-modal--split .auth-modal-form {
  gap: 12px;
  max-width: none;
  margin-top: 0;
}

.auth-modal--split .auth-modal-form input:not([type="checkbox"]) {
  width: 100%;
  min-height: 44px;
}

.auth-modal--split .auth-modal-field {
  position: relative;
}

.auth-modal--split .auth-modal-field input {
  padding-left: 42px;
}

.auth-modal--login .auth-modal-field--password input {
  padding-right: 46px;
}

.auth-modal--register .auth-modal-field--password input::-ms-reveal,
.auth-modal--register .auth-modal-field--password input::-ms-clear {
  display: none;
}

.auth-modal--split .auth-modal-field-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--text-caption);
  pointer-events: none;
}

.auth-modal--split .auth-modal-password-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--text-caption);
  cursor: pointer;
}

.auth-modal--split .auth-modal-password-toggle svg {
  width: 18px;
  height: 18px;
}

.auth-modal--split .auth-modal-password-toggle:hover {
  color: var(--accent-primary);
}

.auth-modal--split .auth-modal-password-toggle.is-visible::after {
  content: "";
  position: absolute;
  width: 23px;
  height: 2px;
  transform: rotate(-45deg);
  background: currentColor;
}

.auth-modal--split .auth-modal-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.auth-modal--split .auth-modal-remember input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent-display-green);
}

.auth-modal--split .auth-modal-forgot {
  align-self: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-primary);
  font-family: var(--font-body);
  font-size: 0.78rem;
  text-decoration: underline;
  opacity: 1;
  cursor: pointer;
}

.auth-modal--split .auth-modal-form > .btn-link {
  align-self: stretch;
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  text-align: center;
}

.auth-modal--split .auth-modal-remember {
  margin: 2px 0;
}

@media (max-width: 700px) {
  .auth-modal--split {
    grid-template-columns: minmax(0, 1fr);
    max-width: 420px;
  }

  .auth-modal--split::after {
    content: none;
  }

  .auth-modal--split .auth-modal-visual {
    display: none;
  }

  .auth-modal--split .auth-modal-content {
    padding: 32px 24px 28px;
  }
}

.auth-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  padding: 0;
  background: none;
  border: none;
  color: var(--text-h1);
  font-size: 1.3rem;
  cursor: pointer;
  transition:
    color 0.15s ease,
    transform 0.15s ease;
}

.auth-modal-close:hover {
  color: var(--hover-primary);
  transform: scale(1.1);
}

.auth-modal-form {
  margin-top: 8px;
}

.auth-widget-toggle-mode {
  display: block;
  margin: 14px auto 0;
  padding: 0;
  background: none;
  border: none;
  color: var(--text-caption);
  font-family: var(--font-body);
  font-size: 0.78rem;
  text-decoration: underline;
  cursor: pointer;
}

.auth-widget-toggle-mode:hover {
  color: var(--hover-primary);
}

.auth-widget-error {
  margin: 12px 0 0;
  color: var(--state-error-emphasis);
  font-family: var(--font-body);
  font-size: 0.78rem;
  text-align: center;
}

/* Widget de sesion (compacto) + menu desplegable
   ============================================================ */

.auth-widget-slot {
  display: flex;
  align-items: center;
  min-width: 0;
}

.auth-widget--logged-in {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.auth-widget-trigger {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 120px;
  padding: 4px 10px 4px 4px;
  background: var(--surface-deep);
  border: 2px solid var(--border-emphasis);
  color: var(--text-body);
  box-shadow: 0 3px 10px rgba(var(--smoke-black-rgb), 0.25);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.auth-widget-trigger:hover,
.auth-widget-trigger[aria-expanded="true"] {
  border-color: var(--hover-primary);
}

.auth-widget-avatar {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}

.auth-widget-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cta-primary);
  color: var(--cta-primary-text);
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
}

.auth-widget-name {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: var(--font-body);
  font-size: 0.78rem;
}

.auth-user-menu {
  position: absolute;
  top: 100%;
  right: clamp(8px, 3vw, 36px);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(420px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 150px);
  overflow-y: auto;
  padding: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-emphasis);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-panel);
}

.auth-user-menu,
.sidebar-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-display-green-rgb), 0.55) var(--surface-deep);
}

.auth-user-menu::-webkit-scrollbar,
.sidebar-scroll::-webkit-scrollbar {
  width: 10px;
}

.auth-user-menu::-webkit-scrollbar-track,
.sidebar-scroll::-webkit-scrollbar-track {
  background: var(--surface-deep);
  border-radius: 999px;
}

.auth-user-menu::-webkit-scrollbar-thumb,
.sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(var(--accent-display-green-rgb), 0.55);
  border: 2px solid var(--surface-deep);
  border-radius: 999px;
}

@media (hover: hover) and (pointer: fine) {
  .auth-user-menu:hover,
  .sidebar-scroll:hover {
    scrollbar-color: rgba(var(--accent-display-green-rgb), 0.75) var(--surface-deep);
  }

  .auth-user-menu::-webkit-scrollbar-thumb:hover,
  .sidebar-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--accent-display-green-rgb), 0.75);
  }
}

.auth-profile-heading h2 {
  margin: 0;
  color: var(--cta-primary);
  font-family: var(--font-display);
  font-size: 1.65rem;
  line-height: 1.15;
}

.auth-profile-heading p {
  margin: 5px 0 0;
  color: var(--text-caption);
  font-size: 0.78rem;
}

.auth-profile-main {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-profile-preview {
  flex: 0 0 68px;
  width: 68px;
  height: 68px;
  overflow: hidden;
  border: 2px solid var(--cta-primary);
  border-radius: 50%;
}

.auth-profile-preview .auth-widget-avatar {
  width: 100%;
  height: 100%;
}

.auth-profile-preview .auth-widget-avatar-placeholder {
  font-size: 1.5rem;
}

.auth-profile-fields {
  flex: 1;
  min-width: 0;
}

.auth-user-menu-label {
  margin-top: 4px;
  color: var(--text-caption);
  font-family: var(--font-body);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.auth-user-menu-profile-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-profile-input-wrap {
  position: relative;
}

.auth-profile-input-wrap input {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 38px 10px 12px;
  background: var(--form-background);
  border: 1px solid var(--form-border);
  border-radius: var(--radius-sm);
  color: var(--text-h1);
  font-family: var(--font-body);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-profile-input-wrap input:focus {
  border-color: var(--form-focus);
  box-shadow: 0 0 0 2px rgba(var(--cta-primary-rgb), 0.2);
}

.auth-profile-input-wrap input:focus-visible {
  outline: 1.5px solid var(--form-focus);
}

.auth-profile-input-wrap input:disabled {
  opacity: 0.7;
  cursor: progress;
}

.auth-profile-input-wrap svg {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  fill: currentColor;
  color: var(--text-caption);
  pointer-events: none;
}

.auth-user-menu-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin-top: 2px;
  padding: 8px 14px;
  background: var(--surface-deep);
  border: 2px solid var(--accent-display-green);
  border-radius: 999px;
  color: var(--accent-display-green);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .auth-user-menu-save:not(:disabled):hover {
    background: var(--surface-elevated);
    box-shadow:
      0 0 8px rgba(var(--accent-display-green-rgb), 0.25),
      inset 0 0 10px rgba(var(--accent-display-green-rgb), 0.08);
  }
}

.auth-user-menu-save:focus-visible {
  outline: 2px solid var(--accent-display-green);
  outline-offset: 3px;
}

.auth-user-menu-save:disabled,
.auth-user-menu-save:disabled:hover {
  background: var(--surface-deep);
  color: var(--accent-display-green);
  opacity: 0.5;
  box-shadow: none;
  cursor: not-allowed;
}

.auth-profile-pending {
  margin: 0;
  color: var(--state-warning);
  font-family: var(--font-body);
  font-size: 0.72rem;
}

.auth-profile-pending:empty {
  display: none;
}

.auth-profile-feedback {
  margin: 5px 0 0;
  color: var(--accent-display-green);
  font-family: var(--font-body);
  font-size: 0.72rem;
}

.auth-profile-feedback:empty {
  display: none;
}

.auth-profile-email {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 8px;
  font-family: var(--font-body);
}

.auth-profile-email-label {
  color: var(--text-caption);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.auth-profile-email-value {
  color: var(--text-body);
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}

.auth-user-menu-avatars {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.auth-user-menu-avatars .auth-menu-no-avatar-icon {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  color: var(--accent-primary);
}

.auth-menu-no-avatar-figure {
  fill: var(--border-emphasis);
}

.auth-user-menu-avatars img {
  display: block;
  width: 100%;
  border-radius: 50%;
}

.auth-menu-avatar-option {
  padding: 2px;
  background: none;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
}

.auth-menu-avatar-option.is-selected {
  border-color: var(--cta-primary);
}

.auth-menu-avatar-option:disabled {
  cursor: progress;
}

.auth-profile-activity {
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.auth-activity-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.auth-activity-heading h3 {
  margin: 0;
  color: var(--accent-primary);
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.auth-activity-heading > span {
  color: var(--text-caption);
  font-size: 0.68rem;
  text-align: right;
}

.auth-activity-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.auth-activity-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  gap: 3px;
  padding: 9px 5px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.auth-activity-icon {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.auth-activity-value {
  color: var(--text-body);
  font-weight: 700;
}

.auth-activity-label {
  color: var(--text-caption);
  font-size: 0.68rem;
  text-align: center;
}

.auth-profile-preferences {
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.auth-profile-preferences h3 {
  margin: 0 0 10px;
  color: var(--accent-primary);
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.auth-forum-unread-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-body);
  text-align: left;
  cursor: pointer;
}

.auth-forum-unread-switch:disabled {
  opacity: 0.65;
  cursor: progress;
}

.auth-forum-unread-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.auth-forum-unread-title {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
}

.auth-forum-unread-help {
  color: var(--text-caption);
  font-size: 0.7rem;
  line-height: 1.35;
}

.auth-forum-unread-track {
  position: relative;
  flex: 0 0 42px;
  width: 42px;
  height: 24px;
  background: var(--surface-deep);
  border: 1px solid var(--border-emphasis);
  border-radius: 999px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.auth-forum-unread-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: var(--text-caption);
  border-radius: 50%;
  transition: transform 0.2s ease, background 0.2s ease;
}

.auth-forum-unread-switch[aria-checked="true"] .auth-forum-unread-track {
  background: var(--state-success);
  border-color: var(--state-success);
}

.auth-forum-unread-switch[aria-checked="true"] .auth-forum-unread-thumb {
  transform: translateX(18px);
  background: var(--bg-primary);
}

.auth-forum-unread-error {
  margin: 6px 0 0;
  color: var(--state-error-emphasis);
  font-size: 0.72rem;
}

@media (hover: hover) and (pointer: fine) {
  .auth-forum-unread-switch:not(:disabled):hover {
    background: var(--surface-elevated);
    border-color: var(--accent-display-green);
  }
}

.auth-user-menu .auth-widget-logout {
  margin-top: 6px;
  width: 100%;
  text-align: center;
}

@media (max-width: 480px) {
  .auth-widget-trigger {
    max-width: 36px;
    padding: 4px;
    gap: 0;
  }

  .auth-widget-name {
    display: none;
  }

  .auth-profile-preview {
    flex-basis: 56px;
    width: 56px;
    height: 56px;
  }

  .auth-user-menu-avatars {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }
}

.auth-modal-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0;
  color: var(--text-caption);
  font-family: var(--font-body);
  font-size: 0.78rem;
  cursor: pointer;
}

.auth-modal-remember input {
  width: auto;
}

/* Aviso positivo en el modal de login (ej: mail de reset enviado) */
.auth-modal-notice {
  margin: 14px 0 0;
  color: var(--state-success);
  font-family: var(--font-body);
  font-size: 0.8rem;
  text-align: center;
}

/* Baja de cuenta (panel de usuario)
   ============================================================ */

.auth-delete-open {
  align-self: flex-start;
  margin: 8px 0;
  padding: 0;
  background: none;
  border: none;
  color: var(--text-body);
  font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
}

.auth-delete-open:hover {
  color: var(--hover-primary);
}

.auth-delete-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.auth-delete-panel h3 {
  margin: 0;
  font-size: 1rem;
}

.auth-delete-panel p {
  margin: 0;
  font-size: 0.85rem;
}

.auth-delete-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-delete-confirm,
.auth-delete-cancel {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
}

.auth-delete-confirm {
  background: var(--danger);
  border: 1px solid var(--danger);
  color: #fff;
  font-weight: 700;
}

.auth-delete-cancel {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-body);
}

.auth-delete-confirm:disabled,
.auth-delete-cancel:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Tarjeta de comentario: texto a la izquierda, avatar a la derecha (Fo7)
   ============================================================ */

.comment-body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.comment-main {
  min-width: 0;
}

.comment-body > .comment-avatar {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  font-size: 1.4rem;
}

.comment-item-reply .comment-body > .comment-avatar {
  width: 44px;
  height: 44px;
  font-size: 1rem;
}

.comment-body .comment-item-header {
  flex-wrap: wrap;
  row-gap: 2px;
}


/* ===== styles/components/story-reader.css ===== */
/* components/story-reader.css */

/* Reader paginado de cuentos
   ============================================================ */

.story-reader {
  margin: 20px 0 10px;
}

.story-reader-viewport {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.story-reader-cover-page {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.story-reader-cover-image {
  max-width: 120%;
  max-height: 105%;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.story-reader-arrow:focus,
.story-reader-arrow:focus-visible {
  outline: none;
  outline-offset: 0;
  box-shadow: none;
}

.story-reader-arrow:focus-visible:not(.is-disabled) {
  color: var(--hover-primary);
  transform: scale(1.15);
}

.story-reader-arrow.is-disabled:focus-visible {
  color: var(--state-disabled);
  transform: none;
}

.story-reader-arrow.is-disabled {
  color: var(--state-disabled);
  pointer-events: none;
}

.story-reader-pages {
  position: relative;
  flex: 0 0 auto;
  height: min(90vh, 640px);
  width: auto;
  max-width: 92vw;
  aspect-ratio: 3 / 4;
  padding: 50px 26px 34px;
  box-sizing: border-box;
  overflow: hidden;
  background: hsl(45, 35%, var(--story-reader-bg-lightness, 100%));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(var(--shadow-color-rgb), 0.25);
  perspective: 1100px;
}

.story-reader-content {
  height: 100%;
  color: #262019;
  font-family: var(--font-body);
  line-height: 1.65;
}

.story-reader-content p {
  margin: 0 0 .1em;
  text-align: justify;
  overflow-wrap: break-word;
}

[data-reader-content] {
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

.story-reader-measurer {
  position: absolute;
  top: -99999px;
  left: -99999px;
  height: auto;
  visibility: hidden;
  pointer-events: none;
}

.story-reader-page-indicator {
  display: block;
  margin-top: 10px;
  text-align: center;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.8rem;
}

/* Ajustes del reader: viven ADENTRO de la hoja, por eso tienen su propio
   tema oscuro fijo (no el verde del sitio) para distinguirse del papel
   claro sobre el que flotan. */

.story-reader-settings-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  background: #1a1a1a;
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.story-reader-settings-btn:hover {
  background: #333;
}

.story-reader-settings-panel {
  position: absolute;
  top: 10px;
  right: 50px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 220px;
  padding: 14px 16px;
  background: #1a1a1a;
  border-radius: var(--radius-md);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.story-reader-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.8rem;
}

.story-reader-font-controls {
  display: flex;
  gap: 8px;
}

.story-reader-font-controls button {
  width: 28px;
  height: 28px;
  background: #333;
  border: 1px solid #555;
  border-radius: var(--radius-sm);
  color: #fff;
  cursor: pointer;
}

.story-reader-font-controls button:hover {
  background: #4a4a4a;
}

.story-reader-brightness-input {
  width: 90px;
}

@media (max-width: 640px) {
  .story-reader-viewport {
    width: 100%;
    gap: 0;
  }

  .story-reader-pages {
    width: min(420px, 100%);
    max-width: none;
    height: auto;
    aspect-ratio: 3 / 4;
    padding: 42px 16px 22px;
  }

  .story-reader-viewport .story-reader-arrow {
  display: none;
  }

  .story-reader-settings-panel {
    width: 190px;
    right: 46px;
  }

  .story-reader-brightness-input {
    width: 80px;
  }
}

/* Fila de modo de lectura: titulo arriba, botones abajo a todo el ancho */
  .story-reader-setting-row--stacked {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .story-reader-mode-controls {
    width: 100%;
  }

  .story-reader-font-controls.story-reader-mode-controls button {
    flex: 1;
    width: auto;
    padding: 0 8px;
    font-size: 0.75rem;
    white-space: nowrap;
  }

  .story-reader-font-controls button.is-active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #1a1a1a;
  }

  /* Modo corrido: la hoja crece con el texto y se lee scrolleando */
  .story-reader.is-scroll-mode .story-reader-pages {
    width: min(760px, 100%);
    max-width: 100%;
    height: auto;
    aspect-ratio: auto;
    padding: 56px 32px 40px;
    overflow: visible;
  }

  .story-reader.is-scroll-mode .story-reader-content {
    height: auto;
  }

  .story-reader.is-scroll-mode .story-reader-content p {
    margin-bottom: 0.8em;
  }

  /* Portada solo arriba y de tamaño razonable, no ocupa toda la hoja */
  .story-reader.is-scroll-mode .story-reader-cover-page {
    height: auto;
    margin-bottom: 24px;
  }

  .story-reader.is-scroll-mode .story-reader-cover-image {
    max-width: 100%;
    max-height: min(70vh, 520px);
  }

  /* Sin flechas ni contador de paginas: se lee scrolleando */
  .story-reader.is-scroll-mode .story-reader-arrow,
  .story-reader.is-scroll-mode .story-reader-page-indicator {
    display: none;
  }

  @media (max-width: 640px) {
    .story-reader.is-scroll-mode .story-reader-pages {
      padding: 48px 18px 28px;
    }
  }


/* ===== styles/components/page-detail.css ===== */
/* components/page-detail.css */

/* Indicador + selector de capitulo/pagina en PageDetailView
   ============================================================ */

.page-nav-indicator {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0 14px;
}

.page-nav-indicator .back-link {
  margin: 0;
}

/* "capítulo 23 — página 1 / 25": centrado, pegado al pie de la imagen. */
.page-nav-indicator-text {
  margin: -16px 0 28px;
  color: var(--text-h3);
  font-family: var(--font-display);
  font-size: 1.17rem;
  font-weight: 400;
  letter-spacing: 0.5px;
  line-height: 1.05;
  text-align: center;
}

.page-nav-indicator-text.has-reader-continuation {
  margin-bottom: 4px;
}

.reader-continuation {
  margin-bottom: 28px;
  text-align: center;
}

.reader-continuation p {
  margin: 0;
}

.reader-continuation--next p {
  color: var(--accent-display-green);
}

.page-nav-selects {
  display: flex;
  gap: 8px;
}

.page-nav-selects select {
  padding: 6px 10px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: 0.8rem;
  max-width: 45vw;
}

@media (max-width: 480px) {
  .page-nav-indicator {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-nav-selects select {
    max-width: 100%;
  }
}


/* ===== styles/components/coverflow.css ===== */
/* components/coverflow.css */

/* Coverflow: galeria de portadas de Alterra
   ============================================================ */

.coverflow-gallery-wrapper {
  margin: 20px 0 10px;
}

.coverflow-gallery {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 4px;
}

.coverflow-track {
  position: relative;
  flex: 0 1 720px;
  min-width: 0;
  height: 430px;
  perspective: 1100px;
  transform-style: preserve-3d;
  overflow: visible;
}

.coverflow-slot {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 253px;
  height: 380px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  opacity: 0;
  text-decoration: none;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transform-origin: center;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  box-shadow:
    0 6px 18px
    rgba(var(--shadow-color-rgb), 0.22);
  transition: box-shadow 0.2s ease;
}

.coverflow-slot[data-offset="0"] {
  opacity: 1;
  z-index: 50;
}

.coverflow-slot.is-center {
  pointer-events: auto;
  cursor: pointer;
  box-shadow:
    0 10px 26px
    rgba(var(--shadow-color-rgb), 0.35);
}

.coverflow-cover {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  transition:
    transform 0.2s ease,
    filter 0.2s ease;
}

.coverflow-slot.is-center:hover
.coverflow-cover {
  transform: scale(1.025);
  filter: brightness(1.05);
}

.coverflow-title {
  margin: 8px 0 0;
  color: var(--text-h3);
  font-family: var(--font-body);
  font-size: 0.85rem;
  text-align: center;
}

.coverflow-gallery-wrapper.is-animating
.coverflow-slot {
  pointer-events: none;
}

.coverflow-arrow {
  position: relative;
  z-index: 60;
}

.coverflow-dots {
  display: none;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
}

.coverflow-dot {
  width: 18px;
  height: 4px;
  border-radius: 2px;
  background: var(--border-subtle);
}

.coverflow-dot.is-active {
  background: var(--cta-primary);
}

@media (max-width: 640px) {
  .coverflow-track {
    height: 340px;
  }

  .coverflow-slot {
    width: 200px;
    height: 300px;
  }

  .coverflow-dots {
    display: flex;
  }
}


/* ===== styles/components/chevrons.css ===== */
/* components/chevrons.css */

/* Sistema visual compartido de chevrones
   ============================================================ */

.chevron-control {
  --chevron-target-size: 52px;
  --chevron-icon-size: 40px;

  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;

  min-inline-size: var(--chevron-target-size);
  min-block-size: var(--chevron-target-size);
  padding: 0.25rem;

  background: transparent;
  border: 0;
  color: var(--icon-primary);

  font-family: var(--font-body);
  line-height: 1;
  text-decoration: none;

  cursor: pointer;
  touch-action: manipulation;

  transition: transform 0.18s ease;
}

/* Hover y foco sin el antiguo rectángulo amarillo. */
.chevron-control:hover:not(.is-disabled):not(:disabled),
.chevron-control:focus-visible:not(.is-disabled):not(:disabled) {
  transform: scale(1.12);
}

.chevron-control:active:not(.is-disabled):not(:disabled) {
  transform: scale(0.96);
}

.chevron-control:focus-visible {
  outline: none;
  box-shadow: none;
}

/* Conserva inline-flex aunque exista el hover anterior de pagination. */
.pagination a.chevron-control,
.pagination a.chevron-control:hover {
  display: inline-flex;
}

/* Estados no disponibles. */
.chevron-control.is-disabled,
.chevron-control:disabled {
  pointer-events: none;
  cursor: default;
  transform: none;
}

/* Compensa el área clickeable ampliada en la paginación superpuesta. */
.pagination--overlay .pagination-side:first-child {
  left: -142px;
}

.pagination--overlay .pagination-side:last-child {
  right: -142px;
}

@media (max-width: 640px) {
  .chevron-control {
    --chevron-target-size: 48px;
  }

  .pagination-side {
    gap: 4px;
  }

  .pagination--flanked {
    gap: 8px;
  }
}

/* Windows High Contrast: mantiene visible el foco de teclado. */
@media (forced-colors: active) {
  .chevron-control:focus-visible {
    outline: 2px solid Highlight;
    outline-offset: 2px;
  }
}

/* Imágenes de navegación: tamaño visual independiente del área clickeable */
.chevron-icon {
  display: block;
  flex: none;
  width: var(--chevron-icon-size);
  height: var(--chevron-icon-size);
  max-width: 100%;
  object-fit: contain;
  pointer-events: none;
}

.pagination .chevron-control {
  --chevron-icon-size: 42px;
}

.pagination .chevron-control:is([data-action="first"], [data-action="last"]) {
  --chevron-icon-size: 50px;
}

.chevron-control:hover:not(.is-disabled):not(:disabled) .chevron-icon,
.chevron-control:focus-visible:not(.is-disabled):not(:disabled) .chevron-icon {
  filter: brightness(1.12);
}

.chevron-control.is-disabled .chevron-icon,
.chevron-control:disabled .chevron-icon {
  opacity: 0.4;
  filter: none;
}

.lightbox-arrow {
  --chevron-icon-size: 44px;
}

.story-reader-arrow {
  --chevron-icon-size: 42px;
}

.coverflow-arrow {
  --chevron-icon-size: 44px;
}

@media (max-width: 640px) {
  .chevron-control,
  .pagination .chevron-control {
    --chevron-icon-size: 34px;
  }

  .pagination .chevron-control:is([data-action="first"], [data-action="last"]) {
    --chevron-icon-size: 42px;
  }

  .lightbox-arrow {
    --chevron-icon-size: 36px;
  }

  .story-reader-arrow {
    --chevron-icon-size: 34px;
  }

  .coverflow-arrow {
    --chevron-icon-size: 36px;
  }
}

@media (max-width: 640px) {
  /* Reservar espacio para los controles encima de la hoja. */
  .pagination--overlay {
    margin-top: 68px;
  }

  .pagination--overlay .pagination-side {
    display: flex;
    top: -60px;
    transform: none;
    gap: 0;
  }

  .pagination--overlay .pagination-side:first-child {
    left: 0;
  }

  .pagination--overlay .pagination-side:last-child {
    right: 0;
  }

  /* En esta vista móvil, solo página anterior y siguiente. */
  .pagination--overlay [data-action="first"],
  .pagination--overlay [data-action="last"] {
    display: none;
  }
}



/* ===== styles/components/recent-comments.css ===== */
/* components/recent-comments.css */

/* Feed de ultimos comentarios (Home)
   ============================================================ */

.recent-comments-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}

.recent-comment-card {
  display: block;
  padding: 12px 16px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease;
}

.recent-comment-card:hover {
  border-color: var(--hover-primary);
}

.recent-comment-topic {
  margin: 4px 0;
  color: var(--accent-primary);
  font-family: var(--font-body);
  font-size: 0.75rem;
}


/* ===== styles/components/accordion.css ===== */
/* components/accordion.css */

/* Acordeon del Foro
   ============================================================ */
.forum-unread-tip {
  margin: 0 0 20px;
  padding: 10px 12px;
  background: var(--surface-card);
  border-left: 3px solid var(--accent-display-green);
  border-radius: var(--radius-sm);
  color: var(--text-h3);
  font: 0.82rem/1.45 var(--font-body);
}

.forum-accordion {
  margin: 16px 0;
  border: 3px solid var(--cta-primary);
  transition: border-color 0.2s ease;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.forum-accordion:hover,
.forum-accordion:focus-within {
  border-color: var(--accent-display-green);
}

.forum-accordion:not(.forum-accordion--sm) {
  background: rgba(255, 255, 255, 0.04);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(2px);
}

.forum-accordion-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 18px;
  background: transparent;
  border: none;
  color: var(--text-h3);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.forum-accordion-toggle:hover {
  color: var(--hover-primary);
}

.forum-accordion-toggle > span:first-child {
  display: inline-block;
  padding-block: 0.1em 0.04em;
  padding-inline: 0.03em 0.14em;
  color: var(--cta-primary);
  -webkit-text-fill-color: var(--cta-primary);
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2vw, 1.6rem);
  font-weight: 400;
  letter-spacing: 0.5px;
  line-height: 1.12;
}

@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .forum-accordion-toggle > span:first-child {
    background-image: var(--display-text-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
}

.forum-accordion-caret {
  transition: transform 0.2s ease;
}

.forum-accordion-toggle.is-open .forum-accordion-caret {
  transform: rotate(180deg);
}

.forum-accordion-panel {
  padding: 8px 0;
  overflow: hidden;
}

/* Acordeón chico (sub-bloques del admin): mismo comportamiento, letra de cuerpo */
.forum-accordion--sm {
  margin: 10px 0;
  border-width: 1px;
}

.forum-accordion--sm > .forum-accordion-toggle {
  padding: 10px 14px;
  font-size: 0.9rem;
}

.forum-accordion--sm > .forum-accordion-toggle > span:first-child {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.3;
  background-image: none;
  background-clip: border-box;
  -webkit-background-clip: border-box;
  color: var(--text-h3);
  -webkit-text-fill-color: var(--text-h3);
}

.forum-accordion--sm > .forum-accordion-panel {
  padding: 8px 14px 14px;
}

.forum-subsection-title {
  margin: 14px 18px 6px;
  color: var(--text-caption);
  font-family: var(--font-body);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.forum-empty-note {
  margin: 8px 18px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.85rem;
}

.forum-topic-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-top: 1px solid var(--border-subtle);
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s ease;
}

.forum-topic-row:hover {
  background: rgba(var(--accent-primary-rgb), 0.06);
}

.forum-topic-row-disabled {
  opacity: 0.5;
  cursor: default;
}

.forum-topic-row-title {
  margin: 0;
  color: var(--text-body);
  font-family: var(--font-body);
  font-weight: 700;
}

.forum-topic-row-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: 0.75rem;
}

.forum-topic-row-author {
  display: flex;
  align-items: center;
  gap: 6px;
}

.forum-topic-row-date,
.forum-topic-row-count {
  white-space: nowrap;
}

@media (max-width: 640px) {
  .forum-topic-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .forum-topic-row-meta {
    flex-wrap: wrap;
  }
}

/* Acordeones anidados (panel de admin): un poco de aire entre ellos */
.forum-accordion-panel .forum-accordion {
  margin-top: 12px;
}

/* Acordeón grande que contiene sub-acordeones chicos (Configuración, Capítulos, Cuentos, Foro):
   espacio entre sus bordes y las listas desplegables, igual que el de los sub-acordeones. */
.forum-accordion:not(.forum-accordion--sm) > .forum-accordion-panel:has(.forum-accordion--sm) {
  padding: 4px 14px 14px;
}

/* variante sobria del panel de administración (acordeones admin-* y cfg-*).
   sin degradado en el título y con borde sutil; los acordeones públicos del foro no cambian.
   va al final del archivo para ganar a las reglas generales de .forum-accordion. */
.forum-accordion:is([data-accordion-id^="admin-"], [data-accordion-id^="cfg-"]) {
  border: 1px solid var(--border-subtle);
}

.forum-accordion:is([data-accordion-id^="admin-"], [data-accordion-id^="cfg-"]):hover,
.forum-accordion:is([data-accordion-id^="admin-"], [data-accordion-id^="cfg-"]):focus-within {
  border-color: var(--border-emphasis);
}

.forum-accordion:is([data-accordion-id^="admin-"], [data-accordion-id^="cfg-"])
  > .forum-accordion-toggle > span:first-child {
  background-image: none;
  background-clip: border-box;
  -webkit-background-clip: border-box;
  color: var(--text-h2);
  -webkit-text-fill-color: var(--text-h2);
}

.forum-accordion:is([data-accordion-id^="admin-"], [data-accordion-id^="cfg-"])
  > .forum-accordion-toggle:hover > span:first-child {
  color: var(--hover-primary);
  -webkit-text-fill-color: var(--hover-primary);
}


/* ===== styles/components/admin.css ===== */
/* components/admin.css */

/* Panel de administracion
   ============================================================ */

.admin-settings-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 640px;
}

.admin-settings-field {
  display: flex;
  align-items: flex-end;
  gap: 20px;
}

.admin-settings-field .admin-settings-label {
  flex: 1;
  min-width: 0;
}

.admin-settings-current {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
  max-width: 220px;
  padding-bottom: 2px;
}

.admin-settings-current-label {
  color: var(--text-caption);
  font-family: var(--font-body);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.admin-settings-current-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .admin-settings-field {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .admin-settings-current {
    max-width: 100%;
  }
}

.admin-settings-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-caption);
  font-family: var(--font-body);
  font-size: 0.85rem;
}

.admin-settings-saved {
  margin-top: 10px;
  color: var(--state-success);
  font-family: var(--font-body);
  font-size: 0.85rem;
}

.auth-user-menu-admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  background: var(--surface-card);
  border: 1px solid var(--border-emphasis);
  border-radius: var(--radius-sm);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.auth-user-menu-admin-link svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}

@media (hover: hover) and (pointer: fine) {
  .auth-user-menu-admin-link:hover {
    background: var(--surface-elevated);
    border-color: var(--accent-display-green);
    color: var(--accent-display-green);
  }
}

.auth-user-menu-admin-link:focus-visible {
  border-color: var(--accent-display-green);
  outline: 2px solid var(--accent-display-green);
  outline-offset: 3px;
}

.admin-settings-hint {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 400;
}

/* Panel de administracion de capitulos
   ============================================================ */

.admin-import-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 12px 0 20px;
}

.admin-import-result {
  color: var(--state-success);
  font-family: var(--font-body);
  font-size: 0.8rem;
}

.admin-chapter-row {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px 8px;
  align-items: end;
  padding: 14px 6px;
  border-bottom: 1px solid var(--border-subtle);
}

.admin-chapter-row-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.admin-field--2 { grid-column: span 2; }
.admin-field--4 { grid-column: span 4; }
.admin-field--5 { grid-column: span 5; }

.admin-field-label {
  color: var(--text-caption);
  font-family: var(--font-body);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.admin-chapter-actions {
  grid-column: span 2;
  display: flex;
}

.admin-chapter-actions .admin-chapter-save {
  width: 100%;
}

.admin-chapter-row-id {
  color: var(--text-caption);
  font-family: var(--font-body);
  font-size: 0.85rem;
}

.admin-chapter-row input,
.admin-chapter-row select {
  width: 100%;
  min-width: 0;
  padding: 6px 8px;
  font-size: 0.8rem;
}

.admin-chapter-save {
  padding: 6px 12px;
  font-size: 0.78rem;
  white-space: nowrap;
}

.admin-chapter-status {
  font-family: var(--font-body);
  font-size: 0.72rem;
  white-space: nowrap;
}

.admin-chapter-status.is-published {
  color: var(--state-success);
}

.admin-chapter-status.is-scheduled {
  color: var(--state-warning);
}

/* Denuncias en el panel de admin
   ============================================================ */

.admin-reports-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 6px;
  color: var(--text-caption);
  font-family: var(--font-body);
  font-size: 0.85rem;
}

.admin-reports-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.admin-report {
  padding: 14px 6px;
  border-bottom: 1px solid var(--border-subtle);
}

.admin-report.is-open {
  padding-left: 12px;
  border-left: 3px solid var(--state-warning);
}

.admin-report-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.admin-report-date {
  color: var(--text-caption);
  font-family: var(--font-body);
  font-size: 0.75rem;
}

.admin-report-meta {
  margin: 6px 0;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.8rem;
}

.admin-report-text {
  margin: 6px 0 10px;
  padding: 8px 12px;
  background: rgba(var(--cta-secondary-rgb), 0.06);
  border-left: 2px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.admin-report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-report-action {
  margin-top: 0;
  padding: 6px 12px;
  font-size: 0.78rem;
}

/* Panel de administracion de cuentos
   =========================================================== */

.admin-story-row-header {
  display: flex;
  align-items: stretch;
}

.admin-story-drag-handle {
  display: flex;
  align-items: center;
  padding: 0 10px;
  color: var(--text-caption);
  cursor: grab;
  user-select: none;
}

.admin-story-draggable {
  margin: 0;
}

.admin-story-toggle-btn {
  flex: 1;
}

.admin-story-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
}

.admin-story-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-caption);
  font-family: var(--font-body);
  font-size: 0.85rem;
}

.admin-story-form textarea {
  font-family: var(--font-body);
  font-size: 0.85rem;
  resize: vertical;
}

.admin-story-checkbox {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
}

.admin-story-form-new {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-top: 8px;
}

.admin-sitetexts-section {
  margin: 18px 0 4px;
  font-size: 0.95rem;
}

.admin-sitetexts-section:first-child {
  margin-top: 0;
}

.admin-sitetexts-label textarea {
  font-family: var(--font-body);
  font-size: 0.85rem;
  resize: vertical;
}

.comments-verify-prompt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 0;
}

.comments-verify-sent {
  color: var(--state-success);
  font-size: 0.8rem;
}

/* Cuentos del admin: agarradera a la izquierda del acordeon de cada cuento */
.admin-story-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.admin-story-item > .forum-accordion {
  flex: 1;
  min-width: 0;
}

.admin-story-item > .admin-story-drag-handle {
  padding-top: 12px;
  cursor: grab;
  user-select: none;
}

/* Fila de arriba: los dos botones se reparten el ancho. Abajo: borrar/descartar ocupa el ancho de los dos juntos. */
.admin-story-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.admin-story-actions .btn-link {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.admin-story-actions .admin-story-danger {
  grid-column: 1 / -1;
}

/* Variante donde cada botón ocupa todo el ancho (ej: Guardar y debajo Eliminar) */
.admin-story-actions--stacked .btn-link {
  grid-column: 1 / -1;
}

/* Cartel de resultado de un formulario del admin (arriba de los botones) */
.admin-result {
  margin: 0;
  padding: 10px 14px;
  border: 1px solid rgba(var(--accent-primary-rgb), 0.55);
  border-radius: var(--radius-sm);
  background: rgba(var(--accent-primary-rgb), 0.12);
  color: var(--accent-primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
}

.admin-result--error {
  border-color: var(--state-error-emphasis);
  background: rgba(212, 87, 79, 0.12);
  color: var(--state-error-emphasis);
}

.admin-chapters-list .admin-result {
  margin: 4px 6px 8px;
}

.admin-story-danger {
  color: var(--danger);
}

.admin-empty-list {
  color: var(--text-muted);
}


/* ===== styles/components/badges.css ===== */
/* components/badges.css */

/* Globito con número (ej: denuncias abiertas)
   ============================================================ */

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  background: var(--cta-primary);
  border-radius: 999px;
  color: var(--cta-primary-text);
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
}

.auth-widget-trigger .count-badge {
  position: absolute;
  top: -6px;
  right: -6px;
}

.auth-user-menu-admin-link .count-badge {
  margin-left: 0.5rem;
}

@media (max-width: 900px) {
  .admin-chapter-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-field--2,
  .admin-field--4 {
    grid-column: span 1;
  }

  .admin-field--5,
  .admin-chapter-actions {
    grid-column: 1 / -1;
  }
}

/* Etiqueta "Nuevo": filas, acordeones y sidebar */
.unread-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--cta-primary);
  color: var(--cta-primary-text);
  -webkit-text-fill-color: var(--cta-primary-text);
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.4;
  text-transform: none;
  vertical-align: middle;
}

.unread-badge[hidden] {
  display: none;
}

/* En el acordeón, el badge queda pegado al título y el caret a la derecha */
.forum-accordion-toggle .unread-badge {
  margin-right: auto;
}

/* Punto en el encabezado de la seccion (los acordeones arrancan cerrados) */
.forum-accordion.has-unread .forum-accordion-toggle > span:first-child::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--cta-primary);
  vertical-align: middle;
}


/* ===== styles/components/clamped-text.css ===== */
/* components/clamped-text.css */

/* Texto cortado con "ver más…" */
/* contenedor del texto: verde un poco más claro que la tarjeta.
   el fondo va acá (no en el <p>) para que "ver más" quede dentro y solo este bloque se estire. */
.clamp {
  padding: 8px 10px;
  background: #154236;
  background: color-mix(in srgb, var(--surface-card) 85%, white);
  border-radius: var(--radius-sm);
}

.clamp-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.clamp.is-expanded .clamp-text {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
}

.clamp-more {
  margin-top: 2px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  cursor: pointer;
}

.clamp-more[hidden] {
  display: none;
}

/* Home: avatar chico, de la altura del nombre, a la derecha */
.recent-comment-card .comment-avatar {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  font-size: 0.6rem;
}

.recent-comment-card .clamp-text {
  -webkit-line-clamp: 3;
  line-clamp: 3;
}


/* ===== styles/pages.css ===== */
/* ============================================================
   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 {
  width: 100%;
  min-width: 0;
  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;
}

/* ===== styles/legal.css ===== */
/* ============================================================
   legal.css — Centro Legal y documentos legales
   ============================================================ */

/* Contenedor general
   ============================================================ */

.legal-page {
  width: min(100%, 900px);
  margin: 0 auto;
  padding: clamp(24px, 5vw, 56px);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-panel);
}

/* Encabezado
   ============================================================ */

.legal-page-header {
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--divider);
}

.legal-page-header h1 {
  margin-bottom: 0.75rem;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
}

.legal-page-header > p {
  max-width: 70ch;
  margin: 0;
  color: var(--text-body);
  font-size: 1rem;
  line-height: 1.7;
}

.legal-page-header .legal-page-updated {
  margin-top: 1rem;
  color: var(--text-caption);
  font-size: 0.85rem;
  font-weight: 700;
}

/* Navegación legal
   ============================================================ */

.legal-page-navigation {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.5rem 0 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}


.legal-document-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.legal-document-navigation a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.55rem 0.85rem;
  background: var(--surface-deep);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-body);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease;
}

.legal-document-navigation a:hover {
  background: var(--surface-elevated);
  border-color: var(--accent-primary);
  color: var(--text-h1);
}

.legal-document-navigation a.is-active {
  background: var(--cta-primary);
  border-color: var(--cta-primary);
  color: var(--cta-primary-text);
}

/* Contenido del documento
   ============================================================ */

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

.legal-page-content section + section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
}

.legal-page-content h2 {
  margin-bottom: 0.8rem;
  font-size: clamp(1.7rem, 4vw, 2.2rem);
}

.legal-page-content h3 {
  margin-top: 1.5rem;
  font-size: 1.35rem;
}

.legal-page-content p {
  max-width: 75ch;
  margin: 0 0 1rem;
}

.legal-page-content ul,
.legal-page-content ol {
  margin: 0 0 1.25rem;
  padding-left: 1.5rem;
}

.legal-page-content li + li {
  margin-top: 0.45rem;
}

.legal-page-content a {
  color: var(--accent-primary);
  font-weight: 700;
}

.legal-page-content a:hover {
  color: var(--hover-primary);
}

/* Centro Legal
   ============================================================ */

.legal-document-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.legal-document-card {
  display: block;
  min-width: 0;
  padding: 1.4rem;
  background: var(--surface-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-body);
  text-decoration: none;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease;
}

.legal-document-card:hover {
  background: var(--surface-elevated);
  border-color: var(--accent-primary);
  transform: translateY(-3px);
}

.legal-document-card h2 {
  margin-bottom: 0.65rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.legal-document-card p {
  margin: 0;
  line-height: 1.6;
}

/* Responsive
   ============================================================ */

@media (max-width: 700px) {
  .legal-page {
    padding: 24px 18px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .legal-page-header h1 {
    font-size: clamp(2rem, 11vw, 2.8rem);
  }

  .legal-document-grid {
    grid-template-columns: 1fr;
  }

  .legal-document-navigation {
    flex-direction: column;
  }

  .legal-document-navigation a {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}