/* ═══════════════════════════════════════════
   VARIABLES
════════════════════════════════════════════ */
:root {
  --color-bg: #F8F9F4;
  --color-accent: #7A9E7E;
  --color-accent-dark: #5C8260;
  --color-text: #2C2C2C;
  --color-text-muted: #6B6B6B;
  --color-surface: #EDEEE8;

  --font-serif: Georgia, 'Times New Roman', serif;
  --font-sans: system-ui, -apple-system, sans-serif;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;

  --max-width: 900px;
  --radius: 4px;

  --transition: 200ms ease;
}


/* ═══════════════════════════════════════════
   RESET & BASE
════════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
}

ol, ul {
  list-style: none;
}

/* ═══════════════════════════════════════════
   UTILIDADES
════════════════════════════════════════════ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: normal;
  color: var(--color-text);
  text-align: center;
  margin-bottom: var(--space-lg);
  letter-spacing: 0.02em;
}

.section-title::after {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: var(--color-accent);
  margin: var(--space-sm) auto 0;
}


/* ═══════════════════════════════════════════
   ANIMACIÓN FADE-IN (scroll)
════════════════════════════════════════════ */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }

  html {
    scroll-behavior: auto;
  }
}


/* ═══════════════════════════════════════════
   HERO
════════════════════════════════════════════ */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-lg) var(--space-md);
  position: relative;
}

.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.hero__pre {
  font-family: var(--font-sans);
  font-size: clamp(0.7rem, 2vw, 0.85rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.hero__names {
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 10vw, 6rem);
  font-weight: normal;
  line-height: 1.1;
  letter-spacing: -0.01em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1em;
}

.hero__amp {
  font-size: 0.55em;
  color: var(--color-accent);
  line-height: 1;
}

.hero__date {
  font-family: var(--font-sans);
  font-size: clamp(0.85rem, 2.5vw, 1.05rem);
  color: var(--color-text-muted);
  letter-spacing: 0.08em;
  margin-top: var(--space-xs);
}

.hero__countdown {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.hero__countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 2.5rem;
}

.hero__countdown-value {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 5vw, 2.2rem);
  color: var(--color-accent-dark);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.hero__countdown-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-text-muted);
  margin-top: 0.3rem;
}

.hero__countdown-sep {
  color: var(--color-accent);
  opacity: 0.45;
  font-size: 1.1rem;
  padding-top: 0.35rem;
}

.hero__countdown-done {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--color-accent-dark);
  font-size: clamp(1rem, 3vw, 1.2rem);
}

.hero__divider {
  margin-top: var(--space-sm);
  opacity: 0.8;
}

/* Scroll indicator */
.hero__scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
}

.hero__scroll-line {
  display: block;
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--color-accent), transparent);
  animation: scroll-pulse 2s ease-in-out infinite;
}

@keyframes scroll-pulse {
  0%, 100% { opacity: 0.2; transform: scaleY(0.6); transform-origin: top; }
  50% { opacity: 1; transform: scaleY(1); transform-origin: top; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__scroll-line {
    animation: none;
    opacity: 0.5;
  }
}


/* ═══════════════════════════════════════════
   NUESTRA HISTORIA — TIMELINE
════════════════════════════════════════════ */
.history {
  padding-block: var(--space-xl);
  background-color: var(--color-bg);
}

.timeline {
  position: relative;
  padding-left: 3rem;
}

/* Línea vertical */
.timeline::before {
  content: '';
  position: absolute;
  left: 1.25rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 1px;
  background: var(--color-accent);
  opacity: 0.3;
}

.timeline__item {
  position: relative;
  padding-bottom: var(--space-lg);
}

.timeline__item:last-child {
  padding-bottom: 0;
}

/* Punto en la línea */
.timeline__item::before {
  content: '';
  position: absolute;
  left: -1.85rem;
  top: 0.4rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 2px solid var(--color-bg);
  box-shadow: 0 0 0 1px var(--color-accent);
}

.timeline__year {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 5vw, 2rem);
  color: var(--color-accent);
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.timeline__content h3 {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 3vw, 1.2rem);
  font-weight: normal;
  margin-bottom: 0.25rem;
}

.timeline__content p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.timeline__img {
  margin-top: var(--space-sm);
  border-radius: var(--radius);
  width: 100%;
  max-width: 360px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid rgba(122, 158, 126, 0.2);
}


/* ═══════════════════════════════════════════
   EL DÍA
════════════════════════════════════════════ */
.day {
  padding-block: var(--space-xl);
  background-color: var(--color-surface);
}

.day__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

@media (min-width: 600px) {
  .day__grid {
    grid-template-columns: 1fr 1fr;
  }
}

.day__block {
  background: var(--color-bg);
  border: 1px solid rgba(122, 158, 126, 0.2);
  border-radius: calc(var(--radius) * 2);
  padding: var(--space-md) var(--space-md) calc(var(--space-md) * 1.2);
  text-align: center;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.day__block:hover {
  border-color: var(--color-accent);
  box-shadow: 0 4px 16px rgba(122, 158, 126, 0.12);
}

.day__icon {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-sm);
  opacity: 0.85;
}

.day__label {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  font-weight: normal;
  margin-bottom: var(--space-xs);
}

.day__time {
  font-size: 1.5rem;
  font-family: var(--font-serif);
  color: var(--color-accent-dark);
  margin-bottom: var(--space-xs);
}

.day__place {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.day__detail {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* Mapa embebido */
.day__map {
  margin-top: var(--space-sm);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  width: 100%;
}

.day__map iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Delay */
.day__block:nth-child(1) { transition-delay: 0ms; }
.day__block:nth-child(2) { transition-delay: 120ms; }


/* ═══════════════════════════════════════════
   GALERÍA
════════════════════════════════════════════ */
.gallery {
  padding-block: var(--space-xl);
  background-color: var(--color-bg);
}

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: auto;
  gap: var(--space-sm);
}

@media (min-width: 600px) {
  .gallery__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.gallery__item {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition), box-shadow var(--transition);
  border: 1px solid rgba(122, 158, 126, 0.15);
}

.gallery__item:hover,
.gallery__item:focus-visible {
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(44, 44, 44, 0.12);
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Ítem ancho (ocupa 2 columnas) */
.gallery__item--wide {
  grid-column: span 2;
}

@media (min-width: 600px) {
  .gallery__item--wide {
    grid-column: span 1;
  }
}

.gallery__placeholder {
  color: var(--color-accent);
  opacity: 0.5;
  pointer-events: none;
}

/* Cuando hay imagen real, ocultar placeholder */
.gallery__item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Delay escalonado */
.gallery__item:nth-child(1) { transition-delay: 0ms; }
.gallery__item:nth-child(2) { transition-delay: 80ms; }
.gallery__item:nth-child(3) { transition-delay: 160ms; }
.gallery__item:nth-child(4) { transition-delay: 240ms; }
.gallery__item:nth-child(5) { transition-delay: 320ms; }


/* ═══════════════════════════════════════════
   FOOTER
════════════════════════════════════════════ */
.footer {
  background-color: var(--color-surface);
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  border-top: 1px solid rgba(122, 158, 126, 0.2);
}

.footer__quote {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 3vw, 1.25rem);
  font-style: italic;
  color: var(--color-text-muted);
  line-height: 1.7;
  max-width: 480px;
  margin-inline: auto;
  margin-bottom: var(--space-md);
}

.footer__names {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  color: var(--color-accent-dark);
  margin-bottom: var(--space-xs);
}

.footer__year {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  letter-spacing: 0.1em;
}


/* ═══════════════════════════════════════════
   LIGHTBOX
════════════════════════════════════════════ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 20, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-md);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.lightbox:not([hidden]) {
  opacity: 1;
}

/* Cuando está oculto con hidden, no se ve pero la transición necesita display */
.lightbox[hidden] {
  display: none;
}

.lightbox__close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  color: #fff;
  opacity: 0.7;
  padding: var(--space-xs);
  border-radius: 50%;
  transition: opacity var(--transition), background var(--transition);
}

.lightbox__close:hover,
.lightbox__close:focus-visible {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
  outline: 2px solid rgba(255, 255, 255, 0.4);
  outline-offset: 2px;
}

.lightbox__img {
  max-width: 100%;
  max-height: 90svh;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}
