:root { --idxw: 4ch; }


@font-face{
  font-family: "Satyr SP";
  src: url("fonts/SatyrSP.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
}
@font-face{
  font-family: "Runtti SP";
  src: url("fonts/RunttiSP-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
}

body { margin: 24px; font-family: Georgia, serif; line-height: 1.5; }
h1 { margin: 0 0 0.25rem 0; }
h2 { margin-top: 2.0rem; }
h3 { margin-top: 1.6rem; }
.container { max-width: 980px; }
.foreword p { margin: 0.55rem 0; }
.foreword p.quote { margin-left: 1.2rem; font-style: italic; }
.summary { font-style: italic; margin: 0.6rem 0 0.8rem 0; }
.break { height: 0.9rem; }
.line { display: flex; gap: .75rem; align-items: baseline; }

/* Dropcap layout (centered on first line) */
.line.has-dropcap .txt{
  position: relative;
  padding-left: 3.2rem; /* reserved space for the initial */
}
.line.has-dropcap .dropcap{
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2.8rem;
  text-align: center;

  font-family: "Runtti SP", serif;
  font-size: 3.1rem;
  line-height: 1;
  font-weight: 700;

  display: block;
  float: none;
  margin: 0;
  padding: 0;
}

.idx { width: var(--idxw); text-align: right; opacity: .65; user-select: none; -webkit-user-select: none; -ms-user-select: none; flex: 0 0 auto;
}
.txt { flex: 1 1 auto; white-space: pre-wrap; }
.note { font-size: 0.95rem; opacity: .8; margin-top: 0.75rem; }
hr { margin: 2rem 0; opacity: .2; }
.toc { margin: 1.5rem 0 2rem 0; padding: 1rem; border: 1px solid #ddd; background: #fafafa; }
.toc h2 { margin-top: 0; }
.toc ol { columns: 2; -webkit-columns: 2; -moz-columns: 2; }
.toc li { margin: 0.2rem 0; } /* --- Kalevala theme polish (v14) --- */
body{
  background:
    radial-gradient(1200px 600px at 50% -200px, rgba(0,0,0,.06), rgba(0,0,0,0) 70%),
    radial-gradient(900px 500px at 50% calc(100% + 240px), rgba(0,0,0,.05), rgba(0,0,0,0) 70%),
    linear-gradient(#f6f1e7, #f3ede1);
}
.container{
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(0,0,0,.10);
  padding: 28px 28px 34px 28px;
  position: relative;
  overflow: hidden;
}
/* subtle “ornament bands” at top and bottom of the container */
.container::before,
.container::after{
  content:"";
  position:absolute;
  left:0; right:0;
  height:22px;
  opacity:.55;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(0,0,0,.22) 0px, rgba(0,0,0,.22) 2px,
      rgba(0,0,0,0) 2px, rgba(0,0,0,0) 10px
    ),
    linear-gradient(90deg, rgba(0,0,0,0), rgba(0,0,0,.25), rgba(0,0,0,0));
}
.container::before{ top:0; }
.container::after{ bottom:0; transform: scaleY(-1); }
h1{
  letter-spacing: .02em;
}
h3{
  letter-spacing: .03em;
  font-variant: small-caps;
  border-bottom: 1px solid rgba(0,0,0,.18);
  padding-bottom: .2rem;
}
/* TOC as “book index” */
.toc{
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(255,255,255,.65);
  position: relative;
}
.toc::before{
  content:"";
  position:absolute;
  left: 14px;
  top: 14px;
  bottom: 14px;
  width: 1px;
  background: rgba(0,0,0,.15);
}
.toc ol{
  padding-left: 1.6rem;
}
.toc a{
  text-decoration: none;
  border-bottom: 1px solid rgba(0,0,0,0);
}
.toc a:hover{
  border-bottom-color: rgba(0,0,0,.35);
}
/* Drop cap: add a gentle “illuminated” feel, still minimal */
/* Rune end marker */
.rune-end{
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 16px;
  margin: 18px 0 8px 0;
  padding: 10px 0;
}
.rune-mark{
  letter-spacing: .25em;
  opacity: .65;
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}
.backtotoc{
  font-size: .92rem;
  opacity: .8;
  text-decoration: none;
  border-bottom: 1px solid rgba(0,0,0,.0);
}
.backtotoc:hover{
  opacity: 1;
  border-bottom-color: rgba(0,0,0,.35);
}


.notice{
  margin: 1.4rem 0 1.6rem 0;
  padding: 1rem 1.2rem;
  background: rgba(255,255,255,.85);
  border-left: 4px solid rgba(0,0,0,.45);
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,.06);
}
.notice p{
  margin: .45rem 0;
}
.notice strong{
  font-weight: 600;
}

/* --- Multi-page navigation --- */
.pagenav{
  display:flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 14px 0 18px 0;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 12px;
  background: rgba(255,255,255,.55);
}
.navlink{
  text-decoration:none;
  border-bottom: 1px solid rgba(0,0,0,0);
  opacity: .9;
  font-weight: 600;
}
.navlink:hover{ border-bottom-color: rgba(0,0,0,.35); opacity: 1; }
.navspacer{ width: 160px; }


/* --- TOC tweaks for multi-page --- */
.toc-foreword{ list-style: none; padding-left: 0; margin: 0 0 0.5rem 0; }
.toc-foreword li{ margin: 0.2rem 0; }
.toc-runes{ columns: 2; -webkit-columns: 2; -moz-columns: 2; }

.notice-purpose{ font-size: 1.12rem; margin-top: .8rem; }
.notice-purpose strong{ letter-spacing: .02em; }

/* --- Notice injected via CSS content (Option C) --- */
.notice{
  margin: 1.4rem 0 1.6rem 0;
  padding: 1rem 1.2rem;
  background: rgba(255,255,255,.85);
  border-left: 4px solid rgba(0,0,0,.45);
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,.06);
}
.notice::before{
  content: "Гэтая публікацыя з глыбокай удзячнасцю і цеплынёй прысвечаная памяці перакладчыка Якуба Лапаткі (1944–2024), які аддаў многія гады свайго жыцця гэтай працы, уклаўшы ў яе сэрца, талент і любоў да слова. За два месяцы да свайго адыходу спадар Якуб ласкава даў нам дазвол апублікаваць гэты пераклад — і мы з вялікай павагай выконваем яго волю.\A \A Па ўсіх пытаннях, якія датычацца гэтай публікацыі, калі ласка, звяртайцеся да нас праз info[at]SverigesBelarusier.eu";
  white-space: pre-line;
  display: block;
}

/* Rune titles + TOC entries */
.rune-title, .toc a{
  font-family: "Satyr SP", serif;
  font-weight: 700;
  letter-spacing: 0.06em;
}


/* Rune title size */
.rune-title{ font-size: 1.5em; }
/* TOC layout (single column, title + summary clickable) */
.toc .grid{ display:block !important; }
.toc-list{ list-style: none; padding-left: 0; margin: .6rem 0 0 0; }
.toc-list li{ margin: .25rem 0; }

.toc-link{
  display:block;
  padding:.65rem .75rem;
  border-radius:12px;
  text-decoration:none;
}
.toc-link:hover{ text-decoration:none; }

.toc-num{
  font-weight: 700;
  margin-right: .35rem;
}

.toc-title{
  display:inline;
}

.toc-sum{
  display:block;
  margin-top: .25rem;
  letter-spacing: 0;
  opacity: .92;
  line-height: 1.35;
}

/* Foreword entry (no numbering) */
.toc-foreword{ margin: .4rem 0 .8rem 0; }
.toc-link.foreword .toc-sum{ display:none; }
/* TOC overrides v3 */
.toc{ column-count: 1; -webkit-column-count: 1; -moz-column-count: 1; }
.toc-list{ columns: 1 !important; -webkit-columns: 1 !important; -moz-columns: 1 !important; }
/* TOC summary styling */
.toc-sum{
font-style: italic; 
font-family: Georgia, serif; 
font-size: 1rem; /* always equals default body size */ 
font-weight: normal;
text-decoration: none !important; 
color: black;
}

.toc-link:hover .toc-title,
.toc-link:hover .toc-num{
  text-decoration: underline;
}
.toc-link:hover .toc-sum{
  text-decoration: none !important;
}

/* Illustrations (public domain, Akseli Gallen-Kallela) */
figure.illustration{
  margin: 1.5rem auto;
  max-width: 900px;
  text-align: center;
}
figure.illustration img{
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
figure.illustration figcaption{
  margin-top: 0.5rem;
  font-style: italic;
  font-size: 0.95em;
  line-height: 1.3;
}

/* --- Book cover (index page) --- */

.book-cover{
  display: flex;
  align-items: center;
  gap: 2rem;
  margin: 1.5rem 0 2.5rem 0;
  padding: 1.4rem 1.2rem;
  border-radius: 18px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(800px 260px at 20% 10%, rgba(0,0,0,.10), rgba(0,0,0,0) 55%),
    radial-gradient(900px 320px at 80% 90%, rgba(0,0,0,.08), rgba(0,0,0,0) 60%),
    linear-gradient(rgba(255,255,255,.70), rgba(255,255,255,.62));
  border: 1px solid rgba(0,0,0,.12);
  box-shadow: 0 10px 26px rgba(0,0,0,.10);
}

/* subtle ornament / vignette bands */
.book-cover::before,
.book-cover::after{
  content:"";
  position:absolute;
  left: 14px;
  right: 14px;
  height: 10px;
  opacity: .35;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(0,0,0,.30) 0px, rgba(0,0,0,.30) 2px,
      rgba(0,0,0,0) 2px, rgba(0,0,0,0) 10px
    );
}
.book-cover::before{ top: 12px; }
.book-cover::after{ bottom: 12px; }
/* credit + small vignette mark */
.book-cover-credit{
  margin-top: .9rem;
  font-style: italic;
  font-size: .95rem;
  opacity: .85;
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* каб засталося як цяпер: злева */
  gap: 1.0rem;             /* ⬅️ вось тут рэгулюеш адлегласьць ПАСЬЛЯ віньеткі */
}

.book-cover-credit::before{
  content: "✦  ✦  ✦";
  display: block;
  opacity: .55;
  letter-spacing: .25em;
  margin: 0;               /* каб нічога не ўплывала “зверху” */
}
.cover-image{
  width: 50%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(0,0,0,.25);
  flex: 0 0 auto;
}

.cover-text{
  flex: 1 1 auto;
  min-width: 240px;
}

.book-title{
  font-family: "Satyr SP", serif;
  font-size: 4rem;
  margin: 0 0 .6rem 0;
  letter-spacing: 0.06em;
}

.book-subtitle{
  font-family: "Satyr SP", serif;
  font-size: 1.2rem;
  margin-bottom: .6rem;
}

.book-translator{
  font-family: "Satyr SP", serif;
  font-size: 1.2rem;
  font-variant: small-caps;
  opacity: .9;
}

/* Mobile: stack vertically */
@media (max-width: 720px){
  body{ margin: 16px; }
  .container{ padding: 22px 18px 28px 18px; }
  .book-cover{
    flex-direction: column;
    align-items: stretch;
    gap: 1.2rem;
    text-align: center;
  }
  .cover-image{
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
  }
  .book-cover-credit::before{
    text-align: center;
  }
}
