/* ===== Halftone+ Embeddable Preset Gallery ===== */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: #000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #fff;
  min-height: 100vh;
  padding: 12px;
  overflow-x: hidden;
}

/* Thumbnail grid — always 4 columns */
#grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

@media (max-width: 600px) {
  #grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}

/* Individual card — just the thumbnail */
.embed-card {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: #111;
  transition: transform 0.15s, box-shadow 0.2s;
}
.embed-card:hover {
  transform: scale(1.03);
  box-shadow: 0 0 16px rgba(255,107,53,0.35);
}

.embed-card-thumb {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-size: cover;
  background-position: center;
  background-color: #111;
}

/* Hover overlay with name */
.embed-card-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 24px 8px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.embed-card:hover .embed-card-overlay {
  opacity: 1;
}
.embed-card-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}
.embed-card-author {
  font-size: 9px;
  color: rgba(255,255,255,0.5);
  margin-top: 2px;
}

/* Fallback placeholder */
.embed-card-placeholder {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.2;
}

/* States */
.state-msg {
  text-align: center;
  color: #555;
  font-size: 12px;
  padding: 30px 0;
  letter-spacing: 2px;
  font-weight: 700;
}

/* Load more button */
.load-more {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 16px auto;
  background: transparent;
  color: #555;
  border: 1px solid #222;
  padding: 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s, color 0.2s;
}
.load-more:hover {
  border-color: #ff6b35;
  color: #fff;
}

/* ===== Lightbox ===== */
.lightbox {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.lightbox.open {
  display: flex;
}
.lightbox-backdrop {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.9);
}
.lightbox-content {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  text-align: center;
}
.lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #222;
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: background 0.2s;
}
.lightbox-close:hover {
  background: #ff6b35;
}
.lightbox-img {
  width: 500px;
  height: 500px;
  max-width: 80vw;
  max-height: 70vh;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-color: #111;
  border-radius: 8px;
}
.lightbox-info {
  margin-top: 12px;
}
.lightbox-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
}
.lightbox-meta {
  font-size: 11px;
  color: #666;
  margin-top: 4px;
}
