/* columnist.mib.news — the desk's own stylesheet.
 * Baseline pass: structure, rhythm and states. The design pass (reference,
 * mechanics, the owner's cheap/expensive checklist) comes on top of this file.
 */

:root {
  --ink: #15171a;
  --ink-soft: #4d545c;
  --ink-faint: #767d86;
  --line: #e2e5e9;
  --paper: #ffffff;
  --paper-soft: #f7f8fa;
  --accent: #1f5fd8;
  --accent-ink: #ffffff;
  --bad: #b3261e;
  --good: #14733c;
  --wrap: 1120px;
  --radius: 8px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 640; letter-spacing: -.01em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

/* --- frame ------------------------------------------------------------- */

.masthead { border-bottom: 1px solid var(--line); background: var(--paper); }
.masthead .bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 62px; }
.brandmark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 650; }
.brandmark:hover { text-decoration: none; }
.nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.nav a { color: var(--ink-soft); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.nav a.button { color: var(--accent-ink); }
.nav a.button:hover { color: var(--accent-ink); }
.inline { display: inline; margin: 0; }

.main { min-height: 60vh; padding: 40px 0 72px; }

.footer { border-top: 1px solid var(--line); background: var(--paper-soft); padding: 28px 0; color: var(--ink-soft); font-size: .9rem; }
.footer__inner p { margin: 0 0 6px; }
.footer__meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--ink-faint); }

/* --- controls ----------------------------------------------------------- */

.button {
  display: inline-block; padding: 12px 20px; border: 0; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600;
  cursor: pointer; text-align: center;
}
.button:hover { text-decoration: none; filter: brightness(1.06); }
.button:disabled { opacity: .55; cursor: default; }
.button--small { padding: 8px 14px; font-size: .92rem; }
.button--quiet { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
.button--bad { background: var(--bad); }

.linklike { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.linklike--bad { color: var(--bad); }

.field { display: block; margin: 0 0 20px; }
.field__label { display: block; margin-bottom: 6px; font-size: .88rem; font-weight: 600; color: var(--ink-soft); }
.field__input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); color: var(--ink); font: inherit;
}
.field__input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.field__input--area { resize: vertical; min-height: 92px; }
.field__input--title { font-size: 1.3rem; font-weight: 650; }
.field__hint { display: block; margin-top: 6px; font-size: .84rem; color: var(--ink-faint); }
.field__error { display: block; margin-top: 6px; font-size: .86rem; color: var(--bad); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 20px; font-size: .94rem; color: var(--ink-soft); }

.alert { padding: 12px 14px; border-radius: var(--radius); background: var(--paper-soft); border: 1px solid var(--line); margin: 0 0 20px; }
.alert--bad { border-color: #f1c4c1; background: #fdf2f1; color: var(--bad); }
.alert--good { border-color: #bfe3cd; background: #f1faf4; color: var(--good); }

.lede { font-size: 1.06rem; color: var(--ink-soft); }
.hint { font-size: .88rem; color: var(--ink-faint); }
.empty { color: var(--ink-faint); padding: 32px 0; }

/* --- public face --------------------------------------------------------- */

.hero { padding: 24px 0 8px; }
.hero__title { font-size: clamp(2rem, 5vw, 3.2rem); max-width: 16ch; }
.hero__lead { max-width: 62ch; font-size: 1.08rem; color: var(--ink-soft); }
.hero__actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin: 24px 0 12px; }
.hero__figures { color: var(--ink-faint); }

.steps { padding: 24px 0; }
.steps__list { display: grid; gap: 24px; grid-template-columns: repeat(3, 1fr); list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps__list li { counter-increment: step; }
.steps__list h2 { font-size: 1.05rem; }
.steps__list h2::before { content: counter(step) ". "; color: var(--accent); }
.steps__list p { color: var(--ink-soft); margin: 0; }
.note { margin-top: 28px; padding: 16px 18px; border-left: 3px solid var(--accent); background: var(--paper-soft); color: var(--ink-soft); }

.section-title { font-size: 1.05rem; margin-top: 40px; }
.languages__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 40px; }
.languages__list li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.languages__count { color: var(--ink-faint); }

.prose { max-width: 70ch; }
.prose h2 { margin-top: 1.8em; font-size: 1.1rem; }
.prose__lead { color: var(--ink-soft); font-size: 1.05rem; }

/* --- forms --------------------------------------------------------------- */

.form-page { max-width: 460px; }
.form-page__aside { margin-top: 20px; color: var(--ink-soft); font-size: .94rem; display: flex; gap: 8px; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0 0 24px; }
.facts dt { color: var(--ink-faint); font-size: .9rem; }
.facts dd { margin: 0; }
.quote { margin: 0 0 24px; padding-left: 16px; border-left: 3px solid var(--line); color: var(--ink-soft); }
.plain-list { list-style: none; padding: 0; }

/* --- desk ---------------------------------------------------------------- */

.desk__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.desk__head h1 { margin: 0; }
.desk__limit { color: var(--ink-faint); font-size: .9rem; }

.panel { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-soft); margin-bottom: 24px; }
.panel--action { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.panel--action p { margin: 0; }
.panel--bad { border-color: #f1c4c1; background: #fdf2f1; }
.panel__title { font-size: 1rem; }

.columns { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.columns__row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.columns__title { font-size: 1.08rem; font-weight: 600; color: var(--ink); }
.columns__meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 6px 0 0; color: var(--ink-faint); font-size: .88rem; }
.columns__actions { display: flex; gap: 14px; align-items: center; flex-shrink: 0; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--paper-soft); border: 1px solid var(--line); color: var(--ink-soft); }
.tag--published { background: #f1faf4; border-color: #bfe3cd; color: var(--good); }
.tag--queued { background: #fff6e5; border-color: #f0d9a8; color: #8a5a00; }
.tag--withdrawn { background: #fdf2f1; border-color: #f1c4c1; color: var(--bad); }

/* --- profile -------------------------------------------------------------- */

.profile__grid { display: grid; grid-template-columns: 240px 1fr; gap: 40px; align-items: start; }
.profile__subtitle { font-size: 1rem; margin-top: 28px; }
.profile__photo .profile__subtitle { margin-top: 18px; }
.avatar { width: 160px; height: 160px; border-radius: 50%; overflow: hidden; background: var(--paper-soft); display: grid; place-items: center; border: 1px solid var(--line); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar__empty { font-size: 3rem; color: var(--ink-faint); }
.profile__photo-actions { display: flex; align-items: center; gap: 14px; }
.editions { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; }
.editions__host { color: var(--ink-faint); font-size: .86rem; }

.cropper { position: fixed; inset: 0; background: rgba(12, 14, 17, .62); display: grid; place-items: center; z-index: 20; }
.cropper__box { background: var(--paper); border-radius: 12px; padding: 22px; width: min(92vw, 380px); text-align: center; }
.cropper__box canvas { width: 100%; max-width: 320px; border-radius: 8px; touch-action: none; cursor: grab; }
.cropper__actions { display: flex; gap: 14px; align-items: center; justify-content: center; margin: 14px 0 0; }
#cropper-zoom { width: 100%; margin: 12px 0 0; }

/* --- editor --------------------------------------------------------------- */

.editor__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.editor__crumbs, .editor__status { margin: 0; display: flex; gap: 10px; align-items: center; color: var(--ink-faint); font-size: .9rem; }
.editor__saved { color: var(--good); }
.editor__grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; }

.toolbar { display: flex; gap: 6px; margin-bottom: 8px; }
.toolbar button { padding: 7px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); font: inherit; cursor: pointer; }
.toolbar button:hover { background: var(--paper-soft); }

.composer {
  min-height: 420px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 1.08rem; line-height: 1.7;
}
.composer:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.composer:empty::before { content: attr(data-placeholder); color: var(--ink-faint); }
.composer h2 { font-size: 1.2rem; margin: 1.4em 0 .4em; }
.composer h3 { font-size: 1.05rem; margin: 1.3em 0 .4em; }
.ed-photo { position: relative; margin: 1.6em 0; padding: 0; }
.ed-photo img { display: block; width: 100%; height: auto; border-radius: 4px; }
.ed-photo figcaption { margin-top: 8px; font-size: .88rem; color: var(--ink-soft); }
.ed-photo__drop { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(12,14,17,.72); color: #fff; font-size: 17px; line-height: 1; cursor: pointer; }

.side-block { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; }
.side-block__title { font-size: .86rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); margin: 0 0 8px; }
.side-block .field { margin-top: 14px; }
.side-block--actions { display: grid; gap: 12px; }
.cover { border: 1px dashed var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.cover img { display: block; width: 100%; height: auto; }
.cover__empty { padding: 22px 14px; color: var(--ink-faint); font-size: .88rem; text-align: center; }

.photo-dialog { border: 0; border-radius: 12px; padding: 24px; width: min(92vw, 420px); box-shadow: 0 20px 60px rgba(12,14,17,.22); }
.photo-dialog::backdrop { background: rgba(12,14,17,.55); }

/* --- narrow --------------------------------------------------------------- */

@media (max-width: 900px) {
  .steps__list { grid-template-columns: 1fr; gap: 18px; }
  .profile__grid { grid-template-columns: 1fr; gap: 28px; }
  .editor__grid { grid-template-columns: 1fr; gap: 24px; }
  .editor__side { order: -1; }
}

@media (max-width: 620px) {
  .main { padding: 24px 0 48px; }
  h1 { font-size: 1.6rem; }
  .masthead .bar { min-height: 56px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .nav { gap: 14px; font-size: .94rem; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .columns__row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .desk__head { flex-direction: column; align-items: flex-start; }
  .composer { min-height: 320px; padding: 14px 14px; }
}
