/* ============================================================
   GALLERY STYLES - ELEGANT MINIMAL DESIGN
   Matching the blog and forum aesthetic
   ============================================================ */

:root {
  /* Dark theme (default) */
  --gallery-bg: #0f0a14;
  --gallery-surface: #1a1020;
  --gallery-surface-hover: #24152d;
  --gallery-border: rgba(255, 255, 255, 0.06);
  --gallery-border-hover: rgba(255, 255, 255, 0.12);
  --gallery-primary: #d96bff;
  --gallery-primary-glow: rgba(217, 107, 255, 0.15);
  --gallery-text: #f1f5f9;
  --gallery-text-secondary: #a68fb8;
  --gallery-text-muted: #6c6078;
  --gallery-accent-gradient: linear-gradient(135deg, #a855f7, #ec4899);
  --gallery-accent-gradient-h1: linear-gradient(135deg, #9333ea, #db2777);
  --gallery-card-title-gradient: linear-gradient(135deg, #c084fc, #f472b6);
  --gallery-card-head-bg: linear-gradient(135deg, #9233ea38, #db27783a);
  --gallery-card-title-text-gradient: linear-gradient(135deg, #e9d5ff, #f9a8d4);
  --gallery-radius-card: 18px;
  --gallery-radius-pill: 50px;
  --gallery-radius-input: 10px;
  --gallery-shadow-card: 0 4px 24px rgba(0, 0, 0, 0.15);
  --gallery-shadow-hover: 0 12px 30px rgba(217, 107, 255, 0.12);
  --gallery-transition: 250ms cubic-bezier(0.2, 0, 0, 1);
  --gallery-hero-from: #1e0a2e;
  --gallery-hero-to:   #3a0a3a;
}

/* ================================================================
   LIGHT MODE
   ================================================================ */
:root.site-light {
  /* ─── Surface Colors ──────────────────────────────────────────── */
  --gallery-bg: #f8f4f2;            /* Warm, creamy off-white background */
  --gallery-surface: #fbf9f8;       /* Pure white for cards */
  --gallery-surface-hover: #f6f2ef; /* Soft, warm pinkish-beige hover */

  --gallery-border: rgba(140, 90, 80, 0.10);    /* Soft, warm border */
  --gallery-border-hover: rgba(140, 90, 80, 0.20);

  /* ─── Accent Colors ───────────────────────────────────────────── */
  --gallery-primary: #a855f7;       /* Keep your signature purple */
  --gallery-primary-glow: rgba(168, 85, 247, 0.12);

  /* ─── Typography ──────────────────────────────────────────────── */
  --gallery-text: #2a1f24;          /* Soft, warm dark brown/grey text */
  --gallery-text-secondary: #6b535c; /* Warm, muted purple-brown */
  --gallery-text-muted: #9a8490;     /* Soft, muted warm grey */

  /* ─── Gradients (Warm & Sensual for Light Mode) ──────────────── */
  --gallery-accent-gradient: linear-gradient(135deg, #a855f7, #db2777);
  --gallery-accent-gradient-h1: linear-gradient(135deg, #9333ea, #db2777);
  --gallery-card-title-gradient: linear-gradient(135deg, #7c3aed, #db2777);

  /* Updated light mode card heads */
  --gallery-card-head-bg: linear-gradient(135deg, rgba(168, 85, 247, 0.10), rgba(219, 39, 119, 0.10));
  --gallery-card-title-text-gradient: linear-gradient(135deg, #7e22ce, #db2777);

  /* ─── Shadows ──────────────────────────────────────────────────── */
  --gallery-shadow-card: 0 4px 24px rgba(140, 90, 80, 0.06);
  --gallery-shadow-hover: 0 12px 30px rgba(168, 85, 247, 0.10);

  /* ─── Hero Colors (Warm off-white gradient) ───────────────────── */
  --gallery-hero-from: #fcf8f4;      /* Warm cream */
  --gallery-hero-to:   #f8f0ec;      /* Very soft warm pink-beige */
}

/* ─── Container ────────────────────────────────────────────────── */
.gallery-index-wrap,
.gallery-album-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 32px 64px;
}

/* ─── Hero (Landing Page) ──────────────────────────────────────── */
.gallery-hero {
  background: linear-gradient(135deg, var(--gallery-hero-from), var(--gallery-hero-to));
  border-radius: var(--gallery-radius-card);
  padding: 64px 48px;
  text-align: center;
  margin-bottom: 48px;
  position: relative;
  overflow: hidden;
}

.gallery-hero::before {
  content: "";
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at 30% 40%, rgba(217,107,255,0.15) 0%, transparent 60%);
  pointer-events: none;
}

.gallery-hero-logo {
  width: min(260px, 50vw);
  height: auto;
  margin: 0 auto 16px;
  display: block;
}

.gallery-hero h2 {
  font: 700 clamp(2.4rem, 5vw, 3.5rem)/1.05 'Cormorant Garamond', Georgia, serif;
  background: var(--gallery-accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.gallery-hero p {
  font-size: 1.1rem;
  color: var(--gallery-text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* ─── Hero Background & Overlay (dynamic) ──────────────────────── */
.gallery-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(8px) brightness(0.4);
  transform: scale(1.05);
  z-index: 0;
}

.gallery-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(15,10,20,0.7), rgba(15,10,20,0.3));
  z-index: 1;
}

.gallery-hero-content {
  position: relative;
  z-index: 2;
}

.gallery-hero-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--gallery-radius-pill);
  background: var(--gallery-accent-gradient);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.gallery-hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* ─── Header (index & album) ──────────────────────────────────── */
.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
}

.gallery-header h1 {
  margin: 0;
  font: 700 clamp(2rem, 4vw, 3rem)/1.05 'Cormorant Garamond', Georgia, serif;
  background: var(--gallery-accent-gradient-h1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gallery-header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ─── Buttons & Links ─────────────────────────────────────────── */
.upload-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--gallery-radius-pill);
  background: var(--gallery-accent-gradient);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--gallery-transition);
  border: none;
  box-shadow: 0 2px 16px var(--gallery-primary-glow);
}

.upload-link:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 4px 24px var(--gallery-primary-glow);
  color: #fff;
}

.admin-link,
.back-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: var(--gallery-radius-pill);
  background: transparent;
  border: 1px solid var(--gallery-border);
  color: var(--gallery-text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: var(--gallery-transition);
}

.admin-link:hover,
.back-pill:hover {
  border-color: var(--gallery-primary);
  color: var(--gallery-text);
  background: var(--gallery-surface-hover);
}

/* ─── Filter Pills & Search Bar ───────────────────────────────── */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
  justify-content: center;
}

.gallery-filter-pill {
  background: var(--gallery-surface);
  border: 1px solid var(--gallery-border);
  color: var(--gallery-text-secondary);
  padding: 6px 18px;
  border-radius: var(--gallery-radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--gallery-transition);
  text-decoration: none;
}

.gallery-filter-pill:hover,
.gallery-filter-pill.active {
  background: var(--gallery-primary-glow);
  border-color: var(--gallery-primary);
  color: var(--gallery-primary);
}

.gallery-filter-bar {
  margin-bottom: 32px;
  position: relative;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.filter-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.filter-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gallery-text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}

.filter-search-input {
  width: 100%;
  padding: 10px 44px 10px 38px;
  background: var(--gallery-surface);
  color: var(--gallery-text);
  border: 1px solid var(--gallery-border);
  border-radius: var(--gallery-radius-pill);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.filter-search-input:focus {
  border-color: var(--gallery-primary);
  box-shadow: 0 0 0 3px var(--gallery-primary-glow);
}

.filter-search-input::placeholder {
  color: var(--gallery-text-muted);
}

.filter-search-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--gallery-accent-gradient);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
  transition: opacity 0.2s;
}

.filter-search-btn:hover { opacity: 0.85; }

.filter-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--gallery-surface);
  border: 1px solid var(--gallery-border);
  border-radius: var(--gallery-radius-input);
  padding: 6px 0;
  display: none;
  z-index: 20;
  box-shadow: var(--gallery-shadow-card);
}

.filter-search-input:focus ~ .filter-dropdown,
.filter-dropdown:hover { display: block; }

.filter-dropdown-item {
  display: block;
  padding: 8px 16px;
  color: var(--gallery-text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: background 0.15s;
}

.filter-dropdown-item:hover {
  background: var(--gallery-surface-hover);
  color: var(--gallery-text);
}

/* ─── Gallery Layout (3 columns) ──────────────────────────────── */
.gallery-layout {
  display: grid;
  grid-template-columns: 220px 1fr 260px;
  gap: 32px;
  align-items: start;
}

.gallery-main { min-width: 0; }

.gallery-sidebar--left,
.gallery-sidebar--right {
  position: sticky;
  top: 24px;
}

.gallery-sidebar-nav {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--gallery-border);
}

.gallery-sidebar-nav:last-child { border-bottom: none; }

.gallery-sidebar-nav h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gallery-text-muted);
  margin-bottom: 12px;
  font-weight: 700;
}

.gallery-sidebar-nav a {
  display: block;
  padding: 6px 12px;
  border-radius: var(--gallery-radius-input);
  color: var(--gallery-text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
}

.gallery-sidebar-nav a:hover,
.gallery-sidebar-nav a.active {
  background: var(--gallery-surface-hover);
  color: var(--gallery-text);
}

.gallery-sidebar-widget {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--gallery-border);
}

.gallery-sidebar-widget:last-child { border-bottom: none; }

.gallery-sidebar-widget h3 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gallery-text);
  margin-bottom: 12px;
}

.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }

.gallery-sidebar-activity {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  text-decoration: none;
  border-bottom: 1px solid var(--gallery-border);
}

.gallery-sidebar-activity:last-child { border-bottom: none; }

.gallery-sidebar-activity .activity-title {
  font-size: 0.85rem;
  color: var(--gallery-text);
  font-weight: 500;
}

.gallery-sidebar-activity .activity-meta {
  font-size: 0.75rem;
  color: var(--gallery-text-muted);
}

/* ─── Albums Grid (Landing Page) ──────────────────────────────── */
.gallery-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 24px;
  padding-bottom: 48px;
}

/* ─── Album Card ───────────────────────────────────────────────── */
.gallery-card {
  background: var(--gallery-surface);
  border: 1px solid var(--gallery-border);
  border-radius: var(--gallery-radius-card);
  overflow: hidden;
  transition: var(--gallery-transition);
  display: block;
  text-decoration: none;
  color: inherit;
}

.gallery-card:hover {
  border-color: var(--gallery-primary);
  transform: translateY(-4px);
  box-shadow: var(--gallery-shadow-hover);
}

.gallery-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.gallery-card-info { padding: 16px; }

.gallery-card-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--gallery-text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--gallery-text-muted);
}

.gallery-card-author { color: var(--gallery-text-secondary); }

/* ─── Album card title on top ──────────────────────────────────── */
.gallery-card-title--above {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 2.3rem;
  font-weight: 700;
  line-height: 1.25;
  padding: 16px 18px;
  margin: 0;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: var(--gallery-radius-card) var(--gallery-radius-card) 0 0;
  letter-spacing: -0.01em;
  border-bottom: none;
  background: var(--gallery-card-head-bg);
  color: transparent;
  background-image: var(--gallery-card-title-text-gradient);
  -webkit-background-clip: text;
  background-clip: text;
}

/* ─── Thumbnail grid ───────────────────────────────────────────── */
.album-card-thumbs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  padding-top: 4px;
  border-radius: 0 0 var(--gallery-radius-card) var(--gallery-radius-card);
}

.album-card-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: none;
}

.album-card-thumbs img:only-child {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
}

.album-card-thumbs .album-cover-placeholder {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  background: rgba(255,255,255,.03);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gallery-text-muted);
  font-size: 2.5rem;
  border: 1px dashed var(--gallery-border);
  border-radius: inherit;
}

/* ─── Discovery Section ────────────────────────────────────────── */
.gallery-discovery { margin-top: 48px; }

.discovery-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gallery-text);
  margin-bottom: 24px;
}

.discovery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.gallery-card--discovery {
  border-radius: var(--gallery-radius-input);
}

.gallery-card--discovery img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--gallery-radius-input) var(--gallery-radius-input) 0 0;
}

/* ─── Empty State ──────────────────────────────────────────────── */
.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 0;
  color: var(--gallery-text-secondary);
}

.gallery-empty .empty-icon {
  font-size: 3rem;
  opacity: 0.3;
  margin-bottom: 16px;
}

.gallery-empty p {
  font-size: 1rem;
  margin-bottom: 24px;
}

/* ─── Album Page ───────────────────────────────────────────────── */
.gallery-album-header { margin-bottom: 24px; }

.gallery-album-header h1 {
  font: 700 clamp(1.8rem, 3vw, 2.5rem)/1.1 'Cormorant Garamond', Georgia, serif;
  background: var(--gallery-accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.gallery-album-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--gallery-text-muted);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.gallery-album-stats .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gallery-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: var(--gallery-text-secondary);
  margin-right: 4px;
}

.gallery-image-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: var(--gallery-radius-pill);
  background: var(--gallery-surface-hover);
  border: 1px solid var(--gallery-border);
  font-size: 0.75rem;
  color: var(--gallery-text-secondary);
}

/* ─── Album Hero (emotional header) ────────────────────────────── */
.album-hero {
  position: relative;
  border-radius: var(--gallery-radius-card);
  overflow: hidden;
  margin-bottom: 32px;
  min-height: 280px;
  display: flex;
  align-items: flex-end;
}

.album-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(12px) brightness(0.35);
  transform: scale(1.05);
  z-index: 0;
}

.album-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15,10,20,0.85) 30%, rgba(15,10,20,0.2) 100%);
  z-index: 1;
}

.album-hero-content {
  position: relative;
  z-index: 2;
  padding: 32px;
  width: 100%;
}

.album-hero-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.album-hero-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
}

.album-hero-creator {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,0.9);
}

.album-hero-avatar {
  box-sizing: border-box;
  display: inline-grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  background: var(--gallery-primary-glow);
  border: 2px solid rgba(255,255,255,0.3);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  overflow: hidden;
}

.album-hero-creator-name {
  font-weight: 600;
  display: block;
  color: #fff;
}

.album-hero-date {
  font-size: 0.8rem;
  opacity: 0.7;
  display: block;
}

.album-hero-stats {
  display: flex;
  gap: 16px;
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
}

.album-stat {
  display: flex;
  align-items: center;
  gap: 6px;
}

.album-hero-description {
  color: rgba(255,255,255,0.75);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 600px;
  margin-bottom: 16px;
}

.album-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.album-hero-actions .album-action-btn {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
  color: #fff;
}

.album-hero-actions .album-action-btn:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.4);
}

/* ─── Album Grids ──────────────────────────────────────────────── */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.album-grid figure {
  margin: 0;
  position: relative;
  overflow: hidden;
  border-radius: var(--gallery-radius-card);
  background: var(--gallery-surface);
  border: 1px solid var(--gallery-border);
  transition: var(--gallery-transition);
  aspect-ratio: 1 / 1;
}

.album-grid figure:hover {
  border-color: var(--gallery-primary);
  transform: translateY(-2px);
  box-shadow: var(--gallery-shadow-hover);
}

.album-grid a {
  display: block;
  width: 100%;
  height: 100%;
}

.album-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.album-grid figure:hover img { transform: scale(1.03); }

.album-grid figcaption {
  font-size: 0.8rem;
  color: var(--gallery-text-secondary);
  padding: 8px 12px;
  text-align: center;
  font-weight: 500;
}

/* Masonry variant */
.album-grid--masonry {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.album-grid-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--gallery-radius-card);
  background: var(--gallery-surface);
  border: 1px solid var(--gallery-border);
  transition: var(--gallery-transition);
  aspect-ratio: auto;
}

.album-grid-item:hover {
  border-color: var(--gallery-primary);
  transform: translateY(-2px);
  box-shadow: var(--gallery-shadow-hover);
}

.album-grid-item a {
  display: block;
  width: 100%;
  height: 100%;
}

.album-grid-item img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.album-grid-item:hover img { transform: scale(1.03); }

.album-grid-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  opacity: 0;
  transition: opacity 0.25s ease;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.album-grid-item:hover .album-grid-overlay { opacity: 1; }

.album-grid-title {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
}

.album-grid-actions {
  display: flex;
  gap: 8px;
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
}

.album-grid-actions i {
  cursor: pointer;
  transition: color 0.15s;
}

.album-grid-actions i:hover { color: var(--gallery-primary); }

/* ─── Album Metadata ───────────────────────────────────────────── */
.album-meta-section {
  margin-bottom: 32px;
  padding: 24px;
  background: var(--gallery-surface);
  border: 1px solid var(--gallery-border);
  border-radius: var(--gallery-radius-card);
}

.album-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.album-meta-block h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gallery-text-muted);
  margin-bottom: 8px;
  font-weight: 700;
}

.album-meta-block span {
  display: block;
  font-size: 0.9rem;
  color: var(--gallery-text-secondary);
  margin-bottom: 4px;
}

/* ─── Social Action Bar ────────────────────────────────────────── */
.album-actions {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.album-actions--centered { justify-content: center; }

.album-action-btn {
  background: transparent;
  border: 1px solid var(--gallery-border);
  color: var(--gallery-text-secondary);
  padding: 8px 20px;
  border-radius: var(--gallery-radius-pill);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--gallery-transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.album-action-btn:hover {
  border-color: var(--gallery-primary);
  color: var(--gallery-text);
  background: var(--gallery-primary-glow);
}

.album-action-btn--danger {
  color: #ef4444 !important;
  border-color: rgba(239,68,68,0.3) !important;
}

.album-action-btn--danger:hover {
  background: rgba(239,68,68,0.1) !important;
  border-color: #ef4444 !important;
}

/* ─── Single Image Centered ────────────────────────────────────── */
.single-image-container {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
}

.single-image-container img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--gallery-radius-card);
  box-shadow: var(--gallery-shadow-card);
}

/* ─── Related Content ──────────────────────────────────────────── */
.related-section { margin-top: 48px; }

.related-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gallery-text);
  margin-bottom: 24px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.related-grid a {
  display: block;
  overflow: hidden;
  border-radius: var(--gallery-radius-input);
  border: 1px solid var(--gallery-border);
  transition: var(--gallery-transition);
  aspect-ratio: 1 / 1;
}

.related-grid a:hover {
  border-color: var(--gallery-primary);
  transform: translateY(-2px);
  box-shadow: var(--gallery-shadow-hover);
}

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

/* ─── Image Viewer (immersive) ─────────────────────────────────── */
.image-viewer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 32px 64px;
  position: relative;
}

.viewer-back-pill {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 50;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 6px 16px;
  border-radius: var(--gallery-radius-pill);
  text-decoration: none;
  font-size: 0.8rem;
  border: 1px solid rgba(255,255,255,0.1);
  transition: background 0.2s;
}

.viewer-back-pill:hover { background: rgba(0,0,0,0.75); color: #fff; }

.viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  background: rgba(10, 5, 14, 0.7);
  backdrop-filter: blur(10px);
  color: #fff;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 1.2rem;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 8px 24px rgba(0,0,0,0.32);
}

.viewer-nav:hover {
  background: rgba(126, 34, 206, 0.84);
  border-color: rgba(233, 213, 255, 0.62);
  color: #fff;
  transform: translateY(-50%) scale(1.04);
}

.viewer-nav:focus-visible {
  outline: 3px solid var(--gallery-primary);
  outline-offset: 3px;
}

.viewer-nav--prev { left: clamp(12px, 2vw, 24px); }
.viewer-nav--next { right: clamp(12px, 2vw, 24px); }

.viewer-image-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
  min-height: 50vh;
  background: rgba(0,0,0,0.3);
  border-radius: var(--gallery-radius-card);
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

.viewer-image {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  display: block;
}

.viewer-info-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 0;
  font-size: 0.9rem;
  color: var(--gallery-text-secondary);
}

.viewer-info-title { font-weight: 600; color: var(--gallery-text); }
.viewer-info-sep { opacity: 0.4; }
.viewer-info-bar strong { color: var(--gallery-text); }

.image-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 24px;
}

.viewer-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
  padding: 20px;
  background: var(--gallery-surface);
  border: 1px solid var(--gallery-border);
  border-radius: var(--gallery-radius-card);
}

.viewer-meta-block h4 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gallery-text-muted);
  margin-bottom: 6px;
}

.viewer-meta-block span {
  display: block;
  font-size: 0.85rem;
  color: var(--gallery-text-secondary);
  margin-bottom: 2px;
}

/* ─── Threaded Comments ────────────────────────────────────────── */
.viewer-comments h3 {
  color: var(--gallery-text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-count-badge {
  font-size: 0.75rem;
  background: var(--gallery-surface-hover);
  color: var(--gallery-text-muted);
  padding: 2px 10px;
  border-radius: var(--gallery-radius-pill);
  font-weight: 600;
}

.viewer-comment {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--gallery-border);
}

.viewer-comment:last-child { border-bottom: 1px solid var(--gallery-border); }

.viewer-comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gallery-primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--gallery-primary);
  flex-shrink: 0;
}

.viewer-comment-body { flex: 1; min-width: 0; }

.viewer-comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.viewer-comment-header strong { color: var(--gallery-text); font-size: 0.9rem; }
.viewer-comment-header time { font-size: 0.75rem; color: var(--gallery-text-muted); }

.viewer-comment-badge {
  font-size: 0.6rem;
  background: var(--gallery-accent-gradient);
  color: #fff;
  padding: 1px 8px;
  border-radius: var(--gallery-radius-pill);
  font-weight: 700;
  text-transform: uppercase;
}

.viewer-comment-text {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--gallery-text-secondary);
  margin-bottom: 6px;
}

.viewer-comment-actions { display: flex; align-items: center; gap: 12px; }

.viewer-comment-actions form { margin: 0; }

.viewer-comment-actions button,
.viewer-comment-actions a {
  background: none;
  border: none;
  color: var(--gallery-text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}

.viewer-comment-actions button:hover,
.viewer-comment-actions a:hover { color: var(--gallery-text); }

.viewer-comment-actions .comment-like-button.is-liked {
  color: #e0526f;
}

.viewer-comment-actions .comment-like-button:disabled {
  opacity: .55;
  cursor: wait;
}

.viewer-comment-empty,
.viewer-comment-signin {
  text-align: center;
  padding: 24px 0;
  color: var(--gallery-text-muted);
}

.viewer-comment-signin a { color: var(--gallery-primary); }

.viewer-comment-form {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--gallery-border);
}

.viewer-comment-form-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gallery-primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--gallery-primary);
  flex-shrink: 0;
}

.viewer-comment-form-input { flex: 1; }

.viewer-comment-form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.viewer-comment-form-actions button {
  background: var(--gallery-accent-gradient);
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: var(--gallery-radius-pill);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
}

.viewer-comment-hint { font-size: 0.75rem; color: var(--gallery-text-muted); }
.viewer-discovery { margin-top: 48px; }

/* ─── Comment Section (generic) ────────────────────────────────── */
.comment-section {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 32px;
}

.comment-section textarea,
.comment-section input {
  background-color: var(--gallery-surface);
  color: var(--gallery-text);
  border: 1px solid var(--gallery-border);
  border-radius: var(--gallery-radius-input);
  padding: 12px;
  width: 100%;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
}

.comment-section textarea::placeholder { color: var(--gallery-text-muted); }

.comment-section button {
  margin-top: 8px;
  background: var(--gallery-accent-gradient);
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: var(--gallery-radius-pill);
  cursor: pointer;
  font-weight: 600;
  transition: var(--gallery-transition);
}

.comment-section button:hover { opacity: 0.9; transform: translateY(-1px); }

/* ─── Upload Page ──────────────────────────────────────────────── */
.upload-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}

.upload-header h1 {
  margin: 0;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 2.4rem;
  background: var(--gallery-accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.upload-status-pill {
  background: var(--gallery-surface);
  color: var(--gallery-text-secondary);
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 0.85rem;
}

.upload-status-autopublish { color: #4caf50; }

.upload-grid-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
  margin-bottom: 32px;
}

.upload-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: var(--gallery-text-secondary);
}

.upload-form .required { color: #ef4444; }

.upload-form .optional {
  font-weight: 400;
  opacity: 0.6;
  font-size: 0.8rem;
}

.upload-form input[type="text"],
.upload-form textarea,
.upload-form select {
  width: 100%;
  padding: 10px 14px;
  background-color: var(--gallery-surface);
  color: var(--gallery-text);
  border: 1px solid var(--gallery-border);
  border-radius: var(--gallery-radius-input);
  font-family: inherit;
  font-size: 0.9rem;
  transition: var(--gallery-transition);
  box-sizing: border-box;
}

.upload-form textarea { min-height: 100px; resize: vertical; }

.upload-form input:focus,
.upload-form textarea:focus,
.upload-form select:focus {
  outline: none;
  border-color: var(--gallery-primary);
  box-shadow: 0 0 0 3px var(--gallery-primary-glow);
}

.upload-form .help-text {
  font-size: 0.8rem;
  color: var(--gallery-text-muted);
  margin-top: 4px;
}

.upload-form .field-errors {
  color: #ef4444;
  font-size: 0.85rem;
  margin-top: 4px;
}

.upload-form .form-group { margin-bottom: 20px; }

.upload-form .form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 24px;
}

.file-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 52px;
  gap: 12px;
  padding: 8px;
  border: 1px solid var(--gallery-border);
  border-radius: var(--gallery-radius-input);
  background: var(--gallery-surface);
}

.file-input-wrapper input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-picker-button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 8px;
  min-height: 36px;
  margin: 0 !important;
  padding: 8px 14px;
  border: 1px solid rgba(217, 107, 255, 0.42);
  border-radius: 8px;
  color: #f5eafe !important;
  background: rgba(217, 107, 255, 0.14);
  cursor: pointer;
  transition: var(--gallery-transition);
}

.file-picker-button:hover,
.file-input-wrapper:focus-within .file-picker-button {
  border-color: var(--gallery-primary);
  background: rgba(217, 107, 255, 0.24);
  box-shadow: 0 0 0 3px var(--gallery-primary-glow);
}

.file-picker-summary {
  min-width: 0;
  color: var(--gallery-text-secondary);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.upload-file-errors:empty { display: none; }
.upload-file-errors { display: grid; gap: 4px; margin-top: 8px !important; }

.selected-file-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.selected-file-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--gallery-border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--gallery-surface) 86%, #000);
}

.selected-file-card > img {
  width: 64px;
  height: 64px;
  display: block;
  border-radius: 8px;
  object-fit: cover;
  background: #09060c;
}

.selected-file-details { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 3px 10px; min-width: 0; }
.selected-file-details strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8rem; }
.selected-file-details small { color: var(--gallery-text-muted); font-size: 0.7rem; }
.selected-file-details label { grid-column: 1 / -1; margin: 5px 0 1px; font-size: 0.7rem; }
.selected-file-details input { grid-column: 1 / -1; width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--gallery-border); border-radius: 7px; color: var(--gallery-text); background: rgba(0,0,0,0.18); font: inherit; font-size: 0.82rem; }

.upload-form .content-tag-selector.is-open { z-index: auto; }
.upload-form .content-tag-results {
  position: static;
  top: auto;
  z-index: auto;
  max-height: min(340px, 52vh);
  padding: 7px;
  border-color: rgba(217, 107, 255, 0.34);
  background: #1b1122;
  box-shadow: 0 18px 44px rgba(0,0,0,0.62);
}
.upload-form .content-tag-result { min-height: 52px; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.upload-form .content-tag-result:last-child { border-bottom: 0; }
.upload-form .content-tag-result small { margin-top: 2px; color: #a995b8; }
.upload-form .content-tag-result-group { align-self: start; white-space: nowrap; }

:root.site-light .upload-form .content-tag-results { background: #fffafc; }
:root.site-light .file-picker-button { color: #642779 !important; background: rgba(168,85,247,0.1); }

.image-preview-box {
  background: var(--gallery-surface);
  border: 2px dashed var(--gallery-border);
  border-radius: 12px;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s ease;
  position: relative;
}

.image-preview-box:hover { border-color: var(--gallery-primary); }

.preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--gallery-text-muted);
  font-size: 1rem;
  text-align: center;
}

.preview-placeholder i { font-size: 2.5rem; opacity: 0.4; }

.preview-placeholder-hint { font-size: 0.9rem; opacity: 0.6; }

.preview-image-hidden {
  display: none;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.upload-preview-note { text-align: center; margin-top: 8px; }

.tag-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }

.tag-checkboxes label {
  background: var(--gallery-surface);
  border: 1px solid var(--gallery-border);
  color: var(--gallery-text-secondary);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--gallery-transition);
  font-weight: normal;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tag-checkboxes label:hover,
.tag-checkboxes input:checked + span {
  background: var(--gallery-primary-glow);
  border-color: var(--gallery-primary);
  color: var(--gallery-primary);
}

.tag-checkboxes input { display: none; }

.upload-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--gallery-surface);
  color: var(--gallery-text);
  border: 1px solid var(--gallery-border);
  border-radius: var(--gallery-radius-input);
  font-family: inherit;
}

/* ─── Moderation Grid ──────────────────────────────────────────── */
.moderation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.moderation-card {
  background: var(--gallery-surface);
  border: 1px solid var(--gallery-border);
  border-radius: var(--gallery-radius-card);
  overflow: hidden;
  transition: var(--gallery-transition);
  display: flex;
  flex-direction: column;
}

.moderation-card:hover {
  border-color: var(--gallery-primary);
  box-shadow: var(--gallery-shadow-hover);
}

.moderation-card-image {
  display: block;
  height: 220px;
  overflow: hidden;
  background: rgba(0,0,0,0.2);
}

.moderation-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.moderation-card:hover .moderation-card-image img { transform: scale(1.03); }

.moderation-card-info {
  padding: 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.moderation-card-uploader {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gallery-text);
}

.moderation-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gallery-primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--gallery-primary);
  flex-shrink: 0;
}

.moderation-card-album {
  font-size: 0.8rem;
  color: var(--gallery-text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.moderation-card-title {
  font-size: 0.85rem;
  color: var(--gallery-text-secondary);
  font-style: italic;
}

.moderation-card-date {
  font-size: 0.75rem;
  color: var(--gallery-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.moderation-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--gallery-border);
}

.moderation-card-actions .album-action-btn {
  flex: 1;
  justify-content: center;
  padding: 6px 10px;
  font-size: 0.8rem;
  text-align: center;
}

.moderation-btn-approve {
  color: #22c55e !important;
  border-color: rgba(34,197,94,0.3) !important;
}

.moderation-btn-approve:hover {
  background: rgba(34,197,94,0.1) !important;
  border-color: #22c55e !important;
  color: #22c55e !important;
}

.moderation-btn-reject {
  color: #ef4444 !important;
  border-color: rgba(239,68,68,0.3) !important;
}

.moderation-btn-reject:hover {
  background: rgba(239,68,68,0.1) !important;
  border-color: #ef4444 !important;
  color: #ef4444 !important;
}

.moderation-btn-edit { text-decoration: none !important; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1100px) {
  .gallery-layout {
    grid-template-columns: 1fr;
  }
  .gallery-sidebar--left,
  .gallery-sidebar--right {
    display: none;
  }
}

@media (max-width: 768px) {
  .gallery-index-wrap,
  .gallery-album-wrap {
    padding: 24px 16px 48px;
  }

  .gallery-hero { padding: 48px 24px; }
  .gallery-hero h2 { font-size: 2.2rem; }

  .gallery-index-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
  }

  .album-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .related-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

  .gallery-header { flex-direction: column; align-items: flex-start; }
  .gallery-header-actions { width: 100%; }

  .upload-link,
  .admin-link { flex: 1; justify-content: center; }

  .gallery-card-title--above {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    padding: 10px 14px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .album-card-thumbs { padding-top: 2px; }
  .single-image-container img { max-height: 60vh; }
  .image-view-wrap .back-pill { top: 10px; left: 10px; padding: 4px 12px; font-size: 0.75rem; }
  .album-actions { gap: 12px; }
  .album-action-btn { padding: 6px 14px; font-size: 0.8rem; }
  .comment-section { padding: 0 16px; }
  .image-preview-box { aspect-ratio: 4 / 3; }

  .album-hero { min-height: 220px; }
  .album-hero-content { padding: 20px; }
  .album-hero-title { font-size: 1.6rem; }
  .album-hero-meta { flex-direction: column; align-items: flex-start; }
  .album-hero-stats { flex-wrap: wrap; gap: 8px; }
  .album-hero-description { display: none; }

  .viewer-nav {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  .viewer-nav--prev { left: 8px; }
  .viewer-nav--next { right: 8px; }
  .viewer-back-pill { top: 10px; left: 10px; font-size: 0.75rem; padding: 4px 12px; }

  .upload-grid-container { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .album-meta-grid { grid-template-columns: 1fr; }
  .viewer-meta-grid { grid-template-columns: 1fr; }
  .moderation-grid { grid-template-columns: 1fr; }
  .moderation-card-image { height: 180px; }
  .file-input-wrapper { align-items: stretch; flex-direction: column; }
  .file-picker-button { width: 100%; min-height: 44px; }
  .selected-file-card { grid-template-columns: 52px minmax(0,1fr); gap: 9px; }
  .selected-file-card > img { width: 52px; height: 52px; }
  .upload-form .form-actions { display: grid; grid-template-columns: 1fr; align-items: stretch; }
  .upload-form .form-actions > * { width: 100%; min-height: 44px; justify-content: center; text-align: center; }
}

@media (max-width: 480px) {
  .gallery-index-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .album-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-hero h2 { font-size: 1.8rem; }

  .gallery-card-title--above {
    font-size: 0.9rem;
    padding: 8px 12px;
  }
}

/* ================================================================
   LIGHT MODE HERO OVERRIDE
   ================================================================ */
:root.site-light .gallery-hero {
    border-color: var(--gallery-border);
}

/* Change the dark purple glowing orb to a subtle light pink glow */
:root.site-light .gallery-hero::before {
    background: radial-gradient(circle at 30% 40%, rgba(168, 85, 247, 0.15) 0%, transparent 60%) !important;
}

/* Make gradient text darker to be readable on white backgrounds */
:root.site-light .gallery-hero h2,
:root.site-light .gallery-header h1 {
    background: linear-gradient(135deg, #a855f7, #db2777) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

/* Change paragraph text to dark gray */
:root.site-light .gallery-hero p {
    color: #5c4a6e !important;
}

/* ─── Fix up the Light Mode Search Bar if present ────────────── */
:root.site-light .filter-search-input {
    background: var(--gallery-bg);
    border-color: var(--gallery-border);
    color: var(--gallery-text);
}
:root.site-light .filter-search-input::placeholder {
    color: var(--gallery-text-muted);
}
:root.site-light .filter-search-input:focus {
    border-color: var(--gallery-primary);
    box-shadow: 0 0 0 3px var(--gallery-primary-glow);
}

/* ─── Fix up the Light Mode Upload Form ──────────────────────── */
:root.site-light .upload-form input[type="text"],
:root.site-light .upload-form textarea,
:root.site-light .upload-form select {
    background: var(--gallery-surface);
}
:root.site-light .upload-form input:focus,
:root.site-light .upload-form textarea:focus,
:root.site-light .upload-form select:focus {
    border-color: var(--gallery-primary);
    box-shadow: 0 0 0 3px var(--gallery-primary-glow);
}

.image-preview-box--batch {
  min-height: 360px;
  aspect-ratio: auto;
  padding: 14px;
  box-sizing: border-box;
}

.image-preview-box--batch.is-dragging {
  border-color: var(--gallery-primary);
  background: var(--gallery-primary-glow);
}

.upload-preview-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.upload-preview-grid:empty { display: none; }
.upload-preview-grid img { width: 100%; aspect-ratio: 1; display: block; object-fit: cover; border-radius: 9px; background: #09060c; }
.preview-placeholder[hidden] { display: none; }

.upload-back-link { margin-bottom: 0.75rem; }
