/* ============ Tokens, typography, buttons, form controls ============
   Ported from the static demo's css/style.css. Only what the product actually
   renders came across: the marketing hero, nav, pricing and logomaker rules
   have no surface in this app and would only be dead weight.

   Propshaft serves every file in this directory, alphabetically, so this file
   lands before chrome.css and can be overridden by it. */
:root {
  /* TEMPLATE (2026-11-20), the same palette as site/css/style.css, value for
     value. The variable NAMES are the ones both codebases have always used, so
     every rule downstream keeps working; only what they point at changed.
     --navy is dark ink, --blue is links and whatever is selected, --go is the
     filled button, --green is for things that are working, and the whys of
     each value live with the master copy in site/css/style.css. One product,
     one skin: a change there is a change here. Light only since 2026-11-21. */
  color-scheme: light;
  /* Charcoal since 2026-11-21 (Alex); the whys are in site/css/style.css. */
  --navy: #1f2328;
  --navy-2: #17191d;
  --navy-3: #2b3036;
  --blue: #3d4754;
  --blue-dark: #2b333d;
  --blue-soft: #f1f2f4;
  --blue-line: #d3d7dc;
  --link: #2c6c34;
  --link-hover: #1f5126;
  --on-blue: #ffffff;
  --amber: #80bc57;
  --amber-dark: #a16207;
  --warn-soft: #fdf5e6;
  --bg: #f4f5f6;
  --tint: #f4f5f6;
  --card: #ffffff;
  --text: #25282c;
  --muted: #4b5058;
  --muted-2: #5d626a;
  --faint: #6b7078;
  --line: #e4e6e9;
  --line-strong: #cdd1d6;
  --green: #15803d;
  --green-soft: #f0fdf4;
  --green-line: #bbf7d0;
  --red: #b42318;
  --red-soft: #fdf0ed;
  --red-line: #ecc8c0;
  --on-dark: #ffffff;
  --on-dark-dim: #c9ced4;
  /* Ember, DESIGN.md's accent: decoration only, with ink type on it, and only
     where DESIGN.md allows it. */
  --ember: #ff5a00;

  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 10px;

  /* Flat: hairlines do the work, and a shadow is for hover or for what
     floats. */
  --shadow-sm: none;
  --shadow-md: 0 6px 18px rgba(20, 22, 25, .08);
  --shadow-lg: 0 8px 24px rgba(20, 22, 25, .16);
  --shadow: var(--shadow-md);
  --glass: #23272c;
  --ring: rgba(61, 71, 84, .25);

  /* The inverse band: a flat dark surface with light type on it. */
  --hero-bg: #1f2328;
  --page: #ffffff;
  --go: #388541;
  --go-dark: #2c6c34;
  --on-go: #ffffff;
  --lime: #80bc57;
  --sky: #aeb4bb;
  --strip: #2a2e33;
  --footer: #16181b;
  --on-band: #eceff2;
  /* Grounds and a wash: the home hero's band, the two light picture grounds,
     and what a hovered control on the bar wears. */
  --hero-blue: linear-gradient(115deg, #1b1e22 0%, #2a2e34 52%, #24282d 100%);
  --picture: linear-gradient(160deg, #f7f7f8 0%, #e2e4e7 100%);
  --picture-deep: linear-gradient(160deg, #eeeff1 0%, #d5d8dc 100%);
  --on-dark-soft: rgba(255, 255, 255, .14);
  --ease: .18s cubic-bezier(.4, 0, .2, 1);

  /* The webfont is loaded from Google Fonts by the layout. Everything after it
     is a real stack rather than a bare `serif`/`sans-serif`, so a blocked or
     slow font request lands on something with comparable metrics. */
  --font-head: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 780px; }

/* One family, heavy headings, no tracking. */
h1, h2, h3 { font-family: var(--font-head); color: var(--navy); line-height: 1.14; letter-spacing: normal; }
h1 { font-size: 1.5rem; font-weight: 800; }
/* The demo centres h2 because every h2 it has is a marketing section heading.
   Every h2 here is a panel or section title inside an application page, so the
   product keeps them left. */
h2 { font-size: 1.15rem; font-weight: 700; text-align: left; }
h3 { font-size: 1.02rem; font-weight: 700; }

a { color: var(--link); text-decoration: none; transition: color var(--ease); }
a:hover { color: var(--link-hover); text-decoration: underline; }

p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .85em; color: var(--navy);
  background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px;
}

small { font-size: .82rem; color: var(--muted); }

/* ---------- Buttons ----------
   Three shapes reach a user as a button in this app: <a class="btn">, the
   <input type="submit"> that form.submit renders, and the <button> inside the
   <form class="button_to"> that button_to wraps around it. All three carry
   .btn and are matched here so they render identically. */
.btn,
.button_to button,
input[type="submit"] {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .875rem;
  padding: 11px 24px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  line-height: 1.4;
  transition: transform var(--ease), box-shadow var(--ease), background var(--ease),
              border-color var(--ease), color var(--ease);
}
.btn:hover, .button_to button:hover, input[type="submit"]:hover { text-decoration: none; }

/* button_to's wrapper form must not introduce a line break of its own, or a
   button sitting beside a link would drop below it. */
.button_to { display: inline-block; }
.button_to.btn-block { display: block; }

/* The filled button is the default: an unclassed submit or button_to is a
   form's primary action everywhere in this app, and the variants below opt out
   of it. Green (--go), the twin of .btn-primary in site/css/style.css. */
.btn-primary, .button_to button, input[type="submit"] {
  background: var(--go); color: var(--on-go);
}
.btn-primary:hover, .button_to button:hover, input[type="submit"]:hover {
  background: var(--go-dark); color: var(--on-go);
}
.btn.btn-ghost, .button_to button.btn-ghost, input[type="submit"].btn-ghost {
  background: var(--card); color: var(--blue); border-color: var(--blue); box-shadow: var(--shadow-sm);
}
.btn.btn-ghost:hover, .button_to button.btn-ghost:hover, input[type="submit"].btn-ghost:hover {
  border-color: var(--blue); color: var(--on-blue); background: var(--blue);
}
.btn.btn-danger, .button_to button.btn-danger {
  background: var(--card); color: var(--red); border-color: #fecaca; box-shadow: var(--shadow-sm);
}
.btn.btn-danger:hover, .button_to button.btn-danger:hover {
  background: #fef2f2; border-color: var(--red); color: #991b1b;
}
.btn-sm, .button_to button.btn-sm, input[type="submit"].btn-sm { padding: 8px 17px; font-size: .89rem; }
.btn-block, .button_to button.btn-block, input[type="submit"].btn-block { display: block; width: 100%; }

/* ---------- Form controls ----------
   Styled by element rather than by class: the console's filter bar and the
   portal's upload form are plain form_with markup, and adding a class to every
   field to reach them would be markup churn for nothing. */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  font-size: .95rem;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
  border-color: var(--blue); background: var(--card);
  box-shadow: 0 0 0 4px var(--ring);
}
/* A textarea somebody types raw HTML into reads as code, so it wears code's
   font - in the body font, nested tags are a grey wall. */
textarea.code-area {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem; line-height: 1.55; tab-size: 2; resize: vertical;
}
input[type="file"] {
  font-family: var(--font-body); font-size: .88rem; color: var(--muted);
  max-width: 100%;
}
label { font-weight: 600; font-size: .88rem; color: var(--navy); }
/* A phone zooms the whole page into any box drawn under 16px when it is
   tapped, and leaves it zoomed: that page and the next one are cut off at the
   right (Alex's iPhone after picking a time, 2026-11-29). The boxes above are
   .95rem and many sheets set smaller ones, so on a touch screen no box is
   under 16px whatever its own rule says, which is what !important is for.
   Buttons and ticks are left out: a phone does not zoom into those. */
@media (pointer: coarse) {
  select, textarea,
  input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"], [type="submit"], [type="button"], [type="reset"], [type="image"]) { font-size: 16px !important; }
}

/* The newsletter editor: a wide column for the words and a narrow one for
   the picture and the Facebook link, with the actions under both. A field is
   label, note, control, stacked, the note held to the control it describes. */
.issue-form { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 0 36px; align-items: start; }
.issue-form .field { margin-bottom: 20px; }
.issue-form .field label { display: block; margin-bottom: 6px; }
.issue-form .field .panel-note { margin: 0 0 8px; }
.issue-form .field summary { cursor: pointer; }
/* The tag list, which is its fold's own child - not the inline <code> in the
   sentence above it, which now sits inside the HTML fold too. */
.issue-form .field details > code { display: block; margin-top: 4px; }
.issue-form .panel-actions { grid-column: 1 / -1; margin-top: 0; }
/* Save, Preview and Cancel on the left; the test box and its button pushed
   to the right, the box no wider than an address. */
.issue-form .panel-actions label { margin-left: auto; }
.issue-form .panel-actions input[type="email"] { width: auto; flex: 0 1 240px; padding: 8px 12px; font-size: .89rem; }
.issue-form > .panel-hint { grid-column: 1 / -1; margin-top: 10px; }
@media (max-width: 860px) {
  .issue-form { grid-template-columns: 1fr; }
}

/* The body, edited as readers see it (see body_editor_controller). The box
   wears the mail's type - Arial 16px/1.5 in #222 on white, as
   town_issue_mailer/issue sets it - rather than the console's, because what
   is being checked in it is what a reader gets. The toolbar above it is the
   console's own. */
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.editor-toolbar button {
  font-family: var(--font-body); font-size: .82rem; padding: 5px 10px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--card); color: var(--text); cursor: pointer;
}
.editor-toolbar button:hover { border-color: var(--blue); }
/* The Image button's refusals, between the toolbar and the box. Two classes,
   to outrank .panel-hint's margin: 0 in chrome.css, which loads later. */
.body-editor > .panel-hint { margin: 0 0 8px; }
.editor-canvas {
  min-height: 420px; padding: 20px 18px;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff;
  font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 1.5; color: #222;
  overflow-wrap: anywhere;
}
.editor-canvas:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--ring); }
/* A mail client draws the body with no stylesheet but its own defaults; the
   console's rules above would dress it as a console page instead - zero
   margins from the reset, the console's headings in ink, links with no
   underline. `revert` hands each of those back to the browser's default,
   which is what the reader's client draws. Three classes deep so it outranks
   .admin-console .panel h2 and friends in chrome.css, which loads later. */
.issue-form .field .editor-canvas :is(h1, h2, h3, h4, p, ul, ol, li, blockquote, hr, a) {
  font-family: revert; font-size: revert; font-weight: revert; line-height: revert;
  letter-spacing: revert; color: revert; text-decoration: revert; margin: revert; padding: revert;
}
.editor-canvas img { max-width: 100%; height: auto; }
.editor-canvas table { max-width: 100%; }
.issue-form .field .body-source { margin-top: 10px; }
.issue-form .field .body-source > summary { font-size: .88rem; font-weight: 600; color: var(--navy); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
