/* ============================
   Diseño moderno – 2025
   ============================ */

/* Variables y escalas */
:root {
  --bg-page: #f6f5f2;
  --bg-card: #ffffff;
  --text: #1f2937;
  --text-soft: #000000;
  --brand: #7a1b1f; /* vino */
  --brand-2: #f59e0b; /* maíz */
  --stroke: #e5e7eb;
  --shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  --radius: 16px;

  --font-sans: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Ubuntu,
    "Helvetica Neue", Arial, sans-serif;
  --font-ser: "Merriweather", Georgia, "Times New Roman", serif;

  --container: 1120px;
}

/* Reset suave */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  color: var(--text);
  background: var(--bg-page) url(images/background2.jpg) center top / cover
    fixed no-repeat;
  font: 16px/1.6 var(--font-sans);
}
img {
  max-width: 100%;
  display: block;
}
a {
  color: var(--brand);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Utilidades */
.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}
.subtitle {
  font: 700 1.525rem var(--font-sans);
  color: var(--brand);
  letter-spacing: 0.2px;
}
.lead {
  font: 400 1.225rem var(--font-ser);
  color: var(--text);
}

.section {
  padding-block: clamp(0rem, 3vw, 1rem);
}
.section-head {
  margin-bottom: 1rem;
}
.section-head h2 {
  margin: 0 0 0.25rem;
  font: 800 clamp(1.4rem, 1.8vw, 1.9rem) var(--font-sans);
  text-align: center;
}
.section-note {
  margin: 0;
  color: var(--text-soft);
}

/* Header + Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(1.2) blur(6px);
  background: color-mix(in srgb, #ffffff 80%, transparent);
  border-bottom: 1px solid var(--stroke);
}
.header-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}
.brand-text {
  font-weight: 800;
  letter-spacing: 0.1px;
  color: #111827;
  font-size: 18px;
}

/* Nav */
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.25rem;
}
.site-nav a {
  display: inline-block;
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 18px;
  color: #374151;
}
.site-nav a.active,
.site-nav a:hover {
  background: #ffffff;
  box-shadow: var(--shadow);
  text-decoration: none;
}

/* Toggle móvil */
.nav-toggle {
  display: none;
}
.nav-toggle-btn {
  display: none;
  width: 44px;
  height: 36px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--stroke);
  cursor: pointer;
}
.nav-toggle-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: #111827;
  margin: 4px 0;
  transition: transform 0.2s ease;
}

/* Hero */
.hero {
  position: relative;
  background: linear-gradient(
      180deg,
      rgba(255, 176, 176, 0.85),
      rgba(255, 255, 255, 0.9)
    ),
    url(images/content_bg_low.jpg) center/cover no-repeat;
  border-bottom: 1px solid var(--stroke);
}
.hero-inner {
  text-align: center;
  padding-block: clamp(2.5rem, 8vw, 5rem);
}
.hero-badge {
  width: 96px;
  height: 96px;
  margin-inline: auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ffffff;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
}
.hero h1 {
  margin: 1rem 0 0.25rem;
  font: 800 clamp(1.8rem, 4vw, 3rem) var(--font-sans);
  letter-spacing: 0.2px;
  color: #111827;
}
.cta-row {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  display: inline-block;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: transform 0.06s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:active {
  transform: translateY(1px);
}
.btn.primary {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow);
}
.btn.primary:hover {
  background: color-mix(in srgb, var(--brand) 90%, #000 10%);
  text-decoration: none;
}
.btn.outline {
  background: #fff;
  border-color: var(--stroke);
  color: #111827;
}
.btn.link {
  padding: 0.5rem 0;
  border: 0;
  color: var(--brand);
  font-weight: 700;
}

/* Cards & Grid */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 3vw, 1.5rem);
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: grid;
}
.card.wide {
  border-radius: var(--radius);
}
.media-link {
  display: block;
}
.media-link img {
  width: 100%;
  height: auto;
  object-fit: cover;
}
.card-body {
  padding: 1rem;
}
.card-title {
  margin: 0 0 0.25rem;
  font: 800 1.125rem var(--font-sans);
}
.card p {
  margin: 0 0 0.5rem;
  color: var(--text-soft);
}

/* Drawer lateral (sin JS) */
.drawer {
  position: fixed;
  right: 1rem;
  top: 6rem;
  z-index: 40;
}
.drawer-toggle {
  display: none;
}
.drawer-tab {
  width: 40px;
  height: 40px;
  border-radius: 10px 0 0 10px;
  background: #232526;
  cursor: pointer;
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
}
.drawer-tab::after {
  content: "≡";
  color: #fff;
  font-weight: 800;
  font-family: ui-sans-serif, system-ui;
}
.drawer-panel {
  position: absolute;
  right: 40px;
  top: 0;
  width: 0;
  overflow: hidden;
  background: #f9fafb;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  box-shadow: var(--shadow);
  transition: width 0.25s ease;
}
.drawer-content {
  padding: 1rem;
  width: min(80vw, 260px);
}
.drawer h3 {
  margin: 0 0 0.5rem;
  font: 800 0.9rem var(--font-sans);
  color: var(--brand);
}
.list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}
.list li {
  margin: 0.4rem 0;
}
.search {
  display: flex;
  gap: 0.5rem;
}
.search input {
  flex: 1;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  padding: 0.5rem 0.75rem;
  background: #fff;
}
.search button {
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: #fff;
  padding: 0.5rem 0.75rem;
}

/* Toggle behavior */
.drawer-toggle:checked ~ .drawer-panel {
  width: min(80vw, 260px);
}
.nav-toggle:checked ~ .nav-toggle-btn span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-toggle:checked ~ .nav-toggle-btn span:nth-child(2) {
  opacity: 0;
}
.nav-toggle:checked ~ .nav-toggle-btn span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}
.nav-toggle:checked ~ .site-nav {
  transform: translateY(0%);
  opacity: 1;
  pointer-events: auto;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--stroke);
  background: #470101;
  color: #e5e7eb;
}
.footer-inner {
  padding-block: 1.25rem;
  display: grid;
  gap: 0.25rem;
  justify-items: center;
  font-size: 0.95rem;
}

/* Responsivo */
@media (max-width: 960px) {
  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 720px) {
  .header-inner {
    grid-template-columns: 1fr auto auto;
  }
  .nav-toggle-btn {
    display: inline-flex;
  }
  .site-nav {
    position: absolute;
    inset: calc(64px + 8px) 0 auto 0;
    background: #fffce5;
    border-top: 1px solid var(--stroke);
    transform: translateY(-8%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
  .site-nav ul {
    flex-direction: column;
    padding: 0.5rem;
  }
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .site-nav ul {
    flex-direction: column;
    padding: 0.5rem;
    gap: 0.25rem; /* un poquito de aire entre items */
  }

  /* Cada link ocupa todo el ancho y el texto va centrado */
  .site-nav a {
    display: block;
    text-align: center;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem; /* esquinas suaves para cada botón */
  }

  .site-nav {
    position: absolute;
    inset: calc(64px + 8px) 0 auto 0;
    background: #fffce5;
    border-top: 1px solid var(--stroke);
    transform: translateY(-8%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;

    /* 👇 toques estéticos */
    border-radius: 0 0 1.25rem 1.25rem; /* redondea las esquinas inferiores */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15); /* sombra suave */
    width: calc(100% - 1.5rem);
    margin: 0 auto;
  }
  .site-nav a:hover {
    background: #f7f3f3; /* o algún tono claro de tu paleta */
  }
}

/* Accesibilidad y motion */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* ===================== Sección VIDEOS (limpia y moderna) ===================== */

/* Grid base: 1 columna por defecto */
.video-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1rem, 2.5vw, 1.75rem);
  align-items: start;
}

/* Desktop/Tablet: dos columnas */
@media (min-width: 900px) {
  .video-grid.two-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Bloque de cada video: título fuera + tarjeta */
.video-section {
  display: flex;
  flex-direction: column;
  gap: 0.55rem; /* espacio entre título y tarjeta */
  align-items: center; /* centra el título */
}

/* Título del video (fuera de la tarjeta) */
.video-title {
  margin: 0;
  text-align: center;
  color: #000000;
  font: 1000 clamp(1rem, 1.4vw, 4rem) var(--font-sans);
}

/* Tarjeta que envuelve el iframe */
.video-card {
  width: 80%;
  background: var(--bg-card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.video-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

/* Contenedor 16:9 del iframe (responsivo) */
.ratio {
  aspect-ratio: 16 / 9;
  width: 100%;
  background: #000; /* evita “parches” antes de cargar */
}
.ratio iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

/* -------------------------------------------------------------------------- */
/* ===================== Estilo de container para videos ===================== */

/* Aplica a todos los contenedores dentro de secciones de video */
.section .container {
  background: linear-gradient(135deg, var(--c7), var(--c6)); /* Blanco → rojo */
  border-radius: 1.25rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  margin-inline: auto;
  margin-bottom: 1rem;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* Encabezado dentro del container */
.section .section-head h2 {
  color: var(--brand);
  font: 800 clamp(1.3rem, 1.8vw, 1.8rem) var(--font-sans);
  margin-top: 0;
}
.section .section-note {
  color: var(--text-soft);
  font-size: 0.95rem;
  margin-bottom: 1.2rem;
}

/* ===================== Libros ===================== */

/* Espaciado contenido solo para esta página */
.books-section {
  padding-block: clamp(1rem, 2vw, 1.6rem);
}

/* Container con contraste */
.books-container {
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 1.25rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  padding: clamp(1.25rem, 3vw, 2rem);
}

/* Header */
.books-container .section-head h2 {
  color: var(--brand);
  margin: 0 0 0.25rem;
}
.books-container .section-note {
  color: var(--text-soft);
  margin: 0 0 1rem;
}

/* Grids */
.books-grid {
  display: grid;
  gap: clamp(1rem, 2vw, 1.4rem);
  align-items: stretch;
}
.books-grid.row-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  width: 70%; /* muy importante */
  margin: 0 auto; /* centra el bloque */
}

.books-grid.row-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.books-grid.row-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.books-grid + .books-grid {
  margin-top: clamp(1rem, 2vw, 1.4rem);
}

/* Responsive */
@media (max-width: 1200px) {
  .books-grid.row-3,
  .books-grid.row-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 700px) {
  .books-grid.row-3,
  .books-grid.row-4 {
    grid-template-columns: 1fr;
  }

  .books-grid.row-2 {
    display: grid;
    grid-template-columns: repeat(1, 1fr); /* dos columnas iguales */
    gap: 1rem;
    width: 100%; /* el conjunto ocupa solo el 40% */
    margin: 0 auto; /* centra el bloque */
  }
}

/* Card */
.book-card {
  background: var(--bg-card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.book-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
}

/* Portada clickable (3:4, centrada) */
.book-cover {
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 4;
  padding: 0.75rem;
  border-bottom: 1px solid var(--stroke);
  background: radial-gradient(
    120% 60% at 100% 0%,
    #fafafa 0%,
    #f5f5f5 60%,
    #f1f1f1 100%
  );
  text-decoration: none;
}
.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.25s ease;
  display: block;
}
.book-card:hover .book-cover img {
  transform: scale(1.03);
}

@media (max-width: 768px) {
  .book-card {
    display: grid;
    grid-template-areas:
      "title"
      "desc"
      "cover";
    justify-items: center;
    text-align: center;
  }

  /* Asignamos cada parte a un área */
  .book-title {
    grid-area: title;
  }

  .book-sub {
    grid-area: desc;
    margin-bottom: 1rem;
  }

  .book-cover-lista {
    grid-area: cover;
    width: 80%;
    max-width: 350px; /* opcional */
    margin: 1rem auto 1.5rem; /* 👈 margen inferior para separar */
    display: flex; /* 👈 fuerza el centrado */
    justify-content: center;
  }

  .book-cover img {
    width: 100%;
    height: auto;
  }
}

/* Texto */
.book-body {
  padding: 0.9rem 0.95rem 1rem;
  text-align: center;
}
.book-title {
  margin: 0 0 0.25rem;
  font: 800 1rem var(--font-sans);
  color: #111827;
}
.book-sub {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.9rem;
}

/* Aviso */
.notice {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--stroke);
  border-left: 4px solid var(--brand);
  border-radius: 0.75rem;
  background: #fffdfa;
  color: #374151;
  font-size: 0.95rem;
}
.adobe-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.adobe-badge img {
  height: 32px;
  width: auto;
  display: block;
}
.adobe-badge small {
  color: var(--text-soft);
}

/* ======= Book detail (clean) ======= */

/* Contraste del contenedor */
.book-container {
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 1.25rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  padding: clamp(1.25rem, 3vw, 2rem);
}

/* Layout: mobile 1 columna, desktop 2 columnas */
.book-layout {
  display: grid;
  grid-template-columns: 1fr; /* base: mobile */
  gap: clamp(1rem, 3vw, 2rem);
  align-items: start;
}

.book-layout--center {
  max-width: 420px; /* ancho del bloque del libro (ajustá a gusto) */
  margin: 0 auto; /* lo centra horizontalmente en la página */
}

@media (min-width: 1024px) {
  .book-layout {
    grid-template-columns: 360px minmax(0, 1fr);
  }
}

/* Aside (portada + meta + CTA) */
.book-aside {
  display: grid;
  gap: 1rem;
}
@media (min-width: 1024px) {
  .book-aside {
    position: sticky; /* sticky solo en desktop */
    top: calc(var(--header-h, 64px) + 16px);
    align-self: start;
    z-index: 1;
    max-height: calc(100dvh - var(--header-h, 64px) - 24px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.book-cover {
  aspect-ratio: 3 / 4;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: radial-gradient(
    120% 60% at 100% 0%,
    #fafafa 0%,
    #f5f5f5 60%,
    #f1f1f1 100%
  );
  display: grid;
  place-items: center;
  overflow: hidden;
}
.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.btn-solid.pdf:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

/* Columna derecha */
.book-main {
  display: grid;
  gap: 1.25rem;
}

.book-summary h3,
.book-index h3 {
  margin: 0 0 0.25rem;
  font: 800 1.15rem var(--font-sans);
  color: var(--brand);
}
.book-summary p {
  margin: 0 0 0.6rem;
  color: var(--text);
}

/* Lista de capítulos */
.chapter-list {
  --pad: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--stroke);
  border-radius: 0.75rem;
  overflow: hidden;
  background: #fff;
}
.chapter-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: var(--pad);
  border-top: 1px solid var(--stroke);
}
.chapter-list li:first-child {
  border-top: 0;
}
.chapter-list span {
  color: var(--brand);
  font-weight: 600;
}

/* Variante de chapter-list SOLO para la sección de tesis */
.chapter-list--tesis .chapter-item {
  display: grid;
  grid-template-columns: auto 1fr auto; /* portada | título | botón */
  grid-template-areas: "cover title button";
  align-items: center;
  gap: 1rem;
}

/* Contenedor de la portada */
.chapter-list--tesis .chapter-cover {
  grid-area: cover;
  width: 240px;
  height: 320px;
  overflow: hidden;
  border-radius: 0.5rem;
  background: #f5f5f5;
}
/* Imagen de portada */
.chapter-list--tesis .chapter-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* recorta para que llene el marco */
  display: block;
}

.chapter-list--tesis .chapter-block {
  grid-area: title;
}

.chapter-list--tesis .pdf-link {
  grid-area: button;
}

@media (max-width: 768px) {
  .chapter-list--tesis .chapter-item {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "cover"
      "button";
    justify-items: center; /* centra los 3 bloques */
    text-align: center; /* centra el texto del título */
  }

  /* Portada más chica en mobile */
  .chapter-list--tesis .chapter-cover {
    width: 180px; /* más angosta */
    height: auto;
  }

  .chapter-list--tesis .chapter-cover img {
    width: 100%;
    height: auto;
    object-fit: cover;
  }

  .chapter-list--tesis .chapter-block {
    margin-bottom: 0.5rem;
  }

  .chapter-list--tesis .pdf-link {
    margin-top: 0.5rem;
  }
}
.pdf-link {
  display: inline-block;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--brand);
  text-decoration: none;
  background: #fff;
  transition: background 0.15s ease, box-shadow 0.2s ease;
}
.pdf-link:hover {
  background: #fff7ec;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.btn-solid.pdf {
  display: inline-block;
  text-align: center;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transition: transform 0.12s ease, box-shadow 0.18s ease, background 0.2s ease;
  border: no;
}

/* Header/menu por encima del contenido */
:root {
  --header-h: 64px;
}
.site-header {
  z-index: 1000;
}
.nav-toggle-btn {
  z-index: 1002;
}
.site-nav {
  z-index: 1001;
}

/* No recortar el menú sobre el libro */
.books-section,
.book-container {
  position: relative;
  z-index: 0;
  overflow: visible;
}

/* ====== Audios ====== */
.audio-container {
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 1.25rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  padding: clamp(1.25rem, 3vw, 2rem);
}

/* Hero (imagen + texto breve) */
.audio-hero {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 0.75rem;
  margin-bottom: clamp(1rem, 2vw, 1.5rem);
}
.audio-hero img {
  width: min(260px, 50vw);
  height: auto;
}
.audio-hero .lead {
  max-width: 60ch;
  color: var(--text);
}

/* Lista de pistas */
.audio-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--stroke);
  border-radius: 0.75rem;
  overflow: hidden;
  background: #fff;
}
.audio-item {
  display: grid;
  grid-template-columns: 2.5rem 1fr minmax(260px, 36%);
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--stroke);
}
.audio-item:first-child {
  border-top: 0;
}

.track-num {
  font: 800 1rem var(--font-sans);
  color: var(--brand);
  text-align: center;
}
.track-title {
  color: var(--text);
  font-weight: 700;
}
.track-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.track-actions audio {
  width: 100%;
  max-width: 100%;
  height: 36px;
}
.btn-pill.sm {
  padding: 0.4rem 0.7rem;
  font-size: 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: #fff;
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.15s ease, box-shadow 0.2s ease;
}
.btn-pill.sm:hover {
  background: #fff7ec;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

/* Responsive */
@media (max-width: 900px) {
  .audio-item {
    grid-template-columns: 2rem 1fr;
    grid-template-areas:
      "num title"
      "num actions";
    align-items: start;
  }
  .track-num {
    grid-area: num;
  }
  .track-title {
    grid-area: title;
  }
  .track-actions {
    grid-area: actions;
    width: 100%;
  }
}

/* ====== Player inline para el ítem de Presentación ====== */
.chapter-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.chapter {
  border: 1px solid var(--stroke);
  border-radius: 0.75rem;
  background: #fff;
  overflow: hidden; /* une cabecera y audio sin “grietas” */
}
.chapter + .chapter {
  margin-top: 1rem;
}

.row-line {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: var(--pad, 0.9rem);
}
.has-audio .row-line {
  border-bottom: 1px solid var(--stroke);
}

.audio-inline {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.4rem 0.2rem;
}

.audio-inline audio {
  flex: 1 1 auto;
  height: 44px;
  border-radius: 0.6rem;
  background: #fff;
  box-shadow: 0 0 0 1px var(--stroke) inset;
}

/* Botón Abrir (tu versión con píldora) */
.btn-pill.dl {
  white-space: nowrap;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1.5px solid var(--brand);
  background: transparent;
  color: var(--brand);
  font: 700 0.95rem var(--font-sans);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
}
.btn-pill.dl:hover {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 720px) {
  .audio-inline {
    flex-direction: column;
    align-items: stretch;
  }
  .audio-inline audio {
    width: 100%;
    min-width: 0; /* evita desbordes raros del control */
    display: block;
  }
  .btn-pill.dl {
    text-align: center;
  }
}

/* Subtítulo del audio */
.audio-title {
  width: 100%;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--brand);
  margin-top: -0.2rem; /* ajusta leve separación */
  margin-bottom: 0rem; /* espacio sobre el player */
  letter-spacing: 0.02em;
}
/* EStilo portadas */
html {
  scroll-behavior: smooth;
}

.hero h1 {
  font-family: "Yeseva One", serif;
  font-size: clamp(2.4rem, 0.5vw, 3.5rem);
  color: #3b1c14;
  line-height: 1.25;
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.hero .subtitle {
  font-family: "Alegreya Sans", sans-serif;
  font-size: clamp(1.2rem, 2vw, 1.9rem);
  color: #a32020;
  font-weight: 700;
  margin-bottom: 1.25rem;
  letter-spacing: 0.04em;
}

.hero .lead {
  font-family: "Alegreya Sans", sans-serif;
  font-size: clamp(1.15rem, 1.4vw, 1.2rem);
  line-height: 1.7;
  color: #3a2b27;
  font-weight: 700; /* ← subilo de 400 a 600 o incluso 700 */
  max-width: 850px;
  margin: 0 auto;
}
.hero .lead-integrantes {
  font-family: "Alegreya Sans", sans-serif;
  font-size: clamp(1rem, 1vw, 1.2rem);
  line-height: 1.7;
  color: #3a2b27;
  font-weight: 700; /* ← subilo de 400 a 600 o incluso 700 */
  max-width: 850px;
  margin: 0 auto;
  font-style: oblique;
  margin-top: 1rem;
}

.hero .cta-row {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/*Estilo TrabajarAula*/
/* Pila vertical de una sola columna */
.stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1rem, 3vw, 1.5rem);
}

/* Card partida en dos columnas internas */
.card.split-card {
  display: grid;
  grid-template-columns: 1fr; /* mobile: 1 columna */
  overflow: hidden;
}
@media (min-width: 900px) {
  .card.split-card {
    grid-template-columns: 1.1fr 1fr; /* izquierda un poco más ancha */
    min-height: 320px;
  }
}

/* Lado imagen / media */
.split-media {
  display: block;
  background: #f8f8f8;
}
.split-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Lado texto */
.split-body {
  padding: clamp(1rem, 3vw, 1.25rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
}
.split-body .card-title {
  margin: 0;
}
.split-body p {
  margin: 0;
  color: var(--text-soft);
}
.split-body .btn.link {
  align-self: flex-start;
}

/* SOLO versión móvil */
@media (max-width: 768px) {
  .split-card {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
      "body"
      "media";
    gap: 1rem;
  }

  .split-media {
    grid-area: media;
  }

  .split-body {
    grid-area: body;
    text-align: center;
    padding: 0 1rem;
  }

  .split-body .card-title {
    margin-top: 0.5rem;
  }

  /* margen para separar el video */
  .split-media {
    margin-top: 1rem;
  }
  .split-card .btn.link {
    display: none;
  }
}

/* Video: usa contenedor 16:9 y llena el lado izquierdo */
.ratio {
  aspect-ratio: 16/9;
  width: 100%;
  background: #000;
}
.ratio iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* En mobile, que la media tenga una proporción agradable */
@media (max-width: 899px) {
  .split-media {
    aspect-ratio: 16/9;
  }
}

/* (Opcional) un hover suave consistente con tus cards */
.card.split-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}

/* ===== Sección 3 columnas previa al Material multimedia ===== */

.section-categorias {
  background: #f59e0b; /* tono suave, combina con tu fondo */
}

.category-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* columnas grandes */
.category-column {
  border-radius: 32px;
  padding: 2rem 1.5rem 1.75rem;
  color: #fff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

/* Colores usando tu paleta:
   color1: #e4c849
   color3: #736111
   color5: #a9bdd1
*/
.category-aula {
  background: #e4c849;
}

.category-reflexion {
  background: #a9bdd1;
}

.category-comunidad {
  background: #7a1b1f;
}

.category-title {
  font-family: "Yeseva One", serif;
  font-size: 1.2rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

/* fila de las dos tarjetas internas */
.subcard-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

/* tarjeta interna */
.subcard {
  position: relative;
  width: 240px;
  height: 240px;
  max-width: 100%;
  border-radius: 24px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

/* imagen de fondo */
.subcard-media {
  position: absolute;
  inset: 0;
}

.subcard-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.45s ease, transform 0.45s ease, filter 0.45s ease;
}

/* capa ligera de color para el efecto al pasar el mouse */
.subcard::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.05),
    rgba(0, 0, 0, 0.35)
  );
  opacity: 0;
  transition: opacity 0.45s ease;
}

/* texto que baja desde arriba */
.subcard-label {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -130%); /* empieza “fuera” arriba */
  font-family: "Alegreya Sans", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: #ffffff;
  text-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
  letter-spacing: 0.03em;
  transition: transform 0.45s ease;
  text-align: center;
}

/* efecto hover / foco teclado */
.subcard:hover .subcard-media img,
.subcard:focus-visible .subcard-media img {
  opacity: 0.25;
  transform: scale(1.05);
  filter: blur(3px);
}

.subcard:hover::before,
.subcard:focus-visible::before {
  opacity: 1;
}

.subcard:hover .subcard-label,
.subcard:focus-visible .subcard-label {
  /* baja hacia el centro de la tarjeta */
  transform: translate(-50%, 140%);
}

/* responsive: en móviles, que las columnas no queden tan altas */
@media (max-width: 768px) {
  .category-column {
    padding: 1.5rem 1rem 1.5rem;
  }

  .subcard {
    width: 100%;
    height: 260px;
  }
}

/* ===== Paleta base ===== */
:root {
  --c1: #d6a82f; /* dorado */
  --c2: #e1da8d; /* amarillo suave */
  --c3: #34290e; /* marrón oscuro */
  --c4: #95b061; /* verde */
  --c5: #b3c0bd; /* gris verdoso */
  --c6: #7a1b1f; /* Tinto*/
  --c7: #fff0f0;
  --c8: #4b1919; /* Tinto*/
}

/* ===== Sección mapa Textos / Multimedia ===== */

.section-mapa {
  padding-top: 3rem;
  padding-bottom: 4rem;
}

/* Fondo del contenedor de la sección (amarillo suave) */
.section-mapa .container {
  background: var(--c8);
  border-radius: 32px;
  padding: 2rem 1.5rem;
}

/* Cada bloque (Textos / Multimedia) */
.content-group {
  background: linear-gradient(135deg, var(--c7), var(--c6)); /* Blanco → rojo */
  border-radius: 32px;
  padding: 1rem 1.1rem 2.2rem;
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.content-group + .content-group {
  margin-top: 2.5rem; /* espacio entre Textos y Multimedia */
}

.content-group-title {
  font-family: "Yeseva One", serif;
  font-size: 2.3rem;
  text-align: center;
  margin-bottom: 1.7rem;
  color: #333232;
}

/* Grilla 2x2 */
.content-grid {
  display: grid;
  justify-items: center;
  gap: 1.5rem 2.5rem;

  grid-template-columns: repeat(
    2,
    minmax(230px, 1fr)
  ); /* 2 columnas, un poco más angostas */
  column-gap: 1.25rem; /* separación horizontal más chica */
  row-gap: 1.5rem; /* separación vertical */
  max-width: 900px; /* opcional: que el bloque no se estire tanto */
  margin: 0 auto; /* centra la grilla dentro del contenedor */
}

/* ===== Tarjetas 400 x 240 ===== */

.content-card {
  position: relative;
  width: 400px;
  height: 240px;
  border-radius: 24px;
  background: #ffffff;

  text-decoration: none;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Imagen poco visible al inicio */
.content-card-media {
  position: absolute;
  inset: 0;
}

.content-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.2; /* lavada */
  filter: blur(2px) grayscale(20%);
  transform: scale(1.05);
  transition: opacity 0.45s ease, filter 0.45s ease, transform 0.45s ease;
}

/* Capa para lectura del texto */
.content-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.5); /* mitad blanco, no bloquea la imagen */
  transition: background 0.35s ease;
  text-decoration: none;
}

/* Texto interno más grande */
.content-card-label {
  position: relative;
  z-index: 1;
  font-family: "Alegreya Sans", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: 1.6rem; /* más grande */
  line-height: 1.35;
  text-align: center;
  color: var(--c3); /* marrón oscuro */
  opacity: 1;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ===== HOVER / FOCUS ===== */

/* La imagen se aprecia completamente */

.content-card-media img {
  opacity: 0.3;              /* casi invisible */
  filter: blur(4px) grayscale(40%);
  transform: scale(1.05);
  transition: opacity .4s ease, filter .4s ease, transform .4s ease;
}

.content-card-label {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .3s ease, transform .3s ease;
}

.content-card.active .content-card-media img {
  opacity: 1;
  filter: blur(0) grayscale(0);
  transform: scale(1.02);
}

.content-card.active .content-card-label {
  opacity: 0;
  transform: translateY(10px);
}

/* Para que el link no tenga subrayado ni cambie de color */
a.content-card {
  text-decoration: none;
  color: inherit;
}

/* Aseguramos que el texto tampoco tenga subrayado */
a.content-card .content-card-label {
  text-decoration: none;
}

/*Modificacion 05/12/25*/



/* ===== Responsive Index===== */
@media (max-width: 1024px) and (min-width: 769px) {
  .content-grid {
    max-width: 760px;     /* un poco más angosto que desktop */
    column-gap: 1.5rem;
    row-gap: 1.5rem;
  }

  .content-card {
    width: 100%;
    max-width: 320px;     /* 👈 límite de ancho por tarjeta en tablet */
  }
}

@media (max-width: 768px) {
  .section-mapa .container {
    padding: 1.7rem 1rem;
    border-radius: 24px;
  }

  .content-group {
    padding: 1.7rem 1.1rem 2.1rem;
  }

  .content-grid {
    grid-template-columns: minmax(280px, 1fr); /* una columna bien ancha */
    justify-content: center; /* centra la columna */
    justify-items: center;
    max-width: 100%;
  }

  .content-card {
    width: 100%;
    max-width: 360px; /* tope para que no queden enormes en móviles grandes */
  }
}
/*Indice textos*/
.chapter-block {
  display: flex;
  flex-direction: column; /* Título arriba, descripción abajo */
}

.chapter-title-indice {
  font-weight: 700;
  font-size: 1rem;
  color: #490000; /* Podés cambiarlo por tu paleta */
  margin-bottom: 0.25rem; /* Espacio entre título y descripción */
}

.chapter-desc {
  font-size: 0.95rem;
  opacity: 0.95;
  line-height: 1.4;
}

.split-media .image-wrapper {
  width: 100%;
  height: 100%;
  max-height: 420px;          /* ajustá si querés más/menos alto */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 16px;
  background: #f5f5f5;        /* fondo neutro por si la imagen no cubre */
}

.split-media .image-wrapper img {
  width: 100%;
  height: 100%;
  max-height: 420px;
  object-fit: cover;          /* se adapta sin deformarse */
  object-position: center top;/* prioriza el rostro */
  display: block;
}

/* ===== Lightbox / Modal de imagen ===== */

.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}

.lightbox.is-open {
  display: block;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  animation: lbFadeIn 180ms ease;
}

.lightbox-dialog {
  position: relative;
  width: min(92vw, 900px);
  margin: 6vh auto 0;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  animation: lbPopIn 220ms ease;
}

.lightbox-img {
  width: 100%;
  height: min(78vh, 700px);
  object-fit: contain; /* para que no se deforme */
  background: #111;    /* marco oscuro */
  display: block;
}

.lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: rgba(255,255,255,0.9);
  color: #111;
  font-size: 26px;
  line-height: 1;
  display: grid;
  place-items: center;
}

@keyframes lbFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes lbPopIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 768px) {
  .btn-always-visible {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}

.zoomable {
  cursor: zoom-in;
}

.zoomable:active {
  transform: scale(0.99);
}

/* ===== Lightbox / Modal ===== */
.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}

.lightbox.is-open {
  display: block;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  animation: lbFadeIn 160ms ease;
}

.lightbox-dialog {
  position: relative;
  width: min(92vw, 980px);
  margin: 6vh auto 0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  background: #111;
  animation: lbZoomIn 220ms ease;
  transform-origin: center;
}

.lightbox-img {
  width: 100%;
  height: min(80vh, 760px);
  object-fit: contain;
  display: block;
  background: #111;
}

.lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: rgba(255,255,255,0.9);
  color: #111;
  font-size: 26px;
  line-height: 1;
  display: grid;
  place-items: center;
}

@keyframes lbFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes lbZoomIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 768px) {
  .split-media .image-wrapper {
    max-height: 320px;   /* ajustá a gusto */
    background: #111;    /* fondo para los “laterales” si sobra espacio */
  }

  .split-media .image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;      /* clave: no recorta */
    object-position: center;  /* centrada */
  }
}

/* ===== Descargas Llamas en la Puna ===== */
.download-list{
  list-style:none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--stroke);
  border-radius: 0.75rem;
  overflow: hidden;
  background: #fff;
}
.download-row{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--stroke);
}
.download-row:first-child{ border-top: 0; }
.download-name{
  font-weight: 800;
  color: var(--text);
}

/* ===== Cómo descargar (imágenes responsivas + zoom) ===== */
.howto{
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
}
.howto li{
  margin: 0.75rem 0;
}
.howto-sub{
  margin-top: 0.75rem;
}
.howto-img{
  margin-top: 0.5rem;
  width: 100%;
  max-width: 760px;
  border-radius: 0.75rem;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  cursor: zoom-in;
}

/* ===== Descargas con video lateral ===== */

.downloads-card {
  padding: 0rem;
}

.downloads-title {
  margin: 0 0 1rem;
  text-align: center;
  font: 900 clamp(1.2rem, 1.6vw, 1.6rem) var(--font-sans);
  color: #111827;
}

.downloads-layout {
  display: grid;
  grid-template-columns: 1fr; /* mobile */
  gap: 1rem;
  align-items: start;
}
.downloads-video {
  display: flex;
  flex-direction: column;
  justify-content: center; /* 👈 clave */
  align-items: center;
  text-align: center;
}


.downloads-video-note {
  margin: 0.6rem 0 0;
  color: var(--text-soft);
  font-size: 0.95rem;
  text-align: center;
}

.downloads-note {
  margin: 1rem 0 0;
  color: var(--text-soft);
}
.downloads-actions{
  display:flex;
  justify-content:center;
}


/* Desktop: video izquierda, lista derecha */
@media (min-width: 900px) {
  .downloads-layout {
    grid-template-columns: 0.9fr 1.1fr; /* izquierda video, derecha lista */
    gap: 1.25rem;
  }
}

/* Opcional: que el video quede “pegado” al hacer scroll en desktop */
@media (min-width: 900px) {
  .downloads-video {
    position: sticky;
    top: calc(var(--header-h, 64px) + 16px);
    padding: 0 1rem;
  }
}
/* Botón "Ver en YouTube" SOLO desktop */
.video-cta-desktop {
  display: flex;
  justify-content: center;
  margin-top: 0.75rem;
}

@media (max-width: 768px) {
  .video-cta-desktop {
    display: none;
  }
}

.video-cta-desktop .btn {
  border-color: #cc0000;
  color: #cc0000;
}

.video-cta-desktop .btn:hover {
  background: #cc0000;
  color: #fff;
}

@media (max-width: 768px) {
  .btn-always-visible {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}