/* The Cairn Society — base styles
   Single stylesheet. Plain text. Edit freely. */

/* --- Tokens --- */
:root {
  --paper:       #F8F5EE;   /* warm off-white background */
  --ink:         #1F1B17;   /* warm near-black text */
  --ink-soft:    #4A453F;   /* slightly lighter for secondary text */
  --muted:       #756E66;   /* warm gray for meta and footer */
  --rule:        #DDD6C9;   /* hairlines and dividers */
  --emphasis:    #3F4A33;   /* deep moss for hover states only */

  --serif:  "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --sans:   "Atkinson Hyperlegible", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --measure: 36rem;          /* book-like reading width */
  --gutter: clamp(1.25rem, 4vw, 2rem);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img { max-width: 100%; height: auto; display: block; }

/* --- Page --- */
html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  font-feature-settings: "kern" 1, "liga" 1, "onum" 1;
  text-rendering: optimizeLegibility;
}

@media (min-width: 40rem) {
  html { font-size: 19px; }
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1 0 auto;
  padding: 0 var(--gutter);
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
}

.wrap-wide {
  max-width: 48rem;
  margin: 0 auto;
}

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

h1 {
  font-size: 1.9rem;
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.015em;
}

@media (min-width: 40rem) {
  h1 { font-size: 2.4rem; }
}

h2 {
  font-size: 1.4rem;
  margin: 2.4rem 0 0.6rem 0;
}

h3 {
  font-size: 1.1rem;
  margin: 1.8rem 0 0.4rem 0;
  font-weight: 600;
}

p {
  margin: 0 0 1.1rem 0;
  hanging-punctuation: first last;
}

p.lede {
  font-size: 1.1rem;
  color: var(--ink-soft);
  font-style: italic;
  margin-bottom: 1.6rem;
}

ul, ol {
  margin: 0 0 1.1rem 0;
  padding-left: 1.4rem;
}

li {
  margin-bottom: 0.4rem;
}

li > ul, li > ol {
  margin-top: 0.4rem;
}

em { font-style: italic; }
strong { font-weight: 600; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--rule);
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover, a:focus {
  color: var(--emphasis);
  text-decoration-color: var(--emphasis);
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.4rem 0;
}

blockquote {
  margin: 1.5rem 0;
  padding-left: 1rem;
  border-left: 2px solid var(--rule);
  color: var(--ink-soft);
  font-style: italic;
}

/* --- Header --- */
.site-header {
  padding: 1.5rem var(--gutter) 1rem var(--gutter);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.5rem;
}

.site-header-inner {
  max-width: 48rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}

.site-name {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--ink);
}

.site-name:hover {
  color: var(--emphasis);
}

.site-nav {
  font-family: var(--sans);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.site-nav a {
  color: var(--ink-soft);
  margin-left: 1.2rem;
  text-decoration: none;
}

.site-nav a:first-child { margin-left: 0; }

.site-nav a:hover {
  color: var(--emphasis);
  text-decoration: underline;
  text-decoration-color: var(--emphasis);
  text-underline-offset: 3px;
}

/* --- Footer --- */
.site-footer {
  flex-shrink: 0;
  margin-top: 4rem;
  padding: 2rem var(--gutter) 2.5rem var(--gutter);
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.site-footer-inner {
  max-width: 48rem;
  margin: 0 auto;
}

.site-footer p {
  margin: 0 0 0.4rem 0;
}

.site-footer a {
  color: var(--muted);
  text-decoration-color: var(--rule);
}

.site-footer a:hover {
  color: var(--emphasis);
}

/* --- Article meta --- */
.eyebrow {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.4rem 0;
  font-weight: 700;
}

.article-meta {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 2rem 0;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.article-meta a {
  color: var(--muted);
  text-decoration-color: var(--rule);
}

/* --- Download box --- */
.downloads {
  background: transparent;
  border: 1px solid var(--rule);
  padding: 1.1rem 1.25rem;
  margin: 2rem 0;
  font-family: var(--sans);
  font-size: 0.92rem;
}

.downloads h2 {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.6rem 0;
  font-weight: 700;
}

.downloads ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.downloads li {
  margin: 0.3rem 0;
}

.downloads a {
  color: var(--ink);
  text-decoration-color: var(--ink);
}

/* --- Article list (homepage / articles index) --- */
.article-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0 0;
}

.article-list li {
  margin: 0 0 2rem 0;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}

.article-list li:last-child {
  border-bottom: 0;
}

.article-list h3 {
  margin: 0 0 0.3rem 0;
  font-size: 1.25rem;
}

.article-list h3 a {
  text-decoration: none;
}

.article-list h3 a:hover {
  text-decoration: underline;
  text-decoration-color: var(--emphasis);
}

.article-list .summary {
  margin: 0;
  color: var(--ink-soft);
}

/* --- FAQ --- */
.faq {
  margin: 3rem 0 1rem 0;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

.faq h2 {
  margin-top: 0;
}

.faq dt {
  font-weight: 600;
  margin-top: 1.4rem;
}

.faq dd {
  margin: 0.3rem 0 0 0;
  color: var(--ink-soft);
}

/* --- Shareable line --- */
.shareable {
  margin: 2.5rem 0;
  padding: 1.5rem 1.5rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-style: italic;
  font-size: 1.15rem;
  text-align: center;
  line-height: 1.4;
}

/* --- Printable / Card pages --- */
.printable-body {
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.45;
}

.printable-body h1 {
  font-family: var(--serif);
  font-size: 1.5rem;
  margin-bottom: 0.4rem;
}

.printable-body h2 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 1.2rem;
  margin-bottom: 0.4rem;
}

.printable-body ul {
  padding-left: 1.2rem;
}

.printable-body li {
  margin-bottom: 0.3rem;
}

/* --- Print styles --- */
@media print {
  :root {
    --paper: #FFFFFF;
    --ink: #000000;
    --ink-soft: #222222;
    --muted: #555555;
    --rule: #BBBBBB;
  }

  html { font-size: 11pt; }
  body { background: white; color: black; }

  .site-header,
  .site-nav,
  .site-footer,
  .downloads,
  .no-print {
    display: none !important;
  }

  main { padding: 0; }
  .wrap, .wrap-wide { max-width: 100%; }

  a {
    color: black;
    text-decoration: underline;
  }

  h1, h2, h3 {
    page-break-after: avoid;
  }

  p, li {
    orphans: 3;
    widows: 3;
  }

  .printable-body {
    font-size: 10pt;
  }
}
