/* ==========================================================================
   PLB · layout.css
   Estructura común: contenedor, secciones, cabecera, menú lateral, pie de
   página, cabeceras de páginas internas, marquesina y transiciones de página.
   ========================================================================== */

/* ---------- 1. Contenedor y secciones ---------- */
.wrap { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }
.section { position: relative; padding-block: clamp(72px, 11vw, 170px); }
.section--papel2 { background: var(--papel-2); }
.section--noche  { background: var(--noche); color: var(--papel); }
.section--tinta  { background: var(--tinta); color: var(--papel); }
.section--amarillo { background: var(--amarillo); color: var(--tinta); }
.section__head { display: grid; gap: 1.2rem; margin-bottom: clamp(36px, 6vw, 84px); }
.section__head--centro { text-align: center; justify-items: center; }
.section__head p { max-width: 40em; }

/* Silueta del ala (isotipo oficial usado como máscara, sin deformarla) */
.ala {
  --ala-color: var(--amarillo);
  display: block; background: var(--ala-color); aspect-ratio: 436.8 / 784;
  -webkit-mask: url("../assets/img/isotipo-negro.svg") center / contain no-repeat;
          mask: url("../assets/img/isotipo-negro.svg") center / contain no-repeat;
  pointer-events: none;
}

/* Fotografías integradas: duotono de marca, fundidos y zona segura para el texto */
.foto { position: relative; overflow: clip; background: var(--tinta); }
.foto > img { width: 100%; height: 100%; object-fit: cover; }
.foto--duo > img { filter: grayscale(1) contrast(1.06) brightness(.96); }
.foto--duo::after {                     /* amarillo de marca sobre la foto en blanco y negro */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: var(--amarillo); mix-blend-mode: multiply;
}
.foto--tinta > img { filter: grayscale(1) contrast(1.08); }
.foto--tinta::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(160deg, rgba(244, 219, 0, .22), rgba(20, 17, 18, .35)); mix-blend-mode: normal;
}
/* Parallax: main.js escribe --py; el escalado 1.12 evita bordes visibles */
[data-parallax] { transform: translate3d(0, var(--py, 0px), 0) scale(1.12); }
.fundido-b { -webkit-mask-image: linear-gradient(#000 62%, transparent); mask-image: linear-gradient(#000 62%, transparent); }
.fundido-t { -webkit-mask-image: linear-gradient(transparent, #000 38%); mask-image: linear-gradient(transparent, #000 38%); }
.corte-diag { clip-path: polygon(0 0, 100% clamp(28px, 7vw, 96px), 100% 100%, 0 100%); }
.corte-diag--2 { clip-path: polygon(0 clamp(28px, 7vw, 96px), 100% 0, 100% 100%, 0 100%); }
.arco { border-radius: 999px 999px var(--radio) var(--radio); }

/* ---------- 2. Cabecera ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100; color: var(--papel);
  transition: background-color .5s var(--ease), backdrop-filter .5s, box-shadow .5s;
}
.site-header__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: calc(var(--header-h) + 14px); transition: height .5s var(--ease);
}
.brand { display: block; position: relative; text-decoration: none; }
.brand img { transition: opacity .35s var(--ease), transform .5s var(--ease); }
.brand__full { width: clamp(104px, 9vw, 128px); height: auto; }
.brand__mark { position: absolute; left: 0; top: 50%; height: 44px; width: auto; opacity: 0; transform: translateY(-50%) scale(.85); }
.site-header__actions { display: flex; align-items: center; gap: clamp(10px, 2vw, 22px); }
.menu-btn {
  display: inline-flex; align-items: center; gap: 12px; padding: 10px 4px; background: none; border: 0; color: inherit;
  font: 700 .72rem/1 var(--sans); letter-spacing: .2em; text-transform: uppercase;
}
.menu-btn__icon { position: relative; width: 30px; height: 12px; }
.menu-btn__icon i { position: absolute; left: 0; height: 2px; background: currentColor; border-radius: 2px; transition: transform .5s var(--ease), width .4s var(--ease); }
.menu-btn__icon i:first-child { top: 0; width: 30px; }
.menu-btn__icon i:last-child  { bottom: 0; width: 20px; right: 0; left: auto; }
.menu-btn:hover .menu-btn__icon i:last-child { width: 30px; }

.site-header.is-scrolled { background: rgba(20, 17, 18, .9); box-shadow: 0 1px 0 var(--linea-clara); }
@supports (backdrop-filter: blur(10px)) {
  .site-header.is-scrolled { background: rgba(20, 17, 18, .78); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); }
}
.site-header.is-scrolled .site-header__bar { height: var(--header-h); }
.site-header.is-scrolled .brand__full { opacity: 0; transform: translateX(-10px); }
.site-header.is-scrolled .brand__mark { opacity: 1; transform: translateY(-50%) scale(1); }

.progress { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--amarillo); transform-origin: 0 50%; transform: scaleX(var(--scroll, 0)); }

@media (max-width: 520px) { .site-header__actions .btn { padding: .8em 1.05em; } .menu-btn span:first-child { display: none; } }

/* ---------- 3. Menú lateral (cortinas que entran desde la derecha) ---------- */
.drawer { position: fixed; inset: 0; z-index: 200; visibility: hidden; pointer-events: none; transition: visibility 0s .9s; }
.drawer.is-open { visibility: visible; pointer-events: auto; transition-delay: 0s; }
.drawer__veil { position: absolute; inset: 0; background: rgba(20, 17, 18, .62); opacity: 0; transition: opacity .6s var(--ease); }
.drawer.is-open .drawer__veil { opacity: 1; }
@supports (backdrop-filter: blur(6px)) { .drawer__veil { backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); } }
.drawer__cortina, .drawer__panel {
  position: absolute; top: 0; right: 0; height: 100%;
  width: min(100%, 620px);
  transform: translateX(101%); transition: transform .8s var(--ease-inout);
}
.drawer__cortina { background: var(--amarillo); width: min(100%, 640px); }
.drawer__panel {
  background: var(--noche); color: var(--papel); transition-duration: .9s; transition-delay: .08s;
  display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain;
  padding: 22px clamp(24px, 5vw, 56px) 32px; isolation: isolate;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}
.drawer.is-open .drawer__cortina, .drawer.is-open .drawer__panel { transform: none; }
.drawer.is-open .drawer__cortina { transition-delay: 0s; }
.drawer.is-open .drawer__panel { transition-delay: .1s; }
.drawer:not(.is-open) .drawer__cortina { transition-delay: .12s; }
.drawer__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: clamp(24px, 6vh, 64px); }
.drawer__top img { width: 150px; height: auto; }
.drawer__close {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  background: transparent; border: 2px solid var(--linea-clara); color: var(--papel);
  transition: background .4s var(--ease), color .4s, transform .6s var(--ease), border-color .4s;
}
.drawer__close:hover { background: var(--amarillo); color: var(--tinta); border-color: var(--amarillo); transform: rotate(90deg); }
.drawer__close svg { width: 22px; height: 22px; }
.drawer__nav { display: grid; gap: 2px; }
.drawer__nav a {
  position: relative; display: flex; align-items: baseline; gap: 18px; text-decoration: none;
  font: 600 clamp(1.9rem, 1.2rem + 3.4vw, 3.3rem)/1.15 var(--serif); letter-spacing: -.02em;
  padding: .12em 0; color: var(--papel);
  transition: color .4s var(--ease), padding-left .5s var(--ease);
}
.drawer__nav a small { font: 700 .68rem/1 var(--sans); letter-spacing: .18em; color: var(--naranja); min-width: 2.2em; transform: translateY(-.9em); }
.drawer__nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--linea-clara);
}
.drawer__nav a::before {           /* barra amarilla que cruza al pasar el cursor */
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--amarillo);
  transform: scaleX(0); transform-origin: 0 50%; transition: transform .6s var(--ease);
}
.drawer__nav a:hover, .drawer__nav a:focus-visible { color: var(--amarillo); padding-left: 14px; }
.drawer__nav a:hover::before, .drawer__nav a:focus-visible::before { transform: scaleX(1); }
.drawer__nav a[aria-current="page"] { color: var(--amarillo); }
.drawer__nav li { overflow: clip; }
.drawer__nav li > a { transform: translateY(110%); transition: transform .9s var(--ease) calc(.25s + var(--i) * 65ms), color .4s var(--ease), padding-left .5s var(--ease); }
.drawer.is-open .drawer__nav li > a { transform: none; }
.drawer__foot { margin-top: auto; padding-top: 36px; display: grid; gap: 22px; opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease) .7s, transform .7s var(--ease) .7s; }
.drawer.is-open .drawer__foot { opacity: 1; transform: none; }
.drawer__contact { display: grid; gap: 4px; font: 500 .9rem/1.6 var(--sans); color: rgba(247, 244, 234, .8); }
.drawer__contact a { text-decoration: none; }
.drawer__contact a:hover { color: var(--amarillo); }
.drawer .ala { position: absolute; z-index: -1; right: -60px; bottom: -40px; width: 300px; --ala-color: var(--papel); opacity: .05; }
.no-js .menu-btn, .no-js .drawer__close, .no-js .drawer__veil, .no-js .drawer__cortina { display: none; }
.no-js .drawer { position: static; visibility: visible; pointer-events: auto; }
.no-js .drawer__panel { position: static; transform: none; width: 100%; height: auto; }
.no-js .drawer__nav li > a, .no-js .drawer__foot { transform: none; opacity: 1; }
.no-js .site-header { position: static; background: var(--noche); }
body.menu-abierto { overflow: hidden; }

/* Redes sociales */
.redes { display: flex; flex-wrap: wrap; gap: 10px; }
.redes a {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  border: 1.5px solid currentColor; color: inherit; text-decoration: none;
  transition: background .4s var(--ease), color .4s var(--ease), border-color .4s, transform .5s var(--ease);
}
.redes a:hover, .redes a:focus-visible { background: var(--amarillo); color: var(--tinta); border-color: var(--amarillo); transform: translateY(-4px); }
.redes svg { width: 20px; height: 20px; fill: currentColor; }

/* ---------- 4. Pie de página ---------- */
.site-footer { position: relative; overflow: clip; background: var(--noche); color: var(--papel); padding: clamp(64px, 9vw, 130px) 0 28px; }
.site-footer .ala { position: absolute; right: 2%; bottom: -8%; width: min(34vw, 380px); --ala-color: var(--amarillo); opacity: .08; }
.footer__grid { position: relative; display: grid; gap: clamp(32px, 5vw, 64px); grid-template-columns: 1.4fr 1fr 1fr 1fr; }
.footer__brand img { width: 190px; height: auto; margin-bottom: 20px; }
.footer__brand p { font: 400 .95rem/1.6 var(--sans); color: rgba(247, 244, 234, .78); max-width: 26em; }
.site-footer .ft { font: 700 .7rem/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--naranja); margin-bottom: 20px; }
.site-footer li + li { margin-top: 10px; }
.site-footer li a, .footer__contact a { text-decoration: none; font: 500 .95rem/1.5 var(--sans); color: rgba(247, 244, 234, .86); transition: color .3s; }
.site-footer li a:hover, .footer__contact a:hover { color: var(--amarillo); }
.footer__contact { display: grid; gap: 10px; }
.footer__contact span { display: flex; gap: 10px; align-items: flex-start; font: 500 .95rem/1.5 var(--sans); color: rgba(247, 244, 234, .86); }
.footer__contact svg { width: 18px; height: 18px; flex: none; margin-top: 3px; color: var(--amarillo); }
.footer__bottom {
  position: relative; margin-top: clamp(40px, 7vw, 90px); padding-top: 24px; border-top: 1px solid var(--linea-clara);
  display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; font: 500 .8rem/1.5 var(--sans); color: rgba(247, 244, 234, .68);
}
.footer__bottom a { color: inherit; text-underline-offset: .2em; }
.footer__bottom a:hover { color: var(--amarillo); }
.footer__bottom nav { display: flex; gap: 22px; flex-wrap: wrap; }
@media (max-width: 900px) { .footer__grid { grid-template-columns: 1fr 1fr; } .footer__brand { grid-column: 1 / -1; } }
@media (max-width: 520px) { .footer__grid { grid-template-columns: 1fr; } }

/* ---------- 5. Cabecera de páginas internas ---------- */
.page-hero {
  position: relative; isolation: isolate; overflow: clip; color: var(--papel); background: var(--noche);
  min-height: clamp(420px, 78svh, 720px); display: grid; align-items: end;
  padding: calc(var(--header-h) + 60px) 0 clamp(48px, 7vw, 96px);
}
.page-hero .foto { position: absolute; inset: 0; z-index: -2; }
.page-hero::before {                 /* zona segura: superposición de tinta ≥ 70 % detrás del texto */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(0deg, rgba(20, 17, 18, .95) 0%, rgba(20, 17, 18, .78) 34%, rgba(20, 17, 18, .16) 74%, rgba(20, 17, 18, .1) 100%),
    linear-gradient(90deg, rgba(20, 17, 18, .7), rgba(20, 17, 18, .2) 65%, transparent);
}
.page-hero .foto--tinta > img { filter: grayscale(1) contrast(1.1) brightness(1.4); }
.page-hero .ala { position: absolute; z-index: -1; right: clamp(-40px, 3vw, 60px); top: 4%; height: 92%; width: auto; --ala-color: var(--amarillo); opacity: .16; }
.page-hero h1 { margin-top: 1.2rem; max-width: 14em; }
.page-hero .lede { margin-top: 1.4rem; }
.migas { font: 600 .74rem/1.4 var(--sans); letter-spacing: .06em; display: flex; flex-wrap: wrap; gap: 8px; color: rgba(247, 244, 234, .78); margin-bottom: 22px; }
.migas a { text-decoration: none; } .migas a:hover { color: var(--amarillo); }
.migas li + li::before { content: "/"; margin-right: 8px; opacity: .5; }
.page-hero__linea { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--amarillo); transform-origin: 0 50%; animation: linea 1.4s var(--ease) .5s both; }
@keyframes linea { from { transform: scaleX(0); } }

/* ---------- 6. Marquesina ---------- */
.marquee { background: var(--noche); color: var(--amarillo); overflow: clip; padding: 22px 0; border-block: 1px solid var(--linea-clara); }
.marquee__track { display: flex; width: max-content; background: var(--noche); }
.marquee.is-ready .marquee__track { animation: marquee 60s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__grupo { display: flex; align-items: center; flex: none; background: var(--noche); }
.marquee__grupo span { font: 600 clamp(1.4rem, 1rem + 1.6vw, 2.2rem)/1 var(--serif); letter-spacing: -.01em; padding: 0 clamp(20px, 3vw, 42px); white-space: nowrap; }
.marquee__grupo i { width: 12px; height: 12px; flex: none; background: var(--naranja); transform: rotate(45deg); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- 7. Transición entre páginas (navegadores compatibles) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-sale .6s var(--ease-inout) both; }
::view-transition-new(root) { animation: vt-entra .8s var(--ease-inout) both; }
@keyframes vt-sale  { to { opacity: .35; transform: translateY(-3%) scale(.985); filter: brightness(.6); } }
@keyframes vt-entra { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }

/* Rendimiento: las secciones largas fuera de pantalla no se calculan hasta acercarse */
.cv { content-visibility: auto; contain-intrinsic-size: auto 900px; }
.cv--largo { contain-intrinsic-size: auto 560svh; }
