/* ===================================================
   LAGUA — layout.css
   Sidebar, menú off-canvas, hero, footer, shell, responsive
   =================================================== */

/* ===== SIDEBAR LATERAL FIJO ===== */
.side-rail{
  position:fixed;
  top:0;left:0;bottom:0;
  width:var(--sidebar-w);
  background:var(--azul-marino);
  z-index:300;
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:32px 0;
}

/* Hamburger */
.menu-toggle{
  width:48px;height:48px;
  display:flex;align-items:center;justify-content:center;
  position:relative;
  z-index:310;
}
.menu-toggle-lines{
  display:flex;flex-direction:column;gap:7px;
  width:39px;
}
.menu-toggle-lines span{
  display:block;
  width:100%;
  height:2.4px;
  background:var(--crema);
  border-radius:2px;
  transition:transform 0.4s var(--ease-spring), opacity 0.3s;
  transform-origin:center;
}

/* Hamburger open state */
.menu-toggle[aria-expanded="true"] .menu-toggle-lines span:nth-child(1){
  transform:translateY(9.5px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] .menu-toggle-lines span:nth-child(2){
  opacity:0;
}
.menu-toggle[aria-expanded="true"] .menu-toggle-lines span:nth-child(3){
  transform:translateY(-9.5px) rotate(-45deg);
}

/* Logo in rail */
.rail-logo{
  margin-top:auto;
  width:36px;height:36px;
}
.rail-logo img{
  width:100%;height:100%;
  object-fit:contain;
  filter:brightness(0) invert(1);
  opacity:0.7;
}

/* Vertical text */
.rail-text{
  margin-top:var(--sp-lg);
  writing-mode:vertical-rl;
  transform:rotate(180deg);
  color:var(--crema);
  opacity:0.4;
  font-size:0.65rem;
  letter-spacing:0.35em;
  text-transform:uppercase;
}

.rail-logo,
.rail-text{
  display:none;
}

/* ===== SCRIM (fondo oscuro al abrir menú) ===== */
.menu-scrim{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.5);
  z-index:250;
  opacity:0;
  pointer-events:none;
  transition:opacity 0.4s;
}
.menu-scrim.active{
  opacity:1;
  pointer-events:auto;
}
.menu-scrim.menu-scrim-instant{
  transition:none;
}

/* ===== PANEL DE NAVEGACIÓN OFF-CANVAS ===== */
.menu-panel{
  position:fixed;
  top:0;
  left:var(--sidebar-w);
  bottom:0;
  width:340px;
  max-width:calc(100vw - var(--sidebar-w));
  overflow:hidden;
  background:var(--azul-prof);
  z-index:280;
  padding:70px 44px;
  pointer-events:none;
  transform:translateX(-100%);
  visibility:hidden;
  will-change:transform;
  transition:transform 0.34s var(--ease-spring), visibility 0s linear 0.34s;
}
.menu-panel.open{
  pointer-events:auto;
  transform:translateX(0);
  visibility:visible;
  transition:transform 0.34s var(--ease-spring), visibility 0s;
}
.menu-panel.menu-panel-instant{
  transition:none;
}
.menu-panel .menu-title{
  color:var(--naranja);
  font-size:0.7rem;
  font-weight:600;
  letter-spacing:0.25em;
  text-transform:uppercase;
  margin-bottom:var(--sp-lg);
}
.menu-panel a{
  display:block;
  color:var(--crema);
  font-family:var(--ff-heading);
  font-size:1.3rem;
  font-weight:500;
  padding:14px 0;
  border-bottom:1px solid rgba(255,255,255,0.1);
  transition:padding-left 0.2s, color 0.2s;
  white-space:nowrap;
}
.menu-panel a:hover,
.menu-panel a[aria-current="page"]{
  padding-left:14px;
  color:var(--naranja);
}

/* ===== SITE SHELL ===== */
.site-shell{
  margin-left:var(--sidebar-w);
  min-height:100vh;
  display:flex;
  flex-direction:column;
}
.site-shell main{flex:1}

/* ===== PAGE HERO ===== */
.page-hero{
  position:relative;
  min-height:55vh;
  display:flex;
  align-items:flex-end;
  padding:var(--sp-2xl) var(--sp-2xl) var(--sp-xl);
  overflow:hidden;
  background:var(--azul-marino);
}
.page-hero::before{
  content:'';
  position:absolute;
  inset:0;
  background:linear-gradient(180deg, rgba(11,57,84,0.15) 0%, rgba(11,57,84,0.55) 60%, rgba(11,57,84,0.85) 100%);
  z-index:1;
}
.page-hero > img,
.page-hero > video{
  position:absolute;
  inset:0;
  width:100%;height:100%;
  object-fit:cover;
}
.page-hero .hero-content{
  position:relative;
  z-index:2;
  color:var(--blanco);
  max-width:760px;
}
.page-hero .hero-content h1{
  color:var(--blanco);
  font-size:clamp(1.8rem, 4.5vw, 3rem);
  text-transform:uppercase;
  margin-bottom:var(--sp-sm);
  text-shadow:0 2px 12px rgba(0,0,0,0.3);
}
.page-hero .hero-content p{
  font-size:1.05rem;
  opacity:0.9;
  max-width:56ch;
}

/* Hero "orange" variant for créditos */
.page-hero.orange::before{
  background:linear-gradient(180deg, rgba(224,138,62,0.08) 0%, rgba(11,57,84,0.7) 70%, rgba(11,57,84,0.9) 100%);
}

/* Banner de Créditos */
.page-hero.creditos-hero{
  min-height:360px;
  height:360px;
  align-items:flex-end;
  justify-content:flex-start;
  padding:0 clamp(42px, 6vw, 84px) 44px;
  text-align:left;
  background:var(--verde);
}
.page-hero.creditos-hero::before{
  background:linear-gradient(180deg, rgba(0,112,88,0.04) 0%, rgba(16,137,92,0.32) 48%, rgba(0,118,70,0.74) 100%);
}
.page-hero.creditos-hero > img{
  object-position:center center;
}
.page-hero.creditos-hero .hero-content{
  width:100%;
  max-width:1080px;
  margin:0;
}
.page-hero.creditos-hero .hero-content h1{
  font-size:clamp(2.35rem, 4.8vw, 4rem);
  font-weight:800;
  line-height:1.02;
  letter-spacing:0;
  margin-bottom:14px;
}
.page-hero.creditos-hero .hero-content p{
  max-width:62ch;
  margin:0;
  font-size:clamp(1rem, 1.6vw, 1.18rem);
  font-weight:600;
  text-shadow:0 2px 10px rgba(0,0,0,0.28);
}
.creditos-hero-label{
  display:block;
  margin-bottom:10px;
  color:var(--blanco);
  font-size:0.76rem;
  font-weight:700;
  letter-spacing:0.24em;
  text-transform:uppercase;
  text-shadow:0 2px 10px rgba(0,0,0,0.28);
}
.creditos-hero + .section{
  padding-top:46px;
  background:var(--blanco);
}
@media(max-width:768px){
  .page-hero.creditos-hero{
    min-height:330px;
    height:330px;
    padding:0 var(--sp-lg) 36px;
  }
  .page-hero.creditos-hero .hero-content h1{
    font-size:clamp(2rem, 8vw, 3rem);
  }
  .page-hero.creditos-hero .hero-content p{
    font-size:1rem;
  }
}

/* Collage media for créditos hero */
.collage-media{
  position:absolute;
  inset:0;
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:0;
}
.collage-media img{
  width:100%;height:100%;
  object-fit:cover;
}

/* ===== HOME HERO ===== */
.home-hero{
  position:relative;
  height:458px;
  min-height:0;
  text-align:center;
  overflow:hidden;
  background:var(--azul-marino);
}
.home-hero::before{
  content:'';
  position:absolute;
  inset:0;
  background:linear-gradient(180deg, rgba(11,57,84,0.08) 0%, rgba(11,57,84,0.04) 42%, rgba(11,57,84,0.12) 100%);
  z-index:1;
}
.home-hero video,
.home-hero > img{
  position:absolute;
  inset:0;
  width:100%;height:100%;
  object-fit:cover;
  object-position:center center;
}
.home-hero-logo{
  position:absolute;
  top:66px;
  left:54px;
  z-index:2;
}
.home-hero-logo img{
  width:270px;
  height:auto;
  object-fit:contain;
}
.home-hero-content{
  position:absolute;
  top:208px;
  left:50%;
  transform:translateX(-50%);
  z-index:2;
  color:var(--blanco);
  width:min(92%, 920px);
  padding:0;
}
.home-hero-content h1{
  color:var(--blanco);
  font-size:clamp(2rem, 3.05vw, 2.45rem);
  font-weight:800;
  text-transform:uppercase;
  text-shadow:0 2px 14px rgba(0,0,0,0.28);
  margin-bottom:18px;
  line-height:1.5;
  letter-spacing:0;
}
/* ===== FOOTER ===== */
.site-footer{
  background:var(--azul-prof);
  color:var(--crema);
  padding:70px 0 0;
  border-top:1px solid rgba(255,255,255,0.08);
}
.footer-grid{
  display:grid;
  grid-template-columns:1.3fr 1fr 1fr 1.4fr;
  gap:40px;
  padding-bottom:40px;
}

/* Brand column */
.footer-brand{
  display:flex;
  flex-direction:column;
  gap:14px;
}
.footer-logo{
  width:160px;
  filter:brightness(0) invert(1);
}
.footer-brand > p{
  font-size:0.88rem;
  opacity:0.8;
  max-width:28ch;
}

/* Social links */
.social-links{
  display:flex;
  gap:12px;
  margin-top:var(--sp-sm);
}
.icon-link{
  width:32px;height:32px;
  display:flex;align-items:center;justify-content:center;
  border:1px solid rgba(255,255,255,0.25);
  border-radius:var(--r-full);
  color:var(--crema);
  transition:background 0.3s, color 0.3s;
}
.icon-link:hover{
  background:var(--naranja);
  border-color:var(--naranja);
}

/* Institutional logos */
.institutional-logos{
  display:flex;
  gap:16px;
  align-items:center;
  margin-top:var(--sp-md);
}
.institutional-logos img{
  height:42px;
  width:auto;
  filter:brightness(0) invert(1);
  opacity:0.8;
}

/* Footer columns */
.footer-col h2{
  font-family:var(--ff-heading);
  font-size:1rem;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:0.04em;
  color:var(--crema);
  margin-bottom:var(--sp-md);
}
.footer-col a,
.footer-col p{
  display:block;
  font-size:0.88rem;
  padding:4px 0;
  opacity:0.8;
  transition:color 0.3s, opacity 0.3s;
}
.footer-col a:hover{color:var(--naranja);opacity:1}

/* Project key */
.project-key{
  display:inline-block;
  color:var(--naranja);
  font-weight:600;
  font-size:0.92rem;
  border-bottom:1px solid var(--naranja);
  padding-bottom:2px;
  margin-top:var(--sp-sm);
}

/* Footer bottom */
.footer-bottom{
  border-top:1px solid rgba(255,255,255,0.1);
  padding:32px 0;
  display:flex;
  justify-content:space-between;
  align-items:center;
  flex-wrap:wrap;
  gap:var(--sp-md);
  font-size:0.8rem;
  opacity:0.6;
}
.footer-bottom nav{
  display:flex;
  gap:var(--sp-lg);
}
.footer-bottom a{transition:color 0.3s}
.footer-bottom a:hover{color:var(--naranja);opacity:1}

/* ===== RESPONSIVE ===== */
@media(max-width:1024px){
  .footer-grid{
    grid-template-columns:1fr 1fr;
    gap:var(--sp-lg);
  }
}
@media(max-width:768px){
  .side-rail{width:var(--sidebar-w-mob)}
  .site-shell{margin-left:var(--sidebar-w-mob)}
  .menu-panel{
    left:var(--sidebar-w-mob);
    width:280px;
    max-width:calc(100vw - var(--sidebar-w-mob));
    padding:60px 28px;
  }
  .page-hero{
    min-height:42vh;
    padding:var(--sp-xl) var(--sp-lg) var(--sp-lg);
  }
  .home-hero{
    height:auto;
    min-height:500px;
    display:flex;
    flex-direction:column;
    align-items:center;
    padding:42px 24px 56px;
  }
  .home-hero-logo{
    position:relative;
    top:auto;
    left:auto;
    align-self:flex-start;
    margin-bottom:44px;
  }
  .home-hero-logo img{
    width:210px;
  }
  .home-hero-content{
    position:relative;
    top:auto;
    left:auto;
    transform:none;
    width:min(88%, 620px);
  }
  .home-hero-content h1{
    font-size:clamp(1.35rem, 5.8vw, 2rem);
    line-height:1.35;
    margin-bottom:22px;
  }
  .section{padding:var(--sp-2xl) 0}
  .footer-grid{grid-template-columns:1fr}
  .footer-bottom{flex-direction:column;text-align:center}
  .footer-bottom nav{justify-content:center}
}
@media(max-width:480px){
  .side-rail{
    padding-top:24px;
  }
  .menu-toggle{
    width:40px;
    height:40px;
  }
  .menu-toggle-lines{
  display:flex;flex-direction:column;gap:7px;
  width:39px;
}
  .home-hero{
    min-height:450px;
    padding:42px 18px 48px;
  }
  .home-hero-logo{
    left:auto;
    margin-bottom:30px;
  }
  .home-hero-logo img{
    width:180px;
  }
  .home-hero-content{
    width:min(88%, 420px);
  }
  .collage-media{grid-template-columns:1fr}
  .collage-media img:nth-child(2),
  .collage-media img:nth-child(3){display:none}
}