﻿/* =========================================================
   1) RESET + BASE
========================================================= */

*,
*::before,
*::after{
  box-sizing:border-box;
  margin:0;
  padding:0;
}

html{ scroll-behavior:smooth; }

body{
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height:1.5;
  color:#111827;
  background:#f3f4f6;
}

img{ max-width:100%; display:block; }
ul{ list-style:none; }
a{ color:inherit; }

:focus-visible{
  outline:3px solid rgba(14, 0, 97, 0.35);
  outline-offset:3px;
}

/* Accesibilidad */
.skip-link{
  position:absolute;
  left:-999px;
  top:12px;
  background:#fff;
  color:#111827;
  padding:10px 14px;
  border-radius:12px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.16);
  z-index:999;
}
.skip-link:focus{ left:12px; }

/* =========================================================
   2) VARIABLES (AZUL LOGO)
========================================================= */

:root{
  --brand:#0E0061;
  --brand-dark:#090045;
  --brand-soft: rgba(14, 0, 97, 0.10);

  --text:#111827;
  --muted:#6b7280;
  --border:#e5e7eb;
  --shell:#ffffff;

  --max:1200px;
  --header-h:86px;

  --shadow-soft: 0 12px 30px rgba(15, 23, 42, 0.12);
  --shadow-strong: 0 18px 44px rgba(15, 23, 42, 0.18);

  --radius-xl: 24px;
  --radius-lg: 18px;
}

/* =========================================================
   3) LAYOUT GLOBAL
========================================================= */

.page-shell{
  max-width:100%;
  margin:0;
  background: var(--shell);
}

.container{
  width:100%;
  max-width:var(--max);
  margin:0 auto;
  padding:0 32px;
}

.main-content{ min-height:50vh; }

/* =========================================================
   4) HEADER + NAV
========================================================= */

.site-header{
  position:sticky;
  top:0;
  z-index:50;
  background:#fff;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
}

.header-bar{ background:#fff; }

.header-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  height:var(--header-h);
  gap:16px;
}

.brand img{
  height:80px;
  width:auto;
  object-fit:contain;
}

.main-nav{ display:flex; align-items:center; }
.main-nav ul{
  display:flex;
  align-items:center;
  gap:40px;
}

.main-nav a{
  font-size:0.98rem;
  font-weight:600;
  color:var(--text);
  text-decoration:none;
  position:relative;
  padding-bottom:6px;
  transition: color .2s ease, opacity .2s ease;
}

.main-nav a::after{
  content:"";
  position:absolute;
  left:0;
  bottom:0;
  height:2px;
  width:0;
  background: var(--brand);
  transition: width .2s ease;
}

.main-nav a:hover{ color:var(--brand); }
.main-nav a:hover::after,
.main-nav a.active::after{ width:100%; }

.nav-toggle{
  display:none;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:5px;
  width:44px;
  height:44px;
  background:#fff;
  border:1px solid rgba(15, 23, 42, 0.10);
  border-radius:999px;
  cursor:pointer;
  transition: box-shadow .15s ease, transform .15s ease;
}

.nav-toggle:hover{
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

.nav-toggle span{
  width:22px;
  height:2px;
  background:#111827;
  transition: transform .2s ease, opacity .2s ease;
}

.nav-toggle.is-open span:nth-child(1){ transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2){ opacity:0; }
.nav-toggle.is-open span:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }

/* =========================================================
   5) HERO GALERÍA
========================================================= */

.hero{
  position:relative;
  width:100%;
  overflow:hidden;
  background:#000;
}

.hero--inner{
  min-height: clamp(260px, 52vh, 380px);
  display:flex;
  align-items:center;
}

.hero--gallery{
  background-image: url("../img/slider3.jpeg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero__overlay{
  position:absolute;
  inset:0;
  background: linear-gradient(
    120deg,
    rgba(15, 23, 42, 0.86),
    rgba(14, 0, 97, 0.30),
    rgba(15, 23, 42, 0.78)
  );
  pointer-events:none;
}

.hero__inner{
  position:relative;
  z-index:1;
  color:#fff;
  padding-block: 70px;
}

.hero__inner--center{
  max-width: 820px;
  text-align:left;
}

.hero__eyebrow{
  display:inline-flex;
  align-items:center;
  padding:6px 14px;
  border-radius:999px;
  background: rgba(255,255,255,0.14);
  border:1px solid rgba(255,255,255,0.18);
  font-size:0.80rem;
  letter-spacing:0.12em;
  text-transform:uppercase;
  margin-bottom: 14px;
}

.hero__title--inner{
  font-size: clamp(2rem, 3vw, 2.55rem);
  font-weight: 900;
  letter-spacing: 0.01em;
  margin-bottom: 12px;
  text-wrap: balance;
}

.hero__subtitle--inner{
  max-width: 60ch;
  font-size: 1.0rem;
  color: #e5e7eb;
}

/* =========================================================
   6) GALERÍA (PORTFOLIO PRO)
========================================================= */

.gallery{
  padding: 80px 0 90px;
  background:#f3f4f6;
}

.gallery-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

/* Tarjeta */
.gallery-item{
  position:relative;
  border-radius: var(--radius-xl);
  overflow:hidden;
  background:#ffffff;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(15, 23, 42, 0.06);
  transform: translateY(0);
  transition: transform .25s ease, box-shadow .25s ease;
  isolation:isolate;
  cursor: default;
}

/* Imagen */
.gallery-item img{
  width:100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform .45s ease;
}

/* Overlay "premium" */
.gallery-item::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(
    0deg,
    rgba(2,6,23,0.72) 0%,
    rgba(2,6,23,0.18) 42%,
    rgba(2,6,23,0.00) 70%
  );
  opacity: 0;
  transition: opacity .25s ease;
  z-index:1;
}

/* Caption automático con alt */
.gallery-item::before{
  content: attr(aria-label);
  position:absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  color:#fff;
  font-weight: 800;
  font-size: 0.98rem;
  line-height: 1.2;
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease;
  z-index:2;
  text-wrap: balance;
}

/* Para que funcione el caption, ponemos aria-label desde CSS con :has(img[alt]) NO (no fiable).
   Solución simple: en HTML hemos usado <figure>. Aquí lo resolvemos con JS? No. Mejor: sin tocar JS.
   Alternativa: usamos el alt como tooltip visual con filter + overlay sin texto.
   => Para tener texto sin JS: ponemos aria-label en cada figure desde HTML (te lo hago aquí abajo en CSS con fallback). */

.gallery-item:hover{
  transform: translateY(-6px);
  box-shadow: 0 22px 52px rgba(15, 23, 42, 0.20);
}

.gallery-item:hover img{ transform: scale(1.06); }
.gallery-item:hover::after{ opacity: 1; }
.gallery-item:hover::before{
  opacity: 1;
  transform: translateY(0);
}

/* Fallback: si no hay aria-label, no muestres caption */
.gallery-item:not([aria-label])::before{ content:""; }

/* =========================================================
   7) BOTONES (CTA)
========================================================= */

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 14px 32px;
  border-radius:999px;
  font-weight:800;
  font-size:0.96rem;
  border:none;
  cursor:pointer;
  text-decoration:none;
  white-space:nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.btn-primary{
  background: var(--brand);
  color:#fff;
  box-shadow: 0 14px 34px rgba(14, 0, 97, 0.38);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.btn-primary:hover{
  background: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 18px 42px rgba(14, 0, 97, 0.45);
}

.gallery-actions{
  margin-top: 44px;
  text-align:center;
}

/* =========================================================
   8) FOOTER
========================================================= */

.site-footer{
  background:#020617;
  color:#e5e7eb;
}

.footer-top{
  border-top:1px solid rgba(148, 163, 184, 0.25);
  padding:40px 0 26px;
}

.footer-grid{
  display:grid;
  grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
  gap:32px;
}

.footer-col h3{
  font-size:0.95rem;
  text-transform:uppercase;
  letter-spacing:0.16em;
  margin-bottom:14px;
  color:#e5e7eb;
}

.footer-col ul li + li{ margin-top:6px; }

.footer-col a{
  color: rgba(255,255,255,0.78);
  font-size:0.94rem;
  text-decoration:none;
  transition: color .15s ease, opacity .15s ease;
}

.footer-col a:hover{ color:#fff; }

.footer-col--brand p{
  font-size:0.95rem;
  color:#9ca3af;
  max-width:340px;
}

.footer-logo img{
  height:64px;
  width:auto;
  margin-bottom:10px;
}

.footer-contact li{
  font-size:0.94rem;
  color:#9ca3af;
}

.footer-contact span{
  font-weight:800;
  color:#e5e7eb;
}

.footer-bottom{
  border-top:1px solid rgba(148, 163, 184, 0.2);
  padding:12px 0 16px;
  background:#020617;
}

.footer-bottom-inner{
  text-align:center;
  font-size:0.85rem;
  color:#9ca3af;
}

/* =========================================================
   9) RESPONSIVE
========================================================= */

@media (max-width: 1100px){
  .gallery-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 992px){
  .container{ padding: 0 20px; }
  .header-inner{ height:72px; }
  .brand img{ height:70px; }

  .nav-toggle{ display:flex; }

  .main-nav{
    position:absolute;
    top:72px;
    right:0;
    left:0;
    background:#fff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
    transform-origin: top;
    transform: scaleY(0);
    opacity: 0;
    pointer-events: none;
    transition: transform .2s ease, opacity .2s ease;
  }

  .main-nav.is-open{
    transform: scaleY(1);
    opacity: 1;
    pointer-events: auto;
  }

  .main-nav ul{
    flex-direction: column;
    align-items: center;
    padding: 16px 0 18px;
    gap: 10px;
  }

  .hero__inner--center{ text-align:center; }
  .hero__subtitle--inner{ margin-left:auto; margin-right:auto; }

  /* 2 columnas queda bien en tablet */
  .gallery-item img{ min-height: 240px; }

  .footer-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap:26px;
  }
}

@media (max-width: 640px){
  .container{ padding: 0 16px; }
  .brand img{ height:60px; }

  .gallery{ padding: 65px 0 75px; }

  .gallery-grid{
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .gallery-item img{ min-height: 220px; }

  .footer-grid{ grid-template-columns: 1fr; }
  .footer-col--brand p{ max-width:none; }
}

/* Respeta preferencias de movimiento */
@media (prefers-reduced-motion: reduce){
  *{ transition:none !important; scroll-behavior:auto !important; }
}


/* =========================================================
   FIX LIGHTBOX - DATIVA24
   (evita que el overlay del hover bloquee el click)
========================================================= */

/* IMPORTANTÍSIMO */
.gallery-item::after,
.gallery-item::before{
  pointer-events:none;
}

/* para que el click siempre llegue */
.gallery-item{
  position:relative;
}

.gallery-item img{
  cursor: zoom-in;
  position:relative;
  z-index:0;
}

/* =========================================================
   LIGHTBOX PRO
========================================================= */

.lightbox{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.88);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:99999;
  cursor:zoom-out;
  animation: lightboxFade .25s ease;
}

.lightbox img{
  max-width:92%;
  max-height:92%;
  border-radius:14px;
  box-shadow:0 25px 70px rgba(0,0,0,0.65);
  animation: lightboxZoom .25s ease;
}

@keyframes lightboxFade{
  from{ opacity:0; }
  to{ opacity:1; }
}

@keyframes lightboxZoom{
  from{
    transform:scale(.92);
    opacity:.6;
  }
  to{
    transform:scale(1);
    opacity:1;
  }
}
