/* tsls.io — shared site styles
   Window-shopping mode (cream + warm) is the v1 default.
   Structural-survey mode is documented but not deployed. */

:root {
  /* Primary identity */
  --scarlet: #5c1a1a;
  --scarlet-ultramaroon: #7b0000;
  --scarlet-hover: #6f0c0c;
  --scarlet-flare: #8a0000;

  /* Grounds + ink — warm (window-shopping) */
  --cream: #eae6e0;
  --cream-light: #f5f1ea;
  --ink: #311310;

  /* Soft pinks (sparingly: crisis page, for-families door, colophon) */
  --pink-soft: #efd6d0;
  --pink-deep: #dcada2;

  /* Cool palette — kept for later, not used in v1 */
  --cool-grey: #f2f3f4;
  --ink-cool: #262d31;

  /* Reserved — teal means water, water means the project's flowing argument.
     Forbidden in v1 outside the map. Declared here for documentation only. */
  --teal-water: #005878;

  /* Type */
  --display: "Cormorant Garamond", "Cormorant", Garamond, "Adobe Garamond Pro", serif;
  --body: "Libre Baskerville", "Baskerville", "Baskerville Old Face", Georgia, serif;
  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Measure + rhythm */
  --measure: 34rem;          /* long-measure prose */
  --measure-tight: 28rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
}

body {
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Type scale */
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 500;
  color: var(--ink);
  margin: 0;
  line-height: 1.18;
  text-wrap: balance;
}

p { margin: 0 0 1em 0; text-wrap: pretty; hyphens: auto; }
p + p { margin-top: 0; }

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

a {
  color: var(--scarlet);
  text-decoration: underline;
  text-decoration-thickness: 0.5px;
  text-underline-offset: 0.2em;
  transition: color 120ms ease;
}
a:hover, a:focus-visible { color: var(--scarlet-hover); }
a:focus-visible {
  outline: 2px solid var(--scarlet);
  outline-offset: 3px;
  border-radius: 1px;
}

::selection { background: var(--pink-soft); color: var(--ink); }

hr.rule {
  border: 0;
  height: 1px;
  background: var(--ink);
  opacity: 0.18;
  margin: 3rem auto;
  width: min(8rem, 30%);
}

/* Layout shell */
.shell {
  max-width: 78rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.measure {
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
}

.measure-tight {
  max-width: var(--measure-tight);
  margin-left: auto;
  margin-right: auto;
}

/* Site mark */
.sitemark {
  text-align: center;
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(1.5rem, 3vw, 2.5rem) 0;
}
.sitemark__title {
  font-family: var(--display);
  font-weight: 500;
  font-style: normal;
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
  letter-spacing: 0.01em;
  line-height: 1.25;
  color: var(--ink);
  display: inline-block;
}
.sitemark__title .scarlet {
  color: var(--scarlet);
  font-style: italic;
}
.sitemark__rule {
  width: 3rem;
  height: 1px;
  background: var(--scarlet);
  margin: 1.25rem auto 0;
  opacity: 0.7;
}
.sitemark--small .sitemark__title { font-size: 1.05rem; }
.sitemark--small { padding: 1.75rem 0 1rem; }

/* Page header (inner pages) — site mark + thin rule */
.page-header { text-align: center; padding: 2.5rem var(--gutter) 1.25rem; }
.page-header a { text-decoration: none; display: inline-block; }
.page-header__mark {
  display: block;
  width: 100%;
  max-width: 28rem;
  height: auto;
  margin: 0 auto;
}

/* Persistent footer */
.site-footer {
  margin-top: clamp(4rem, 8vw, 7rem);
  padding: 2rem var(--gutter) 2.5rem;
  border-top: 1px solid rgba(49, 19, 16, 0.18);
  background: transparent;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.site-footer__inner {
  max-width: 78rem;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 2rem;
  flex-wrap: wrap;
}
.site-footer__principle {
  opacity: 0.78;
  text-transform: none;
}
.site-footer__crisis a {
  color: var(--scarlet);
  text-decoration: none;
  border-bottom: 1px solid rgba(92, 26, 26, 0.35);
  padding-bottom: 1px;
}
.site-footer__crisis a:hover {
  color: var(--scarlet-hover);
  border-bottom-color: var(--scarlet-hover);
}

/* Apparatus / metadata */
.apparatus {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: var(--ink);
  opacity: 0.7;
}

/* Held literary list (no bullets, line-leading) */
.held-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.held-list li {
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(49, 19, 16, 0.12);
  font-style: italic;
  font-family: var(--display);
  font-size: 1.2rem;
  line-height: 1.35;
}
.held-list li:last-child { border-bottom: 0; }
.held-list a {
  color: var(--ink);
  text-decoration: none;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.held-list a:hover, .held-list a:focus-visible {
  color: var(--scarlet);
}
.held-list a::after {
  content: "→";
  font-style: normal;
  font-family: var(--body);
  font-size: 1rem;
  opacity: 0.5;
  transition: transform 160ms ease, opacity 160ms ease;
}
.held-list a:hover::after, .held-list a:focus-visible::after {
  opacity: 1;
  transform: translateX(0.25rem);
  color: var(--scarlet);
}

/* Crisis-page softening (used on crisis only) */
.soft-pink-rule {
  height: 1px;
  background: var(--pink-deep);
  width: min(8rem, 30%);
  margin: 2rem auto;
  border: 0;
  opacity: 0.7;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--cream);
  padding: 0.5rem 1rem;
  z-index: 100;
  font-family: var(--mono);
  font-size: 0.85rem;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* Print hint for inner pages */
@media print {
  .site-footer, .skip-link { display: none; }
  body { background: white; color: black; }
}
