/* Makes Postorius look like gpots.org.
   Loaded after Bootstrap, so everything here wins. The palette and the
   body rules are copied from the main site's assets/style.css; if that
   file changes, change these to match. */

:root {
  --bg: #ffffff;
  --text: #1c1e21;
  --muted: #6a7075;
  --accent: #14566b;
  --accent-ink: #ffffff;
  --rule: #e3e6e8;
  --surface: #f6f8f9;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15181b;
    --text: #e6e8ea;
    --muted: #99a0a6;
    --accent: #7cc4dc;
    --accent-ink: #10242b;
    --rule: #2a2f34;
    --surface: #1b1f23;
  }
}

/* Retheme Bootstrap at the source. Most of its components read these. */
:root {
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-body-font-size: 17px;
  --bs-body-line-height: 1.65;
  --bs-border-color: var(--rule);
  --bs-link-color: var(--accent);
  --bs-link-hover-color: var(--accent);
  --bs-emphasis-color: var(--text);
  --bs-secondary-color: var(--muted);
  --bs-heading-color: var(--text);
}

body {
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  max-width: 48rem;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
}

/* Postorius wraps everything in .container-xxl; body already sets the width. */
.container-xxl, .container {
  max-width: none;
  width: auto;
  padding-left: 0;
  padding-right: 0;
}

/* ---- Masthead ---- */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.wordmark { text-decoration: none; color: inherit; }
.wordmark:hover { text-decoration: none; color: inherit; }

.wordmark-short {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.wordmark-long {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
}

.masthead nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.92rem;
}

.masthead nav a {
  color: var(--muted);
  text-decoration: none;
}

.masthead nav a:hover { color: var(--accent); }

.masthead nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

/* ---- Text ---- */

main { padding-top: 2.25rem; display: block; }

h1 {
  margin: 0 0 1.25rem;
  font-size: 1.7rem;
  line-height: 1.25;
  font-weight: 700;
}

h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.15rem;
  font-weight: 650;
}

h3, h4 {
  margin: 2rem 0 0.7rem;
  font-size: 1.02rem;
  font-weight: 650;
}

p { margin: 0 0 1.1rem; }

a { color: var(--accent); text-underline-offset: 0.15em; }

ul { padding-left: 1.2rem; }
li { margin-bottom: 0.35rem; }

hr {
  margin: 2.25rem 0;
  border: 0;
  border-top: 1px solid var(--rule);
  opacity: 1;
}

.muted, .text-muted { color: var(--muted) !important; }

/* ---- Forms ---- */

/* Postorius lays subscribe forms out as a Bootstrap horizontal grid with a
   2/8 column split. At this width a single column reads better. */
.form-horizontal .row > [class*="col-"] {
  flex: 0 0 100%;
  max-width: 100%;
}

.form-horizontal [class*="offset-"] { margin-left: 0; }

label, .col-form-label {
  font-size: 0.92rem;
  font-weight: 600;
  padding-bottom: 0.25rem;
}

.form-control, .form-select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--rule);
  border-radius: 2px;
  font-size: 1rem;
  padding: 0.5rem 0.7rem;
}

.form-control:focus, .form-select:focus {
  background: var(--bg);
  color: var(--text);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent);
}

.form-control::placeholder { color: var(--muted); }

.form-text, .helptext { color: var(--muted); font-size: 0.88rem; }

/* ---- Buttons ---- */

.btn {
  border-radius: 2px;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.5rem 1.1rem;
}

.btn-primary, .btn-success {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover, .btn-primary:focus,
.btn-success:hover, .btn-success:focus {
  background: color-mix(in srgb, var(--accent) 85%, var(--text));
  border-color: color-mix(in srgb, var(--accent) 85%, var(--text));
  color: var(--accent-ink);
}

.btn-secondary, .btn-default {
  background: transparent;
  border-color: var(--rule);
  color: var(--text);
}

.btn-danger {
  background: transparent;
  border-color: #b23c3c;
  color: #b23c3c;
}

.btn-danger:hover, .btn-danger:focus {
  background: #b23c3c;
  border-color: #b23c3c;
  color: #ffffff;
}

/* ---- Tables ---- */

.table-responsive, .table-wrap { overflow-x: auto; margin: 0 0 1.5rem; }

table, .table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
  color: var(--text);
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-striped-bg: var(--surface);
  --bs-table-striped-color: var(--text);
  --bs-table-border-color: var(--rule);
}

.table > :not(caption) > * > * { background: transparent; color: var(--text); }

thead th, .table thead th {
  padding: 0 0.9rem 0.5rem 0;
  text-align: left;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}

tbody td, .table tbody td {
  padding: 0.6rem 0.9rem 0.6rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: baseline;
}

.table-bordered > :not(caption) > * > * { border-width: 0 0 1px 0; }

/* ---- Tabs (the admin nav Postorius puts above list pages) ---- */

.nav-tabs {
  border-bottom: 1px solid var(--rule);
  gap: 0.25rem;
  margin-bottom: 1.75rem;
}

.nav-tabs .nav-link {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--muted);
  font-size: 0.92rem;
  padding: 0.4rem 0.7rem;
}

.nav-tabs .nav-link:hover { color: var(--accent); border-bottom-color: var(--rule); }

.nav-tabs .nav-link.active {
  background: transparent;
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

/* ---- Alerts ---- */

.alert {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 2px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  padding: 0.9rem 1.1rem;
}

.alert-error, .alert-danger { border-left-color: #b23c3c; }

/* ---- Footer ---- */

footer.footer {
  margin-top: 3.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.88rem;
  color: var(--muted);
}

footer.footer p { margin: 0 0 0.4rem; }
footer.footer a { color: var(--muted); }
footer.footer a:hover { color: var(--accent); }

/* ---- Bits salvaged from the Postorius and django-mailman3 stylesheets ----
   Those two files are not loaded here, because most of what they contain is
   the blue navbar and a sticky footer we do not want. These are the rules
   that were doing real work. */

.page-header {
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}

.page-header h1 { margin-top: 0; padding-top: 0; }

.margin-bottom { margin-bottom: 1em; }

ul.horizontal-list {
  list-style: none;
  padding-inline-start: 0;
  padding-bottom: 0;
  margin-bottom: 0;
}

ul.horizontal-list li { display: inline; }

.paginator { text-align: center; }
.paginator form { margin: 0 auto; }
.paginator form label { font-weight: normal; }
.paginator form.jump-to-page { display: none; }

table.header-matches td .errorlist { list-style-type: none; padding: 0; margin: 0; }
.header-matches-pending-changes { display: none; margin-left: 1rem; }
table.bans-current { width: auto; }
form.bans-add-form { margin-bottom: 2.5rem; }

/* ---- Narrow screens ---- */

@media (max-width: 34rem) {
  body { padding: 2rem 1.1rem 3rem; font-size: 16px; }
  .masthead { gap: 0.6rem; }
  h1 { font-size: 1.45rem; }
}
