/* ================= VARIABLES ================= */
:root {
  --color-text: #1d1d1f;
  --color-muted: #86868b;
  --color-primary: #8cca2f;
  --color-bg: #fafafa;

  --radius-sm: 8px;
  --radius-md: 12px;
  --shadow-sm: 0 4px 8px rgba(0,0,0,.2);
  --transition: .3s ease;
  --nav-height: 60px;
}

/* ================= RESET ================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  padding-top: var(--nav-height);
}
body.snap {
  scroll-snap-type: y mandatory;
}
section {
  min-height: 100vh;
  scroll-snap-align: start;
}
/* img, */
video {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}
/* Enfoque accesible */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* ================= ACCESIBILIDAD ================= */
/* Reducir animaciones si el usuario lo prefiere */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ==================================================
   DARK MODE
================================================== */

/* Automático según sistema */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #121212;
    --color-text: #f5f5f5;
    --color-muted: #b0b0b0;

    --shadow-sm: 0 4px 8px rgba(0,0,0,.6);
    --shadow-md: 0 10px 20px rgba(0,0,0,.7);
  }

  .nav {
    background: rgba(18,18,18,.95);
  }
}

/* Forzado por el usuario */
body.dark {
  --color-bg: #121212;
  --color-text: #f5f5f5;
  --color-muted: #b0b0b0;

  --shadow-sm: 0 4px 8px rgba(0,0,0,.6);
  --shadow-md: 0 10px 20px rgba(0,0,0,.7);
}

body.dark .nav {
  background: rgba(18,18,18,.95);
}

body.dark header::after {
  background: rgba(0,0,0,.6);
}

.theme-toggle {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  margin-left: 1rem;
  transition: transform .2s ease;
}

.theme-toggle:hover {
  transform: scale(1.15);
}

/* ================= UTILIDADES ================= */
.text-primary { color: var(--color-primary); }
.text-muted { color: var(--color-muted); }

/* ================= NAV ================= */
.nav {
  position: fixed;
  top: 0;
  width: 100%;
   height: var(--nav-height);
  background: rgba(250,250,250,.9);
  border-bottom: 2px solid var(--color-primary);
  z-index: 100;
}

.nav__container {
  max-width: 980px;
  height: 100%;
  margin: auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav__menu {
  display: flex;
  justify-content: space-evenly;
  flex: 1;
  top: var(--nav-height);
}

.nav__link {
  position: relative;
  text-decoration: none;
  color: #333;
  font-weight: 500;
  padding: .3rem 0;
  transition: color .3s ease;
}

/* ===== ANIMACIÓN HOVER ===== */
.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width .3s ease;
}

.nav__link:hover {
  color: var(--color-primary);
}

.nav__link:hover::after {
  width: 100%;
}

/* ===== LINK ACTIVO ===== */
.nav__link.active {
  color: var(--color-primary);
}

.nav__link.active::after {
  width: 100%;
}

/* ===== HAMBURGUESA ===== */
.nav__toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav__toggle {
    display: block;
  }

  .nav__menu {
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    background: #fff;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    display: none;
  }

  .nav__menu.show {
    display: flex;
  }
  .card-curso {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .card-icon {
    font-size: 2rem;
  }

}
/* @media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #121212;
    --color-text: #f5f5f5;
    --color-muted: #aaa;
  }

  .nav {
    background: rgba(20,20,20,.95);
  }
} */
/* ========CTA flotante======== */
.cta-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--color-primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: bold;
  box-shadow: var(--shadow-sm); 
  transition: transform .3s ease, box-shadow .3s ease;
  z-index: 999;
}

.cta-float:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,.25);
}

/* =====================
   HEADER / VIDEO
===================== */
header {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
}

header video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Overlay oscuro */
header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
}
.header-content {
  position: relative;
  background:var(--color-bg);
  padding: 2rem;
  border-radius: var(--radius-md);
  max-width: 420px;
  text-align: center;
}


/* =====================
   SECCIÓN VIRTUALVIC
===================== */
 .virtualvic {
  height: 100vh;
  display: grid;
  grid-template-rows: 1fr 2fr; /* 1/3 arriba, 2/3 abajo */
  overflow: hidden;
    
  }
  .fila-1 {
  overflow: hidden;
}

.fila-1 img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  padding: 10px;
}
  /* Segunda fila con dos columnas */
  .fila-2 {
  display: grid;
  grid-template-columns: 1fr 2fr; /* imagen | cards */
  gap: 30px;
  padding: 0 50px;
  align-items: center;
}
.fila-2 > div:first-child {
  display: flex;
  justify-content: center;
  align-items: center;
}

.img-50 {
  width: 50%;
  height: auto;
}

  .col-2{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

  .card-curso{
    background:var(--color-bg)  ;
  padding: 15px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 20px rgba(0,0,0,.15);
  display: grid;
  grid-template-columns: 1fr 3fr;
  align-items: center;
  gap: 10px;/* Dos columnas */

  }
/* === animación card === */
.card-curso {
  opacity: 0;
  transform: translateY(30px);
  transition: transform var(--transition), box-shadow var(--transition);
}
.card-curso:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0,0,0,.15);
}

.card-curso.show {
  opacity: 1;
  transform: translateY(0);
}

  .card-curso h4{
   visibility: visible;   
  }

  /* ================= Responsive virtualvic ================= */
  /* grig segunda fila */
  @media (max-width: 768px) {
  .fila-2 {
    grid-template-columns: 1fr;
    padding: 20px;
    text-align: center;
  }

  .img-50 {
    width: 60%;
    margin-bottom: 20px;
  }
}
/* card en una columna */
@media (max-width: 768px) {
  .col-2 {
    grid-template-columns: 1fr;
  }
}

/* =====================
   GALERÍA CURSOS – GRID FLUIDO CORREGIDO
===================== */

.galeriaCursos {
  background: var(--color-text);
  padding: 20px 0;
}

/* GRID PRINCIPAL */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
  grid-auto-rows: 180px;
  grid-auto-flow:dense; 
  /* gap: 12px; */
  /* padding: 12px; */
  
 } 

/* ITEM */
.item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  
}

/* IMAGEN */
.item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
  vertical-align:bottom;
}

.item:hover img {
  transform: scale(1.06);
}
/* SPANS */
.r-span2 {
  grid-row: span 2;
}

.c-span2 {
  grid-column: span 2;
}

/* OVERLAY */
.item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,.65),
    rgba(0,0,0,.15)
  );
  opacity: 0;
  transition: opacity .3s ease;
}

/* TEXTO */
.item figcaption {
  position: absolute;
  bottom: 14px;
  width: 100%;
  padding: 0 10px;
  text-align: center;
  color: #fff;
  font-weight: 600;
  opacity: 0;
  transition: opacity .25s ease;
  z-index: 1;
}

/* HOVER + FOCUS */
.item:hover::after,
.item:hover figcaption,
.item:focus-within::after,
.item:focus-within figcaption {
  opacity: 1;
}

/* LINK */
.item a {
  display: block;
  height: 100%;
}

/* MOBILE */
@media (max-width: 768px) {
  .grid-container {
    grid-template-columns: 1fr;
    grid-auto-rows: 220px;
  }

  .r-span2,
  .c-span2 {
    grid-row: span 1;
    grid-column: span 1;
  }
}

/** abajo  */
.abajo {
  background: #fff;
  /* height: 100vh; */
  display: grid;
  place-items: center;
  align-content: end;
   padding-top: 60px;
}

.abajo img {
  width: 100%;
}

.abajo h2 {
  font-size: 28px;
  font-weight: 600;
}

.abajo h3 {
  letter-spacing: 0.5px;
  font-size: 18px;
}

/** FOOTER  */
footer {
  width: 100%;
  height: 44px;
  background:var(--color-text);
  color: var(--color-muted);
  display: flex;
  justify-content: center;
  align-items: center;
}
