/* Fantasybuch24 – Theme "Alte Bibliothek"
   Liegt als Schicht über main.css: Holzvertäfelung als Hintergrund, Pergament-Textur in den Boxen,
   Goldrähmchen (SVG-9-Slice), Leder mit Prägung, ornamentale Trennlinien. Texturen sind SVG-Dateien. */

:root { --frame: url("/img/frame-gold.svg"); }

body {
  background:
    radial-gradient(ellipse 70% 38rem at 50% 0, rgba(255,190,100,.22), transparent 70%),
    radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(0,0,0,.55) 100%),
    url("/img/tex-wood.svg") #26170e;
  background-attachment: scroll;
}

/* Kopf und Fuß: geprägtes Leder */
.masthead, .footer { background-image: url("/img/tex-leather.svg"); background-color: var(--leather); }
.footer { border-top: 2px solid var(--gold); }

/* Rahmen um Hauptspalte und Boxen */
.col-main, .box {
  background: url("/img/tex-paper.svg") var(--paper);
  border: 10px solid transparent; border-image: var(--frame) 16 / 10px stretch;
  border-radius: 0;
  box-shadow: 0 6px 22px rgba(0,0,0,.55);
}
.col-main { border-width: 14px; border-image-width: 14px; padding: 1.5rem clamp(.8rem, 2.6vw, 2rem) 2.25rem; }
.box { border-width: 9px; border-image-width: 9px; padding: .6rem .8rem .8rem; box-shadow: 0 4px 14px rgba(0,0,0,.5); }
.box h2 { border-bottom: 0; background: url("/img/divider.svg") center bottom / 100% 12px no-repeat; padding-bottom: .8rem; text-align: center; }

/* Linke Navigation: Leder mit doppeltem Goldrand und Ziernaht */
.side-nav {
  background: url("/img/tex-leather.svg") var(--leather);
  border: 2px solid var(--gold); border-radius: 2px;
  outline: 1px solid rgba(224,199,131,.45); outline-offset: -7px;
  box-shadow: 0 0 0 1px #1b100b, 0 6px 22px rgba(0,0,0,.55);
  padding: .7rem .3rem;
}
.side-nav summary { text-shadow: 0 1px 0 #000; letter-spacing: .02em; }

/* Überschriften: Zierlinie statt Doppelstrich */
h1 { border-bottom: 0; padding-bottom: 1.1rem; text-align: center;
     background: url("/img/divider.svg") center bottom / min(20rem, 80%) 18px no-repeat; text-shadow: 0 1px 0 rgba(255,255,255,.6); }
.news-item, .genre-card { border-color: rgba(176,138,58,.55); }
.genre-card { background: rgba(239,230,207,.6); border-radius: 2px; border: 1px solid var(--gold); outline: 1px solid rgba(176,138,58,.35); outline-offset: 3px; margin: 3px; }

/* Initiale in Nachrichtentexten */
.news-detail .prose > p:first-of-type::first-letter {
  float: left; font: 700 3.6rem/.85 var(--serif); color: var(--oxblood); padding: .25rem .5rem 0 0; text-shadow: 1px 1px 0 var(--gold-light);
}

/* Buttons und Cover */
.btn, button.btn { border-color: var(--gold); background: linear-gradient(#f6edd4, #e6d8b3); box-shadow: 0 1px 0 #fff8 inset, 0 1px 3px rgba(43,27,20,.3); }
.btn-primary { background: linear-gradient(#85262e, #5c161c); border-color: var(--gold); color: #fff3d2; }
.btn-primary:hover { background: linear-gradient(#97303a, #6f1d24); border-color: var(--gold-light); }
.cover { outline: 1px solid var(--gold); outline-offset: 1px; }

@media (max-width: 48rem) {
  .col-main { border-width: 10px; border-image-width: 10px; }
  .box { border-width: 8px; border-image-width: 8px; }
}
@media print { body { background: #fff; } .col-main, .box { border: 0; border-image: none; background: none; } }

/* A–Z-Leiste: keine große Fläche, aber die kleinen Rähmchen um die Buchstaben */
.abc { position: static; background: none; border-bottom: 0; padding: 0; }
.abc a { border: 1px solid var(--gold); background: var(--paper-2); }
.abc a:hover { background: #fff; border-color: var(--oxblood); color: var(--oxblood); }

/* Linke Navigation: roter Samt im Goldrähmchen (hebt sich vom Holz ab) */
.side-nav {
  background: url("/img/tex-velvet.svg") #5c141b;
  border: 12px solid transparent; border-image: var(--frame) 16 / 12px stretch; border-radius: 0;
  outline: 0;
  box-shadow: 0 6px 22px rgba(0,0,0,.6);
  padding: .1rem 0;
}
.side-nav details { border-bottom-color: rgba(224,199,131,.3); }
.side-nav summary { color: #f1dc9c; }
.side-nav li a:hover { background: rgba(0,0,0,.22); }
.side-nav li a[aria-current="page"], .side-nav li a[aria-current="location"] { background: rgba(0,0,0,.3); }

/* Aufgeklapptes Menü: Buchseite aus Pergament, vom Titel hängt ein Lesezeichenband herab */
.side-nav details[open] > ul {
  position: relative; margin: .1rem .55rem .7rem; padding: .55rem 1.9rem .6rem .35rem;
  background: url("/img/tex-paper.svg") var(--paper);
  border: 1px solid var(--gold); outline: 1px solid rgba(176,138,58,.4); outline-offset: -4px;
  box-shadow: inset 0 0 14px rgba(111,29,36,.18), 0 2px 6px rgba(0,0,0,.45);
}
.side-nav details[open] > ul::before {
  content: ""; position: absolute; right: .55rem; top: -.55rem; width: .95rem; height: calc(100% + .45rem);
  background: linear-gradient(90deg, #0f3a34, #1f5a52 40%, #2a756a 60%, #174a43);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - .55rem), 0 100%);
  filter: drop-shadow(1px 2px 1px rgba(0,0,0,.5));
}
.side-nav details[open] > ul li a { color: var(--ink); border-left-color: transparent; padding-left: .8rem; }
.side-nav details[open] > ul li a:hover { background: rgba(176,138,58,.2); color: var(--oxblood); }
.side-nav details[open] > ul li a[aria-current="page"],
.side-nav details[open] > ul li a[aria-current="location"] { background: rgba(176,138,58,.25); color: var(--oxblood-dark); font-weight: 700; border-left-color: var(--oxblood); }
.side-nav details[open] > ul :focus-visible { box-shadow: inset 0 0 0 2px var(--patina); }

/* Suche im Kopf: kleiner, als Schriftrolle mit Goldrand und Lupen-Siegel */
.head-search { width: min(100%, 20rem); align-items: stretch; border: 1px solid var(--gold); outline: 1px solid rgba(224,199,131,.35); outline-offset: 2px;
  border-radius: 999px; overflow: hidden; background: url("/img/tex-paper.svg") #f1e6c8; box-shadow: inset 0 1px 4px rgba(43,27,20,.35), 0 1px 0 rgba(224,199,131,.25); }
.head-search input { padding: .3rem .4rem .3rem 1rem; font: italic 1rem var(--serif); background: transparent; border: 0; border-radius: 0; color: var(--ink); }
.head-search input::placeholder { color: #7a6747; }
.head-search input:focus { outline: 0; }
.head-search:focus-within { outline-color: var(--gold-light); box-shadow: inset 0 1px 4px rgba(43,27,20,.35), 0 0 0 3px rgba(224,199,131,.3); }
.head-search button { width: 2.4rem; padding: 0; border: 0; border-left: 1px solid var(--gold); border-radius: 0; font-size: 0; color: transparent;
  background: url("/img/search-seal.svg") center / 1.25rem no-repeat, linear-gradient(#8f2a32, #5c161c); }
.head-search button:hover { background: url("/img/search-seal.svg") center / 1.25rem no-repeat, linear-gradient(#a4363e, #6f1d24); }

/* Chat als Pergamentrolle: Holzstäbe mit Goldknäufen, dazwischen das Blatt; klappt auf und zu */
.scroll { margin: 0 0 1.4rem; --rod: linear-gradient(#3a2415, #6b4527 35%, #8a5d35 50%, #5a381d 75%, #2a190d); }
.scroll-rod { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 1.9rem; margin: 0; padding: 0 1.6rem; border: 0; border-radius: .95rem;
  background: var(--rod); box-shadow: 0 3px 6px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,220,160,.35); color: var(--gold-light); font: 700 1.1rem var(--serif); }
.scroll-rod::before, .scroll-rod::after { content: ""; position: absolute; top: 50%; width: .9rem; height: 1.55rem; transform: translateY(-50%);
  background: radial-gradient(circle at 35% 30%, #f3dd9c, #b08a3a 55%, #6b4f1a); border-radius: 45%; box-shadow: 0 1px 3px rgba(0,0,0,.6); }
.scroll-rod::before { left: -.35rem; } .scroll-rod::after { right: -.35rem; }
.scroll-top { cursor: pointer; text-shadow: 0 1px 1px #000; }
.scroll-top:hover { color: #fff3c9; }
.scroll-top:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }
.scroll-hint { position: absolute; right: 1.5rem; width: .55rem; height: .55rem; border-right: 2px solid var(--gold-light); border-bottom: 2px solid var(--gold-light); transform: rotate(-45deg); transition: transform .3s; }
.scroll.is-open .scroll-hint { transform: rotate(45deg); }
.scroll-bottom { height: 1.5rem; margin-top: -1px; }
.scroll:not(.is-open) .scroll-bottom { margin-top: -.35rem; }

.scroll-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s ease; margin: 0 1.1rem; }
.scroll.is-open .scroll-body { grid-template-rows: 1fr; }
.scroll-sheet { min-height: 0; overflow: hidden; visibility: hidden; transition: visibility 0s .45s;
  background: url("/img/tex-paper.svg"), linear-gradient(90deg, rgba(120,80,30,.28), transparent 7%, transparent 93%, rgba(120,80,30,.28)), #f1e5c3;
  box-shadow: inset 0 8px 8px -6px rgba(60,35,10,.55), inset 0 -8px 8px -6px rgba(60,35,10,.55); }
.scroll.is-open .scroll-sheet { visibility: visible; transition-delay: 0s; padding: .9rem 1rem 1.1rem; }
.scroll:not(.is-open) .scroll-sheet { padding: 0 1rem; }

.chat-guest { margin: .4rem 0; text-align: center; font-family: var(--serif); font-size: 1.05rem; }
.chat-log { list-style: none; margin: 0; padding: .3rem .5rem; height: 11rem; overflow-y: auto; font-size: .95rem; border-bottom: 1px solid rgba(176,138,58,.5); }
.chat-msg { display: flex; flex-wrap: wrap; gap: 0 .45rem; padding: .12rem 0; align-items: baseline; }
.chat-time { color: var(--ink-soft); font-size: .8rem; }
.chat-name { color: var(--oxblood); font-family: var(--serif); }
.chat-text { overflow-wrap: anywhere; flex: 1 1 8rem; }
.chat-day, .chat-empty { text-align: center; color: var(--ink-soft); font: italic .9rem var(--serif); padding: .2rem 0; }
.chat-del { border: 0; background: none; color: var(--ink-soft); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0 .3rem; }
.chat-del:hover { color: var(--oxblood); }
.chat-form { display: flex; gap: .5rem; margin-top: .7rem; }
.chat-form input { flex: 1; min-width: 0; height: 2.4rem; padding: 0 .7rem; border: 1px solid var(--gold); background: rgba(251,247,234,.9); font: inherit; }
.chat-form .btn { padding: .35rem 1rem; }
.chat-error { margin: .4rem 0 0; color: var(--danger); font-size: .92rem; }
@media (prefers-reduced-motion: reduce) { .scroll-body, .scroll-hint { transition: none; } }

/* Konto löschen: mehr Abstand zum Formular darüber */
.danger-zone { margin-top: 2.75rem; }
