/* Aluminis Garrido · réplica HTML5 del diseño Flash original (garrido.swf, 1024x768)
   Escritorio (>= 900px): "escena" 4:3 escalable con las mismas posiciones que la película Flash.
   Móvil (< 900px): mismos elementos apilados. */

:root {
  --azul: #0066ff;
  --azul-menu: #0033ff;
  --gris-caja: #f2f2f2;
  --borde-caja: #8c8c8c;
  --texto: #1a1a1a;
  --fuente: Arial, Helvetica, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #fff; color: var(--texto); font: 15px/1.45 var(--fuente); }
img { max-width: 100%; height: auto; border: 0; }
a { color: var(--azul); }
[hidden] { display: none !important; }
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--azul); outline-offset: 2px; }

/* ---------- Elementos comunes ---------- */
.caja {
  background: var(--gris-caja);
  border: 1px dashed var(--borde-caja);
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.8) inset, 0 1px 3px rgba(0,0,0,.12);
  padding: 1em 1.2em 1.2em;
  overflow: auto;
}
.caja h2 { margin: 0 0 .8em; text-align: center; line-height: 1; }
.caja h2 img { height: 2.2em; width: auto; }
.texto { text-align: justify; }

.boton {
  display: inline-block;
  font: 12px/1 Verdana, Arial, sans-serif;
  color: #111;
  text-decoration: none;
  padding: .55em 1.8em;
  border: 1px solid #2c4f8f;
  border-radius: 5px;
  background: linear-gradient(#e3edfd, #9fbbec 48%, #6d93d8 52%, #8eaee6);
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
  cursor: pointer;
}
.boton:hover { filter: brightness(1.07); }
.boton:active { transform: translateY(1px); }

.menu a { display: block; transition: transform .15s, filter .15s; }
.menu a:hover, .menu a:focus-visible { transform: scale(1.06); filter: drop-shadow(0 1px 1px rgba(0,51,255,.35)); }
.menu a[aria-current] { filter: drop-shadow(0 2px 0 rgba(0,51,255,.25)); }
.menu img { display: block; width: 100%; }

.sonido { background: none; border: 0; padding: 0; cursor: pointer; line-height: 0; }
.sonido img { width: 100%; }
.sonido .sonido-on { display: none; }
.sonido[aria-pressed="true"] .sonido-on { display: block; }
.sonido[aria-pressed="true"] .sonido-off { display: none; }

/* Localización */
.localizacion { display: flex; gap: 1em; align-items: center; }
.localizacion address { font-style: normal; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.localizacion address strong { display: block; }
.localizacion address .sep { margin-top: .9em; }
.localizacion a { color: inherit; text-decoration: none; }
.localizacion a:hover { color: var(--azul); text-decoration: underline; }
.mapa { flex: 0 0 auto; width: 42%; }

/* Galería (Trabajos) */
.galeria { display: flex; flex-direction: column; align-items: center; height: 100%; }
.galeria-vista { margin: 0 0 .6em; text-align: center; }
.galeria-vista img { display: block; margin: 0 auto; object-fit: contain; background: #fff; border: 1px solid #ccc; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.galeria-vista figcaption { margin-top: .4em; font: 12px/1.3 Verdana, Arial, sans-serif; color: #333; }
.galeria-vacia { text-align: center; color: #555; }
.galeria-marco {
  display: flex; align-items: center; gap: .5em; width: 100%;
  border: 1px dashed #9c9c9c; border-radius: 2px; padding: .5em .3em; background: rgba(255,255,255,.6);
}
.galeria-flecha { flex: 0 0 auto; line-height: 0; }
.galeria-flecha img { width: 25px; }
.galeria-flecha[aria-disabled="true"] { opacity: .35; pointer-events: none; }
.galeria-miniaturas { flex: 1; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.galeria-miniaturas a { display: block; text-align: center; text-decoration: none; opacity: .6; transition: opacity .2s; }
.galeria-miniaturas a:hover, .galeria-miniaturas a:focus-visible, .galeria-miniaturas a[aria-current] { opacity: 1; }
.galeria-miniaturas img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #fff; }
.galeria-miniaturas span { display: block; min-height: 1.3em; font: 10px/1.3 Verdana, Arial, sans-serif; color: #333; visibility: hidden; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.galeria-miniaturas a:hover span, .galeria-miniaturas a:focus-visible span, .galeria-miniaturas a[aria-current] span { visibility: visible; }

/* Contactar */
.contacto { display: grid; grid-template-columns: auto 1fr; gap: .7em .6em; align-items: center; }
.contacto label { color: var(--azul); text-align: right; font-size: 1.05em; }
.contacto label.ancho { grid-column: 1 / -1; text-align: left; }
.contacto input, .contacto textarea {
  width: 100%; font: inherit; color: #222; background: #fff;
  border: 1px solid #e2e2e2; border-radius: 0; padding: .35em .45em;
}
.contacto input:focus, .contacto textarea:focus { border-color: #8fb0ee; outline: none; box-shadow: 0 0 0 2px rgba(0,102,255,.15); }
.contacto textarea { grid-column: 1 / -1; resize: vertical; min-height: 7em; }
.contacto .boton { grid-column: 1 / -1; justify-self: center; margin-top: .3em; }
.contacto .estado { grid-column: 1 / -1; margin: 0; min-height: 1.3em; text-align: center; font-size: .9em; }
.estado-ok { color: #19782b; }
.estado-error { color: #c0261b; }
.trampa { position: absolute; left: -9999px; }

.aviso-error { background: #fff4d6; border: 1px solid #e5c76b; padding: .5em; margin: 0 0 .5em; font-size: .85em; }

/* Aviso legal */
.enlace-aviso { text-align: center; margin: .6em 0 1.2em; font-size: 13px; }
.enlace-aviso a { color: #333; }
.dialogo-aviso { width: min(680px, calc(100vw - 32px)); max-height: 85vh; padding: 0; border: 1px dashed var(--borde-caja); border-radius: 3px; background: #fff; }
.dialogo-aviso::backdrop { background: rgba(30,30,30,.55); }
.dialogo-aviso h2:focus { outline: none; }
.dialogo-aviso h2 { margin: 0; padding: .7em 1em; color: var(--azul); font-size: 18px; font-weight: normal; background: var(--gris-caja); position: sticky; top: 0; }
.dialogo-aviso form { text-align: center; padding: 0 0 1em; }
.aviso-texto { padding: 0 1.2em; font-size: 13px; text-align: justify; }
.aviso-texto h3 { font-size: 13px; margin: 1.2em 0 .4em; }
.pagina-aviso { padding: 16px; }
.aviso-pagina { max-width: 760px; margin: 0 auto; }
.aviso-pagina h1 { color: var(--azul); font-weight: normal; font-size: 22px; margin-top: 0; }

/* ---------- Intro ("Entrar") ---------- */
.intro { display: none; }
.con-intro .intro {
  display: flex; position: fixed; inset: 0; z-index: 50; background: #fff;
  flex-direction: column; align-items: center; justify-content: center; gap: 2vh; padding: 16px;
  transition: opacity .6s ease;
}
.con-intro body { overflow: hidden; }
.intro.saliendo { opacity: 0; pointer-events: none; }
.intro-logo { position: relative; width: min(300px, 60vw, 46vh); }
.intro-logo > img:not(.intro-destello) { display: block; width: 100%; }
.intro-eslogan { width: min(472px, 92vw); }
.intro-entrar { margin-top: 3vh; line-height: 0; }
.intro-entrar img { height: clamp(18px, 3vh, 26px); width: auto; transition: transform .2s; }
.intro-entrar:hover img, .intro-entrar:focus-visible img { transform: scale(1.1); }
.intro-destello { position: absolute; width: 38%; left: -32%; bottom: 4%; animation: destello 3.2s ease-in-out infinite; }
.intro-puntos { position: absolute; right: -28%; top: -4%; width: 32%; height: 30%; }
.intro-puntos i { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: radial-gradient(#7fb0ff, #2b6ad8); animation: punto 4s linear infinite; }
.intro-puntos i:nth-child(1) { left: 10%; animation-delay: 0s; }
.intro-puntos i:nth-child(2) { left: 30%; animation-delay: .6s; }
.intro-puntos i:nth-child(3) { left: 50%; animation-delay: 1.2s; }
.intro-puntos i:nth-child(4) { left: 70%; animation-delay: 1.8s; }
.intro-puntos i:nth-child(5) { left: 85%; animation-delay: 2.4s; }
.intro-puntos i:nth-child(6) { left: 20%; animation-delay: 3s; }
.intro-puntos i:nth-child(7) { left: 60%; animation-delay: 3.5s; }
@keyframes destello { 0%,100% { transform: rotate(-8deg) scale(.9); opacity: .75; } 50% { transform: rotate(14deg) scale(1.08); opacity: 1; } }
@keyframes punto { 0% { transform: translateY(160%); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-140%); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .intro-destello, .intro-puntos i { animation: none; } .intro { transition: none; } }

/* ---------- MÓVIL Y TABLET (< 900px) ---------- */
@media (max-width: 899.98px) {
  .escena { position: relative; isolation: isolate; padding: 0 16px; }
  .escena::before {
    content: ""; position: absolute; left: 0; top: 0; width: 190px; height: 107px; z-index: -1;
    background: url(../img/flores-sup.webp) left top / 100% auto no-repeat;
    -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent);
  }
  .cabecera { position: relative; padding: 92px 0 8px; }
  .menu { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
  .menu a { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px; }
  .menu img { width: auto; height: 19px; }
  .sonido { position: absolute; top: 18px; right: 0; width: 30px; }
  .contenido { margin: 6px auto 16px; max-width: 620px; }
  .caja h2 img { height: 34px; }
  .galeria-vista img { width: 100%; max-height: 62vh; }
  .galeria-miniaturas { gap: 5px; }
  .galeria-miniaturas span { display: none; }
  .mapa { width: 38%; }
  .fotos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 700px; margin: 0 auto; }
  .fotos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
  .logo-pie { display: block; width: 210px; margin: 10px 0 0 auto; }
  .pie { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0 0; border-top: 3px solid #e3e3e3; }
  .pie .copyright { width: min(270px, 80vw); }
  .pie .leonsoft { width: 100px; }
}
@media (max-width: 420px) {
  .localizacion { flex-direction: column; align-items: flex-start; }
  .mapa { width: 70%; align-self: center; }
  .contacto { grid-template-columns: 1fr; }
  .contacto label { text-align: left; }
}

/* ---------- ESCRITORIO (>= 900px): escena Flash 1024x768 ---------- */
@media (min-width: 900px) {
  body { font-size: 13px; }
  .escena {
    position: relative;
    width: clamp(900px, min(100vw, 133.333vh), 1280px);
    aspect-ratio: 4 / 3;
    margin: 0 auto;
    background: #fff url(../img/fondo.webp) center / 100% 100% no-repeat;
    container-type: inline-size;
  }
  .contenido { font-size: 1.22cqw; line-height: 1.38; } /* 12.5px a 1024px, escala con la escena */
  .fotos, .logo-pie { display: none; }

  /* Menú en las mismas coordenadas que la película */
  .menu a { position: absolute; }
  .menu-empresa      { left: 26.66%; top: 7.42%; width: 9.8%; }
  .menu-localizacion { left: 41.00%; top: 7.80%; width: 17.1%; }
  .menu-trabajos     { left: 63.20%; top: 7.42%; width: 10.97%; }
  .menu-contactar    { left: 79.20%; top: 7.55%; width: 12.5%; }
  .sonido { position: absolute; left: 92.2%; top: 4.4%; width: 2.4%; }

  /* Zona de contenido: a la derecha de la ventana dibujada */
  .contenido { position: absolute; left: 39%; top: 14.6%; width: 55.5%; height: 56.5%; }
  .seccion { height: 100%; display: flex; align-items: center; justify-content: center; }
  .caja-empresa      { width: 89.6%; max-height: 90%; }
  .caja-localizacion { width: 100%; max-height: 100%; }
  .caja-contactar    { width: 56.5%; max-height: 100%; }
  .caja h2 img { height: 3.3cqw; }
  .caja-localizacion h2 img, .caja-contactar h2 img { height: 2.6cqw; }
  .contacto label { font-size: 1.15em; }

  .galeria { width: 100%; justify-content: flex-end; }
  .galeria-vista { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
  .galeria-vista img { width: 26cqw; height: 21cqw; min-height: 0; }
  .galeria-vista figcaption { font-size: .9em; }
  .galeria-marco { width: 105%; margin-left: -5.8%; background: transparent; padding: .7cqw .3cqw .2cqw; }
  .galeria-flecha img { width: 2.4cqw; }
  .galeria-miniaturas { gap: .8cqw; }
  .galeria-miniaturas span { font-size: .78em; }

  .pie .copyright { position: absolute; left: .2%; top: 96.5%; width: 26.2%; }
  .pie .leonsoft  { position: absolute; left: 53.8%; top: 97.6%; width: 9.8%; }
  .enlace-aviso { margin-top: .4em; }
}
