:root {
  --ink: #102a43;
  --emerald: #176b5b;
  --emerald-dark: #0e4d43;
  --gold: #c69b3c;
  --ivory: #fbfaf5;
  --mist: #edf4f0;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: #263f46;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  line-height: 1.65;
  background: radial-gradient(circle at top right, rgba(198, 155, 60, .13), transparent 28%), linear-gradient(180deg, #f7f7f2, var(--mist));
}

.container#contenedor {
  max-width: 1100px;
  width: calc(100% - 2rem);
  margin: 2rem auto;
  padding: 0;
  overflow: hidden;
  border-radius: 20px;
  box-shadow: 0 20px 54px rgba(16, 42, 67, .16);
}

.row { margin: 0; }
.row > .col { padding: clamp(1.25rem, 4vw, 3rem); }
#fila1 { background: linear-gradient(125deg, #102a43, #174e52 60%, #176b5b); }
#fila2, #fila3 { background: var(--ivory); }
#fila3 > .col { padding-top: 0; }

h1.title {
  max-width: 960px;
  margin: 0;
  color: #fff;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.15;
}
.hero-text { max-width: 900px; margin: 1.2rem 0 0; color: #f4f7f3; font-size: clamp(1rem, 2vw, 1.2rem); }
.section-intro { margin-bottom: 1.25rem; }
.section-kicker { display: block; margin-bottom: .35rem; color: #8b6824; font-size: .82rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.section-intro h2 { margin: 0; color: var(--emerald-dark); font-size: clamp(1.4rem, 3vw, 2rem); }
#fila2 p { max-width: 920px; font-size: 1.08rem; }

.list-group { overflow: hidden; border: 1px solid #d6e2dc; border-radius: .9rem; box-shadow: 0 10px 30px rgba(16, 42, 67, .07); }
.list-group-item { display: block; padding: .9rem 1.1rem; color: #145849; font-size: clamp(1rem, 2vw, 1.25rem); text-decoration: none; background: #fffefa; border: 0; border-top: 1px solid #dfe8e3; transition: background-color .2s ease; }
.list-group-item:hover { background: #e8f2ed; color: #0e4d43; }
.list-group-item:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; background: #e8f2ed; }
.module-heading { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem; color: #f7f4ea; background: var(--ink); }
.module-heading .module-number { color: #e5c577; font: 700 1.2rem/1 Georgia, "Times New Roman", serif; letter-spacing: .08em; }
.module-heading div { display: flex; flex-direction: column; line-height: 1.25; }
.module-heading div > span { font-weight: 700; }
.module-heading small { margin-top: .2rem; color: #b9cec7; font-size: .78rem; }
.course-footer { padding: 1.2rem; color: #526861; font-size: .9rem; text-align: center; background: #f3f4ee; border-top: 1px solid #d9e2dc; }

@media (max-width: 767px) {
  .container#contenedor { margin: 1rem auto; }
  .list-group-item { padding: .85rem 1rem; }
}

/* Bloques ejecutables presentes en los temas del curso. */
.tema-page .recuadro-codigo { position: relative; padding-top: 2.9rem; }
.tema-page .run-btn {
  position: absolute;
  top: .55rem;
  right: .65rem;
  padding: .28rem .75rem;
  color: #0e4d43;
  font: 600 .85rem/1.25 "Segoe UI", Arial, sans-serif;
  background: rgba(255, 255, 255, .96);
  border: 1px solid #176b5b;
  border-radius: 999px;
  cursor: pointer;
}
.tema-page .run-btn:hover { background: #edf4f0; transform: translateY(-1px); }
.tema-page .run-btn:focus-visible { outline: 3px solid #c69b3c; outline-offset: 2px; }
.tema-page .resultado-ejecucion {
  margin: -.55rem 0 1.25rem;
  padding: .8rem 1rem;
  overflow-x: auto;
  color: #263f46;
  white-space: pre-wrap;
  background: #edf4f0;
  border: 1px solid #c6dcd2;
  border-left: 4px solid #176b5b;
  border-radius: 6px;
  font: 1rem/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.tema-page .recuadrooculto { display: none; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
