* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  scroll-behavior: smooth;
  /* Evita el desplazamiento horizontal en móviles causado por elementos que puedan desbordar ligeramente */
  overflow-x: hidden;
  overflow-y: hidden;
}

.container {
  height: 100vh;
  overflow-y: auto;
  /* Use proximity so snapping occurs only when the user gets close to a snap point (less aggressive) */
  scroll-snap-type: y proximity;
  -webkit-overflow-scrolling: touch;
} 

.panel {
  min-height: 100vh;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  padding: 2rem;
} 

.panel-1 {
  background-image: url('images/1c.png');
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  padding: 2rem;
  max-height: 100vh;
  overflow: hidden;
  position: relative;
}

.panel-1 h1 {
  position: absolute;
  bottom: 6vh;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-family: 'Lato', sans-serif;
  font-weight: 900;
  font-size: clamp(2.25rem, 6.5vw, 6.25rem);
  line-height: 1;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  text-align: center;
  max-width: 90%;
  word-break: break-word;
  display: block;
}

.panel-1 .panel-1-logo {
  max-width: 40%;
  height: auto;
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.6));
}

/* Ajustes para móviles */
@media (max-width: 420px) {
  .panel-1 {
    padding: 1.5rem;
    gap: 0;
    justify-content: center;
  }

  .panel-1 h1 {
    font-size: clamp(2.2rem, 7vw, 3.2rem);
    bottom: 4vh;
    max-width: 85%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .panel-1 .panel-1-logo {
    max-width: 65%;
    margin: 0 auto;
  }
}

.panel-3 {
  background-image: url('images/3.png');
  background-size: cover;
  background-position: center;
  padding: 3rem;
  text-align: center;
  /* layout: stack title above paragraph */
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* Responsivos para texto en panel-3 */
.panel-3 h1 {
  font-size: clamp(1.5rem, 6.5vw, 2.5rem);
  margin: 0;
  line-height: 1.05;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  text-align: center;
  max-width: 90%;
  word-break: break-word;
}

.panel-3-text {
  font-size: clamp(0.95rem, 2.7vw, 1rem);
  padding: 1rem 1.25rem;
  box-sizing: border-box;
}

/* En pantallas pequeñas y/o con poca altura evitar que el contenido se oculte */
@media (max-width: 420px) {
  .panel {
    padding: 1.25rem;
    justify-content: flex-start;
    align-items: stretch;
  }
  .panel-3 {
    padding: 1.25rem;
    max-height: 100vh;
    overflow: hidden;
  }
  .panel-3 h1 {
    font-size: clamp(1.2rem, 5.2vw, 1.6rem);
  }
  .panel-3-text {
    padding: 0.75rem 0.9rem;
    font-size: clamp(0.85rem, 2.2vw, 0.95rem);
    line-height: 1.45;
    margin-top: 0.6rem;
  }
}

/* Si la altura de la ventana es pequeña, colocar el contenido al inicio para que no se centre y se corte */
@media (max-height: 640px) {
  .panel {
    justify-content: flex-start;
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }
}

.panel-3-text {
  max-width: 900px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  line-height: 1.6;
  font-size: 1rem;
  margin-top: 1rem;
  text-align: left;
}

.panel-2 {
  position: relative;
  overflow: hidden;
  padding: 0;
  height: 100vh;
  color: transparent; /* hide any text */
  background-color: #000; /* fallback while images load */
}

.corner {
  position: absolute;
  inset: 0; /* top:0; right:0; bottom:0; left:0; */
  pointer-events: none; /* let clickable children opt-in */
}

.corner .c {
  position: absolute;
  z-index: 0;
  /* make each link cover half the viewport with a tiny overlap to avoid 1px seam due to subpixel rounding */
  width: calc(50% + 1px);
  height: calc(50% + 1px);
  display: block;
  overflow: hidden;
  border: 0;
  margin: 0;
  padding: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  pointer-events: auto; /* make anchors clickable */
  cursor: pointer;
}

.corner .c img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.corner .top-left { top: 0; left: 0; }
.corner .top-right { top: 0; right: 0; }
.corner .bottom-left { bottom: 0; left: 0; }
.corner .bottom-right { bottom: 0; right: 0; }

.center-text {
  position: absolute;
  z-index: 10;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #000; /* solid black background as requested */
  color: #fff;
  font-family: "Times New Roman", Times, serif;
  font-weight: 700;
  text-align: center;
  padding: 0.5rem 0.9rem;
  font-size: 2rem; /* initial fallback, will be overridden by JS */
  line-height: 1.05;
  letter-spacing: 0.02em;
  border-radius: 4px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.6);
  display: inline-block; /* shrink to content width */
  max-width: calc(100% - 2rem); /* avoid overflow on small screens */
  white-space: nowrap; /* keep it single-line by default so JS fits to width */
  overflow-wrap: normal;
  word-break: normal;
  pointer-events: none; /* permitir desplazamiento a través del overlay */
}

/* En móviles permitir que el texto haga wrap y se parta de forma segura */
@media (max-width: 420px) {
  .center-text {
    display: block;
    /* ocupar casi todo el ancho disponible para reducir saltos de línea */
    width: calc(100% - 2rem);
    max-width: calc(100% - 2rem);
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
    /* un poco más de espacio vertical para evitar que las descenders se corten */
    padding: 0.45rem 0.6rem;
    line-height: 1.12;
    font-weight: 700;
    word-spacing: 0.02em;
    /* remove max-height to avoid clipping; JS en forzar el máximo de líneas */
    max-height: none;
    overflow: visible;
  }
} 


