/* ===================== TIPOGRAFÍA ===================== */
@font-face {
  font-family: "Riffic Free";
  src: url("assets/fonts/RifficFree-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ===================== COLORES DE MARCA (tomados del logo) ===================== */
:root {
  --orange: #f05a28;
  --red: #e63a2a;
  --red-dark: #c1272d;
  --yellow: #ffd400;
  --sun: #fbbb1b;
  --blue: #1e4f9c;
  --green: #00a160;
  --leaf: #a3d08a;
  --purple: #8e63a8;

  --ink: #23264a;
  --muted: #5b5f7a;
  --cream: #fff8ec;
  --white: #ffffff;

  --radius: 24px;
  --shadow: 0 10px 30px rgba(35, 38, 74, 0.1);
  --font-title: "Riffic Free", "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

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

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

h1, h2, h3 {
  font-family: var(--font-title);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: 0.01em;
}
h1 { font-size: clamp(2.2rem, 5.5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.75rem); color: var(--blue); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }

a { color: inherit; }

.container { width: min(1160px, 100% - 32px); margin-inline: auto; }
.container--narrow { width: min(820px, 100% - 32px); }

/* ===================== BOTONES ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.9em 1.6em;
  border-radius: 999px;
  background: var(--orange);
  color: var(--white);
  font-family: var(--font-title);
  font-size: 1.05rem;
  text-decoration: none;
  box-shadow: 0 5px 0 var(--red-dark);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--red-dark); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--red-dark); }
.btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }

.btn--small { padding: 0.65em 1.2em; font-size: 0.95rem; }
.btn--ghost {
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid var(--white);
  box-shadow: none;
  backdrop-filter: blur(4px);
}
.btn--ghost:hover, .btn--ghost:active { box-shadow: none; background: rgba(255, 255, 255, 0.28); }
.btn--light { background: var(--white); color: var(--orange); box-shadow: 0 5px 0 var(--red-dark); }
.btn--light:hover { box-shadow: 0 7px 0 var(--red-dark); }
.btn--light:active { box-shadow: 0 2px 0 var(--red-dark); }

/* ===================== HEADER ===================== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 3px dashed rgba(240, 90, 40, 0.35);
}
.header__inner { display: flex; align-items: center; gap: 24px; min-height: 76px; }
.header__logo img { width: 64px; height: 64px; }
.nav { display: flex; gap: 24px; margin-left: auto; font-weight: 700; }
.nav a { text-decoration: none; color: var(--ink); }
.nav a:hover { color: var(--orange); }

@media (max-width: 760px) {
  .nav { display: none; }
  .header__inner { justify-content: space-between; }
  .header__logo img { width: 56px; height: 56px; }
}

/* ===================== HERO ===================== */
.hero {
  position: relative;
  min-height: min(88vh, 760px);
  display: flex;
  align-items: center;
  color: var(--white);
  overflow: hidden;
  isolation: isolate;
}
.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% 50%;
  z-index: -2;
}
.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(22, 86, 52, 0.85) 0%, rgba(22, 86, 52, 0.55) 45%, rgba(22, 86, 52, 0.05) 80%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.25), transparent 40%);
}
.hero__content { padding-block: 96px; max-width: 1160px; }
.hero h1 { max-width: 13ch; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.15); }
.hero__lead { max-width: 40ch; font-size: clamp(1.1rem, 1.8vw, 1.3rem); font-weight: 600; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 28px; }

.pill {
  display: inline-block;
  padding: 0.35em 1em;
  border-radius: 999px;
  background: var(--orange);
  color: var(--white);
  font-family: var(--font-title);
  font-size: 0.95rem;
  margin-bottom: 18px;
}

/* Escritorio: el hero respeta la proporción original de la foto (2000 × 617),
   así se ve completa y nunca se amplía por encima de su tamaño real.
   Si el texto no cabe (pantallas más angostas), el hero crece y recorta un poco. */
@media (min-width: 1024px) {
  .hero { min-height: calc(100vw * 617 / 2000); }
  .hero__content { padding-block: 48px; }
  .hero h1 { max-width: 20ch; font-size: clamp(2.4rem, 3.4vw, 3.4rem); }
  .hero__lead { max-width: 46ch; }
  .hero__ctas { margin-top: 20px; }
}

@media (max-width: 760px) {
  .hero { min-height: 82vh; }
  .hero__overlay { background: linear-gradient(0deg, rgba(22, 86, 52, 0.92) 10%, rgba(22, 86, 52, 0.55) 70%, rgba(22, 86, 52, 0.3)); }
  .hero__content { padding-block: 64px; align-self: flex-end; }
}

/* ===================== FILOSOFÍA ===================== */
/* Foto 2:1 a todo el ancho; el texto va sobre la zona izquierda, que está desenfocada. */
.philosophy {
  position: relative;
  min-height: calc(100vw / 2);
  display: flex;
  align-items: center;
  color: var(--white);
  overflow: hidden;
  isolation: isolate;
}
.philosophy__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% 50%;
  z-index: -2;
}
.philosophy__overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(22, 86, 52, 0.88) 0%, rgba(22, 86, 52, 0.7) 32%, rgba(22, 86, 52, 0) 55%);
}
.philosophy__content { padding-block: 64px; }
.philosophy__quote {
  position: relative;
  margin: 0;
  max-width: min(520px, 46%);
  padding-top: 56px;
  font-size: clamp(1.05rem, 1.35vw, 1.25rem);
  font-weight: 600;
  line-height: 1.65;
}
.philosophy__quote::before {
  content: "“";
  position: absolute;
  top: -18px;
  left: -4px;
  font-family: var(--font-title);
  font-size: 7rem;
  line-height: 1;
  color: var(--orange);
}
.philosophy__quote p { margin: 0 0 1em; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }
.philosophy__highlight {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  line-height: 1.3;
  margin-bottom: 0 !important;
}
.philosophy__sign {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 2px solid rgba(255, 255, 255, 0.35);
  max-width: 260px;
  font-family: var(--font-title);
  font-size: 1.15rem;
  line-height: 1.3;
}
.philosophy__sign span { display: block; font-family: inherit; font-size: 0.85rem; color: var(--sun); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 4px; }

/* Móvil y tablet: la foto arriba (enfocando a la maestra) y el texto debajo sobre verde. */
@media (max-width: 860px) {
  .philosophy { display: block; min-height: 0; background: #165634; }
  .philosophy__bg { position: static; aspect-ratio: 4 / 3; object-position: 72% 50%; }
  .philosophy__overlay { display: none; }
  .philosophy__content { padding-block: 48px 56px; }
  .philosophy__quote { max-width: none; }
}

/* ===================== SECCIONES ===================== */
.section { padding-block: clamp(64px, 9vw, 112px); }
.section--tint { background: var(--cream); }
.section__head { text-align: center; max-width: 680px; margin: 0 auto 48px; }
.section__head p:not(.eyebrow) { color: var(--muted); font-size: 1.1rem; }
.section__head p + p:not(.eyebrow) { margin-top: 0.8em; }
.eyebrow {
  font-family: var(--font-title);
  color: var(--orange);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.6em;
}

/* ===================== METODOLOGÍA ===================== */
.cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 24px;
}
.card {
  --c: var(--orange);
  position: relative;
  padding: 32px 28px 28px;
  border-radius: var(--radius);
  background: var(--white);
  border: 3px dashed color-mix(in srgb, var(--c) 45%, transparent);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}
.card:hover { transform: translateY(-4px) rotate(-0.4deg); }
.card h3 { color: var(--c); }
.card p { color: var(--muted); margin: 0; }
.card__icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--c) 16%, white);
  font-size: 1.8rem;
}
.card--orange { --c: var(--orange); }
.card--blue { --c: var(--blue); }
.card--green { --c: var(--green); }
.card--purple { --c: var(--purple); }
.card--red { --c: var(--red); }
.card--yellow { --c: #d99a00; }

/* Escritorio: 3 por fila; si la última fila queda con una sola tarjeta, se centra. */
@media (min-width: 1000px) {
  .cards { grid-template-columns: repeat(6, 1fr); }
  .card { grid-column: span 2; }
  .card:last-child:nth-child(3n + 1) { grid-column: 3 / span 2; }
}

/* ===================== GALERÍA ===================== */
.gallery {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.gallery__item { border-radius: var(--radius); overflow: hidden; aspect-ratio: 1; }
.gallery__btn {
  all: unset;
  display: block;
  width: 100%;
  height: 100%;
  cursor: zoom-in;
}
.gallery__btn:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
.gallery__btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.gallery__btn:hover img { transform: scale(1.04); }

/* Móvil: 2 columnas; la primera foto ocupa todo el ancho para que las 9 cuadren. */
@media (max-width: 760px) {
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .gallery__item { border-radius: 16px; }
  .gallery__item:first-child { grid-column: span 2; }
}

.lightbox {
  padding: 0;
  border: 0;
  border-radius: 16px;
  max-width: min(1100px, 92vw);
  background: transparent;
  overflow: visible;
}
.lightbox::backdrop { background: rgba(20, 22, 50, 0.85); }
.lightbox img { max-height: 85vh; width: auto; border-radius: 16px; }
.lightbox__close {
  position: absolute;
  top: -18px;
  right: -18px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--blue);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

/* ===================== UBICACIÓN ===================== */
.location {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 48px;
  align-items: center;
}
.location__info p { color: var(--muted); }
.location__list { margin: 24px 0 32px; display: grid; gap: 16px; }
.location__list dt { font-weight: 800; }
.location__list dd { margin: 0; color: var(--muted); }
.location__map {
  border-radius: var(--radius);
  overflow: hidden;
  border: 6px solid var(--white);
  outline: 3px dashed color-mix(in srgb, var(--orange) 50%, transparent);
  outline-offset: 6px;
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 3;
}
.location__map iframe { width: 100%; height: 100%; border: 0; display: block; }

@media (max-width: 860px) {
  .location { grid-template-columns: 1fr; gap: 40px; }
}

/* ===================== PREGUNTAS FRECUENTES ===================== */
.faq { display: grid; gap: 14px; }
.faq details {
  background: var(--white);
  border-radius: 18px;
  box-shadow: 0 4px 14px rgba(35, 38, 74, 0.07);
  border: 2px solid transparent;
  transition: border-color 0.2s ease;
}
.faq details[open] { border-color: color-mix(in srgb, var(--orange) 40%, transparent); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 60px 20px 24px;
  position: relative;
  font-weight: 800;
  font-size: 1.1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 20px;
  top: 50%;
  translate: 0 -50%;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--orange);
  color: var(--white);
  font-family: var(--font-title);
  font-size: 1.3rem;
  transition: rotate 0.2s ease;
}
.faq details[open] summary::after { rotate: 45deg; }
.faq summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 18px; }
.faq details p { padding: 0 24px 20px; margin: 0; color: var(--muted); }

/* ===================== CTA FINAL ===================== */
.cta {
  background: var(--orange);
  color: var(--white);
  padding-block: 72px;
}
.cta__inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.cta h2 { color: var(--white); max-width: 22ch; margin: 0; }

/* ===================== FOOTER ===================== */
.footer { background: var(--blue); color: rgba(255, 255, 255, 0.85); padding-block: 32px; font-size: 0.95rem; }
.footer__inner { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.footer p { margin: 0; }

/* ===================== APARICIÓN AL HACER SCROLL ===================== */
/* Solo se activa si el JS marca <html class="js-reveal">; sin JS todo se ve normal. */
.js-reveal .reveal {
  opacity: 0;
  translate: 0 28px;
  scale: 0.96;
  transition:
    opacity 0.6s ease var(--reveal-delay, 0s),
    translate 0.7s cubic-bezier(0.34, 1.4, 0.64, 1) var(--reveal-delay, 0s),
    scale 0.7s cubic-bezier(0.34, 1.4, 0.64, 1) var(--reveal-delay, 0s),
    transform 0.2s ease,
    border-color 0.2s ease;
}
.js-reveal .reveal.is-visible { opacity: 1; translate: 0 0; scale: 1; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
