/* ==========================================================================
   ISLA — hoja de estilos principal
   Paleta tomada del logo: azul, amarillo, naranja y rojo sobre fondos
   suaves lila/gris. Poppins para títulos (redondeado, cálido, propio de
   un proyecto educativo/comunitario), Inter para texto de lectura.
   ========================================================================== */

:root {
  --blue: #2569d9;
  --blue-dark: #1a4fb0;
  --yellow: #f2cd1b;
  --orange: #f2a93b;
  --red: #e8434b;

  --ink: #1c1d24;
  --ink-soft: #565a66;
  --bg-lilac: #dbe4fb;
  --bg-lilac-soft: #eef1fc;
  --bg-soft: #f3f4f6;
  --bg-dark: #111114;
  --white: #ffffff;

  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-pill: 999px;

  --shadow-card: 0 10px 30px rgba(28, 29, 36, 0.08);
  --container: 1180px;

  --font-head: 'Poppins', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 16px;
  color: var(--ink);
}
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 16px; color: var(--ink-soft); }
a { color: var(--blue); text-decoration: none; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

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

/* Botones tipo píldora ------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 30px;
  border-radius: var(--radius-pill);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-blue { background: var(--blue); color: var(--white); }
.btn-blue:hover { background: var(--blue-dark); color: var(--white); }
.btn-yellow { background: var(--yellow); color: var(--ink); }
.btn-outline { background: transparent; border-color: var(--white); color: var(--white); }
.btn-outline-dark { background: transparent; border-color: var(--ink); color: var(--ink); }

/* ============================ HEADER ================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 40px; width: auto; }
.brand-text {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--ink);
}
.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav a {
  color: var(--ink);
  font-weight: 500;
  font-size: 0.98rem;
}
.main-nav a.active, .main-nav a:hover { color: var(--blue); }
.header-actions { display: flex; align-items: center; gap: 18px; }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--ink);
}

@media (max-width: 900px) {
  .main-nav {
    position: fixed;
    inset: 70px 0 0 0;
    background: var(--white);
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
    gap: 18px;
    transform: translateY(-120%);
    transition: transform 0.25s ease;
    overflow-y: auto;
  }
  .main-nav.open { transform: translateY(0); }
  .nav-toggle { display: block; }
}

/* ============================ HERO SECTIONS =========================== */
.hero {
  position: relative;
  background: var(--bg-lilac);
  padding: 64px 0 110px;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}
.hero h1 { margin-bottom: 18px; color: var(--blue-dark); }
.hero p.lead { font-size: 1.08rem; max-width: 46ch; }
.hero-actions { margin-top: 22px; }
.hero-media { position: relative; }
.hero-media img { border-radius: var(--radius-lg); }

.page-hero {
  position: relative;
  background: var(--bg-lilac);
  padding: 0 0 90px;
  overflow: hidden;
}
.page-hero-media { height: 320px; overflow: hidden; }
.page-hero-media img { width: 100%; height: 100%; object-fit: cover; }
.page-hero .page-hero-text {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
  padding-top: 40px;
}

@media (max-width: 800px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-media { order: -1; }
}

/* Divisor tipo "ola" entre secciones ----------------------------------- */
.wave { display: block; width: 100%; position: relative; margin-top: -2px; }
.wave svg { display: block; width: 100%; height: auto; }

/* ============================ SECCIONES GENERALES ===================== */
section { padding: 70px 0; }
.section-soft { background: var(--bg-soft); }
.section-lilac { background: var(--bg-lilac-soft); }
.section-heading { max-width: 640px; margin: 0 auto 40px; text-align: center; }
.section-heading h2 { color: var(--blue-dark); }
.section-heading p { color: var(--ink-soft); }

/* Tarjetas de estadísticas ---------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 26px 20px;
  text-align: center;
  box-shadow: var(--shadow-card);
}
.stat-card .number {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 2rem;
  margin-bottom: 6px;
}
.stat-card:nth-child(6n+1) .number { color: var(--blue); }
.stat-card:nth-child(6n+2) .number { color: var(--orange); }
.stat-card:nth-child(6n+3) .number { color: var(--ink); }
.stat-card:nth-child(6n+4) .number { color: var(--red); }
.stat-card:nth-child(6n+5) .number { color: var(--blue); }
.stat-card:nth-child(6n+6) .number { color: var(--orange); }
.stat-card p { margin: 0; font-size: 0.92rem; }

@media (max-width: 760px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Bloque "What we do" ---------------------------------------------------- */
.split-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.split-block img { border-radius: var(--radius-lg); }
@media (max-width: 800px) {
  .split-block { grid-template-columns: 1fr; }
}

/* Carrusel / grid de programas ------------------------------------------- */
.programs-scroller {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 1fr);
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
}
.programs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}
.program-card {
  scroll-snap-align: start;
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border-top: 6px solid var(--blue);
  display: flex;
  flex-direction: column;
}
.program-card:nth-child(4n+1) { border-top-color: var(--blue); }
.program-card:nth-child(4n+2) { border-top-color: var(--orange); }
.program-card:nth-child(4n+3) { border-top-color: var(--yellow); }
.program-card:nth-child(4n+4) { border-top-color: var(--red); }
.program-card img { height: 160px; width: 100%; object-fit: cover; }
.program-card .body { padding: 18px 20px; flex: 1; display: flex; flex-direction: column; }
.program-card h3 { margin-bottom: 4px; font-size: 1.1rem; }
.program-card .ages { font-size: 0.82rem; color: var(--ink-soft); margin-bottom: 8px; }
.program-card p { font-size: 0.92rem; flex: 1; }
.program-card .btn { align-self: flex-start; margin-top: 8px; padding: 9px 22px; font-size: 0.85rem; }

/* Tarjetas numeradas (retos / desafíos) ---------------------------------- */
.numbered-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.numbered-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-card);
}
.numbered-card .num {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--red);
  margin-bottom: 10px;
}
@media (max-width: 760px) { .numbered-cards { grid-template-columns: 1fr; } }

/* Equipo ------------------------------------------------------------------ */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 28px;
  text-align: center;
}
.team-grid img {
  width: 130px; height: 130px; object-fit: cover;
  border-radius: 50%; margin: 0 auto 14px;
  border: 4px solid var(--bg-lilac);
}
.team-grid h3 { margin-bottom: 2px; font-size: 1.05rem; }
.team-grid .role { color: var(--blue); font-size: 0.88rem; font-weight: 500; }

/* Patrocinadores ----------------------------------------------------------- */
.sponsor-row {
  display: flex; flex-wrap: wrap; gap: 32px; align-items: center; justify-content: center;
}
.sponsor-row img { max-height: 50px; width: auto; filter: grayscale(20%); }

/* Bloque "join us" ---------------------------------------------------------- */
.join-block {
  background: var(--bg-lilac);
  border-radius: var(--radius-lg);
  padding: 44px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: center;
}
.join-block img { border-radius: var(--radius-md); }
@media (max-width: 800px) { .join-block { grid-template-columns: 1fr; padding: 28px; } }

/* Formulario de contacto ------------------------------------------------------ */
.contact-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 40px;
  max-width: 700px;
  margin: -70px auto 0;
  position: relative;
  z-index: 5;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 0.88rem; font-weight: 600; color: var(--ink); }
.form-field input, .form-field select, .form-field textarea {
  border: 1px solid #d8dbe3;
  border-radius: 10px;
  padding: 11px 14px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--white);
}
.form-field textarea { min-height: 110px; resize: vertical; }
.form-actions { margin-top: 10px; }
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .contact-card { padding: 26px; margin-top: -40px; }
}

.alert {
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 18px;
  font-size: 0.92rem;
}
.alert-success { background: #e4f6ea; color: #1c6b3c; }
.alert-error { background: #fdecec; color: #b3272d; }

/* Listado de recursos ---------------------------------------------------------- */
.resources-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.resource-card {
  background: var(--white);
  border: 1px solid #ececf1;
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-card);
}
.resource-card .tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-lilac);
  color: var(--blue-dark);
  margin-bottom: 10px;
}

/* Noticias / blog --------------------------------------------------------------- */
.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 26px; }
.news-card {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}
.news-card img { height: 180px; object-fit: cover; width: 100%; }
.news-card .body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.news-card .date { font-size: 0.78rem; color: var(--orange); font-weight: 600; margin-bottom: 6px; }
.news-card h3 { font-size: 1.08rem; margin-bottom: 8px; }
.news-card p { font-size: 0.92rem; flex: 1; }
.news-article { max-width: 760px; margin: 0 auto; }
.news-article .cover { border-radius: var(--radius-lg); margin-bottom: 28px; max-height: 420px; width: 100%; object-fit: cover; }
.news-article .content { font-size: 1.03rem; }
.news-article .content h2, .news-article .content h3 { color: var(--blue-dark); margin-top: 32px; }
.news-article .content img { border-radius: var(--radius-md); margin: 20px 0; }

/* Galería tipo grid ------------------------------------------------------------- */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gallery-grid img { border-radius: var(--radius-md); height: 180px; width: 100%; object-fit: cover; }
@media (max-width: 640px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }

/* Logística (cajas) -------------------------------------------------------------- */
.logistics-row { display: flex; flex-wrap: wrap; gap: 18px; }
.logistics-box {
  flex: 1 1 200px;
  border: 2px dashed var(--bg-lilac);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  font-weight: 600;
  color: var(--blue-dark);
}

/* ============================ FOOTER ============================ */
.site-footer {
  background: var(--bg-dark);
  color: #d3d4da;
  padding: 70px 0 24px;
  margin-top: -2px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr 1fr;
  gap: 32px;
  margin-bottom: 40px;
}
.footer-brand .brand-text { color: var(--white); }
.footer-brand p { color: #9a9ba3; font-size: 0.92rem; margin-top: 14px; }
.footer-social { display: flex; gap: 10px; margin-top: 18px; }
.footer-social a {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--blue);
  display: flex; align-items: center; justify-content: center;
  color: var(--white); font-size: 0.85rem;
}
.footer-col h4 { color: var(--white); font-size: 1rem; margin-bottom: 16px; }
.footer-col a { display: block; color: #b7b8c0; font-size: 0.92rem; margin-bottom: 10px; }
.footer-col a:hover { color: var(--white); }
.footer-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 20px; }
.footer-gallery img { border-radius: 8px; height: 60px; object-fit: cover; }
.subscribe-form { display: flex; border-radius: var(--radius-pill); background: #1e1f24; padding: 6px; }
.subscribe-form input {
  flex: 1; background: transparent; border: none; color: var(--white);
  padding: 10px 14px; font-size: 0.9rem;
}
.subscribe-form input::placeholder { color: #8b8c94; }
.subscribe-form button {
  background: var(--blue); color: var(--white); border: none;
  border-radius: 50%; width: 38px; height: 38px; cursor: pointer;
}
.footer-meta {
  border-top: 1px solid #2a2b31;
  margin-top: 30px;
  padding-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  font-size: 0.82rem;
  color: #86878f;
}
.footer-contact { margin-top: 18px; font-size: 0.88rem; color: #b7b8c0; }
.footer-contact div { margin-bottom: 8px; }

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .numbered-cards, .stats-grid { grid-template-columns: 1fr; }
}

/* Utilidades de scroll horizontal con flechas -------------------------------- */
.scroller-wrap { position: relative; }
.scroller-arrows { display: flex; gap: 10px; justify-content: flex-end; margin-bottom: 14px; }
.scroller-arrows button {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid #dcdde3;
  background: var(--white); cursor: pointer; font-size: 1rem;
}
