/* ============================================================
   Fundación Kanillitas — hoja de estilos
   Paleta: grises + celeste (a partir del logo)
   ============================================================ */
:root {
  --ink: #1d2530;          /* texto principal / footer */
  --slate: #3a4654;        /* texto secundario oscuro */
  --muted: #5d6877;        /* texto de apoyo */
  --line: #d9dee4;         /* bordes */
  --gray-100: #eceff3;     /* fondo secciones alternas */
  --gray-50: #f6f7f9;      /* fondo general */
  --white: #ffffff;
  --sky: #3aa9e0;          /* celeste principal */
  --sky-deep: #17709f;     /* celeste para botones/texto (contraste AA) */
  --sky-soft: #e2f2fb;     /* celeste muy claro */
  --radius: 14px;
  --font-head: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Figtree', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --maxw: 1180px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--slate);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; }
a { color: var(--sky-deep); }
h1, h2, h3 { font-family: var(--font-head); color: var(--ink); line-height: 1.12; letter-spacing: -0.02em; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 4px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 300; }
.skip-link:focus { left: 8px; }

.wrap { width: min(100% - 48px, var(--maxw)); margin-inline: auto; }
section { padding: 88px 0; }
.alt { background: var(--gray-100); }

.section-head { max-width: 720px; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(30px, 4vw, 44px); margin-bottom: 14px; }
.section-head p { color: var(--muted); font-size: 18px; }
.section-head.center { margin-inline: auto; text-align: center; }

/* ─── Botones ─── */
.btn {
  display: inline-block;
  font: 600 15px/1 var(--font-body);
  padding: 15px 28px;
  border-radius: 999px;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn-primary { background: var(--sky-deep); color: #fff; }
.btn-primary:hover { background: #115779; }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: var(--sky-soft); }
.btn-ghost { border-color: rgba(255,255,255,.7); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.14); }
.btn-outline { border-color: var(--sky-deep); color: var(--sky-deep); }
.btn-outline:hover { background: var(--sky-deep); color: #fff; }

/* ─── Navegación ─── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(246,247,249,.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { width: 44px; height: 44px; object-fit: contain; }
.brand span { font: 800 21px/1 var(--font-head); letter-spacing: -0.02em; }
.brand small { display: block; font: 500 11px/1.2 var(--font-body); color: var(--muted); letter-spacing: .02em; margin-top: 3px; }
.nav-links { display: flex; align-items: center; gap: 6px; list-style: none; }
.nav-links a {
  display: block; padding: 9px 15px; border-radius: 999px;
  font-size: 15px; font-weight: 500; color: var(--slate); text-decoration: none;
  transition: background .15s, color .15s;
}
.nav-links a:hover { background: var(--gray-100); color: var(--ink); }
.nav-links a[aria-current="page"] { background: var(--sky-soft); color: var(--sky-deep); font-weight: 600; }
.nav-links .nav-cta { background: var(--sky-deep); color: #fff; margin-left: 8px; font-weight: 600; }
.nav-links .nav-cta:hover { background: #115779; color: #fff; }
.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; border-radius: 10px; cursor: pointer; align-items: center; justify-content: center; flex-direction: column; gap: 5px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); transition: transform .25s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── Hero (inicio) ─── */
.hero {
  position: relative; color: #fff; padding: 0;
  min-height: clamp(520px, 78vh, 760px);
  display: flex; align-items: center;
  background: #26323f url('images/hero.jpg') center/cover no-repeat;
  isolation: isolate;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, rgba(23,33,45,.92) 0%, rgba(23,33,45,.72) 45%, rgba(23,33,45,.18) 100%);
}
.hero-inner { padding: 80px 0; max-width: 640px; animation: hero-in .8s ease both; }
.hero h1 { color: #fff; font-size: clamp(38px, 6vw, 66px); margin-bottom: 22px; }
.hero p { font-size: 19px; color: #e6ebf0; max-width: 54ch; margin-bottom: 34px; }
.hero-btns { display: flex; flex-wrap: wrap; gap: 12px; }
@keyframes hero-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ─── Cabecera de páginas internas ─── */
.page-hero {
  position: relative; color: #fff; padding: 84px 0 72px; isolation: isolate;
  background: #26323f var(--hero-img, none) center/cover no-repeat;
}
.page-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, rgba(23,33,45,.9), rgba(23,33,45,.6)); }
.page-hero h1 { color: #fff; font-size: clamp(36px, 5vw, 58px); margin-bottom: 14px; }
.page-hero p { color: #e3e9ef; font-size: 19px; max-width: 58ch; }

/* ─── Franja de evento ─── */
.event-bar { background: var(--sky-deep); color: #fff; padding: 16px 0; }
.event-bar .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 22px; text-align: center; font-size: 15.5px; }
.event-bar strong { font-weight: 700; }
.event-bar a { color: #fff; font-weight: 600; }

/* ─── Intro dividida ─── */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.split.reverse .split-media { order: 2; }
.split-media img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius); }
.split-text h2 { font-size: clamp(28px, 3.6vw, 40px); margin-bottom: 18px; }
.split-text p { margin-bottom: 16px; }
.split-text .btn { margin-top: 10px; }
.lead { font-size: 19px; color: var(--ink); }

/* ─── Tarjetas de categoría con imagen ─── */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.cat-card {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 3 / 4; border-radius: var(--radius);
  color: #fff; text-decoration: none; background: #26323f; isolation: isolate;
}
.cat-card img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform .7s cubic-bezier(.2,.7,.2,1), filter .5s;
}
.cat-card::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top, rgba(23,33,45,.92) 0%, rgba(23,33,45,.35) 45%, rgba(23,33,45,0) 70%);
  transition: background .45s;
}
.cat-body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 22px; transition: transform .45s cubic-bezier(.2,.7,.2,1); transform: translateY(calc(100% - 64px)); }
.cat-body h3 { color: #fff; font-size: 24px; margin-bottom: 8px; }
.cat-body p { font-size: 14.5px; line-height: 1.5; color: #e6edf3; opacity: 0; transition: opacity .35s .05s; }
.cat-more { display: inline-block; margin-top: 12px; font-size: 14px; font-weight: 700; opacity: 0; transition: opacity .35s .1s; border-bottom: 2px solid var(--sky); }
.cat-card:hover img, .cat-card:focus-visible img { transform: scale(1.09); }
.cat-card:hover::after, .cat-card:focus-visible::after { background: linear-gradient(to top, rgba(23,112,159,.95) 0%, rgba(23,112,159,.55) 55%, rgba(23,33,45,.1) 100%); }
.cat-card:hover .cat-body, .cat-card:focus-visible .cat-body { transform: none; }
.cat-card:hover .cat-body p, .cat-card:hover .cat-more,
.cat-card:focus-visible .cat-body p, .cat-card:focus-visible .cat-more { opacity: 1; }

/* ─── Video ─── */
.video-frame { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; }
.video-frame video { width: 100%; aspect-ratio: 16/9; object-fit: cover; }

/* ─── Participar ─── */
.dual { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.dual-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 40px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; transition: border-color .25s, box-shadow .25s; }
.dual-card:hover { border-color: var(--sky); box-shadow: 0 14px 34px rgba(29,37,48,.08); }
.dual-card h3 { font-size: 26px; }
.dual-card p { color: var(--muted); flex: 1; }
.dual-card.dark { background: var(--ink); border-color: var(--ink); }
.dual-card.dark h3 { color: #fff; }
.dual-card.dark p { color: #c9d2dc; }

/* ─── Galería ─── */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.gallery-item { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--gray-100); aspect-ratio: 4 / 3; }
.gallery-item.tall { grid-row: span 2; aspect-ratio: auto; }
.gallery-item button { all: unset; display: block; width: 100%; height: 100%; cursor: zoom-in; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.gallery-item:hover img { transform: scale(1.06); }
.gallery-item figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 34px 16px 14px; font-size: 14px; font-weight: 600; color: #fff; background: linear-gradient(to top, rgba(23,33,45,.82), rgba(23,33,45,0)); pointer-events: none; }
.gallery-more { text-align: center; margin-top: 36px; }
dialog.lightbox { border: 0; background: transparent; max-width: 94vw; max-height: 92vh; margin: auto; overflow: visible; }
dialog.lightbox::backdrop { background: rgba(15,21,29,.88); }
dialog.lightbox img { max-width: 94vw; max-height: 82vh; border-radius: 10px; margin: auto; }
dialog.lightbox p { color: #fff; text-align: center; margin-top: 12px; font-weight: 600; }
.lightbox-close { position: absolute; top: -48px; right: 0; background: #fff; color: var(--ink); border: 0; width: 40px; height: 40px; border-radius: 50%; font-size: 22px; cursor: pointer; }

/* ─── Aliados ─── */
.allies { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.ally { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 104px; padding: 16px; border: 2px dashed #b9c2cd; border-radius: var(--radius); color: var(--muted); font-weight: 600; font-size: 15px; background: #fff; }

/* ─── Bloque CTA final ─── */
.cta-band { background: linear-gradient(120deg, var(--sky-deep), #1f87bd); color: #fff; text-align: center; padding: 84px 0; }
.cta-band h2 { color: #fff; font-size: clamp(30px, 4vw, 46px); margin-bottom: 14px; }
.cta-band p { max-width: 52ch; margin: 0 auto 30px; color: #e5f3fb; font-size: 19px; }

/* ─── Programas ─── */
.program { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; padding: 56px 0; }
.program + .program { border-top: 1px solid var(--line); }
.program:nth-child(even) .program-media { order: 2; }
.program-media img { width: 100%; aspect-ratio: 5/4; object-fit: cover; border-radius: var(--radius); }
.program h2 { font-size: clamp(26px, 3.2vw, 36px); margin-bottom: 14px; }
.program .for { display: inline-block; margin-top: 8px; padding: 6px 14px; background: var(--sky-soft); color: var(--sky-deep); border-radius: 999px; font-size: 14px; font-weight: 600; }

/* ─── Quiénes somos ─── */
.quote { font-family: var(--font-head); font-size: clamp(26px, 3.4vw, 38px); line-height: 1.25; color: var(--ink); max-width: 24ch; border-left: 5px solid var(--sky); padding-left: 24px; }
.story { display: grid; grid-template-columns: 1fr 1.2fr; gap: 64px; align-items: start; }
.story p + p { margin-top: 16px; }
.founder { display: grid; grid-template-columns: 280px 1fr; gap: 44px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.founder h3 { font-size: 30px; margin-bottom: 4px; }
.founder .role { color: var(--sky-deep); font-weight: 600; margin-bottom: 14px; }
.team { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.member { text-align: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 20px; }
.member strong { display: block; color: var(--ink); font-size: 18px; margin-top: 14px; }
.member span { color: var(--muted); font-size: 15px; }
.avatar { width: 128px; height: 128px; border-radius: 50%; margin-inline: auto; background: var(--gray-100) url('images/persona.svg') center/cover; border: 4px solid var(--sky-soft); }
.founder .avatar { width: 100%; height: auto; aspect-ratio: 1; border-radius: var(--radius); border-width: 0; }
.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.value { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; }
.value .icon { width: 46px; height: 46px; border-radius: 12px; background: var(--sky-soft); color: var(--sky-deep); display: grid; place-items: center; margin-bottom: 16px; }
.value .icon svg { width: 24px; height: 24px; }
.value h3 { font-size: 21px; margin-bottom: 8px; }
.value p { color: var(--muted); font-size: 16px; }

/* ─── Contacto ─── */
.contact-layout { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: start; }
.contact-list { display: grid; gap: 14px; }
.contact-card { display: flex; align-items: center; gap: 16px; padding: 20px 22px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--slate); transition: border-color .2s, transform .2s; }
.contact-card:hover { border-color: var(--sky); transform: translateX(4px); }
.contact-card .icon { flex: none; width: 46px; height: 46px; border-radius: 12px; background: var(--sky-soft); color: var(--sky-deep); display: grid; place-items: center; }
.contact-card .icon svg { width: 22px; height: 22px; }
.contact-card strong { display: block; color: var(--ink); font-size: 16px; }
.contact-card span { font-size: 15px; color: var(--muted); }
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 36px; }
.form-card h2 { font-size: 28px; margin-bottom: 8px; }
.form-card > p { color: var(--muted); margin-bottom: 22px; font-size: 16px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; color: var(--ink); font-size: 15px; margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; font: inherit; font-size: 16px; padding: 13px 15px; border: 1.5px solid #c3cbd5; border-radius: 10px; background: var(--gray-50); color: var(--ink); transition: border-color .2s, background .2s; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--sky); background: #fff; box-shadow: 0 0 0 3px var(--sky-soft); }
.field textarea { min-height: 130px; resize: vertical; }
.form-note { font-size: 14px; color: var(--muted); margin-top: 12px; }

/* ─── Footer ─── */
.site-footer { background: var(--ink); color: #b8c2ce; padding: 64px 0 28px; font-size: 15.5px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 48px; padding-bottom: 40px; border-bottom: 1px solid #323d4b; }
.site-footer .brand { color: #fff; margin-bottom: 14px; }
.site-footer .brand small { color: #9ba6b3; }
.site-footer .brand img { background: #fff; border-radius: 10px; padding: 3px; }
.site-footer h4 { font: 700 16px var(--font-head); color: #fff; margin-bottom: 14px; }
.site-footer ul { list-style: none; display: grid; gap: 9px; }
.site-footer a { color: #b8c2ce; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.social { display: flex; gap: 10px; margin-top: 18px; }
.social a { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid #46515f; display: grid; place-items: center; transition: background .2s, border-color .2s; }
.social a:hover { background: var(--sky-deep); border-color: var(--sky-deep); text-decoration: none; }
.social svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.footer-bottom { padding-top: 24px; font-size: 14px; color: #8a96a4; }

/* ─── WhatsApp flotante ─── */
.whatsapp-fab { position: fixed; right: 22px; bottom: 22px; width: 58px; height: 58px; border-radius: 50%; background: #25a55a; display: grid; place-items: center; box-shadow: 0 8px 22px rgba(0,0,0,.25); z-index: 90; transition: transform .2s; }
.whatsapp-fab:hover { transform: scale(1.08); }
.whatsapp-fab svg { width: 30px; height: 30px; fill: #fff; }

/* ─── Responsive ─── */
@media (max-width: 1000px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .split, .story, .program, .contact-layout { grid-template-columns: 1fr; gap: 32px; }
  .split.reverse .split-media, .program:nth-child(even) .program-media { order: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
  .values, .team { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute; left: 0; right: 0; top: 76px; flex-direction: column; align-items: stretch; gap: 4px;
    background: var(--gray-50); padding: 14px 24px 22px; border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 13px 16px; font-size: 17px; }
  .nav-links .nav-cta { margin: 8px 0 0; text-align: center; }
}
@media (max-width: 640px) {
  section { padding: 64px 0; }
  .wrap { width: min(100% - 36px, var(--maxw)); }
  .dual, .gallery-grid, .allies, .values, .team { grid-template-columns: 1fr; }
  .allies { grid-template-columns: 1fr 1fr; }
  .gallery-item.tall { grid-row: auto; aspect-ratio: 4/3; }
  .founder { grid-template-columns: 1fr; padding: 20px; }
  .founder .avatar { max-width: 220px; }
  .dual-card, .form-card { padding: 28px; }
  .cat-grid { gap: 12px; }
  .cat-body { padding: 14px; transform: translateY(calc(100% - 52px)); }
  .cat-body h3 { font-size: 19px; }
  .hero-inner { padding: 56px 0; }
}
/* En pantallas táctiles no existe hover: se muestra el texto completo */
@media (hover: none) {
  .cat-body { transform: none; }
  .cat-body p, .cat-more { opacity: 1; }
  .cat-body p { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
