/* ============================================================
   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-results {
  scroll-margin-top: 6.5rem;
}

.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: var(--fl-success, #c58d72); }

.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: normal; overflow-wrap: anywhere; }

: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: var(--fl-success, #c58d72) !important;
  border-color: rgba(197,141,114,0.3) !important;
}

.moderation-btn-approve:hover {
  background: rgba(197,141,114,0.1) !important;
  border-color: var(--fl-success, #c58d72) !important;
  color: var(--fl-success, #c58d72) !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; }

/* Gallery: visual work first, browser chrome second. */
.gallery-index-wrap { max-width:1120px; margin:0 auto; }
.gallery-editorial-intro { display:grid; grid-template-columns:1.1fr .9fr; gap:3rem; align-items:end; padding:clamp(3rem,7vw,7rem) 0 4rem; border-bottom:1px solid var(--border); }
.gallery-editorial-intro > p { grid-column:1/-1; margin:0; color:var(--champagne); font-size:.68rem; font-weight:700; letter-spacing:.18em; text-transform:uppercase; }
.gallery-editorial-intro h1 { margin:0; color:var(--ink); font:400 clamp(3.8rem,7vw,6.8rem)/.84 var(--serif,Georgia,serif); letter-spacing:-.045em; }
.gallery-editorial-intro h1 em { color:var(--rose); font-weight:400; }
.gallery-editorial-intro div { padding-bottom:.6rem; }
.gallery-editorial-intro div span { display:block; max-width:44ch; margin-bottom:1rem; color:var(--muted); line-height:1.7; }
.gallery-editorial-intro div a { color:var(--rose); font-size:.8rem; font-weight:700; text-decoration:none; }
.gallery-hero-logo { display:none; }
.gallery-hero { min-height:440px; margin:4rem 0; border:0; border-radius:1.25rem; background:linear-gradient(145deg,#32131f,#130a10); box-shadow:0 32px 85px rgba(0,0,0,.3); }
.gallery-hero-overlay { background:linear-gradient(90deg,rgba(12,6,10,.9),rgba(12,6,10,.22)); }
.gallery-hero-content { max-width:620px; padding:clamp(2rem,6vw,5rem); }
.gallery-hero-badge { color:var(--champagne); letter-spacing:.16em; }
.gallery-hero h2 { color:#fff8ef; font:400 clamp(2.8rem,6vw,5rem)/.94 var(--serif,Georgia,serif); }
.gallery-header { margin:4rem 0 1.5rem; padding-bottom:1rem; border-bottom:1px solid var(--border); }
.gallery-header h2 { margin:0; color:var(--ink); font:400 2.5rem var(--serif,Georgia,serif); }
.gallery-filter-bar { max-width:580px; margin:0 0 2.5rem; background:transparent; border:0; border-bottom:1px solid var(--border); border-radius:0; }
.gallery-layout { grid-template-columns:minmax(0,1fr) 220px !important; gap:clamp(2rem,5vw,4rem) !important; }
.gallery-sidebar--left { display:none !important; }
.gallery-sidebar-widget { padding:1.2rem 0; border-top:1px solid var(--border); }
.gallery-sidebar-widget h3 { color:var(--champagne); font-size:.67rem; letter-spacing:.14em; text-transform:uppercase; }
.gallery-index-grid { gap:2.2rem 1.3rem; }
.gallery-card { border:0; border-radius:0; background:transparent; box-shadow:none; }
.gallery-card:hover { transform:translateY(-4px); box-shadow:none; }
.album-card-thumbs { border-radius:.75rem; overflow:hidden; }
.gallery-card-title--above { padding:.8rem 0; background:transparent; -webkit-text-fill-color:currentColor; color:var(--ink); font:600 1.5rem var(--serif,Georgia,serif); }
.gallery-card-info { padding:.8rem 0; }

@media (max-width:760px) {
  .gallery-editorial-intro { grid-template-columns:1fr; gap:1.5rem; }
  .gallery-layout { grid-template-columns:1fr !important; }
  .gallery-sidebar--right { display:none; }
  .gallery-hero { min-height:360px; }
}

/* Album detail: one continuous editorial canvas, not a stack of cards. */
.gallery-album-wrap { max-width:1180px;padding-top:clamp(2rem,5vw,4.5rem); }
.gallery-album-wrap > .back-pill {
  margin-bottom:clamp(2rem,5vw,4rem);
  padding:0 0 .35rem;
  border:0;
  border-bottom:1px solid transparent;
  border-radius:0;
  background:transparent;
  color:var(--gallery-text-muted);
}
.gallery-album-wrap > .back-pill:hover { border-bottom-color:var(--gallery-primary);background:transparent;color:var(--gallery-text); }
.gallery-album-wrap .album-hero {
  min-height:0;
  margin:0 0 clamp(2.5rem,6vw,5rem);
  overflow:visible;
  border-block:1px solid var(--gallery-border);
  border-radius:0;
  background:transparent;
}
.gallery-album-wrap .album-hero-bg,
.gallery-album-wrap .album-hero-overlay { display:none; }
.gallery-album-wrap .album-hero-content { padding:clamp(2rem,5vw,4rem) 0;width:100%; }
.album-hero-eyebrow { margin:0 0 .75rem;color:var(--fl-champagne,#dfc28b);font-size:.66rem;font-weight:800;letter-spacing:.16em;text-transform:uppercase; }
.gallery-album-wrap .album-hero-title {
  max-width:15ch;
  margin:0 0 clamp(1.5rem,4vw,2.5rem);
  color:var(--gallery-text);
  font:400 clamp(3.4rem,8vw,6.5rem)/.86 var(--fl-serif,'Cormorant Garamond',Georgia,serif);
  letter-spacing:-.045em;
  text-shadow:none;
  overflow-wrap:anywhere;
}
.gallery-album-wrap .album-hero-meta { align-items:center;margin-bottom:1.4rem;padding-bottom:1.4rem;border-bottom:1px solid var(--gallery-border); }
.gallery-album-wrap .album-hero-creator { color:var(--gallery-text-secondary); }
.gallery-album-wrap .album-hero-creator-name { color:var(--gallery-text);font-family:var(--fl-serif,Georgia,serif);font-size:1.05rem; }
.gallery-album-wrap .album-hero-date { color:var(--gallery-text-muted);opacity:1; }
.gallery-album-wrap .album-hero-avatar { border:1px solid var(--gallery-border);background:transparent;color:var(--gallery-primary);box-shadow:none; }
.gallery-album-wrap .album-hero-stats { color:var(--gallery-text-muted); }
.gallery-album-wrap .album-stat i { color:var(--fl-champagne,#dfc28b); }
.gallery-album-wrap .album-hero-description { max-width:68ch;margin:0 0 1.25rem;color:var(--gallery-text-secondary);font-family:var(--fl-serif,Georgia,serif);font-size:clamp(1.1rem,2vw,1.35rem);line-height:1.65; }
.gallery-album-wrap .album-taxonomy { margin-bottom:1.2rem; }
.gallery-album-wrap .album-taxonomy .tag { border:0;border-bottom:1px solid var(--gallery-border);border-radius:0;background:transparent; }
.gallery-album-wrap .album-hero-actions { gap:0;margin-top:1.35rem;padding-top:.65rem;border-top:1px solid var(--gallery-border); }
.gallery-album-wrap .album-hero-actions .album-action-btn,
.gallery-album-wrap .album-hero-actions .follow-control {
  min-height:38px;
  margin:.35rem .25rem .35rem 0;
  padding:.5rem .78rem;
  border:0;
  border-right:1px solid var(--gallery-border);
  border-radius:0;
  background:transparent;
  color:var(--gallery-text-secondary);
  box-shadow:none;
}
.gallery-album-wrap .album-hero-actions .album-action-btn:hover,
.gallery-album-wrap .album-hero-actions .follow-control:hover,
.gallery-album-wrap .album-hero-actions .follow-control.is-active { background:transparent;color:var(--gallery-primary);transform:none; }
.gallery-album-wrap .album-grid--masonry {
  display:block;
  columns:3 260px;
  column-gap:clamp(1rem,2.5vw,1.75rem);
  margin-bottom:clamp(3rem,7vw,5rem);
}
.gallery-album-wrap .album-grid-item {
  display:inline-block;
  width:100%;
  margin:0 0 clamp(1.4rem,3vw,2rem);
  overflow:visible;
  break-inside:avoid;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
}
.gallery-album-wrap .album-grid-item:hover { border:0;box-shadow:none;transform:none; }
.gallery-album-wrap .album-grid-item a { height:auto;overflow:hidden;background:#080507; }
.gallery-album-wrap .album-grid-item img { width:100%;height:auto;object-fit:contain; }
.gallery-album-wrap .album-grid-item:hover img { transform:scale(1.015); }
.album-grid-caption { display:flex;justify-content:space-between;gap:1rem;padding:.7rem 0;border-bottom:1px solid var(--gallery-border);color:var(--gallery-text-muted);font-size:.68rem;line-height:1.4; }
.album-grid-caption span:first-child { min-width:0;color:var(--gallery-text-secondary);overflow-wrap:anywhere; }
.album-grid-caption span:last-child { color:var(--gallery-primary);white-space:nowrap; }
.gallery-album-wrap .single-image-container { margin-bottom:clamp(3rem,7vw,5rem);padding-block:clamp(1rem,3vw,2rem);border-bottom:1px solid var(--gallery-border); }
.gallery-album-wrap .single-image-container img { border-radius:0;box-shadow:none; }
.gallery-album-wrap .album-meta-section { margin:0 0 clamp(3rem,7vw,5rem);padding:1.5rem 0;border-block:1px solid var(--gallery-border);border-inline:0;border-radius:0;background:transparent; }
.gallery-album-wrap .album-meta-grid { gap:0; }
.gallery-album-wrap .album-meta-block { padding-right:2rem; }
.gallery-album-wrap .album-meta-block + .album-meta-block { padding-left:2rem;border-left:1px solid var(--gallery-border); }
.gallery-album-wrap .album-meta-block h4 { color:var(--fl-champagne,#dfc28b);letter-spacing:.14em; }
.gallery-album-wrap .album-meta-block span { color:var(--gallery-text-secondary);line-height:1.55; }
.gallery-album-wrap .gallery-discovery { margin-top:clamp(3rem,7vw,5rem);padding-top:1.4rem;border-top:1px solid var(--gallery-border); }
.gallery-album-wrap .discovery-title { margin:0 0 1.5rem;color:var(--gallery-text);font:500 clamp(1.65rem,3vw,2.2rem)/1 var(--fl-serif,Georgia,serif); }
.gallery-album-wrap .discovery-grid { grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:clamp(1rem,2.5vw,1.7rem); }
.gallery-album-wrap .gallery-card--discovery { border:0;border-radius:0;background:transparent;box-shadow:none; }
.gallery-album-wrap .gallery-card--discovery:hover { transform:translateY(-3px);box-shadow:none; }
.gallery-album-wrap .gallery-card--discovery img { border-radius:0; }
.gallery-album-wrap .gallery-card--discovery .gallery-card-info { padding:.75rem 0;border-bottom:1px solid var(--gallery-border); }
.gallery-album-wrap .gallery-card--discovery .gallery-card-title { color:var(--gallery-text);font-family:var(--fl-serif,Georgia,serif);font-size:1.05rem; }
.gallery-album-wrap .gallery-card--discovery .gallery-card-author { color:var(--gallery-text-muted); }

@media (max-width:680px) {
  .gallery-album-wrap .album-hero-content { padding:2rem 0; }
  .gallery-album-wrap .album-hero-title { font-size:clamp(3rem,17vw,4.75rem); }
  .gallery-album-wrap .album-hero-description { display:block; }
  .gallery-album-wrap .album-hero-stats { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%; }
  .gallery-album-wrap .album-grid--masonry { columns:2 140px;column-gap:.75rem; }
  .gallery-album-wrap .album-grid-item { margin-bottom:1rem; }
  .album-grid-caption { align-items:flex-start;flex-direction:column;gap:.15rem; }
  .gallery-album-wrap .album-meta-grid { grid-template-columns:1fr; }
  .gallery-album-wrap .album-meta-block { padding:0 0 1.25rem; }
  .gallery-album-wrap .album-meta-block + .album-meta-block { padding:1.25rem 0 0;border-top:1px solid var(--gallery-border);border-left:0; }
}

/* Album mobile presentation: compact editorial header and calm artwork flow. */
.gallery-album-wrap img.album-hero-avatar {
  display:block;
  object-fit:cover;
  object-position:center;
}

@media (max-width:680px) {
  .gallery-album-wrap {
    width:100%;
    max-width:100%;
    padding:1.25rem 1rem 3.5rem;
  }
  .gallery-album-wrap > .back-pill {
    margin-bottom:1.5rem;
  }
  .gallery-album-wrap .album-hero {
    margin-bottom:2.25rem;
  }
  .gallery-album-wrap .album-hero-content {
    padding:1.5rem 0 1.65rem;
  }
  .gallery-album-wrap .album-hero-title {
    max-width:100%;
    margin-bottom:1.5rem;
    font-size:clamp(2.75rem,15vw,4.15rem);
    line-height:.9;
  }
  .gallery-album-wrap .album-hero-meta {
    display:grid;
    grid-template-columns:minmax(0,1fr);
    gap:1.15rem;
    margin-bottom:1.15rem;
    padding-bottom:1.15rem;
  }
  .gallery-album-wrap .album-hero-creator {
    display:grid;
    grid-template-columns:52px minmax(0,1fr);
    gap:.85rem;
    width:100%;
  }
  .gallery-album-wrap .album-hero-avatar {
    width:52px;
    height:52px;
    flex-basis:52px;
  }
  .gallery-album-wrap .album-hero-creator-name {
    font-size:1.12rem;
    line-height:1.2;
  }
  .gallery-album-wrap .album-hero-date {
    margin-top:.2rem;
    font-size:.76rem;
  }
  .gallery-album-wrap .album-hero-stats {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:.5rem;
    width:100%;
  }
  .gallery-album-wrap .album-stat {
    display:grid;
    grid-template-columns:auto minmax(0,1fr);
    gap:.4rem;
    align-items:center;
    min-width:0;
    font-size:.72rem;
    line-height:1.25;
  }
  .gallery-album-wrap .album-hero-description {
    margin-bottom:1rem;
    font-size:1.08rem;
    line-height:1.55;
  }
  .gallery-album-wrap .album-hero-actions {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:.55rem;
    margin-top:1.1rem;
    padding-top:1rem;
  }
  .gallery-album-wrap .album-hero-actions .album-action-btn,
  .gallery-album-wrap .album-hero-actions .follow-control {
    justify-content:center;
    width:100%;
    min-width:0;
    min-height:44px;
    margin:0;
    padding:.65rem .55rem;
    border:1px solid var(--gallery-border);
    border-radius:999px;
    background:rgba(255,248,239,.025);
    font-size:.72rem;
    line-height:1.1;
    text-align:center;
  }
  .gallery-album-wrap .album-hero-actions .album-action-btn:hover,
  .gallery-album-wrap .album-hero-actions .follow-control:hover,
  .gallery-album-wrap .album-hero-actions .follow-control.is-active {
    border-color:var(--gallery-primary);
    background:var(--gallery-primary-glow);
  }
  .gallery-album-wrap .album-meta-section {
    margin-bottom:2.75rem;
  }
}

@media (max-width:520px) {
  .gallery-album-wrap .album-grid--masonry {
    columns:1;
    column-gap:0;
  }
  .gallery-album-wrap .album-grid-item {
    margin-bottom:1.5rem;
  }
  .gallery-album-wrap .album-grid-caption {
    align-items:center;
    flex-direction:row;
    gap:1rem;
  }
}

@media (max-width:350px) {
  .gallery-album-wrap .album-hero-stats,
  .gallery-album-wrap .album-hero-actions {
    grid-template-columns:minmax(0,1fr);
  }
}

.viewer-author {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: inherit;
  text-decoration: none;
}
.viewer-author img,
.viewer-author .initial-avatar {
  width: 34px;
  height: 34px;
  display: inline-grid;
  flex: 0 0 34px;
  place-items: center;
  object-fit: cover;
  border: 1px solid var(--gallery-border);
  border-radius: 50%;
  background: var(--gallery-primary-glow);
  color: var(--gallery-primary);
  font-style: normal;
}
.viewer-author:hover strong { color: var(--gallery-primary); }
