/* Slovo 2.2.5 — full stylesheet, consolidated footer. */
:root {
  color-scheme: light;
  --bg: #f8fafc;
  --paper: #fff;
  --ink: #173246;
  --muted: #526779;
  --line: #dbe3e9;
  --accent: #175b70;
  --tint: #eaf3f6;
  --mark: #ffe998;
  --current: #efb83d;
  --shadow: 0 10px 32px #12354b0b;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
}

:root[data-theme=dark] {
  color-scheme: dark;
  --bg: #101a22;
  --paper: #162530;
  --ink: #e2ecf2;
  --muted: #a6bac7;
  --line: #344752;
  --accent: #80cedf;
  --tint: #213b48;
  --mark: #7d6018;
  --current: #ae7816;
  --shadow: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0px;
  background: var(--bg);
  color: var(--ink);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,input,select {
  font: inherit;
}

button,a,input,select {
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: 0.45;
  cursor: default;
}

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible {
  outline: 3px solid #c99725;
  outline-offset: 4px;
}

button {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 7px;
  padding: 0.65rem 1rem;
}

input,select {
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.65rem;
  max-width: 100%;
}

input {
  min-width: 0px;
}

h1,h2,h3,p {
  margin-top: 0px;
}

.site-header {
  max-width: 1280px;
  margin: auto;
  padding: 26px 40px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  gap: 13px;
  align-items: center;
  color: var(--ink);
  font-size: 1.25rem;
  letter-spacing: 0.18em;
  font-weight: 650;
}

.brand:hover {
  text-decoration: none;
}

.brand small {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  margin-top: 4px;
  font-weight: 500;
  color: var(--muted);
}

.brand-icon {
  background: rgb(23, 61, 82);
  color: rgb(255, 255, 255);
  font-family: Georgia, serif;
  font-size: 2rem;
  border-radius: 4px;
  padding: 0px 9px;
  line-height: 1.4;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 0.9rem;
}

.site-header nav a {
  color: var(--muted);
}

.site-header nav a[aria-current=page] {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 8px;
}

.icon-button {
  padding: 0.3rem 0.7rem;
  font-size: 1.35rem;
}

.search-page,.library-page {
  max-width: 1120px;
  margin: 0px auto;
  padding: 56px 24px 0px;
}

.intro {
  margin-bottom: 30px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--accent);
  margin-bottom: 15px;
}

.intro h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.035em;
  margin-bottom: 16px;
}

.intro p {
  color: var(--muted);
  line-height: 1.7;
}

.search-form {
  display: flex;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px;
  box-shadow: var(--shadow);
  gap: 8px;
}

.search-form input {
  border: 0px;
  flex: 1 1 0%;
  padding: 13px 15px;
  font-size: 1.08rem;
  background: transparent;
  outline-offset: 0px;
}

.primary {
  background: rgb(23, 91, 112);
  border-color: rgb(23, 91, 112);
  color: white;
  padding: 13px 25px;
}

.search-help {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 13px 0px 25px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.search-help button {
  font-size: 0.875rem;
  border: 0px;
  padding: 3px 7px;
  background: var(--tint);
  color: var(--accent);
}

.filter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
  font-size: 0.875rem;
}

.filter-row label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-row select {
  max-width: 350px;
}

.search-layout {
  display: grid;
  grid-template-columns: minmax(0,1fr) 250px;
  gap: 45px;
  align-items: start;
}

.result-summary {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 17px;
  margin: 8px 0px 0px;
  font-size: 0.95rem;
}

.result-summary small {
  color: var(--muted);
  font-size: 0.85rem;
}

.result {
  padding: 25px 0px;
  border-bottom: 1px solid var(--line);
}

.result .meta {
  color: var(--muted);
  font-size: 0.83rem;
  margin-bottom: 8px;
  line-height: 1.6;
}

.result h2 {
  font-family: Georgia, serif;
  font-size: 1.45rem;
  font-weight: 400;
  margin-bottom: 12px;
}

.result p {
  font-family: Georgia, serif;
  font-size: 1.125rem;
  line-height: 1.75;
  margin-bottom: 12px;
  overflow-wrap: anywhere;
}

.result .open-link {
  font-size: 0.86rem;
  font-weight: 550;
}

.result .occurrence {
  font-size: 0.8rem;
  color: var(--muted);
  margin-left: 16px;
}

mark {
  background: var(--mark);
  color: var(--ink);
  border-radius: 2px;
  padding: 0px 0.05em;
}

aside.group-list {
  position: sticky;
  top: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 20px;
  margin-top: 8px;
}

aside h2 {
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 15px;
}

.group-list button {
  display: flex;
  text-align: left;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  width: 100%;
  padding: 10px 0px;
  border-top: 0px;
  border-right: 0px;
  border-bottom: 1px solid var(--line);
  border-left: 0px;
  border-image: none;
  border-radius: 0px;
  background: transparent;
  font-size: 0.875rem;
  line-height: 1.5;
}

.group-list button:last-child {
  border-bottom: 0px;
}

.group-list button span:last-child {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.book-table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
}

.book-table th {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
  padding: 15px 12px;
  border-bottom: 1px solid var(--line);
}

.book-table td {
  padding: 19px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.book-table td:first-child {
  font-family: Georgia, serif;
  font-size: 1.18rem;
}

.book-table td:last-child {
  text-align: right;
}

.empty {
  padding: 50px 0px;
  color: var(--muted);
  line-height: 1.8;
}

.empty h2 {
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 500;
}

.notice {
  padding: 18px 20px;
  background: var(--tint);
  border-radius: 7px;
  line-height: 1.7;
  margin: 20px 0px;
}

.error {
  color: rgb(155, 52, 52);
  border: 1px solid rgb(219, 170, 170);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 28px 0px;
  font-size: 0.875rem;
}

.loading {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}

.reader-layout {
  display: grid;
  grid-template-columns: 250px minmax(0,1fr);
  max-width: 1260px;
  margin: 0px auto;
  gap: 38px;
  padding: 28px 30px;
}

.reader-sidebar {
  position: sticky;
  top: 20px;
  align-self: start;
  font-size: 0.88rem;
}

.reader-sidebar h2 {
  font-size: 1rem;
  line-height: 1.5;
  margin: 22px 0px 7px;
}

.reader-sidebar .author {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.toc {
  max-height: 55vh;
  overflow: auto;
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 13px;
}

.toc a {
  display: block;
  line-height: 1.5;
  padding: 9px 12px;
  border-left: 2px solid transparent;
  font-size: 0.86rem;
  color: var(--muted);
}

.toc a[aria-current=page] {
  background: var(--tint);
  border-left-color: var(--accent);
  color: var(--ink);
}

.reader-content {
  min-width: 0px;
}

.reader-toolbar {
  position: sticky;
  top: 0px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
}

.reader-toolbar button {
  padding: 0.4rem 0.65rem;
}

.hit-controls,.reader-settings {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hit-count {
  font-variant-numeric: tabular-nums;
  min-width: 95px;
  text-align: center;
}

.reader-paper {
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin-top: 20px;
  border-radius: 3px;
}

.chapter-label {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 30px;
}

.book-text {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.19rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.book-text[data-size=large] {
  font-size: 1.4rem;
}

.book-text[data-size=small] {
  font-size: 1.05rem;
}

.book-text .text-block {
  scroll-margin: 120px;
}

.book-text p {
  margin: 0px 0px 1em;
}

.book-text h1,.book-text h2,.book-text h3 {
  font-weight: 500;
  line-height: 1.4;
  margin: 1.7em 0px 0.9em;
}

.book-text h2 {
  font-size: 1.55em;
}

.book-text blockquote {
  border-left: 2px solid var(--line);
  margin-left: 0px;
  padding-left: 24px;
}

.book-text pre {
  white-space: pre-wrap;
}

.book-text mark.current-hit {
  background: var(--current);
  outline: 2px solid #a96c13;
  outline-offset: 2px;
}

.reader-nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 25px 0px;
  font-size: 0.9rem;
}

.in-book {
  display: flex;
  gap: 6px;
  margin-top: 20px;
}

.in-book input {
  width: 100%;
  font-size: 0.875rem;
}

.in-book button {
  padding: 6px 9px;
}

.copy-status {
  min-height: 24px;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 8px;
}

.skip {
  position: fixed;
  top: -100px;
  left: 20px;
  background: var(--paper);
  padding: 12px;
  z-index: 20;
}

.skip:focus {
  top: 10px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0px, 0px, 0px, 0px);
  white-space: nowrap;
  border: 0px;
}

[hidden] {
  display: none !important;
}

summary {
  cursor: pointer;
}

@media (max-width:900px) {
.search-layout {
  grid-template-columns: 1fr;
}

.group-list {
  display: none;
}

.reader-layout {
  grid-template-columns: 200px minmax(0,1fr);
  padding: 20px;
  gap: 20px;
}

.filter-row select {
  max-width: 250px;
}
}

@media (max-width:650px) {
.site-header {
  padding: 19px 18px;
  gap: 14px;
}

.brand {
  font-size: 1rem;
  gap: 8px;
}

.brand small {
  display: none;
}

.brand-icon {
  font-size: 1.65rem;
}

.site-header nav {
  gap: 15px;
  font-size: 0.85rem;
}

.intro h1 {
  font-size: 2.1rem;
}

.search-page,.library-page {
  padding: 34px 18px 0px;
}

.search-form input {
  padding: 12px 8px;
  font-size: 1rem;
}

.primary {
  padding: 12px 15px;
}

.filter-row {
  align-items: stretch;
  flex-direction: column;
  gap: 12px;
}

.filter-row label {
  justify-content: space-between;
}

.filter-row select {
  max-width: 75%;
}

.book-table th:nth-child(2),.book-table td:nth-child(2) {
  display: none;
}

.book-table td,.book-table th {
  padding: 15px 6px;
}

.book-table td:first-child {
  font-size: 1.05rem;
}

.reader-layout {
  display: block;
  padding: 18px 12px;
}

.reader-sidebar {
  position: static;
  margin-bottom: 20px;
  padding: 0px 8px;
}

.reader-sidebar h2 {
  margin-top: 15px;
}

.toc {
  max-height: 200px;
}

.reader-toolbar {
  font-size: 0.8rem;
}

.reader-paper {
  padding: 25px 20px;
}

.reader-settings {
  margin-left: auto;
}

.book-text {
  font-size: 1.12rem;
}

.search-help {
  line-height: 1.7;
}
}

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

:root {
  --near: #dcebe3;
  --semantic: #e2e8ff;
}

:root[data-theme=dark] {
  --near: #254b38;
  --semantic: #303c64;
}

.site-header {
  display: block;
  padding-bottom: 18px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
}

.brand {
  font-family: Georgia, serif;
  letter-spacing: 0px;
  font-size: clamp(1.3rem, 2.4vw, 1.85rem);
  font-weight: 400;
}

.site-header .foundation-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px 18px;
  padding-top: 20px;
  line-height: 1.6;
  font-size: 0.8rem;
}

.foundation-links a {
  padding: 4px 0px;
}

.search-page {
  padding-top: 40px;
}

.search-heading {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 16px;
}

.intro .eyebrow {
  display: none;
}

.match-badge {
  display: inline-block;
  font-size: 0.78rem;
  line-height: 1.5;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 4px 8px;
  margin-bottom: 12px;
  background: var(--tint);
  color: var(--ink);
}

.level-1 {
  background: var(--mark);
}

.level-2 {
  background: var(--near);
}

.level-3 {
  background: var(--semantic);
}

mark.match-near {
  background: var(--near);
}

mark.match-semantic {
  background: var(--semantic);
}

.book-text mark.match-near.current-hit {
  background: var(--near);
}

.book-text mark.match-semantic.current-hit {
  background: var(--semantic);
}

@media (max-width:650px) {
.header-top {
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.site-header nav {
  flex-wrap: wrap;
}

.site-header .foundation-links {
  gap: 5px 15px;
}

.site-header {
  padding: 20px 18px;
}

.search-page {
  padding-top: 28px;
}

.search-form {
  flex-wrap: wrap;
}

.search-form input {
  flex: 1 1 160px;
}

.search-form .primary {
  min-height: 44px;
}

.match-badge {
  max-width: 100%;
}
}

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

#main {
  flex: 1 0 auto;
  width: 100%;
  min-width: 0px;
}

.site-header {
  flex-shrink: 0;
  width: 100%;
}

/* Footer: original teal/slate palette, compact typography, theme-aware colors. */
.site-footer {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1.2fr) minmax(0,1fr);
  align-items: start;
  gap: 20px 32px;
  width: calc(100% - 48px);
  max-width: 1200px;
  margin: 28px auto 0;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.55;
}
.site-footer > * { min-width: 0; }
.site-footer p { margin: 4px 0 0; }
.site-footer > p { margin: 0; }
.site-footer strong { color: var(--ink); font-weight: 600; }
.site-footer a { color: var(--accent); overflow-wrap: anywhere; text-underline-offset: 3px; }
.site-footer .footer-links {
  display: grid;
  grid-template-columns: max-content max-content;
  align-items: center;
  justify-content: start;
  gap: 3px 16px;
  margin: 0;
  padding: 0;
}
.site-footer .footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 0;
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .025em;
}
.site-footer .footer-links .footer-search {
  grid-column: 1 / -1;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.12rem;
  font-weight: 400;
  letter-spacing: .035em;
}
.site-footer .footer-links p {
  grid-column: 1 / -1;
  margin: 2px 0;
  font-size: .8rem;
  line-height: 1.45;
}
@media (max-width: 900px) {
  .site-footer { grid-template-columns: minmax(0,1fr) minmax(0,1.2fr); gap: 12px 24px; }
  .site-footer .footer-links { grid-row: span 2; }
  .site-footer > p { grid-column: 2; }
}
@media (max-width: 600px) {
  .site-footer { grid-template-columns: minmax(0,1fr); width: calc(100% - 36px); margin-top: 24px; padding: 16px 0; gap: 12px; }
  .site-footer .footer-links { grid-row: auto; }
  .site-footer > p { grid-column: auto; }
}
@media (pointer: coarse) {
  .site-footer .footer-links a { min-height: 44px; }
}

/* 2.2.5: shared search, compact footer and accessible return-to-top control. */
.global-search {
  width: 100%; max-width: 1280px; margin: 0 auto;
  padding: 24px 40px 0; flex-shrink: 0;
}
.search-caption {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: 4px 16px; margin-bottom: 12px;
}
.search-caption .search-heading {
  margin: 0; font-size: clamp(.95rem, 1.25vw, 1.08rem); font-weight: 500;
}
.library-count { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.6; }
.search-page, .library-page { padding-top: 24px; }
.site-footer { padding-bottom: 76px; }
.site-footer .footer-links { grid-template-columns: minmax(0, 1fr); }
.site-footer .footer-links .footer-trademarks {
  font-size: .74rem; line-height: 1.65; overflow-wrap: anywhere;
}
.footer-social {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap;
  align-items: center; gap: 4px 24px;
  padding-top: 8px; border-top: 1px solid var(--line);
}
.footer-social a { display: inline-flex; align-items: center; min-height: 44px; }
.back-to-top {
  position: fixed; z-index: 20; right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  width: 46px; height: 46px; padding: 0;
  display: grid; place-items: center;
  background: var(--accent); color: var(--bg); border-color: var(--accent);
  border-radius: 50%; font-size: 1.65rem; box-shadow: 0 3px 12px #0002;
}
.back-to-top:hover { filter: brightness(1.1); }
.copy-status input { width: 100%; margin: 6px 0; font-size: 16px; }
.copy-status button { min-height: 44px; }
@media (max-width: 650px) {
  .global-search { padding: 20px 18px 0; }
  .search-caption { gap: 4px; }
  .library-count { flex-basis: 100%; }
  .search-page, .library-page { padding-top: 20px; }
  .back-to-top { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
}

/* 2.3.0: footer arrangement and no-JavaScript reading. */
.site-footer .footer-links { grid-template-columns: repeat(2, minmax(0, max-content)); }
.site-footer .footer-trademarks { color: var(--ink); font-size: .8rem; line-height: 1.7; overflow-wrap: anywhere; }
.seo-book-title { font-size: 1rem; line-height: 1.5; margin: 22px 0 7px; }
.toc ol { margin: 0; padding: 0; list-style: none; }
