:root {
  --bg: #f5f3ee;
  --ink: #1d1d1f;
  --accent: #1a3a5c;
  --gold: #c0a060;
  --muted: #6e6e73;
  --card: #ffffff;
  --border: #e3ddd0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

.topbar {
  padding: 1.5rem 2rem;
  background: var(--accent);
  color: #fff;
  border-bottom: 4px solid var(--gold);
}

.topbar h1 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
}

.topbar .tagline {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  opacity: 0.85;
}

.layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
}

.form-pane, .output-pane {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
}

.form-pane label {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.form-pane label > span {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.form-pane label em {
  font-style: normal;
  color: var(--muted);
  font-weight: 400;
  font-size: 0.8rem;
  margin-left: 0.4rem;
}

.form-pane input,
.form-pane textarea,
.form-pane select {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.95rem;
  background: #fafaf7;
}
.form-pane select { cursor: pointer; }

.form-pane textarea { resize: vertical; }

.form-pane input:focus,
.form-pane textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}

#submit-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.75rem 1.2rem;
  font-size: 1rem;
  cursor: pointer;
  width: 100%;
  font-weight: 600;
  letter-spacing: 0.02em;
}

#submit-btn:hover:not(:disabled) { background: #244e7a; }
#submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.status {
  margin-top: 1rem;
  font-size: 0.85rem;
  min-height: 1.4em;
  white-space: pre-wrap;
  word-break: break-word;
}
.status.error { color: #b3261e; }
.status.working { color: var(--accent); }
.status.done { color: #1f7a1f; }

.placeholder {
  color: var(--muted);
  text-align: center;
  padding: 4rem 1rem;
  font-style: italic;
}

.post img { width: 100%; height: auto; border-radius: 6px; margin-bottom: 1.25rem; }

.meta-block {
  background: #faf7ee;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}
.meta-block strong { color: var(--accent); }
.meta-block code {
  background: #f0ebd8;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.85em;
}

.article-body {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #2a2a2c;
}

.article-body h1 { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 2rem; }
.article-body h2 { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin-top: 2rem; }
.article-body h3 { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }

.actions {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.actions a, .actions button {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.5rem 0.9rem;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
}

.actions a:hover, .actions button:hover { background: #faf7ee; border-color: var(--gold); }

.publish-btn {
  background: var(--gold) !important;
  color: #fff !important;
  border-color: var(--gold) !important;
  font-weight: 600;
}
.publish-btn:hover:not(:disabled) { background: #a8893a !important; }
.publish-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* WordPress settings panel */
.wp-settings {
  margin-top: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
}
.wp-settings summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
  list-style: none;
}
.wp-settings summary::-webkit-details-marker { display: none; }
.wp-settings summary::before { content: "▸ "; }
.wp-settings[open] summary::before { content: "▾ "; }
.wp-fields { margin-top: 0.75rem; }
.wp-fields label { margin-bottom: 0.75rem; }
.wp-fields input { background: #fafaf7; }

/* ── Animated work-in-progress panel ──────────────────────────────────────── */
.progress {
  text-align: center;
  padding: 2.5rem 1.5rem 2rem;
  max-width: 460px;
  margin: 0 auto;
}

/* Spinning ring with a glyph in the middle */
.progress-orb {
  position: relative;
  width: 84px;
  height: 84px;
  margin: 0 auto 1.25rem;
}
.orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-right-color: var(--accent);
  animation: orb-spin 1s linear infinite;
}
.orb-glyph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  animation: orb-bob 1.8s ease-in-out infinite;
}
@keyframes orb-spin { to { transform: rotate(360deg); } }
@keyframes orb-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

.progress-title {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1.25rem;
  margin: 0 0 0.35rem;
  color: var(--accent);
}
.progress-sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 1.5rem;
  min-height: 1.3em;
}

/* Step list */
.steps {
  list-style: none;
  padding: 0;
  margin: 0 auto 1.5rem;
  text-align: left;
  max-width: 300px;
}
.steps li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.4rem 0;
  font-size: 0.95rem;
  color: var(--muted);
  transition: color 0.3s ease;
}
.steps .dot {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: #fff;
  position: relative;
  transition: border-color 0.3s ease, background 0.3s ease;
}
/* Pending → active → done */
.steps li.active { color: var(--ink); font-weight: 600; }
.steps li.active .dot {
  border-color: var(--gold);
  animation: dot-pulse 1.1s ease-in-out infinite;
}
.steps li.done { color: var(--accent); }
.steps li.done .dot {
  border-color: var(--accent);
  background: var(--accent);
}
.steps li.done .dot::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192, 160, 96, 0.5); }
  50%      { box-shadow: 0 0 0 6px rgba(192, 160, 96, 0); }
}

/* Indeterminate moving shimmer bar — proves work is ongoing */
.shimmer {
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
  max-width: 300px;
  margin: 0 auto 1rem;
}
.shimmer span {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  animation: shimmer-slide 1.3s ease-in-out infinite;
}
@keyframes shimmer-slide {
  0%   { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

.progress-note {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  .orb-ring, .orb-glyph, .steps li.active .dot, .shimmer span { animation: none; }
  .orb-ring { border-top-color: var(--gold); }
}

/* ── Embedded asset (table/quiz) preview ─────────────────────────────────── */
.embed-preview {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.embed-preview-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
}
.embed-preview iframe {
  width: 100%;
  height: 640px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
