/* ============================================================
   Estilos generales del sitio — "cuaderno de viajes"
   ============================================================ */

:root {
  --color-bg: #faf6ef;
  --color-bg-alt: #f1e9db;
  --color-ink: #23313a;
  --color-ink-soft: #5b6b73;
  --color-primary: #1c4550;
  --color-primary-dark: #123138;
  --color-accent: #d97a52;
  --color-accent-dark: #bd5f3a;
  --color-white: #ffffff;
  --color-border: #e2d9c8;
  --color-hero-fallback: #f3e7d8;

  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Poppins', system-ui, -apple-system, Segoe UI, sans-serif;

  --container-width: 1180px;
  --radius: 14px;
  --shadow-soft: 0 10px 30px rgba(23, 41, 46, 0.12);
  --shadow-strong: 0 20px 50px rgba(18, 30, 34, 0.35);
  --transition: 0.25s ease;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.5em;
  color: var(--color-primary-dark);
}

p { margin: 0 0 1em; }

a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------- Header / navegación ---------------- */

.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: 22px 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.site-nav {
  display: flex;
  gap: 28px;
}

.site-nav a {
  color: var(--color-white);
  font-weight: 500;
  font-size: 0.95rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.35);
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: border-color var(--transition);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  border-color: var(--color-accent);
}

/* Cuando el header aparece sobre fondo claro (páginas interiores) */
.site-header--solid {
  position: relative;
  background: var(--color-primary);
  padding: 18px 0;
}

.site-header--solid .site-nav a {
  text-shadow: none;
}

/* ---------------- Hero / Portada ---------------- */

.hero {
  position: relative;
  min-height: min(92vh, 900px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  /* Se ve si la foto no llega a cubrir el hueco entero (modo "foto
     completa sin recortar"), en vez de un fondo blanco. */
  background: var(--color-hero-fallback);
}

/* "Marco" de la portada: recorta lo que sobre y alinea la foto (dentro
   tiene su ancho en píxeles ya calculado a partir del zoom elegido en el
   panel, así que aquí solo hace falta encajarla y recortarla). */
.hero__img-frame {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.hero__img {
  flex-shrink: 0;
  max-width: none; /* el ancho lo fija el zoom, no el ancho del hero */
  height: auto;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(18,30,34,0.35) 0%, rgba(18,30,34,0.15) 45%, rgba(18,30,34,0.85) 100%);
}

.hero__content {
  position: relative;
  z-index: 5;
  width: 100%;
  padding: 0 24px 80px;
  max-width: var(--container-width);
  margin: 0 auto;
  color: var(--color-white);
}

.hero__title {
  font-size: var(--heading-size, clamp(2.4rem, 6vw, 4.2rem));
  color: var(--color-white);
  margin-bottom: 0.3em;
  text-shadow: 0 4px 24px rgba(0,0,0,0.35);
}

.hero__subtitle {
  font-size: var(--heading-size, clamp(1rem, 2vw, 1.25rem));
  max-width: 620px;
  color: rgba(255,255,255,0.92);
  text-shadow: 0 2px 14px rgba(0,0,0,0.35);
}

/* El admin puede fijar un tamaño concreto para pantallas normales (arriba),
   pero en móvil siempre imponemos un tamaño que quepa bien, sea cual sea
   ese valor. */
@media (max-width: 640px) {
  .hero__title { font-size: clamp(1.9rem, 9vw, 2.6rem); }
  .hero__subtitle { font-size: clamp(0.95rem, 4vw, 1.1rem); }
}

.hero__scroll {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  color: var(--color-white);
  opacity: 0.85;
  font-size: 1.6rem;
  animation: bob 2.2s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

/* ---------------- Sección destacada (teaser) ---------------- */

.section {
  padding: 90px 0;
}

.section--alt { background: var(--color-bg-alt); }

.section__head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px;
}

.section__eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-accent-dark);
  margin-bottom: 10px;
}

.section__title { font-size: var(--heading-size, clamp(1.8rem, 3.4vw, 2.6rem)); }
.section__subtitle { color: var(--color-ink-soft); font-size: var(--heading-size, 1.05rem); }

@media (max-width: 640px) {
  .section__title { font-size: clamp(1.5rem, 7vw, 1.9rem); }
  .section__subtitle { font-size: clamp(0.9rem, 4vw, 1rem); }
}

/*
  Tarjetas de "Por el mundo": tamaño fijo siempre (no se ensanchan, para
  que las fotos verticales no se recorten de más), filas centradas y como
  mucho 5 por fila — el ancho máximo de aquí es justo el de 5 tarjetas.
  El admin puede además partir la fila donde quiera (.teaser-row-break).
*/
.teaser-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  max-width: 1130px;
  margin-left: auto;
  margin-right: auto;
}

.teaser-card {
  flex: 0 0 210px;
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition), box-shadow var(--transition);
}

/* Elemento invisible que empuja a la siguiente fila. El margen negativo
   compensa el hueco de más que añadiría el "gap" en vertical. */
.teaser-row-break {
  flex-basis: 100%;
  height: 0;
  margin-top: -20px;
}

@media (max-width: 640px) {
  /* En el móvil mandan el ancho de la pantalla y el sentido común: las
     tarjetas se colocan solas y los saltos de fila no se aplican. */
  .teaser-card { flex-basis: 140px; }
  .teaser-row-break { display: none; }
}

.teaser-card--admin { cursor: default; }

.teaser-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-strong);
}

.teaser-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.teaser-card:hover img { transform: scale(1.06); }

/* ---------------- "Próximos viajes" ----------------
   Las tarjetas usan las mismas clases que las del blog (.blog-card, en
   blog.css): tamaño fijo, centradas y tres por fila. Aquí solo va el
   comentario corto, que sí conserva la tipografía que elija el admin. */
.future-card__comment {
  white-space: pre-line;
  overflow-wrap: anywhere;
  color: var(--color-ink-soft);
  font-size: var(--cap-size, 15px);
  letter-spacing: var(--cap-spacing, 0);
  line-height: var(--cap-lh, 1.4);
  flex: 1;
  margin: 0;
}
.future-card__comment[data-align="left"] { text-align: left; }
.future-card__comment[data-align="center"] { text-align: center; }
.future-card__comment[data-align="right"] { text-align: right; }

.section__cta {
  text-align: center;
  margin-top: 48px;
}

/* ---------------- Botones ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 30px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
}

.btn--primary {
  background: var(--color-accent);
  color: var(--color-white);
}
.btn--primary:hover { background: var(--color-accent-dark); transform: translateY(-2px); }

.btn--outline {
  background: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.btn--outline:hover { background: var(--color-primary); color: var(--color-white); }

.btn--ghost-light {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.5);
  color: var(--color-white);
  backdrop-filter: blur(4px);
}
.btn--ghost-light:hover { background: rgba(255,255,255,0.25); }

/* ---------------- Footer ---------------- */

.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,0.75);
  padding: 36px 0;
  text-align: center;
  font-size: 0.9rem;
}

.site-footer a {
  color: rgba(255,255,255,0.55);
  font-size: 0.8rem;
}
.site-footer a:hover { color: var(--color-white); }

.site-footer__links {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 10px;
}

/* ---------------- Página de galería (encabezado) ---------------- */

.page-head {
  background: var(--color-primary);
  color: var(--color-white);
  padding: 64px 0 48px;
  text-align: center;
}
.page-head h1 { color: var(--color-white); }
.page-head p { color: rgba(255,255,255,0.85); max-width: 560px; margin: 0 auto; }

.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--color-ink-soft);
}
.empty-state__icon { font-size: 2.6rem; margin-bottom: 16px; }

@media (max-width: 640px) {
  .site-nav { gap: 16px; }
  .section { padding: 60px 0; }
}
