/* authoring.css — Content Studio (back-office CMS) layout.
   Uses the design tokens from theme.css (--surface, --border, --ink, …). */

.astudio {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body, "Nunito", system-ui, sans-serif);
}
.ascroll { overflow-y: auto; }
.arow { display: flex; align-items: center; }
.acol { display: flex; flex-direction: column; }
.agap { gap: 12px; }
.abetween { justify-content: space-between; }
.agrow { flex: 1; min-width: 0; }
.atrunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amuted { color: var(--ink-soft); }
.amono { font-family: ui-monospace, monospace; }

/* ---- sidebar ---- */
.aside {
  border-right: 2px solid var(--border);
  background: var(--surface);
  display: flex; flex-direction: column;
}
.abrand { display: flex; align-items: center; gap: 10px; padding: 16px 14px; border-bottom: 2px solid var(--border); }
.alogo {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--primary); color: var(--primary-ink, #fff); font-weight: 800; font-family: var(--font-display, "Fredoka", sans-serif);
}
.asearch { padding: 10px 12px; }
.asearch input, .ameta input, .ameta select, .atitle, .aitembody input, .aitembody select, .amininum input {
  width: 100%; border: 2px solid var(--border); border-radius: 10px; padding: 9px 11px;
  background: var(--surface-2); color: var(--ink); font: inherit; outline: none;
}
.asearch input:focus, .ameta input:focus, .ameta select:focus, .aitembody input:focus, .aitembody select:focus { border-color: var(--primary); }
/* native selects → consistent field look with a custom chevron */
.ameta select, .aitembody select {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  cursor: pointer; padding-right: 30px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center;
}
.atree { flex: 1; padding: 6px 8px; }
.atree-subjhead { display: flex; align-items: center; gap: 8px; font-weight: 700; padding: 10px 8px 4px; font-family: var(--font-display, sans-serif); }
.adot { width: 10px; height: 10px; border-radius: 3px; }
.atree-reghead { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-soft); padding: 8px 10px 4px; }
.atree-skill {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: none;
  background: transparent; color: var(--ink); cursor: pointer; border-radius: 9px; text-align: left; font: inherit;
}
.atree-skill:hover { background: var(--surface-2); }
.atree-skill.on { background: color-mix(in oklab, var(--primary) 14%, var(--surface)); }
.astatusdot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.acount { font-size: 12px; color: var(--ink-soft); background: var(--surface-2); border-radius: 20px; padding: 1px 8px; }

/* ---- main editor ---- */
.amain { padding: 26px clamp(18px, 4vw, 48px); }
.askillhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.acrumb { color: var(--ink-soft); font-size: 13px; }
.acrumb span { margin: 0 6px; }
.atitle { font-size: 24px; font-weight: 700; font-family: var(--font-display, sans-serif); border-color: transparent !important; background: transparent !important; padding-left: 0 !important; }
.atitle:focus { border-color: var(--primary) !important; background: var(--surface-2) !important; padding-left: 11px !important; }
.acard { background: var(--surface); border: 2px solid var(--border); border-radius: 14px; padding: 16px; }
.ameta { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.afield { display: flex; flex-direction: column; gap: 5px; }
.alabel { font-size: 13px; font-weight: 700; font-family: var(--font-display, sans-serif); }
.afhint { font-size: 11.5px; color: var(--ink-soft); font-weight: 400; }
.ah3 { font-size: 18px; font-family: var(--font-display, sans-serif); }

.abtn { border: 2px solid var(--border); border-radius: 10px; padding: 8px 14px; background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; font-weight: 600; }
.abtn:hover { border-color: var(--primary); }
.abtn.aprimary { background: var(--primary); color: var(--primary-ink, #fff); border-color: var(--primary); }
.abtn.aghost { background: transparent; }
.abtn.afull { width: calc(100% - 24px); justify-content: center; display: flex; gap: 6px; }
.aplus { font-weight: 800; }
.alink { background: none; border: none; cursor: pointer; font: inherit; color: var(--ink-soft); padding: 0; }
.alink.adanger { color: var(--danger); }

/* ---- item editor ---- */
.aitem { margin-bottom: 12px; padding: 0; overflow: hidden; }
.aitemhead { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: transparent; border: none; cursor: pointer; font: inherit; color: var(--ink); }
.aidx { width: 22px; height: 22px; border-radius: 6px; background: var(--surface-2); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.achip2 { font-size: 11px; background: color-mix(in oklab, var(--primary) 16%, var(--surface)); color: var(--primary); border-radius: 20px; padding: 1px 8px; }
.acaret { color: var(--ink-soft); }
.aitembody { padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 14px; border-top: 2px solid var(--border); }
.ablock { display: flex; flex-direction: column; gap: 8px; }
.adistractor { display: flex; align-items: center; gap: 8px; }
.adval { max-width: 90px; }
.aarrow { color: var(--ink-soft); }
.adwhy { flex: 1; }
.amininum { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-soft); }
.amininum input { width: 80px; }
.avizprev { margin-top: 6px; padding: 12px; border: 2px dashed var(--border); border-radius: 12px; background: var(--surface-2); }
.asaved { font-size: 12px; }

.aempty, .aempty2 { color: var(--ink-soft); text-align: center; padding: 30px; }
.aempty2 p { margin: 0 0 12px; }

.astatusbtn { border: 2px solid var(--border); border-radius: 8px; padding: 5px 10px; background: transparent; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; }

@media (max-width: 760px) {
  .astudio { grid-template-columns: 1fr; }
  .aside { display: none; }
}
