/* ============================================================
   22° FESTIVAL SAN SALVADOR · LA DANZA Y LOS GURISES
   Diseño moderno, cálido y folklórico. Mobile-First.
   ============================================================ */

/* ---------- 1. Variables & Reset ---------- */
:root {
  /* Primario · tonos tierra/madera */
  --wood-darkest: #2C1810;
  --wood-dark:    #3E2723;
  /* Secundario · verde monte/campo */
  --green-deep:   #1B4332;
  --green-mid:    #2D6A4F;
  /* Acentos */
  --gold:         #D4AF37;
  --gold-soft:    #E6C65C;
  --terracota:    #A04000;
  /* Fondos */
  --cream:        #FDFBF7;
  --white:        #FFFFFF;
  --ink:          #24130C;
  /* Tipografía */
  --font-title: 'Playfair Display', 'Cinzel', Georgia, serif;
  --font-body:   'Inter', 'Roboto', system-ui, -apple-system, sans-serif;

  /* Layout */
  --container: 1180px;
  --radius: 16px;
  --shadow-sm: 0 2px 10px rgba(36, 19, 12, 0.08);
  --shadow-md: 0 18px 40px rgba(36, 19, 12, 0.14);
  --header-h: 76px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 8px);
}

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

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

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

ul { list-style: none; }

button { font-family: inherit; cursor: pointer; }

.container {
  width: min(var(--container), 100% - 2.5rem);
  margin-inline: auto;
}

/* ---------- 2. Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  border: 2px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn-lg { padding: 1rem 2rem; font-size: 1.02rem; }
.btn-block { width: 100%; }

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  color: var(--wood-darkest);
  border-color: var(--gold);
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.35);
}
.btn-gold:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(212, 175, 55, 0.45); }

.btn-outline {
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(4px);
}
.btn-outline:hover { background: rgba(255, 255, 255, 0.14); transform: translateY(-3px); }

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

.btn-terracota {
  background: var(--terracota);
  color: var(--white);
  box-shadow: 0 8px 22px rgba(160, 64, 0, 0.35);
}
.btn-terracota:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(160, 64, 0, 0.45); }

/* ---------- 3. Header & Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(44, 24, 16, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.site-header.scrolled { box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35); }

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.brand { display: flex; align-items: center; gap: 0.7rem; color: var(--white); }

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  color: var(--wood-darkest);
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 1.05rem;
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.4);
  flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--font-title); font-size: 1.02rem; letter-spacing: 0.02em; }
.brand-text small { font-size: 0.72rem; color: var(--gold-soft); letter-spacing: 0.14em; text-transform: uppercase; }

.main-nav { display: flex; align-items: center; gap: 1.4rem; }

.nav-list { display: flex; align-items: center; gap: 1.3rem; }

.nav-link {
  position: relative;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.4rem 0;
  transition: color 0.2s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav-link:hover, .nav-link.active { color: var(--white); }
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }

.btn-cta-nav { padding: 0.55rem 1.3rem; font-size: 0.9rem; }

/* Botón hamburguesa */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 46px;
  height: 46px;
  padding: 10px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
}
.nav-toggle .bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.nav-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 4. Hero ---------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--wood-darkest);
}

/* Imagen generada por IA: assets/img/hero.jpg (1920x1080 o 2560x1440).
   Si la imagen no existe, el fondo oscuro sigue garantizando contraste. */
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(0, 0, 0, 0.30), rgba(0, 0, 0, 0.30)),
    url("../img/hero.jpg") center/cover no-repeat;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.65) 55%, rgba(44, 24, 16, 0.95) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 5rem 0 3rem;
  color: var(--white);
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.45);
  backdrop-filter: blur(6px);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-soft);
}
.hero-badge .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.hero-title {
  font-family: var(--font-title);
  font-weight: 900;
  font-size: clamp(2.1rem, 6vw, 4.4rem);
  line-height: 1.12;
  margin: 1.4rem 0 1rem;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}
.hero-title br { display: none; }
.hero-title br.show { display: inline; }

.hero-subtitle {
  font-size: clamp(1rem, 2.4vw, 1.3rem);
  color: rgba(255, 255, 255, 0.85);
  max-width: 640px;
  margin: 0 auto 2.2rem;
  font-weight: 400;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3.4rem;
}

.hero-meta {
  display: flex;
  justify-content: center;
  gap: clamp(1.5rem, 6vw, 4rem);
  padding-top: 1.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  max-width: 560px;
  margin-inline: auto;
}
.hero-meta-item { display: flex; flex-direction: column; }
.hero-meta-item strong {
  font-family: var(--font-title);
  font-size: 1.7rem;
  color: var(--gold-soft);
}
.hero-meta-item span { font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.7); }

.scroll-hint {
  position: absolute;
  bottom: 1.4rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  width: 26px; height: 44px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 14px;
  display: flex;
  justify-content: center;
  padding-top: 8px;
}
.scroll-hint span {
  width: 4px; height: 8px;
  border-radius: 4px;
  background: var(--gold-soft);
  animation: scrollDot 1.6s ease-in-out infinite;
}
@keyframes scrollDot {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(14px); opacity: 0.2; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ---------- 5. Secciones generales ---------- */
.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }

.section-dark {
  background: radial-gradient(1200px 500px at 50% 0%, #3E2723 0%, var(--wood-darkest) 60%);
  color: var(--white);
}
.section-dark .section-lead { color: rgba(255, 255, 255, 0.75); }
.section-dark .eyebrow { color: var(--gold-soft); border-color: rgba(212, 175, 55, 0.4); }

.section-head {
  text-align: center;
  max-width: 760px;
  margin: 0 auto clamp(2rem, 5vw, 3.2rem);
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--terracota);
  border: 1px solid rgba(160, 64, 0, 0.3);
  padding: 0.35rem 1rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  line-height: 1.15;
  color: var(--ink);
}
.section-dark .section-title { color: var(--white); }

.section-lead {
  margin-top: 1rem;
  color: rgba(36, 19, 12, 0.75);
}

/* ---------- 6. El Festival ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

.about-media {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 6px solid var(--white);
  outline: 1px solid rgba(44, 24, 16, 0.08);
}
.about-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.about-content p {
  margin-bottom: 1rem;
  color: rgba(36, 19, 12, 0.85);
}
.about-content strong { color: var(--terracota); }

.about-values {
  margin-top: 1.4rem;
  border-left: 4px solid var(--gold);
  background: var(--white);
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: var(--shadow-sm);
  padding: 1.1rem 1.4rem;
}
.about-values li { margin: 0.5rem 0; font-size: 0.95rem; color: rgba(36, 19, 12, 0.85); }
.about-values li strong { font-weight: 700; }

/* ---------- 7. Países ---------- */
.delegaciones { background: var(--white); }

.countries-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.4rem;
}

.country-card {
  position: relative;
  text-align: center;
  padding: 2.2rem 1.6rem;
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--cream), #FFF);
  border: 1px solid rgba(44, 24, 16, 0.09);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.country-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, var(--gold), var(--terracota), var(--green-mid));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}
.country-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-md); }
.country-card:hover::before { transform: scaleX(1); }

.country-flag { display: block; font-size: 3rem; line-height: 1; margin-bottom: 1rem; }

.country-name {
  font-family: var(--font-title);
  font-size: 1.45rem;
  color: var(--wood-dark);
  margin-bottom: 0.6rem;
}
.country-desc { font-size: 0.94rem; color: rgba(36, 19, 12, 0.75); }

/* ---------- 8. En vivo & entradas ---------- */
.stream-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

/* Contenedor 16:9 para el reproductor */
.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(29, 67, 50, 0.88), rgba(44, 24, 16, 0.92)),
    var(--green-deep);
  border: 1px solid rgba(212, 175, 55, 0.4);
  box-shadow: var(--shadow-md);
}
.video-frame::after {
  content: "● El canal oficial del festival";
  position: absolute;
  bottom: 12px; left: 14px;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  pointer-events: none;
}
.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.ticket-card {
  background: linear-gradient(160deg, var(--white), var(--cream));
  border-radius: var(--radius);
  padding: 2rem 1.7rem;
  border: 1px solid rgba(212, 175, 55, 0.35);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ticket-badge {
  align-self: flex-start;
  background: var(--terracota);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
}

.ticket-card h3 {
  font-family: var(--font-title);
  font-size: 1.6rem;
  color: var(--wood-dark);
}
.ticket-card p { font-size: 0.95rem; color: rgba(36, 19, 12, 0.78); }

.ticket-list {
  border-top: 1px dashed rgba(160, 64, 0, 0.35);
  padding-top: 0.9rem;
  display: grid;
  gap: 0.6rem;
}
.ticket-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.95rem;
  color: rgba(36, 19, 12, 0.8);
}
.ticket-list strong { color: var(--terracota); }

.ticket-note { font-size: 0.8rem !important; color: rgba(36, 19, 12, 0.55) !important; }

/* ---------- 9. Formulario ---------- */
.inscribirse { background: linear-gradient(180deg, var(--cream), #FFF); }
.inscribirse .section-title, .inscribirse .eyebrow { text-align: center; }

.reg-form {
  max-width: 860px;
  margin-inline: auto;
  background: var(--white);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.6rem);
  border: 1px solid rgba(44, 24, 16, 0.09);
  box-shadow: var(--shadow-md);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
  margin-bottom: 1.1rem;
}

.field { display: flex; flex-direction: column; gap: 0.4rem; }

.field-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--wood-dark);
}
.field-label em { color: var(--terracota); font-style: normal; }

.field input,
.field select,
.field textarea {
  font-family: inherit;
  font-size: 0.96rem;
  color: var(--ink);
  background: var(--cream);
  border: 1.5px solid rgba(44, 24, 16, 0.16);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  width: 100%;
}
.field textarea { resize: vertical; min-height: 120px; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.18);
}

.field input.is-invalid,
.field select.is-invalid {
  border-color: #C0392B;
  box-shadow: 0 0 0 4px rgba(192, 57, 43, 0.13);
}

.field .field-error {
  display: none;
  font-size: 0.78rem;
  color: #C0392B;
  font-weight: 500;
}
.field input.is-invalid + .field-error,
.field select.is-invalid + .field-error { display: block; }

.form-note {
  margin-top: 1.2rem;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(36, 19, 12, 0.55);
}

/* Mensaje de éxito */
.form-success {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--green-deep), var(--green-mid));
  color: var(--white);
  padding: clamp(2rem, 5vw, 3.2rem) 1.6rem;
  box-shadow: var(--shadow-md);
}
.form-success-icon {
  display: grid;
  place-items: center;
  width: 72px; height: 72px;
  margin: 0 auto 1.2rem;
  border-radius: 50%;
  background: var(--gold);
  color: var(--wood-darkest);
  font-size: 2rem;
  font-weight: 900;
}
.form-success h3 { font-family: var(--font-title); font-size: 1.7rem; margin-bottom: 0.6rem; }
.form-success p { color: rgba(255, 255, 255, 0.85); margin-bottom: 1.6rem; }

/* ---------- 10. Footer ---------- */
.site-footer {
  background: var(--wood-darkest);
  color: rgba(255, 255, 255, 0.8);
  padding-top: 3.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.8rem;
  padding-bottom: 2.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-brand { display: flex; align-items: center; gap: 0.8rem; }
.footer-brand strong { font-family: var(--font-title); font-size: 1.15rem; color: var(--white); display: block; }
.footer-brand .brand-mark { width: 42px; height: 42px; font-size: 0.95rem; }
.footer-brand span:last-child { font-size: 0.78rem; color: var(--gold-soft); }

.footer-org { font-size: 0.92rem; color: rgba(255, 255, 255, 0.7); }

.footer-social { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; }
.footer-social a {
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.footer-social a:hover { color: var(--gold-soft); border-color: var(--gold-soft); }

.footer-address { font-size: 0.92rem; color: rgba(255, 255, 255, 0.7); }
.footer-address a { color: var(--gold-soft); }
.footer-address a:hover { text-decoration: underline; }

.footer-bottom {
  padding: 1.4rem 0;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ---------- 11. Responsive (desktop) ---------- */
@media (min-width: 640px) {
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .field-full { grid-column: 1 / -1; }
  .countries-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; align-items: start; }
}

@media (min-width: 860px) {
  .about-grid { grid-template-columns: 0.9fr 1.1fr; gap: 3rem; }
  .countries-grid { grid-template-columns: repeat(4, 1fr); }
  .stream-grid { grid-template-columns: 1.55fr 1fr; align-items: center; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}

@media (min-width: 1024px) {
  .hero-title br.show { display: inline; }
}

/* ---------- 12. Menú móvil ---------- */
@media (max-width: 1023px) {
  .nav-toggle { display: flex; }

  .main-nav {
    position: fixed;
    top: var(--header-h);
    inset-inline: 0;
    bottom: 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.5rem;
    padding: 2rem 1.5rem;
    background: rgba(44, 24, 16, 0.98);
    backdrop-filter: blur(12px);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.35s ease, visibility 0.35s ease;
    overflow-y: auto;
  }
  .main-nav.is-open { transform: translateX(0); visibility: visible; }

  .nav-list { flex-direction: column; align-items: stretch; gap: 0.3rem; }
  .nav-link {
    display: block;
    padding: 0.95rem 0.6rem;
    font-size: 1.05rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
  }
  .nav-link::after { display: none; }
  .nav-link:hover { background: rgba(255, 255, 255, 0.06); }
  .btn-cta-nav { margin-top: 1.2rem; width: auto; align-self: flex-start; }

  body.nav-open { overflow: hidden; }
}

@media (max-width: 379px) {
  .brand-text strong { font-size: 0.9rem; }
  .brand-text small { font-size: 0.62rem; }
  .hero-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
    scroll-behavior: auto !important;
  }
}