/* ===================================================================
   MUCA Unay — sistema de diseño
   Paleta: adobe / verde andino / dorado, sobre fondo cálido tipo papel
   Tipografía: Fraunces (display, tallado/ceremonial) + Work Sans (texto)
=================================================================== */

:root {
  /* Color */
  --bg: #F4EEDF;
  --bg-alt: #EADFC3;
  --card: #FFFDF7;
  --text: #2E2116;
  --text-soft: #5C4C3A;
  --adobe: #B9622F;
  --adobe-dark: #8C4A22;
  --green: #4F6F4E;
  --green-dark: #3A5238;
  --gold: #C89B3C;
  --gold-soft: #E4C77E;
  --line: #D9CBA8;

  /* Tipografía */
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Layout */
  --maxw: 1120px;
  --gap: 2.5rem;
  --radius-s: 8px;
  --radius-m: 16px;
  --radius-l: 28px;
  --shadow: 0 12px 30px -14px rgba(46, 33, 22, 0.35);
  --header-h: 76px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

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

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--adobe-dark);
  line-height: 1.15;
  margin: 0 0 0.6em;
}

h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.35rem; color: var(--green-dark); }
h4 { font-size: 1.1rem; color: var(--green-dark); margin-bottom: 0.4em; }

p { margin: 0 0 1em; max-width: 68ch; color: var(--text-soft); }

a { color: var(--adobe); }

section[id] { scroll-margin-top: calc(var(--header-h) + 12px); }

.section { padding: 5.5rem 1.5rem; }
.section-alt { background: var(--bg-alt); }
.section-inner { max-width: var(--maxw); margin: 0 auto; }

.section-titulo { max-width: 62ch; margin-bottom: 3rem; }
.section-lead { font-size: 1.1rem; }

/* ===================== BOTONES ===================== */
.btn {
  display: inline-block;
  padding: 0.85em 1.8em;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  transition: transform 0.15s ease, background-color 0.2s ease, color 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primario { background: var(--adobe); color: var(--card); }
.btn-primario:hover { background: var(--adobe-dark); }
.btn-secundario { background: transparent; border-color: var(--green); color: var(--green-dark); }
.btn-secundario:hover { background: var(--green); color: var(--card); }

/* ===================== HEADER / NAV ===================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(244, 238, 223, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.brand-logo { width: 42px; height: 42px; border-radius: 50%; }

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--adobe-dark);
  letter-spacing: 0.01em;
}
.brand-name-accent { color: var(--green); font-style: italic; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.9rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 0.98rem;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.nav-link:hover { border-color: var(--gold); color: var(--adobe-dark); }

.nav-link-cta {
  background: var(--green);
  color: var(--card) !important;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  border: none;
}
.nav-link-cta:hover { background: var(--green-dark); border: none; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  background: transparent;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 24px;
  margin: 0 auto;
  background: var(--adobe-dark);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===================== HERO / INICIO ===================== */
.hero {
  padding-top: 4rem;
  background:
    radial-gradient(ellipse at top right, rgba(200,155,60,0.16), transparent 55%),
    var(--bg);
}

.hero-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 3rem;
  align-items: center;
}

.hero-mascota-wrap {
  display: flex;
  justify-content: center;
}

.muquito-escena {
  position: relative;
  width: min(280px, 70vw);
  margin-top: 130px;
}

.mascota-hero {
  width: 100%;
  display: block;
  animation: muquito-entrada 1.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
  transform-origin: bottom center;
}

@keyframes muquito-entrada {
  0%   { transform: translateY(-160px) scale(0.82); opacity: 0; }
  8%   { opacity: 1; }
  32%  { transform: translateY(0) scale(1); }
  46%  { transform: translateY(-42px) scale(1.02); }
  58%  { transform: translateY(0) scale(1); }
  68%  { transform: translateY(-18px); }
  78%  { transform: translateY(0); }
  86%  { transform: translateY(-7px); }
  94%  { transform: translateY(0); }
  100% { transform: translateY(0); }
}

.muquito-globo {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 6px);
  transform: translateX(-50%) scale(0.6) translateY(10px);
  width: max(200px, 92%);
  background: var(--card);
  border: 2px solid var(--gold);
  border-radius: 20px;
  padding: 0.85rem 1rem 3rem;
  box-shadow: 0 10px 22px rgba(0,0,0,0.14);
  opacity: 0;
  z-index: 3;
  animation: globo-entrada 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 1.55s both;
}

@keyframes globo-entrada {
  0%   { opacity: 0; transform: translateX(-50%) scale(0.6) translateY(10px); }
  100% { opacity: 1; transform: translateX(-50%) scale(1) translateY(0); }
}

.muquito-globo::before,
.muquito-globo::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  width: 0;
  height: 0;
  border-style: solid;
}
.muquito-globo::before {
  margin-left: -13px;
  border-width: 14px 13px 0 13px;
  border-color: var(--gold) transparent transparent transparent;
}
.muquito-globo::after {
  margin-left: -10px;
  margin-top: -2px;
  border-width: 11px 10px 0 10px;
  border-color: var(--card) transparent transparent transparent;
}

.muquito-globo-frase {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.98rem;
  line-height: 1.35;
  color: var(--green-dark);
  margin: 0;
  text-align: center;
}

.audio-btn {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.audio-btn:hover { background: var(--gold-soft); }

.audio-btn--globo {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
}
.audio-btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--adobe);
  outline-offset: 2px;
}

.icon-speaker { width: 20px; height: 20px; fill: var(--adobe-dark); }

.audio-waves {
  display: none;
  gap: 2px;
  align-items: flex-end;
  height: 16px;
}
.audio-btn.reproduciendo .icon-speaker { display: none; }
.audio-btn.reproduciendo .audio-waves { display: flex; }
.audio-waves i {
  width: 3px;
  background: var(--adobe-dark);
  border-radius: 2px;
  animation: onda 0.9s ease-in-out infinite;
}
.audio-waves i:nth-child(1) { height: 6px; animation-delay: 0s; }
.audio-waves i:nth-child(2) { height: 14px; animation-delay: 0.15s; }
.audio-waves i:nth-child(3) { height: 9px; animation-delay: 0.3s; }
@keyframes onda {
  0%, 100% { transform: scaleY(0.5); }
  50% { transform: scaleY(1.4); }
}

.hero-titulo { margin-bottom: 0.1em; }
.hero-subtitulo {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--green);
  font-size: 1.2rem;
  margin-bottom: 1.4rem;
}
.hero-descripcion { font-size: 1.02rem; max-width: 62ch; }
.hero-acciones { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.6rem; }

/* ===================== BLOQUES CON IMAGEN ===================== */
.bloque {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: center;
  padding: 2.6rem 0;
  border-top: 1px solid var(--line);
}
.bloque:first-of-type { border-top: none; }

.bloque-imagen-izquierda .bloque-media { order: 1; }
.bloque-imagen-izquierda .bloque-texto { order: 2; }
.bloque-imagen-derecha .bloque-media { order: 2; }
.bloque-imagen-derecha .bloque-texto { order: 1; }

.bloque-texto { position: relative; }

.mascota-guia {
  width: 52px;
  height: auto;
  position: relative;
  display: inline-block;
  vertical-align: middle;
  margin-right: 12px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
}

.bloque-media {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.bloque-media .bloque-img {
  width: 100%;
  height: 100%;
  max-height: 320px;
  border-radius: var(--radius-m);
  object-fit: cover;
  box-shadow: var(--shadow);
}

.img-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-m);
  background: repeating-linear-gradient(135deg, #E3D6B3, #E3D6B3 10px, #DAC89C 10px, #DAC89C 20px);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.img-placeholder::after {
  content: attr(data-anexo);
  background: rgba(46,33,22,0.72);
  color: #F4EEDF;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35em 0.8em;
  border-radius: 999px;
}

/* ===================================================================
   SECCIÓN INTERPRETACIÓN HISTÓRICA (HEADER CORREGIDO)
=================================================================== */

.section-titulo-interpretacion {
  display: grid;
  grid-template-columns: 1fr 1fr; /* 2 columnas iguales */
  gap: var(--gap);
  align-items: center;
  width: 100%;
  margin-bottom: 3.5rem;
}

/* Columna Izquierda: Contenedor e Imagen */
.section-titulo-interpretacion .bloque-media {
  width: 100%;
}

.img-header-grande {
  width: 100%;
  height: 280px;
  object-fit: cover;
  border-radius: var(--radius-m);
  box-shadow: var(--shadow);
}

/* Columna Derecha: Ocupa todo el ancho restante */
.header-texto-con-mascota {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: 100%; /* Permite que el texto ocupe todo el espacio a la derecha */
}

.header-texto-con-mascota .titulo-texto {
  flex: 1;
}

.mascota-header {
  width: 110px; /* Tamaño controlado para no apretar el texto */
  height: auto;
  flex-shrink: 0;
  object-fit: contain;
}

/* ===================== SUBSECCIONES / FASES ===================== */
.subseccion { margin-top: 4.5rem; }
.subseccion-titulo { margin-bottom: 0.3em; }
.subseccion-lead { margin-bottom: 2.2rem; }

.fases-timeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
  position: relative;
}

.fase-card {
  background: var(--card);
  border-radius: var(--radius-m);
  padding: 1.6rem;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--adobe);
}

.fase-numero {
  display: inline-block;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--adobe);
  margin-bottom: 0.6rem;
}

.fase-card .img-placeholder { aspect-ratio: 16 / 10; margin-bottom: 1rem; }
.fase-fecha { color: var(--text-soft); font-weight: 400; font-size: 0.95rem; }
.fase-card p { font-size: 0.95rem; }

/* ===================== HALLAZGOS ===================== */
.hallazgos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
}
.hallazgo-card {
  background: var(--card);
  border-radius: var(--radius-m);
  padding: 1.6rem;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--green);
}
.hallazgo-card .img-placeholder { aspect-ratio: 16 / 10; margin-bottom: 1rem; }
.hallazgo-card p { font-size: 0.95rem; }

/* ===================== MUSEO 3D ===================== */
.section-museo3d { background: linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%); }

.modelos-3d-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.8rem;
}

.modelo-3d-contenedor {
  background: var(--card);
  border-radius: var(--radius-m);
  padding: 1.6rem;
  box-shadow: var(--shadow);
}
.modelo-3d-contenedor p { font-size: 0.95rem; }

.visor-3d {
  width: 100%;
  min-height: 400px;
  border-radius: var(--radius-s);
  background: #E9E0C7;
  border: 1px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.visor-3d iframe { width: 100%; height: 100%; border: 0; }
.visor-3d-placeholder { color: var(--text-soft); font-size: 0.9rem; font-style: italic; }

@media (min-width: 900px) {
  .visor-3d { min-height: 500px; }
}

.leyenda-reconstruccion {
  margin-top: 2.4rem;
  font-size: 0.9rem;
  color: var(--text-soft);
  border-left: 3px solid var(--gold);
  padding-left: 1rem;
  max-width: none;
}

.museo3d-encabezado {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: var(--maxw);
  margin: 0 auto 2.5rem auto;
  padding: 2rem 0 0 0;
}

.encabezado-texto {
  text-align: center;
}

.encabezado-texto h2 {
  margin-bottom: 0.4em;
}

.encabezado-texto p {
  max-width: 68ch;
  margin: 0 auto;
}

.encabezado-boton {
  display: flex;
  justify-content: flex-end;
}

.btn-audio-muquito {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--gold);
  border: 2px solid var(--adobe-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background-color 0.3s ease;
  padding: 0;
  box-shadow: 0 4px 10px rgba(46, 33, 22, 0.15);
}

.btn-audio-muquito:hover {
  transform: scale(1.08);
  background-color: var(--gold-soft);
}

.barras-ecualizador {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
}

.barras-ecualizador .barra {
  width: 3px;
  height: 100%;
  background-color: var(--card);
  border-radius: 2px;
  transition: height 0.3s ease;
}

.btn-audio-muquito.reproduciendo .barra:nth-child(1) {
  animation: ecualizar 0.6s infinite alternate ease-in-out;
}

.btn-audio-muquito.reproduciendo .barra:nth-child(2) {
  animation: ecualizar 0.8s infinite alternate ease-in-out 0.2s;
}

.btn-audio-muquito.reproduciendo .barra:nth-child(3) {
  animation: ecualizar 0.5s infinite alternate ease-in-out 0.4s;
}

.btn-audio-muquito:not(.reproduciendo) .barra {
  height: 6px !important;
  animation: none !important;
}

@keyframes ecualizar {
  0% { height: 4px; }
  100% { height: 16px; }
}

.contenedor-panorama-full {
  width: 100%;
  margin-top: 2rem;
}

.visor-360-ancho {
  width: 100% !important;
  height: 480px !important;
  border-radius: 12px;
}

.museo3d-encabezado .mascota-seccion,
.museo3d-encabezado img {
  width: 130px !important;
  max-width: none !important;
  height: auto !important;
  flex-shrink: 0;
}

.museo3d-encabezado .encabezado-boton {
  flex-shrink: 0;
  width: 130px;
  display: flex;
  justify-content: flex-end;
}

/* ===================== CONTACTO ===================== */
.section-inner-contacto {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: var(--gap);
  align-items: start;
}

.mascota-contacto { width: 96px; margin-bottom: 1rem; }

.form-contacto {
  background: var(--card);
  border-radius: var(--radius-m);
  padding: 2.2rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.campo { display: flex; flex-direction: column; gap: 0.4rem; }
.campo label { font-weight: 600; font-size: 0.92rem; color: var(--green-dark); }

.campo input, .campo textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.7em 0.9em;
  border-radius: var(--radius-s);
  border: 1.5px solid var(--line);
  background: var(--bg);
  color: var(--text);
  resize: vertical;
}
.campo input:focus, .campo textarea:focus {
  border-color: var(--adobe);
  outline: none;
}
.campo.campo-invalido input, .campo.campo-invalido textarea { border-color: #A6432B; }

.campo-error {
  font-size: 0.82rem;
  color: #A6432B;
  min-height: 1em;
}

.btn-form { align-self: flex-start; border: none; cursor: pointer; font-size: 1rem; }

.form-confirmacion {
  margin: 0;
  font-weight: 600;
  color: var(--green-dark);
  min-height: 1.2em;
}

/* ===================== FOOTER ===================== */
.site-footer {
  background: var(--adobe-dark);
  color: #F4EEDF;
  padding: 3rem 1.5rem 2.2rem;
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
  justify-content: space-between;
}
.footer-logos {
  display: flex;
  align-items: center;
  gap: 1.8rem;
}
.footer-logos img:not(.logo-mincul-rectangular) {
  height: 48px;
  width: 48px;
  border-radius: 50%;
  background: #F4EEDF;
  padding: 4px;
  object-fit: cover;
}
.footer-texto p { margin: 0; color: #F4EEDF; max-width: none; }
.footer-nota { font-size: 0.85rem; opacity: 0.75; margin-top: 0.3em !important; }

.link-logo-gobierno {
  display: inline-block;
  transition: transform 0.2s ease;
}

.link-logo-gobierno:hover {
  transform: scale(1.03);
}

.logo-mincul-rectangular {
  width: auto !important;
  height: 85px !important;
  max-width: 360px !important;
  border-radius: 8px !important;
  background: transparent !important;
  padding: 0 !important;
  object-fit: contain !important;
}

/* ===================================================================
   SECCIÓN DE TÍTULOS CON MASCOTA / MUQUITO
=================================================================== */
.section-titulo-mascota {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  width: 100%;
  margin-bottom: 2rem;
}

.section-titulo-mascota .titulo-texto {
  flex: 1;
}

.section-titulo-mascota .titulo-texto h2 {
  margin-bottom: 0.4em;
}

.section-titulo-mascota .titulo-texto p {
  margin-bottom: 0;
}

.mascota-seccion {
  flex-shrink: 0;
  width: 220px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.3s ease;
}

.mascota-seccion img,
.mascota-seccion-img {
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  object-fit: contain;
  display: block;
}

.mascota-seccion:hover {
  transform: scale(1.05);
}

/* ===================================================================
   RESPONSIVE / ADAPTATIVO
=================================================================== */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-acciones { justify-content: center; }
  .hero-descripcion { margin-left: auto; margin-right: auto; }
  .muquito-escena { margin: 0 auto 1.6rem; }

  .fases-timeline, .hallazgos-grid, .modelos-3d-grid { grid-template-columns: 1fr; }

  .bloque { grid-template-columns: 1fr; }
  .bloque-imagen-izquierda .bloque-media, 
  .bloque-imagen-derecha .bloque-media { order: 2; }
  .bloque-imagen-izquierda .bloque-texto, 
  .bloque-imagen-derecha .bloque-texto { order: 1; }

  .section-titulo-interpretacion {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .header-texto-con-mascota {
    flex-direction: column;
    align-items: flex-start;
  }

  .mascota-header {
    align-self: center;
  }

  .mascota-guia { margin-bottom: 0.6rem; }
  .section-inner-contacto { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .museo3d-encabezado {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .section-titulo-mascota {
    flex-direction: column-reverse;
    text-align: center;
    gap: 1.2rem;
  }

  .section-titulo-mascota .titulo-texto p {
    margin: 0 auto;
  }

  .mascota-seccion {
    width: 160px;
  }
}

@media (max-width: 720px) {
  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1.5rem 1.2rem;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
  .site-nav.abierto {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-link { padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
  .nav-link-cta { margin-top: 0.8rem; text-align: center; }
  .nav-toggle { display: flex; }
  .brand-name { font-size: 1.1rem; }

  .section { padding: 3.6rem 1.2rem; }
}