/* WallpaperVault – Frontend Styles */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:wght@300;400;500&display=swap');

/* ── Variables (overrideable by shortcode accent) ───────────── */
.wv-gallery {
  --wv-accent:     #e8c547;
  --wv-bg:         #06060e;
  --wv-card-bg:    #0e0e1c;
  --wv-card-hover: #141428;
  --wv-border:     rgba(255,255,255,0.07);
  --wv-border-2:   rgba(255,255,255,0.13);
  --wv-text:       #f2f2ff;
  --wv-text-2:     rgba(242,242,255,0.55);
  --wv-text-3:     rgba(242,242,255,0.3);
  --wv-radius:     14px;
  --wv-radius-sm:  8px;
  --wv-font:       'Syne', sans-serif;
  --wv-font-body:  'DM Sans', sans-serif;
  --wv-shadow:     0 12px 40px rgba(0,0,0,0.6);
  --wv-cols:       3;

  font-family: var(--wv-font-body);
  color: var(--wv-text);
  background: transparent;
}
.wv-gallery * { box-sizing: border-box; }

/* ── Toolbar ─────────────────────────────────────────────────── */
.wv-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}

/* Filter Pills */
.wv-filter-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.wv-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--wv-border-2);
  color: var(--wv-text-2);
  font-family: var(--wv-font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.wv-pill:hover {
  border-color: var(--wv-accent);
  color: var(--wv-accent);
  background: rgba(var(--wv-accent-rgb, 232,197,71), 0.08);
}
.wv-pill--active {
  background: var(--wv-accent);
  border-color: var(--wv-accent);
  color: #000;
}
.wv-pill__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: rgba(0,0,0,0.2);
  font-size: 10px;
  font-weight: 700;
}
.wv-pill--active .wv-pill__count { background: rgba(0,0,0,0.25); }

/* Search */
.wv-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.wv-search-wrap svg {
  position: absolute;
  left: 14px;
  width: 16px; height: 16px;
  color: var(--wv-text-3);
  pointer-events: none;
}
.wv-search {
  padding: 10px 16px 10px 40px;
  background: var(--wv-card-bg);
  border: 1px solid var(--wv-border-2);
  border-radius: 999px;
  color: var(--wv-text);
  font-family: var(--wv-font-body);
  font-size: 14px;
  width: 240px;
  transition: all 0.25s;
}
.wv-search:focus {
  outline: none;
  border-color: var(--wv-accent);
  width: 280px;
  box-shadow: 0 0 0 3px rgba(232,197,71,0.1);
}
.wv-search::placeholder { color: var(--wv-text-3); }

/* ── Grid ────────────────────────────────────────────────────── */
.wv-grid {
  display: grid;
  gap: 16px;
  align-items: start;
  animation: wvFadeIn 0.5s ease;
}
.wv-grid--masonry {
  grid-template-columns: repeat(var(--wv-cols), 1fr);
}
.wv-grid--grid {
  grid-template-columns: repeat(var(--wv-cols), 1fr);
}
@media (max-width: 1024px) {
  .wv-grid { --wv-cols: 2 !important; }
}
@media (max-width: 600px) {
  .wv-grid { --wv-cols: 1 !important; }
  .wv-toolbar { flex-direction: column; align-items: stretch; }
  .wv-search { width: 100%; }
  .wv-search:focus { width: 100%; }
}

/* ── Card ────────────────────────────────────────────────────── */
.wv-card {
  background: var(--wv-card-bg);
  border: 1px solid var(--wv-border);
  border-radius: var(--wv-radius);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, opacity 0.3s ease;
  break-inside: avoid;
}
.wv-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--wv-shadow);
  border-color: var(--wv-border-2);
}
.wv-card.wv-card--exiting {
  opacity: 0;
  transform: scale(0.95);
}
.wv-card.wv-card--entering {
  animation: wvCardIn 0.4s ease forwards;
}

@keyframes wvCardIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes wvFadeIn {
  from { opacity: 0; } to { opacity: 1; }
}

/* Card Thumbnail */
.wv-card__thumb {
  position: relative;
  overflow: hidden;
  background: var(--wv-border);
}
.wv-card__thumb img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.5s ease;
}
.wv-card:hover .wv-card__thumb img {
  transform: scale(1.04);
}
.wv-card__badge--featured {
  position: absolute;
  top: 12px; left: 12px;
  background: var(--wv-accent);
  color: #000;
  font-family: var(--wv-font);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  z-index: 2;
  letter-spacing: 0.02em;
}

/* Card Overlay */
.wv-card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 12px;
  background: linear-gradient(160deg, rgba(0,0,0,0.4) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
}
.wv-card:hover .wv-card__overlay { opacity: 1; }

.wv-card__preview-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.2s;
}
.wv-card__preview-btn svg { width: 14px; height: 14px; }
.wv-card__preview-btn:hover { background: rgba(255,255,255,0.25); transform: scale(1.08); }

/* Card Info */
.wv-card__info {
  padding: 14px 16px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}
.wv-card__meta { flex: 1; min-width: 0; }
.wv-card__title {
  font-family: var(--wv-font);
  font-size: 14px;
  font-weight: 700;
  color: var(--wv-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}
.wv-card__tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.wv-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-family: 'Courier New', monospace;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.wv-tag--res { background: rgba(232,197,71,0.12); color: var(--wv-accent); }
.wv-tag--cat { background: rgba(167,139,250,0.12); color: #a78bfa; }

/* Card Actions */
.wv-card__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

/* Download Button */
.wv-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--wv-radius-sm);
  background: var(--wv-accent);
  color: #000;
  font-family: var(--wv-font);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.25s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.wv-download-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.wv-download-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(232,197,71,0.35);
  color: #000;
  text-decoration: none;
}
.wv-download-btn:active { transform: translateY(0); }

/* Multi-resolution dropdown */
.wv-download-wrap { position: relative; }
.wv-download-btn--multi .wv-chevron { width: 12px; height: 12px; transition: transform 0.2s; }
.wv-download-wrap:hover .wv-chevron { transform: rotate(180deg); }

.wv-download-dropdown {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: var(--wv-card-bg);
  border: 1px solid var(--wv-border-2);
  border-radius: var(--wv-radius-sm);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.2s, transform 0.2s;
  z-index: 100;
}
.wv-download-wrap:hover .wv-download-dropdown {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}
.wv-download-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  color: var(--wv-text-2);
  font-size: 13px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  border-bottom: 1px solid var(--wv-border);
}
.wv-download-option:last-child { border-bottom: none; }
.wv-download-option svg { width: 14px; height: 14px; flex-shrink: 0; }
.wv-download-option:hover { background: rgba(232,197,71,0.08); color: var(--wv-accent); }

/* DL Count */
.wv-dl-count {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--wv-text-3);
}
.wv-dl-count svg { width: 11px; height: 11px; }

/* ── Load More ───────────────────────────────────────────────── */
.wv-load-more-wrap { display: flex; justify-content: center; margin-top: 48px; }
.wv-load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  background: transparent;
  border: 1px solid var(--wv-border-2);
  border-radius: 999px;
  color: var(--wv-text-2);
  font-family: var(--wv-font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}
.wv-load-more-btn:hover {
  border-color: var(--wv-accent);
  color: var(--wv-accent);
  background: rgba(232,197,71,0.05);
}
.wv-load-more-btn__icon { width: 16px; height: 16px; transition: transform 0.3s; }
.wv-load-more-btn:hover .wv-load-more-btn__icon { transform: translateY(2px); }
.wv-load-more-btn__spinner {
  display: none;
  width: 16px; height: 16px;
  border: 2px solid rgba(232,197,71,0.3);
  border-top-color: var(--wv-accent);
  border-radius: 50%;
  animation: wvSpin 0.7s linear infinite;
}
.wv-load-more-btn.wv-loading .wv-load-more-btn__spinner { display: block; }
.wv-load-more-btn.wv-loading .wv-load-more-btn__icon { display: none; }

@keyframes wvSpin { to { transform: rotate(360deg); } }

/* ── Lightbox ────────────────────────────────────────────────── */
.wv-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.wv-lightbox.wv-lightbox--open {
  opacity: 1;
  pointer-events: all;
}
.wv-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4,4,12,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Close / Nav */
.wv-lightbox__close,
.wv-lightbox__nav {
  position: absolute;
  z-index: 2;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  color: white;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.2s;
}
.wv-lightbox__close svg, .wv-lightbox__nav svg { width: 20px; height: 20px; }
.wv-lightbox__close { top: 20px; right: 20px; }
.wv-lightbox__nav--prev { left: 20px;  top: 50%; transform: translateY(-50%); }
.wv-lightbox__nav--next { right: 20px; top: 50%; transform: translateY(-50%); }
.wv-lightbox__close:hover { background: rgba(255,255,255,0.15); transform: scale(1.05); }
.wv-lightbox__nav--prev:hover { transform: translateY(-50%) translateX(-2px); background: rgba(255,255,255,0.12); }
.wv-lightbox__nav--next:hover { transform: translateY(-50%) translateX(2px);  background: rgba(255,255,255,0.12); }

/* Inner layout */
.wv-lightbox__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: stretch;
  gap: 0;
  max-width: 1100px;
  width: calc(100% - 160px);
  max-height: 90vh;
  border-radius: 18px;
  overflow: hidden;
  background: #0d0d1e;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 40px 80px rgba(0,0,0,0.8);
  transform: scale(0.95);
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
.wv-lightbox--open .wv-lightbox__inner { transform: scale(1); }

@media (max-width: 768px) {
  .wv-lightbox__inner { flex-direction: column; width: calc(100% - 40px); }
  .wv-lightbox__nav { display: none; }
}

/* Image side */
.wv-lightbox__image-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #070710;
  min-height: 300px;
  overflow: hidden;
}
.wv-lightbox__image {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  display: block;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.wv-lightbox__image.loaded { opacity: 1; }
.wv-lightbox__loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wv-spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--wv-accent);
  border-radius: 50%;
  animation: wvSpin 0.8s linear infinite;
}

/* Sidebar */
.wv-lightbox__sidebar {
  width: 300px;
  flex-shrink: 0;
  padding: 32px 24px;
  background: rgba(14,14,28,0.95);
  border-left: 1px solid rgba(255,255,255,0.06);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
@media (max-width: 768px) {
  .wv-lightbox__sidebar { width: 100%; border-left: none; border-top: 1px solid rgba(255,255,255,0.06); padding: 20px; }
}

.wv-lightbox__title {
  font-family: var(--wv-font);
  font-size: 20px;
  font-weight: 800;
  color: var(--wv-text);
  line-height: 1.2;
}
.wv-lightbox__cats { display: flex; gap: 6px; flex-wrap: wrap; }
.wv-lightbox__excerpt { font-size: 14px; color: var(--wv-text-2); line-height: 1.6; }

.wv-lightbox__props { display: flex; flex-direction: column; gap: 10px; }
.wv-lb-prop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--wv-border);
  border-radius: 8px;
}
.wv-lb-prop__label { font-size: 11px; color: var(--wv-text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.wv-lb-prop__value { font-family: 'Courier New', monospace; font-size: 13px; color: var(--wv-accent); font-weight: 600; }

.wv-lightbox__downloads { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.wv-lb-download-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--wv-accent);
  color: #000;
  text-decoration: none;
  border-radius: 10px;
  font-family: var(--wv-font);
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s;
}
.wv-lb-download-btn:hover { opacity: 0.9; transform: translateY(-1px); color: #000; text-decoration: none; }
.wv-lb-download-btn:not(:first-child) {
  background: rgba(232,197,71,0.1);
  color: var(--wv-accent);
  border: 1px solid rgba(232,197,71,0.25);
}
.wv-lb-download-btn:not(:first-child):hover { background: rgba(232,197,71,0.18); }
.wv-lb-download-btn svg { width: 16px; height: 16px; }

/* ── Utility ─────────────────────────────────────────────────── */
.wv-gallery [hidden] { display: none !important; }
