/* ---------- COLORES (cámbialos aquí si quieres) ---------- */
:root {
  --fondo: #e9f5ec;      /* verde muy clarito */
  --papel: #fbfffc;      /* casi blanco de la carta */
  --texto: #2b3d33;      /* verde muy oscuro, se lee bien */
  --color: #3f8a5c;      /* verde para títulos y botones */
  --claro: #cfe8d6;      /* verde claro del sobre */
  --solapa: #b3d9bf;     /* verde un poco más fuerte para la solapa */
}

/* ---------- LO BÁSICO ---------- */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 22px;        /* letra grande para leer fácil */
  line-height: 1.6;
  color: var(--texto);
  background: var(--fondo);
}

h1, h2 {
  color: var(--color);
  text-align: center;
  line-height: 1.3;
}

.escondido {
  display: none;          /* esconde lo que tenga esta clase */
}

/* EL SOBRE */
#portada {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#sobre {
  position: relative;
  width: 300px;
  height: 200px;
  border: none;
  border-radius: 10px;
  background: var(--claro);
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* La solapa: un triángulo con la punta hacia ABAJO */
#sobre::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 60%;
  background: var(--solapa);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  border-radius: 10px 10px 0 0;
}

.sello {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 40px;
}

.aviso {
  margin-top: 30px;
  font-weight: bold;
  text-align: center;
}

/* LA CARTA*/
#carta {
  max-width: 680px;
  margin: 30px auto;
  padding: 30px 24px;
  background: var(--papel);
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.firma {
  text-align: right;
  font-size: 26px;
  color: var(--color);
  font-weight: bold;
}

/* LA ÚNICA ANIMACIÓN: la carta sale del sobre hacia arriba */
.sale {
  animation: sale 1s ease-out;
}

@keyframes sale {
  from { transform: translateY(150px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

/*LAS FOTOS*/
#fotos {
  text-align: center;
  padding: 10px 0 20px;
}

#carrusel {
  position: relative;
}

#lista {
  display: flex;                  /* pone las fotos en fila */
  gap: 16px;
  overflow-x: auto;               /* permite deslizar con el dedo */
  scroll-snap-type: x mandatory;  /* cada foto se queda centrada */
  padding: 10px 20px;
}

#lista img {
  height: 55vh;
  width: auto;
  flex: none;
  scroll-snap-align: center;
  border: 6px solid white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.flecha {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: var(--color);
  color: white;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}

#atras    { left: 8px; }
#adelante { right: 8px; }

.final {
  text-align: center;
  font-size: 28px;
  font-weight: bold;
  color: var(--color);
  padding: 20px 20px 60px;
}

/* LA FOTO EN GRANDE*/
#visor {
  position: fixed;        /* tapa toda la pantalla */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #dcefe1;
  z-index: 10;
  flex-direction: column;
  color: var(--texto);
}

#visor.visible {
  display: flex;
}

#cerrar {
  margin: 12px;
  padding: 12px 20px;
  align-self: flex-end;
  border: none;
  border-radius: 30px;
  background: var(--color);
  color: white;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
}

#ayuda {
  margin: 0 0 8px;
  text-align: center;
  font-size: 18px;
}

#marco {
  flex: 1;
  overflow: auto;         /* si la foto es grande, se puede mover */
  text-align: center;
}

#foto-grande {
  max-width: 100%;
  max-height: 100%;       /* la foto entera cabe en la pantalla */
  cursor: zoom-in;
}

/* cuando se pulsa la foto, se hace grande */
#foto-grande.zoom {
  max-width: none;
  max-height: none;
  width: 220%;
  cursor: zoom-out;
}
