/* Editor for the site: the site's navy and paper, one column, large targets. */

@font-face {
  font-family: 'Brygada 1918';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/brygada-1918-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('fonts/source-sans-3-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url('fonts/source-sans-3-italic.woff2') format('woff2');
}

:root {
  --navy: #0a2b4e;
  --navy-deep: #071d36;
  --paper: #f7f3ec;
  --sheet: #fffdf8;
  --ink: #17202c;
  --ink-soft: #4b5361;
  --rule: #d6ccbc;
  --accent: #a3322a;
  --ok: #2d6a3e;
  --on-navy: #f7f3ec;
  --serif: 'Brygada 1918', 'Iowan Old Style', Georgia, serif;
  --sans: 'Source Sans 3', 'Segoe UI', system-ui, sans-serif;
  --measure: 42rem;
  --radius: 4px;
  --target: 44px;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.55;
  overflow-wrap: break-word;
}

img {
  max-width: 100%;
  height: auto;
}

h1,
h2 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  color: var(--navy);
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 {
  font-size: clamp(1.8rem, 1.5rem + 1.2vw, 2.3rem);
}
h2 {
  font-size: 1.35rem;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--navy);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover {
  color: var(--accent);
}

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

[hidden] {
  display: none !important;
}

.muted {
  color: var(--ink-soft);
}

/* Header */
.top {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.top-inner,
main {
  max-width: calc(var(--measure) + 32px);
  margin-inline: auto;
  padding-inline: 16px;
}
.top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 60px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: var(--target);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--navy);
  text-decoration: none;
}
.brand img {
  width: 32px;
  height: 32px;
}

main {
  padding-block: 1.75rem 5rem;
}
main:focus {
  outline: none;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--target);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.7rem 1.3rem;
  border-radius: var(--radius);
  border: 2px solid var(--navy);
  background: var(--navy);
  color: var(--on-navy);
  text-decoration: none;
  cursor: pointer;
}
.button:hover {
  background: var(--navy-deep);
  border-color: var(--navy-deep);
  color: var(--on-navy);
}
.button[disabled] {
  opacity: 0.6;
  cursor: progress;
}
.button.secondary {
  background: transparent;
  color: var(--navy);
}
.button.secondary:hover {
  background: var(--sheet);
  color: var(--navy);
}
.button.wide {
  width: 100%;
}
.link-button {
  font: inherit;
  min-height: var(--target);
  padding: 0 0.25rem;
  background: none;
  border: 0;
  color: var(--navy);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  cursor: pointer;
}
.link-button:hover {
  color: var(--accent);
}
.link-button.danger {
  color: var(--accent);
}
.link-button[disabled] {
  color: var(--ink-soft);
  text-decoration: none;
  cursor: default;
}

.back {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  margin-bottom: 0.5rem;
}

/* Forms */
form {
  margin: 0;
}
.field {
  margin-bottom: 1.4rem;
}
.field > label,
.label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.label .optional,
.field > label .optional {
  font-weight: 400;
  color: var(--ink-soft);
}
.help {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin: 0.3rem 0 0;
}
.lede {
  color: var(--ink-soft);
  font-size: 1.1rem;
}
.input,
select.input {
  display: block;
  width: 100%;
  min-height: var(--target);
  font: inherit;
  color: var(--ink);
  background: var(--sheet);
  border: 1px solid var(--ink-soft);
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem;
}
.input:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 1px;
  border-color: var(--navy);
}
.input.code {
  font-size: 1.6rem;
  letter-spacing: 0.3em;
  font-variant-numeric: tabular-nums;
  max-width: 15rem;
}
.input.short {
  max-width: 12rem;
}
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}
.check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: var(--target);
  cursor: pointer;
}
.check input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--navy);
  flex: none;
}

.section {
  margin-top: 2.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
.section > h2 {
  margin-bottom: 0.25rem;
}
.section > .help:first-of-type {
  margin-bottom: 1rem;
}

/* One attachment or board member: a hairline between items, not boxes. */
.item {
  padding-block: 1rem;
  border-bottom: 1px solid var(--rule);
}
.item:first-child {
  border-top: 1px solid var(--rule);
}
.item .field {
  margin-bottom: 0.9rem;
}
.item-file {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
}
.items {
  margin-bottom: 1rem;
}
.docs {
  margin: 0.2rem 0 0.6rem 2rem;
}

.actions {
  margin-top: 2rem;
}
.actions .button {
  min-width: 10rem;
}
.danger-zone {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

/* Messages */
.message {
  margin: 0 0 1rem;
  padding-left: 0.9rem;
  border-left: 3px solid var(--navy);
}
.message.error {
  border-left-color: var(--accent);
  color: var(--accent);
}
.message.ok {
  border-left-color: var(--ok);
}
.message ul {
  margin: 0.3rem 0 0;
  padding-left: 1.2rem;
}
.message p {
  margin: 0;
}
.message .link-button {
  min-height: 0;
  padding: 0;
}
.progress {
  margin: 0 0 1rem;
  color: var(--ink-soft);
}

/* Start */
.new-sak {
  margin-bottom: 2.25rem;
}
.list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.list li {
  border-bottom: 1px solid var(--rule);
}
.list li:first-child {
  border-top: 1px solid var(--rule);
}
.list a {
  display: block;
  padding: 0.7rem 0;
  min-height: var(--target);
  text-decoration: none;
}
.list a:hover .list-title {
  color: var(--accent);
  text-decoration: underline;
}
.list-title {
  display: block;
  font-weight: 600;
  color: var(--navy);
}
.meta {
  display: block;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.waiting {
  color: var(--ink-soft);
}
.more {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  margin-top: 0.4rem;
}
.year {
  font-size: 1rem;
  font-family: var(--sans);
  font-weight: 600;
  color: var(--ink-soft);
  margin: 1.75rem 0 0.25rem;
}

/* Rich text */
.rich {
  border: 1px solid var(--ink-soft);
  border-radius: var(--radius);
  background: var(--sheet);
}
.rich:focus-within {
  outline: 3px solid var(--navy);
  outline-offset: 1px;
}
trix-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  border-radius: var(--radius) var(--radius) 0 0;
}
.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 4px;
}
.tools button {
  font: inherit;
  font-size: 0.95rem;
  min-height: var(--target);
  min-width: var(--target);
  padding: 0 0.6rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: none;
  color: var(--navy);
  cursor: pointer;
}
.tools button:hover {
  background: var(--sheet);
  border-color: var(--rule);
}
.tools button.trix-active {
  background: var(--navy);
  color: var(--on-navy);
}
.tools button:disabled {
  color: var(--rule);
  cursor: default;
  background: none;
  border-color: transparent;
}
.tools [data-trix-attribute='bold'] {
  font-weight: 700;
}
.tools [data-trix-attribute='italic'] {
  font-style: italic;
}
.link-dialog {
  padding: 0.6rem;
  border-top: 1px solid var(--rule);
}
.link-dialog .dialog-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
trix-editor.rich-text {
  display: block;
  min-height: 12rem;
  padding: 0.8rem 0.9rem;
  border: 0;
  outline: none;
  font-size: 1.05rem;
  line-height: 1.6;
}
trix-editor.tall {
  min-height: 22rem;
}
trix-editor h1 {
  font-size: 1.35rem;
  margin: 0.6em 0 0.3em;
}
trix-editor ul,
trix-editor ol {
  padding-left: 1.4em;
}
trix-editor blockquote {
  border-left: 3px solid var(--navy);
  margin: 0;
  padding-left: 0.9em;
}
trix-editor .attachment__caption textarea {
  font: inherit;
}
trix-editor figure {
  margin: 0.6em 0;
}
trix-editor .attachment__caption {
  color: var(--ink-soft);
  font-size: 0.95rem;
}
trix-editor .attachment__toolbar .trix-button {
  font-size: 0.85rem;
}
.rich-note {
  margin: 0.4rem 0 0;
  font-size: 0.95rem;
  color: var(--accent);
}

/* Login dialog over a form */
dialog {
  width: min(28rem, calc(100vw - 32px));
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  padding: 1.5rem;
}
dialog::backdrop {
  background: rgba(7, 29, 54, 0.45);
}

@media (max-width: 30rem) {
  .row {
    grid-template-columns: 1fr;
  }
  .actions .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
fieldset.item {
  margin: 0;
  min-width: 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  padding: 1rem 0;
}
fieldset.item:first-child {
  border-top: 1px solid var(--rule);
}
h2.spaced {
  margin-top: 2.5rem;
}
.help.spaced-below {
  margin-bottom: 1.25rem;
}
trix-editor > div {
  margin-bottom: 0.7em;
}
