/* ── Grid de tarjetas (masonry con columns) ─── */
.gallery-grid {
  columns: 2;
  column-gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.gallery-card {
  break-inside: avoid;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .gallery-grid {
    columns: 1;
  }
}

/* ── Tarjeta ─────────────────────────────────── */
.gallery-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.09), 0 1px 4px rgba(0,0,0,0.05);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: default;
  user-select: none;
  display: flex;
  flex-direction: column;
}

.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.15);
}

.dark .gallery-card {
  background: #1f2937;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

/* ── Grid de imágenes dentro de la tarjeta ───── */
.gallery-img-grid {
  display: grid;
  gap: 2px;
  border-bottom: 4px solid #f97316;
}

.gallery-img-grid-1 { grid-template-columns: 1fr; }
.gallery-img-grid-2 { grid-template-columns: 1fr 1fr; }
.gallery-img-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.gallery-img-grid-4 { grid-template-columns: 1fr 1fr; }

.gallery-img-link {
  overflow: hidden;
  display: block;
  position: relative;
  cursor: pointer;
}

.gallery-thumb {
  width: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.gallery-img-grid-1 .gallery-thumb { height: 24rem; }
.gallery-img-grid-2 .gallery-thumb,
.gallery-img-grid-3 .gallery-thumb { height: 16rem; }
.gallery-img-grid-4 .gallery-thumb { height: 14rem; }

.gallery-img-link:hover .gallery-thumb {
  transform: scale(1.05);
}

/* overlay +N */
.gallery-more-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Cuerpo de la tarjeta ────────────────────── */
.gallery-card-body {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.gallery-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.3;
  margin: 0;
}

.dark .gallery-card-title { color: #f9fafb; }

.gallery-card-desc {
  font-size: 0.95rem;
  color: #4b5563;
  line-height: 1.6;
  margin: 0;
}

.dark .gallery-card-desc { color: #d1d5db; }

.gallery-card-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f3f4f6;
}

.dark .gallery-card-footer { border-top-color: #374151; }

.gallery-card-date {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #ea580c;
  letter-spacing: 0.01em;
}

.dark .gallery-card-date {
  color: #fb923c;
}

/* ── Tags ────────────────────────────────────── */
.gallery-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.gallery-tag {
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  color: #c2410c;
  border: 1px solid #fed7aa;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  letter-spacing: 0.02em;
}

.dark .gallery-tag {
  background: linear-gradient(135deg, #431407, #7c2d12);
  color: #fed7aa;
  border-color: #9a3412;
}