:root {
  --bg-light: #E7E7E7;
  --bg-accent: #C0CDF2;
  --item-bg: #F2F2F2;
  --item-hover: #FEF7B7;
  --link: #0061E4;
  --shadow: 0 0 8px #666;
  --radius-lg: 20px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.5;
  color: #111;
  background: #fff;
}

/* 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 */
h1.title {
  font-size: clamp(1rem, 3vw, 2em);
  margin: 0 0 .25em 0;
  color: #fff;
  text-shadow: 0 0 15px #000;
}
.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; }

/* Menu list */
.list-group { box-shadow: 0 0 4px #666; border-radius: .5rem; overflow: hidden; }
.list-group#menu { font-size: 1.5em; }
.list-group-item {
  display: block;
  padding: 1rem;
  background: var(--item-bg);
  color: var(--link);
  text-decoration: none;
  border-top: 1px solid #ddd;
  text-align: justify;
  text-justify: inter-word;
}
.list-group-item:first-child { border-top: 0; }
.list-group-item:hover { background: var(--item-hover); }


.text-center { text-align: center; }
.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%; }
  #fila2 .col, #fila3 .col { flex-basis: 100%; }
}

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

body.tema-page { background-color: #D3E9D0; }
.tema-page .container#contenedor { padding: 1rem; }
.titulodetalle {
  background-color: #AED7A8;
  border-radius: 4px;
  box-shadow: 0 0 8px #aaa;
  padding: 10px;
  margin: 1rem 0 2rem 0;
}
.titulodetalle h1 { margin: 0; font-size: clamp(1.5rem, 4vw, 2.25rem); }
.cuerpodetalle {
  background-color: #AED7A8;
  border-radius: 4px;
  padding: 10px;
  box-shadow: 0 0 8px #aaa;
  margin-bottom: 2rem;
  font-size: 1.05rem;
}
.cuerpodetalle p { margin: 0 0 1em 0; text-align: justify; text-justify: inter-word; }
.cuerpodetalle h2 { margin: 1rem 0 .5rem; font-size: clamp(1.25rem, 3vw, 1.5rem); }
.cuerpodetalle ul { padding-left: 1.25rem; margin: 0 0 1em 0; }
.tabla {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background: #fff;
}
.tabla th,
.tabla td {
  border: 1px solid #000;
  padding: .75rem;
  text-align: left;
}
.tabla th {
  background: #ccc;
  font-weight: 600;
}
.recuadro {
  background: #fff7cc;
  border: 1px solid #d4c36a;
  border-radius: 8px;
  padding: 12px 24px;
  margin: 1rem 0;
  box-shadow: 0 4px 10px rgba(0,0,0,.08);
  position: relative;
  overflow: hidden;
}
.recuadro pre {
  margin: 0;
  background: transparent;
}
.recuadro pre code.hljs {
  padding: 0;
  background: transparent;
}

.recuadro--tabla .tabla-comparativa {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  border: 1px solid #000;
}

.tabla-comparativa {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 0;
  align-items: stretch;
}

.tabla-comparativa__header {
  display: contents;
}

.tabla-comparativa__row {
  display: contents;
}

.tabla-comparativa span {
  padding: 10px 12px;
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
  color: #000;
}

.tabla-comparativa span:nth-child(3n) {
  border-right: 0;
}

.tabla-comparativa__header span {
  background: #e0e0e0;
  font-weight: 600;
}

.tabla-comparativa__row span {
  background: #fff;
}

.tabla-comparativa__row:nth-of-type(odd) span {
  background: #f7f7f7;
}

.tabla-comparativa span:nth-child(3n+2),
.tabla-comparativa span:nth-child(3n+3) {
  text-align: center;
}
.recuadro:hover .copy-btn,
.recuadro:focus-within .copy-btn {
  opacity: 1;
  transform: translateY(0);
}

.recuadro--tabla {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 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;
  text-decoration: none;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .2s ease, transform .2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.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: .5rem .9rem;
  background: #fff;
  border: 1px solid #888;
  border-radius: .375rem;
  text-decoration: none;
  color: inherit;
}
.botonretorno a:hover { filter: brightness(0.97); }
.botonretorno--avl { margin-top: 1.5rem; }
.botonretorno--avl .btn-avl {
  background: linear-gradient(135deg, #1e7a3b 0%, #2fb267 100%);
  border: none;
  color: #fff;
  letter-spacing: 0.5px;
  box-shadow: 0 10px 20px rgba(31, 122, 59, 0.25);
  transition: transform .15s ease, box-shadow .15s ease;
}
.botonretorno--avl .btn-avl:hover {
  filter: none;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(31, 122, 59, 0.28);
}
.botonretorno--avl .btn-avl:active {
  transform: translateY(0);
  box-shadow: 0 6px 12px rgba(31, 122, 59, 0.2);
}
.ilustracion-avl {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.5rem auto;
  border-radius: 10px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}
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; }
