/* Emojis para usar en contenidos y alertas:
📚 Libro/apuntes (por ejemplo para indicar "Temas" en índice)
📅 Calendario (ej: indicar "Semana")
📖 Libro abierto (para enlazar a teoría)
✏️ Lápiz (para ejercicios)
📝 Cuaderno (para exámenes)
⭐ Estrella (para extras)
📦 Caja (para contenido/recursos)
💡 Bombilla (para consejos o tips)
⚠️ Precaución (para advertencias)
📌 Chincheta (para recordatorios)
ℹ️ Información (para notas informativas)
*/

/* ============================= */
/* RESET Y ESTRUCTURA BASE */
/* ============================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #f1f5f9;
  padding: 1.5rem;
  min-height: 100vh;
  background-attachment: fixed;
}

/* Contenedor principal */
.container {
  max-width: 1400px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.container.content-page {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(6px);
  border-radius: 18px;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.4),
    inset 0 0 8px rgba(255, 255, 255, 0.05);
  padding-bottom: 2rem;
  color: #f8fafc;
}

/* Contenido de la página */
.content {
  padding: 2.5rem;
  line-height: 1.7;
}

/* ============================= */
/* TÍTULOS Y ENCABEZADOS */
/* ============================= */

/* Título del tema */
.topic-title {
  color: #1a2332;
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  padding: 2rem 2rem 1rem 2rem;
  border-bottom: 3px solid #10b981;
  margin: 0;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #ffffff 0%, #d1f4e8 20%, #d1f4e8 80%, #ffffff 100%);
  border-radius: 8px 8px 0 0;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
}

/* NIVEL 1: H2 - Títulos Principales (MÁXIMA PROMINENCIA) */
.content h2 {
  position: relative;
  padding-right: 4rem; /* Espacio para el botón */  
  font-size: 1.7rem;
  color: #ffffff !important;
  font-weight: 900;
  letter-spacing: 0.3px;
  text-align: left;
  margin: 2.5rem 0 1.5rem 0;
  padding: 1rem 1.2rem;
  border: 4px solid #047857;
  border-radius: 8px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 
    0 4px 12px rgba(16, 185, 129, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2); /* Brillo interno */
  text-shadow: 
    2px 2px 4px rgba(0, 0, 0, 0.3),
    0 0 10px rgba(255, 255, 255, 0.1); /* Doble sombra */
}

.back-to-summary {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.back-to-summary:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.5);
}

.back-to-summary:active {
  transform: translateY(-50%) scale(0.95);
}

/* NIVEL 2A: H3 - Títulos Secundarios (Prominencia media-alta) */
.content h3 {
  font-size: 1.3rem;
  color: #1e40af; /* Azul medio */
  font-weight: 700;
  letter-spacing: -0.3px;
  text-align: left;
  margin: 2rem 0 1.2rem 0;
  padding: 0.7rem 1rem 0.8rem 1rem;
  border: 2px solid #10b981;
  border-radius: 6px;
  background: linear-gradient(to right, #ecfdf5 0%, #d1fae5 60%, #f0fdf4 100%);
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.08);
}

/* NIVEL 2B: H4 - Títulos Terciarios (Prominencia media) */
.content h4:not(.collapsible-header h4):not(blockquote h4) {
  font-size: 1.2rem;
  color: #2563eb; /* Azul claro */
  font-weight: 700;
  letter-spacing: -0.2px;
  text-align: left;
  margin: 2rem 0 1.2rem 0;
  padding: 0.7rem 1rem 0.8rem 1.25rem;
  border-left: 3px solid #10b981;
  border-radius: 6px;
  background: linear-gradient(to right, #f0fdf4 0%, #ffffff 100%);
  box-shadow: 0 1px 4px rgba(16, 185, 129, 0.04);
}

/* H5 - Nivel 4 */
.content h5 {
  font-size: 1.1rem;
  color: #3b82f6;
  font-weight: 600;
  letter-spacing: -0.2px;
  text-align: left;
  margin: 1.5rem 0 1rem 0;
  padding: 0.6rem 1rem 0.6rem 1.25rem;
  border-left: 2px solid rgba(16, 185, 129, 0.3);
  border-radius: 4px;
  background: linear-gradient(to right, #f0fdf4 0%, #ffffff 100%);
  box-shadow: 0 1px 4px rgba(16, 185, 129, 0.04);
}

/* Subtítulo de página (Teoría/Ejercicios/Exámenes/Extras) */
.page-subtitle {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a2332;
  margin: 1.5rem 2rem 0 2rem;
  padding: 0.75rem 1.5rem;
  letter-spacing: -0.3px;
  background: linear-gradient(to right, #f8fafb 0%, #e0f2fe 20%, #e0f2fe 80%, #f8fafb 100%);
  border-radius: 10px;
  border: 2px solid #bfdbfe;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.08);
}

/* ============================================ */
/* ENLACES DEL RESUMEN A SECCIONES H2 */
/* ============================================ */
.week-summary ul li a.summary-link {
  text-decoration: none;
  color: #1e293b;
  transition: all 0.3s ease;
  display: inline-block;
  position: relative;
  padding-left: 0.5rem;
  font-weight: 500;
}

.week-summary ul li a.summary-link:hover {
  color: #10b981;
  transform: translateX(5px);
}

.week-summary ul li a.summary-link::before {
  content: "→";
  position: absolute;
  left: -1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  color: #10b981;
  font-weight: bold;
}

.week-summary ul li a.summary-link:hover::before {
  opacity: 1;
}

/* Scroll suave */
html {
  scroll-behavior: smooth;
}

/* Destacar sección cuando llegas por anchor */
.content h2:target {
  animation: highlight 2s ease;
}

@keyframes highlight {
  0% {
    background: #fef3c7;
    transform: scale(1.02);
  }
  100% {
    background: inherit;
    transform: scale(1);
  }
}

/* ============================= */
/* TEXTO Y FORMATO */
/* ============================= */

.content p {
  margin-bottom: 1.2rem;
  text-align: justify;
  color: #4a5568;
}

.content b,
.content strong {
  color: #1a2332;
  font-weight: 600;
}

.content u {
  text-decoration: underline;
  text-decoration-color: #10b981;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* Texto destacado */
.content mark {
  background: linear-gradient(to right, #fef3c7 0%, #fef9e7 100%);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  color: #92400e;
  font-weight: 600;
  border-bottom: 2px solid #f59e0b;
  box-shadow: 0 1px 3px rgba(245, 158, 11, 0.1);
}

/* Texto tachado e insertado */
.content del {
  text-decoration: line-through;
  color: #ef4444;
  text-decoration-thickness: 2px;
  background: #fee2e2;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
}

.content ins {
  text-decoration: none;
  color: #10b981;
  font-weight: 600;
  background: #d1fae5;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
}

/* Enlaces */
a {
  color: #3b82f6;
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 500;
  border-bottom: 1px solid transparent;
}

a:hover {
  color: #1e40af;
  border-bottom: 1px solid #1e40af;
}

/* ============================= */
/* LISTAS */
/* ============================= */

/* Listas con viñetas */
ul {
  margin: 1.2rem 0;
  padding-left: 2rem;
}

li {
  margin-bottom: 0.7rem;
  color: #4a5568;
}

/* Listas ordenadas con estilo personalizado */
.content ol {
  counter-reset: item;
  list-style-type: none;
  padding-left: 2.5rem;
  margin: 1.2rem 0;
}

.content ol li {
  counter-increment: item;
  margin-bottom: 0.8rem;
  color: #4a5568;
  position: relative;
  padding-left: 0.5rem;
}

.content ol li::before {
  content: counter(item);
  position: absolute;
  left: -2rem;
  width: 1.5rem;
  height: 1.5rem;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

/* Listas de definiciones (glosario) */
.content dl {
  margin: 2rem 0;
  padding: 1.5rem;
  background: linear-gradient(to bottom, #f8fafb 0%, #ffffff 100%);
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.content dt {
  color: #1a2332;
  font-weight: 700;
  font-size: 1.1rem;
  margin-top: 1.2rem;
  margin-bottom: 0.5rem;
  padding: 0.6rem 1rem;
  background: linear-gradient(to right, #dbeafe 0%, #eff6ff 100%);
  border-left: 4px solid #3b82f6;
  border-radius: 6px;
}

.content dt:first-child {
  margin-top: 0;
}

.content dd {
  color: #4a5568;
  margin-left: 1.5rem;
  margin-bottom: 1.2rem;
  padding-left: 1rem;
  border-left: 2px solid #e2e8f0;
  line-height: 1.7;
  font-size: 0.95rem;
}

/* ============================= */
/* TABLAS */
/* ============================= */

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 2rem 0;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.95rem;
  min-width: 500px;
  border: 3px solid #10b981;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.15);
}

thead {
  background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
}

th {
  background: transparent;
  color: #ffffff;
  font-weight: 700;
  text-align: left;
  padding: 1rem 1.2rem;
  border-bottom: 3px solid #10b981;
  border-right: 3px solid #10b981;
  white-space: nowrap;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
}

th:last-child {
  border-right: none;
}

tbody tr {
  background: #ffffff;
  transition: background-color 0.25s ease;
}

td {
  padding: 1rem 1.2rem;
  border-bottom: 2px solid #10b981; /* VERDE para uniformidad */
  border-right: 2px solid #10b981; /* VERDE para uniformidad */
  color: #4a5568;
}

td:last-child {
  border-right: none;
}

tbody tr:hover {
  background-color: #cbd5e1 !important;
}

tbody tr:hover td {
  background-color: transparent;
}

tbody tr:last-child td {
  border-bottom: none;
}

thead tr:first-child th:first-child {
  border-top-left-radius: 12px;
}

thead tr:first-child th:last-child {
  border-top-right-radius: 12px;
}

tbody tr:last-child td:first-child {
  border-bottom-left-radius: 12px;
}

tbody tr:last-child td:last-child {
  border-bottom-right-radius: 12px;
}

/* ============================= */
/* GRILLAS DE COMPARACIÓN */
/* ============================= */

/* Grilla de 2 columnas */
.two-column-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 2rem 0;
  padding: 1.5rem;
  background: #f8fafb;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
}

.two-column-grid .column {
  padding: 1rem;
  background: #ffffff;
  border-radius: 8px;
  border-left: 4px solid #10b981;
}

.two-column-grid .column h4 {
  color: #1a2332;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
}

.two-column-grid .column p {
  color: #4a5568;
  line-height: 1.6;
}

/* Grilla de 3 columnas */
.three-column-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 2rem 0;
  padding: 1.5rem;
  background: #f8fafb;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
}

.three-column-grid .column {
  padding: 1.2rem;
  background: #ffffff;
  border-radius: 8px;
  border-top: 4px solid #8b5cf6;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
}

.three-column-grid .column:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.three-column-grid .column h4 {
  color: #1a2332;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
  text-align: center;
}

.three-column-grid .column p,
.three-column-grid .column ul {
  color: #4a5568;
  line-height: 1.6;
}

.three-column-grid .column ul {
  padding-left: 1.2rem;
}

/* ============================= */
/* ICONOS INLINE */
/* ============================= */

.icon-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin: 0 0.25rem;
  font-size: 1rem;
  vertical-align: middle;
}

.icon-check {
  color: #10b981;
  font-weight: 700;
}

.icon-cross {
  color: #ef4444;
  font-weight: 700;
}

.icon-star {
  color: #f59e0b;
}

.icon-target {
  color: #3b82f6;
}

.icon-note {
  color: #8b5cf6;
}

/* ============================= */
/* SEPARADORES */
/* ============================= */

.content hr,
.section-divider {
  border: none;
  height: 3px;
  background: linear-gradient(to right, transparent 0%, #10b981 20%, #10b981 80%, transparent 100%);
  margin: 3rem 0;
  border-radius: 2px;
}

.section-divider-dots {
  border: none;
  text-align: center;
  margin: 3rem 0;
  height: auto;
}

.section-divider-dots::before {
  content: "• • •";
  color: #10b981;
  font-size: 1.5rem;
  letter-spacing: 1rem;
}

/* ============================================ */
/* SEPARADOR PRINCIPAL DE APARTADOS */
/* ============================================ */
hr.section-divider-main {
  border: none !important;
  margin: 4rem 0 !important;
  text-align: center;
  position: relative;
  height: 60px !important; /* Altura fija en lugar de auto */
  background: transparent !important;
  display: flex !important; /* Usar flex para centrar */
  align-items: center !important;
  justify-content: center !important;
}

hr.section-divider-main::before {
  content: "━━━━━ 📚 END OF SECTION 📚 ━━━━━";
  color: #10b981;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.15rem;
  text-transform: uppercase;
  display: inline-block;
  background: white;
  padding: 0.5rem 2rem;
  border: 2px solid #10b981;
  border-radius: 50px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
  position: relative; /* Asegurar que no herede position absolute */
  transform: none; /* Resetear cualquier transform heredado */
}

/* Resetear cualquier ::after heredado */
hr.section-divider-main::after {
  content: none !important;
  display: none !important;
}

/* ============================= */
/* CAJAS DE CONTENIDO */
/* ============================= */

/* Caja de resumen semanal */
.week-summary {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 2px solid #93c5fd;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 2rem 2rem 0 2rem;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.week-summary .summary-text {
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #1e40af;
  font-size: 1.05rem;
}

.week-summary ul {
  margin: 0.75rem 0 0 1.5rem;
}

.week-summary li {
  margin-bottom: 0.5rem;
  color: #1e40af;
}

.week-summary a {
  color: #1e40af;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.week-summary a:hover {
  color: #3b82f6;
  text-decoration: underline;
}

/* NIVEL 4: EJEMPLO-BOX Y NOTA-BOX - Grises neutros, MÁS COMPACTOS */
.ejemplo-box,
.nota-box {
  background: linear-gradient(to right, #f8fafc 0%, #ffffff 100%);
  border: 2px solid #cbd5e1;
  border-left: 3px solid #94a3b8;
  border-radius: 10px;
  padding: 1rem 1.25rem; /* Reducido de 1.5rem */
  margin: 1.25rem 0; /* Reducido de 1.5rem */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
}

.ejemplo-box:hover,
.nota-box:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  border-left-color: #10b981;
}

.ejemplo-box h4,
.nota-box h4 {
  color: #475569;
  font-size: 1.05rem; /* Reducido de 1.1rem */
  font-weight: 700;
  margin-bottom: 0.75rem; /* Reducido de 1rem */
  padding-bottom: 0.4rem; /* Reducido de 0.5rem */
  border-bottom: 2px solid #e2e8f0;
}

.ejemplo-box p,
.nota-box p {
  color: #64748b;
  margin-bottom: 0.4rem; /* Reducido de 0.5rem */
  font-size: 0.95rem;
}

/* ============================= */
/* CALLOUTS Y ALERTAS */
/* NIVEL 3: TODOS LOS COLLAPSIBLES - MÁS COMPACTOS */
/* ============================= */

.consejo,
.advertencia,
.recordatorio,
.info,
.ejercicio-rapido,
.dato-curioso {
  padding: 0.75rem 1rem; /* Reducido de 1rem 1.25rem */
  margin: 1.25rem 0; /* Reducido de 1.5rem */
  border-radius: 10px;
  border-left: 5px solid #64748b;
  background: linear-gradient(to right, #f1f5f9 0%, #f8fafc 100%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
}

.consejo:hover,
.advertencia:hover,
.recordatorio:hover,
.info:hover,
.ejercicio-rapido:hover,
.dato-curioso:hover {
  transform: translateX(4px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
  border-left-color: #10b981;
}

.consejo strong,
.advertencia strong,
.recordatorio strong,
.info strong,
.ejercicio-rapido strong,
.dato-curioso strong {
  display: block;
  margin-bottom: 0.4rem; /* Reducido de 0.5rem */
  color: #334155;
  font-size: 1rem; /* Reducido de 1.05rem */
}

/* ============================= */
/* ACORDEONES COLAPSABLES */
/* ============================= */

.collapsible {
  margin: 1.25rem 0; /* Reducido de 1.5rem */
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.collapsible-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 0.75rem 1rem; /* Reducido de 1rem 1.25rem */
  transition: all 0.2s ease;
}

.collapsible:hover .collapsible-header {
  background: rgba(0, 0, 0, 0.02);
}

.collapsible strong {
  font-weight: 600;
  font-size: 1rem; /* Reducido de 1.05rem */
}

.arrow {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: auto;
  position: relative;
}

.arrow::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid #64748b;
  transform: translate(-50%, -50%) rotate(-90deg);
  transition: transform 0.3s ease;
  opacity: 0.7;
}

.collapsible.active .arrow::before {
  transform: translate(-50%, -50%) rotate(0deg);
  opacity: 1;
  border-top-color: #10b981;
}

.collapsible-content {
  display: none;
  padding: 0.75rem 1rem 1rem 1rem; /* Reducido */
  animation: slideDown 0.3s ease;
}

.content .collapsible-content p {
  margin-bottom: 0.7rem; /* Reducido de 0.8rem */
  line-height: 1.6;
}

.content .collapsible-content p:last-child {
  margin-bottom: 0;
}

.content .collapsible-content strong {
  display: inline;
  color: inherit;
  font-weight: 600;
  background: none;
  padding: 0;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.collapsible.active .collapsible-content {
  display: block;
}

/* Iconos automáticos en encabezados - MANTENER emojis diferentes */
.consejo .collapsible-header strong::before {
  content: "💡 ";
}

.advertencia .collapsible-header strong::before {
  content: "⚠️ ";
}

.recordatorio .collapsible-header strong::before {
  content: "📌 ";
}

.info .collapsible-header strong::before {
  content: "ℹ️ ";
}

.ejercicio-rapido.collapsible .collapsible-header strong::before {
  content: "✏️ ";
}

.dato-curioso.collapsible .collapsible-header strong::before {
  content: "💡 ";
}

/* Acordeones anidados */
.collapsible-nested {
  margin: 1rem 0 1rem 1.5rem;
  border-radius: 8px;
  overflow: hidden;
  border-left: 3px solid #cbd5e1;
  background: rgba(255, 255, 255, 0.5);
}

.collapsible-nested .collapsible-header {
  padding: 0.8rem 1rem;
  font-size: 0.95rem;
}

.collapsible-nested strong {
  font-size: 0.95rem;
  color: #475569;
}

.collapsible-nested .collapsible-content {
  padding: 0 1rem 0.8rem 1rem;
  font-size: 0.9rem;
}

.collapsible-nested .arrow {
  width: 14px;
  height: 14px;
}

.collapsible-nested .arrow::before {
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid #64748b;
}

/* Estilos específicos para acordeones anidados */
.consejo .collapsible-nested,
.advertencia .collapsible-nested,
.recordatorio .collapsible-nested,
.info .collapsible-nested {
  border-left-color: #cbd5e1;
  background: rgba(255, 255, 255, 0.5);
}

/* ============================= */
/* MULTIMEDIA */
/* ============================= */

.content img,
.content video,
.content audio {
  max-width: 100%;
  display: block;
  margin: 2rem auto;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.content audio {
  width: 100%;
  margin: 1.5rem 0;
}

/* ============================= */
/* CITAS Y CÓDIGO */
/* ============================= */

/* Citas */
.content blockquote {
  border-left: 5px solid #10b981;
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: #64748b;
  background: linear-gradient(to right, #f0fdf4 0%, transparent 100%);
  padding: 1.25rem 1.5rem;
  border-radius: 0 10px 10px 0;
}

/* Código */
.content pre,
.content code {
  background: #f8fafb;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  overflow-x: auto;
  color: #1e40af;
  border: 1px solid #e2e8f0;
  font-size: 0.9rem;
}

.content pre {
  margin: 1.5rem 0;
}

/* ============================= */
/* TRADUCCIONES */
/* ============================= */

.translation-box {
  margin-top: 1.5rem;
  padding: 1.5rem;
  border-radius: 10px;
  background-color: #f7f7f7;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  color: #555555;
  font-size: 1rem;
}

.translation-box .translation-text {
  margin: 0;
  line-height: 1.6;
  text-align: justify;
}

/* Botón de traducir */
.content button {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.content button:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

/* ============================= */
/* BOTÓN INICIO */
/* ============================= */

.inicio-btn {
  position: absolute;
  top: 1.25rem;
  left: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.3rem;
  background: linear-gradient(135deg, #1a2332 0%, #2d3748 100%);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(26, 35, 50, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.95rem;
  z-index: 10;
}

.inicio-btn::before {
  content: "🏠 ";
  font-size: 1.1rem;
}

.inicio-btn:hover {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
  border-bottom: none;
}

/* ============================= */
/* RESPONSIVE */
/* ============================= */

@media (max-width: 968px) {
  .three-column-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
    padding: 1rem;
  }
}

@media (max-width: 768px) {
  body {
    padding: 1rem;
  }

  .topic-title {
    color: #ffffff;
    text-align: center;
    font-size: 2.1rem;
    font-weight: 800;
    padding: 2rem 2rem 1.2rem 2rem;
    margin: 0;
    letter-spacing: -0.5px;
    background: linear-gradient(to bottom, rgba(30,41,59,0.9) 0%, rgba(15,23,42,0.95) 100%);
    border-bottom: 3px solid #10b981;
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
  }

  .week-summary {
    padding: 1.25rem;
    margin: 1.5rem 1.5rem 0 1.5rem;
  }

  .content {
    padding: 2rem 1.5rem;
  }

  .content h2 {
    font-size: 1.35rem;
  }

  table {
    font-size: 0.85rem;
  }

  th, td {
    padding: 0.75rem 0.9rem;
  }

  .inicio-btn {
    padding: 0.6rem 1.1rem;
    font-size: 0.9rem;
  }

  .two-column-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1rem;
  }

  .content ol {
    padding-left: 2rem;
  }

  .content ol li::before {
    left: -1.5rem;
    width: 1.3rem;
    height: 1.3rem;
    font-size: 0.8rem;
  }

  .ejemplo-box,
  .nota-box {
    padding: 1rem;
  }

  .content dl {
    padding: 1.2rem;
  }

  .collapsible-nested {
    margin-left: 1rem;
  }

  .collapsible-nested .collapsible-header {
    padding: 0.7rem 0.9rem;
  }
}

@media (max-width: 480px) {
  body {
    padding: 0.75rem;
  }

  .topic-title {
    font-size: 1.4rem;
    padding: 1.25rem 1rem 0.6rem 1rem;
  }

  .content {
    padding: 1.5rem 1rem;
  }

  .content h2 {
    font-size: 1.2rem;
  }

  table {
    font-size: 0.8rem;
  }

  th, td {
    padding: 0.6rem 0.7rem;
  }

  .week-summary {
    margin: 1rem;
    padding: 1rem;
  }

  .inicio-btn {
    top: 1rem;
    left: 1rem;
    padding: 0.5rem 0.9rem;
    font-size: 0.85rem;
  }

  .two-column-grid {
    padding: 0.75rem;
  }

  .content ol {
    padding-left: 1.8rem;
  }

  .content dd {
    margin-left: 1rem;
    padding-left: 0.75rem;
  }

  .ejemplo-box,
  .nota-box {
    padding: 0.85rem 1rem;
  }

  .content dl {
    padding: 1rem;
  }

  .collapsible-nested {
    margin-left: 0.5rem;
  }

  .ejercicio-rapido,
  .dato-curioso {
    padding: 0.7rem 0.9rem;
  }
}
