/* ============================================================
   EDITORIAL THEME — AirSelects
   Scoped under body.theme-editorial
   Load after root2.css. Remove class to revert.
   ============================================================ */

/* ─── Token Overrides ─── */
body.theme-editorial {
  scroll-padding-top: 70px;
  --color-surface: #050505;
  --color-surface-elevated: #0c0c0c;
  --color-surface-overlay: rgba(3,3,3,0.97);
  --color-text-primary: #e8e6e1;
  --color-text-muted: #666;
  --color-accent-cream: #c8b88a;
  --color-accent-gold: #c8b88a;
  --color-favorite: #c8b88a;
  --star-color: #c8b88a;
  --fav-color: #c8b88a;
  --light-red-color: #c8b88a;

  --primary-dark-color: #050505;
  --seconary-dark-color: #050505;
  --third-dark-color: #0c0c0c;
  --primay-light-color: #e8e6e1;
  --secondary-light-color: #888;
  --regular-blue-color: #c8b88a;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-header: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

  --default-border-radius: 2px;

  background-color: #050505 !important;
  --light-blue-color: #c8b88a;
  --preloader-color: #c8b88a;
  font-family: var(--font-body) !important;
}

/* ─── Film Grain ─── */
body.theme-editorial::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 99999;
  pointer-events: none;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px;
}

/* ============================================================
   NAVBAR — Full cohesive restyle
   ============================================================ */
.theme-editorial #gallerynav-container {
  background: #050505 !important;
  border-bottom: 1px solid #1a1a1a !important;
}

.theme-editorial #gallery-navbar {
  background: transparent !important;
}

.theme-editorial #nav-hr {
  display: none !important;
}

/* Brand text logo */
.theme-editorial .brand-text {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-size: 20px;
  color: #e8e6e1;
  letter-spacing: 0.01em;
}

.theme-editorial .brand a {
  text-decoration: none !important;
}

/* Nav items */
.theme-editorial .navbar-item {
  font-family: var(--font-mono) !important;
  font-size: 10px !important;
  font-weight: 400 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  color: #444 !important;
  transition: color 0.2s !important;
}

.theme-editorial .navbar-item:hover {
  color: #888 !important;
}

.theme-editorial .navbar-item.active {
  border-bottom-color: var(--color-accent-gold) !important;
  color: var(--color-text-primary) !important;
}

/* Clusters + Invite buttons */
.theme-editorial .header-cluster-btn,
.theme-editorial .header-invite-btn {
  font-family: var(--font-mono) !important;
  font-size: 9px !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  background: transparent !important;
  border: 1px solid #1a1a1a !important;
  border-radius: 3px !important;
  color: #444 !important;
  padding: 6px 14px !important;
  transition: all 0.2s !important;
}

.theme-editorial .header-cluster-btn .title,
.theme-editorial .header-invite-btn .title {
  font-family: var(--font-mono) !important;
  font-size: 9px !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
}

.theme-editorial .header-cluster-btn:hover,
.theme-editorial .header-invite-btn:hover {
  border-color: #333 !important;
  color: #888 !important;
}

.theme-editorial .header-cluster-btn.action-active {
  border-color: var(--color-accent-gold) !important;
  color: var(--color-accent-gold) !important;
}

.theme-editorial .header-divider {
  background: #1a1a1a !important;
}

.theme-editorial .nav-badge {
  background: var(--color-accent-gold) !important;
  color: #050505 !important;
  font-family: var(--font-mono) !important;
  font-size: 9px !important;
  border-radius: 3px !important;
}

/* ============================================================
   GALLERY GRID — Override Bootstrap columns for tight contact sheet
   ============================================================ */

/* Expand the gallery container to use more width */
.theme-editorial #gallery-container {
  max-width: none !important;
  width: auto !important;
  flex: 1 !important;
  padding: 0 2px !important;
  margin-top: 0 !important;
  margin-right: 0 !important;
  margin-bottom: 0 !important;
}

/* Override Bootstrap col classes on gallery container */
.theme-editorial #gallery-container.col-10,
.theme-editorial #gallery-container.col-md-6,
.theme-editorial #gallery-container.col-lg-6 {
  width: auto !important;
  max-width: none !important;
  flex: 1 !important;
}

/* Override Bootstrap offset — sidebar margin */
.theme-editorial #gallery-container.offset-1,
.theme-editorial #gallery-container.offset-md-3 {
  margin-left: 60px !important;
}

/* Main container — no extra margin, let gallery-container handle it */
.theme-editorial .gallery-main,
.theme-editorial main#main-container {
  margin-left: 0 !important;
  padding-left: 0 !important;
}

/* Push breadcrumbs right to match + add bottom padding so filmstrip isn't covered */
.theme-editorial #breadcrumbs-wrapper {
  left: 60px !important;
  z-index: 1035 !important;
}

/* Images container — CSS Grid instead of Bootstrap row */
.theme-editorial .images-container {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 6px !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Override Bootstrap col classes on individual image items */
.theme-editorial .image-item {
  width: 100% !important;
  max-width: 100% !important;
  flex: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  position: relative;
}

.theme-editorial .image-item .image {
  border-radius: 0 !important;
  transition: transform 0.4s ease !important;
  background-position: center top !important;
}

.theme-editorial .image-item:hover .image {
  transform: scale(1.03);
}

/* Frame number edge overlay */
.theme-editorial .image-item .editorial-edge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 22px;
  background: linear-gradient(transparent, rgba(0,0,0,0.55));
  display: flex;
  align-items: flex-end;
  padding: 0 6px 3px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
  z-index: 2;
}

.theme-editorial .image-item:hover .editorial-edge {
  opacity: 1;
}

.theme-editorial .editorial-edge .frame-num {
  font-family: var(--font-mono);
  font-size: 9px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.03em;
}

/* Heart / favorite restyle — always show faint heart, full on hover/voted */
.theme-editorial .fav-btn,
.theme-editorial .unfav-btn {
  opacity: 0.3 !important;
  transition: all 0.2s !important;
}

.theme-editorial .image-item:hover .fav-btn,
.theme-editorial .image-item:hover .unfav-btn {
  opacity: 0.7 !important;
}

.theme-editorial .image-item.favorited .fav-btn,
.theme-editorial .image-item.favorited .unfav-btn {
  opacity: 1 !important;
}

.theme-editorial .fav-btn svg path,
.theme-editorial .unfav-btn svg path {
  transition: all 0.15s !important;
}

/* Select button restyle */
.theme-editorial .select-btn svg .circle {
  stroke: rgba(255,255,255,0.4) !important;
}

.theme-editorial .select-btn:hover svg .circle {
  fill: rgba(200,184,138,0.3) !important;
  stroke: var(--color-accent-gold) !important;
}

/* Staggered load */
@keyframes editorialFadeUp {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.theme-editorial .image-item {
  opacity: 0;
  animation: editorialFadeUp 0.4s ease forwards;
}

/* Shimmer */
@keyframes editorialShimmer {
  0% { background-position: -300px 0; }
  100% { background-position: 300px 0; }
}

.theme-editorial .image-skeleton {
  background: linear-gradient(90deg, #0c0c0c 0%, #151515 50%, #0c0c0c 100%) !important;
  background-size: 300px 100% !important;
  animation: editorialShimmer 1.4s ease infinite !important;
}

/* ============================================================
   MINIMAP — Hide original, replace with clean sidebar filmstrip
   ============================================================ */

/* Hide the original minimap completely */
.theme-editorial #gallery-minimap {
  display: none !important;
}

/* Editorial sidebar filmstrip (built by JS) */
.theme-editorial .editorial-sidebar {
  position: fixed;
  left: 0;
  top: 50px;
  bottom: 0;
  width: 56px;
  background: #050505;
  border-right: 1px solid #1a1a1a;
  padding: 8px 4px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  z-index: 9999;
  isolation: isolate;
}

.theme-editorial .editorial-sidebar::-webkit-scrollbar { display: none; }

.theme-editorial .editorial-sidebar .sidebar-label {
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #333;
  text-align: center;
  display: block;
  margin-bottom: 6px;
}

.theme-editorial .editorial-sidebar .sidebar-thumb {
  width: 100%;
  aspect-ratio: 4/5;
  border-radius: 1px;
  margin-bottom: 2px;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.2s;
  overflow: hidden;
  position: relative;
}

.theme-editorial .editorial-sidebar .sidebar-thumb:hover { opacity: 0.8; }
.theme-editorial .editorial-sidebar .sidebar-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.theme-editorial .editorial-sidebar .sidebar-thumb .sb-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #c8b88a;
  display: none;
}

.theme-editorial .editorial-sidebar .sidebar-thumb.voted .sb-dot { display: block; }

/* Hide sidebar + breadcrumbs when enlarged view is open */
body.theme-editorial[style*="overflow: hidden"] .editorial-sidebar,
body.theme-editorial[style*="overflow:hidden"] .editorial-sidebar {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

body.theme-editorial[style*="overflow: hidden"] #breadcrumbs-wrapper,
body.theme-editorial[style*="overflow:hidden"] #breadcrumbs-wrapper {
  display: none !important;
}

/* Gallery margin for sidebar */
.theme-editorial #gallery-container {
  margin-left: 60px !important;
}


/* Maintain sidebar gap on favorites tab */
.theme-editorial.favorites-tab #gallery-container {
  margin-left: 60px !important;
}

/* minimap-collapsed state not needed — minimap is hidden in editorial */

/* ============================================================
   CLUSTERS / SIMPLIFIED VIEW
   ============================================================ */
.theme-editorial .cluster-container {
  background: #0c0c0c !important;
  border-radius: 3px !important;
  padding: 6px !important;
  margin-bottom: 8px !important;
  border: 1px solid #1a1a1a !important;
}

.theme-editorial .cluster-container .images-container {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 4px !important;
}

.theme-editorial .parent-cluster {
  border-radius: 3px !important;
  border: 1px solid #1a1a1a !important;
  background: #0a0a0a !important;
}

.theme-editorial .parent-label {
  font-family: var(--font-display) !important;
  color: #888 !important;
  border-bottom: 1px solid #1a1a1a !important;
  background: #0c0c0c !important;
}

.theme-editorial .cluster-category {
  font-family: var(--font-mono) !important;
  font-size: 9px !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  color: #444 !important;
}

.theme-editorial .stacked-cluster-container {
  margin-bottom: 8px !important;
}

/* Cluster bookmark button */
.theme-editorial .bookmark-btn {
  color: #444 !important;
  transition: color 0.2s !important;
}

.theme-editorial .bookmark-btn:hover {
  color: var(--color-accent-gold) !important;
}

/* ============================================================
   ACTIONS PANEL (right sidebar)
   ============================================================ */
.theme-editorial #actions-section {
  background: #050505 !important;
  border-left: 1px solid #1a1a1a !important;
}

.theme-editorial #actions-section button,
.theme-editorial #actions-section a {
  border: 1px solid #1a1a1a !important;
  color: #444 !important;
  border-radius: 3px !important;
  background: transparent !important;
  transition: all 0.2s !important;
}

.theme-editorial #actions-section button:hover,
.theme-editorial #actions-section a:hover {
  border-color: #333 !important;
  color: #888 !important;
}

/* Grid layout FAB */
.theme-editorial #grid-layout-fab {
  border: 1px solid #1a1a1a !important;
  background: #0c0c0c !important;
  color: #444 !important;
  border-radius: 4px !important;
}

.theme-editorial #grid-layout-fab:hover {
  border-color: #333 !important;
  color: #888 !important;
}

/* Visual search FAB */
.theme-editorial .search-fab {
  border: 1px solid #1a1a1a !important;
  background: #0c0c0c !important;
  color: #444 !important;
  border-radius: 4px !important;
}

/* ============================================================
   SELECTION TOOLBAR
   ============================================================ */
.theme-editorial .selection-toolbar {
  background: #0c0c0c !important;
  border-bottom: 1px solid #1a1a1a !important;
  font-family: var(--font-mono) !important;
  font-size: 11px !important;
}

.theme-editorial .selection-toolbar button {
  font-family: var(--font-mono) !important;
  font-size: 10px !important;
  letter-spacing: 0.05em !important;
}

/* ============================================================
   BREADCRUMBS
   ============================================================ */
.theme-editorial #breadcrumbs-wrapper {
  background: #050505 !important;
  border-top: 1px solid #1a1a1a !important;
  font-family: var(--font-mono) !important;
  font-size: 10px !important;
  color: #444 !important;
  letter-spacing: 0.05em !important;
}

.theme-editorial #breadcrumbs-wrapper a {
  color: #666 !important;
}

/* ============================================================
   LAYOUT TOAST
   ============================================================ */
.theme-editorial #layout-toast {
  font-family: var(--font-mono) !important;
  font-size: 11px !important;
  letter-spacing: 0.05em !important;
  background: rgba(12,12,12,0.95) !important;
  border: 1px solid #1a1a1a !important;
  border-radius: 3px !important;
}

/* ============================================================
   CONTEXT MENU
   ============================================================ */
.theme-editorial .context-menu {
  background: #0c0c0c !important;
  border: 1px solid #1a1a1a !important;
  border-radius: 4px !important;
  font-family: var(--font-body) !important;
}

.theme-editorial .context-menu li {
  font-size: 12px !important;
  color: #888 !important;
}

.theme-editorial .context-menu li:hover {
  background: #151515 !important;
  color: var(--color-text-primary) !important;
}

/* ============================================================
   TOOLTIPS
   ============================================================ */
.theme-editorial #tooltip {
  background: #0c0c0c !important;
  border: 1px solid #1a1a1a !important;
  border-radius: 3px !important;
  font-family: var(--font-mono) !important;
  font-size: 10px !important;
  color: #888 !important;
}

/* ============================================================
   ENLARGED VIEW (Shadow DOM — uses inherited CSS variables)
   ============================================================ */
.theme-editorial enlarged-view {
  --ev-bg: rgba(3,3,3,0.97);
  --ev-accent: var(--color-accent-gold);
}

/* ============================================================
   FILMSTRIP (injected by filmstrip.js)
   ============================================================ */
.theme-editorial .filmstrip {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 76px;
  background: #0c0c0c;
  border-top: 1px solid #1a1a1a;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 40px;
  overflow-x: auto;
  scrollbar-width: none;
  z-index: 1050;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.theme-editorial .filmstrip::-webkit-scrollbar { display: none; }

.theme-editorial .filmstrip.visible {
  opacity: 1;
  pointer-events: all;
}

.theme-editorial .filmstrip-thumb {
  flex-shrink: 0;
  width: 76px;
  height: 50px;
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.2;
  transition: opacity 0.2s, outline-color 0.2s;
  outline: 2px solid transparent;
  outline-offset: 1px;
  position: relative;
  background: #111;
}

.theme-editorial .filmstrip-thumb:hover { opacity: 0.45; }

.theme-editorial .filmstrip-thumb.active {
  opacity: 1;
  outline-color: var(--color-accent-gold);
}

.theme-editorial .filmstrip-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.theme-editorial .filmstrip-thumb .strip-num {
  position: absolute;
  bottom: 2px;
  left: 3px;
  font-family: var(--font-mono);
  font-size: 7px;
  color: rgba(255,255,255,0.3);
}

.theme-editorial .filmstrip-thumb .strip-dot {
  position: absolute;
  bottom: 2px;
  right: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-accent-gold);
  display: none;
  box-shadow: 0 0 3px rgba(200,184,138,0.6);
}

.theme-editorial .filmstrip-thumb.faved .strip-dot {
  display: block;
}

/* ============================================================
   INVITE MODAL
   ============================================================ */
.theme-editorial .modal-content {
  background: #0c0c0c !important;
  border: 1px solid #1a1a1a !important;
  border-radius: 6px !important;
  color: var(--color-text-primary) !important;
}

.theme-editorial .modal-header {
  border-bottom: 1px solid #1a1a1a !important;
}

.theme-editorial .modal-footer {
  border-top: 1px solid #1a1a1a !important;
}


/* ============================================================
   CONTEXT MENU (gallery right-click)
   ============================================================ */
.theme-editorial .contextmenu-list {
  background: #0c0c0c !important;
  border: 1px solid #1a1a1a !important;
  border-radius: 4px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4) !important;
}

.theme-editorial .contextmenu-list > li > a {
  font-family: var(--font-body) !important;
  font-size: 12px !important;
  color: #888 !important;
}

.theme-editorial .contextmenu-list > li:hover {
  background: #151515 !important;
}

.theme-editorial .contextmenu-list > li:hover > a,
.theme-editorial .contextmenu-list > li > a:hover {
  color: #e8e6e1 !important;
}

/* ============================================================
   BUTTON SYSTEM
   ============================================================ */
.theme-editorial .btn--primary {
  background: #c8b88a !important;
  color: #050505 !important;
  border: none !important;
  border-radius: 3px !important;
  font-family: var(--font-mono) !important;
  font-size: 11px !important;
  letter-spacing: 0.05em !important;
}

.theme-editorial .btn--primary:hover {
  background: #d4d0c8 !important;
}

.theme-editorial .btn--secondary {
  background: transparent !important;
  border: 1px solid #1a1a1a !important;
  color: #888 !important;
  border-radius: 3px !important;
  font-family: var(--font-mono) !important;
  font-size: 11px !important;
  letter-spacing: 0.05em !important;
}

.theme-editorial .btn--secondary:hover {
  border-color: #333 !important;
  color: #e8e6e1 !important;
}

.theme-editorial .btn--ghost {
  background: transparent !important;
  border: none !important;
  color: #666 !important;
  font-family: var(--font-mono) !important;
  font-size: 11px !important;
}

.theme-editorial .btn--ghost:hover {
  color: #888 !important;
}

.theme-editorial .btn--danger {
  background: transparent !important;
  border: 1px solid #8a5a5a !important;
  color: #c88a8a !important;
  border-radius: 3px !important;
  font-family: var(--font-mono) !important;
  font-size: 11px !important;
}

.theme-editorial .btn--danger:hover {
  border-color: #c88a8a !important;
  background: rgba(138,90,90,0.1) !important;
}

.theme-editorial .btn--accent {
  background: #c8b88a !important;
  color: #050505 !important;
  border-radius: 3px !important;
  font-family: var(--font-mono) !important;
  font-size: 11px !important;
}

/* ============================================================
   FIND SIMILAR MODAL
   ============================================================ */
.theme-editorial .find-similar-modal-backdrop {
  background: rgba(3,3,3,0.9) !important;
}

.theme-editorial .find-similar-modal-content {
  background: #0c0c0c !important;
  border: 1px solid #1a1a1a !important;
  border-radius: 6px !important;
}

.theme-editorial .find-similar-modal-close {
  color: #444 !important;
}

.theme-editorial .find-similar-modal-close:hover {
  color: #888 !important;
}

.theme-editorial .find-similar-modal-subtitle {
  font-family: var(--font-mono) !important;
  color: #666 !important;
  font-size: 11px !important;
}

/* ============================================================
   FAVORITES SECTION NAV
   ============================================================ */
.theme-editorial .favs-section-nav {
  background: #050505 !important;
  border-bottom: 1px solid #1a1a1a !important;
}

.theme-editorial .favs-nav-pill {
  font-family: var(--font-mono) !important;
  font-size: 10px !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  color: #444 !important;
  border-radius: 2px !important;
}

.theme-editorial .favs-nav-pill:hover {
  color: #888 !important;
}

.theme-editorial .favs-nav-pill.active {
  color: #e8e6e1 !important;
  border-bottom-color: #c8b88a !important;
}

/* ============================================================
   CLOSE BUTTON
   ============================================================ */
.theme-editorial .close-btn {
  color: #444 !important;
  transition: color 0.2s !important;
}

.theme-editorial .close-btn:hover {
  color: #888 !important;
}

/* ============================================================
   DROPZONE STATES
   ============================================================ */
.theme-editorial .dz-preview {
  border: 1px solid #1a1a1a !important;
  border-radius: 3px !important;
  background: #0c0c0c !important;
}

.theme-editorial .dz-error-message {
  color: #c8b88a !important;
  font-family: var(--font-mono) !important;
  font-size: 11px !important;
}

.theme-editorial .dz-progress .dz-upload {
  background: #c8b88a !important;
}

/* ============================================================
   INPUT FOCUS STATES
   ============================================================ */
.theme-editorial input:focus,
.theme-editorial textarea:focus,
.theme-editorial select:focus {
  outline-color: #c8b88a !important;
  border-color: #333 !important;
  box-shadow: 0 0 0 1px rgba(200,184,138,0.2) !important;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
  .theme-editorial .images-container {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

@media (max-width: 768px) {
  .theme-editorial .images-container {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .theme-editorial .filmstrip {
    height: 60px;
    padding: 0 12px;
  }
  .theme-editorial .filmstrip-thumb {
    width: 56px;
    height: 38px;
  }
  .theme-editorial .brand a::after {
    font-size: 16px !important;
  }
}
