@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;1,400&family=Outfit:wght@300;400;500&display=swap');

.gdg-wrap {
  --ink: #0f0f0f;
  --dust: #f5f3ef;
  --mist: #e8e4dc;
  --gold: #c9a96e;
  --gold-light: #e8d5b0;
  --smoke: #8a8278;

  font-family: 'Outfit', sans-serif;
  background: var(--dust);
  border-radius: 16px;
  padding: 36px 32px 32px;
  position: relative;
  overflow: hidden;
}

/* Reset acotado al widget, para no pisar el tema */
.gdg-wrap *,
.gdg-lightbox * { box-sizing: border-box; }
.gdg-wrap p { margin: 0; padding: 0; }

.gdg-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  border-radius: 16px;
}

.gdg-wrap > * { position: relative; z-index: 1; }

.gdg-eyebrow {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}

.gdg-title {
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.gdg-title em {
  font-style: italic;
  color: var(--smoke);
}

.gdg-subtitle {
  font-size: 12px;
  font-weight: 300;
  color: var(--smoke);
  margin-top: 6px;
  letter-spacing: 0.04em;
}

.gdg-count-pill {
  background: var(--mist);
  border: 1px solid var(--gold-light);
  color: var(--smoke);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.06em;
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
  align-self: flex-start;
}

.gdg-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}

/* ── GRID DE IMÁGENES ── */
.gdg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  max-height: 560px;
  overflow-y: auto;
  padding: 16px;
  background: white;
  border-radius: 10px;
  border: 1px solid var(--mist);
  box-shadow: 0 2px 20px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.6);
  scrollbar-width: thin;
  scrollbar-color: var(--gold-light) transparent;
}

.gdg-grid::-webkit-scrollbar { width: 4px; }
.gdg-grid::-webkit-scrollbar-track { background: transparent; }
.gdg-grid::-webkit-scrollbar-thumb { background: var(--gold-light); border-radius: 99px; }

.gdg-img-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--mist);
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gdg-img-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0,0,0,0.18);
}

.gdg-img-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gdg-img-item .gdg-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.45) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: flex-end;
  padding: 8px;
}

.gdg-img-item:hover .gdg-img-overlay {
  opacity: 1;
}

.gdg-img-overlay a {
  color: white;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
  background: rgba(255,255,255,0.15);
  padding: 4px 8px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

/* ── LIGHTBOX ── */
.gdg-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}

.gdg-lightbox.active {
  display: flex;
}

.gdg-lightbox img {
  max-width: 90vw;
  max-height: 88vh;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  object-fit: contain;
}

.gdg-lb-close {
  position: absolute;
  top: 20px;
  right: 24px;
  color: white;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
  background: none;
  border: none;
  font-family: inherit;
}
.gdg-lb-close:hover { opacity: 1; }

.gdg-lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.12);
  border: none;
  color: white;
  font-size: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  backdrop-filter: blur(4px);
}
.gdg-lb-nav:hover { background: rgba(255,255,255,0.25); }
.gdg-lb-prev { left: 20px; }
.gdg-lb-next { right: 20px; }

/* ── LOADING / ERROR ── */
.gdg-status {
  grid-column: 1 / -1;
  padding: 40px;
  text-align: center;
  color: var(--smoke);
  font-size: 13px;
  letter-spacing: 0.05em;
}

.gdg-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--mist);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: gdg-spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes gdg-spin { to { transform: rotate(360deg); } }

/* ── SCROLL HINT ── */
.gdg-scroll-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--smoke);
  letter-spacing: 0.05em;
  animation: gdg-hintpulse 2.4s ease-in-out infinite;
}
@keyframes gdg-hintpulse {
  0%, 100% { opacity: 0.5; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(2px); }
}
.gdg-scroll-hint svg { width: 12px; height: 12px; stroke: var(--gold); fill: none; stroke-width: 2; stroke-linecap: round; }

/* ── FOOTER ── */
.gdg-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--mist);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.gdg-meta {
  font-size: 11px;
  color: var(--smoke);
  font-weight: 300;
  letter-spacing: 0.04em;
}

.gdg-meta span {
  display: inline-block;
  width: 20px;
  height: 1px;
  background: var(--gold);
  vertical-align: middle;
  margin-right: 8px;
  margin-bottom: 1px;
}

.gdg-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 999px;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.07em;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-transform: uppercase;
}

.gdg-btn-fill {
  background: var(--ink);
  color: #fff;
  border: 1.5px solid var(--ink);
}
.gdg-btn-fill:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(201,169,110,0.35);
}

@media (prefers-reduced-motion: reduce) {
  .gdg-img-item, .gdg-btn, .gdg-img-overlay { transition: none; }
  .gdg-scroll-hint, .gdg-spinner { animation: none; }
}
