/* ============================================================
   GALLERIA — instagram grid + lightbox
   ============================================================ */

.page-head {
  padding: 130px 0 30px;
  text-align: center;
  position: relative;
  z-index: 50;
}
.page-title { font-size: clamp(2.6rem, 7vw, 4.6rem); font-weight: 300; }
.page-title em { font-style: normal; font-weight: 400; color: var(--rose-600); font-size: 1.05em; }
.page-sub { font-size: 1.05rem; max-width: 540px; margin: 14px auto 0; }

/* Filter pills */
.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.4);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border: .5px solid rgba(255,255,255,.65);
  max-width: max-content;
  margin-left: auto;
  margin-right: auto;
}
.filter-pill {
  border: 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: transparent;
  color: var(--rose-ink);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .25s var(--ease);
}
.filter-pill:hover { background: rgba(255,255,255,.55); }
.filter-pill.active {
  background: linear-gradient(135deg, var(--rose-400), var(--rose-500));
  color: #fff;
  box-shadow: 0 6px 14px -6px rgba(217,71,122,.55);
}

/* Instagram grid */
.ig-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
@media (min-width: 760px)  { .ig-grid { gap: 8px; grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .ig-grid { gap: 12px; grid-template-columns: repeat(3, 1fr); } }

.gtile {
  position: relative;
  border: 0;
  padding: 0;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: transparent;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
@media (min-width: 760px) { .gtile { border-radius: 14px; } }
.gtile:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -12px rgba(217,71,122,.45); }
.gtile-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
}
.gtile-shine {
  position: absolute; inset: 0;
  background:
    radial-gradient(40% 30% at 30% 25%, rgba(255,255,255,.45), transparent 70%),
    radial-gradient(30% 25% at 75% 80%, rgba(255,255,255,.25), transparent 70%);
}
.gtile-hover {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  background: linear-gradient(180deg, transparent 40%, rgba(74,31,46,.55) 100%);
  color: #fff;
  opacity: 0;
  transition: opacity .3s var(--ease);
  padding: 20px;
}
.gtile:hover .gtile-hover { opacity: 1; }
.gtile-hover .script { font-size: 1.6rem; }
.gtile-hover small { font-size: .8rem; opacity: .85; letter-spacing: .04em; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .25s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox-bg {
  position: absolute; inset: 0;
  background: rgba(74,31,46,.55);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
}
.lb-close, .lb-prev, .lb-next {
  position: absolute; z-index: 2;
  width: 50px; height: 50px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,.85);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--rose-ink);
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s, background .2s;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: #fff; transform: scale(1.05); }
.lb-close { top: 20px; right: 20px; }
.lb-prev  { left: 20px; top: 50%; transform: translateY(-50%); }
.lb-next  { right: 20px; top: 50%; transform: translateY(-50%); }
.lb-prev:hover { transform: translateY(-50%) scale(1.05); }
.lb-next:hover { transform: translateY(-50%) scale(1.05); }

.lb-stage {
  position: relative; z-index: 1;
  width: min(1100px, 92vw);
  max-height: 88vh;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  animation: lbIn .35s var(--ease);
}
@keyframes lbIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }

.lb-card {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(255,255,255,.65);
}
.lb-photo {
  position: relative;
  aspect-ratio: 4 / 5;
  background: #FBE9F0;
  overflow: hidden;
}
.lb-photo img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block;
}
.lb-photo-fallback {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
}
.lb-meta {
  padding: 36px;
  display: flex; flex-direction: column; justify-content: space-between;
  gap: 24px;
}
.lb-tag { font-size: 3rem; color: var(--rose-600); line-height: 1; margin: 0; }
.lb-actions { display: flex; flex-direction: column; gap: 10px; }
.lb-counter {
  color: rgba(255,255,255,.85);
  font-size: .85rem; letter-spacing: .14em; text-transform: uppercase;
}

@media (max-width: 760px) {
  /* Lightbox stacks photo on top, meta below. Photo capped to leave room for description. */
  .lb-card { grid-template-columns: 1fr; }
  .lb-photo {
    aspect-ratio: auto;
    height: 56vh;
    max-height: 56vh;
  }
  .lb-photo img { object-fit: cover; }
  .lb-meta {
    padding: 22px 22px 24px;
    gap: 16px;
  }
  .lb-tag { font-size: 1.9rem; }
  .lb-actions { gap: 8px; }
  .lb-actions .btn { padding: 13px 20px; font-size: .92rem; }
  .lb-close { top: 10px; right: 10px; width: 42px; height: 42px; }
  .lb-prev  { left: 6px; width: 42px; height: 42px; font-size: 22px; }
  .lb-next  { right: 6px; width: 42px; height: 42px; font-size: 22px; }
  .lb-stage {
    max-height: 94vh;
    width: 94vw;
    gap: 10px;
  }
  /* Allow meta area to scroll independently if it doesn't fit */
  .lb-card { max-height: calc(94vh - 36px); overflow-y: auto; }
  /* Hide "Voglio questo" button in lightbox on mobile — keep only Prenota for a lighter UX */
  .lb-actions .btn-primary { display: none; }
}

/* Mobile category dropdown — shown <760px in place of the pills */
.filters-mobile { display: none; margin-top: 24px; }
@media (max-width: 760px) {
  .filters { display: none; }
  .filters-mobile { display: block; }
}

.filter-dd {
  position: relative;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  z-index: 60;
}
.filter-dd.open { z-index: 70; }
.filter-dd-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 14px 20px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,.75), rgba(255,225,235,.55));
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  backdrop-filter: blur(18px) saturate(170%);
  box-shadow:
    0 1px 0 rgba(255,255,255,.7) inset,
    0 0 0 .5px rgba(74,31,46,.06),
    0 10px 26px -10px rgba(217,71,122,.35);
  border: .5px solid rgba(255,255,255,.7);
  color: var(--rose-ink);
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition: transform .2s var(--ease), box-shadow .25s var(--ease);
}
.filter-dd-trigger:active { transform: scale(.985); }
.filter-dd-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.filter-dd-kicker {
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--rose-500);
}
.filter-dd-label b {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--rose-ink);
  line-height: 1.1;
  letter-spacing: -0.005em;
}
.filter-dd-chev {
  font-size: 18px;
  color: var(--rose-500);
  flex-shrink: 0;
  transition: transform .3s var(--ease);
  margin-right: 4px;
}
.filter-dd.open .filter-dd-chev { transform: rotate(-180deg); }

.filter-dd-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  z-index: 80;
  max-height: 60vh;
  overflow-y: auto;
  border-radius: 18px;
  padding: 6px;
  background: rgba(255,255,255,.85);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: .5px solid rgba(255,255,255,.8);
  box-shadow:
    0 1px 0 rgba(255,255,255,.7) inset,
    0 20px 40px -12px rgba(74,31,46,.28);
  opacity: 0;
  transform: translateY(-8px) scale(.98);
  transform-origin: top center;
  pointer-events: none;
  transition: opacity .22s var(--ease), transform .25s var(--ease);
}
.filter-dd.open .filter-dd-menu {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.filter-dd-opt {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--rose-ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.filter-dd-opt:hover { background: rgba(248,187,208,.25); }
.filter-dd-opt.active {
  background: linear-gradient(135deg, var(--rose-400), var(--rose-500));
  color: #fff;
}
.filter-dd-check {
  font-size: .85rem;
  font-weight: 600;
}
.ig-sentinel {
  height: 1px;
  width: 100%;
  grid-column: 1 / -1;
}
.ig-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 36px 0;
  color: var(--muted);
  font-size: .85rem;
  letter-spacing: .04em;
}
.ig-loading .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--rose-400);
  animation: igpulse 1.4s ease-in-out infinite;
}
.ig-loading .dot:nth-child(2) { animation-delay: .2s; }
.ig-loading .dot:nth-child(3) { animation-delay: .4s; }
@keyframes igpulse {
  0%, 80%, 100% { opacity: .3; transform: scale(.7); }
  40% { opacity: 1; transform: scale(1); }
}

/* Fade-in for tiles as they load incrementally */
.gtile { animation: tileIn .55s var(--ease) both; }
@keyframes tileIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
