/* MINI GALLERY */
.mini-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.mini-gallery .g-item {
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 4 / 3;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: var(--bg-2);
}

.mini-gallery .g-item:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow);
}

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

.mini-gallery .g-item .g-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px 16px 16px;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.7) 100%);
  color: #fff;
}

.mini-gallery .g-item .g-overlay span {
  font-weight: 700;
  font-size: 16px;
  display: block;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* GALLERY FILTERS */
.gallery-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 28px 0 24px;
}

.filter-btn {
  padding: 9px 18px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 700;
  font-size: 13.5px;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
}

.filter-btn:hover { border-color: var(--brand); color: var(--brand); }
.filter-btn.active {
  background: var(--brand-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(47,166,160,.28);
}
.filter-btn.active:hover { color: #fff; }

/* GALLERY SECTIONS */
.gallery-sections-wrap {
  display: flex;
  flex-direction: column;
  gap: 40px;
  margin-top: 8px;
}

.gallery-section-title {
  font-size: 19px;
  font-weight: 800;
  margin: 0 0 16px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.gallery-section-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 900px) {
  .gallery-section-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .gallery-section-grid { grid-template-columns: 1fr; }
}

.gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform .25s cubic-bezier(.16,.84,.44,1), box-shadow .25s, border-color .25s;
  cursor: pointer;
}

.gallery-item:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand);
}

.gallery-item img,
.gallery-item video,
.thumb-wrap img,
.thumb-wrap video {
  transition: transform .5s cubic-bezier(.16,.84,.44,1);
}

.gallery-item:hover img,
.gallery-item:hover video,
.gallery-item:hover .thumb-wrap img,
.gallery-item:hover .thumb-wrap video {
  transform: scale(1.06);
}

.thumb-wrap { overflow: hidden; }

.gallery-item img,
.gallery-item video {
  width: 100%;
  display: block;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.gallery-item .video-wrapper,
.gallery-item .embed-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}

.gallery-item .video-wrapper iframe,
.gallery-item .embed-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.gallery-item .item-caption {
  padding: 14px 16px;
  background: var(--surface);
}

.gallery-item .item-caption h4 { font-size: 15px; margin: 0 0 4px; }
.gallery-item .item-caption p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.thumb-wrap {
  position: relative;
}

.thumb-wrap img,
.thumb-wrap video,
.thumb-wrap .gallery-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}

.thumb-wrap .platform-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  margin-bottom: 0;
}

.thumb-wrap .play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.gallery-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 34px;
}

.platform-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.platform-badge.youtube { background: #FF0000; color: #fff; }
.platform-badge.tiktok { background: #000; color: #fff; }
.platform-badge.facebook { background: #1877F2; color: #fff; }
.platform-badge.instagram { background: #E4405F; color: #fff; }
.platform-badge.image { background: var(--bg-2); color: var(--muted); }
.platform-badge.video { background: var(--medicina-soft); color: var(--medicina); }

.loading-spinner {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 15px;
  grid-column: 1/-1;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  grid-column: 1/-1;
}

.gallery-load-more {
  text-align: center;
  margin-top: 32px;
}

.embed-16x9 {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #0c1720;
}

.embed-16x9 iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.embed-tiktok {
  display: flex;
  justify-content: center;
}

.embed-tiktok iframe {
  width: 325px;
  height: 735px;
  max-width: 100%;
  border: 0;
  border-radius: 12px;
}