:root {
  --bg-light: linear-gradient(135deg, #1f1427 0%, #5b1f2a 42%, #9f3b2d 100%);
  --bg-accent: linear-gradient(180deg, #f7e6d9 0%, #fff4ec 100%);
  --item-bg: #fffaf5;
  --item-hover: #ffe7d6;
  --link: #7d2d20;
  --shadow: 0 20px 54px rgba(56, 21, 19, .18);
  --radius-lg: 20px;
  --text-soft: #ffe5d6;
  --card-border: rgba(125, 45, 32, .14);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.5;
  color: #3c211c;
  background:
    radial-gradient(circle at top right, rgba(196, 87, 58, .16), transparent 28%),
    radial-gradient(circle at left center, rgba(122, 36, 45, .08), transparent 32%),
    linear-gradient(180deg, #fff8f2 0%, #f8ebe2 100%);
}

/* Layout */
.container#contenedor {
  max-width: 1100px;
  margin: 2rem auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.row { display: flex; flex-wrap: wrap; }
.row > .col { flex: 1 1 100%; padding: 1rem; }
.row.align-right { justify-content: flex-end; }

#fila1 { background: var(--bg-light); }
#fila2 { background: var(--bg-accent); }
#fila3 { background: var(--bg-accent); }

/* Header */
.eyebrow {
  display: inline-block;
  margin: 0 0 .75rem 0;
  padding: .35rem .8rem;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  color: var(--text-soft);
  background: rgba(255,255,255,.08);
  font-size: .95rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
h1.title {
  font-size: clamp(2rem, 6vw, 4em);
  margin: 0 0 .25em 0;
  color: #fff;
  text-shadow: 0 6px 16px rgba(0,0,0,.35);
}
.hero-text {
  max-width: 850px;
  margin: 0;
  color: var(--text-soft);
  font-size: clamp(1rem, 2vw, 1.2rem);
}
.header-actions { text-align: right; }
.header-actions a { display: inline-block; margin: .5rem 1rem .5rem 0; }

.btn {
  display: inline-block;
  padding: .5rem 1rem;
  border-radius: .375rem;
  text-decoration: none;
  font-weight: 600;
  transition: filter .15s ease-in-out;
}
.btn:hover { filter: brightness(0.95); }
.btn-success { background: #198754; color: #fff; }

.course-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.highlight-card {
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(125, 45, 32, .12);
  box-shadow: 0 10px 26px rgba(125, 45, 32, .10);
}

.highlight-label {
  display: block;
  margin-bottom: .35rem;
  color: #8f5b4f;
  font-size: .92rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.highlight-card strong {
  color: #4b1e18;
  font-size: 1.05rem;
}

.section-intro {
  margin-bottom: 1.25rem;
}

.section-intro h2 {
  margin: 0 0 .35rem 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: #68251d;
}

.section-intro p {
  margin: 0;
  color: #75463d;
}

/* Menu list */
.list-group { box-shadow: 0 10px 28px rgba(11, 33, 55, .14); border-radius: .9rem; overflow: hidden; border: 1px solid var(--card-border); }
.list-group#menu { font-size: 1.5em; }
.list-group-item {
  display: block;
  padding: 1.05rem 1rem;
  background: var(--item-bg);
  color: var(--link);
  text-decoration: none;
  font-weight: 400;
  border-top: 1px solid #f0d8ca;
  transition: background-color .2s ease, transform .2s ease, padding-left .2s ease;
}
.list-group-item:first-child { border-top: 0; }
.list-group-item:hover {
  background: var(--item-hover);
  transform: translateX(4px);
  padding-left: 1.2rem;
}

.list-group-item.is-active {
  background: linear-gradient(90deg, #ffe0cf 0%, #fff2e8 100%);
  box-shadow: inset 4px 0 0 #c45138;
}


.text-center { text-align: center; }
.container#contenedor p { font-weight: 400; }
.pagination { list-style: none; padding: 0; margin: 1rem 0; }
.pagination li { display: inline-block; margin: 0 .25rem; }
.pagination a { display: inline-block; padding: .5rem .75rem; background: #fff; border: 1px solid #ddd; border-radius: .25rem; text-decoration: none; color: inherit; }
.pagination .active a { background: #e9ecef; }

@media (min-width: 768px) {
  .row > .col { flex: 1 1 50%; }
  #fila1 > .col:first-child { flex: 1 1 70%; } /* Title column */
  #fila1 > .col:last-child { flex: 1 1 30%; } /* Buttons column */
  #fila2 .col, #fila3 .col { flex-basis: 100%; }
}

/* En páginas de tema, usar columna de ancho completo tambien en pantallas grandes */
@media (min-width: 768px) {
  body.tema-page .row > .col {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

body.tema-page {
  background:
    radial-gradient(circle at top left, rgba(196, 87, 58, .13), transparent 30%),
    radial-gradient(circle at bottom right, rgba(91, 31, 42, .10), transparent 35%),
    linear-gradient(180deg, #fff8f2 0%, #f6e7dd 100%);
}
.tema-page .container#contenedor { padding: 1rem; }
.titulodetalle {
  background: linear-gradient(135deg, #1f1427 0%, #5b1f2a 48%, #9f3b2d 100%);
  border-radius: 18px;
  box-shadow: 0 20px 46px rgba(56, 21, 19, .22);
  padding: 1.25rem 1.4rem;
  margin: 1rem 0 2rem 0;
}
.titulodetalle h1 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  color: #fff;
  text-shadow: 0 6px 16px rgba(0,0,0,.35);
}
.tema-page .titulodetalle .eyebrow { margin-bottom: .6rem; }
.tema-page .titulodetalle .hero-text {
  margin-top: .75rem;
  max-width: 900px;
}
.cuerpodetalle {
  background: linear-gradient(180deg, rgba(255,255,255,.96) 0%, rgba(255, 246, 240, .98) 100%);
  border: 1px solid #eed4c5;
  border-radius: 18px;
  padding: 1.25rem 1.4rem;
  box-shadow: 0 18px 40px rgba(79, 35, 26, .10);
  margin-bottom: 2rem;
  font-size: 1.05rem;
}
.cuerpodetalle p { margin: 0 0 1em 0; text-align: justify; text-justify: inter-word; color: #4a2d27; font-weight: 400; }
.cuerpodetalle h2 {
  margin: 1.6rem 0 .6rem;
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  color: #7d2d20;
}
.cuerpodetalle section:first-of-type h2 { margin-top: 0; }
.cuerpodetalle ul { padding-left: 1.25rem; margin: 0 0 1em 0; }
.cuerpodetalle ol { padding-left: 1.25rem; margin: 0 0 1em 0; }
.cuerpodetalle li { color: #4a2d27; font-weight: 400; }
.cuerpodetalle a { color: #9a3827; }
.tema-page .table {
  --bs-table-striped-bg: rgba(255, 233, 220, .56);
}
.tema-page .table thead th {
  background: #f6ddd0;
  color: #5e231a;
}
.recuadro {
  background: linear-gradient(180deg, #fff8f4 0%, #fff0e6 100%);
  text-align:left;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size:1rem;
  padding:.75rem 1rem;
  border: 1px solid #e6b69c;
  border-left: 4px solid #c45138;
  border-radius: 6px;
  color: #5a2b22;
  box-shadow: 0 8px 20px rgba(125, 45, 32, .08);
  overflow-x:auto;
  margin: .75rem 0 1.25rem 0;
  position: relative;
}

.recuadro-codigo:hover .copy-btn,
.recuadro-codigo:focus-within .copy-btn {
  opacity: 1;
  transform: translateY(0);
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: .85rem;
  color: #0d6efd;
  background: rgba(255,255,255,.95);
  border: 1px solid #0d6efd;
  border-radius: 999px;
  padding: .15rem .65rem;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .2s ease, transform .2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
  cursor: pointer;
}

.copy-btn:hover,
.copy-btn:focus {
  opacity: 1;
  transform: translateY(-1px);
  outline: none;
}

.recuadrooculto { display: none; }
.botonretorno { font-size: 1.1rem; margin-top: 1rem; }
.botonretorno a {
  display: inline-block;
  padding: .7rem 1.2rem;
  background: linear-gradient(135deg, #8e2f22 0%, #c45138 100%);
  border: 0;
  border-radius: 999px;
  text-decoration: none;
  color: #fff;
  box-shadow: 0 12px 28px rgba(125, 45, 32, .24);
}
.botonretorno a:hover { filter: none; transform: translateY(-1px); }
.botonretorno a.boton-online {
  padding: .85rem 1.4rem;
  background: linear-gradient(135deg, #0f766e 0%, #14b8a6 52%, #67e8f9 100%);
  border: 0;
  border-radius: 999px;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.botonretorno a.boton-online:hover {
  filter: none;
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(15, 118, 110, .35);
}
.botonretorno a.boton-online:active {
  transform: translateY(0);
  box-shadow: 0 10px 20px rgba(15, 118, 110, .24);
}
ul li { margin-bottom: .75rem; }

/* Responsive ad placeholders similar to tema.htm */
.uno { width: 320px; height: 100px; }
@media (min-width: 500px) { .uno { width: 320px; height: 100px; } }
@media (min-width: 800px) { .uno { width: 336px; height: 280px; } }

.dos { width: 320px; height: 100px; }
@media (min-width: 500px) { .dos { width: 320px; height: 100px;} }
@media (min-width: 800px) { .dos { width: 336px; height: 280px; } }

/* Media elements */
.cuerpodetalle img, .cuerpodetalle video { max-width: 100%; height: auto; border-radius: 4px; box-shadow: 0 0 6px #aaa; }
/* Modal dialog (generic) */
.modal { position: fixed; inset: 0; display: none; z-index: 1000; }
.modal.open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.modal-dialog { position: relative; max-width: 900px; width: calc(100% - 2rem); margin: 5vh auto; background: #fff; border-radius: 8px; box-shadow: 0 20px 50px rgba(0,0,0,.25); overflow: hidden; }
.modal-header, .modal-footer { padding: .75rem 1rem; background: #f6f6f6; }
.modal-header { display: flex; align-items: center; justify-content: space-between; }
.modal-body { padding: 1rem; max-height: 70vh; overflow: auto; }
.modal-close { border: 0; background: transparent; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.modal .recuadro { margin: 0; }
/* Center screenshots nicely */
.cuerpodetalle .screenshot { display:block; margin:.5rem auto 1rem; }
/* Inline code highlight as yellow chips */
.cuerpodetalle code {
  background: #fff9c4;
  border-radius: .25rem;
  padding: .1em .3em;
}

/* Bloques de código con highlight.js */
pre { margin: .75rem 0 1.25rem 0; overflow-x: auto; }
pre code.hljs { display: block; padding: 1rem; border-radius: 6px; }
.recuadro pre { margin: 0; }
.recuadro pre code.hljs { padding: 0; background: transparent; }

@media (max-width: 767px) {
  .container#contenedor { margin: 1rem; }
  .list-group#menu { font-size: 1.1rem; }
  .course-highlights { grid-template-columns: 1fr 1fr; }
  .list-group-item:hover {
    transform: none;
    padding-left: 1rem;
  }
}

