/* ============================================================
   editor.css — chrome for the server-backed editor.
   Added 2026-08-11 alongside api/api.php. Kept separate from
   admin.css so the original login styling stays untouched.

   Mobile-first on purpose: Laurie edits from her phone, so
   controls are thumb-sized and Save is pinned to the bottom.
   ============================================================ */

.editor { max-width: 780px; margin: 0 auto; padding: 0 16px 110px; }

.ed-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px 0 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
}
.ed-brand {
  font-family: var(--display, inherit);
  letter-spacing: 2px; font-size: 1.05rem;
  color: var(--gold-soft, #f0d69a);
}
.ed-bar-actions { display: flex; gap: 14px; align-items: center; }
.ed-link {
  background: none; border: 0; padding: 8px 2px; cursor: pointer;
  font: inherit; font-size: .85rem; color: var(--ink-soft, #b9b4cc);
  text-decoration: underline; text-underline-offset: 3px;
}
.ed-link:hover { color: var(--gold, #e9c878); }

.ed-tabs { display: flex; gap: 8px; margin: 16px 0 22px; flex-wrap: wrap; }
.ed-tab {
  flex: 1 1 auto; min-height: 44px; padding: 10px 14px; cursor: pointer;
  font: inherit; font-size: .9rem;
  background: rgba(255, 255, 255, .04); color: var(--ink-soft, #b9b4cc);
  border: 1px solid rgba(255, 255, 255, .10); border-radius: 10px;
}
.ed-tab.is-on {
  background: rgba(233, 200, 120, .12);
  border-color: var(--gold, #e9c878);
  color: var(--gold-soft, #f0d69a);
}

.ed-group {
  font-family: var(--display, inherit);
  font-size: 1rem; letter-spacing: 2px; text-transform: uppercase;
  color: var(--gold-soft, #f0d69a);
  margin: 30px 0 14px; padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.ed-group:first-child { margin-top: 4px; }

.editor .field { display: block; margin: 0 0 18px; }
.editor .field > span { display: block; margin-bottom: 6px; font-size: .9rem; color: #ded9ee; }
.editor .field > span small { color: var(--ink-soft, #b9b4cc); font-weight: 400; }

.editor input, .editor textarea {
  width: 100%; box-sizing: border-box;
  padding: 12px 14px; border-radius: 10px;
  background: rgba(255, 255, 255, .05); color: #f2f0f8;
  border: 1px solid rgba(255, 255, 255, .12);
  font: inherit;
  font-size: 16px;          /* 16px keeps iOS from zooming in on focus */
  line-height: 1.5;
}
.editor textarea { resize: vertical; min-height: 88px; }
.editor input:focus, .editor textarea:focus {
  outline: 2px solid var(--gold, #e9c878); outline-offset: 1px;
}
.ed-help { display: block; margin-top: 6px; font-size: .78rem; color: var(--ink-soft, #b9b4cc); }

.ed-post {
  padding: 16px; margin: 0 0 16px; border-radius: 12px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(255, 255, 255, .09);
}
.ed-post-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ed-remove {
  background: none; border: 0; cursor: pointer; padding: 8px;
  font: inherit; font-size: .82rem; color: #e6a0a0; text-decoration: underline;
}

.ed-note {
  margin-top: 26px; padding: 14px 16px; border-radius: 10px;
  background: rgba(255, 255, 255, .03);
  border-left: 3px solid var(--gold, #e9c878);
  font-size: .86rem; line-height: 1.6; color: var(--ink-soft, #b9b4cc);
}

/* Save bar stays under the thumb */
.ed-save {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(14, 11, 24, .96);
  border-top: 1px solid rgba(255, 255, 255, .10);
  backdrop-filter: blur(8px);
}
.ed-save .btn { min-height: 46px; padding: 12px 26px; margin: 0; width: auto; }
.ed-status { font-size: .85rem; color: var(--ink-soft, #b9b4cc); }
.ed-status.is-ok  { color: #9fd9a8; }
.ed-status.is-bad { color: #ff9d9d; }

.btn-ghost { background: none; border: 1px dashed rgba(255, 255, 255, .25); color: var(--ink-soft, #b9b4cc); }
.btn-ghost:hover { border-color: var(--gold, #e9c878); color: var(--gold-soft, #f0d69a); }

@media (min-width: 700px) {
  .ed-tabs .ed-tab { flex: 0 0 auto; }
  .ed-save { justify-content: flex-end; }
  .ed-save .ed-status { margin-right: auto; }
}

/* Support session marker — makes it obvious at a glance that you are signed
   in as Mirage Net rather than as Laurie, so changes are never made under
   the wrong identity by mistake. */
.ed-brand.is-support {
  color: #86e3d6;
  font-size: .92rem;
  letter-spacing: 1px;
}
.ed-brand.is-support::before {
  content: "\25CF";
  color: #86e3d6;
  margin-right: 7px;
  font-size: .7em;
  vertical-align: middle;
}

/* ============================================================
   THE BUG THAT MADE EVERYTHING ONE LONG SCROLL
   ------------------------------------------------------------
   `.login-wrap { display: grid }` in admin.css overrode the
   `hidden` attribute's UA `display:none`, so the sign-in screen,
   the setup screen and the editor all rendered stacked on top of
   one another. This has to outrank any author display rule.
   ============================================================ */
[hidden] { display: none !important; }

/* ---- Gate: sign in first, setup tucked underneath ---------- */
.gate-setup {
  margin: 22px 0 4px;
  border-top: 1px solid rgba(255, 255, 255, .10);
  padding-top: 16px;
}
.gate-setup > summary {
  cursor: pointer;
  list-style: none;
  font-size: .88rem;
  color: var(--ink-soft, #b9b4cc);
  padding: 6px 0;
  text-align: center;
}
.gate-setup > summary::-webkit-details-marker { display: none; }
.gate-setup > summary::after {
  content: " \25BE";
  color: var(--gold, #e9c878);
}
.gate-setup[open] > summary::after { content: " \25B4"; }
.gate-setup > summary:hover { color: var(--gold-soft, #f0d69a); }
.gate-setup form { margin-top: 14px; }

/* ---- Editor: collapsible sections instead of one long list -- */
.ed-lead {
  margin: 0 0 18px;
  font-size: .92rem;
  line-height: 1.6;
  color: var(--ink-soft, #b9b4cc);
}
.ed-section {
  margin: 0 0 10px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 12px;
  background: rgba(255, 255, 255, .025);
  overflow: hidden;
}
.ed-section > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 14px 16px;
  font-family: var(--display, inherit);
  font-size: .95rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold-soft, #f0d69a);
}
.ed-section > summary::-webkit-details-marker { display: none; }
.ed-section > summary::after {
  content: "\25BE";
  font-size: .8rem;
  color: var(--gold, #e9c878);
}
.ed-section[open] > summary::after { content: "\25B4"; }
.ed-section[open] > summary { border-bottom: 1px solid rgba(255, 255, 255, .08); }
.ed-section-body { padding: 18px 16px 6px; }
