/* the publisher's pages */

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 0 0 26px;
  padding: 22px 16px;
  border: 2px dashed color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: 18px;
  background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface));
  text-align: center;
}

.dropzone .drop-title { margin: 0; font-size: 1.15rem; font-weight: 700; }
.dropzone p { margin: 0; }

.new-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  max-width: 640px;
  margin-top: 10px;
}

@media (min-width: 720px) { .new-actions { grid-template-columns: repeat(4, 1fr); } }
.big-action { min-height: 56px; }

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent) 80%, transparent);
  color: var(--accent-ink);
  font-size: 1.6rem;
  font-weight: 700;
  pointer-events: none;
}

/* ------------------------------------------------------------------------------------- the editor */

.editor-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}

.editor-bar .status { color: var(--muted); font-size: 0.9rem; margin-right: auto; }

.segmented { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); }
.segmented button {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.segmented button[aria-pressed="true"] { background: var(--surface); box-shadow: var(--shadow); }

.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.item { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--surface-2); }
.item .item-body { display: flex; flex-direction: column; gap: 8px; padding: 10px; }
.item textarea { min-height: 64px; font-size: 16px; }
.item .row { justify-content: space-between; }
.item.uploading { opacity: 0.7; }
.item .name { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-single img { aspect-ratio: auto; max-height: 60dvh; object-fit: contain; }

.add-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }

/* markdown editing: write and preview side by side on large screens, as tabs on a phone */
.md-editor { display: grid; gap: 12px; }
.md-tabs { display: flex; }
@media (min-width: 1000px) {
  .md-editor { grid-template-columns: 1fr 1fr; align-items: start; }
  .md-tabs { display: none; }
  .md-editor .pane[hidden] { display: flex !important; }
}
.pane { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.toolbar { display: flex; flex-wrap: nowrap; gap: 4px; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
.toolbar button {
  flex: none;
  min-width: 42px;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: 600 0.95rem var(--font);
  cursor: pointer;
}
.toolbar button:hover { border-color: var(--accent); }
textarea.source {
  min-height: 55dvh;
  font: 15px/1.55 var(--mono);
  tab-size: 2;
}
@media (max-width: 600px) { textarea.source { font-size: 16px; } }
.preview { min-height: 55dvh; max-height: 80dvh; overflow: auto; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.preview.slides-preview { padding: 0; min-height: 0; background: #111; }
.preview .deck-frame { height: min(60dvh, 70vw); border-radius: 0; box-shadow: none; }
.slides-nav { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 8px; color: #ddd; }
.slides-nav .btn { min-height: 38px; }

.attachments { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0; }
.attachment { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 92px; }
.attachment button.thumb { width: 92px; height: 70px; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface-2); cursor: pointer; }
.attachment button.thumb img { width: 100%; height: 100%; object-fit: cover; }
.attachment .name { max-width: 92px; font: 0.72rem var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.danger-zone { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); }
