/* =========================================================
   CHILAPA, NAYARIT — Sitio de la comunidad
   ========================================================= */

:root {
  --bg-dark: #20261A;
  --bg-dark-2: #262D1E;
  --bg-dark-3: #2D3524;
  --cream: #FBF6EA;
  --cream-2: #F1E6CE;
  --accent: #C9622A;
  --accent-light: #E38A50;
  --accent-dark: #963F16;
  --secondary: #3C7A56;
  --secondary-light: #86C79C;
  --secondary-dark: #1E3F2C;
  --yellow: #E3A93A;
  --text-muted: #6E6A59;
  --border-light: #E4D9BE;
  --border-dark: #38402C;
  --font-head: 'Fraunces', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --container: 1180px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--bg-dark);
  background: var(--cream);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

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

.eyebrow {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.section { padding: 96px 0; }
.section--tight { padding: 72px 0; }
.section--dark { background: var(--bg-dark); color: var(--cream); }
.section--cream { background: var(--cream); color: var(--bg-dark); }
.section--cream-2 { background: var(--cream-2); color: var(--bg-dark); }

.section-head { max-width: 660px; margin-bottom: 56px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: clamp(30px, 4.2vw, 44px); }
.section-head p { margin-top: 16px; font-size: 17px; color: var(--text-muted); }
.section--dark .section-head p { color: #C4C9BB; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
  padding: 14px 28px;
  border-radius: 100px;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }

.btn--primary { background: var(--accent); color: var(--cream); }
.btn--primary:hover { background: var(--accent-light); box-shadow: 0 10px 26px rgba(201,98,42,0.35); }

.btn--outline { background: transparent; color: var(--cream); border: 1.5px solid rgba(251,246,234,0.35); }
.btn--outline:hover { border-color: var(--accent-light); color: var(--accent-light); }

.btn--outline-dark { background: transparent; color: var(--bg-dark); border: 1.5px solid rgba(32,38,26,0.25); }
.btn--outline-dark:hover { border-color: var(--accent); color: var(--accent-dark); }

/* ============ HEADER ============ */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 16px 0;
  transition: background 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease;
}
.header.is-scrolled {
  background: rgba(32,38,26,0.92);
  backdrop-filter: blur(10px);
  padding: 10px 0;
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
}
.header__inner { display: flex; align-items: center; justify-content: space-between; }

.logo {
  font-family: var(--font-head);
  font-weight: 700;
  font-style: italic;
  font-size: 24px;
  letter-spacing: 0.01em;
  color: var(--cream);
  line-height: 1;
}
.logo span {
  display: block;
  font-style: normal;
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-top: 3px;
}

.nav { display: flex; align-items: center; gap: 40px; }
.nav__links { display: none; gap: 28px; }
@media (min-width: 960px) { .nav__links { display: flex; } }
.nav__links a {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 14.5px;
  color: var(--cream);
  opacity: 0.85;
  position: relative;
  padding: 4px 0;
}
.nav__links a:hover { opacity: 1; color: var(--accent-light); }

.nav__cta { display: none; }
@media (min-width: 960px) { .nav__cta { display: inline-flex; } }

.burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1100;
}
.burger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--cream);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.burger.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.is-active span:nth-child(2) { opacity: 0; }
.burger.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (min-width: 960px) { .burger { display: none; } }

.mobile-menu {
  position: fixed;
  inset: 0;
  background: linear-gradient(160deg, var(--secondary-dark), var(--secondary) 75%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  transform: translateY(-100%);
  transition: transform 0.4s cubic-bezier(0.65,0,0.35,1);
  z-index: 1050;
}
.mobile-menu.is-open { transform: translateY(0); }
.mobile-menu a {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 26px;
  color: var(--cream);
}
.mobile-menu a:hover { color: var(--yellow); }
.mobile-menu .btn { margin-top: 10px; }
@media (min-width: 960px) { .mobile-menu { display: none; } }

/* ============ HERO ============ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  color: var(--cream);
  background: var(--bg-dark);
  overflow: hidden;
}
.hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 65%;
  opacity: 0.5;
}
.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(32,38,26,0.55) 0%, rgba(30,42,26,0.8) 55%, rgba(28,32,20,0.97) 100%);
}
.hero__content {
  position: relative;
  z-index: 2;
  padding-top: 130px;
  padding-bottom: 120px;
  max-width: 760px;
}
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(60,122,86,0.25);
  border: 1px solid rgba(134,199,156,0.35);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--secondary-light);
}
.hero__badge::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--secondary-light);
}
.hero h1 {
  font-style: italic;
  font-size: clamp(52px, 10vw, 96px);
  line-height: 0.98;
  color: var(--cream);
}
.hero h1 small {
  display: block;
  font-style: normal;
  font-weight: 600;
  font-size: clamp(14px, 1.6vw, 17px);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-top: 14px;
}
.hero__subtitle {
  margin-top: 22px;
  font-size: clamp(17px, 2.2vw, 21px);
  color: #DDE0D4;
  max-width: 500px;
}
.hero__actions {
  margin-top: 38px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ============ QUICK INFO CARDS ============ */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  position: relative;
  z-index: 2;
  margin-top: -40px;
}
.quick-card {
  background: var(--bg-dark-2);
  border: 1px solid var(--border-dark);
  border-radius: 18px;
  padding: 26px 24px;
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.quick-card:hover { transform: translateY(-6px); border-color: var(--accent); }
.quick-card__icon { font-size: 22px; margin-bottom: 14px; }
.quick-card h3 { font-size: 15px; color: var(--yellow); letter-spacing: 0.04em; margin-bottom: 10px; }
.quick-card p { font-size: 14.5px; color: #C4C9BB; }

/* ============ BANNER STRIP ============ */
.banner {
  background: var(--secondary-dark);
  color: var(--cream);
  padding: 56px 0;
  text-align: center;
}
.banner p:first-child {
  font-family: var(--font-head);
  font-weight: 700;
  font-style: italic;
  font-size: clamp(20px, 3vw, 30px);
  max-width: 780px;
  margin: 0 auto;
  line-height: 1.3;
}
.banner p:last-child {
  margin-top: 14px;
  font-size: 13.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--secondary-light);
  font-weight: 700;
}

/* ============ NUESTRO PUEBLO ============ */
.pueblo-quote {
  font-family: var(--font-head);
  font-weight: 700;
  font-style: italic;
  font-size: clamp(24px, 3.6vw, 36px);
  line-height: 1.25;
  color: var(--bg-dark);
  max-width: 820px;
  margin-bottom: 24px;
}
.pueblo-quote span { color: var(--accent-dark); }
.pueblo-text { max-width: 760px; font-size: 16.5px; color: #3A3D2F; margin-bottom: 18px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin-top: 44px;
}
.stat-card {
  background: var(--cream-2);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 24px 20px;
}
.stat-card__num {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(24px, 3vw, 30px);
  color: var(--accent-dark);
  line-height: 1;
}
.stat-card__label { margin-top: 10px; font-size: 13px; color: var(--text-muted); line-height: 1.4; }

/* ============ HISTORIA / TIMELINE ============ */
.timeline { position: relative; margin-top: 20px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 11px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--border-dark);
}
.timeline-item {
  position: relative;
  padding-left: 44px;
  padding-bottom: 40px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: 3px; top: 4px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--bg-dark);
  border: 3px solid var(--accent);
}
.timeline-item__year {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--accent-light);
  font-size: 15px;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.timeline-item h4 { font-size: 18.5px; color: var(--cream); margin-bottom: 8px; }
.timeline-item p { font-size: 15px; color: #C4C9BB; max-width: 640px; }
.timeline-item p.note { color: var(--yellow); font-style: italic; margin-top: 8px; font-size: 14px; }

.historia-media { border-radius: 18px; overflow: hidden; margin-bottom: 48px; }
.historia-media img { width: 100%; aspect-ratio: 16/8; object-fit: cover; }

/* ============ LUGARES ============ */
.place-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
  margin-top: 44px;
}
.place-card {
  background: var(--cream);
  border: 1px solid var(--border-light);
  border-radius: 18px;
  overflow: hidden;
  transition: transform 0.3s ease;
}
.place-card:hover { transform: translateY(-6px); }
.place-card__media { height: 180px; position: relative; overflow: hidden; }
.place-card__media img { width: 100%; height: 100%; object-fit: cover; }
.place-card__media--pattern {
  background:
    radial-gradient(circle at 20% 30%, rgba(201,98,42,0.35), transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(60,122,86,0.4), transparent 50%),
    var(--bg-dark);
  display: flex; align-items: center; justify-content: center;
}
.place-card__media--pattern .place-card__glyph { font-size: 40px; opacity: 0.85; }
.place-card__body { padding: 22px 24px; }
.place-card__tag {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 8px;
}
.place-card h3 { font-size: 18.5px; margin-bottom: 8px; }
.place-card p { font-size: 14.5px; color: var(--text-muted); }
.place-card__link { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-family: var(--font-head); font-weight: 700; font-size: 13px; color: var(--accent-dark); }

.credit-tag {
  display: block;
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--text-muted);
}
.credit-tag a { color: var(--accent-dark); }
.section--dark .credit-tag { color: #98A08B; }
.section--dark .credit-tag a { color: var(--accent-light); }

/* ============ FIESTAS ============ */
.fiesta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
  margin-top: 44px;
}
.fiesta-card {
  background: var(--cream-2);
  border: 1px solid var(--border-light);
  border-radius: 18px;
  padding: 30px 26px;
}
.fiesta-card__date {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream);
  background: var(--accent);
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 16px;
}
.fiesta-card h3 { font-size: 19px; margin-bottom: 10px; }
.fiesta-card p { font-size: 15px; color: var(--text-muted); }

/* ============ GALERIA ============ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 44px;
}
.gallery-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 4/3;
  cursor: pointer;
  background: var(--cream-2);
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.gallery-item:hover img { transform: scale(1.07); }
.gallery-item__caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 16px 12px;
  background: linear-gradient(0deg, rgba(0,0,0,0.72), transparent);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
}
.gallery-item--cta {
  border: 1.5px dashed rgba(150,63,22,0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 20px;
  cursor: default;
}
.gallery-item--cta .glyph { font-size: 26px; opacity: 0.6; }
.gallery-item--cta span { font-size: 12.5px; color: var(--text-muted); font-weight: 600; max-width: 160px; }
.gallery-item--cta a { margin-top: 6px; font-size: 12px; color: var(--accent-dark); font-weight: 700; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(15,18,10,0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 40px 20px;
}
.lightbox.is-open { display: flex; }
.lightbox__inner { max-width: 1000px; width: 100%; }
.lightbox__inner img { width: 100%; max-height: 78vh; object-fit: contain; border-radius: 10px; }
.lightbox__caption { color: #D9DCCF; font-size: 13.5px; margin-top: 14px; text-align: center; }
.lightbox__caption a { color: var(--accent-light); }
.lightbox__close {
  position: absolute; top: 24px; right: 28px;
  background: none; border: none; color: #fff;
  font-size: 32px; cursor: pointer; line-height: 1;
}

/* ============ REDES / VIDEOS ============ */
.social-group { margin-bottom: 64px; }
.social-group:last-child { margin-bottom: 0; }
.social-group__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 26px; flex-wrap: wrap; }
.social-group__head h3 { font-size: 22px; color: var(--cream); }
.social-group__head span { font-size: 13.5px; color: #98A08B; }

.fb-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 820px) { .fb-layout { grid-template-columns: 1fr; } }

.fb-page-embed {
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-dark-2);
  border: 1px solid var(--border-dark);
}
.fb-page-embed iframe { width: 100%; display: block; }

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.video-card {
  background: var(--bg-dark-2);
  border: 1px solid var(--border-dark);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.video-card__frame {
  background: #000;
  display: flex;
  justify-content: center;
  min-height: 280px;
}
.video-card__frame iframe { border: none; width: 100%; }
.video-card__body { padding: 16px 18px; }
.video-card__body h4 { font-size: 14.5px; color: var(--cream); margin-bottom: 6px; line-height: 1.35; }
.video-card__body a.source-link { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--accent-light); font-weight: 700; margin-top: 6px; }
.video-card__body .author { font-size: 12.5px; color: #98A08B; }

.social-note {
  margin-top: 40px;
  background: var(--bg-dark-2);
  border: 1px solid var(--border-dark);
  border-radius: 16px;
  padding: 22px 26px;
  font-size: 14px;
  color: #B7BDA9;
}
.social-note strong { color: var(--cream); }

/* ============ UBICACION ============ */
.ubicacion-wrap { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 48px; align-items: center; }
@media (max-width: 900px) { .ubicacion-wrap { grid-template-columns: 1fr; } }
.ubicacion-list { margin-top: 24px; }
.ubicacion-list li {
  display: flex; gap: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--border-light);
  font-size: 15px;
}
.ubicacion-list li:last-child { border-bottom: 1px solid var(--border-light); }
.ubicacion-list b { min-width: 132px; display: inline-block; color: var(--accent-dark); font-family: var(--font-head); }
.map-frame { border-radius: 20px; overflow: hidden; border: 1px solid var(--border-light); }
.map-frame iframe { width: 100%; height: 420px; border: 0; display: block; }

/* ============ COLABORA ============ */
.collab {
  background: linear-gradient(135deg, var(--secondary-dark), var(--bg-dark) 70%);
  color: var(--cream);
  padding: 72px 0;
  text-align: center;
}
.collab h2 { font-size: clamp(26px, 3.6vw, 38px); margin-bottom: 16px; }
.collab p { max-width: 560px; margin: 0 auto 28px; color: #CDD2C0; font-size: 16px; }

/* ============ FOOTER ============ */
.footer { background: var(--bg-dark); color: #9BA096; padding: 56px 0 28px; border-top: 1px solid var(--border-dark); }
.footer__top {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px;
  padding-bottom: 36px; border-bottom: 1px solid var(--border-dark);
}
.footer__brand .logo { margin-bottom: 14px; }
.footer__brand p { max-width: 300px; font-size: 14px; }
.footer__links { display: flex; gap: 56px; flex-wrap: wrap; }
.footer__col h4 { font-family: var(--font-head); font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cream); margin-bottom: 16px; }
.footer__col a, .footer__col p { display: block; font-size: 14px; margin-bottom: 10px; }
.footer__col a:hover { color: var(--accent-light); }
.footer__sources { padding-top: 28px; font-size: 12px; color: #7D8272; line-height: 1.8; }
.footer__sources a { color: #9BA096; text-decoration: underline; text-underline-offset: 2px; }
.footer__bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 20px; font-size: 13px; }

/* ============ REVEAL ANIM ============ */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 600px) {
  .section { padding: 64px 0; }
  .hero__content { padding-top: 110px; padding-bottom: 90px; }
}
