:root {
  --bg: #faf7f2;
  --bg-alt: #f2ede4;
  --ink: #1c2128;
  --ink-soft: #4a5261;
  --muted: #7c8493;
  --line: #e6dfd2;
  --accent: #c85a3a;
  --accent-deep: #a3462b;
  --sky: #eae2d0;
  --sky-2: #d9c9a9;
  --dark: #1f2937;
  --card: #ffffff;
  --shadow-sm: 0 1px 2px rgba(28, 33, 40, 0.06), 0 2px 6px rgba(28, 33, 40, 0.04);
  --shadow-md: 0 4px 12px rgba(28, 33, 40, 0.08), 0 12px 32px rgba(28, 33, 40, 0.08);
  --radius: 14px;
  --radius-lg: 22px;
  --maxw: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
}

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

a {
  color: var(--accent-deep);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

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

h1, h2, h3, h4 {
  font-family: 'Fraunces', 'Times New Roman', serif;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.08;
  margin: 0 0 0.5em;
  color: var(--ink);
}

h1 { font-size: clamp(2.6rem, 6vw, 4.8rem); font-weight: 800; }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: 1.4rem; }
h4 { font-size: 1rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); }

.accent { color: var(--accent); }
.muted { color: var(--muted); }

.eyebrow {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0.9em 1.6em;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--dark);
  color: #fff;
}
.btn-primary:hover {
  background: #000;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-ghost:hover {
  background: var(--ink);
  color: #fff;
  text-decoration: none;
}
.btn-sm {
  padding: 0.55em 1.1em;
  font-size: 0.85rem;
}

/* Hero */
.hero {
  position: relative;
  background:
    radial-gradient(1000px 500px at 80% -10%, #f7e6c8 0%, transparent 60%),
    radial-gradient(700px 500px at 10% 100%, #f0d8bf 0%, transparent 60%),
    linear-gradient(180deg, #fbf6ea 0%, var(--bg) 100%);
  overflow: hidden;
  padding-bottom: clamp(4rem, 8vw, 7rem);
}
.hero-gradient {
  position: absolute;
  inset: auto 0 0 0;
  height: 60px;
  background: linear-gradient(180deg, transparent, var(--bg));
  pointer-events: none;
}
.nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.5rem 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.logo {
  font-family: 'Fraunces', serif;
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--ink);
  letter-spacing: -0.01em;
  text-decoration: none;
}
.logo:hover { text-decoration: none; }
.nav-links {
  display: flex;
  gap: 1.6rem;
}
.nav-links a {
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 0.95rem;
}
.nav-links a:hover { color: var(--accent); text-decoration: none; }

.hero-content {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) 24px 0;
  text-align: center;
}
.hero-eyebrow {
  display: inline-block;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  padding: 0.4em 1em;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(4px);
  margin-bottom: 1.5rem;
}
.hero h1 {
  margin: 0 0 1.2rem;
}
.tagline {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--ink-soft);
  max-width: 620px;
  margin: 0 auto 2.2rem;
  line-height: 1.55;
}
.hero-cta {
  display: flex;
  gap: 0.85rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Reunion */
.reunion {
  padding: clamp(4rem, 8vw, 7rem) 0;
  background: var(--bg);
}
.reunion-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
}
.reunion-info h2 {
  margin-top: 0.3rem;
  margin-bottom: 1.5rem;
}
.reunion-address {
  font-size: 1.15rem;
  color: var(--ink-soft);
  margin: 0 0 1.8rem;
  line-height: 1.6;
}
.reunion-note {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 420px;
}
.map-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  aspect-ratio: 4 / 3;
  background: var(--bg-alt);
}
.map-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Galería */
.galeria {
  padding: clamp(4rem, 8vw, 7rem) 0 clamp(5rem, 10vw, 9rem);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
}
.galeria-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 3rem;
}
.section-lead {
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin: 0.5rem 0 0;
}
.galeria-meta {
  margin-top: 1.4rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  min-height: 40px;
}
.galeria-updated {
  font-size: 0.85rem;
  color: var(--muted);
}
.gallery-groups { display: block; }

.carousel {
  position: relative;
  margin: 0 -24px;
  padding: 0;
}
.carousel-track {
  display: flex;
  gap: 14px;
  padding: 8px 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}
.carousel-track::-webkit-scrollbar { display: none; }

.gallery-item {
  position: relative;
  flex: 0 0 auto;
  width: clamp(220px, 32vw, 320px);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-alt);
  cursor: zoom-in;
  box-shadow: var(--shadow-sm);
  scroll-snap-align: start;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border: 0;
  padding: 0;
}
.gallery-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  opacity: 0;
}
.gallery-item img.loaded {
  opacity: 1;
}
.gallery-item:hover img.loaded {
  transform: scale(1.04);
}
.gallery-item-date {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 5px 10px;
  background: rgba(15, 20, 30, 0.7);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  text-transform: capitalize;
  pointer-events: none;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: opacity 0.2s ease, background 0.15s ease, transform 0.15s ease;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
}
.carousel:hover .carousel-btn,
.carousel-btn:focus-visible {
  opacity: 1;
  pointer-events: auto;
}
.carousel-btn:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.05);
}
.carousel-btn:disabled {
  opacity: 0 !important;
  pointer-events: none;
}
.carousel-btn.prev { left: 12px; }
.carousel-btn.next { right: 12px; }

@media (max-width: 820px) {
  .carousel-btn { display: none; }
  .carousel { margin: 0 -20px; }
  .carousel-track { padding: 8px 20px; }
}

/* Estados */
.gallery-state {
  padding: 4rem 1.5rem;
  text-align: center;
  color: var(--muted);
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
}
.gallery-state.error { color: var(--accent-deep); }
.gallery-state p { margin: 0.5rem 0 0; }
.gallery-state .btn { margin-top: 1.3rem; }

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Footer */
footer {
  background: var(--dark);
  color: #d6dae1;
  padding: 4rem 0 2rem;
}
footer .logo { color: #fff; }
footer h4 { color: #fff; }
footer p { margin: 0.35rem 0; color: #b1b7c2; }
footer a { color: #f0e0d1; }
footer a:hover { color: #fff; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.4fr;
  gap: 2rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.copyright {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.6rem 24px 0;
  font-size: 0.85rem;
  color: #8a91a0;
  text-align: center;
}

/* Chat FAB */
.chat-fab {
  position: fixed !important;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 14px 20px 14px 16px;
  background: linear-gradient(135deg, #1f2937 0%, #2a3546 100%);
  color: #fff;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 0 0 4px rgba(200, 90, 58, 0.15),
    0 10px 30px rgba(15, 20, 30, 0.35),
    0 4px 12px rgba(15, 20, 30, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: fab-glow 3.2s ease-in-out infinite;
}
@keyframes fab-glow {
  0%, 100% {
    box-shadow:
      0 0 0 4px rgba(200, 90, 58, 0.15),
      0 10px 30px rgba(15, 20, 30, 0.35),
      0 4px 12px rgba(15, 20, 30, 0.25);
  }
  50% {
    box-shadow:
      0 0 0 10px rgba(200, 90, 58, 0.08),
      0 0 24px rgba(200, 90, 58, 0.35),
      0 10px 30px rgba(15, 20, 30, 0.35),
      0 4px 12px rgba(15, 20, 30, 0.25);
  }
}
.chat-fab:hover {
  color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
}
.chat-fab:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.chat-fab-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--accent);
  filter: drop-shadow(0 0 6px rgba(200, 90, 58, 0.5));
}
.chat-fab-text {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.15;
  text-align: left;
}
.chat-fab-title {
  font-weight: 700;
  font-size: 0.98rem;
}
.chat-fab-sub {
  font-size: 0.7rem;
  font-weight: 500;
  color: #b7c0d0;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-top: 2px;
}
@media (max-width: 520px) {
  .chat-fab {
    padding: 0;
    width: 60px;
    height: 60px;
    justify-content: center;
    gap: 0;
    right: 16px;
    bottom: 16px;
  }
  .chat-fab-text { display: none; }
  .chat-fab-icon { width: 26px; height: 26px; }
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 22, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: clamp(1rem, 4vw, 3rem);
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.lightbox-close,
.lightbox-nav {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.lightbox-close { top: 20px; right: 20px; }
.lightbox-nav { top: 50%; transform: translateY(-50%); font-size: 2rem; }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-close:hover,
.lightbox-nav:hover { background: rgba(255, 255, 255, 0.2); }
.lightbox-caption {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  text-align: center;
  padding: 0 3rem;
}

/* Responsive */
@media (max-width: 820px) {
  .nav-links { gap: 1rem; }
  .nav-links a:last-child { display: none; }
  .reunion-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; text-align: left; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
  .lightbox-nav { width: 40px; height: 40px; }
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
}

@media (max-width: 480px) {
  .hero-cta { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
  .nav-links { display: none; }
}
