:root {
  --wine: #9b1f2a;
  --wine-dark: #68131c;
  --rose: #cc6666;
  --green: #6f9f38;
  --ink: #27221f;
  --muted: #6d625c;
  --paper: #fffdf9;
  --cream: #f7f0e8;
  --line: #e5cbc8;
  --blue: #0058af;
  --shadow: 0 12px 32px rgba(70, 35, 28, 0.09);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at 15% 0%, rgba(204, 102, 102, 0.13), transparent 26rem), linear-gradient(#fff 0, var(--paper) 22rem, var(--cream) 100%);
  font-family: Verdana, Arial, sans-serif;
  line-height: 1.6;
}
a { color: var(--blue); }
a:visited { color: #8e4a2d; }
a:hover { color: #333366; }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 10; padding: .7rem 1rem; background: white; }
.skip-link:focus { left: 1rem; top: 1rem; }
.site-header { min-height: 76px; display: flex; align-items: center; color: white; background: #050505; border-top: 5px solid var(--wine); }
.header-inner, .nav-inner, main { width: min(1120px, calc(100% - 36px)); margin-inline: auto; }
.header-inner { display: flex; align-items: baseline; justify-content: space-between; gap: 1.5rem; }
.site-name { color: #b95d3c !important; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.35rem, 3vw, 1.9rem); font-weight: 700; text-decoration: none; letter-spacing: .01em; }
.site-section { color: #ded4cd; font-size: .9rem; letter-spacing: .12em; text-transform: uppercase; }
.site-nav { background: linear-gradient(to top, var(--rose) 0%, #ad3940 64%, var(--wine) 100%); box-shadow: 0 3px 10px rgba(70, 20, 25, .2); }
.nav-inner { display: flex; }
.nav-inner a { padding: .78rem 1.25rem; color: white !important; text-decoration: none; font-size: .94rem; font-weight: 700; }
.nav-inner a:hover, .nav-inner a:focus-visible { background: #7f2f31; }
.nav-inner a.active { background: linear-gradient(to top, #7fd13f 0%, var(--green) 100%); }
main { padding: 3.2rem 0 4.5rem; }
.hero { position: relative; overflow: hidden; padding: clamp(2rem, 5vw, 4.2rem); border: 1px solid var(--line); border-radius: 18px; background: rgba(255, 253, 249, .92); box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; top: -7rem; right: -6rem; width: 22rem; height: 22rem; border: 42px solid rgba(155, 31, 42, .06); border-radius: 50%; pointer-events: none; }
.eyebrow { margin: 0 0 .4rem; color: var(--wine); font-size: .77rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3 { margin-top: 0; font-family: Georgia, "Times New Roman", serif; line-height: 1.18; }
h1 { margin-bottom: .9rem; font-size: clamp(2.5rem, 7vw, 5.2rem); color: var(--wine-dark); }
.intro { max-width: 760px; margin: 0; color: #544944; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.05rem, 2vw, 1.3rem); }
.search-box { position: relative; z-index: 1; max-width: 820px; margin-top: 2.1rem; }
.search-box label { display: block; margin-bottom: .45rem; font-weight: 700; }
.search-row { display: flex; gap: .65rem; }
input[type="search"] { min-width: 0; flex: 1; padding: .88rem 1rem; border: 1px solid #c8aaa6; border-radius: 7px; background: white; color: var(--ink); font: inherit; }
input[type="search"]:focus { outline: 3px solid rgba(111, 159, 56, .28); border-color: var(--green); }
button, .document-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .7rem 1rem; border: 0; border-radius: 7px; background: var(--green); color: white !important; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
button:hover, .document-link:hover { background: #557e29; text-decoration: none; }
.clear-button { background: #5e5651; }
.clear-button:hover { background: #403a37; }
.search-help { margin: .5rem 0 0; color: var(--muted); font-size: .83rem; }
.collection { padding-top: 4rem; }
.collection-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1.3rem; }
h2 { margin-bottom: 0; font-size: clamp(1.8rem, 4vw, 2.7rem); }
.result-count { margin: 0 0 .25rem; color: var(--muted); }
.story-list { display: grid; gap: 1rem; }
.story-card { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 1.15rem; align-items: start; padding: 1.35rem; border: 1px solid var(--line); border-left: 5px solid var(--wine); border-radius: 10px; background: rgba(255, 255, 255, .87); box-shadow: 0 6px 20px rgba(65, 34, 27, .06); }
.document-icon { width: 50px; height: 58px; display: grid; place-content: center; border-radius: 5px; background: #f4e5e3; color: var(--wine); font-size: .72rem; font-weight: 800; letter-spacing: .06em; }
.story-card h3 { margin-bottom: .3rem; font-size: 1.25rem; }
.story-card h3 a { color: var(--wine-dark); text-decoration: none; }
.story-card h3 a:hover { text-decoration: underline; }
.document-meta { margin: 0 0 .65rem; color: var(--muted); font-size: .79rem; }
.summary { margin: 0; color: #49413d; }
.summary.placeholder { color: #80726b; font-style: italic; }
.match-excerpt { margin: .8rem 0 0; padding: .7rem .85rem; border-left: 3px solid var(--green); background: #f1f6eb; color: #3f4936; font-size: .9rem; }
mark { padding: 0 .08em; background: #fff0a8; color: inherit; }
.empty-state { padding: 2.5rem; border: 1px dashed #bd918c; border-radius: 10px; text-align: center; background: white; }
footer { padding: 1.6rem 1rem; border-top: 1px solid var(--line); color: #6f625b; background: #f6eee7; text-align: center; font-size: .84rem; }
@media (max-width: 680px) {
  .header-inner { align-items: flex-start; flex-direction: column; gap: .15rem; padding-block: .8rem; }
  .nav-inner { width: 100%; overflow-x: auto; }
  .nav-inner a { flex: 1 0 auto; text-align: center; padding-inline: .85rem; }
  main { width: min(100% - 22px, 1120px); padding-top: 1rem; }
  .hero { padding: 1.5rem; border-radius: 11px; }
  .search-row { flex-wrap: wrap; }
  input[type="search"] { flex-basis: 100%; }
  .collection-heading { align-items: start; flex-direction: column; gap: .25rem; }
  .story-card { grid-template-columns: 44px minmax(0, 1fr); padding: 1rem; }
  .document-icon { width: 42px; height: 49px; }
  .document-link { grid-column: 1 / -1; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
