/* =====================================================================
 * design_edit.css — component styles for the shared landing DESIGN/EDIT
 * module (modules/design_edit/design_edit.php).
 *
 * COLOURS: strictly from the shared settings tokens declared in
 * assets/keystone.css :root (var(--ink), var(--line), var(--bg-*),
 * var(--muted) …). The per-product accent arrives as a scoped custom
 * property --de-accent (set inline by design_edit_render() to a settings
 * brand token, e.g. var(--brand-solar)) so NOTHING here is hard-coded hex.
 * Cache-busted with the estate ?v= (config asset_version).
 * ===================================================================== */

.de-landing {
  --de-accent: var(--brand-core);          /* fallback until render sets it */
  color: var(--ink);
  font: inherit;
}
.de-landing * { box-sizing: border-box; }

/* ---- admin edit bar + affordances (never rendered on the public face) --- */
.de-editbar {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  padding: .5rem .75rem; margin-bottom: 1rem;
  background: var(--bg-3); border: 1px solid var(--line-2);
  border-radius: var(--c-radius-input, 8px);
}
.de-editbar__tag {
  font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: #fff; background: var(--de-accent); padding: .15rem .5rem; border-radius: 999px;
}
.de-editbar__hint { color: var(--muted); font-size: .84rem; }

.de-section { position: relative; padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.de-section:last-child { border-bottom: 0; }
.de-section--admin { background: var(--bg-2); }

.de-section__afford {
  position: absolute; top: .5rem; right: 0;
  display: inline-flex; align-items: center; gap: .5rem;
}
.de-section__vis {
  font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em;
  padding: .1rem .45rem; border-radius: 999px;
  color: var(--ink-2); background: var(--bg-3); border: 1px solid var(--line-2);
}
.de-section__vis--admin { color: var(--de-accent); border-color: var(--de-accent); }
.de-edit-btn {
  font-size: .78rem; cursor: pointer;
  color: var(--ink); background: #fff; border: 1px solid var(--line-2);
  border-radius: var(--c-radius-input, 8px); padding: .2rem .55rem;
}
.de-edit-btn:hover { background: var(--bg-3); }

/* ---- render primitives ------------------------------------------------- */
.de-hero { padding: 1rem 0 1.5rem; }
.de-hero__headline { margin: 0 0 .35rem; font-size: 2rem; line-height: 1.1; color: var(--ink); }
.de-hero__subhead { margin: 0 0 1rem; font-size: 1.1rem; color: var(--ink-2); }

.de-h2 { margin: 0 0 .75rem; font-size: 1.3rem; color: var(--ink); }
.de-prose { margin: 0; color: var(--ink-2); line-height: 1.6; }

.de-feature-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.de-feature { padding: .9rem; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--c-radius-input, 8px); }
.de-feature__title { margin: 0 0 .3rem; font-size: 1rem; color: var(--ink); }
.de-feature__body { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }

.de-cta { padding: 1.25rem 0; text-align: center; }
.de-cta__headline { margin: 0 0 .75rem; font-size: 1.5rem; color: var(--ink); }

.de-btn {
  display: inline-block; text-decoration: none; cursor: pointer;
  padding: .5rem .95rem; border-radius: var(--c-radius-input, 8px);
  font-weight: 600; border: 1px solid transparent;
}
.de-btn--accent { color: #fff; background: var(--de-accent); }
.de-btn--accent:hover { filter: brightness(1.05); }

.de-fields { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: .35rem .9rem; }
.de-fields__k { color: var(--muted); font-size: .85rem; }
.de-fields__v { color: var(--ink-2); font-size: .9rem; }

.de-empty, .de-locked { color: var(--muted); font-style: italic; }

/* ---- editor form ------------------------------------------------------- */
.de-form { display: grid; gap: 1rem; }
.de-form__palette { display: grid; gap: .3rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line); }
.de-form__section {
  border: 1px solid var(--line-2); border-radius: var(--c-radius-input, 8px);
  padding: .9rem 1rem; display: grid; gap: .6rem;
}
.de-form__legend { font-weight: 700; color: var(--ink); display: inline-flex; align-items: center; gap: .5rem; padding: 0 .35rem; }
.de-form__vis {
  font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em;
  padding: .08rem .4rem; border-radius: 999px; color: var(--ink-2);
  background: var(--bg-3); border: 1px solid var(--line-2);
}
.de-form__vis--admin { color: var(--de-accent, var(--brand-core)); border-color: currentColor; }
.de-form__row { display: grid; gap: .25rem; }
.de-form__label { font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.de-form__hint { font-size: .8rem; color: var(--muted); }
.de-form__input {
  font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line-2); border-radius: var(--c-radius-input, 8px);
  padding: .4rem .55rem; width: 100%;
}
.de-form__input:focus { outline: 2px solid var(--de-accent, var(--brand-core)); outline-offset: 1px; }
.de-form__input--json { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; }
.de-form__actions { display: flex; justify-content: flex-end; }
