:root {
  color-scheme: dark;
  --background: #0c0706;
  --panel: #1b100d;
  --line: #5a392b;
  --gold: #e2b567;
  --text: #f2e9dc;
  --muted: #c0aa98;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(ellipse at top, #3a170f 0, #190b08 38%, var(--background) 78%);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
}

a {
  color: var(--gold);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
textarea {
  font: inherit;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #c49249;
  border-radius: 4px;
  padding: 10px 18px;
  background: linear-gradient(#a23820, #4f1b12);
  color: #fff3dc;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
}

button:hover,
.button:hover {
  filter: brightness(1.15);
  text-decoration: none;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid #e6bb74;
  outline-offset: 4px;
}

.secondary {
  border-color: #77543c;
  background: linear-gradient(#38221a, #1b100d);
  font-weight: 500;
}

.site-header {
  max-width: 1180px;
  margin: auto;
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-bottom: 1px solid #80613d;
}

.brand-text {
  color: #f5dfb1;
  font: bold 23px/1.15 Georgia, serif;
  letter-spacing: 1.5px;
  text-shadow: 0 2px 10px #000;
}

.brand-text span {
  display: block;
  color: var(--gold);
  font: bold 10px/1.6 system-ui, sans-serif;
  letter-spacing: 4px;
}

.site-header nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 22px;
}

.site-header nav form {
  margin: 0;
}

.public-main,
.admin-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 28px 70px;
}

.hero {
  margin-bottom: 28px;
  padding: 54px 36px;
  border: 1px solid #765338;
  border-radius: 5px;
  background: linear-gradient(110deg, #1b0c08, #35160f 55%, #120908);
  box-shadow: 0 18px 60px #0008;
}

.eyebrow {
  color: var(--gold);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 1.7px;
}

h1,
h2,
h3 {
  margin: 12px 0 18px;
  line-height: 1.25;
}

h1 {
  color: #f5dfb1;
  font: 40px/1.2 Georgia, serif;
}

h2 {
  color: #f0d7aa;
  font-size: 23px;
}

h3 {
  font-size: 18px;
}

p {
  margin: 10px 0;
  color: var(--muted);
}

time {
  color: var(--muted);
  font-size: 13px;
}

.news-list {
  max-width: 930px;
  margin: auto;
}

.news-card,
.card,
.auth-card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: linear-gradient(145deg, #24140f, #100907);
  box-shadow: 0 12px 40px #0007;
}

.news-card {
  margin-bottom: 22px;
  border-top: 2px solid #a87c43;
}

.post-body {
  color: #e0d5c7;
  overflow-wrap: anywhere;
}

.auth-card {
  max-width: 520px;
  margin: 14px auto 40px;
  padding: 34px;
}

.auth-card h1 {
  font-size: 32px;
}

.auth-card form > button {
  width: 100%;
  margin-top: 22px;
}

label {
  display: block;
  margin: 18px 0 7px;
  color: #ead9bb;
  font-size: 14px;
  font-weight: 650;
}

input,
textarea {
  display: block;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #74533e;
  border-radius: 4px;
  outline: none;
  background: #0b0706;
  color: var(--text);
}

input:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px #d7a75624;
}

textarea {
  min-height: 200px;
  resize: vertical;
}

small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.captcha-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

.captcha-row img {
  max-width: 100%;
  height: 74px;
  border: 1px solid #74533e;
  border-radius: 4px;
}

.captcha-row button {
  padding: 8px 10px;
  font-size: 12px;
}

.notice {
  margin: 18px 0;
  padding: 13px 17px;
  border: 1px solid #bc6d5d;
  border-radius: 4px;
  background: #62261d55;
  color: #ffe1d8;
}

.notice.success {
  border-color: #65875b;
  background: #193d2d;
  color: #d9f6e8;
}

.dashboard-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.dashboard-heading h1 {
  font-size: 35px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 24px;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0;
  font-weight: 500;
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: #cb9042;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.count {
  color: var(--muted);
  font-size: 15px;
}

.admin-post {
  padding: 19px 0;
  border-bottom: 1px solid #493328;
  overflow-wrap: anywhere;
}

.admin-post:first-child {
  padding-top: 4px;
}

.admin-post h3 {
  margin: 9px 0;
}

.status {
  display: inline-block;
  padding: 2px 9px;
  border: 1px solid #78614b;
  border-radius: 20px;
  color: #d2c2ad;
  font-size: 11px;
}

.status.live {
  border-color: #65875b;
  color: #c7e9b8;
}

.post-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 12px;
  font-size: 13px;
}

.post-actions form {
  margin: 0;
}

.text-button {
  padding: 0;
  border: 0;
  background: none;
  color: #d1b680;
  font-size: 13px;
  font-weight: 500;
}

.empty {
  padding: 20px 0;
}

.empty h2 {
  color: #e8d2aa;
}

#publish-math-captcha[hidden] {
  display: none;
}

footer {
  padding: 22px;
  border-top: 1px solid #362319;
  color: #a89580;
  font-size: 12px;
  text-align: center;
}

@media (max-width: 760px) {
  .site-header {
    flex-direction: column;
    gap: 16px;
    padding: 20px;
  }

  .site-header nav {
    justify-content: center;
    gap: 18px;
    font-size: 14px;
  }

  .public-main,
  .admin-main {
    padding: 24px 16px 45px;
  }

  .hero {
    padding: 36px 24px;
  }

  h1 {
    font-size: 32px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-card {
    padding: 24px;
  }

  .card,
  .news-card {
    padding: 22px;
  }
}
