/* Páginas propias de cada proyecto (/proyecto/<id>). Se carga después de zonas.css. */

/* Portada con movimiento: foto con zoom lento ("respiración") y, si el proyecto tiene, video de fondo */
.hero { overflow: hidden; background: var(--bosque); }
.hero .fondo { position: absolute; top: -2%; right: -2%; bottom: -2%; left: -2%; background: var(--bg) center/cover no-repeat; animation: respirar 22s ease-in-out infinite alternate; will-change: transform; }
@keyframes respirar { from { transform: scale(1); } to { transform: scale(1.12) translate(-1.5%, -1%); } }
.hero-video { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s ease; }
.hero-video.listo { opacity: 1; }
.hero::before { z-index: 1; }
.hero .wrap { z-index: 2; }

/* Franja final con la foto quieta mientras se baja (parallax) */
.cta.parallax { position: relative; background: linear-gradient(rgba(10,44,34,.86), rgba(14,59,46,.9)), var(--foto) center/cover fixed; padding: 110px 0; }

/* Aparición suave al bajar (solo si el navegador lo permite; sin JavaScript todo se ve normal) */
.anim .reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s ease; }
.anim .reveal.visible { opacity: 1; transform: none; }
.anim .galeria.reveal.visible a { animation: subirFoto .6s ease both; }
.anim .galeria.reveal.visible a:nth-child(2) { animation-delay: .06s; } .anim .galeria.reveal.visible a:nth-child(3) { animation-delay: .12s; }
.anim .galeria.reveal.visible a:nth-child(4) { animation-delay: .18s; } .anim .galeria.reveal.visible a:nth-child(5) { animation-delay: .24s; }
.anim .galeria.reveal.visible a:nth-child(n+6) { animation-delay: .3s; }
@keyframes subirFoto { from { opacity: 0; transform: translateY(18px); } }

@media (max-width: 900px) { .cta.parallax { background-attachment: scroll; } }   /* los celulares no soportan bien la foto fija */
@media (prefers-reduced-motion: reduce) { .hero .fondo, .anim .galeria a { animation: none; } .anim .reveal { opacity: 1; transform: none; transition: none; } }
.sub svg { width: 18px; height: 18px; vertical-align: -3px; margin-right: 6px; fill: none; stroke: currentColor; stroke-width: 2; }
.desde-hero { color: var(--beige); font-size: 17px; margin: -6px 0 22px; }
.desde-hero b { color: var(--dorado); font-size: 22px; }
.tit.izq { text-align: left; margin-bottom: 14px; }
.texto h3 { color: var(--bosque); font-size: 19px; margin: 26px 0 12px; }
.centro { text-align: center; }

/* Tabla de precios */
.tabla-caja { overflow-x: auto; }
.tprecios { width: 100%; border-collapse: separate; border-spacing: 0 10px; font-size: 15px; }
.tprecios th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--gris); font-weight: 600; padding: 0 16px; }
.tprecios td { background: var(--crema); padding: 16px; vertical-align: middle; }
.tprecios td:first-child { border-radius: 12px 0 0 12px; color: var(--bosque); }
.tprecios td:last-child { border-radius: 0 12px 12px 0; }
.tprecios small { display: block; color: var(--gris); font-size: 13px; }
.tprecios .grande { font-size: 18px; color: var(--bosque); }
.nota a { color: var(--bosque); font-weight: 600; }

/* Galería */
.galeria { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.galeria a { position: relative; display: block; border-radius: 14px; overflow: hidden; aspect-ratio: 3 / 2; background: #ddd; }
.galeria img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.galeria a:hover img { transform: scale(1.04); }
.galeria span { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 12px 10px; font-size: 13px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); }

/* Video y mapa */
.pvideo { width: 100%; max-height: 80vh; border-radius: 16px; background: #000; }
.ubic-txt { display: flex; gap: 8px; align-items: center; justify-content: center; color: var(--gris); margin: -10px 0 18px; }
.ubic-txt svg { width: 18px; height: 18px; fill: none; stroke: var(--oliva); stroke-width: 2; flex: none; }
.mapa { border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 9; margin-bottom: 18px; }
.mapa iframe { width: 100%; height: 100%; border: 0; }
.btn-linea svg { fill: none; stroke: currentColor; stroke-width: 2; }

@media (max-width: 760px) {
  .galeria { grid-template-columns: 1fr 1fr; gap: 10px; }
  .mapa { aspect-ratio: 4 / 5; }
  .tprecios thead { display: none; }
  .tprecios, .tprecios tbody, .tprecios tr, .tprecios td { display: block; width: 100%; }
  .tprecios tr { margin-bottom: 12px; background: var(--crema); border-radius: 12px; padding: 6px 0; }
  .tprecios td { padding: 8px 16px; border-radius: 0 !important; background: none; }
  .tprecios td[data-t]::before { content: attr(data-t); display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--gris); }
}

/* Navegadores antiguos sin aspect-ratio (iOS 14 o anterior) */
@supports not (aspect-ratio: 1 / 1) {
  .galeria a { height: 200px; }
  .mapa { height: 50vw; max-height: 560px; }
  @media (max-width: 760px) { .galeria a { height: 30vw; } .mapa { height: 110vw; } }
}
