:root {
  --crimson: #8b1528;
  --crimson-deep: #5c0c1a;
  --crimson-ink: #3a0811;
  --crimson-soft: #a52a3d;
  --silver: #c5ccd4;
  --silver-bright: #e8eef4;
  --silver-metal: linear-gradient(145deg, #f4f7fa 0%, #c7ced6 42%, #9aa3ad 78%, #dde3ea 100%);
  --bg: #f3f1f2;
  --bg-wash: #ebe6e8;
  --ink: #1a1214;
  --muted: #5c5054;
  --card: #fffcfd;
  --line: #d9d0d3;
  --ok: #1f6b3a;
  --warn: #8a4b12;
  --danger: #8b1528;
  --shadow: 0 12px 28px rgba(58, 8, 17, 0.12);
  --radius: 18px;
  --font: "Manrope", "Segoe UI", sans-serif;
  --display: "Libre Baskerville", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 8% -8%, rgba(165, 42, 61, 0.12), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(197, 204, 212, 0.35), transparent 50%),
    linear-gradient(180deg, #f7f4f5 0%, var(--bg) 45%, var(--bg-wash) 100%);
  min-height: 100vh;
  line-height: 1.55;
}

img, video { max-width: 100%; display: block; }
a { color: var(--crimson); }
.wrap { width: min(1120px, calc(100% - 2rem)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip-link {
  position: absolute; left: -999px; top: 0; background: #fff; padding: .5rem 1rem; z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.site-header {
  position: sticky; top: 0; z-index: 40;
  background:
    linear-gradient(180deg, var(--crimson-deep) 0%, var(--crimson) 100%);
  border-bottom: 1px solid rgba(232, 238, 244, 0.18);
  box-shadow: 0 8px 24px rgba(58, 8, 17, 0.28);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 4.4rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  color: var(--silver-bright);
  text-decoration: none;
  min-width: 0;
}
.brand-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #9a1c30, var(--crimson-ink));
  box-shadow: 0 4px 12px rgba(0,0,0,.25), inset 0 0 0 1px rgba(232,238,244,.25);
  flex-shrink: 0;
}
.brand-text {
  display: grid;
  gap: .1rem;
  min-width: 0;
}
.brand-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #fff;
}
.brand-tag {
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--silver);
  font-weight: 600;
}
.site-nav { display: flex; flex-wrap: wrap; gap: .85rem 1.1rem; align-items: center; }
.site-nav a, .site-header .linkish {
  color: var(--silver-bright); text-decoration: none; font-weight: 600; background: none; border: 0; cursor: pointer; font: inherit; padding: 0;
}
.site-nav a:hover, .site-header .linkish:hover { color: #fff; text-shadow: 0 0 12px rgba(232,238,244,.35); }
.nav-toggle {
  display: none; border: 1px solid rgba(232,238,244,.35); background: rgba(255,255,255,.08); color: #fff;
  border-radius: 999px; padding: .4rem .9rem; font-weight: 600;
}
.inline-form { display: inline; margin: 0; }

.main { padding: 1.5rem 0 3rem; }
.site-footer {
  background:
    radial-gradient(80% 120% at 50% 0%, rgba(139, 21, 40, 0.35), transparent 60%),
    linear-gradient(180deg, var(--crimson) 0%, var(--crimson-ink) 100%);
  color: var(--silver-bright);
  padding: 2rem 0 2.25rem;
  margin-top: 1rem;
}
.footer-inner {
  display: grid;
  gap: 1rem;
  grid-template-columns: auto 1fr;
  align-items: start;
}
.footer-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #9a1c30, var(--crimson-ink));
  box-shadow: 0 6px 16px rgba(0,0,0,.3);
}
.footer-copy p { margin: .35rem 0; }
.footer-copy a { color: var(--silver-bright); }
.footer-copy strong {
  font-family: var(--display);
  font-size: 1.15rem;
  color: #fff;
}
.footer-address {
  margin-top: .65rem !important;
  font-weight: 600;
  letter-spacing: .01em;
  color: #fff;
}
.muted { color: var(--muted); }
.site-footer .muted { color: rgba(232, 238, 244, 0.78); }

.hero-band {
  margin-bottom: 1.5rem;
  padding: 1.35rem 1.4rem 1.5rem;
  border-radius: calc(var(--radius) + 4px);
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(197, 204, 212, 0.18), transparent 45%),
    linear-gradient(145deg, var(--crimson-deep) 0%, var(--crimson) 55%, #6e101f 100%);
  color: #fff;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero-band::after {
  content: "";
  position: absolute;
  width: 180px; height: 180px;
  right: -40px; top: -50px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232,238,244,.2), transparent 70%);
  pointer-events: none;
}
.hero-copy { position: relative; z-index: 1; max-width: 40rem; }
.hero-band .eyebrow { color: var(--silver); }
.hero-band h1 {
  color: #fff;
  font-size: clamp(2rem, 5vw, 3rem);
}
.hero-band .lede { color: rgba(232, 238, 244, 0.9); }
.hero-band .search-bar { position: relative; z-index: 1; }
.hero-band .search-bar input {
  border-color: transparent;
  box-shadow: inset 0 0 0 1px rgba(232,238,244,.25);
}
.page-head { margin-bottom: 1.5rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: .75rem; color: var(--crimson-soft); font-weight: 700; margin: 0 0 .4rem; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; line-height: 1.15; color: var(--crimson-ink); }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 .5rem; }
.lede { font-size: 1.05rem; color: var(--muted); max-width: 42rem; }

.search-bar {
  display: grid; grid-template-columns: 1fr auto; gap: .5rem;
  margin-top: 1rem; max-width: 40rem;
}
.search-bar input, .form-card input, .form-card textarea, .form-card select,
.stack-form input, .stack-form textarea, .stack-form select,
.inline-reset input {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: .7rem .85rem;
  font: inherit;
}
.search-bar button, .btn {
  appearance: none; border: 0; cursor: pointer;
  background: var(--silver-metal);
  color: var(--crimson-ink);
  font-weight: 700;
  border-radius: 999px;
  padding: .7rem 1.2rem;
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 4px 0 rgba(90, 98, 108, 0.35), 0 8px 18px rgba(58, 8, 17, 0.18);
}
.btn:hover, .search-bar button:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--crimson);
  border: 1px solid var(--crimson);
  box-shadow: none;
}
.hero-band .btn-ghost { color: #fff; border-color: rgba(255,255,255,.55); }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .8rem; }

.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 1.25rem; }
.chip {
  text-decoration: none; color: var(--ink); background: rgba(255,255,255,.78);
  border: 1px solid var(--line); border-radius: 999px; padding: .35rem .8rem; font-weight: 600; font-size: .92rem;
}
.chip.is-active {
  background: var(--crimson);
  color: #fff;
  border-color: var(--crimson-deep);
}

.feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.feed-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.feed-card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(58,8,17,.14); }
.feed-card.static { cursor: default; }
.feed-card.static:hover { transform: none; }
.feed-media { aspect-ratio: 4/3; background: #e7dfe2; position: relative; overflow: hidden; }
.feed-media img, .feed-media video { width: 100%; height: 100%; object-fit: cover; }
.media-placeholder {
  display: grid; place-items: center; height: 100%; color: var(--muted); font-weight: 600;
  background: repeating-linear-gradient(-45deg, #e8dfe2, #e8dfe2 8px, #f3ecee 8px, #f3ecee 16px);
}
.media-placeholder.tall { min-height: 220px; border-radius: var(--radius); }
.badge {
  position: absolute; top: .6rem; left: .6rem; background: rgba(58,8,17,.82); color: #fff;
  font-size: .75rem; padding: .2rem .5rem; border-radius: 999px;
}
.feed-body { padding: .9rem 1rem 1.1rem; }
.feed-body h2 { font-size: 1.15rem; margin: .2rem 0 .4rem; }
.feed-body p { margin: 0 0 .55rem; color: var(--muted); font-size: .95rem; }
.meta { color: var(--muted); font-size: .82rem; }

.gallery {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: .75rem; margin-bottom: 1.25rem;
}
.gallery-item {
  margin: 0; border-radius: var(--radius); overflow: hidden; background: #000; border: 1px solid var(--line);
}
.gallery-item.is-primary { grid-row: span 2; }
.gallery-item img, .gallery-item video, .gallery.compact img, .gallery.compact video {
  width: 100%; height: 100%; object-fit: cover; min-height: 160px;
}
.gallery.compact { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

.item-grid, .split {
  display: grid; grid-template-columns: 1.4fr .9fr; gap: 1rem;
}
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.1rem; box-shadow: var(--shadow);
}
.contact-panel { align-self: start; position: sticky; top: 5rem; }
.contact-list { padding-left: 1.1rem; }
.facts { display: grid; gap: .55rem; margin: 1rem 0 0; }
.facts div { display: grid; grid-template-columns: 10rem 1fr; gap: .5rem; border-top: 1px solid var(--line); padding-top: .45rem; }
.facts dt { color: var(--muted); font-weight: 600; }
.facts dd { margin: 0; }
.prose { white-space: pre-wrap; }

.form-card, .stack-form {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem; display: grid; gap: .85rem; box-shadow: var(--shadow); margin-bottom: 1rem;
}
.form-card.narrow, .page-head.narrow { max-width: 28rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; }
label { display: grid; gap: .35rem; font-weight: 600; font-size: .95rem; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem 1rem; }
legend { font-weight: 700; padding: 0 .35rem; }

.flash { padding: .75rem 1rem; border-radius: 10px; font-weight: 600; }
.flash-error { background: #f8e4e7; color: var(--danger); }
.flash-ok { background: #e2f3e8; color: var(--ok); }
.empty { padding: 2rem; text-align: center; color: var(--muted); background: rgba(255,255,255,.65); border-radius: var(--radius); border: 1px dashed var(--line); }

.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; margin-bottom: 1rem;
}
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem; display: grid; gap: .2rem; box-shadow: var(--shadow);
}
.link-stat { text-decoration: none; color: inherit; }
.stat-num { font-family: var(--display); font-size: 1.8rem; font-weight: 700; color: var(--crimson); }

.status {
  display: inline-block; font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; padding: .2rem .5rem; border-radius: 999px; background: #efe6e8;
}
.status-available { background: #d8f0e1; color: var(--ok); }
.status-claimed, .status-collected { background: #efe4d4; color: var(--warn); }
.status-expired_review { background: #f5e0e4; color: var(--danger); }
.status-archived { background: #e5e5e5; color: #555; }

.data-table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.data-table th, .data-table td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table th { background: #f0e6e9; font-size: .85rem; color: var(--crimson-ink); }
.plain-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .65rem; }
.plain-list.dense { gap: .35rem; font-size: .95rem; }
.result-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.result-list a {
  display: grid; grid-template-columns: 96px 1fr; gap: .85rem; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; padding: .6rem;
}
.result-thumb { aspect-ratio: 1; background: #e7dfe2; border-radius: 10px; overflow: hidden; }
.result-thumb img, .result-thumb video { width: 100%; height: 100%; object-fit: cover; }
.result-list h2 { margin: .25rem 0; font-size: 1.15rem; }
.actions-cell { display: grid; gap: .35rem; }
.inline-reset { display: flex; gap: .35rem; align-items: center; }
.pager { text-align: center; margin-top: 1.5rem; }
.status-row { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }

.church-mark {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: .75rem;
}
.church-mark img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: contain;
  background: radial-gradient(circle at 40% 35%, #9a1c30, var(--crimson-ink));
  box-shadow: 0 8px 18px rgba(58,8,17,.25);
}
.church-mark span {
  font-family: var(--display);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 700;
}
.hero-band .church-mark span { color: #fff; }
.page-head .church-mark span { color: var(--crimson-ink); }

@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--crimson-deep); border-bottom: 1px solid rgba(255,255,255,.12); padding: 1rem;
    flex-direction: column; align-items: flex-start;
  }
  .site-nav.is-open { display: flex; }
  .item-grid, .split, .gallery, .footer-inner { grid-template-columns: 1fr; }
  .gallery-item.is-primary { grid-row: auto; }
  .contact-panel { position: static; }
  .facts div { grid-template-columns: 1fr; }
  .data-table { display: block; overflow-x: auto; }
  .brand-tag { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
