.mfb-gallery { width: 100%; }

.mfb-error {
  padding: 12px;
  border: 1px solid #ddd;
  background: #fff6f6;
}

.mfb-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 700px) {
  .mfb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .mfb-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.mfb-card {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  padding: 0;
  cursor: pointer;
}

.mfb-thumb {
  aspect-ratio: 4 / 3;
  background: #f2f2f2;
  overflow: hidden;
}

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

.mfb-meta { padding: 10px 12px 12px; }

.mfb-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}

.mfb-sub {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 4px;
}

/* Load more */
.mfb-actions {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.mfb-loadmore {
  border: 1px solid #e5e5e5;
  background: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
}

/* Inline album photos */
.mfb-inline[hidden] { display: none; }

.mfb-inline {
  margin-top: 18px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}

.mfb-inline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.mfb-inline-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.mfb-inline-close {
  border: 1px solid #e5e5e5;
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}

.mfb-photo-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (min-width: 700px) {
  .mfb-photo-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .mfb-photo-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}

.mfb-photo {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: #f2f2f2;
}

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

/* Lightbox */
.mfb-lightbox[hidden] { display: none; }

.mfb-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
}

.mfb-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
}

.mfb-lightbox-panel {
  position: absolute;
  inset: 5vh 4vw;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 10px;
}

.mfb-figure {
  margin: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  height: 100%;
}

.mfb-figure img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  margin: auto;
  display: block;
  border-radius: 10px;
}

.mfb-caption {
  color: #fff;
  font-size: 13px;
  padding: 10px 6px 0;
  text-align: center;
  opacity: 0.9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mfb-nav,
.mfb-x {
  appearance: none;
  border: 0;
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-radius: 10px;
  width: 44px;
  height: 44px;
  font-size: 28px;
  line-height: 44px;
  cursor: pointer;
}

.mfb-x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  font-size: 26px;
}

@media (max-width: 520px) {
  .mfb-lightbox-panel {
    grid-template-columns: 36px 1fr 36px;
    inset: 8vh 3vw;
  }
  .mfb-nav, .mfb-x {
    width: 36px;
    height: 36px;
    line-height: 36px;
  }
}

/* Loading toast */
.mfb-toast[hidden] { display: none; }

.mfb-toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  z-index: 100000;
  font-size: 13px;
}