/* ============================================================
   site-v44.css — Client Logos manager in the staff dashboard
   (v2.4.0; v2.4.1 adds external logo links and the replace mode)
   New cj-logo-* selectors only. Reuses the dashboard's existing
   cards, drop zone and buttons; the home page carousel is untouched.
   ============================================================ */

/* ── Upload card ───────────────────────────────────────── */
.cj-logo-upload-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}
.cj-logo-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 176px;
  padding: 20px !important;
}
.cj-logo-drop .ttl { max-width: 100%; overflow-wrap: anywhere; }
.cj-logo-drop .cj-logo-preview { display: none; }
.cj-logo-drop.has-file .ic { display: none; }
.cj-logo-drop.has-file .cj-logo-preview {
  display: flex; align-items: center; justify-content: center;
  width: 156px; height: 72px; padding: 10px 16px; margin: 0 auto 12px;
  background: #ffffff;
  border: 1px solid rgba(20,33,61,0.08);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(20,33,61,0.05);
}
.cj-logo-drop .cj-logo-preview img {
  max-width: 124px; max-height: 44px; width: auto; height: auto;
  object-fit: contain; display: block;
}
.cj-logo-drop .cj-logo-nopreview { font-size: 11px; line-height: 1.4; color: #6B7280; text-align: center; }

/* File or link: the "or" divider and the image URL field */
.cj-logo-source { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cj-logo-or {
  display: flex; align-items: center; gap: 10px;
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: #9CA3AF;
}
.cj-logo-or::before, .cj-logo-or::after { content: ''; flex: 1; height: 1px; background: rgba(20,33,61,0.10); }
.cj-logo-source .cj-logo-url-group { margin-bottom: 0; }

.cj-logo-upload-side { display: flex; flex-direction: column; gap: 12px; }
.cj-logo-upload-side .input-group { margin-bottom: 0; }
.cj-logo-note { margin: 0; font-size: 12px; line-height: 1.5; color: #6B7280; }
.cj-logo-submit { display: flex; gap: 8px; margin-top: auto; }
.cj-logo-submit .btn { justify-content: center; }
.cj-logo-submit .btn-primary { flex: 1; }
.cj-logo-submit .btn[disabled] {
  opacity: .5; cursor: not-allowed;
  transform: none !important; box-shadow: none !important;
}
.cj-logo-submit [hidden], .cj-logo-upload-side .input-group[hidden] { display: none !important; }

/* Replace mode: the card and the tile being replaced are outlined */
.dash-card.cj-logo-upload.is-replacing { border-color: #4F8EDC !important; box-shadow: 0 0 0 3px rgba(79,142,220,0.15) !important; }
.cj-logo-tile.is-replacing { border-color: #4F8EDC; box-shadow: 0 0 0 3px rgba(79,142,220,0.18); }

/* ── Current logos ─────────────────────────────────────── */
.cj-logo-head { gap: 12px; flex-wrap: wrap; }
.cj-logo-count { font-weight: 500; color: #6B7280; }
.cj-logo-head-note { font-size: 12px; color: #6B7280; }

.cj-logo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 14px;
}
.cj-logo-tile {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid rgba(20,33,61,0.10);
  border-radius: 12px;
  transition: border-color .2s, box-shadow .2s, opacity .2s;
}
.cj-logo-tile:hover { border-color: rgba(79,142,220,0.35); box-shadow: 0 6px 16px -10px rgba(20,33,61,0.25); }
.cj-logo-tile.is-dragging { opacity: .45; border-style: dashed; border-color: #4F8EDC; }
.cj-logo-tile.is-new { border-color: #1F8A5B; box-shadow: 0 0 0 3px rgba(31,138,91,0.15); }
.cj-logo-tile.is-busy { opacity: .55; pointer-events: none; }
.cj-logo-tile.is-busy::after {
  content: '';
  position: absolute; top: 50%; left: 50%;
  width: 22px; height: 22px; margin: -11px 0 0 -11px;
  border: 2px solid rgba(79,142,220,0.25);
  border-top-color: #4F8EDC;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.cj-logo-bar { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.cj-logo-handle {
  flex: none; width: 12px; height: 18px;
  cursor: grab;
  background-image: radial-gradient(circle, #9CA3AF 1.4px, transparent 1.6px);
  background-size: 6px 6px;
}
.cj-logo-handle:active { cursor: grabbing; }
.cj-logo-pos { font-size: 12px; font-weight: 700; color: #6B7280; letter-spacing: .02em; }
.cj-logo-src {
  padding: 2px 8px; border-radius: 999px;
  background: rgba(79,142,220,0.10); color: #3A73BD;
  font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  cursor: help;
}
.cj-logo-move { margin-left: auto; display: flex; gap: 4px; }

.cj-logo-btn {
  height: 30px; min-width: 30px; padding: 0 12px;
  background: #f5f6f8;
  border: 1px solid rgba(20,33,61,0.06);
  border-radius: 6px;
  color: #14213D;
  font-size: 12px; font-weight: 600; line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.cj-logo-move .cj-logo-btn { width: 30px; padding: 0; }
.cj-logo-btn:hover:not([disabled]) { background: #4F8EDC; border-color: #4F8EDC; color: #ffffff; }
.cj-logo-btn.danger:hover:not([disabled]) { background: #ef4444; border-color: #ef4444; }
.cj-logo-btn[disabled] { opacity: .35; cursor: default; }
.cj-logo-btn:focus-visible { outline: 2px solid #4F8EDC; outline-offset: 2px; }

/* Thumbnail mirrors the home page tile: logo fits 124 × 44 on white */
.cj-logo-thumb {
  height: 84px;
  display: flex; align-items: center; justify-content: center;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid rgba(20,33,61,0.06);
  border-radius: 10px;
}
.cj-logo-thumb img {
  max-width: 124px; max-height: 44px; width: auto; height: auto;
  object-fit: contain; display: block;
}
.cj-logo-missing { font-size: 12px; font-weight: 600; color: #ef4444; text-align: center; }

.cj-logo-name {
  width: 100%;
  padding: 8px 10px;
  background: #ffffff;
  border: 1px solid rgba(20,33,61,0.15);
  border-radius: 8px;
  color: #14213D;
  font-size: 13px;
}
.cj-logo-name:focus { outline: none; border-color: #4F8EDC; box-shadow: 0 0 0 3px rgba(79,142,220,0.15); }
.cj-logo-name[disabled] { opacity: .6; }

.cj-logo-actions { display: flex; gap: 6px; }
.cj-logo-actions .cj-logo-btn { flex: 1; }

.cj-logo-empty {
  grid-column: 1 / -1;
  padding: 36px 16px;
  text-align: center;
  font-size: 13px; line-height: 1.6;
  color: #6B7280;
}
.cj-logo-empty .cj-logo-btn { margin-left: 6px; }

@media (max-width: 720px) {
  .cj-logo-upload-grid { grid-template-columns: 1fr; }
  .cj-logo-drop { min-height: 150px; }
  .cj-logo-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .cj-logo-handle { display: none; } /* touch screens reorder with the arrows */
}
