:root {
  --green: #12443a;
  --green-deep: #0c2f28;
  --gold: #e0b341;
  --ink: #1a2421;
  --muted: #55625d;
  --line: #cdd5d0;
  --paper: #f2f4f2;
  --white: #fff;
  --danger: #a12a2a;
  --blurple: #5865f2;
  --serif: 'Bitter', Georgia, serif;
  --sans: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.6 var(--sans);
}

h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 2.25rem; font-weight: 700; }
h2 { font-size: 1.5rem; font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }

a { color: var(--green); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.masthead :focus-visible { outline-color: #fff; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.muted, .sub, .hint { color: var(--muted); }
.sub { display: block; font-size: .9rem; }
.hint { font-size: .9rem; margin: .25rem 0 0; }

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 8px; top: 8px; z-index: 20; background: #fff; padding: 8px 12px; }

/* ---------- masthead ---------- */
.masthead { background: var(--green); color: #fff; }
.masthead-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 18px; padding-bottom: 18px; }
.site-name { font: 700 1.6rem/1.1 var(--serif); color: #fff; text-decoration: none; }
.site-name:hover { text-decoration: underline; text-decoration-thickness: 2px; }

#account { display: flex; align-items: center; }
.who { display: flex; align-items: center; gap: 10px; text-align: right; }
.who img { width: 32px; height: 32px; border-radius: 50%; background: #fff; }
.who .name { display: block; font-weight: 600; line-height: 1.2; }
.who .role { display: block; font-size: .8rem; color: #c9dad3; line-height: 1.2; }
.link-light { background: none; border: 0; color: #fff; font: inherit; text-decoration: underline; cursor: pointer; padding: 4px; }

.discord-btn {
  display: inline-block; background: var(--blurple); color: #fff; text-decoration: none;
  font-weight: 600; padding: .55rem 1rem; border-radius: 3px;
}
.discord-btn:hover { background: #4752c4; }

.tabs { background: var(--green-deep); }
.tabs ul { display: flex; list-style: none; margin: 0; padding: 0; overflow-x: auto; }
.tabs li { flex: none; }
.tabs li.right { margin-left: auto; }
.tabs a {
  display: block; padding: 12px 16px 8px; color: #d3e0da; text-decoration: none;
  border-bottom: 4px solid transparent; font-weight: 500; white-space: nowrap;
}
.tabs a:hover { color: #fff; }
.tabs a[aria-current="page"] { color: #fff; border-bottom-color: var(--gold); }
.tabs a:focus-visible { outline-offset: -3px; }

main { padding-top: 32px; padding-bottom: 24px; }
main:focus { outline: none; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }

/* ---------- buttons and forms ---------- */
.btn {
  display: inline-block; background: var(--green); color: #fff; border: 1px solid var(--green);
  font: 600 1rem/1.3 var(--sans); padding: .55rem 1rem; border-radius: 3px; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--green-deep); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.secondary { background: #fff; color: var(--green); }
.btn.secondary:hover { background: #e8eeea; }
.btn.danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: #f8e9e9; }
.btn.small { padding: .3rem .65rem; font-size: .9rem; }
.link-btn { background: none; border: 0; padding: 0; color: var(--green); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.field { display: block; margin-bottom: 1rem; }
.field > span { display: block; font-weight: 600; margin-bottom: .25rem; }
input[type="text"], select, textarea {
  width: 100%; font: inherit; color: inherit; background: #fff;
  border: 1px solid #86928d; border-radius: 3px; padding: .55rem .65rem;
}
textarea { resize: vertical; }
input[type="file"] { max-width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

details.compose { margin-bottom: 20px; }
details.compose > summary { list-style: none; cursor: pointer; }
details.compose > summary::-webkit-details-marker { display: none; }
details.compose[open] > summary { margin-bottom: 16px; }
.compose-form { background: #fff; border: 1px solid var(--line); padding: 20px; max-width: 640px; }

/* ---------- home ---------- */
.manifesto { background: #fff; border: 1px solid var(--line); padding: 24px; margin-bottom: 40px; }
.manifesto h2 { margin-bottom: .25em; }
.mf-summary { font-size: 1.1rem; margin-bottom: 14px; }
.mf-bar { display: flex; gap: 3px; height: 28px; }
.mf-bar .seg { flex: 1; background: #dde4e0; }
.mf-bar .seg.on { background: var(--green); }
.mf-bar.solid { background: #dde4e0; display: block; }
.mf-bar.solid .fill { display: block; height: 100%; background: var(--green); }

.home { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; }
.stories { border-top: 2px solid var(--green); }
.story { padding: 20px 0; border-bottom: 1px solid var(--line); }
.story .from { font-weight: 600; margin: 0 0 2px; }
.story h3 { margin-bottom: .15em; }
.story .when { color: var(--muted); font-size: .9rem; margin-bottom: .6em; }
.story-body { white-space: pre-line; margin-bottom: .5em; }
.story .tools { display: flex; gap: 16px; }

.dept-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--green); }
.dept-list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.dept-list a { font-weight: 600; }
.empty { color: var(--muted); }

/* ---------- leadership ---------- */
.leadership { margin-bottom: 40px; }
.lead-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.leader { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 20px; background: #fff; border: 1px solid var(--line); padding: 20px; }
.leader.editing { grid-template-columns: 1fr; }
.leader .portrait.small { width: 130px; }
.leader h3 { margin-bottom: .25em; }
.leader-desc { white-space: pre-line; margin-bottom: .8em; }

/* ---------- news photos ---------- */
.thumbs { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 1rem; }
.thumb { display: grid; gap: 4px; justify-items: start; }
.thumb img { width: 110px; height: 82px; object-fit: cover; background: #dde4e0; }
.gallery { display: grid; gap: 8px; margin: 0 0 12px; max-width: 560px; }
.gallery a { display: block; }
.gallery img { display: block; width: 100%; background: #dde4e0; }
.gallery.g1 img { max-height: 380px; object-fit: cover; }
.gallery:not(.g1) { grid-template-columns: 1fr 1fr; }
.gallery:not(.g1) img { aspect-ratio: 4 / 3; object-fit: cover; }

/* ---------- department ---------- */
.holder {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px;
  background: #fff; border: 1px solid var(--line); padding: 24px; margin: 28px 0 44px;
}
.portrait { display: block; width: 220px; aspect-ratio: 4 / 5; object-fit: cover; background: #dde4e0; }
.portrait.blank { display: grid; place-items: center; color: var(--muted); font-size: .9rem; }
.holder-text h2 { margin-bottom: .2em; }
.appointment { font-weight: 600; color: var(--green); }
.holder-desc { white-space: pre-line; max-width: 62ch; }
.photo-tools { display: grid; gap: 10px; margin-top: 12px; justify-items: start; }

/* ---------- manage ---------- */
.panel { background: #fff; border: 1px solid var(--line); padding: 24px; margin-bottom: 32px; }
.panel h2 { font-size: 1.3rem; }
.dept-admin { border-top: 1px solid var(--line); padding: 22px 0; }
.dept-admin:first-of-type { border-top: 0; padding-top: 0; }
.dept-admin h3 { margin-bottom: .6em; }
.editors { list-style: none; margin: 0 0 12px; padding: 0; }
.editors li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.add-editor { display: flex; gap: 10px; max-width: 480px; }
.add-editor input { flex: 1; }

.loading { color: var(--muted); }
.foot { padding-top: 24px; padding-bottom: 48px; color: var(--muted); font-size: .9rem; }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 30;
  background: var(--ink); color: #fff; padding: .7rem 1rem; border-radius: 3px; max-width: min(90vw, 520px);
}
.toast.error { background: var(--danger); }

@media (max-width: 800px) {
  h1 { font-size: 1.8rem; }
  .home { grid-template-columns: 1fr; gap: 36px; }
  .lead-grid { grid-template-columns: 1fr; }
  .masthead-row { flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .holder { grid-template-columns: 1fr; gap: 18px; }
  .portrait { width: 100%; max-width: 220px; }
  .row { grid-template-columns: 1fr; }
  .add-editor { flex-direction: column; }
}
