/* ==========================================================================
   VIEXPERU - Viajeros Explorando el Peru
   Estilo "postal de viaje retro". Una sola hoja, sin frameworks.

   Para cambiar el aspecto de todo el sitio basta con los colores de :root.
   Las dos tipografias estan alojadas en este servidor (no se piden a Google).
   ========================================================================== */

/* --------------------------------------------------------------- fuentes */

/* Manuscrita: nombres de destino y titulos. */
@font-face {
  font-family: 'Manuscrita';
  src: url('/assets/fuentes/caveat.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;   /* el texto se ve al instante con la de respaldo */
}

/* Maquina de escribir: etiquetas, sellos y datos. */
@font-face {
  font-family: 'Maquina';
  src: url('/assets/fuentes/elite.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---------------------------------------------------------------- paleta */

:root {
  --papel:   #e9ddc4;   /* papel kraft envejecido: fondo general */
  --postal:  #fdf8ec;   /* crema del marco de la postal */
  --tinta:   #3b3228;   /* marron tinta: texto */
  --suave:   #7b6d59;   /* texto secundario */
  --rojo:    #b4472e;   /* rojo desvaido de correo aereo */
  --azul:    #2b5a6b;   /* azul petroleo desvaido */
  --oro:     #bb8a3c;   /* dorado de sello postal */
  --borde:   #d3c09c;
  --ancho:   1180px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--tinta);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 17px;
  line-height: 1.65;

  /* Textura de papel hecha solo con degradados: no pesa ni un byte extra. */
  background-color: var(--papel);
  background-image:
    repeating-linear-gradient(90deg, rgba(120,100,70,.035) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(0deg,  rgba(120,100,70,.035) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at 50% 0%, rgba(255,250,235,.55), transparent 70%);
}

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

a { color: var(--rojo); }

.wrap {
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 0 22px;
}

/* ------------------------------------------------------------ encabezado */

.top {
  background: rgba(253,248,236,.93);
  border-bottom: 2px solid var(--borde);
  position: sticky;
  top: 0;
  z-index: 20;
}

/* Franja de correo aereo: el detalle retro que mas se reconoce. */
.aereo {
  height: 6px;
  background: repeating-linear-gradient(
    45deg,
    var(--rojo) 0 11px,
    #fdf8ec   11px 22px,
    var(--azul) 22px 33px,
    #fdf8ec   33px 44px
  );
}

.top .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 26px;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  padding-bottom: 12px;
}

.marca {
  text-decoration: none;
  color: var(--tinta);
  line-height: 1.05;
}

.marca b {
  display: block;
  font-family: 'Maquina', 'Courier New', monospace;
  font-size: 23px;
  letter-spacing: .14em;
  font-weight: 400;
}

.marca span {
  display: block;
  font-family: 'Manuscrita', 'Segoe Script', cursive;
  font-size: 19px;
  color: var(--rojo);
  margin-top: -2px;
}

.menu { display: flex; gap: 8px; flex-wrap: wrap; }

.menu a {
  font-family: 'Maquina', 'Courier New', monospace;
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--suave);
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 2px;
}

.menu a:hover { color: var(--tinta); border-color: var(--borde); }

.menu a[aria-current="page"] {
  color: var(--tinta);
  border-color: var(--tinta);
  background: rgba(187,138,60,.12);
}

/* ------------------------------------------------------------------ hero */

.hero {
  position: relative;
  min-height: 62vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 72px 22px;
  overflow: hidden;
  border-bottom: 2px solid var(--borde);
}

.hero-foto {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  /* Virado sepia: la foto se integra al papel en vez de pelear con el. */
  filter: sepia(.42) saturate(.78) contrast(1.04) brightness(.92);
}

/* Velo para que el texto siempre se lea sobre cualquier foto. */
.hero-velo {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(30,24,16,.28), rgba(30,24,16,.62)),
    linear-gradient(180deg, rgba(233,221,196,.25), transparent 40%, rgba(233,221,196,.35));
}

.hero-texto { position: relative; max-width: 760px; }

.hero .sobre {
  display: inline-block;
  font-family: 'Maquina', 'Courier New', monospace;
  font-size: 12px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: #f6ead1;
  border: 1px solid rgba(246,234,209,.5);
  border-radius: 2px;
  padding: 5px 14px;
  margin-bottom: 20px;
}

.hero h1 {
  font-family: 'Manuscrita', 'Segoe Script', cursive;
  font-weight: 600;
  font-size: clamp(38px, 7vw, 68px);
  line-height: 1.05;
  margin: 0 0 14px;
  color: #fffaf0;
  text-shadow: 0 2px 14px rgba(20,14,8,.55);
}

.hero p {
  margin: 0 auto;
  max-width: 620px;
  color: #f3e7d2;
  font-size: 17px;
  text-shadow: 0 1px 8px rgba(20,14,8,.6);
}

.hero .credito-hero {
  position: absolute;
  right: 10px;
  bottom: 6px;
  font-family: 'Maquina', 'Courier New', monospace;
  font-size: 10px;
  color: rgba(253,248,236,.62);
}

.hero .credito-hero a { color: inherit; }

/* --------------------------------------------------------------- botones */

.botones {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Maquina', 'Courier New', monospace;
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 13px 24px;
  border-radius: 2px;
  border: 2px solid var(--tinta);
  background: var(--tinta);
  color: #fdf8ec;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
  box-shadow: 3px 3px 0 rgba(59,50,40,.28);
}

.btn:hover { transform: translate(-1px,-1px); box-shadow: 5px 5px 0 rgba(59,50,40,.32); }

.btn.claro {
  background: rgba(253,248,236,.92);
  color: var(--tinta);
  border-color: #fdf8ec;
}

/* -------------------------------------------------------------- secciones */

section { padding: 54px 0; }

.rotulo {
  font-family: 'Maquina', 'Courier New', monospace;
  font-size: 12px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--rojo);
  margin-bottom: 6px;
}

.titulo {
  font-family: 'Manuscrita', 'Segoe Script', cursive;
  font-weight: 600;
  font-size: 40px;
  line-height: 1.1;
  margin: 0 0 8px;
}

.bajada {
  margin: 0 0 32px;
  color: var(--suave);
  max-width: 620px;
}

/* ------------------------------------------------- coleccion de postales */

/* Masonry real con columnas CSS: sin JavaScript y acepta fotos verticales
   y horizontales mezcladas sin recortarlas. */
.coleccion {
  columns: 3 290px;
  column-gap: 26px;
}

.postal {
  display: inline-block;
  width: 100%;
  margin: 0 0 28px;
  break-inside: avoid;
  text-decoration: none;
  color: inherit;

  background: var(--postal);
  padding: 11px 11px 0;
  border-radius: 3px;
  box-shadow:
    0 1px 0 rgba(255,255,255,.7) inset,
    0 10px 20px rgba(75,58,35,.16),
    0 2px 5px rgba(75,58,35,.14);
  transition: transform .28s ease, box-shadow .28s ease;
}

/* Cada postal cae con una inclinacion distinta, como apiladas a mano. */
.postal:nth-child(3n+1) { transform: rotate(-.7deg); }
.postal:nth-child(3n+2) { transform: rotate(.5deg); }
.postal:nth-child(3n+3) { transform: rotate(-.25deg); }

.postal:hover,
.postal:focus-visible {
  transform: rotate(0) translateY(-7px);
  box-shadow: 0 20px 34px rgba(75,58,35,.26), 0 3px 8px rgba(75,58,35,.18);
  outline: none;
}

.postal .marco {
  overflow: hidden;
  border-radius: 2px;
  background: var(--borde);
}

.postal img {
  width: 100%;
  height: auto;
  filter: sepia(.2) saturate(.9) contrast(1.03);
  transition: transform .7s ease, filter .5s ease;
}

.postal:hover img {
  transform: scale(1.07);
  filter: sepia(.06) saturate(1.02) contrast(1.02);
}

.postal .pie-postal {
  position: relative;
  padding: 13px 4px 15px;
  text-align: center;
}

.postal h3 {
  font-family: 'Manuscrita', 'Segoe Script', cursive;
  font-weight: 600;
  font-size: 27px;
  line-height: 1.1;
  margin: 0;
}

.postal .region {
  display: block;
  font-family: 'Maquina', 'Courier New', monospace;
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--suave);
  margin-top: 3px;
}

.postal .nota {
  margin: 7px 0 0;
  font-size: 14px;
  color: var(--suave);
  line-height: 1.5;
}

/* Sello postal: cuadrito dentado con la region, arriba a la derecha. */
.sello {
  position: absolute;
  top: -40px;
  right: 6px;
  width: 44px;
  height: 52px;
  background: rgba(253,248,236,.95);
  border: 1px dashed var(--oro);
  border-radius: 2px;
  transform: rotate(5deg);
  display: grid;
  place-items: center;
  font-family: 'Maquina', 'Courier New', monospace;
  font-size: 9px;
  letter-spacing: .06em;
  color: var(--oro);
  text-align: center;
  line-height: 1.15;
  padding: 3px;
  box-shadow: 0 2px 5px rgba(75,58,35,.18);
}

/* --------------------------------------------------------- filtros/sellos */

.filtros {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.filtros a {
  font-family: 'Maquina', 'Courier New', monospace;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--suave);
  background: rgba(253,248,236,.75);
  border: 1px dashed var(--borde);
  border-radius: 2px;
  padding: 8px 15px;
  transition: transform .18s ease;
}

.filtros a:hover { transform: translateY(-2px); color: var(--tinta); }

.filtros a.activo {
  color: #fdf8ec;
  background: var(--azul);
  border: 1px solid var(--azul);
  border-style: solid;
}

/* ------------------------------------------------------------------ redes */

.redes { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

.redes a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: 'Maquina', 'Courier New', monospace;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--tinta);
  background: var(--postal);
  border: 1px solid var(--borde);
  border-radius: 2px;
  padding: 12px 18px;
  box-shadow: 2px 2px 0 rgba(75,58,35,.14);
  transition: transform .18s ease, box-shadow .18s ease;
}

.redes a:hover {
  transform: translate(-1px,-1px);
  box-shadow: 4px 4px 0 rgba(75,58,35,.18);
  border-color: var(--tinta);
}

.ico { width: 18px; height: 18px; fill: currentColor; flex: none; }

/* ------------------------------------------------- boton flotante whatsapp */

.flotante {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--rojo);
  color: #fdf8ec;
  border: 2px solid #fdf8ec;
  box-shadow: 0 5px 16px rgba(60,40,20,.38);
  transition: transform .2s ease;
}

.flotante:hover { transform: scale(1.08); }
.flotante .ico { width: 27px; height: 27px; }

/* ------------------------------------------------------------- sobre/texto */

.pliego {
  background: var(--postal);
  border: 1px solid var(--borde);
  border-radius: 3px;
  padding: 34px 36px;
  max-width: 760px;
  box-shadow: 0 8px 18px rgba(75,58,35,.1);
}

.pliego p { color: var(--suave); }
.pliego p:first-of-type { color: var(--tinta); }

/* ----------------------------------------------------------------- pie */

.pie {
  border-top: 2px solid var(--borde);
  background: rgba(253,248,236,.6);
  margin-top: 40px;
  padding: 30px 0 34px;
  text-align: center;
  font-family: 'Maquina', 'Courier New', monospace;
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--suave);
  line-height: 1.9;
}

.pie small { font-size: 11px; opacity: .85; }

.vacio {
  background: var(--postal);
  border: 2px dashed var(--borde);
  border-radius: 3px;
  padding: 40px;
  text-align: center;
  color: var(--suave);
}

/* ---------------------------------------------------------------- visor */

/* Foto ampliada. Se abre con CSS :target: sin JavaScript. */
.visor {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(30,24,16,.94);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 26px;
  z-index: 60;
}

.visor:target { display: flex; }

.visor .lamina {
  background: var(--postal);
  padding: 12px 12px 0;
  border-radius: 3px;
  max-width: 1000px;
  box-shadow: 0 20px 50px rgba(0,0,0,.5);
}

.visor img { max-width: 100%; max-height: 74vh; width: auto; margin: 0 auto; }

.visor figcaption {
  padding: 12px 6px 16px;
  text-align: center;
}

.visor figcaption strong {
  font-family: 'Manuscrita', 'Segoe Script', cursive;
  font-weight: 600;
  font-size: 26px;
  display: block;
}

.visor figcaption .nota { color: var(--suave); font-size: 15px; }

.visor .credito {
  display: block;
  margin-top: 9px;
  font-family: 'Maquina', 'Courier New', monospace;
  font-size: 10px;
  letter-spacing: .06em;
  color: #9c8f7c;
}

.visor .credito a { color: inherit; }

.visor .cerrar {
  position: absolute;
  top: 16px;
  right: 24px;
  color: #fdf8ec;
  font-size: 34px;
  line-height: 1;
  text-decoration: none;
}

/* ----------------------------------------------------------- adaptable */

@media (max-width: 900px) {
  .coleccion { columns: 2 240px; column-gap: 20px; }
  .titulo { font-size: 33px; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .coleccion { columns: 1; }
  .postal { transform: none !important; }
  .hero { min-height: 52vh; padding: 52px 18px; }
  .pliego { padding: 24px 22px; }
  section { padding: 38px 0; }
}

/* Respeta a quien pidio menos animaciones en su sistema operativo. */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .postal { transform: none !important; }
  .postal:hover img { transform: none; }
  .flotante:hover, .btn:hover, .redes a:hover, .filtros a:hover { transform: none; }
}
