:root {
  color-scheme: light;
  --paper: #fbfaf7;
  --ink: #202326;
  --muted: #686f76;
  --line: #d9d5cc;
  --panel: #ffffff;
  --sage: #6f8f72;
  --sage-dark: #446448;
  --clay: #b86f52;
  --sky: #e4eff5;
  --gold: #d5a74f;
  --shadow: 0 18px 46px rgba(34, 38, 40, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

body.theme-bright {
  --paper: #f6fbff;
  --ink: #172027;
  --muted: #5e6972;
  --line: #c9dce8;
  --panel: #ffffff;
  --sage: #4d9f8d;
  --sage-dark: #1f6d60;
  --clay: #d35f43;
  --sky: #d8f1ff;
  --gold: #c58d24;
}

body.theme-ink {
  --paper: #171919;
  --ink: #f5f1e8;
  --muted: #c7c0b1;
  --line: #3a3f3f;
  --panel: #222525;
  --sage: #83b08a;
  --sage-dark: #9dc7a3;
  --clay: #d99073;
  --sky: #2d3d43;
  --gold: #e0b45d;
  --shadow: 0 18px 46px rgba(0, 0, 0, 0.32);
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  align-items: center;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  min-height: 72px;
  padding: 14px clamp(16px, 4vw, 48px);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
}

.brand {
  align-items: center;
  color: inherit;
  display: flex;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: var(--sage-dark);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  letter-spacing: 0;
  width: 42px;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 2px;
}

nav {
  display: flex;
  gap: 8px;
}

nav a,
.primary-link {
  border-radius: 8px;
  color: var(--ink);
  font-weight: 700;
  padding: 10px 12px;
  text-decoration: none;
}

nav a:hover,
nav a[aria-current="page"],
.primary-link:hover {
  background: var(--sky);
}

.hero {
  display: grid;
  min-height: min(680px, calc(100vh - 72px));
  overflow: hidden;
  position: relative;
}

.hero img {
  grid-area: 1 / 1;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.hero::after {
  background: linear-gradient(90deg, rgba(18, 25, 23, 0.8), rgba(18, 25, 23, 0.46) 44%, rgba(18, 25, 23, 0.08));
  content: "";
  grid-area: 1 / 1;
  pointer-events: none;
}

.hero-copy {
  align-self: center;
  color: #fff;
  grid-area: 1 / 1;
  max-width: 720px;
  padding: clamp(36px, 8vw, 96px);
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 8vw, 6.9rem);
  font-weight: 700;
  line-height: 0.95;
  margin: 0 0 22px;
}

.hero p:not(.eyebrow) {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.6;
  margin: 0 0 28px;
  max-width: 650px;
}

.primary-link {
  background: #fff;
  color: var(--sage-dark);
  display: inline-flex;
}

.workspace,
.public-posts,
.admin-layout {
  display: grid;
  gap: clamp(18px, 4vw, 36px);
  margin: 0 auto;
  max-width: 1400px;
  padding: clamp(20px, 5vw, 56px);
}

.workspace,
.admin-layout {
  grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
}

.public-posts {
  grid-template-columns: 1fr;
}

.custom-feature {
  align-items: center;
  display: grid;
  gap: clamp(20px, 4vw, 36px);
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  margin: 0 auto;
  max-width: 1180px;
  padding: clamp(32px, 6vw, 72px) clamp(20px, 5vw, 56px) 0;
}

.custom-feature[hidden] {
  display: none;
}

.custom-feature h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 1;
  margin: 0 0 16px;
}

.custom-feature p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
  margin: 0;
}

.custom-feature img,
.post-image {
  border-radius: 8px;
  display: block;
  object-fit: cover;
  width: 100%;
}

.custom-feature img {
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow);
}

.editor-panel {
  align-self: start;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.admin-page {
  background: linear-gradient(180deg, var(--sky), var(--paper) 340px);
}

.admin-lock {
  align-items: center;
  background: var(--paper);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 100;
}

.admin-lock.is-unlocked {
  display: none;
}

.admin-lock-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  max-width: 440px;
  padding: clamp(24px, 5vw, 36px);
  width: min(100%, 440px);
}

.admin-lock-panel h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 8vw, 4.4rem);
  line-height: 0.98;
  margin: 0;
}

.admin-lock-panel p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.admin-hero {
  margin: 0 auto;
  max-width: 1400px;
  padding: clamp(36px, 7vw, 86px) clamp(20px, 5vw, 56px) clamp(20px, 4vw, 42px);
}

.admin-hero h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 7vw, 6.2rem);
  line-height: 0.96;
  margin: 0 0 20px;
  max-width: 900px;
}

.admin-hero p:not(.eyebrow) {
  color: #3d4850;
  font-size: 1.1rem;
  line-height: 1.65;
  margin: 0 0 24px;
  max-width: 720px;
}

.admin-hero-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-tools {
  display: grid;
  gap: 18px;
}

.admin-message {
  color: var(--sage-dark);
  font-weight: 800;
  margin: 0;
  min-height: 22px;
}

.panel-heading h2,
.section-bar h2 {
  font-size: 1.8rem;
  line-height: 1.1;
  margin: 0;
}

.eyebrow {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.post-form {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.check-row {
  align-items: center;
  color: var(--ink);
  display: flex;
  gap: 9px;
  line-height: 1.35;
}

.check-row input {
  flex: 0 0 auto;
  width: auto;
}

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

body.theme-ink input,
body.theme-ink select,
body.theme-ink textarea {
  background: #1d2020;
  color: var(--ink);
}

body.theme-ink .button-secondary,
body.theme-ink .filter,
body.theme-ink .post-actions button,
body.theme-ink .category-pill {
  color: var(--ink);
}

body.theme-ink .post-body,
body.theme-ink .about-copy p:not(.eyebrow),
body.theme-ink .about-story p,
body.theme-ink .admin-hero p:not(.eyebrow) {
  color: var(--muted);
}

textarea {
  line-height: 1.45;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(213, 167, 79, 0.38);
  outline-offset: 2px;
}

.form-row,
.post-actions,
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  min-height: 40px;
  padding: 10px 13px;
}

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

.button-secondary,
.filter,
.post-actions button,
.category-pill {
  background: var(--sky);
  color: #243237;
}

.button-primary:hover,
.button-secondary:hover,
.filter:hover,
.post-actions button:hover,
.category-pill:hover {
  filter: brightness(0.96);
}

.post-section {
  min-width: 0;
}

.section-bar {
  align-items: end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-help {
  color: var(--muted);
  line-height: 1.5;
  margin: 8px 0 0;
}

.filter.is-active {
  background: var(--clay);
  color: #fff;
}

.filter.is-drop-target {
  outline: 3px solid rgba(213, 167, 79, 0.48);
  outline-offset: 2px;
}

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

.post-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  min-height: 310px;
  padding: 22px;
}

.post-card[draggable="true"] {
  cursor: grab;
}

.post-card.is-dragging {
  opacity: 0.55;
}

.post-card.is-featured {
  border-color: var(--gold);
  box-shadow: 0 12px 28px rgba(213, 167, 79, 0.18);
}

.post-meta {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 0.82rem;
  font-weight: 800;
  gap: 10px;
  justify-content: space-between;
}

.post-meta span {
  background: rgba(111, 143, 114, 0.16);
  border-radius: 999px;
  color: var(--sage-dark);
  padding: 5px 9px;
}

.post-card h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 2.7vw, 2.25rem);
  line-height: 1.08;
  margin: 18px 0 10px;
}

.post-card p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 16px;
}

.post-body {
  color: #34383d;
  line-height: 1.65;
  margin-bottom: 20px;
  white-space: pre-wrap;
}

.post-image {
  aspect-ratio: 16 / 10;
  margin: 0 0 18px;
}

.post-image[hidden] {
  display: none;
}

.post-actions {
  margin-top: auto;
}

.post-title-link {
  color: inherit;
  text-decoration: none;
}

.post-title-link:hover {
  color: var(--sage-dark);
}

.post-card-footer {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
}

.read-link,
.back-link {
  color: var(--sage-dark);
  font-weight: 800;
  text-decoration: none;
}

.read-link:hover,
.back-link:hover {
  text-decoration: underline;
}

.inline-signup {
  display: grid;
  gap: 10px;
}

.inline-signup label {
  display: grid;
  gap: 6px;
}

.single-post-page {
  padding: clamp(24px, 6vw, 76px) clamp(18px, 5vw, 56px);
}

.single-post {
  margin: 0 auto;
  max-width: 880px;
}

.single-post h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 8vw, 6.2rem);
  line-height: 0.96;
  margin: 18px 0;
}

.single-excerpt {
  color: var(--muted);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.65;
  margin: 0 0 24px;
}

.single-image {
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: block;
  margin: 0 0 28px;
  object-fit: cover;
  width: 100%;
}

.single-image[hidden] {
  display: none;
}

.single-body {
  color: #34383d;
  font-size: 1.08rem;
  line-height: 1.8;
  white-space: pre-wrap;
}

body.theme-ink .single-body {
  color: var(--muted);
}

.article-cta {
  background: var(--sky);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  margin-top: clamp(28px, 6vw, 56px);
  padding: clamp(20px, 5vw, 34px);
}

.article-cta h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1;
  margin: 0 0 12px;
}

.article-cta p:not(.eyebrow) {
  color: #34434a;
  line-height: 1.6;
  margin: 0;
}

.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.share-link {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  font-weight: 800;
  min-height: 40px;
  padding: 10px 13px;
  text-decoration: none;
}

.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.category-pill {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px 8px 13px;
}

.category-pill button {
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  color: var(--ink);
  display: inline-flex;
  font-size: 1rem;
  height: 24px;
  justify-content: center;
  min-height: 24px;
  padding: 0;
  width: 24px;
}

.empty-state {
  background: var(--sky);
  border-radius: 8px;
  color: #263941;
  grid-column: 1 / -1;
  padding: 22px;
}

.about-hero {
  display: grid;
  gap: clamp(24px, 5vw, 56px);
  grid-template-columns: minmax(0, 0.92fr) minmax(280px, 0.72fr);
  margin: 0 auto;
  max-width: 1400px;
  min-height: calc(74vh - 72px);
  padding: clamp(26px, 6vw, 72px);
}

.about-copy {
  align-self: center;
}

.about-copy h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 7vw, 6.4rem);
  line-height: 0.96;
  margin: 0 0 22px;
}

.about-copy p:not(.eyebrow),
.about-story p {
  color: #41474d;
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 760px;
}

.about-hero img {
  align-self: stretch;
  border-radius: 8px;
  box-shadow: var(--shadow);
  height: 100%;
  min-height: 430px;
  object-fit: cover;
  width: 100%;
}

.about-layout {
  display: grid;
  gap: clamp(20px, 4vw, 36px);
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  margin: 0 auto;
  max-width: 1180px;
  padding: 0 clamp(20px, 5vw, 56px) clamp(42px, 8vw, 86px);
}

.about-story h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.05;
  margin: 0 0 18px;
}

.about-note {
  align-self: start;
  background: var(--sky);
  border-radius: 8px;
  color: #263941;
  padding: 22px;
}

.about-note ul {
  line-height: 1.7;
  margin: 0;
  padding-left: 20px;
}

.signup-backdrop {
  align-items: center;
  background: rgba(22, 26, 27, 0.52);
  display: none;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: fixed;
  z-index: 50;
}

.signup-backdrop.is-visible {
  display: flex;
}

.signup-dialog {
  background: var(--panel);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.25);
  max-width: 520px;
  padding: clamp(22px, 5vw, 34px);
  position: relative;
  width: min(100%, 520px);
}

.signup-close {
  align-items: center;
  background: var(--sky);
  border-radius: 999px;
  color: var(--ink);
  display: inline-flex;
  font-size: 1.35rem;
  height: 40px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: absolute;
  right: 14px;
  top: 14px;
  width: 40px;
}

.signup-dialog h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 7vw, 3.6rem);
  line-height: 0.98;
  margin: 10px 38px 16px 0;
}

.signup-dialog p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 18px;
}

.signup-form {
  display: grid;
  gap: 10px;
}

.signup-message {
  color: var(--sage-dark);
  font-weight: 800;
  min-height: 22px;
}

.button-plain {
  background: transparent;
  color: var(--muted);
}

@media (max-width: 920px) {
  .workspace,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .editor-panel {
    position: static;
  }

  .post-list,
  .about-hero,
  .about-layout,
  .custom-feature {
    grid-template-columns: 1fr;
  }

  .about-hero img {
    min-height: 320px;
  }
}

@media (max-width: 640px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand small {
    max-width: 230px;
  }

  .hero {
    min-height: 620px;
  }

  .hero::after {
    background: linear-gradient(180deg, rgba(18, 25, 23, 0.82), rgba(18, 25, 23, 0.36));
  }

  .hero-copy {
    align-self: end;
    padding: 32px 18px;
  }

  .section-bar {
    align-items: stretch;
    flex-direction: column;
  }
}
