/* ==========================================================================
   Drachenlanze.de – Stylesheet (Neuaufbau 2026)
   Farben und Grafiken des Originals, modernes Layout:
   Kopf mit Logo + Drache, Navigation oben, Bereichsmenü, Pergament-Inhalt.
   ========================================================================== */

:root {
  --bg: #bdbda1;
  --bar: #c1c199;
  --box: #cccc99;
  --box-light: #dcdcb0;
  --olive: #555500;
  --ink: #1d1a12;
  --rot: #770000;
  --wood: #6b4a2b;
  --wood-dark: #3a2614;
  --grey: #6c645e;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Verdana, "DejaVu Sans", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "DejaVu Serif", serif;
  --caps: Copperplate, "Copperplate Gothic Light", "Palatino Linotype", Palatino, Georgia, serif;
  --wrap: 1220px;
  --radius: 3px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font: 16px/1.6 var(--sans);
  color: var(--ink);
  background: var(--bg) url(../img/bg.gif) repeat;
  display: flex; flex-direction: column; min-height: 100vh;
}
img { max-width: 100%; height: auto; }
img:not([border]) { border: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--rot); outline-offset: 2px; }

.skip { position: absolute; left: -999px; top: 0; z-index: 100; background: #fff; padding: .5em 1em; }
.skip:focus { left: 1em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cap { font-size: 1.25em; }

/* ---------------------------------------------------------------- Kopf */
.site-header { position: relative; z-index: 30; }
.hd-inner {
  position: relative;
  max-width: var(--wrap); margin: 0 auto; padding: 10px 20px 0;
  display: flex; align-items: center; gap: 20px;
  min-height: 150px;
}
.logo { flex: 0 1 auto; display: block; line-height: 0; }
.logo img { width: 420px; max-width: 100%; height: auto; filter: drop-shadow(0 1px 1px rgba(0,0,0,.2)); }
.hd-dragon {
  position: absolute; right: 12px; bottom: 0;
  height: 150px; width: auto;
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.25));
}
.hd-search {
  margin-left: auto; margin-right: 230px;
  display: flex; align-items: stretch;
  background: #fffdf2; border: 1px solid #6f6a4c; border-radius: 999px; overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.15);
}
.hd-search input {
  border: 0; background: transparent; font: 15px var(--sans); padding: 7px 4px 7px 14px; width: 15em; min-width: 0;
}
.hd-search input:focus { outline: none; }
.hd-search:focus-within { outline: 2px solid var(--rot); outline-offset: 1px; }
.hd-search button { border: 0; background: transparent; padding: 0 12px; cursor: pointer; color: var(--olive); }
.hd-search button:hover { color: var(--rot); }
.menu-toggle {
  display: none; margin-left: auto;
  align-items: center; gap: 8px;
  font: 600 15px var(--sans); color: var(--ink);
  background: var(--box); border: 1px solid #6f6a4c; border-radius: var(--radius);
  padding: 8px 12px; cursor: pointer;
}
.bars, .bars::before, .bars::after { display: block; width: 18px; height: 2px; background: currentColor; position: relative; }
.bars::before, .bars::after { content: ""; position: absolute; left: 0; }
.bars::before { top: -6px; } .bars::after { top: 6px; }
.pyros { position: absolute; left: 0; top: 0; width: 80px; pointer-events: none; z-index: 2; will-change: transform; }
.pyros img { display: block; width: 100%; }

/* ---------------------------------------------------------------- Hauptnavigation */
.mainnav {
  background: var(--bar);
  background-image: linear-gradient(#cdcda6, #b9b98f);
  border-top: 1px solid #000; border-bottom: 1px solid #000;
  box-shadow: 0 2px 4px rgba(0,0,0,.18);
}
.mn {
  list-style: none; margin: 0 auto; padding: 0 12px;
  max-width: var(--wrap);
  display: flex; flex-wrap: wrap;
}
.mn-item { position: relative; }
.mn-link {
  display: block; border: 0; background: none; cursor: pointer;
  font: bold 14px/1 var(--caps); letter-spacing: .06em; text-transform: uppercase;
  color: var(--olive); text-decoration: none;
  padding: 13px 14px 11px;
  border-bottom: 3px solid transparent;
}
.mn-item.has-sub > .mn-link::after { content: "▾"; margin-left: 6px; font-size: 11px; }
.mn-link:hover, .mn-item:hover > .mn-link, .mn-link[aria-expanded="true"] { color: #000; background: var(--box-light); }
.mn-item.active > .mn-link { color: #000; border-bottom-color: var(--rot); }
.mn-panel {
  display: none;
  position: absolute; top: 100%; left: 0; z-index: 40;
  min-width: 250px;
  background: var(--box);
  border-style: solid; border-width: 7px;
  border-image: url(../img/nav-frame.png) 7 round;
  box-shadow: 0 8px 18px rgba(0,0,0,.3);
  padding: 4px 0 6px;
}
.mn-item:last-child .mn-panel, .mn-item:nth-last-child(2) .mn-panel { left: auto; right: 0; }
@media (hover: hover) and (min-width: 901px) {
  .mn-item.has-sub:hover > .mn-panel { display: block; }
}
.mn-link[aria-expanded="true"] + .mn-panel { display: block; }
.mn-panel ul { list-style: none; margin: 0; padding: 0; }
.mn-panel a {
  display: block; padding: 6px 16px; font-size: 14px; color: var(--olive); text-decoration: none;
  border-bottom: 1px dotted #a9a57a;
}
.mn-panel li:last-child a { border-bottom: 0; }
.mn-panel a:hover, .mn-panel a:focus-visible { background: var(--box-light); color: #000; }
.mn-panel .mn-all { font-weight: 600; color: #000; border-bottom: 1px solid #8d8960; }

/* ---------------------------------------------------------------- Seitenraster */
.page {
  flex: 1;
  width: 100%; max-width: var(--wrap); margin: 0 auto;
  padding: 26px 20px 44px;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px;
}
body.has-aside .page { grid-template-columns: 250px minmax(0, 1fr); }
body:not(.has-aside):not(.home) .main { max-width: 980px; width: 100%; margin: 0 auto; }
.main { min-width: 0; }

/* Bereichsmenü */
.sectionnav { align-self: start; position: sticky; top: 14px; max-height: calc(100vh - 28px); overflow: auto; scrollbar-width: thin; }
.sn {
  background: var(--box);
  border-style: solid; border-width: 7px;
  border-image: url(../img/nav-frame.png) 7 round;
  font-size: 14px; line-height: 1.3;
}
.sn summary {
  list-style: none; cursor: default;
  background: linear-gradient(#b4b384, #c9c89c);
  border-bottom: 1px solid #8d8960;
  padding: 8px 12px;
  font: bold 14px var(--caps); letter-spacing: .05em; text-transform: uppercase;
}
.sn summary::-webkit-details-marker { display: none; }
.sn-title a { color: #000; text-decoration: none; }
.sn-title a:hover { color: var(--rot); }
.sn-body { padding: 2px 0 8px; }
.sn .navhead {
  margin: 10px 12px 2px; font: bold 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #4b4a2a;
}
.sn .navhead:empty { display: none; }
.sn ul { list-style: none; margin: 0; padding: 0; }
.sn li > a {
  display: block; padding: 4px 12px 4px 22px; color: var(--olive); text-decoration: none; position: relative;
}
.sn li > a::before { content: "›"; position: absolute; left: 11px; color: #8a8660; }
.sn li > a:hover { background: var(--box-light); color: #000; }
.sn li.current > a, .sn li.open > a { color: #000; font-weight: 700; }
.sn li.current > a { background: var(--box-light); box-shadow: inset 3px 0 0 var(--rot); }
.sn .subnav { margin: 0 0 4px 12px; border-left: 1px solid #a9a57a; }

/* ---------------------------------------------------------------- Pergament */
.parchment {
  border-style: solid;
  border-width: 22px 27px 25px 26px;
  border-image: url(../img/parchment-frame.png) 22 27 25 26 round;
  background: #ead9b5 url(../img/parchment.jpg) repeat;
  background-clip: padding-box;
  padding: 0 14px;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.28));
}
.leiste-oben {
  min-height: 40px; padding: 0 56px 22px 0;
  display: flex; align-items: flex-end;
  background:
    url(../img/linie_oben_r1_c2.gif) no-repeat right top,
    url(../img/linie_oben_r2_c1.gif) no-repeat left bottom / 100% 21px;
}
.leiste-unten {
  min-height: 38px; padding-top: 21px; text-align: right;
  background:
    url(../img/line_unten_r1_c1.gif) no-repeat left top / 100% 21px,
    url(../img/line_unten_r2_c1.gif) no-repeat left bottom;
}
.totop { font-size: 12px; color: var(--grey); text-decoration: none; }
.totop:hover { color: var(--rot); }
.crumbs { font-size: 12.5px; color: var(--grey); line-height: 1.4; }
.crumbs a { color: var(--grey); text-decoration: none; font-weight: 600; }
.crumbs a:hover { color: var(--rot); text-decoration: underline; }
.crumbs .sep { margin: 0 .45em; color: #a59a86; }
.crumbs [aria-current] { color: #3d382f; }
.leiste { color: var(--grey); font-size: 11px; font-weight: bold; }

/* ---------------------------------------------------------------- Inhalt */
.content {
  padding: 10px 2% 14px;
  font: 17px/1.65 var(--serif);
  overflow-wrap: break-word;
}
.content > :first-child { margin-top: 0; }
.content p, .content li, .content dd { font-size: 1em; }
.content td, .content th { font-size: .95em; line-height: 1.5; }
.content a:link, .content a:visited { color: #3b1a00; font-weight: 600; text-decoration: underline; text-decoration-color: rgba(119,0,0,.35); text-underline-offset: 2px; }
.content a:hover { color: var(--rot); text-decoration-color: currentColor; }
.content a.clean, .content a.cleanu, .content a.cleanbh, .content a.cleanb { text-decoration: none; }
.content a.clean, .content a.cleanu, .content a.cleanbh { font-weight: normal; }
.content a.cleanu:hover { text-decoration: underline; }
.content [align="justify" i], .absatz { text-align: justify; hyphens: auto; }
.content h1, .content h2, .content h3, .page-title { font-family: var(--caps); line-height: 1.25; }
.page-title { color: var(--rot); font-size: 28px; margin: .2em 0 .6em; font-weight: bold; letter-spacing: .02em; }
.center { text-align: center; }
.center > table, .center > .table-wrap > table { margin-left: auto; margin-right: auto; }

/* Alte Schriftgrößen-Klassen vereinheitlichen (früher 8–11 px) */
.content .normtext, .content .klein, .content .small, .content .home, .content .absatz { font-size: 1em; }
.content td .klein, .content td .small { font-size: .95em; }
.content .xklein, .content .smaller, .content .xsmall { font-size: .8em; }
.content .larger { font-size: 1.1em; }
.content .xlarge { font-size: 1.35em; }
.subtitel { color: var(--rot); font: bold 1.15em var(--caps); letter-spacing: .02em; margin: 1.1em 0 .5em; }
.titel { color: #3d5f12; font-size: 1.35em; }
.zitat { font-style: italic; }
.farblich { color: var(--rot); font-weight: bold; }
.rot { color: var(--rot); }
.code { font-family: "Courier New", Courier, monospace; }
.gold { color: #a07800; font-weight: bold; }
.goldklein { color: #a07800; font-size: .8em; font-weight: bold; }
.qbar { background-color: #d3caab; }
p.indent { margin-left: 1cm; } p.indent2 { margin-left: 2cm; } ul.indent { margin-left: 2cm; } .indent03 { margin-left: .3cm; }

.content table { border-collapse: separate; max-width: 100%; text-align: start; }
.table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.content hr { border: 0; border-top: 1px solid #8a7a5a; }
.content table img { max-width: none; }
.content .img-cell { line-height: 0; font-size: 0; }
.content .img-cell img { vertical-align: top; }

/* Tooltips (ersetzen die alten Popup-Skripte) */
[data-tip] { cursor: help; }
.tip {
  position: fixed; z-index: 60; max-width: min(360px, 90vw);
  background: #ffd; color: #000; border: 1px solid #000;
  padding: 6px 8px; font: 13px/1.4 var(--sans);
  box-shadow: 2px 2px 6px rgba(0,0,0,.3); pointer-events: none;
}

/* Videos: erst nach Klick laden */
.video {
  aspect-ratio: 16 / 9; max-width: 640px; margin: 1em auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: #2a241b; color: #e9dcc0; text-align: center; padding: 1em; font-family: var(--sans);
}
.video button { font: bold 14px var(--sans); padding: 9px 16px; cursor: pointer; background: var(--box); border: 1px solid #000; border-radius: var(--radius); }
.video iframe { width: 100%; height: 100%; border: 0; }
.video.loaded { padding: 0; }

/* Umfragen */
.poll { list-style: none; padding: 0; max-width: 560px; font-family: var(--sans); font-size: 15px; }
.poll li { display: grid; margin-bottom: .7em; }
.poll-label { font-style: italic; }
.poll-bar { display: block; height: 12px; background: #e9e0c4; border: 1px solid #6b5a3a; }
.poll-bar span { display: block; height: 100%; width: var(--pct); background: var(--rot); }
.poll-q { font-size: 1.15em; }

/* Übersichtsseiten */
.hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 30px; }
.hub-sec .subtitel { margin-top: .4em; }
.hub-sec ul, .tophub { margin: 0 0 1.2em; padding-left: 1.1em; }
.hub-sec li, .tophub li { margin: .2em 0; }
.tophub { columns: 2 260px; column-gap: 40px; }
.tophub .count { color: var(--grey); font: 12px var(--sans); }

/* Suche */
.searchform { display: flex; gap: 8px; margin-bottom: .6em; font-family: var(--sans); }
.searchform input { flex: 1; min-width: 0; font: 16px var(--sans); padding: 7px 10px; border: 1px solid #6f6a4c; border-radius: var(--radius); background: #fffdf2; }
.searchform button { font: 600 15px var(--sans); padding: 7px 14px; border: 1px solid #6f6a4c; border-radius: var(--radius); background: var(--box); cursor: pointer; }
.searchform button:hover { background: var(--box-light); }
.search-results { padding-left: 1.4em; }
.search-results li { margin-bottom: 1.1em; }
.search-results .crumb { display: block; color: var(--grey); font: 12px var(--sans); }
.search-results .klein { font-size: .9em; }
.search-results mark { background: #f3d77a; }

/* Bildbetrachter */
dialog.lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; }
dialog.lightbox::backdrop { background: rgba(0,0,0,.85); }
dialog.lightbox img { display: block; max-width: 96vw; max-height: 86vh; border: 3px solid #e9dcc0; }
dialog.lightbox p { color: #eee; text-align: center; margin: .4em 0 0; font: 14px var(--sans); }
dialog.lightbox button { position: absolute; top: 4px; right: 4px; font-size: 22px; line-height: 1; background: #e9dcc0; border: 0; padding: 2px 10px; cursor: pointer; }

/* ---------------------------------------------------------------- Startseite */
.home-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 26px; align-items: start; }
.lead { font-size: 1.08em; }
.newslist { list-style: none; margin: 0; padding: 0; }
.newslist li { padding: .55em 0; border-bottom: 1px dotted #9c8b66; }
.newslist time { display: block; font: 600 13px var(--sans); color: var(--grey); letter-spacing: .02em; }
.more { font-family: var(--sans); font-size: 14px; }
.home-side { display: grid; gap: 22px; }
.card, .tile {
  background: var(--box);
  border-style: solid; border-width: 7px;
  border-image: url(../img/nav-frame.png) 7 round;
  box-shadow: 0 2px 5px rgba(0,0,0,.2);
}
.card h2, .tile h3 {
  margin: 0; padding: 8px 14px;
  background: linear-gradient(#b4b384, #c9c89c);
  border-bottom: 1px solid #8d8960;
  font: bold 14px var(--caps); letter-spacing: .06em; text-transform: uppercase;
}
.tile h3 a { color: #000; text-decoration: none; }
.tile h3 a:hover { color: var(--rot); }
.card > :not(h2) { margin: 12px 14px; }
.feats { list-style: none; padding: 0; }
.feats li { margin: .4em 0; }
.feats a, .tile li a { color: var(--olive); font-weight: 600; text-decoration: none; }
.feats a::before { content: "› "; color: var(--rot); }
.feats a:hover, .tile li a:hover { color: #000; text-decoration: underline; }
.card select { width: calc(100% - 28px); font: 14px var(--sans); padding: 6px; background: #ebdac0; border: 1px solid #6f6a4c; border-radius: var(--radius); }
.card .hint { font-size: 12.5px; color: #4b4a2a; }
.search-card .searchform input { font-size: 15px; }
.section-title { font: bold 20px var(--caps); letter-spacing: .08em; text-transform: uppercase; color: #3d3b1c; margin: 38px 0 14px; text-shadow: 0 1px 0 rgba(255,255,255,.35); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.tile ul { list-style: none; margin: 0; padding: 6px 0 10px; font-size: 14.5px; }
.tile li a { display: block; padding: 3px 14px; font-weight: normal; }

/* ---------------------------------------------------------------- Fuß */
.site-footer {
  background: var(--wood-dark) linear-gradient(#4a311b, #2e1e10);
  border-top: 6px solid var(--wood);
  color: #e3d6b8; font-size: 13.5px;
}
.ft-inner { max-width: var(--wrap); margin: 0 auto; padding: 22px 20px 28px; }
.ft-links { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-bottom: 12px; }
.ft-links a { color: #f6e9c8; font-weight: 600; text-decoration: none; }
.ft-links a:hover { text-decoration: underline; }
.ft-links img { vertical-align: -2px; }
.site-footer p { margin: .4em 0; color: #cbbd9c; }
.site-footer .fan { font-size: 12.5px; }

/* ---------------------------------------------------------------- Tablet / Handy */
@media (max-width: 1060px) {
  .hd-search { margin-right: 180px; }
  .hd-dragon { height: 120px; }
  .hd-inner { min-height: 124px; }
  .logo img { width: 340px; }
}
@media (max-width: 900px) {
  .hd-inner { flex-wrap: wrap; min-height: 0; padding: 10px 14px; gap: 10px; }
  .logo img { width: min(300px, 62vw); }
  .hd-dragon { height: 92px; right: 6px; top: auto; bottom: 52px; }
  .menu-toggle { display: inline-flex; margin-left: 0; order: 3; }
  .hd-search { order: 4; margin: 0; flex: 1 1 200px; }
  .hd-search input { width: 100%; }
  .logo { order: 1; flex-basis: 100%; }

  .mainnav { display: none; }
  body.nav-open .mainnav { display: block; }
  .mn { flex-direction: column; padding: 0; }
  .mn-link { width: 100%; text-align: left; padding: 14px 16px; border-bottom: 1px solid #a9a57a; font-size: 15px; }
  .mn-item.active > .mn-link { border-bottom-color: #a9a57a; box-shadow: inset 4px 0 0 var(--rot); }
  .mn-item.has-sub > .mn-link::after { float: right; }
  .mn-link[aria-expanded="true"]::after { transform: rotate(180deg); }
  .mn-panel { position: static; box-shadow: none; border: 0; border-image: none; background: var(--box-light); padding: 0; }
  .mn-panel a { padding: 11px 16px 11px 30px; font-size: 15px; }

  body.has-aside .page { grid-template-columns: minmax(0, 1fr); }
  .page { padding: 16px 10px 30px; gap: 14px; }
  .sectionnav { position: static; max-height: none; }
  .sn summary { cursor: pointer; display: flex; justify-content: space-between; }
  .sn summary::after { content: "▾"; }
  .sn[open] summary::after { content: "▴"; }
  .sn li > a { padding-top: 8px; padding-bottom: 8px; }

  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .parchment { border-width: 16px 14px 18px 14px; padding: 0 4px; }
  .content { padding: 6px 0 10px; font-size: 17px; }
  .content [align="justify" i] { text-align: left; }
  .content td[width] { width: auto; }
  .leiste-oben { padding-right: 54px; }
  .page-title { font-size: 23px; }
  .pyros { display: none; }
}
@media (max-width: 480px) {
  .hd-dragon { display: none; }
  .tiles { grid-template-columns: minmax(0, 1fr); }
}

@media print {
  .site-header, .sectionnav, .site-footer, .pyros, .leiste-unten { display: none !important; }
  body { background: #fff; }
  body.has-aside .page { grid-template-columns: 1fr; }
  .parchment { border: 0; background: none; filter: none; }
}

/* Platzhalter in Impressum/Datenschutz, solange Angaben fehlen */
mark.todo { background: #ffe14d; color: #000; padding: 0 .25em; font-family: var(--sans); font-size: .9em; font-weight: 600; }
.kontakte { padding-left: 1.2em; }
.kontakte li { margin: .5em 0; }
