/* Wisdom, sleeping.. — warm manuscript design.
   Modern frame (layout, nav, buttons: sans, clean) around a bookish voice
   (EB Garamond display, parchment paper, ink accents). Assets referenced
   from CSS use RELATIVE paths so the /wisdom-tenner/ pathPrefix build works. */

@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/ebgaramond-var.woff2") format("woff2");
}
@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/ebgaramond-var-italic.woff2") format("woff2");
}

:root {
  --paper: #f4ebd7;
  --paper-deep: #eaddc0;
  --paper-card: #faf4e3;
  --ink: #2d2519;
  --body-ink: #3a3122;
  --muted: #77684e;
  --line: #d9c7a3;
  --accent: #8a3a2a;
  --accent-dark: #662a1e;
  --serif: Georgia, "Times New Roman", serif;
  --display: "EB Garamond", Georgia, "Times New Roman", serif;
  --sans: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.055'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

html {
  color: var(--ink);
  background-color: var(--paper);
  background-image: var(--grain);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.72;
  scroll-behavior: smooth;
}

body { margin: 0; }

a { color: var(--accent-dark); text-decoration-thickness: 1px; text-underline-offset: .16em; }
a:hover { color: var(--accent); }
img { display: block; max-width: 100%; height: auto; }

h1, h2, h3, h4 { font-family: var(--display); font-weight: 560; color: var(--ink); }

.skip-link {
  position: fixed;
  z-index: 20;
  top: .5rem;
  left: .5rem;
  padding: .55rem .8rem;
  background: var(--ink);
  color: white;
  transform: translateY(-150%);
}
.skip-link:focus { transform: none; }

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  border-bottom: 3px double var(--line);
  background: color-mix(in srgb, var(--paper), transparent 8%);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 2rem));
  min-height: 4.5rem;
  margin: auto;
  gap: 2rem;
}

.site-name {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: var(--ink);
  line-height: 1.1;
  text-decoration: none;
}
.site-mark { width: auto; height: 2.35rem; }
.site-name span { display: block; font-family: var(--display); font-size: 1.32rem; font-weight: 620; }
.site-name .site-name-edition {
  font-variant-caps: all-small-caps;
  letter-spacing: .06em;
}
.site-name small {
  display: block;
  margin-top: .12rem;
  color: var(--muted);
  font-family: var(--display);
  font-size: .8rem;
  font-variant-caps: all-small-caps;
  letter-spacing: .17em;
}

.site-nav { display: flex; align-items: center; gap: 1.3rem; }
.site-nav a {
  color: var(--ink);
  font-family: var(--sans);
  font-size: .76rem;
  font-weight: 650;
  letter-spacing: .04em;
  text-decoration: none;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); }
.menu-button { display: none; }

.hero {
  border-bottom: 1px solid var(--line);
  background-color: var(--paper-deep);
  background-image:
    var(--grain),
    radial-gradient(circle at 88% 8%, rgba(138, 58, 42, .13), transparent 26rem),
    radial-gradient(circle at 8% 100%, rgba(160, 120, 60, .14), transparent 30rem),
    linear-gradient(155deg, #f8f1dd, #e9d9b6);
}
.hero-inner {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  width: min(1280px, calc(100% - 2rem));
  margin: auto;
  padding: clamp(3.5rem, 8vw, 6.5rem) 0;
}
.eyebrow {
  margin: 0 0 .75rem;
  color: var(--accent);
  font-family: var(--display);
  font-size: 1.02rem;
  font-weight: 600;
  font-variant-caps: all-small-caps;
  letter-spacing: .22em;
}
.hero h1, .page-header h1, .collection-header h1 {
  margin: 0;
  font-size: clamp(2.55rem, 6.5vw, 4.9rem);
  font-weight: 540;
  letter-spacing: -.012em;
  line-height: 1.02;
}
.hero h1 em, .page-header h1 em { font-style: italic; font-weight: 480; }
.hero-subtitle {
  margin: .45rem 0 0;
  color: var(--accent);
  font-family: var(--display);
  font-size: clamp(1.25rem, 2.8vw, 1.65rem);
  line-height: 1.2;
}
.hero-provenance {
  max-width: 660px;
  margin: 1.35rem 0 0;
  color: var(--muted);
  font-family: var(--display);
  font-size: 1rem;
  line-height: 1.5;
}
.hero-intro {
  max-width: 640px;
  margin: 1.15rem 0 0;
  color: #52472f;
  font-family: var(--display);
  font-size: clamp(1.18rem, 2.5vw, 1.45rem);
  line-height: 1.5;
}
.hero-links { display: flex; align-items: center; gap: 1.4rem; margin-top: 2.1rem; }
.button {
  display: inline-block;
  padding: .72rem 1.05rem;
  border-radius: 2px;
  background: var(--accent);
  color: white;
  font-family: var(--sans);
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(102, 42, 30, .25);
}
.button:hover { background: var(--accent-dark); color: white; }
.text-link { font-size: .93rem; }

/* The sleeping painting, mounted like a plate in a book */
.hero-plate {
  margin: 0;
  transform: rotate(.4deg);
}
.hero-plate img {
  padding: clamp(.6rem, 1.4vw, .9rem);
  border: 1px solid #cbb488;
  background: #fbf6e9;
  box-shadow: 0 18px 45px rgba(80, 55, 25, .28);
}
.hero-plate figcaption {
  max-width: 30rem;
  margin: 1rem auto 0;
  color: #5d5138;
  font-family: var(--display);
  font-size: 1.02rem;
  font-style: italic;
  line-height: 1.5;
  text-align: center;
}

.page-shell, .collection-shell {
  width: min(850px, calc(100% - 2rem));
  margin: auto;
  padding: clamp(3.5rem, 8vw, 7rem) 0;
}
.page-header, .collection-header {
  margin-bottom: clamp(2.5rem, 6vw, 5rem);
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}
.page-header h1, .collection-header h1 {
  max-width: 900px;
  font-size: clamp(2.2rem, 5.5vw, 4.1rem);
  line-height: 1.08;
}
.published {
  margin: 1rem 0 0;
  color: var(--muted);
  font-family: var(--display);
  font-size: .92rem;
  font-variant-caps: all-small-caps;
  letter-spacing: .12em;
}

.prose { color: var(--body-ink); font-size: 1.03rem; }
.prose > *:first-child { margin-top: 0; }
.prose h2, .prose h3, .prose h4 {
  margin: 2.3em 0 .7em;
  line-height: 1.22;
}
.prose h2 { font-size: 1.95rem; font-weight: 560; }
.prose h3 { font-size: 1.45rem; }
.prose p, .prose ul, .prose ol { margin: 1.15em 0; }

/* Drop cap on essays and stories — the illuminated first letter.
   The .has-dropcap class is set by site.js on the first real text paragraph. */
.prose--essay > p.has-dropcap::first-letter {
  float: left;
  padding: .05em .07em 0 0;
  color: var(--accent);
  font-family: var(--display);
  font-size: 3.2em;
  font-weight: 560;
  line-height: .8;
}

.prose blockquote {
  margin: 2rem 0;
  padding: .2rem 0 .2rem 1.5rem;
  border-left: 3px solid var(--accent);
  color: #55492e;
  font-family: var(--display);
  font-size: 1.18rem;
  font-style: italic;
  line-height: 1.6;
}

/* Section breaks become the hand-drawn flourish */
.prose hr {
  height: 26px;
  margin: 2.8rem auto;
  border: 0;
  background: url("../uploads/brand/flourish.png") center / auto 100% no-repeat;
  opacity: .8;
}

.prose img {
  margin: 2rem auto;
  border: 1px solid #d3bd92;
  background: #fbf6e9;
  padding: .55rem;
  box-shadow: 0 12px 34px rgba(80, 55, 25, .16);
}
.prose figure {
  width: fit-content;
  max-width: 100%;
  margin: 2.4rem auto;
}
.prose figure img { margin: 0 auto; }
.prose figcaption {
  max-width: 42rem;
  margin: .75rem auto 0;
  color: var(--muted);
  font-family: var(--display);
  font-size: .95rem;
  font-style: italic;
  line-height: 1.45;
  text-align: center;
}
.prose figcaption a { color: inherit; }
.prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.prose th, .prose td { padding: .55rem; border: 1px solid var(--line); }

/* Home page: the hero already presents the painting and its line,
   so hide the duplicated opening block of the imported page content. */
.home-content .prose > h2:first-child,
.home-content .prose > figure:first-of-type,
.home-content .prose > p:first-of-type,
.home-content .prose > hr:first-of-type { display: none; }

.collection-header p:last-child {
  max-width: 700px;
  color: var(--muted);
  font-family: var(--display);
  font-size: 1.2rem;
}
.entry-list { margin: 0; padding: 0; list-style: none; }
.entry-list li { border-top: 1px solid var(--line); }
.entry-list li:last-child { border-bottom: 1px solid var(--line); }
.entry-list a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .25rem 2rem;
  padding: 1.25rem .1rem;
  color: var(--ink);
  text-decoration: none;
}
.entry-list a:hover { background: color-mix(in srgb, var(--paper-card), transparent 40%); }
.entry-list a:hover .entry-title { color: var(--accent); }
.entry-title { font-family: var(--display); font-size: 1.3rem; font-weight: 560; line-height: 1.32; }
.entry-list time {
  padding-top: .2rem;
  color: var(--muted);
  font-family: var(--display);
  font-size: .85rem;
  font-variant-caps: all-small-caps;
  letter-spacing: .08em;
  white-space: nowrap;
}
.entry-description { grid-column: 1; color: var(--muted); font-size: .88rem; }

.story-collection {
  width: min(1080px, calc(100% - 2rem));
}
.collection-invitation {
  margin-top: 1.2rem;
  font-style: italic;
}
.story-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}
.story-grid li { min-width: 0; }
.story-grid li.story-card--foreword { grid-column: 1 / -1; }
.story-grid a {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  padding: clamp(1.25rem, 3vw, 1.8rem);
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper-card);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(80, 55, 25, .05);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.story-grid a:hover {
  border-color: color-mix(in srgb, var(--accent), var(--line) 45%);
  box-shadow: 0 13px 32px rgba(80, 55, 25, .12);
  transform: translateY(-2px);
}
.story-number {
  margin-bottom: .55rem;
  color: var(--accent);
  font-family: var(--display);
  font-size: .85rem;
  font-weight: 620;
  font-variant-caps: all-small-caps;
  letter-spacing: .16em;
}
.story-grid .entry-title { font-size: clamp(1.3rem, 2.5vw, 1.6rem); }
.story-grid .entry-description {
  display: -webkit-box;
  margin-top: .65rem;
  overflow: hidden;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.story-read {
  margin-top: auto;
  padding-top: 1.1rem;
  color: var(--accent-dark);
  font-family: var(--sans);
  font-size: .74rem;
  font-weight: 700;
}

.site-footer {
  border-top: 3px double var(--line);
  background-color: var(--paper-deep);
  background-image: var(--grain);
  text-align: center;
}
.footer-flourish {
  height: 24px;
  width: auto;
  margin: 2.2rem auto 0;
  opacity: .75;
}
.site-footer > div {
  display: flex;
  justify-content: center;
  width: min(1180px, calc(100% - 2rem));
  margin: auto;
  padding: 1.1rem 0 2.6rem;
  gap: 2rem;
  color: var(--muted);
  font-size: .82rem;
  font-family: var(--display);
}
.site-footer p { margin: 0; }
.edition-name {
  font-variant-caps: all-small-caps;
  letter-spacing: .06em;
}
.quiet { font-family: var(--sans); }

@media (max-width: 800px) {
  html { font-size: 17px; }
  .menu-button {
    display: block;
    padding: .5rem .7rem;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    font-family: var(--sans);
  }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 1rem;
    left: 1rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: .5rem;
    border: 1px solid var(--line);
    background: var(--paper);
    box-shadow: 0 15px 35px rgba(50, 35, 15, .18);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: .75rem; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-plate { max-width: 26rem; transform: none; }
  .hero-links { align-items: flex-start; flex-direction: column; }
  .entry-list a { grid-template-columns: 1fr; }
  .entry-list time { grid-row: 2; }
  .story-grid { grid-template-columns: 1fr; }
  .site-footer > div { flex-direction: column; gap: .4rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* The credit line under the sleeping painting */
.plate-credit {
  display: block;
  margin-top: .5rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: .74rem;
  font-style: normal;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* Search — the thread that ties the pages into one network of thought */
.site-search {
  width: min(850px, calc(100% - 2rem));
  margin: 2rem auto 0;
}
.site-search-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
  padding: .9rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper-card);
}
.site-search-form label {
  color: var(--muted);
  font-family: var(--sans);
  font-size: .74rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.site-search-input {
  flex: 1 1 16rem;
  min-width: 0;
  padding: .55rem .7rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.05rem;
}
.site-search-input:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(138, 58, 42, .25);
}
.site-search-button { padding: .55rem 1.1rem; font-size: .85rem; }
.site-search-results:not(:empty) {
  margin-top: 1.2rem;
  padding: 1.1rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper-card);
}
.site-search-count, .site-search-empty {
  margin: 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: .82rem;
}
.site-search-list {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}
.site-search-list li + li {
  margin-top: .9rem;
  padding-top: .9rem;
  border-top: 1px solid var(--line);
}
.site-search-list a {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .6rem;
  text-decoration: none;
}
.site-search-title {
  color: var(--accent);
  font-family: var(--display);
  font-size: 1.15rem;
}
.site-search-list a:hover .site-search-title { text-decoration: underline; }
.site-search-kind {
  color: var(--muted);
  font-family: var(--sans);
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.site-search-snippet {
  margin: .3rem 0 0;
  color: var(--body-ink);
  font-family: var(--serif);
  font-size: .95rem;
  line-height: 1.6;
}
.site-search-snippet mark {
  padding: 0 .1em;
  background: rgba(212, 160, 60, .35);
  color: inherit;
}

/* The Power to Make Things Simple — Edition 2026 (book pages) */
.book-nav p { font-size: 0.9rem; margin: 1rem 0 2rem; }
.book-note { font-size: 0.88rem; line-height: 1.5; border-left: 3px solid rgba(0,0,0,.15); padding: .2rem 0 .2rem 1rem; margin: 1rem 0 1.5rem; }
.book-note p { margin: 0; }
.book-plate img { max-width: 100%; height: auto; display: block; margin: 1rem auto; }
.book-contact { margin-top: 2.5rem; padding: 1rem; border: 1px solid rgba(0,0,0,.15); }
.prose table { border-collapse: collapse; margin: 1.5rem 0; font-size: .92rem; }
.prose table td { border: 1px solid rgba(0,0,0,.15); padding: .4rem .6rem; vertical-align: top; }
