:root {
  color-scheme: light;
  --ink: #243645;
  --muted: #627583;
  --blue: #1589bd;
  --green: #66a936;
  --paper: #ffffff;
  --page: #f3f8fa;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(145deg, #e9f7fc 0%, var(--page) 48%, #f7fbef 100%);
  color: var(--ink);
  font-family: 'Fredoka', sans-serif;
}

.site-header, main, footer {
  width: min(100% - 40px, 1040px);
  margin-inline: auto;
}

.site-header { padding: 22px 0; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
}

.brand img { width: 58px; height: auto; opacity: .82; }

main { padding: 58px 0 76px; }

.intro { max-width: 660px; }

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1 { margin-bottom: 14px; font-size: clamp(2.2rem, 6vw, 4.3rem); line-height: 1; }

.intro > p:last-child { color: var(--muted); font-size: 1.12rem; line-height: 1.6; }

section + section { margin-top: 58px; }
h2 { font-size: 1.3rem; }

.simulator-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 350px)); gap: 18px; }

.simulator-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  padding: 24px;
  background: var(--paper);
  border: 1px solid #d7e5ea;
  border-radius: 18px;
  box-shadow: 0 10px 26px rgba(25, 78, 102, .08);
  color: inherit;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.simulator-card:hover, .simulator-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--blue);
  box-shadow: 0 16px 32px rgba(25, 78, 102, .14);
}

.card-icon { font-size: 2rem; }
.simulator-card h3 { margin-bottom: 7px; font-size: 1.25rem; }
.simulator-card p { margin-bottom: 18px; color: var(--muted); line-height: 1.5; }
.card-link { grid-column: 2; color: var(--blue); font-weight: 700; }

footer { padding-bottom: 28px; color: var(--muted); font-size: .85rem; }

@media (max-width: 560px) {
  .site-header, main, footer { width: min(100% - 28px, 1040px); }
  main { padding-top: 34px; }
}

/* ─────────────────────────────────────────────────────────────
   Portal: menú de secciones, migas de pan y galería de infografías
   ───────────────────────────────────────────────────────────── */

.crumbs {
  width: min(100% - 40px, 1040px);
  margin: -6px auto 0;
  color: var(--muted);
  font-size: .88rem;
}

.crumbs a { color: var(--blue); font-weight: 600; text-decoration: none; }
.crumbs a:hover, .crumbs a:focus-visible { text-decoration: underline; }
.crumbs span { margin: 0 4px; }

/* Menú principal del portal */
.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.section-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 28px 24px;
  background: var(--paper);
  border: 1px solid #d7e5ea;
  border-radius: 18px;
  box-shadow: 0 10px 26px rgba(25, 78, 102, .08);
  color: inherit;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.section-card:hover, .section-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--blue);
  box-shadow: 0 16px 32px rgba(25, 78, 102, .14);
}

.section-card .card-icon { font-size: 2.4rem; }
.section-card h3 { margin: 0; font-size: 1.3rem; }
.section-card p { margin: 0; color: var(--muted); line-height: 1.5; }

.section-meta {
  margin-top: auto;
  padding-top: 12px;
  color: var(--blue);
  font-weight: 700;
  font-size: .95rem;
}

.section-card.is-soon { opacity: .72; }
.section-card.is-soon .section-meta { color: var(--muted); }

.badge-soon {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: #eef3f6;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* Galería de infografías */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
}

.info-card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid #d7e5ea;
  border-radius: 18px;
  box-shadow: 0 10px 26px rgba(25, 78, 102, .08);
  overflow: hidden;
}

.info-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  padding: 0;
  background: #eef4f7;
  cursor: zoom-in;
}

.info-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform .25s ease;
}

.info-thumb:hover img, .info-thumb:focus-visible img { transform: scale(1.03); }

.info-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.info-body h3 { margin: 0; font-size: 1.12rem; line-height: 1.3; }

.info-tag {
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 999px;
  background: #eaf6ec;
  color: #3f7f2a;
  font-size: .75rem;
  font-weight: 700;
}

.info-body p { margin: 0; color: var(--muted); font-size: .93rem; line-height: 1.5; }

.info-actions { display: flex; gap: 10px; margin-top: auto; padding-top: 14px; }

.btn {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--blue);
  border-radius: 11px;
  background: var(--blue);
  color: #fff;
  font-family: inherit;
  font-size: .93rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: filter .15s ease, transform .15s ease;
}

.btn:hover, .btn:focus-visible { filter: brightness(1.08); transform: translateY(-1px); }
.btn.is-ghost { background: transparent; color: var(--blue); }
.btn.is-ghost:hover, .btn.is-ghost:focus-visible { background: #eaf5fa; }

/* Visor a pantalla completa */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  flex-direction: column;
  background: rgba(18, 33, 43, .94);
}

.viewer[open], .viewer.is-open { display: flex; }

.viewer-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  color: #fff;
  background: rgba(0, 0, 0, .28);
}

.viewer-title { flex: 1; font-size: 1rem; font-weight: 600; }

.viewer-bar .btn {
  flex: 0 0 auto;
  border-color: rgba(255, 255, 255, .6);
  background: transparent;
  color: #fff;
}

.viewer-bar .btn:hover, .viewer-bar .btn:focus-visible { background: rgba(255, 255, 255, .16); }

.viewer-stage {
  flex: 1;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 16px;
}

.viewer-stage img { max-width: 100%; max-height: 100%; cursor: zoom-in; }
.viewer-stage.is-zoomed { place-items: start; }
.viewer-stage.is-zoomed img { max-width: none; max-height: none; width: 2752px; cursor: zoom-out; }

/* Catálogo de videos */
.video-group { margin-top: 34px; }
.video-group:first-child { margin-top: 0; }

.video-group h2 {
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #dbe9ef;
  font-size: 1.18rem;
}

/* La miniatura de YouTube es 4:3 y el recuadro es 16:9. Si la imagen queda en
   flujo normal, su altura natural manda sobre el aspect-ratio del botón y
   aparecen las barras negras; sacándola del flujo el recuadro impone el 16:9 y
   el recorte elimina las barras. */
.video-thumb {
  position: relative;
  display: block;
  overflow: hidden;
  cursor: pointer;
  background: #10222c;
}

.video-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.play-badge {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.play-badge span {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  padding-left: 5px;
  border: 3px solid rgba(255, 255, 255, .9);
  border-radius: 50%;
  background: rgba(18, 33, 43, .55);
  color: #fff;
  font-size: 1.35rem;
  transition: transform .2s ease, background .2s ease;
}

.video-thumb:hover .play-badge span,
.video-thumb:focus-visible .play-badge span {
  transform: scale(1.1);
  background: var(--blue);
}

.video-canal { margin: 0; color: var(--blue); font-size: .85rem; font-weight: 700; }

/* Modal del video */
.viewer-frame-stage {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 18px;
  overflow: auto;
}

.viewer-frame-box {
  width: min(100%, 1120px);
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .45);
}

.viewer-frame-box iframe { display: block; width: 100%; height: 100%; border: 0; }

.hint { color: var(--muted); font-size: .88rem; margin-top: 10px; }

@media (max-width: 560px) {
  .crumbs { width: min(100% - 28px, 1040px); }
  .info-actions { flex-direction: column; }
  .viewer-bar { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .viewer-title { flex: 1 0 100%; font-size: .9rem; }
  .viewer-frame-stage { padding: 10px; }
  .play-badge span { width: 52px; height: 52px; font-size: 1.15rem; }
}
