:root {
  --charcoal: #1e1e1e;
  --charcoal-soft: #262320;
  --offwhite: #f7f5f2;
  --surface: #efeae3;
  --burgundy: #6b2e2e;
  --burgundy-soft: #8a4a45;
  --warm-gray: #a6a1a1;
  --ink: #2f2a27;
  --muted: #6f6863;
  --dusty-gold: #b89b5e;
  --border: rgba(34, 29, 25, 0.12);
  --shadow: 0 20px 60px rgba(20, 14, 11, 0.15);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --max-width: 1180px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Source Sans 3", Arial, sans-serif;
  color: var(--ink);
  background: var(--offwhite);
  line-height: 1.65;
}

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

a {
  color: inherit;
}

p,
ul {
  margin-top: 0;
}

.container {
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 0 auto;
}

.site-alert {
  background: #161311;
  color: #f2ebe4;
  font-size: 0.96rem;
}

.site-alert-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0;
}

.site-alert p {
  margin-bottom: 0;
}

.site-alert a {
  color: #fff3d8;
}

.quick-exit-link {
  border: 1px solid rgba(255, 243, 216, 0.32);
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(12px);
  background: rgba(247, 245, 242, 0.88);
  border-bottom: 1px solid rgba(34, 29, 25, 0.08);
}

.header-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.brand-mark {
  text-decoration: none;
  display: grid;
  gap: 0.15rem;
}

.brand-kicker {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-subtitle {
  font-size: 0.92rem;
  color: var(--muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  position: relative;
}

.site-nav a.active::after,
.site-nav a:hover::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.35rem;
  width: 100%;
  height: 2px;
  background: var(--dusty-gold);
}

.site-nav .nav-cta {
  background: var(--burgundy);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.site-nav .nav-cta::after {
  display: none;
}

.nav-toggle {
  display: none;
  border: 0;
  background: transparent;
  padding: 0;
}

.nav-toggle span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
}

.hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(24, 20, 18, 0.92) 0%, rgba(24, 20, 18, 0.82) 36%, rgba(24, 20, 18, 0.48) 63%, rgba(24, 20, 18, 0.5) 100%),
    url('/assets/backgrounds/memorial-concept.png') center/cover no-repeat;
  color: #f7f2eb;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 180px;
  background: linear-gradient(180deg, rgba(24, 20, 18, 0), rgba(24, 20, 18, 0.86));
}

.hero-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.9fr);
  gap: 2rem;
  padding: 5.5rem 0 6.5rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #f2d9c9;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}

.hero h1,
.page-hero h1,
.section-heading h2,
.story-page h1,
.story-feature h2,
.about-grid h2,
.resource-layout h2,
.admin-shell h1,
.admin-shell h2,
.timeline-heading h2 {
  margin: 0 0 1rem;
  font-family: "Playfair Display", Georgia, serif;
  line-height: 1.08;
}

.hero h1 {
  font-size: clamp(3rem, 7vw, 5.5rem);
  max-width: 11ch;
}

.hero h1 span {
  color: #dfcba4;
  font-style: italic;
}

.hero p {
  max-width: 37rem;
  font-size: 1.18rem;
  color: rgba(247, 242, 235, 0.88);
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.75rem;
}

.button,
button.button,
input[type="submit"].button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.9rem 1.3rem;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.button:hover,
button.button:hover,
input[type="submit"].button:hover {
  transform: translateY(-1px);
}

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

.button-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
}

.button-ghost {
  background: transparent;
  color: var(--burgundy);
  border-color: rgba(107, 46, 46, 0.3);
}

.hero-panel {
  align-self: end;
  background: rgba(250, 246, 241, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero-panel p {
  margin-bottom: 0;
  font-size: 1rem;
}

.hero-panel .quote-panel {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.75rem;
  color: #fff6ea;
  margin-bottom: 1rem;
}

.surface-section {
  padding: 5.5rem 0;
}

.surface-light {
  background: var(--offwhite);
}

.surface-ink {
  background:
    radial-gradient(circle at top left, rgba(184, 155, 94, 0.18), transparent 35%),
    linear-gradient(180deg, #211d1a 0%, #181513 100%);
  color: #efe9e2;
}

.surface-muted {
  background: var(--surface);
}

.section-heading {
  display: grid;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.section-heading p {
  max-width: 44rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.surface-ink .section-heading p,
.surface-ink .story-card p,
.surface-ink .story-meta,
.surface-ink .mission-card p,
.surface-ink .resource-card p {
  color: rgba(239, 233, 226, 0.78);
}

.mission-grid,
.story-grid,
.signal-grid,
.resource-grid,
.admin-cards,
.story-section-grid {
  display: grid;
  gap: 1.5rem;
}

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

.mission-card,
.signal-card,
.story-card,
.resource-card,
.content-panel,
.stat-card,
.admin-card,
.timeline-card,
.story-section,
.table-shell,
.admin-form,
.admin-login-card,
.featured-story-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.surface-ink .mission-card,
.surface-ink .story-card,
.surface-ink .signal-card,
.surface-ink .resource-card,
.surface-ink .featured-story-card {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.mission-card,
.signal-card,
.resource-card,
.content-panel,
.stat-card,
.admin-card,
.story-section {
  padding: 1.5rem;
}

.mission-card h3,
.signal-card h3,
.resource-card h3,
.story-card h3,
.content-panel h3,
.stat-card h3,
.admin-card h3,
.story-section h2,
.timeline-card h3,
.featured-story-card h3 {
  margin: 0 0 0.8rem;
  font-family: "Playfair Display", Georgia, serif;
}

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

.story-card {
  overflow: hidden;
}

.story-card-media {
  position: relative;
  aspect-ratio: 1 / 1.08;
  background: linear-gradient(180deg, rgba(107, 46, 46, 0.08), rgba(184, 155, 94, 0.12));
}

.story-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-badge,
.demo-banner span,
.meta-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.story-badge,
.meta-pill,
.status-neutral {
  background: rgba(184, 155, 94, 0.16);
  color: var(--ink);
}

.status-published {
  background: rgba(63, 115, 78, 0.14);
  color: #1d5030;
}

.status-draft {
  background: rgba(107, 46, 46, 0.12);
  color: var(--burgundy);
}

.status-review {
  background: rgba(184, 155, 94, 0.18);
  color: #6e5725;
}

.status-private {
  background: rgba(46, 54, 71, 0.12);
  color: #2e3647;
}

.story-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(250, 244, 238, 0.92);
}

.story-card-body {
  padding: 1.3rem;
}

.story-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  margin-bottom: 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.tag-row span {
  background: rgba(107, 46, 46, 0.08);
  color: var(--burgundy);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.84rem;
  font-weight: 600;
}

.text-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--dusty-gold);
  font-weight: 700;
  text-decoration: none;
}

.text-link:hover {
  color: #d6bb83;
}

.story-feature-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 1.5rem;
}

.featured-story-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1fr);
  overflow: hidden;
}

.featured-story-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-story-content {
  padding: 1.8rem;
}

.featured-story-content blockquote,
.story-hero-copy blockquote {
  margin: 1rem 0;
  padding-left: 1rem;
  border-left: 3px solid rgba(184, 155, 94, 0.75);
  color: var(--ink);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.1rem;
}

.surface-ink .featured-story-content blockquote {
  color: #fff1df;
}

.signal-grid,
.resource-grid,
.admin-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.page-hero {
  padding: 4.5rem 0 2rem;
  background:
    radial-gradient(circle at top left, rgba(184, 155, 94, 0.22), transparent 32%),
    linear-gradient(180deg, rgba(107, 46, 46, 0.12), rgba(107, 46, 46, 0));
}

.page-hero p {
  max-width: 52rem;
  color: var(--muted);
  font-size: 1.08rem;
}

.page-layout,
.resource-layout,
.about-grid,
.contact-grid,
.story-page-grid,
.admin-grid {
  display: grid;
  gap: 1.5rem;
}

.resource-layout,
.about-grid,
.contact-grid,
.story-page-grid,
.admin-grid {
  grid-template-columns: minmax(0, 1fr) 320px;
}

.story-page {
  padding: 2rem 0 5rem;
}

.story-hero-card {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.5rem;
}

.story-hero-card img {
  width: 100%;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: linear-gradient(180deg, rgba(107, 46, 46, 0.1), rgba(184, 155, 94, 0.12));
}

.story-hero-copy {
  display: grid;
  align-content: start;
}

.story-hero-copy .story-meta {
  margin: 1rem 0;
}

.demo-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-sm);
  background: rgba(184, 155, 94, 0.12);
  color: var(--ink);
}

.story-section-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1.5rem;
}

.story-section ul,
.content-panel ul,
.resource-card ul,
.about-grid ul {
  padding-left: 1.15rem;
  margin-bottom: 0;
}

.timeline-list {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-list::before {
  content: "";
  position: absolute;
  left: 0.55rem;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 2px;
  background: rgba(107, 46, 46, 0.16);
}

.timeline-list li {
  position: relative;
  padding-left: 2.2rem;
  margin-bottom: 1.25rem;
}

.timeline-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.25rem;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--dusty-gold);
  box-shadow: 0 0 0 5px rgba(184, 155, 94, 0.16);
}

.timeline-list strong {
  display: block;
}

.timeline-list span {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.resource-stack,
.stat-stack {
  display: grid;
  gap: 1rem;
}

.stat-card strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
  margin-top: 0.3rem;
  color: var(--burgundy);
}

.search-bar {
  display: flex;
  margin-bottom: 1.5rem;
}

.search-bar input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  border: 1px solid rgba(34, 29, 25, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  padding: 0.9rem 1rem;
  font: inherit;
  color: var(--ink);
}

textarea {
  min-height: 140px;
  resize: vertical;
}

.search-bar input {
  padding: 1rem 1.1rem;
  font-size: 1rem;
}

.is-hidden {
  display: none !important;
}

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

.form-grid .full-width {
  grid-column: 1 / -1;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field label {
  font-weight: 700;
}

.field small {
  color: var(--muted);
}

.flash {
  margin: 1rem 0 0;
  border-radius: 14px;
  padding: 1rem 1.1rem;
  font-weight: 700;
}

.flash-success {
  background: rgba(45, 122, 77, 0.12);
  color: #1d5030;
}

.flash-error {
  background: rgba(107, 46, 46, 0.12);
  color: var(--burgundy);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  padding: 3rem 0 1.5rem;
}

.site-footer {
  background: #171412;
  color: #efe9e2;
}

.site-footer h2,
.site-footer h3 {
  margin-top: 0;
  font-family: "Playfair Display", Georgia, serif;
}

.site-footer a {
  color: #f4d7a0;
}

.footer-meta {
  padding: 0 0 2rem;
  color: rgba(239, 233, 226, 0.72);
  font-size: 0.95rem;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.admin-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(184, 155, 94, 0.18), transparent 28%),
    linear-gradient(180deg, #f7f5f2 0%, #efe9e2 100%);
}

.admin-header {
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
}

.admin-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.admin-header a {
  text-decoration: none;
  font-weight: 700;
}

.admin-main {
  padding: 2rem 0 4rem;
}

.admin-login-wrap {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 80px);
  padding: 2rem 1rem;
}

.admin-login-card {
  width: min(520px, 100%);
  padding: 2rem;
}

.admin-form {
  padding: 1.5rem;
}

.table-shell {
  overflow: hidden;
}

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

th,
td {
  padding: 1rem;
  border-bottom: 1px solid rgba(34, 29, 25, 0.08);
  text-align: left;
  vertical-align: top;
}

th {
  font-size: 0.88rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.kpi {
  display: block;
  margin-top: 0.35rem;
  font-size: 2rem;
  line-height: 1;
  color: var(--burgundy);
  font-family: "Playfair Display", Georgia, serif;
}

.admin-note {
  margin-top: 1rem;
  color: var(--muted);
}

.story-page-grid .aside-stack,
.resource-layout .aside-stack,
.about-grid .aside-stack,
.contact-grid .aside-stack,
.admin-grid .aside-stack {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.muted-card {
  background: rgba(107, 46, 46, 0.05);
}

@media (max-width: 1100px) {
  .story-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .signal-grid,
  .resource-grid,
  .admin-cards {
    grid-template-columns: 1fr;
  }

  .story-feature-layout,
  .resource-layout,
  .about-grid,
  .contact-grid,
  .story-page-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .site-alert-inner,
  .header-shell,
  .hero-shell,
  .story-hero-card,
  .featured-story-card,
  .footer-grid,
  .form-grid,
  .story-section-grid {
    grid-template-columns: 1fr;
  }

  .site-alert-inner,
  .header-shell,
  .footer-grid {
    display: grid;
  }

  .nav-toggle {
    display: inline-block;
  }

  .site-nav {
    position: absolute;
    left: 1rem;
    right: 1rem;
    top: calc(100% + 0.6rem);
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    background: rgba(247, 245, 242, 0.98);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
  }

  .nav-open .site-nav {
    display: flex;
  }

  .hero-shell {
    padding: 4rem 0 4.5rem;
  }

  .hero h1 {
    max-width: 10ch;
  }

  .story-grid,
  .mission-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(var(--max-width), calc(100% - 1.2rem));
  }

  .surface-section {
    padding: 4rem 0;
  }

  .button-row,
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .story-meta {
    flex-direction: column;
    gap: 0.3rem;
  }
}
