/* ─── Edit toolbar ─────────────────────────────── */
#ed-bar {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--grey-900);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.22);
}

.ed-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 6px;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.ed-btn:hover { background: rgba(255,255,255,0.07); color: #fff; }
.ed-btn.active { color: var(--accent); }
.ed-btn svg { width: 15px; height: 15px; pointer-events: none; flex-shrink: 0; }

/* ─── Editable text highlights ──────────────────── */
body.editing [contenteditable="true"] { cursor: text; border-radius: 3px; }

body.editing [contenteditable="true"]:hover {
  outline: 1.5px dashed var(--accent-mid);
  outline-offset: 2px;
}

body.editing [contenteditable="true"]:focus {
  outline: 1.5px solid var(--accent);
  outline-offset: 2px;
  background: var(--accent-glow);
}

/* ─── Thumbnail image ───────────────────────────── */
.asset-thumb {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

.asset-thumb.loaded { display: block; }

/* ─── Upload hint overlay ───────────────────────── */
.asset-thumb-hint {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  color: transparent;
  pointer-events: none;
  transition: background 0.15s, color 0.15s;
  font: 500 12px/1 var(--font-body);
  letter-spacing: 0.02em;
  z-index: 5;
}

body.editing .asset-thumb-hint {
  cursor: pointer;
  pointer-events: auto;
}

body.editing .asset-card:hover .asset-thumb-hint {
  background: rgba(0,0,0,0.38);
  color: #fff;
}

.asset-thumb-hint svg { width: 18px; height: 18px; pointer-events: none; }

/* ─── Asset card edit button ────────────────────── */
.asset-card { position: relative; }

.asset-edit-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  background: var(--grey-900);
  color: rgba(255,255,255,0.6);
  border: none;
  border-radius: 5px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: color 0.15s;
}

body.editing .asset-edit-btn { display: flex; }
.asset-edit-btn:hover { color: #fff; }
.asset-edit-btn svg { width: 11px; height: 11px; pointer-events: none; }

/* ─── Asset edit panel ──────────────────────────── */
.asset-edit-panel {
  position: absolute;
  inset: 0;
  background: var(--grey-900);
  border-radius: 8px;
  padding: 10px;
  display: none;
  flex-direction: column;
  gap: 6px;
  z-index: 20;
}

.asset-edit-panel.open { display: flex; }

.asset-edit-panel input {
  font: 14px/1 var(--font-body);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  border-radius: 4px;
  padding: 6px 8px;
  outline: none;
  width: 100%;
}

.asset-edit-panel input:focus { border-color: var(--accent); }
.asset-edit-panel input::placeholder { color: rgba(255,255,255,0.25); }

.asset-edit-label {
  font: 500 11px/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  margin-top: 2px;
}

.asset-edit-close {
  align-self: flex-end;
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  cursor: pointer;
  font-size: 19px;
  line-height: 1;
  padding: 0;
  margin-bottom: 2px;
}

.asset-edit-close:hover { color: #fff; }

/* ─── URL input bars (shared across video, zip, CTA) */
.ed-url-wrap {
  display: none;
  gap: 8px;
  margin-bottom: 1rem;
  align-items: center;
}

body.editing .ed-url-wrap { display: flex; }

.ed-url-wrap input {
  flex: 1;
  font: 14px/1 var(--font-body);
  background: var(--grey-50);
  border: 1.5px solid var(--grey-200);
  border-radius: 6px;
  padding: 8px 12px;
  outline: none;
  color: var(--grey-800);
}

.ed-url-wrap input:focus { border-color: var(--accent); }
.ed-url-wrap input::placeholder { color: var(--grey-400); }

.video-url-set {
  font: 600 14px/1 var(--font-body);
  background: var(--grey-900);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.video-url-set:hover { background: var(--grey-700); }

/* ─── Video thumbnail ───────────────────────────── */
.video-thumb {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.video-thumb.loaded { display: block; }

/* Darken placeholder over thumbnail so play button stays readable */
.video-container.has-thumb .video-placeholder {
  position: relative;
  z-index: 1;
  background: rgba(0,0,0,0.32);
}

.video-container.has-thumb .video-placeholder__label {
  color: rgba(255,255,255,0.75);
}

/* Upload hint on the video container */
body.editing .video-container:hover .asset-thumb-hint {
  background: rgba(0,0,0,0.42);
  color: #fff;
}

/* ─── Video modal ───────────────────────────────── */
#video-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.82);
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

#video-modal.open { display: flex; }

.video-modal__box {
  position: relative;
  width: 92vw;
  max-width: 1265px;
}

.video-modal__frame iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  border: none;
  border-radius: 8px;
}

.video-modal__close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.video-modal__close:hover { background: rgba(255,255,255,0.2); }
.video-modal__close svg { width: 16px; height: 16px; pointer-events: none; }

/* ─── Print: hide editor UI ─────────────────────── */
@media print {
  #ed-bar,
  .asset-edit-btn,
  .asset-edit-panel,
  .ed-url-wrap { display: none !important; }
}
