:root {
  --ink: #1f2528;
  --soft-ink: #4f5b62;
  --paper: #ffffff;
  --wash: #f4f6f1;
  --line: #dce3dd;
  --brand: #c1121f;
  --brand-dark: #7f1018;
  --green: #386641;
  --blue: #0f5d7c;
  --gold: #f4a261;
  --focus: #0077b6;
  --shadow: 0 20px 52px rgba(31, 37, 40, 0.11);
  --soft-shadow: 0 10px 32px rgba(31, 37, 40, 0.08);
  --radius: 8px;
  --sans: Calibri, "Segoe UI", Candara, Arial, Helvetica, sans-serif;
  --serif: Calibri, "Segoe UI", Candara, Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--wash);
  font-family: var(--sans);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--brand);
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(31, 37, 40, 0.02);
}

.top-strip {
  color: #fff;
  background: var(--ink);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
}

.top-strip-inner {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0;
}

.top-strip a {
  color: #fff;
  font-weight: 700;
}

.brand-row {
  min-height: 138px;
  display: grid;
  grid-template-columns: 380px minmax(280px, 1fr) 44px;
  align-items: center;
  gap: 28px;
}

.brand img {
  width: 360px;
}

.search-form {
  display: flex;
  align-items: center;
  max-width: 620px;
  margin-left: auto;
  border: 1px solid #cfd8d0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 6px 22px rgba(31, 37, 40, 0.05);
}

.search-form input {
  width: 100%;
  border: 0;
  padding: 14px 16px;
  outline: 0;
  font-size: 1.02rem;
}

.search-form button {
  border: 0;
  align-self: stretch;
  padding: 0 22px;
  color: #fff;
  background: var(--brand);
  cursor: pointer;
  font-weight: 900;
}

.menu-toggle {
  width: 44px;
  height: 44px;
  display: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 4px auto;
  background: var(--ink);
}

.main-nav {
  border-top: 1px solid var(--line);
  background: #fbfcfa;
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
}

.nav-inner a {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  padding: 0 13px;
  color: #3e4a50;
  font-size: 0.91rem;
  font-weight: 900;
  white-space: nowrap;
  text-transform: uppercase;
}

.nav-inner a:hover,
.nav-inner .nav-legal {
  color: var(--brand);
}

.news-ticker {
  border-bottom: 1px solid var(--line);
  background: #fff5df;
}

.ticker-inner {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #69410f;
  font-size: 1rem;
}

.ticker-inner strong {
  color: #fff;
  background: var(--brand);
  padding: 6px 10px;
  border-radius: 4px;
  font-weight: 900;
}

.front-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(340px, 0.95fr);
  gap: 28px;
  padding: 30px 0 24px;
}

.lead-story {
  min-height: 500px;
  display: grid;
  grid-template-rows: minmax(260px, 1fr) auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.article-image img,
.rail-item img,
.article-hero {
  width: 100%;
  object-fit: cover;
}

.lead-story > a {
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-width: 0;
  background: #eef3ef;
}

.lead-story img {
  width: 100%;
  height: 100%;
  min-height: 330px;
  object-fit: cover;
  object-position: center;
}

.lead-copy {
  padding: 30px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--kicker-color, var(--brand));
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--kicker-color, var(--brand));
}

.lead-copy h1 {
  max-width: 820px;
  margin: 12px 0 14px;
  font-family: var(--serif);
  font-size: 3.25rem;
  line-height: 1.04;
}

.lead-copy p,
.article-card p,
.listing-header p,
.legal-item p,
.site-footer p {
  color: var(--soft-ink);
  font-size: 1.02rem;
}

.story-meta,
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--soft-ink);
  font-size: 0.88rem;
}

.story-meta a,
.article-meta a {
  color: var(--blue);
  font-weight: 800;
}

.side-rail {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--soft-shadow);
}

.side-rail-heading {
  margin-bottom: 4px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 12px;
}

.side-rail-heading span {
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.side-rail h2,
.section-heading h2,
.legal-widget h2 {
  margin: 0;
  font-family: var(--serif);
  line-height: 1.05;
}

.rail-item {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.rail-item:last-child {
  border-bottom: 0;
}

.rail-item img {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background: var(--wash);
}

.rail-item h3 {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.18;
}

.rail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  color: var(--soft-ink);
  font-size: 0.82rem;
  font-weight: 700;
}

.rail-meta a {
  color: var(--blue);
  font-weight: 900;
}

.rail-meta time::before {
  content: "/";
  margin-right: 8px;
  color: #a5aaa7;
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 30px;
  align-items: start;
  padding: 10px 0 42px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 10px;
}

.section-heading span,
.section-heading a {
  color: var(--soft-ink);
  font-size: 0.9rem;
  font-weight: 800;
}

.section-heading.compact {
  align-items: center;
  margin-bottom: 12px;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.compact-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.article-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(31, 37, 40, 0.05);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(31, 37, 40, 0.1);
}

.article-image img {
  aspect-ratio: 16 / 10;
}

.article-card-body {
  display: flex;
  min-height: 260px;
  flex-direction: column;
  padding: 18px;
}

.article-card h3 {
  margin: 9px 0 10px;
  font-family: var(--serif);
  font-size: 1.32rem;
  line-height: 1.16;
}

.article-card p {
  margin: 0 0 14px;
  font-size: 0.94rem;
}

.article-card .story-meta {
  margin-top: auto;
}

.legal-widget {
  position: sticky;
  top: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--soft-shadow);
}

.legal-mini {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.legal-mini:last-child {
  border-bottom: 0;
}

.legal-mini span,
.legal-type {
  display: inline-flex;
  color: #fff;
  background: var(--green);
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.legal-mini h3 {
  margin: 8px 0 6px;
  font-size: 1rem;
}

.legal-mini time {
  color: var(--soft-ink);
  font-size: 0.85rem;
}

.city-band {
  padding: 38px 0 48px;
  background: #fff;
  border-top: 1px solid var(--line);
}

.city-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.city-list a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--wash);
  font-weight: 800;
}

.article-page,
.listing-page,
.legal-page,
.related-section,
.legal-document {
  padding: 34px 0 48px;
}

.article-shell {
  max-width: 920px;
}

.article-header h1,
.listing-header h1,
.legal-document-header h1 {
  margin: 10px 0;
  font-family: var(--serif);
  font-size: 3.8rem;
  line-height: 1.02;
}

.article-header p {
  color: var(--soft-ink);
  font-size: 1.18rem;
}

.article-hero {
  max-height: 520px;
  margin: 28px 0;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  aspect-ratio: 16 / 9;
}

.article-content {
  max-width: 760px;
  margin: 0 auto;
  color: #222;
  font-family: var(--serif);
  font-size: 1.18rem;
}

.article-content p {
  margin: 0 0 1.25em;
}

.listing-header {
  max-width: 780px;
  margin-bottom: 24px;
}

.listing-header span {
  color: var(--brand);
  font-weight: 900;
  text-transform: uppercase;
}

.empty-state {
  margin: 48px auto;
  max-width: 720px;
  padding: 34px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.legal-list {
  display: grid;
  gap: 14px;
}

.legal-page-actions {
  display: grid;
  grid-template-columns: max-content minmax(280px, 520px);
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
}

.legal-check-form,
.legal-verify-search {
  display: flex;
  align-items: center;
  gap: 10px;
}

.legal-check-form input,
.legal-verify-search input {
  min-height: 42px;
}

.legal-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 24px;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.legal-item h2 {
  margin: 10px 0;
  font-family: var(--serif);
}

.legal-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  font-weight: 900;
}

.legal-item-actions a {
  color: var(--brand);
}

.legal-item dl,
.legal-document-header dl,
.certificate-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.legal-item dt,
.legal-document-header dt,
.certificate-table dt {
  color: var(--soft-ink);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.legal-item dd,
.legal-document-header dd,
.certificate-table dd {
  margin: 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.legal-document-header {
  padding: 26px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.legal-content {
  margin-top: 30px;
  padding: 26px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.legal-certificate {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 20px;
  margin-top: 20px;
  padding: 22px;
  background: #fff;
  border: 2px solid var(--brand);
  border-radius: var(--radius);
}

.certificate-stamp {
  display: grid;
  place-items: center;
  min-height: 142px;
  border: 2px solid var(--brand);
  border-radius: 50%;
  color: var(--brand);
  text-align: center;
  text-transform: uppercase;
}

.certificate-stamp strong {
  max-width: 120px;
  font-size: 1rem;
  line-height: 1.05;
}

.certificate-stamp span {
  max-width: 120px;
  color: var(--soft-ink);
  font-size: 0.72rem;
  font-weight: 900;
}

.legal-certificate h2,
.verify-result h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
}

.legal-certificate p {
  margin: 0 0 14px;
  color: var(--soft-ink);
}

.signature-line {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.signature-line div {
  display: grid;
  gap: 2px;
}

.signature-line span {
  color: var(--soft-ink);
}

.signature-mark {
  color: #ef9a9f;
  font-family: var(--serif);
  font-size: 4rem;
  font-style: italic;
  line-height: 1;
}

.certificate-table {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.certificate-table div {
  padding: 10px;
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.legal-verify-search {
  max-width: 760px;
  margin-bottom: 22px;
}

.verify-result {
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.verify-status {
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
  padding: 14px;
  border-radius: var(--radius);
}

.verify-status strong {
  font-size: 1.1rem;
}

.verify-status.is-valid {
  color: #235031;
  background: #e7f6ea;
  border: 1px solid #b7dfc0;
}

.verify-status.is-invalid {
  color: #7f1018;
  background: #ffe8e9;
  border: 1px solid #ffc8cc;
}

.document-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0 16px;
  cursor: pointer;
  font-weight: 900;
}

.button-primary {
  color: #fff;
  background: var(--brand);
}

.button-primary:hover {
  color: #fff;
  background: var(--brand-dark);
}

.button-secondary {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.site-footer {
  color: #d8e1df;
  background: #202829;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 28px;
  padding: 38px 0 26px;
}

.footer-logo {
  width: 220px;
  margin-bottom: 14px;
}

.site-footer h2 {
  margin: 0 0 10px;
  color: #fff;
  font-size: 1rem;
}

.footer-links {
  display: grid;
  gap: 6px;
}

.footer-bottom {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.9rem;
}

.login-page,
.install-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #edf1ed;
}

.login-panel,
.install-card {
  width: min(440px, 100%);
  padding: 30px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.login-panel img {
  width: 230px;
}

.login-panel h1,
.install-card h1 {
  margin: 20px 0;
  font-family: var(--serif);
}

.login-panel form,
.admin-form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--soft-ink);
  font-size: 0.9rem;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #cfd7d2;
  border-radius: var(--radius);
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
  outline-color: var(--focus);
}

textarea {
  resize: vertical;
}

.alert {
  border-radius: var(--radius);
  padding: 12px 14px;
  font-weight: 800;
}

.alert-error {
  color: #7f1018;
  background: #ffe8e9;
  border: 1px solid #ffc8cc;
}

.alert-success {
  color: #235031;
  background: #e7f6ea;
  border: 1px solid #b7dfc0;
}

.alert-warning {
  color: #6e4500;
  background: #fff3d6;
  border: 1px solid #ffd37a;
}

.admin-body {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  background: #f3f5f2;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  color: #fff;
  background: #202829;
}

.admin-brand img {
  width: 190px;
}

.admin-sidebar nav {
  display: grid;
  gap: 8px;
}

.admin-sidebar a,
.admin-sidebar button {
  min-height: 42px;
  display: flex;
  align-items: center;
  border: 0;
  border-radius: var(--radius);
  padding: 0 12px;
  color: #fff;
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.admin-sidebar a:hover,
.admin-sidebar button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.admin-sidebar form {
  margin-top: auto;
}

.admin-main {
  min-width: 0;
  padding: 28px;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.admin-topbar span {
  color: var(--brand);
  font-weight: 900;
  text-transform: uppercase;
}

.admin-topbar h1 {
  margin: 2px 0 0;
  font-family: var(--serif);
  font-size: 2.2rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stats-grid article,
.admin-table-section,
.admin-form {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stats-grid article {
  padding: 20px;
}

.stats-grid span {
  color: var(--soft-ink);
  font-size: 0.85rem;
  font-weight: 900;
  text-transform: uppercase;
}

.stats-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 2.4rem;
  line-height: 1;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.admin-table-section {
  padding: 18px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--soft-ink);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-actions form {
  margin: 0;
}

.table-actions button {
  border: 0;
  color: var(--brand);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.admin-form {
  padding: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.span-2 {
  grid-column: span 2;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  align-self: end;
  min-height: 44px;
}

.checkbox-label input {
  width: 18px;
  height: 18px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

@media (max-width: 980px) {
  .front-grid,
  .section-grid,
  .legal-item,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .article-grid,
  .compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .legal-widget {
    position: static;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .top-strip-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 8px 0;
  }

  .brand-row {
    grid-template-columns: 1fr 44px;
    gap: 14px;
    padding: 16px 0;
  }

  .brand img {
    width: 260px;
  }

  .search-form {
    grid-column: 1 / -1;
    order: 3;
    max-width: none;
    width: 100%;
  }

  .menu-toggle {
    display: block;
  }

  .main-nav {
    display: none;
  }

  .main-nav.is-open {
    display: block;
  }

  .nav-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 8px 0;
  }

  .nav-inner a {
    min-height: 42px;
  }

  .front-grid {
    padding-top: 18px;
  }

  .lead-story {
    min-height: auto;
  }

  .lead-copy {
    padding: 18px;
  }

  .lead-copy h1,
  .article-header h1,
  .listing-header h1,
  .legal-document-header h1 {
    font-size: 2.35rem;
  }

  .rail-item {
    grid-template-columns: 96px 1fr;
  }

  .article-grid,
  .compact-grid {
    grid-template-columns: 1fr;
  }

  .article-card-body {
    min-height: auto;
  }

  .legal-item dl,
  .legal-document-header dl,
  .certificate-table,
  .legal-certificate,
  .legal-page-actions {
    grid-template-columns: 1fr;
  }

  .legal-check-form,
  .legal-verify-search,
  .signature-line {
    flex-direction: column;
    align-items: stretch;
  }

  .signature-line {
    grid-template-columns: 1fr;
  }

  .certificate-stamp {
    max-width: 170px;
  }

  .document-actions,
  .footer-bottom,
  .admin-topbar,
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-body {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    min-height: auto;
  }

  .admin-sidebar nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-main {
    padding: 18px;
  }

  .stats-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }
}

@media print {
  .site-header,
  .site-footer,
  .document-actions {
    display: none;
  }

  body {
    background: #fff;
  }

  .legal-content,
  .legal-document-header {
    border: 0;
    padding: 0;
  }
}
