@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,900;1,400;1,700&family=Crimson+Pro:ital,wght@0,300;0,400;0,600;1,300;1,400&family=DM+Mono:wght@300;400;500&display=swap');

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

:root {
  --bg:        #0a0705;
  --bg2:       #110e0b;
  --bg3:       #1a1410;
  --cream:     #e8ddd0;
  --cream2:    #bfb3a4;
  --gold:      #c4933f;
  --gold2:     #8a5f1e;
  --red:       #8b3a2a;
  --gray:      #2d2520;
  --gray2:     #3d342e;
  --font-disp: 'Playfair Display', Georgia, serif;
  --font-body: 'Crimson Pro', Georgia, serif;
  --font-mono: 'DM Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.7;
  overflow-x: hidden;
  cursor: default;
}

::selection { background: var(--gold2); color: var(--cream); }

/* ─── SCROLLBAR ─────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--gold2); border-radius: 2px; }

/* ─── NAV ───────────────────────────────────────────── */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 48px;
  transition: background 0.5s, padding 0.4s;
}
#nav.scrolled {
  background: rgba(10,7,5,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(196,147,63,0.15);
  padding: 14px 48px;
}
.nav-brand {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
}
.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cream2);
  text-decoration: none;
  transition: color 0.3s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 1px;
  background: var(--gold);
  transition: width 0.3s;
}
.nav-links a:hover { color: var(--gold); }
.nav-links a:hover::after { width: 100%; }

/* ─── HERO SLIDER ───────────────────────────────────── */
#hero {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.4s cubic-bezier(0.4,0,0.2,1);
}
.slide.active { opacity: 1; z-index: 2; }
.slide.prev   { opacity: 0; z-index: 1; }

.slide-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.08);
  transition: transform 8s ease-out;
  filter: brightness(0.45) contrast(1.1) sepia(0.25);
}
.slide.active .slide-img { transform: scale(1); }

.slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10,7,5,0.2) 0%,
    rgba(10,7,5,0.1) 40%,
    rgba(10,7,5,0.7) 80%,
    rgba(10,7,5,1) 100%
  );
  z-index: 3;
}

.slide-caption {
  position: absolute;
  bottom: 120px;
  left: 60px;
  right: 40%;
  z-index: 4;
  transform: translateY(20px);
  opacity: 0;
  transition: all 1.2s 0.6s cubic-bezier(0.4,0,0.2,1);
}
.slide.active .slide-caption {
  transform: translateY(0);
  opacity: 1;
}

.slide-number {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--gold);
  margin-bottom: 16px;
  display: block;
}
.slide-title {
  font-family: var(--font-disp);
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--cream);
  margin-bottom: 16px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}
.slide-title em {
  font-style: italic;
  color: var(--gold);
}
.slide-text {
  font-size: 15px;
  color: var(--cream2);
  line-height: 1.6;
  max-width: 520px;
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
}
.slide-location {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--cream2);
  text-transform: uppercase;
}
.slide-location::before {
  content: '';
  display: block;
  width: 20px; height: 1px;
  background: var(--gold);
}

/* Slider Controls */
.slider-controls {
  position: absolute;
  bottom: 40px;
  left: 60px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 20px;
}
.slider-dots {
  display: flex;
  gap: 8px;
}
.dot {
  width: 24px; height: 2px;
  background: rgba(232,221,208,0.3);
  cursor: pointer;
  transition: all 0.3s;
  border: none;
  padding: 0;
}
.dot.active {
  background: var(--gold);
  width: 40px;
}
.slider-arrows {
  display: flex;
  gap: 12px;
}
.arrow-btn {
  width: 42px; height: 42px;
  border: 1px solid rgba(196,147,63,0.4);
  background: rgba(10,7,5,0.6);
  color: var(--cream);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  backdrop-filter: blur(8px);
}
.arrow-btn:hover {
  border-color: var(--gold);
  background: rgba(196,147,63,0.15);
  color: var(--gold);
}

/* Progress bar */
.slide-progress {
  position: absolute;
  bottom: 0; left: 0;
  height: 2px;
  background: var(--gold);
  z-index: 6;
  width: 0%;
  transition: width linear;
}

/* ─── INTRO ─────────────────────────────────────────── */
#intro {
  padding: 120px 0 80px;
  max-width: 960px;
  margin: 0 auto;
  padding-inline: 60px;
}
.label-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}
.label-tag::before {
  content: '';
  display: block;
  width: 40px; height: 1px;
  background: var(--gold);
}

.intro-headline {
  font-family: var(--font-disp);
  font-size: clamp(32px, 5vw, 64px);
  font-weight: 400;
  line-height: 1.2;
  color: var(--cream);
  margin-bottom: 40px;
}
.intro-headline em {
  font-style: italic;
  color: var(--gold);
  display: block;
}

.intro-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-top: 48px;
}
.intro-body p {
  font-size: 17px;
  color: var(--cream2);
  line-height: 1.85;
}
.intro-body p + p { margin-top: 20px; }

.intro-divider {
  width: 1px;
  background: var(--gray2);
  grid-row: 1;
  grid-column: auto;
  display: none;
}

/* ─── TERRITORIOS ───────────────────────────────────── */
#territorios {
  padding: 80px 0;
  background: var(--bg2);
  border-top: 1px solid var(--gray);
  border-bottom: 1px solid var(--gray);
}
.section-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding-inline: 60px;
}
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 60px;
}
.section-title {
  font-family: var(--font-disp);
  font-size: clamp(24px, 3vw, 40px);
  font-weight: 400;
  color: var(--cream);
}

.municipios-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
}
.municipio-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3/4;
  cursor: pointer;
}
.municipio-placeholder {
  width: 100%; height: 100%;
  position: absolute;
  inset: 0;
  background: var(--gray);
  overflow: hidden;
}
.municipio-placeholder img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.5) sepia(0.3) contrast(1.1);
  transition: transform 0.8s cubic-bezier(0.4,0,0.2,1);
}
.municipio-card:hover .municipio-placeholder img {
  transform: scale(1.06);
}
.municipio-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,7,5,0.9) 0%, transparent 60%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px 24px;
  transition: background 0.4s;
}
.municipio-card:hover .municipio-overlay {
  background: linear-gradient(to top, rgba(10,7,5,0.95) 30%, rgba(10,7,5,0.3) 100%);
}
.municipio-num {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.3em;
  color: var(--gold);
  margin-bottom: 8px;
}
.municipio-name {
  font-family: var(--font-disp);
  font-size: 22px;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 8px;
}
.municipio-desc {
  font-size: 13px;
  color: var(--cream2);
  line-height: 1.5;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s 0.1s;
}
.municipio-card:hover .municipio-desc {
  max-height: 80px;
}

/* ─── AUDIO SECTION ─────────────────────────────────── */
#voces {
  padding: 120px 0;
}
.voces-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding-inline: 60px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
.voces-text .label-tag { margin-bottom: 24px; }
.voces-headline {
  font-family: var(--font-disp);
  font-size: clamp(26px, 3.5vw, 48px);
  font-weight: 400;
  line-height: 1.2;
  color: var(--cream);
  margin-bottom: 24px;
}
.voces-headline em { font-style: italic; color: var(--gold); }
.voces-body {
  font-size: 16px;
  color: var(--cream2);
  line-height: 1.85;
  margin-bottom: 40px;
}

/* Audio Player */
.audio-player-wrap {
  background: var(--bg3);
  border: 1px solid var(--gray2);
  padding: 32px;
  position: relative;
  overflow: hidden;
}
.audio-player-wrap::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--gold);
}
.audio-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
  display: block;
}
.audio-title {
  font-family: var(--font-disp);
  font-size: 20px;
  color: var(--cream);
  margin-bottom: 6px;
}
.audio-subtitle {
  font-size: 14px;
  color: var(--cream2);
  margin-bottom: 28px;
  font-style: italic;
}
.audio-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.play-btn {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--gold);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  flex-shrink: 0;
  color: var(--bg);
  font-size: 18px;
}
.play-btn:hover {
  background: #d4a34f;
  transform: scale(1.06);
  box-shadow: 0 0 24px rgba(196,147,63,0.4);
}
.audio-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cream2);
  min-width: 90px;
}
.audio-progress-wrap {
  flex: 1;
  height: 3px;
  background: var(--gray2);
  cursor: pointer;
  position: relative;
}
.audio-progress-fill {
  height: 100%;
  background: var(--gold);
  width: 0%;
  transition: width 0.1s linear;
  pointer-events: none;
}
.audio-waveform {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 40px;
  margin-top: 16px;
  overflow: hidden;
}
.waveform-bar {
  flex: 1;
  background: var(--gray2);
  border-radius: 1px;
  transition: background 0.1s;
  min-height: 3px;
}
.waveform-bar.active { background: var(--gold); }

.no-audio-msg {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gray2);
  letter-spacing: 0.1em;
  text-align: center;
  padding: 20px 0;
}

/* ─── GALERÍA NARRATIVA ──────────────────────────────── */
#galeria {
  padding: 80px 0 120px;
  background: var(--bg2);
}
.galeria-header {
  max-width: 1200px;
  margin: 0 auto;
  padding-inline: 60px;
  margin-bottom: 60px;
}
.galeria-masonry {
  max-width: 1200px;
  margin: 0 auto;
  padding-inline: 60px;
  columns: 3;
  column-gap: 16px;
}
.galeria-item {
  break-inside: avoid;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.galeria-item img,
.galeria-placeholder {
  width: 100%;
  display: block;
  filter: brightness(0.7) sepia(0.2);
  transition: all 0.6s cubic-bezier(0.4,0,0.2,1);
}
.galeria-placeholder {
  background: var(--gray);
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray2);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
}
.galeria-item:hover img,
.galeria-item:hover .galeria-placeholder {
  transform: scale(1.03);
  filter: brightness(0.85) sepia(0.1);
}
.galeria-item-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10,7,5,0);
  display: flex;
  align-items: flex-end;
  padding: 20px;
  transition: background 0.4s;
}
.galeria-item:hover .galeria-item-overlay {
  background: rgba(10,7,5,0.6);
}
.galeria-caption {
  font-family: var(--font-body);
  font-size: 14px;
  font-style: italic;
  color: var(--cream);
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.4s 0.1s;
  line-height: 1.5;
}
.galeria-item:hover .galeria-caption {
  opacity: 1;
  transform: translateY(0);
}

/* ─── CRÓNICA ────────────────────────────────────────── */
#cronica {
  padding: 120px 0;
}
.cronica-inner {
  max-width: 760px;
  margin: 0 auto;
  padding-inline: 60px;
}
.cronica-inner .label-tag { margin-bottom: 32px; }
.cronica-title {
  font-family: var(--font-disp);
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 400;
  line-height: 1.2;
  color: var(--cream);
  margin-bottom: 48px;
}
.cronica-title em { font-style: italic; color: var(--gold); }
.cronica-dropcap {
  font-size: 17px;
  color: var(--cream2);
  line-height: 1.85;
  margin-bottom: 28px;
}
.cronica-dropcap::first-letter {
  font-family: var(--font-disp);
  font-size: 72px;
  font-weight: 700;
  color: var(--gold);
  float: left;
  line-height: 0.8;
  margin-right: 12px;
  margin-top: 8px;
}
.cronica-body p {
  font-size: 17px;
  color: var(--cream2);
  line-height: 1.9;
  margin-bottom: 28px;
}
.cronica-pullquote {
  border-left: 3px solid var(--gold);
  padding: 24px 32px;
  margin: 48px 0;
  background: var(--bg3);
}
.cronica-pullquote p {
  font-family: var(--font-disp);
  font-size: 22px;
  font-style: italic;
  color: var(--cream);
  line-height: 1.5;
  margin: 0;
}
.cronica-pullquote cite {
  display: block;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--gold);
  font-style: normal;
}

/* ─── FOOTER ─────────────────────────────────────────── */
#footer {
  background: var(--bg2);
  border-top: 1px solid var(--gray);
  padding: 60px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.footer-brand {
  font-family: var(--font-disp);
  font-size: 24px;
  font-weight: 400;
  color: var(--cream);
  margin-bottom: 8px;
}
.footer-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--cream2);
  text-transform: uppercase;
}
.footer-right {
  text-align: right;
}
.footer-right p {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cream2);
  letter-spacing: 0.1em;
  line-height: 1.8;
}
.footer-right a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.3s;
}
.footer-right a:hover { color: var(--cream); }

/* ─── FADE IN ANIMATIONS ─────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.4,0,0.2,1),
              transform 0.8s cubic-bezier(0.4,0,0.2,1);
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}
.fade-up:nth-child(2) { transition-delay: 0.15s; }
.fade-up:nth-child(3) { transition-delay: 0.3s; }
.fade-up:nth-child(4) { transition-delay: 0.45s; }

/* ─── GRAIN OVERLAY ──────────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 128px 128px;
  opacity: 0.35;
}

/* ─── LIGHTBOX ───────────────────────────────────────── */
#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10,7,5,0.97);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
#lightbox.open { display: flex; }
#lightbox img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
}
#lightbox-close {
  position: absolute;
  top: 24px; right: 32px;
  background: none;
  border: none;
  color: var(--cream2);
  font-size: 28px;
  cursor: pointer;
  font-family: var(--font-mono);
  transition: color 0.3s;
}
#lightbox-close:hover { color: var(--gold); }

/* ─── LOADING ────────────────────────────────────────── */
#loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s, visibility 0.8s;
}
#loader.hidden { opacity: 0; visibility: hidden; }
.loader-title {
  font-family: var(--font-disp);
  font-size: 32px;
  font-weight: 400;
  color: var(--cream);
  margin-bottom: 8px;
  text-align: center;
}
.loader-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 48px;
}
.loader-bar-wrap {
  width: 200px;
  height: 1px;
  background: var(--gray);
  overflow: hidden;
}
.loader-bar {
  height: 100%;
  background: var(--gold);
  width: 0%;
  animation: loaderAnim 1.8s cubic-bezier(0.4,0,0.2,1) forwards;
}
@keyframes loaderAnim {
  0%   { width: 0%; }
  60%  { width: 70%; }
  100% { width: 100%; }
}

/* ─── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 900px) {
  #nav { padding: 16px 24px; }
  .nav-links { display: none; }
  .slide-caption { left: 24px; right: 24px; }
  .slider-controls { left: 24px; }
  .section-inner, .galeria-masonry, .galeria-header,
  #intro, .cronica-inner { padding-inline: 24px; }
  .intro-body { grid-template-columns: 1fr; gap: 24px; }
  .municipios-grid { grid-template-columns: repeat(2, 1fr); }
  .voces-inner { grid-template-columns: 1fr; gap: 40px; }
  #footer { flex-direction: column; gap: 32px; text-align: left; }
  .footer-right { text-align: left; }
  .galeria-masonry { columns: 2; }
}

/* ─── SPOTIFY EMBED ──────────────────────────────────── */
#spotify-wrap .audio-title {
  font-family: var(--font-disp);
  font-size: 18px;
  color: var(--cream);
  margin-bottom: 4px;
}
#spotify-wrap .audio-subtitle {
  font-size: 13px;
  font-style: italic;
  color: var(--cream2);
  margin-bottom: 0;
}
#spotify-embed iframe {
  display: block;
  width: 100%;
  border: none;
  border-radius: 4px;
}
