/* Guía Cartagena Express — tokens */
:root {
  --papel: #F6EEDF;
  --papel-sombra: #E8DCC4;
  --tinta: #2B2118;
  --coral: #E85D45;
  --mango: #F2A33C;
  --crepusculo: #123840;
  --crepusculo-osc: #0B272E;
  --palma: #3F6B50;
  --blanco: #FFFDF8;
}

@font-face {
  font-family: "Bebas Neue";
  src: url("../fuentes/bebas-neue-400.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "Alegreya Sans";
  src: url("../fuentes/alegreya-sans-400.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "Alegreya Sans";
  src: url("../fuentes/alegreya-sans-700.woff2") format("woff2");
  font-weight: 700; font-display: swap;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Alegreya Sans", system-ui, sans-serif;
  color: var(--tinta);
  background:
    radial-gradient(120% 90% at 50% -10%, #1C4A54 0%, var(--crepusculo) 55%, var(--crepusculo-osc) 100%)
    var(--crepusculo);
  min-height: 100vh;
}
:focus-visible { outline: 3px solid var(--mango); outline-offset: 3px; }

/* ---------- Menú: cabecera de papel ---------- */
.cabecera {
  background: var(--papel);
  text-align: center;
  padding: clamp(2rem, 5vw, 3.5rem) 1.5rem 1.75rem;
}
.eyebrow {
  font-size: .8rem; font-weight: 700;
  letter-spacing: .28em;
  color: var(--palma);
}
.marca {
  font-family: "Bebas Neue", "Arial Narrow", sans-serif;
  font-weight: 400;
  font-size: clamp(3rem, 9vw, 5.5rem);
  line-height: .95;
  letter-spacing: .02em;
  color: var(--coral);
  margin: .35rem 0 .5rem;
}
.lema {
  max-width: 44ch; margin: 0 auto;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  color: #5B4A3A;
}
.rasgado { display: block; width: 100%; height: 26px; margin-top: -1px; }
.rasgado path { fill: var(--papel); }

/* ---------- Menú: kiosco de postales ---------- */
.kiosco { padding: clamp(1.5rem, 4vw, 3rem) 1.25rem 2rem; }
.rejilla {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: clamp(1.25rem, 3vw, 2.25rem);
  max-width: 1100px; margin: 0 auto;
}
.postal { display: flex; }
.postal-enlace {
  position: relative;
  display: flex; flex-direction: column;
  width: 100%;
  background: var(--blanco);
  padding: .6rem .6rem .9rem;
  border-radius: 4px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
  text-decoration: none; color: var(--tinta);
  transform: rotate(var(--giro, 0deg));
  transition: transform .25s ease, box-shadow .25s ease;
}
.postal:nth-child(4n+1) .postal-enlace { --giro: -1.6deg; }
.postal:nth-child(4n+2) .postal-enlace { --giro: 1.2deg; }
.postal:nth-child(4n+3) .postal-enlace { --giro: -.8deg; }
.postal:nth-child(4n+4) .postal-enlace { --giro: 1.8deg; }
.postal-enlace:hover, .postal-enlace:focus-visible {
  transform: rotate(0deg) translateY(-6px) scale(1.02);
  box-shadow: 0 18px 34px rgba(0, 0, 0, .45);
}
.postal-portada {
  width: 100%; aspect-ratio: 9 / 16;
  object-fit: cover; border-radius: 2px;
  background: var(--papel-sombra);
}
.sello {
  position: absolute; top: -.7rem; right: -.5rem;
  background: var(--mango); color: var(--tinta);
  font-size: .72rem; font-weight: 700; letter-spacing: .06em;
  padding: .3rem .5rem;
  border: 2px dashed rgba(43, 33, 24, .55);
  border-radius: 3px;
  transform: rotate(4deg);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .3);
}
.postal-titulo {
  font-family: "Bebas Neue", "Arial Narrow", sans-serif;
  font-size: 1.45rem; line-height: 1;
  margin-top: .7rem;
}
.postal-cta { font-size: .85rem; color: var(--coral); font-weight: 700; margin-top: .15rem; }
.aviso {
  text-align: center; color: var(--papel);
  font-size: 1.1rem; padding: 3rem 1rem;
}

/* entrada en cascada */
@media (prefers-reduced-motion: no-preference) {
  .postal { animation: aparecer .5s ease-out backwards; }
  .postal:nth-child(1) { animation-delay: .05s; } .postal:nth-child(2) { animation-delay: .1s; }
  .postal:nth-child(3) { animation-delay: .15s; } .postal:nth-child(4) { animation-delay: .2s; }
  .postal:nth-child(5) { animation-delay: .25s; } .postal:nth-child(6) { animation-delay: .3s; }
  .postal:nth-child(7) { animation-delay: .35s; } .postal:nth-child(8) { animation-delay: .4s; }
  @keyframes aparecer { from { opacity: 0; transform: translateY(18px); } }
}

/* ---------- Footer ---------- */
.pie { padding: 2.5rem 1.25rem 0; text-align: center; }
.pie-titulo {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.4rem; color: var(--mango); letter-spacing: .08em;
}
.redes { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 2rem; padding: .5rem 0 2rem; }
.redes a { color: var(--papel); text-decoration: none; font-weight: 700; }
.redes a span { font-weight: 400; opacity: .8; }
.redes a:hover, .redes a:focus-visible { color: var(--mango); }
.tricolor { display: flex; height: 8px; }
.tricolor i { flex: 1; }
.tricolor i:nth-child(1) { background: #2E8B57; }
.tricolor i:nth-child(2) { background: #F2C230; }
.tricolor i:nth-child(3) { background: #D3452E; }

/* ---------- Vista libro ---------- */
#pantalla-libro {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column;
  background:
    radial-gradient(100% 100% at 50% 0%, #143C46 0%, var(--crepusculo-osc) 70%)
    var(--crepusculo-osc);
}
#pantalla-libro[hidden] { display: none; }
.barra {
  display: flex; align-items: center; gap: 1rem;
  padding: .6rem 1rem;
  background: rgba(11, 39, 46, .8);
  color: var(--papel);
}
.barra h2 {
  flex: 1; text-align: center;
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400; font-size: 1.5rem; letter-spacing: .05em;
  color: var(--mango);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.barra-acciones { display: flex; align-items: center; gap: .75rem; }
#contador { font-size: .9rem; opacity: .85; min-width: 7.5rem; text-align: right; }
.barra button {
  background: none; border: 1px solid rgba(246, 238, 223, .4);
  color: var(--papel); font: inherit;
  padding: .35rem .8rem; border-radius: 999px;
  cursor: pointer;
}
.barra button:hover, .barra button:focus-visible { background: rgba(246, 238, 223, .15); }
.escenario {
  flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  gap: .5rem; padding: 1rem;
}
/* StPageFlip pisa el estilo inline de #libro (width:100%): el tamaño exacto
   lo fija app.js sobre el marco envolvente, que la librería no toca. */
.marco { flex: none; }
#libro { width: 100%; height: 100%; }
.pagina { background: var(--papel-sombra); }
.pagina img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  user-select: none; -webkit-user-drag: none;
}
.pagina--error {
  display: flex; align-items: center; justify-content: center;
  color: var(--tinta); font-size: .95rem; text-align: center; padding: 1rem;
}
.flecha {
  flex: none;
  width: 3rem; height: 3rem; border-radius: 50%;
  border: none; cursor: pointer;
  background: var(--papel); color: var(--tinta);
  font-size: 1.6rem; line-height: 1;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .4);
}
.flecha:disabled { opacity: .25; cursor: default; }
.flecha:not(:disabled):hover { background: var(--mango); }

@media (max-width: 640px) {
  .flecha { display: none; }           /* en móvil se pasa con swipe */
  #contador { min-width: 0; }
}
