/* Word Editor — word.sanderkaatee.nl */

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --border: #e2e5ea;
  --border-strong: #c9cfd8;
  --text: #1f2430;
  --muted: #68717d;
  --accent: #2f6fed;
  --accent-strong: #255ed3;
  --accent-soft: #e9effd;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.07);
}

* { box-sizing: border-box; }

html,
body { margin: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

/* ---------- header / footer ---------- */

.app-header {
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 16px 10px;
  text-align: center;
}

.app-header h1 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: -0.01em;
}

.tagline {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.app-footer {
  max-width: 900px;
  margin: 0 auto;
  padding: 8px 16px 36px;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.app-footer p { margin: 0; }

/* ---------- page / actions ---------- */

.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.spacer { flex: 1 1 auto; }

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  padding: 8px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: var(--shadow);
}

.btn:hover { border-color: var(--border-strong); background: #fafbfd; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.privacy {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.file-status {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------- formatting toolbar ---------- */

.toolbar {
  position: sticky;
  top: 8px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  margin-top: 14px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.tb {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  height: 32px;
  min-width: 34px;
  padding: 0 9px;
  border-radius: 6px;
  cursor: pointer;
}

.tb:hover { background: #f0f2f5; }

.tb.active {
  background: var(--accent-soft);
  border-color: #c8d8fb;
  color: var(--accent-strong);
}

.tb .b { font-weight: 700; }
.tb .i { font-style: italic; font-family: Georgia, serif; }
.tb .u { text-decoration: underline; }
.tb .s { text-decoration: line-through; }

.tb-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 6px;
}

/* ---------- notices ---------- */

.notice { display: none; }

.notice.show {
  display: block;
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  border: 1px solid;
}

.notice.info  { background: var(--accent-soft); border-color: #c8d8fb; color: #274d9f; }
.notice.warn  { background: #fff6e5; border-color: #eeda9f; color: #7a5a10; }
.notice.error { background: #fdecec; border-color: #f0bcbc; color: #8c2733; }

/* ---------- the document sheet ---------- */

.editor {
  margin: 14px auto 0;
  max-width: 820px;
  min-height: 60vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 56px 60px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  line-height: 1.7;
  outline: none;
  overflow-wrap: break-word;
}

.editor:focus {
  border-color: #b7c9f3;
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.12);
}

.editor:empty::before {
  content: attr(data-placeholder);
  color: #9aa2ad;
  pointer-events: none;
}

.editor h1 { font-size: 1.9rem; line-height: 1.25; margin: 0.2em 0 0.5em; }
.editor h2 { font-size: 1.5rem; line-height: 1.3; margin: 1.1em 0 0.4em; }
.editor h3 { font-size: 1.2rem; margin: 1.1em 0 0.35em; }
.editor p { margin: 0 0 1em; }
.editor ul,
.editor ol { margin: 0 0 1em; padding-left: 1.6em; }
.editor img { max-width: 100%; height: auto; }
.editor blockquote {
  margin: 0 0 1em;
  padding-left: 1em;
  border-left: 3px solid var(--border);
  color: #4b5563;
}
.editor table { border-collapse: collapse; margin: 0 0 1em; }
.editor td,
.editor th { border: 1px solid #d4d8de; padding: 6px 10px; }
.editor a { color: var(--accent); }

/* ---------- drag-and-drop overlay ---------- */

#drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(47, 111, 237, 0.08);
  border: 3px dashed var(--accent);
  pointer-events: none;
}

body.dragging #drop-overlay { display: flex; }

.drop-hint {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  padding: 18px 28px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
}

/* ---------- small screens ---------- */

@media (max-width: 640px) {
  .app-header { padding-top: 20px; }
  .editor { padding: 28px 20px; min-height: 50vh; }
  .btn { padding: 8px 12px; }
}
