/* galeria.css */
:root{
  --bg:#050505;
  --text:rgba(255,255,255,.92);
  --muted:rgba(255,255,255,.68);
  --line:rgba(255,255,255,.10);
  --line2:rgba(255,255,255,.06);
  --shadow: 0 18px 70px rgba(0,0,0,.55);

  --accent:#DDCB2C;
  --radius:18px;
  --radius2:14px;

  --max:1100px;
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; background:var(--bg); }
html,body{ height:100%; }
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:
    radial-gradient(1000px 600px at 20% 10%, rgba(221,203,44,.10), transparent 55%),
    radial-gradient(900px 600px at 80% 30%, rgba(255,78,132,.08), transparent 60%),
    var(--bg);
  color: var(--text);
  overflow-x:hidden;
}

a{ color: inherit; text-decoration:none; }
img{ max-width:100%; display:block; }

.container{
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 80px;
}

/* Scrollbar */
*{ scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) rgba(0,0,0,.35); }
*::-webkit-scrollbar{ width:10px; }
*::-webkit-scrollbar-track{ background:rgba(0,0,0,.35); }
*::-webkit-scrollbar-thumb{ background:rgba(255,255,255,.18); border-radius:999px; }
*::-webkit-scrollbar-thumb:hover{ background:rgba(255,255,255,.28); }

/* Skip link */
.skip-link{
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 10px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: #111;
  transform: translateY(-200%);
  transition: transform .2s ease;
  z-index: 2000;
}
.skip-link:focus{ transform: translateY(0); }

/* Focus */
:focus-visible{
  outline: 3px solid rgba(221,203,44,.55);
  outline-offset: 3px;
  border-radius: 12px;
}

/* Topbar */
.topbar{
  position: sticky;
  top:0;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: linear-gradient(to bottom, rgba(5,5,5,.88), rgba(5,5,5,.55));
  border-bottom: 1px solid var(--line2);
}
.topbar-inner{
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight: 650;
  letter-spacing: .2px;
}
.brand-title{ color: rgba(255,255,255,.9); }
.dot{
  width:10px;height:10px;border-radius:999px;background:var(--accent);
  box-shadow: 0 0 0 6px rgba(221,203,44,.12);
}
.backbtn{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius: 999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
  color: var(--text);
  cursor:pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.backbtn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.16);
}

/* Card base */
.card{
  background: linear-gradient(to bottom, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.psec{ padding: 22px; }

/* Header */
.hero-title{
  margin:0;
  font-size: clamp(28px, 3.2vw, 44px);
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.hero-sub{
  margin:10px 0 0;
  color: var(--muted);
  max-width: 70ch;
  line-height: 1.6;
  font-size: 16px;
}

/* Chips */
.chips{
  margin-top: 16px;
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip{
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  color: rgba(255,255,255,.86);
  cursor:pointer;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
  font-size: 14px;
  user-select: none;
}
.chip:hover{ transform: translateY(-1px); background: rgba(255,255,255,.06); }
.chip.is-active{
  border-color: rgba(221,203,44,.38);
  background: rgba(221,203,44,.12);
}

/* Gallery */
.gallery-grid{
  margin-top: 18px;
  display:grid;
  gap: 14px;
  grid-template-columns: repeat(12, 1fr);
}
.gallery-item{ grid-column: span 6; }
@media (min-width: 900px){ .gallery-item{ grid-column: span 4; } }

.gallery-btn{
  width:100%;
  border:0;
  padding:0;
  background: transparent;
  cursor:pointer;
  text-align:left;
}

.thumb{
  border-radius: var(--radius2);
  overflow:hidden;
  border: 1px solid rgba(255,255,255,.08);
  background: #0F0F0F;
  position: relative;
}
.thumb img{
  width:100%;
  height:auto;
  display:block;
  transform: translateZ(0);
  transition: transform .25s ease, opacity .25s ease;
}
.gallery-btn:hover img{ transform: scale(1.02); opacity: .96; }

.thumb::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(to bottom, transparent 55%, rgba(0,0,0,.42));
  opacity: .0;
  transition: opacity .25s ease;
}
.gallery-btn:hover .thumb::after{ opacity: 1; }

.gallery-cap{
  display:grid;
  gap: 4px;
  margin-top: 10px;
  padding: 0 2px;
}
.cap-title{
  font-weight: 650;
  letter-spacing: .1px;
  line-height:1.2;
}
.cap-meta{
  color: var(--muted);
  font-size: 14px;
  line-height: 1.2;
}

/* Footer */
.footer{
  margin-top: 18px;
  padding: 14px 2px 0;
  color: var(--muted);
  font-size: 14px;
  display:flex;
  justify-content:space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line2);
}

/* Lightbox */
.lightbox{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 999;
}
.lightbox.is-open{ display:block; }

.lb-backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.70);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.lb-dialog{
  position: relative;
  width: min(1100px, calc(100% - 24px));
  margin: 5vh auto;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(14,14,14,.88);
  box-shadow: 0 40px 120px rgba(0,0,0,.75);
  overflow:hidden;
}

.lb-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap: 12px;
  padding: 14px 14px 0;
}

.lb-left{ min-width: 0; }
.lb-title{
  margin:0;
  font-size: 18px;
  font-weight: 700;
}
.lb-desc{
  margin:6px 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
  max-width: 80ch;
}

.lb-actions{
  display:flex;
  gap: 8px;
  align-items:center;
}

.lb-close, .lb-nav{
  border:0;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  cursor:pointer;
  font-size: 20px;
  line-height: 1;
  display:grid;
  place-items:center;
  transition: transform .18s ease, background .18s ease;
}
.lb-close:hover, .lb-nav:hover{ transform: translateY(-1px); background: rgba(255,255,255,.10); }

.lb-body{
  padding: 14px;
  display:grid;
  gap: 12px;
}

.lb-media{
  border-radius: 14px;
  overflow:hidden;
  border: 1px solid rgba(255,255,255,.08);
  background: #0F0F0F;
}
.lb-media img{
  width:100%;
  height:auto;
  display:block;
}

/* Scroll lock helper */
body.is-locked{ overflow:hidden; }

@media (prefers-reduced-motion: reduce){
  *{ transition:none !important; scroll-behavior:auto !important; }
}

/* --- FIX: títulos y captions más legibles --- */
.gallery-btn{
  display:block;              /* asegura layout correcto */
  width:100%;
  text-align:left;
}

.gallery-cap{
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0,0,0,.35);              /* fondo para legibilidad */
  border: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.cap-title{
  color: rgba(255,255,255,.95);             /* blanco real */
  font-weight: 750;
  letter-spacing: .2px;
  font-size: 15px;
  line-height: 1.15;
}

.cap-meta{
  color: rgba(255,255,255,.72);             /* meta más visible */
  font-size: 13px;
  line-height: 1.2;
}

/* ===== Lightbox FULLSCREEN (PRIORIDAD VERTICAL) ===== */
.lightbox{
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
}
.lightbox.is-open{ display: block; }

.lb-dialog{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 0;
  border: 0;
  background: rgba(10,10,10,.92);
  box-shadow: none;
  overflow: hidden;
}

.lb-top{
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 14px 14px 10px;
  background: linear-gradient(to bottom, rgba(10,10,10,.92), rgba(10,10,10,.55));
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.lb-body{
  height: calc(100vh - 72px); /* alto disponible bajo el header */
  padding: 0;
}

.lb-media{
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden; /* recorta laterales si hace falta */
}

/* CLAVE: ajusta por altura (vertical), no por ancho */
.lb-media img{
  height: 100%;
  width: auto;
  max-width: none;     /* para que no limite el ancho */
  object-fit: cover;   /* por si el navegador aplica algo */
  display: block;
}
/* ===== Mobile: galería en 1 columna ===== */
@media (max-width: 640px){
  .gallery-grid{
    grid-template-columns: 1fr;  /* una sola columna */
    gap: 14px;
  }

  .gallery-item{
    grid-column: auto;           /* anula el span 6/4 */
  }

  /* opcional: cards un pelín más grandes y cómodas */
  .thumb{
    border-radius: 18px;
  }

  .gallery-cap{
    padding: 12px 14px;
  }
}
/* ===== Mobile: lightbox SIN recorte ===== */
@media (max-width: 768px){

  .lb-media{
    overflow: hidden; /* mantiene limpio el contenedor */
  }

  /* CLAVE: en mobile usamos CONTAIN */
  .lb-media img{
    width: 100%;
    height: 100%;
    object-fit: contain;   /* 👈 NO recorta */
    object-position: center;
    max-width: 100%;
    max-height: 100%;
  }
}
