/* Galería editorial — blog y actividades */
.content-gallery--editorial {
  margin: 2.75rem 0 3rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border-radius: 1.35rem;
  border: 1px solid #e2e8f0;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(62, 163, 93, 0.07), transparent 55%),
    linear-gradient(165deg, #f8fafc 0%, #fff 45%, #f1f5f9 100%);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.06);
}

.content-gallery__head {
  margin-bottom: 1.35rem;
  max-width: 36rem;
}

.content-gallery__kicker {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.45rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748b;
}

.content-gallery__kicker span {
  width: 28px;
  height: 2px;
  background: linear-gradient(90deg, #3ea35d, rgba(62, 163, 93, 0.2));
  border-radius: 2px;
}

.content-gallery__head h2 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.content-gallery__lead {
  margin: 0;
  font-size: 0.875rem;
  color: #64748b;
}

.content-gallery__preview-hint {
  margin: 0.65rem 0 0;
  font-size: 0.8125rem;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 0.65rem;
  padding: 0.5rem 0.75rem;
}

.content-gallery__grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, 1fr);
}

.content-gallery__item {
  position: relative;
  margin: 0;
  min-height: 0;
}

.content-gallery__tile {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 148px;
  padding: 0;
  border: 0;
  border-radius: 1rem;
  overflow: hidden;
  cursor: zoom-in;
  background: #cbd5e1;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.content-gallery__tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
}

.content-gallery__tile:focus-visible {
  outline: 3px solid #3ea35d;
  outline-offset: 3px;
}

.content-gallery__tile img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.content-gallery__tile:hover img {
  transform: scale(1.07);
}

.content-gallery__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.55) 0%, transparent 45%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.content-gallery__tile:hover .content-gallery__shade {
  opacity: 1;
}

.content-gallery__zoom {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(6px);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.content-gallery__zoom svg {
  width: 18px;
  height: 18px;
}

.content-gallery__tile:hover .content-gallery__zoom {
  opacity: 1;
  transform: translateY(0);
}

.content-gallery__caption {
  position: absolute;
  left: 12px;
  right: 52px;
  bottom: 12px;
  z-index: 1;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.content-gallery__tile:hover .content-gallery__caption {
  opacity: 1;
  transform: translateY(0);
}

.content-gallery__item--hidden .content-gallery__tile {
  outline: 2px dashed #94a3b8;
  outline-offset: 3px;
}

.content-gallery__item--hidden .content-gallery__tile img {
  opacity: 0.62;
}

.content-gallery__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Mosaic layouts (desktop) */
@media (min-width: 768px) {
  .content-gallery__grid {
    gap: 0.85rem;
    grid-auto-rows: minmax(160px, 1fr);
  }

  .content-gallery__grid[data-count="1"] {
    grid-template-columns: 1fr;
  }

  .content-gallery__grid[data-count="1"] .content-gallery__tile {
    min-height: clamp(280px, 42vh, 480px);
  }

  .content-gallery__grid[data-count="2"] {
    grid-template-columns: 1fr 1fr;
  }

  .content-gallery__grid[data-count="2"] .content-gallery__tile {
    min-height: clamp(220px, 32vh, 360px);
  }

  .content-gallery__grid[data-count="3"] {
    grid-template-columns: 1.35fr 1fr;
    grid-template-rows: 1fr 1fr;
  }

  .content-gallery__grid[data-count="3"] .content-gallery__item:first-child {
    grid-row: span 2;
  }

  .content-gallery__grid[data-count="3"] .content-gallery__item:first-child .content-gallery__tile {
    min-height: 100%;
  }

  .content-gallery__grid[data-count="4"] {
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(2, minmax(180px, 1fr));
  }

  .content-gallery__grid[data-count="4"] .content-gallery__item:nth-child(1) {
    grid-column: span 7;
    grid-row: span 2;
  }

  .content-gallery__grid[data-count="4"] .content-gallery__item:nth-child(2) {
    grid-column: span 5;
  }

  .content-gallery__grid[data-count="4"] .content-gallery__item:nth-child(3) {
    grid-column: span 5;
  }

  .content-gallery__grid[data-count="4"] .content-gallery__item:nth-child(4) {
    grid-column: span 12;
  }

  .content-gallery__grid[data-count="4"] .content-gallery__item:nth-child(4) .content-gallery__tile {
    min-height: 200px;
  }

  .content-gallery__grid[data-count="5"] {
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(2, minmax(170px, 1fr));
  }

  .content-gallery__grid[data-count="5"] .content-gallery__item:nth-child(1) {
    grid-column: span 7;
    grid-row: span 2;
  }

  .content-gallery__grid[data-count="5"] .content-gallery__item:nth-child(n + 2) {
    grid-column: span 5;
  }

  .content-gallery__grid[data-count="6"] {
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(3, minmax(150px, 1fr));
  }

  .content-gallery__grid[data-count="6"] .content-gallery__item:nth-child(1) {
    grid-column: span 8;
    grid-row: span 2;
  }

  .content-gallery__grid[data-count="6"] .content-gallery__item:nth-child(2),
  .content-gallery__grid[data-count="6"] .content-gallery__item:nth-child(3) {
    grid-column: span 4;
  }

  .content-gallery__grid[data-count="6"] .content-gallery__item:nth-child(n + 4) {
    grid-column: span 4;
  }

  .content-gallery__grid[data-count]:not([data-count="1"]):not([data-count="2"]):not([data-count="3"]):not([data-count="4"]):not([data-count="5"]):not([data-count="6"]) {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(180px, auto);
  }

  .content-gallery__grid[data-count]:not([data-count="1"]):not([data-count="2"]):not([data-count="3"]):not([data-count="4"]):not([data-count="5"]):not([data-count="6"]) .content-gallery__item:first-child {
    grid-column: span 2;
    grid-row: span 2;
  }
}

@media (max-width: 767px) {
  .content-gallery__grid[data-count="1"] .content-gallery__tile {
    min-height: 240px;
  }
}

/* Lightbox */
.content-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem 2rem;
  color: #fff;
}

.content-gallery-lightbox.is-open {
  display: flex;
}

.content-gallery-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 16, 0.94);
  backdrop-filter: blur(8px);
}

.content-gallery-lightbox__header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.content-gallery-lightbox__close,
.content-gallery-lightbox__nav {
  border: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  border-radius: 999px;
  transition: background 0.2s ease;
}

.content-gallery-lightbox__close {
  width: 42px;
  height: 42px;
  font-size: 1.25rem;
}

.content-gallery-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 48px;
  height: 48px;
  font-size: 2rem;
  line-height: 1;
}

.content-gallery-lightbox__nav--prev { left: 0.75rem; }
.content-gallery-lightbox__nav--next { right: 0.75rem; }

.content-gallery-lightbox__close:hover,
.content-gallery-lightbox__nav:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.22);
}

.content-gallery-lightbox__nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.content-gallery-lightbox__figure {
  position: relative;
  z-index: 1;
  max-width: min(1100px, 100%);
  max-height: calc(100vh - 6rem);
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.content-gallery-lightbox__img {
  max-width: 100%;
  max-height: calc(100vh - 8rem);
  object-fit: contain;
  border-radius: 0.65rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.content-gallery-lightbox__figure figcaption {
  margin-top: 0.75rem;
  max-width: 42rem;
  text-align: center;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.5;
}
