/* ============================================================
   Gap-the-Code · fase3.css
   Añadidos de Fase 3: sistema DOODLE-ÁMBAR, hero con imagen,
   ajustes tipográficos móvil, logos institucionales, bio mejorada.
   Se carga DESPUÉS de main.css
   ============================================================ */

/* Importar doodle icons */
@import url('icons-doodle.css');

/* ---------- 1. Ajuste tipográfico de títulos largos ---------- */
h1, h2, h3 {
  text-wrap: balance;
  -webkit-hyphens: auto;
  hyphens: auto;
}

/* Evitar que el punto final quede huérfano en móvil */
.no-orphan-dot {
  white-space: nowrap;
}

/* ---------- 2. Logo en nav (sustituye la G en degradado) ---------- */
.nav__logo-mark {
  width: 42px;
  height: 42px;
  background: transparent;
  border-radius: 50%;
  box-shadow: none;
  overflow: hidden;
}
.nav__logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ---------- 3. Hero con imagen a la derecha ---------- */
.hero--with-image {
  padding-block: var(--sp-12) var(--sp-16);
}
.hero--with-image .hero__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-10);
  align-items: center;
}
.hero__content {
  position: relative;
  z-index: 2;
}
.hero__visual {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin-inline: auto;
}
.hero__visual img {
  width: 100%;
  height: auto;
  border-radius: var(--r-xl);
  box-shadow: var(--sh-xl);
  transform: rotate(2deg);
  transition: transform var(--t-slow) var(--ease-out);
}
.hero__visual:hover img {
  transform: rotate(0deg) scale(1.02);
}
/* Glow amber detrás */
.hero__visual::before {
  content: '';
  position: absolute;
  inset: -30px;
  background: radial-gradient(circle at center, rgba(245, 166, 35, 0.25), transparent 60%);
  z-index: -1;
  filter: blur(20px);
  animation: glow-pulse 6s ease-in-out infinite;
}
@keyframes glow-pulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

@media (min-width: 900px) {
  .hero--with-image .hero__inner {
    grid-template-columns: 1.1fr 1fr;
    gap: var(--sp-16);
  }
}

/* ---------- 4. Section "Para quién es / No es" con iconos grandes ---------- */
.split__col-header {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}
.split__col-icon {
  width: 64px;
  height: 64px;
  padding: 10px;
  background: var(--doodle-amber-soft);
  border-radius: var(--r-lg);
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.split__col--no .split__col-icon {
  background: #F3EEF7;
  opacity: 0.85;
}
.split__col-header h3 {
  margin: 0;
  font-size: var(--fs-xl);
}

/* Items de lista con iconos DOODLE */
.split__list li {
  display: block;
  padding-left: 52px !important;
  position: relative;
  margin-bottom: var(--sp-5);
}
.split__list li > div {
  display: block;
}
.split__list li > .doodle-icon {
  position: absolute;
  left: 0;
  top: 0;
  width: 34px !important;
  height: 34px !important;
  flex-shrink: 0;
}

/* ---------- 5. Sección director/autor con foto ---------- */
.director {
  position: relative;
}
.director__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-8);
  align-items: center;
}
@media (min-width: 780px) {
  .director__layout {
    grid-template-columns: 280px 1fr;
    gap: var(--sp-10);
  }
}
.director__photo {
  position: relative;
  max-width: 280px;
  margin-inline: auto;
}
.director__photo img {
  width: 100%;
  height: auto;
  border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
  display: block;
}
/* Badge "+20 años" encima */
.director__badge {
  position: absolute;
  bottom: -20px;
  right: -30px;
  width: 200px;
  max-width: 60%;
  pointer-events: none;
}
.director__badge img {
  width: 100%;
  height: auto;
  transform: rotate(-5deg);
}
@media (max-width: 779px) {
  .director__badge {
    right: -10px;
    bottom: -10px;
    width: 160px;
  }
}
.director__bio {
  font-size: var(--fs-md);
  color: var(--c-text);
  line-height: 1.75;
}
.director__bio strong {
  color: var(--c-ink);
  font-weight: 700;
}

/* ---------- 6. Proof / credibilidad institucional con logos reales ---------- */
.proof-logos {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-6);
  margin-top: var(--sp-6);
}
@media (min-width: 720px) {
  .proof-logos { grid-template-columns: repeat(3, 1fr); }
}

.proof-block {
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  padding: var(--sp-6) var(--sp-5);
  text-align: center;
  transition: transform var(--t-med), box-shadow var(--t-med);
}
.proof-block:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-md);
}
.proof-block__logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--sp-4);
  min-height: 72px;
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}
.proof-block__logos img {
  max-height: 60px;
  width: auto;
  object-fit: contain;
}
.proof-block__logos img.logo-small { max-height: 44px; }
.proof-block__logos img.logo-bg-dark {
  padding: 8px 12px;
  background: var(--c-ink);
  border-radius: 8px;
}
.proof-block strong {
  display: block;
  color: var(--c-ink);
  font-size: var(--fs-sm);
  font-weight: 700;
  margin-bottom: 4px;
}
.proof-block span {
  display: block;
  font-size: var(--fs-xs);
  color: var(--c-text-soft);
  line-height: 1.4;
}

/* ---------- 7. Ajuste de cards con iconos doodle ---------- */
.card__icon {
  background: var(--doodle-amber-soft);
  color: var(--c-ink);
  width: 64px;
  height: 64px;
  padding: 8px;
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px rgba(245, 166, 35, 0.22);
}
.card:hover .card__icon {
  background: #fff;
  color: var(--c-ink);
  transform: rotate(-3deg) scale(1.05);
}
.card .card__icon > svg {
  width: 100%;
  height: 100%;
}

/* ---------- 8. Ajuste info cards con iconos (contacto, microcredencial) ---------- */
.infocard__icon {
  background: var(--doodle-amber-soft);
  color: var(--c-ink);
  width: 48px;
  height: 48px;
  padding: 6px;
  border-radius: 12px;
}
.infocard__icon > svg {
  width: 100%;
  height: 100%;
}

/* ---------- 9. Versión móvil del título hero ---------- */
@media (max-width: 640px) {
  .hero h1 {
    font-size: clamp(1.9rem, 7vw, 2.6rem);
  }
  /* El punto final "código." debe ir junto a la palabra */
  .hero h1 .last-word {
    white-space: nowrap;
  }
}

/* ---------- 10. Pequeña mejora del resaltado em en hero ---------- */
.hero h1 em {
  position: relative;
  display: inline-block;
}
.hero h1 em::after {
  content: '';
  position: absolute;
  left: -4px;
  right: -4px;
  bottom: 4px;
  height: 10px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 10' preserveAspectRatio='none'><path d='M2 7 Q 40 2 80 5 T 160 4 T 198 7' stroke='%23F5A623' stroke-width='3.5' fill='none' stroke-linecap='round'/></svg>");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  z-index: -1;
  opacity: 0.7;
}

/* ---------- 11. Pequeños detalles doodle en títulos de sección ---------- */
.section-head .eyebrow {
  position: relative;
  padding-left: 28px;
}
.section-head .eyebrow::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 2px;
  background: var(--doodle-amber);
  border-radius: 2px;
}

/* ---------- 12. Footer logo centrado con el bloque de texto ---------- */
.footer__brand {
  /* Centra el contenido completo (logo + textos) dentro de su columna */
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.footer__brand p,
.footer__brand small {
  max-width: 360px;
  text-align: center;
}
.footer__brand .footer__logo-wrap {
  margin-bottom: var(--sp-4);
  display: flex;
  justify-content: center;
}
.footer__brand .footer__logo-wrap img {
  display: block;
  width: 90px;
  height: 90px;
}

/* ---------- 13. Sección revistas científicas (about · ancho completo) ---------- */
.journals {
  margin-top: var(--sp-16);
  padding: var(--sp-16) 0;
  background: linear-gradient(180deg, var(--c-wash) 0%, #fff 100%);
  border-top: 1px solid var(--c-line);
}
.journals__head {
  text-align: center;
  margin-bottom: var(--sp-10);
  max-width: 720px;
  margin-inline: auto;
}
.journals__head .eyebrow {
  display: block;
  margin-bottom: var(--sp-4);
}
.journals__head .stat-big {
  font-size: clamp(4rem, 10vw, 6.5rem);
  font-weight: 800;
  color: var(--c-ink);
  line-height: 1;
  display: inline-block;
  padding: 0;
  margin: 0;
  letter-spacing: -0.03em;
}
.journals__head .stat-big sup {
  font-size: 0.4em;
  font-weight: 600;
  color: var(--c-magenta);
  vertical-align: super;
  margin-left: 2px;
}
.journals__head .stat-label {
  display: block;
  margin-top: var(--sp-3);
  font-size: var(--fs-lg);
  color: var(--c-ink);
  font-weight: 600;
  line-height: 1.4;
}
.journals__intro {
  margin-top: var(--sp-5);
  font-size: var(--fs-base);
  line-height: 1.7;
}
.journals__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-3);
  max-width: 1100px;
  margin-inline: auto;
}
@media (min-width: 480px) { .journals__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 720px) { .journals__grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 960px) { .journals__grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .journals__grid { grid-template-columns: repeat(7, minmax(0, 1fr)); } }

.journal-card {
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: var(--sp-3);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--t-med), box-shadow var(--t-med), border-color var(--t-med);
  min-width: 0; /* evita que el hijo fuerce expansión */
  overflow: hidden;
}
.journal-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-md);
  border-color: var(--c-plum);
}
.journal-card img {
  max-width: 100%;
  max-height: 80%;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0.68;
  transition: opacity var(--t-med);
  display: block;
}
.journal-card:hover img { opacity: 1; }

.journals__caption {
  margin-top: var(--sp-8);
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--c-text-soft);
  max-width: 720px;
  margin-inline: auto;
}

/* ---------- 14. Imagen Método Gap-the-Code (about) ---------- */
.method-chart {
  display: block;
  max-width: 720px;
  width: 100%;
  margin: var(--sp-6) auto;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-md);
}

/* ---------- 15. Imagen director JoAn con doodle (about) ---------- */
.director-visual {
  display: block;
  max-width: 580px;
  width: 100%;
  height: auto;
  margin: var(--sp-6) auto var(--sp-10);
  border-radius: var(--r-xl);
  box-shadow: none;
}
