:root {
  --paper: #F2ECD9;
  --paper-deep: #E9DFC4;
  --ink: #3D2B1F;
  --ink-soft: #5C4632;
  --gold: #A8823C;
  --gold-soft: #C9A968;
  --maroon: #7A2E22;
  --line: rgba(61,43,31,0.18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'EB Garamond', serif;
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
  line-height: 1.2;
}

a { color: var(--maroon); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

/* ---- Header ---- */
header.site {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
header.site .brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink);
}
header.site .menu-btn {
  width: 30px; height: 22px;
  position: relative;
  cursor: pointer;
  display: block;
}
header.site .menu-btn span,
header.site .menu-btn::before,
header.site .menu-btn::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
header.site .menu-btn span { top: 10px; }
header.site .menu-btn::before { top: 0; }
header.site .menu-btn::after { top: 20px; }

/* ---- Drawer nav (mobile-first: off-canvas by default) ---- */
.drawer-toggle { display: none; }
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(61,43,31,0.35);
  z-index: 25;
}
nav.drawer {
  position: fixed;
  top: 0; bottom: 0; right: 0;
  width: min(300px, 82vw);
  background: var(--paper-deep);
  border-left: 1px solid var(--line);
  z-index: 28;
  padding: 70px 24px 24px;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
}
nav.drawer ul { list-style: none; margin: 0; padding: 0; }
nav.drawer > ul > li { margin-bottom: 18px; }
nav.drawer a {
  display: block;
  padding: 6px 0;
  color: var(--ink);
  font-size: 17px;
}
nav.drawer a.active { color: var(--maroon); font-weight: 600; }
nav.drawer .drawer-section {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}
nav.drawer ul ul { padding-left: 12px; margin-bottom: 4px; }

.drawer-toggle:checked ~ .drawer-overlay { display: block; }
.drawer-toggle:checked ~ nav.drawer { transform: translateX(0); }

@media (min-width: 900px) {
  /* On wider screens, keep the drawer pattern but centered content stays comfortable to read */
  nav.drawer { width: 320px; }
}

/* ---- Content ---- */
main.content {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 20px 10px;
}
article.md-body h1:first-child {
  font-size: 30px;
  margin-bottom: 6px;
}
article.md-body h2 {
  font-size: 24px;
  margin-top: 34px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
article.md-body h3 { font-size: 20px; margin-top: 22px; }
article.md-body .headerlink { display: none; }
article.md-body p { margin: 14px 0; }
article.md-body hr {
  border: none;
  height: 2px;
  margin: 30px auto;
  width: 100%;
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
}
article.md-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}
article.md-body th, article.md-body td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
}
article.md-body blockquote {
  margin: 16px 0;
  padding: 4px 16px;
  border-left: 3px solid var(--gold);
  color: var(--ink-soft);
  font-style: italic;
}
article.md-body .admonition {
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  background: var(--paper-deep);
  padding: 12px 16px;
  margin: 18px 0;
  border-radius: 2px;
}
article.md-body .admonition-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  margin-bottom: 4px;
}

/* ---- Reusable "card" component for section listings (used inside markdown via HTML) ---- */
.eyebrow {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 15px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: 4px;
}
.hero { padding: 10px 0 20px; text-align: center; }
.hero img.sign {
  width: min(280px, 78vw);
  margin: 0 auto 18px;
  display: block;
  filter: drop-shadow(0 6px 10px rgba(61,43,31,0.18));
}
.hero p.sub {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 17px;
  font-style: italic;
}

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 16px 0;
}
@media (min-width: 560px) {
  .cards.cols-2 { grid-template-columns: 1fr 1fr; }
  .cards.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
}
.card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px 16px;
  transition: transform 0.15s ease;
}
.card:hover { text-decoration: none; }
.card:active { transform: scale(0.98); }
.card img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex-shrink: 0;
}
.card .card-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 19px;
  line-height: 1.2;
  color: var(--ink);
}
.card .card-note {
  font-size: 14px;
  color: var(--ink-soft);
  margin-top: 2px;
}
.card.featured { background: var(--ink); border-color: var(--ink); }
.card.featured .card-title { color: var(--paper); }
.card.featured .card-note { color: var(--gold-soft); }

/* ---- Footer ---- */
footer.site {
  margin-top: 40px;
  padding: 30px 20px 40px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
  border-top: 1px solid var(--line);
}
footer.site .cross {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  color: var(--gold);
  margin-bottom: 6px;
}

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