/* ==========================================================================
   LUMINA — NOTION/MEDIUM ZERO-CHROME CANVAS EDITOR
   ========================================================================== */

/* Reading Progress Bar */
.reading-progress-bar {
  position: fixed;
  top: 72px;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-active));
  z-index: 101;
  width: 0%;
  transition: width 50ms linear;
}

/* ── Article Reader ── */
.article-header {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-8);
}
.article-category { margin-bottom: var(--space-4); }
.article-title {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-4);
  color: var(--text-primary);
}
.article-lead {
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
}
.article-byline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
  font-size: 0.9rem;
  color: var(--text-muted);
}
.author-info { display: flex; align-items: center; gap: var(--space-3); }
.author-name { font-weight: 700; color: var(--text-primary); }
.article-hero-cover {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-8);
  border: 1px solid var(--border-subtle);
}
.article-hero-cover img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
}
.article-cover-caption {
  padding: var(--space-3) var(--space-4);
  background-color: var(--bg-surface);
  font-size: 0.825rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
}
.article-body {
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--text-primary);
}
.article-body p { margin-bottom: var(--space-6); }
.article-body h2 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
}
.article-body h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}
.article-body blockquote {
  border-left: 3px solid var(--text-primary);
  padding-left: var(--space-6);
  margin: var(--space-6) 0;
  font-size: 1.25rem;
  font-style: italic;
  line-height: 1.5;
}
.article-body hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: var(--space-8) 0;
}

/* ── Inline Photo in Published Articles ── */
.inline-photo-block {
  margin: var(--space-6) 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}
.inline-photo-block img {
  width: 100%;
  max-height: 600px;
  object-fit: cover;
  display: block;
}
.inline-photo-caption {
  padding: 10px 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  outline: none;
}

/* ===========================================================================
   ZERO-CHROME CANVAS EDITOR (The whole page IS the document)
   =========================================================================== */

.editor-shell {
  max-width: var(--max-width-article);
  margin: 0 auto;
  padding: var(--space-8) var(--space-4) var(--space-16);
}

/* Publish Bar — minimal, top-right */
.editor-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
}
.editor-topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.editor-pillar-pill {
  padding: 5px 16px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.editor-pillar-pill.active {
  background: var(--text-primary);
  color: var(--bg-canvas);
  border-color: var(--text-primary);
}
.btn-publish {
  padding: 8px 24px;
  border-radius: var(--radius-full);
  background: var(--text-primary);
  color: var(--bg-canvas);
  font-size: 0.9rem;
  font-weight: 700;
  transition: all var(--transition-fast);
}
.btn-publish:hover { opacity: 0.85; }

/* Title — huge, borderless, like Medium */
.editor-title-input {
  width: 100%;
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  background: transparent;
  border: none;
  outline: none;
  margin-bottom: var(--space-2);
  font-family: var(--font-sans);
}
.editor-title-input::placeholder {
  color: var(--text-muted);
  opacity: 0.4;
}

/* Byline — subtle */
.editor-byline-input {
  width: 100%;
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  outline: none;
  margin-bottom: var(--space-8);
  font-family: var(--font-sans);
}
.editor-byline-input::placeholder {
  color: var(--text-muted);
  opacity: 0.4;
}

/* Canvas — the main writing surface. No border, no box. Just text. */
.editor-canvas {
  width: 100%;
  min-height: 60vh;
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text-primary);
  outline: none;
  position: relative;
  caret-color: var(--accent-primary);
}
.editor-canvas:empty::before {
  content: 'Почніть писати тут...';
  color: var(--text-muted);
  opacity: 0.35;
  pointer-events: none;
}
.editor-canvas p { margin-bottom: var(--space-4); }
.editor-canvas h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}
.editor-canvas h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
}
.editor-canvas blockquote {
  border-left: 3px solid var(--text-primary);
  padding-left: var(--space-6);
  margin: var(--space-4) 0;
  font-style: italic;
  color: var(--text-secondary);
}
.editor-canvas ul, .editor-canvas ol {
  padding-left: var(--space-6);
  margin-bottom: var(--space-4);
}
.editor-canvas hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: var(--space-6) 0;
}

/* Drop overlay when dragging files onto canvas */
.editor-canvas.drag-over {
  background: var(--accent-subtle);
  border-radius: var(--radius-lg);
}

/* ── Inline Editor Photo Block ── */
.editor-canvas .inline-photo-block {
  position: relative;
  margin: var(--space-4) 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  user-select: none;
}
.editor-canvas .inline-photo-block img {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  display: block;
}
.editor-canvas .inline-photo-block figcaption {
  padding: 8px 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid var(--border-subtle);
  outline: none;
  user-select: text;
}
.photo-remove-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  z-index: 10;
  backdrop-filter: blur(4px);
  transition: all var(--transition-fast);
}
.photo-remove-btn:hover { background: rgba(220,38,38,0.9); }

/* ── Floating Format Bubble (appears on text selection) ── */
.format-bubble {
  position: absolute;
  display: none;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  background: var(--text-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-modal);
  z-index: 200;
  animation: bubblePop 120ms var(--ease-smooth) forwards;
}
.format-bubble.visible { display: flex; }
.format-bubble-btn {
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--bg-canvas);
  background: transparent;
  cursor: pointer;
  transition: background var(--transition-fast);
  white-space: nowrap;
}
.format-bubble-btn:hover { background: rgba(255,255,255,0.15); }
.format-bubble-divider {
  width: 1px;
  height: 16px;
  background: rgba(255,255,255,0.2);
  margin: 0 2px;
}

@keyframes bubblePop {
  from { opacity: 0; transform: translateY(6px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Plus (+) Block Inserter (appears on empty lines) ── */
.block-inserter {
  position: absolute;
  display: none;
  align-items: center;
  z-index: 100;
}
.block-inserter.visible { display: flex; }

.block-inserter-trigger {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-canvas);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  font-weight: 300;
  transition: all var(--transition-fast);
}
.block-inserter-trigger:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
  transform: rotate(90deg);
}

/* Inserter dropdown menu */
.block-inserter-menu {
  display: none;
  position: absolute;
  left: 36px;
  top: -4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-modal);
  padding: 6px;
  min-width: 200px;
  animation: bubblePop 120ms var(--ease-smooth) forwards;
}
.block-inserter-menu.open { display: block; }

.block-inserter-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.block-inserter-item:hover { background: var(--bg-surface-hover); }
.block-inserter-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

/* ── Bottom Metadata (file attach + deanon target) ── */
.editor-meta-footer {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-subtle);
}
.editor-meta-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}
.editor-file-drop {
  padding: var(--space-4);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.editor-file-drop:hover {
  border-color: var(--accent-primary);
  background: var(--accent-subtle);
}
.editor-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-top: var(--space-4);
}
