:root {
  --page-bg: #f5efe3;
  --paper: #fffaf2;
  --paper-strong: #fffdf8;
  --ink: #1c1a16;
  --muted: #5a5146;
  --line: rgba(28, 26, 22, 0.12);
  --accent: #c96a2b;
  --accent-deep: #8d3f14;
  --accent-soft: #f3d6ba;
  --olive: #39563d;
  --olive-soft: #dce8d9;
  --blue-soft: #dbe6f5;
  --shadow: 0 18px 45px rgba(68, 43, 17, 0.14);
  --radius-lg: 28px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(201, 106, 43, 0.18), transparent 24%),
    radial-gradient(circle at right 18%, rgba(57, 86, 61, 0.18), transparent 22%),
    linear-gradient(180deg, #f8f1e4 0%, #f3ecdf 45%, #efe7da 100%);
}

a {
  color: var(--accent-deep);
}

.home-page .site-shell {
  max-width: 1220px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.hero {
  display: grid;
  gap: 24px;
  margin-bottom: 24px;
}

.hero-copy,
.hero-panel,
.info-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 32px;
  background:
    linear-gradient(135deg, rgba(255, 252, 244, 0.98), rgba(247, 236, 219, 0.94)),
    var(--paper);
}

.eyebrow,
.section-kicker,
.panel-label {
  margin: 0 0 10px;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(2.3rem, 5vw, 4.9rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.hero-lead {
  max-width: 760px;
  margin: 0;
  font-size: 1.16rem;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.15rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #fff8f2;
  box-shadow: 0 10px 24px rgba(141, 63, 20, 0.2);
}

.btn-secondary {
  background: transparent;
  border-color: rgba(141, 63, 20, 0.35);
  color: var(--accent-deep);
}

.hero-panel {
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(57, 86, 61, 0.96), rgba(34, 51, 37, 0.96)),
    var(--olive);
  color: #eff6ef;
}

.hero-highlights {
  margin: 0;
  padding-left: 1.1rem;
}

.hero-highlights li {
  margin-bottom: 0.8rem;
  font-size: 1.02rem;
}

.home-grid {
  display: grid;
  gap: 24px;
}

.info-card {
  padding: 26px;
  background: rgba(255, 251, 244, 0.9);
}

.info-card h2 {
  margin: 0 0 14px;
  font-size: clamp(1.65rem, 3vw, 2.4rem);
  line-height: 1.05;
}

.info-card p {
  margin: 0 0 12px;
  color: var(--muted);
}

.program-card {
  background:
    linear-gradient(180deg, rgba(219, 230, 245, 0.45), rgba(255, 251, 244, 0.96)),
    var(--paper-strong);
}

.program-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.program-note {
  padding: 12px 14px;
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  background: rgba(243, 214, 186, 0.55);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 0.96rem;
}

.topics-list,
.source-list,
.insights-list {
  display: grid;
  gap: 14px;
}

.topic-item,
.source-item,
.insight-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.84);
}

.topic-item {
  display: block;
  padding: 18px 18px 16px;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.topic-item:hover {
  transform: translateY(-2px);
  border-color: rgba(141, 63, 20, 0.35);
  background: #fff7ed;
}

.topic-title {
  display: block;
  margin-bottom: 6px;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.topic-description {
  display: block;
  color: var(--muted);
}

.home-page .topic-description code {
  background: rgba(243, 214, 186, 0.6);
  border-radius: 0.25rem;
  padding: 0.08em 0.28em;
}

.source-item,
.insight-item {
  padding: 18px;
}

.source-item h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-family: "Trebuchet MS", Verdana, sans-serif;
}

.insight-item {
  background: rgba(220, 232, 217, 0.62);
}

.text-center {
  text-align: center;
}

.container#contenedor {
  max-width: 1100px;
  margin: 2rem auto;
  border-radius: 20px;
  box-shadow: 0 0 8px #666;
  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: #e7e7e7;
}

#fila2,
#fila3 {
  background: #c0cdf2;
}

h1.title {
  font-size: clamp(1rem, 3vw, 2em);
  margin: 0 0 0.25em 0;
  color: #fff;
  text-shadow: 0 0 15px #000;
}

.header-actions {
  text-align: right;
}

.header-actions a {
  display: inline-block;
  margin: 0.5rem 1rem 0.5rem 0;
}

.btn-success {
  background: #198754;
  color: #fff;
}

.list-group {
  box-shadow: 0 0 4px #666;
  border-radius: 0.5rem;
  overflow: hidden;
}

.list-group#menu {
  font-size: 1.5em;
}

.list-group-item {
  display: block;
  padding: 1rem;
  background: #f2f2f2;
  color: #0061e4;
  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: #fef7b7;
}

.pagination {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.pagination li {
  display: inline-block;
  margin: 0 0.25rem;
}

.pagination a {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 0.25rem;
  text-decoration: none;
  color: inherit;
}

.pagination .active a {
  background: #e9ecef;
}

body.tema-page {
  background-color: #d3e9d0;
  background-image: none;
}

body.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 0.5rem;
  font-size: clamp(1.25rem, 3vw, 1.5rem);
}

.cuerpodetalle ul {
  padding-left: 1.25rem;
  margin: 0 0 1em 0;
}

.recuadro {
  background-color: #ffffcc;
  text-align: left;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid #ffaa00;
  border-left-width: 4px;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  overflow-x: auto;
  margin: 0.75rem 0 1.25rem 0;
}

.recuadrooculto {
  display: none;
}

.botonretorno {
  font-size: 1.1rem;
  margin-top: 1rem;
}

.botonretorno a {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  background: #fff;
  border: 1px solid #888;
  border-radius: 0.375rem;
  text-decoration: none;
  color: inherit;
}

.botonretorno a:hover {
  filter: brightness(0.97);
}

ul li {
  margin-bottom: 0.75rem;
}

.uno,
.dos {
  width: 320px;
  height: 100px;
}

.cuerpodetalle img,
.cuerpodetalle video {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 0 6px #aaa;
}

.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, 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, 0.25);
  overflow: hidden;
}

.modal-header,
.modal-footer {
  padding: 0.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;
}

.cuerpodetalle .screenshot {
  display: block;
  margin: 0.5rem auto 1rem;
}

.cuerpodetalle code {
  background: #fff9c4;
  border-radius: 0.25rem;
  padding: 0.1em 0.3em;
}

pre {
  margin: 0.75rem 0 1.25rem 0;
  overflow-x: auto;
}

pre code.hljs {
  display: block;
  padding: 1rem;
  border-radius: 6px;
}

@media (min-width: 768px) {
  .home-page .hero {
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.8fr);
    align-items: stretch;
  }

  .home-page .home-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .intro-card {
    grid-column: span 5;
  }

  .source-card {
    grid-column: span 7;
  }

  .program-card,
  .insight-card {
    grid-column: 1 / -1;
  }

  .row > .col {
    flex: 1 1 50%;
  }

  #fila2 .col,
  #fila3 .col {
    flex-basis: 100%;
  }

  body.tema-page .row > .col {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

@media (max-width: 767px) {
  .home-page .site-shell {
    padding: 18px 14px 28px;
  }

  .hero-copy,
  .hero-panel,
  .info-card {
    padding: 20px;
  }

  .hero h1 {
    font-size: clamp(2rem, 11vw, 3.2rem);
  }
}

@media (min-width: 500px) {
  .uno,
  .dos {
    width: 320px;
    height: 100px;
  }
}

@media (min-width: 800px) {
  .uno,
  .dos {
    width: 336px;
    height: 280px;
  }
}
