/* SREF Gallery — TischEins */

/* Remove the uk-container-small (900px) constraint on the gallery article page */
#article-62 .uk-container-small {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

#sref-gallery-wrap * { box-sizing: border-box; }
#sref-gallery-wrap {
  font-family: inherit;
  width: 100%;
}

/* Sticky Nav */
#sref-nav {
  position: sticky;
  top: 80px;
  z-index: 980;
  background: rgb(29, 28, 43);
  padding: 12px calc(50vw - 50%) 10px;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
#sref-search-wrap { margin-bottom: 10px; }
#sref-search {
  width: 100%;
  max-width: 420px;
  padding: 8px 16px;
  background: #1e1e1e;
  border: 1px solid #3a3a3a;
  border-radius: 20px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
#sref-search::placeholder { color: #666; }
#sref-search:focus { border-color: #666; }

/* Category Buttons */
#sref-cat-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.sref-cat-btn {
  padding: 5px 16px;
  background: transparent;
  border: 1px solid #3a3a3a;
  border-radius: 20px;
  color: #999;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
}
.sref-cat-btn:hover { border-color: #666; color: #fff; }
.sref-cat-btn.active {
  background: #fff;
  border-color: #fff;
  color: #000;
  font-weight: 600;
}
#sref-count {
  font-size: 12px;
  color: #555;
  margin-top: 8px;
}

/* Grid */
#sref-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 639px) { #sref-grid { grid-template-columns: repeat(1, 1fr); } }

/* Grid Item */
.sref-item {
  position: relative;
  cursor: pointer;
  border-radius: 3px;
  background: #1a1a1a;
  display: flex;
  flex-direction: column;
}
.sref-img-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 3px 3px 0 0;
}
.sref-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.sref-item:hover img { transform: scale(1.06); }

/* Tag pills below image */
.sref-tag-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 6px 4px;
  min-height: 28px;
}
.sref-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(255,255,255,0.1);
  color: #aaa;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Hover Overlay */
.sref-overlay {
  position: absolute;
  inset: 0;
  border-radius: 3px 3px 0 0;
  background: rgba(0, 0, 0, 0.78);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.22s;
  gap: 10px;
  padding: 12px;
}
.sref-item:hover .sref-overlay { opacity: 1; }
.sref-code-text {
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
  word-break: break-all;
}
.sref-copy-btn {
  padding: 5px 14px;
  background: #fff;
  color: #000;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  font-family: inherit;
}
.sref-copy-btn:hover { background: #e0e0e0; }
.sref-copy-btn.copied { background: #4caf50 !important; color: #fff !important; }

/* Lightbox */
#sref-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.94);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
}
#sref-lightbox.open { display: flex; }
#sref-lb-img {
  max-width: 88vw;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 60px rgba(0, 0, 0, 0.8);
}
#sref-lb-code {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
#sref-lb-copy {
  padding: 8px 22px;
  background: #fff;
  color: #000;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}
#sref-lb-copy:hover { background: #e0e0e0; }
#sref-lb-copy.copied { background: #4caf50 !important; color: #fff !important; }
#sref-lb-close {
  position: fixed;
  top: 18px;
  right: 22px;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
#sref-lb-close:hover { background: rgba(255,255,255,0.2); }
.sref-lb-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 30px;
  cursor: pointer;
  padding: 14px 18px;
  border-radius: 4px;
  transition: background 0.2s;
  line-height: 1;
}
.sref-lb-nav:hover { background: rgba(255, 255, 255, 0.22); }
#sref-lb-prev { left: 10px; }
#sref-lb-next { right: 10px; }

#sref-no-results {
  color: #666;
  padding: 60px 0;
  text-align: center;
  display: none;
  font-size: 16px;
}

/* Meta-Zeile "Written by..." auf der Galerie-Seite verstecken */
#article-62 .uk-article-meta { display: none; }

/* Seiten-Titel (uk-article-title) auf der Galerie-Seite verstecken */
#article-62 h1.uk-article-title { display: none; }

/* PIB-Grafik oben rechts auf der Galerie-Seite */
#article-62 {
  position: relative;
}
#sref-pib {
  position: absolute;
  top: -60px;
  right: 160px;
  width: 346px;
  pointer-events: none;
  z-index: 10;
}
@media (max-width: 959px) {
  #sref-pib { display: none; }
}

/* Lightbox Copy-Button: Site-Hintergrund + Theme-Orange */
#sref-lb-copy {
  background: rgb(29, 28, 43);
  color: rgb(255, 184, 48);
  border: 1px solid rgb(255, 184, 48);
  font-weight: 600;
  letter-spacing: 0.03em;
}
#sref-lb-copy:hover {
  background: rgb(255, 184, 48);
  color: rgb(29, 28, 43);
}

/* ---- Sort Dropdown ---- */
#sref-sort-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 8px;
}
#sref-sort-btn {
  background: transparent;
  border: 1px solid rgba(255,184,48,0.4);
  color: rgb(255,184,48);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, border-color 0.15s;
}
#sref-sort-btn:hover {
  background: rgba(255,184,48,0.1);
  border-color: rgb(255,184,48);
}
#sref-sort-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: rgb(29,28,43);
  border: 1px solid rgba(255,184,48,0.25);
  border-radius: 10px;
  overflow: hidden;
  z-index: 200;
  min-width: 150px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
#sref-sort-dropdown.open { display: block; }
.sref-sort-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: #ccc;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.sref-sort-item:hover { background: rgba(255,184,48,0.1); color: #fff; }
.sref-sort-item.active { color: rgb(255,184,48); font-weight: 600; }

/* ---- Tag bar layout: tags left, heart right ---- */
.sref-tag-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 4px;
}
.sref-tags-left {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

/* ---- Heart Button ---- */
.sref-heart-wrap {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}
.sref-heart-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: rgba(255,255,255,0.35);
  line-height: 1;
  padding: 2px 0;
  transition: color 0.15s, transform 0.1s;
}
.sref-heart-btn:hover { color: rgb(255,184,48); transform: scale(1.2); }
.sref-heart-btn.liked { color: rgb(255,184,48); }
.sref-like-count {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  min-width: 14px;
}
.sref-heart-btn.liked + .sref-like-count { color: rgb(255,184,48); }
