/* Galería de trabajos. Reutiliza site.css y detailing.css */
.gal-hero { padding: 1.6rem 1.6rem 1.4rem; background: #060608; border: 1px solid var(--line); border-radius: .9rem; }
.gal-hero h1 { font-family: var(--display); font-stretch: 125%; font-style: italic; font-weight: 900; font-size: 2.6rem; line-height: 1; text-transform: uppercase; }
.gal-hero p { margin-top: .4rem; color: #e8e9ec; font-size: 1.15rem; font-weight: 400; }
.gal-filters { display: flex; gap: .45rem; margin: 1rem 0; padding-bottom: .3rem; overflow-x: auto; scrollbar-width: thin; }
.gal-filter { flex: none; min-height: 2.75rem; padding: 0 1rem; background: #060608; color: #fff; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font: 600 1.02rem var(--body); }
.gal-filter:hover { border-color: #fff; }
.gal-filter[aria-pressed="true"] { background: var(--red); border-color: var(--red); }

.gal-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 15rem; grid-auto-flow: dense; gap: .8rem; }
.gal-card { position: relative; display: block; min-width: 0; overflow: hidden; background: #060608; color: #fff; border: 1px solid var(--line); border-radius: .9rem; text-decoration: none; }
.gal-card:hover { border-color: #fff; }
.gal-card.big { grid-column: span 2; grid-row: span 2; }
.gal-card.wide { grid-column: span 2; }
.gal-card.tall { grid-row: span 2; }
.gal-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.gal-card:hover img { transform: scale(1.03); }
.gal-card-text { position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: .1rem; padding: 2.4rem .9rem .75rem; background: linear-gradient(to top, rgba(0, 0, 0, .9), transparent); }
.gal-card-text strong { font-size: 1.2rem; font-weight: 600; line-height: 1.15; }
.gal-card.big .gal-card-text strong { font: italic 800 1.7rem/1.1 var(--display); }
.gal-card-text small { color: #d7d8dc; font-size: 1rem; }
.gal-tags { position: absolute; top: .7rem; left: .7rem; display: flex; flex-wrap: wrap; gap: .3rem; }
.gal-tag { padding: .12rem .6rem; background: rgba(0, 0, 0, .72); border: 1px solid var(--line); border-radius: 999px; font-size: .92rem; font-weight: 600; }
.gal-tag.hot { background: var(--red); border-color: var(--red); }
.gal-play { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.gal-play::before { content: ""; width: 3.6rem; height: 3.6rem; background: rgba(0, 0, 0, .65); border: 2px solid #fff; border-radius: 50%; }
.gal-play::after { content: ""; position: absolute; margin-left: .25rem; border-style: solid; border-width: .65rem 0 .65rem 1.05rem; border-color: transparent transparent transparent #fff; }
.gal-empty { display: grid; gap: .5rem; justify-items: center; margin-top: 1rem; padding: 3.5rem 1.2rem; background: #060608; border: 1px solid var(--line); border-radius: .9rem; text-align: center; }
.gal-empty h2 { font: italic 800 1.9rem/1.15 var(--display); text-transform: uppercase; }
.gal-empty p { color: #d7d8dc; font-size: 1.1rem; }

.gal-detail { display: grid; gap: 1rem; margin-top: 1rem; }
.gal-back { justify-self: start; display: inline-flex; align-items: center; gap: .4rem; min-height: 2.75rem; color: #fff; font-size: 1.05rem; }
.gal-detail h2 { font: italic 800 2.1rem/1.1 var(--display); text-transform: uppercase; overflow-wrap: anywhere; }
.gal-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; color: var(--muted); font-size: 1.05rem; }
.gal-desc { max-width: 46rem; color: #e8e9ec; font-size: 1.15rem; font-weight: 400; line-height: 1.35; white-space: pre-line; }
.gal-section-title { font: 600 1.35rem var(--display); }
.gal-media { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.gal-thumb { position: relative; padding: 0; aspect-ratio: 4 / 3; overflow: hidden; background: #060608; border: 1px solid var(--line); border-radius: .7rem; cursor: zoom-in; }
.gal-thumb:first-child { grid-column: span 2; grid-row: span 2; }
.gal-thumb:only-child { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.gal-thumb:hover { border-color: #fff; }
.gal-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gal-cta { justify-self: start; }

.ba { position: relative; width: 100%; max-width: 56rem; overflow: hidden; background: #000; border: 1px solid var(--line); border-radius: .9rem; cursor: ew-resize; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ba-line { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; pointer-events: none; }
.ba-line::after { content: "‹ ›"; position: absolute; top: 50%; left: 50%; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; margin: -1.375rem 0 0 -1.375rem; background: var(--red); border: 2px solid #fff; border-radius: 50%; color: #fff; font-weight: 700; }
.ba-label { position: absolute; top: .7rem; padding: .12rem .6rem; background: rgba(0, 0, 0, .72); border-radius: 999px; font-weight: 600; pointer-events: none; }
.ba-label.before { left: .7rem; }
.ba-label.after { right: .7rem; }
.ba input { position: absolute; left: 0; bottom: 0; width: 100%; height: 2rem; margin: 0; opacity: 0; cursor: ew-resize; }
.ba:focus-within { outline: 2px solid #fff; outline-offset: 2px; }

.lightbox { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; background: rgba(0, 0, 0, .96); color: #fff; border: 0; }
.lightbox::backdrop { background: #000; }
.lightbox[open] { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr) 3.5rem; align-items: center; }
.lb-stage { display: grid; place-items: center; grid-column: 2; height: 100dvh; min-width: 0; padding: 3.2rem 0; touch-action: pan-y; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: .4rem; }
.lb-close, .lb-nav { display: grid; place-items: center; width: 2.9rem; height: 2.9rem; padding: 0; background: rgba(255, 255, 255, .12); color: #fff; border: 0; border-radius: 50%; cursor: pointer; font-size: 1.7rem; line-height: 1; }
.lb-close:hover, .lb-nav:hover { background: var(--red); }
.lb-close { position: absolute; top: .5rem; right: .6rem; z-index: 2; }
.lb-prev { grid-column: 1; justify-self: center; grid-row: 1; }
.lb-next { grid-column: 3; justify-self: center; grid-row: 1; }
.lb-stage { grid-row: 1; }
.lb-count { position: absolute; left: 0; right: 0; bottom: .7rem; color: #d7d8dc; text-align: center; pointer-events: none; }

@media (max-width: 860px) {
  .gal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 11.5rem; }
  .gal-hero h1 { font-size: 2rem; }
}
@media (max-width: 460px) {
  .gal-grid { gap: .5rem; grid-auto-rows: 10rem; }
  .gal-card.big .gal-card-text strong { font-size: 1.3rem; }
  .gal-card-text { padding: 1.8rem .6rem .5rem; }
  .gal-card-text strong { font-size: 1.05rem; }
  .gal-media { grid-template-columns: 1fr 1fr; }
  .gal-detail h2 { font-size: 1.6rem; }
  .gal-cta { justify-self: stretch; }
  .lightbox[open] { grid-template-columns: 0 minmax(0, 1fr) 0; }
  .lb-prev, .lb-next { position: absolute; bottom: .3rem; z-index: 2; }
  .lb-prev { left: .6rem; }
  .lb-next { right: .6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .gal-card img { transition: none; }
}
