/* BASE */
body {
  margin: 0;
  font-family: "Times", "Times New Roman", serif;
  font-size: 13px;
  line-height: 1.2;
  letter-spacing: 0.01em;
  background: #fff;
  color: #000;
  cursor: crosshair;
}

html,
body {
  cursor: crosshair;
}

/* LINKS */
a {
  color: #000;
  text-decoration: underline;
}

a:visited {
  color: #000;
}

/* HEADER */
.site-header {
  position: static;
  top: 0;
  left: 0;
  padding: 0.4rem;
}

/* TEXT */
.site-content {
  padding: 0.4rem 0.4rem 0 0.4rem;
  max-width: 45rem;
}

.text p {
  margin: 0 0 0.8rem 0;
}

/* GALLERY FIXED */
.gallery {
  width: 100%;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
  margin-top: 3rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.custom-gallery {
  display: grid;
  grid-template-columns: repeat(21, 1fr);
  gap: 0.4rem;
}

@media (max-width: 768px) {
  .custom-gallery {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* ITEMS */
.gallery-item {
  width: 100%;
  display: block;
  filter: grayscale(100%);
  mix-blend-mode: darken;
  user-select: none;
  cursor: pointer;
}

/* HOVER */
@media (hover: hover) and (pointer: fine) {
  .gallery-item:hover {
    filter: none;
    mix-blend-mode: normal;
  }
}

/* LIGHTBOX */
.custom-lightbox {
  --lb-margin: 0.4rem;
}

.custom-lightbox {
  position: fixed;
  inset: 0;
  background: #000;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 2rem;
  box-sizing: border-box;

  z-index: 999;
}

/* HEADER LIGHTBOX */
.lb-header {
  position: fixed;
  top: 0.4rem;
  left: 0.4rem;

  font-family: "Times", "Times New Roman", serif;
  font-size: 13px;
  line-height: 1.2;
  letter-spacing: 0.01em;

  color: #fff;
  z-index: 1000;

  user-select: none;
}

.custom-lightbox[hidden] {
  display: none;
}

.custom-lightbox img,
.custom-lightbox video {
  max-width: calc(100vw - (var(--lb-margin) * 2));
  max-height: calc(100vh - (var(--lb-margin) * 2));
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* CONTROLS */
.lb-prev,
.lb-next,
.lb-close {
  position: fixed;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.lb-prev {
  left: 10vw;
  top: 52%;
}

.lb-next {
  right: 10vw;
  top: 52%;
}

.lb-close {
  top: 0.4rem;
  right: 0.4rem;
}

/* =========================================
   DESKTOP (GALLERY FIXED)
========================================= */

@media (min-width: 769px) {

  .gallery {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 1.6rem;

    padding-left: 0.4rem;
    padding-right: 0.4rem;

    z-index: 10;
    background: #ffffff;
  }

@media (max-width: 768px) {

  .custom-lightbox img,
  .custom-lightbox video {
    width: 100%;
    max-width: 100%;
    height: auto;
  }

  /* 🔴 CLAVE: solo para vídeo */
  .custom-lightbox video {
    object-fit: cover;
    max-height: 70vh;
  }
}

  body {
    padding-bottom: 10rem;
  }
}

@media (max-width: 768px) {
  .gallery {
    position: static;
    margin-top: 2rem;
  }
}

/* =========================
   FONT RENDERING
========================= */

html, body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* =========================
   PLACEHOLDER FOR GALLERY ITEMS
========================= */

.gallery-item {
  background: #e5e5e5;
}

/* images */
.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
}

/* videos */
.gallery-item video {
  display: block;
  width: 100%;
  height: auto;
}

/* without flashes */
.gallery-item {
  overflow: hidden;
}

/* FOOTER */
.site-footer {
  padding: 0.4rem;
  font-size: 13px;
}

/* GALLERY HEIGHT */
@media (min-width: 769px) {
  .gallery-spacer {
    height: 9rem;
  }
}

@media (min-width: 769px) {

  .site-footer {
    position: fixed;
    left: 0.4rem;
    bottom: 0.4rem;
    padding: 0;
    z-index: 11;
  }
}

@media (max-width: 768px) {
  .site-footer {
    position: static !important;
    margin-top: 1.2rem;
    padding: 0.4rem;
  }
}

@media (max-width: 768px) {

  /* LIGHTBOX */
  .custom-lightbox {
    padding: 1rem;
  }

  /* Center image */
  .custom-lightbox img {
    max-width: 97vw;
    max-height: 70vh;
  }

  /* Navigation */
  .lb-prev,
  .lb-next {
    top: auto;
    bottom: 3rem;
    transform: none;
  }

  .lb-prev {
    left: 0.4rem;
  }

  .lb-next {
    right: 0.4rem;
  }
}

.custom-lightbox {
  touch-action: pan-x pan-y;
}

.custom-lightbox *,
.lb-prev,
.lb-next,
.lb-close {
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

a {
  color: #000;
  text-decoration: none;
  position: relative;
}

a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
  a:hover::after {
    animation: underline-blink 0.8s ease-in-out infinite;
  }
}

@keyframes underline-blink {
  0%   { opacity: 1; }
  35%  { opacity: 0; }
  55%  { opacity: 0; }
  100% { opacity: 1; }
}

/* =========================
   LIGHTBOX — BASE
========================= */

.custom-lightbox {
  --lb-margin: 0.4rem;

  position: fixed;
  inset: 0;
  background: #000;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: var(--lb-margin);
  box-sizing: border-box;

  z-index: 999;
}

.custom-lightbox[hidden] {
  display: none;
}

/* Imagen y vídeo */
.custom-lightbox img,
.custom-lightbox video {
  max-width: calc(100vw - (var(--lb-margin) * 2));
  max-height: calc(100vh - (var(--lb-margin) * 2));
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* =========================
   CONTROLS — BASE
========================= */

.lb-prev,
.lb-next,
.lb-close {
  position: fixed;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

/* Close */
.lb-close {
  top: var(--lb-margin);
  right: var(--lb-margin);
}

/* =========================
   DESKTOP (>= 769px)
========================= */

@media (min-width: 769px) {

  /* Botones alejados del margen (como antes) */
  .lb-prev {
    left: 10vw;
    top: 52%;
  }

  .lb-next {
    right: 10vw;
    top: 52%;
  }
}

/* =========================
   MÓVIL (<= 768px)
========================= */

@media (max-width: 768px) {

  .custom-lightbox {
    --lb-margin: 0.4rem;
  }

  .custom-lightbox img,
  .custom-lightbox video {
    max-width: calc(100vw - (var(--lb-margin) * 2));
    max-height: calc(100vh - (var(--lb-margin) * 2));
  }

  .lb-prev {
    left: var(--lb-margin);
    bottom: 3rem;
    top: auto;
  }

  .lb-next {
    right: var(--lb-margin);
    bottom: 3rem;
    top: auto;
  }
}

::selection {
  background-color: #e0e0e0; 
  color: #000000;            
}