/* ===========================================================
   Instituto América del Sur — hoja de estilos principal
   =========================================================== */

/* ---- Fuentes (self-hosted, evita el salto de layout al cambiar de fuente) ---- */
@font-face {
  font-family: "Nunito Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/nunito-sans-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Quicksand";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("../fonts/quicksand-latin.woff2") format("woff2");
}

/* ---- Reset básico ---- */
* , *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  margin: 0;
  font-family: "Nunito Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4 {
  font-family: "Quicksand", "Segoe UI", sans-serif;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 .6em;
  color: var(--navy-dark);
}
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---- Paleta e identidad (extraída del logo e institucional real) ---- */
:root {
  --navy: #1B3F7A;
  --navy-dark: #10284F;
  --red: #D5262C;
  --red-dark: #A81D22;
  --yellow: #F4B400;
  --green: #4C9F70;
  --orange: #F2994A;
  --cream: #FBF7EF;
  --white: #FFFFFF;
  --ink: #232A35;
  --gray: #5B6470;
  --border: #E7E0D3;
  --shadow: 0 10px 30px rgba(16, 40, 79, .12);
  --radius-lg: 28px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --container: 1160px;
}

/* ---- Utilidades de layout ---- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}
.section { padding: 64px 0; }
.section--tight { padding: 40px 0; }
.section--navy { background: var(--navy); color: var(--white); }
.section--navy h2, .section--navy h3 { color: var(--white); }
.section--cream-alt { background: #F3ECDC; }
.text-center { text-align: center; }
.eyebrow {
  display: inline-block;
  font-family: "Quicksand", sans-serif;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: .78rem;
  color: var(--red);
  background: rgba(213, 38, 44, .1);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.section--navy .eyebrow { color: var(--yellow); background: rgba(244, 180, 0, .16); }
.lede { font-size: 1.15rem; color: var(--cream); max-width: 62ch; }
.section--navy .lede { color: #D9E1F2; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px;
  background: var(--navy); color: var(--white);
  padding: 10px 18px; border-radius: 0 0 10px 10px;
  z-index: 200; transition: top .2s ease;
}
.skip-link:focus { top: 0; }

/* ---- Botones ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-family: "Quicksand", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  border: 2px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--red); color: var(--white); box-shadow: 0 8px 20px rgba(213,38,44,.35); padding-top: 4px; padding-bottom: 4px; }
.btn-primary:hover { background: var(--red-dark); }
.btn-secondary { background: var(--white); color: var(--navy); border-color: var(--white); }
.btn-secondary:hover { background: transparent; color: var(--white); }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-block { width: 100%; justify-content: center; }

/* ===========================================================
   Header / Navegación
   =========================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.nav-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  padding-block: 10px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 68px; width: auto; }
.brand-text {
  font-family: "Quicksand", sans-serif;
  font-weight: 700;
  color: var(--navy-dark);
  font-size: 1.02rem;
  line-height: 1.15;
}
.brand-text small { display: block; font-weight: 600; color: var(--red); font-size: .78rem; letter-spacing: .04em; }

.nav-toggle {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px;
  background: transparent; border: 1px solid var(--border); border-radius: 10px;
}
.nav-toggle span {
  display: block; height: 2px; width: 22px; margin-inline: auto;
  background: var(--navy-dark); border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.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); }

.main-nav {
  display: flex; align-items: center; gap: 4px;
}
.main-nav > ul { display: flex; align-items: stretch; gap: 2px; }
.main-nav a.nav-link, .main-nav button.nav-link {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 14px;
  font-family: "Quicksand", sans-serif;
  font-weight: 600;
  color: var(--navy-dark);
  border-radius: 10px;
  background: transparent;
  border: none;
  white-space: nowrap;
}
.main-nav a.nav-link:hover, .main-nav button.nav-link:hover { background: #F0F3FA; }
.main-nav .nav-link.is-active { color: var(--red); }
.nav-cta { margin-left: 6px; }
.nav-cta .btn {
  width: 125px;
  justify-content: center;
  text-align: center;
  white-space: normal;
  padding-inline: 10px;
}

.has-dropdown { position: relative; }
.chevron { width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-top: -3px; }
.dropdown {
  position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 230px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 8px;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
}
.has-dropdown.is-open .dropdown,
.has-dropdown:focus-within .dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.dropdown a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--navy-dark); font-weight: 600; }
.dropdown a:hover { background: #F0F3FA; }

/* ---- Nav responsive (mobile-first: colapsado por defecto) ---- */
@media (max-width: 899px) {
  .nav-bar { padding-block: 4px; }
  .main-nav {
    position: fixed; inset: 53px 0 0 0;
    background: var(--white);
    flex-direction: column; align-items: stretch;
    padding: 12px 20px 32px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform .25s ease;
  }
  .main-nav.is-open { transform: translateX(0); }
  .main-nav > ul { flex-direction: column; gap: 2px; width: 100%; }
  .main-nav a.nav-link, .main-nav button.nav-link { width: 100%; padding: 14px 12px; font-size: 1.05rem; justify-content: space-between; }
  .dropdown {
    position: static; box-shadow: none; border: none; opacity: 1; visibility: visible; transform: none;
    display: none; padding-left: 12px; margin-bottom: 6px;
  }
  .has-dropdown.is-open .dropdown { display: block; }
  .nav-cta { margin: 14px 0 0; }
  .nav-cta .btn { width: 100%; }
}
@media (min-width: 900px) {
  .nav-toggle { display: none; }
}

/* ===========================================================
   Hero
   =========================================================== */
.hero {
  position: relative;
  color: var(--white);
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-dark) 100%);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 82% 18%, rgba(244,180,0,.22), transparent 45%),
              radial-gradient(circle at 8% 92%, rgba(213,38,44,.28), transparent 45%);
  pointer-events: none;
}
.hero-inner {
  position: relative; z-index: 1;
  display: grid; gap: 36px;
  padding-block: 56px 64px;
  align-items: center;
}
.hero-inner > * { min-width: 0; }
.hero-photo {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
  aspect-ratio: 4 / 3;
  min-width: 0;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.hero h1 { color: var(--white); font-size: clamp(2rem, 4.4vw, 3.1rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 22px; }

.page-hero {
  padding-block: 40px 48px;
}
.page-hero .hero-inner { padding-block: 0; grid-template-columns: 1fr; }
.page-hero-tag {
  font-family: "Quicksand", sans-serif; font-weight: 700;
  font-size: clamp(1.1rem, 2.4vw, 1.5rem);
  color: var(--yellow);
  margin-top: 6px;
}

@media (min-width: 860px) {
  .hero-inner.hero-inner--split { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); }
  .page-hero .hero-inner { grid-template-columns: minmax(0, 1fr); }
}

/* ===========================================================
   Banner de inscripciones
   =========================================================== */
.enroll-banner {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
  color: var(--white);
}
.enroll-banner-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 20px;
  padding-block: 28px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.enroll-banner h2 { color: var(--white); margin-bottom: 4px; font-size: clamp(1.2rem, 2.6vw, 1.6rem); }
.enroll-banner p { margin: 0; color: #FBE2E2; }
.enroll-banner .btn-primary { background: var(--white); color: var(--red-dark); box-shadow: none; flex: none; }
.enroll-banner .btn-primary:hover { background: var(--cream); }

/* ===========================================================
   Chips (palabras reales del folleto institucional)
   =========================================================== */
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  font-family: "Quicksand", sans-serif; font-weight: 700; font-size: .92rem;
  padding: 9px 18px; border-radius: 999px; color: var(--white);
  text-transform: lowercase;
}
.chip:nth-child(7n+1) { background: var(--red); }
.chip:nth-child(7n+2) { background: var(--navy); }
.chip:nth-child(7n+3) { background: var(--green); }
.chip:nth-child(7n+4) { background: var(--orange); }
.chip:nth-child(7n+5) { background: #7A6FD6; }
.chip:nth-child(7n+6) { background: #2E9CB0; }
.chip:nth-child(7n+7) { background: var(--red-dark); }

/* ===========================================================
   Tarjetas (niveles / propuesta)
   =========================================================== */
.grid { display: grid; gap: 26px; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.grid > * { min-width: 0; }

.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
  height: 100%;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(16,40,79,.18); }
.card-photo { aspect-ratio: 4/3; overflow: hidden; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-tag {
  align-self: flex-start;
  font-family: "Quicksand", sans-serif; font-weight: 700; font-size: .74rem;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 999px; color: var(--white);
}
.card-tag--inicial { background: var(--orange); }
.card-tag--primario { background: var(--navy); }
.card-tag--ingles { background: #2E9CB0; }
.card-tag--proyecto { background: var(--green); }
.card-body h3 { margin-bottom: 2px; font-size: 1.25rem; }
.card-body p { color: var(--gray); margin-bottom: 0; }
.card-link {
  margin-top: auto; padding-top: 10px;
  font-family: "Quicksand", sans-serif; font-weight: 700; color: var(--red);
  display: inline-flex; align-items: center; gap: 6px;
}
.card-link::after { content: "→"; transition: transform .15s ease; }
.card:hover .card-link::after { transform: translateX(4px); }

/* ===========================================================
   Contenido de páginas internas (texto institucional)
   =========================================================== */
.prose { max-width: 74ch; }
.prose p { color: var(--ink); font-size: 1.05rem; }
.prose h2 { margin-top: 1.6em; }
.prose ul { margin: 0 0 1.4em; padding-left: 0; }
.prose li {
  position: relative; padding-left: 30px; margin-bottom: .7em; color: var(--ink);
}
.prose li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  color: var(--white); background: var(--green);
  width: 20px; height: 20px; border-radius: 50%;
  font-size: .7rem; display: flex; align-items: center; justify-content: center;
}
blockquote.pull-quote {
  margin: 1.8em 0; padding: 22px 26px;
  background: #F0F3FA; border-left: 5px solid var(--red);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-family: "Quicksand", sans-serif; font-style: italic; font-weight: 600;
  color: var(--navy-dark); font-size: 1.08rem;
}

/* ---- Tabs (Nuestra institución) ---- */
.institution-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 6px; }
.tab-btn {
  padding: 10px 20px;
  border-radius: 999px;
  border: 2px solid var(--navy);
  background: transparent;
  color: var(--navy);
  font-family: "Quicksand", sans-serif;
  font-weight: 700;
  font-size: .95rem;
}
.tab-btn:hover { background: #F0F3FA; }
.tab-btn.is-active { background: var(--navy); color: var(--white); }
.tab-btn.is-active:hover { background: var(--navy); }
.tab-panel { padding-top: 22px; }
.tab-panel[hidden] { display: none; }

/* ---- Nuestro equipo ---- */
.team-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
}
.team-card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 28px 20px;
  text-align: center;
}
.team-card .icon-circle {
  width: 56px; height: 56px; margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--navy); color: var(--white);
  display: flex; align-items: center; justify-content: center;
}
.team-card h3 { margin-bottom: 0; font-size: 1.05rem; }

.two-col {
  display: grid; gap: 40px;
  grid-template-columns: minmax(0, 1fr);
}
.two-col > * { min-width: 0; }
@media (min-width: 900px) {
  .two-col { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: start; }
  .two-col .side-photo { position: sticky; top: 96px; }
}
.side-photo img { border-radius: var(--radius-lg); box-shadow: var(--shadow); }

.subhead-block { margin-top: 2.2em; }
.subhead-block h3 { color: var(--red); font-size: 1.3rem; }

/* ===========================================================
   Galería
   =========================================================== */
.gallery { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gallery figure { margin: 0; min-width: 0; border-radius: var(--radius-md); overflow: hidden; aspect-ratio: 1; box-shadow: var(--shadow); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.gallery a:hover img { transform: scale(1.06); }
@media (min-width: 700px) {
  .gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ===========================================================
   Contacto
   =========================================================== */
.contact-grid { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
.contact-grid > * { min-width: 0; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.contact-list { display: flex; flex-direction: column; gap: 18px; }
.contact-item {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--white); border-radius: var(--radius-md);
  padding: 18px 20px; box-shadow: var(--shadow);
}
.contact-icon {
  flex: none; width: 44px; height: 44px; border-radius: 12px;
  background: var(--navy); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.contact-item h3 { margin-bottom: 2px; font-size: 1rem; }
.contact-item a { color: var(--gray); }
.contact-item a:hover { color: var(--red); }
.map-frame {
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow);
  aspect-ratio: 4/3; border: none; width: 100%; height: 100%;
}
.form-card {
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: 28px; text-align: center;
}

/* ===========================================================
   Footer
   =========================================================== */
.site-footer { background: var(--navy-dark); color: #D9E1F2; }
.footer-grid {
  display: grid; gap: 32px;
  grid-template-columns: minmax(0, 1fr);
  padding-block: 48px 28px;
}
.footer-grid > * { min-width: 0; }
@media (min-width: 760px) {
  .footer-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); }
}
.footer-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.footer-brand img { height: 46px; filter: brightness(0) invert(1); }
.footer-col h4 {
  color: var(--white); font-size: .82rem; letter-spacing: .1em; text-transform: uppercase;
  margin-bottom: 14px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: #C4CEE6; }
.footer-col a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12);
  padding-block: 18px;
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between;
  font-size: .85rem; color: #9FADCB;
}
.social-row { display: flex; gap: 10px; margin-top: 6px; }
.social-row a {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.18);
}
.social-row a:hover { background: var(--red); border-color: var(--red); }

/* ===========================================================
   Animación de entrada suave
   =========================================================== */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ===========================================================
   Breakpoints generales de tipografía
   =========================================================== */
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.05rem); }
h3 { font-size: 1.2rem; }

@media (max-width: 480px) {
  .section { padding: 44px 0; }
  .card-body { padding: 18px; }
  .brand-text { font-size: .88rem; }
  .brand img { height: 52px; }
}
