/*
 * Hochzeit Sonja & Jan – Stylesheet
 * Nachbau des TYPO3-Layouts von 2011: rosa Ringbuch-Ränder links (Menü) und rechts,
 * dunkelrote Schrift auf hellem Grund. Ab 800 px Breite dreispaltig, darunter einspaltig.
 */

:root {
  --text: #801608;
  --link: #cc3300;
  --muted: #9c6d67;
  --bg: #fff9f2;
  --pink: #f7b5c8;
  --menu-width: 200px;
  --edge-width: 49px;
  --right-width: 200px;
  --font: Verdana, Arial, Helvetica, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  color: var(--text);
  font: 13px/1.5 var(--font);
  background: var(--bg);
}

a { color: var(--link); text-decoration: none; }
a:hover, a:focus-visible { color: #000; border-bottom: 1px dotted #000; }
img { max-width: 100%; height: auto; border: 0; }

h2 { font-size: 15px; margin: 0 0 10px; }
h3 { font-size: 14px; margin: 10px 0; }
p, ul, ol, table { margin: 0 0 10px; }
ul { padding-left: 18px; }
td { vertical-align: top; padding: 0 6px 2px 0; }
/* In Tabellen nur bei Bedarf umbrechen, damit Beschriftungen wie "Festnetz:" ganz bleiben */
main td { overflow-wrap: break-word; }
hr { border: 0; border-top: 1px dotted var(--muted); margin: 16px 0; }

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

/* ------------------------------------------------------------- Grundlayout */
.page {
  display: grid;
  grid-template-columns: var(--menu-width) minmax(0, 1fr) var(--edge-width);
  max-width: 1200px;
  min-height: 100vh;
}

.sidebar {
  /* Bild ist 240 px breit; rechts ausrichten, damit die Spirale am Rand der schmaleren Spalte bleibt */
  background: url(../img/LinksKleinTransparent.png) right top repeat-y;
  min-width: 0;
}
.sidebar > * { position: sticky; }
.site-title {
  display: block;
  padding: 30px 50px 20px 10px;
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  text-align: right;
  text-shadow: 0 1px 2px rgba(128, 22, 8, 0.4);
}
.site-title:hover { color: #fff; border: 0; }
.site-title .title-first { display: block; }
.site-title .title-rest { white-space: nowrap; }
#hauptmenue { position: sticky; top: 20px; padding: 0 50px 20px 10px; }
.menu-toggle { display: none; }

.edge { background: url(../img/RechtsKleinTransparent.png) repeat-y; }

.content {
  padding: 0 10px 0 20px;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------- Menü */
.menu { list-style: none; margin: 0; padding: 0; }
.menu a { display: block; padding: 2px 0; text-align: right; }
.menu.level1 > li > a { color: #fff; font-size: 15px; }
.menu.level1 > li.active > a,
.menu.level1 > li > a:hover { font-weight: bold; border: 0; color: #fff; }
.menu.level2 { margin: 2px 0 6px; }
.menu.level2 a, .menu.level3 a { color: #7a5a5a; font-size: 12px; }
.menu.level2 li.active > a, .menu.level2 a:hover,
.menu.level3 li.active > a, .menu.level3 a:hover { font-weight: bold; border: 0; color: var(--text); }
.menu.level3 a { padding-right: 12px; }

/* ------------------------------------------------------------- Kopfzeile (Impressum & Co.) */
.topbar {
  min-height: 30px;
  padding: 8px 0;
  text-align: right;
  color: var(--muted);
  font-weight: bold;
}
.topbar a { color: var(--muted); }
.topbar a.active, .topbar a:hover { color: var(--text); }
.inline-form { display: inline; margin: 0; }
.link-button {
  background: none; border: 0; padding: 0; margin: 0;
  color: var(--muted); font: inherit; font-weight: bold; cursor: pointer;
}
.link-button:hover { color: var(--text); text-decoration: underline dotted; }

/* ------------------------------------------------------------- Spalten */
.columns { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.columns.has-right { grid-template-columns: minmax(0, 1fr) var(--right-width); }
main, aside { min-width: 0; overflow-wrap: anywhere; }
aside.right { font-size: 12px; }

/* ------------------------------------------------------------- Inhaltselemente */
.ce { margin: 0 0 24px; }
.ce::after { content: ""; display: block; clear: both; }
.align-center { text-align: center; }
.align-right { text-align: right; }
.frame-20, .frame-21 {
  border: 1px dotted var(--muted);
  background: rgba(247, 181, 200, 0.15);
  padding: 10px;
}

.ce-images { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.ce-images figure { margin: 0; max-width: 100%; min-width: 0; }
.ce-images figcaption { font-size: 11px; font-style: italic; padding-top: 2px; }
.ce-images-above-center, .ce-images-below-center { justify-content: center; }
.ce-images-above-right, .ce-images-below-right { justify-content: flex-end; }
.ce-images-intext-right, .ce-images-beside-right { float: right; margin-left: 15px; max-width: 50%; }
.ce-images-intext-left, .ce-images-beside-left { float: left; margin-right: 15px; max-width: 50%; }
.ce-images-beside-right + .ce-text, .ce-images-beside-left + .ce-text { overflow: hidden; }
.clear { clear: both; }

.gallery-count { font-size: 11px; color: var(--muted); }
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 6px;
}
.gallery a { display: block; border: 0; aspect-ratio: 4 / 3; overflow: hidden; background: #f3e3dc; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.gallery a:hover img, .gallery a:focus-visible img { transform: scale(1.05); }

video { width: 100%; max-width: 640px; background: #000; }
.audio-list { padding-left: 24px; }
.audio-list li { margin-bottom: 8px; }
.audio-title { display: block; }
.audio-list audio { width: 100%; max-width: 420px; height: 32px; }
.file-size { color: var(--muted); font-size: 11px; }

.map { border: 1px dotted var(--muted); padding: 10px; background: #fff; }
.map iframe { width: 100%; height: 320px; border: 0; display: block; margin-bottom: 6px; }

/* ------------------------------------------------------------- Formulare */
form label { display: block; margin-bottom: 10px; font-weight: bold; }
form input[type=text], form input[type=email], form input[type=password], form textarea {
  display: block; width: 100%; max-width: 420px; margin-top: 2px; padding: 5px;
  border: 1px solid #c9a9a3; border-radius: 3px; font: 13px var(--font); color: #333; background: #fff;
}
form textarea { max-width: 560px; }
button, .button {
  padding: 6px 14px; border: 1px solid var(--text); border-radius: 3px;
  background: var(--text); color: #fff; font: bold 13px var(--font); cursor: pointer;
}
button:hover { background: var(--link); }
.link-button, .link-button:hover { background: none; }
.field-error { display: block; color: #b00000; font-weight: normal; font-size: 12px; }
.form-note { font-size: 11px; color: var(--muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.flash { padding: 8px 12px; border-radius: 3px; margin: 0 0 16px; }
.flash-ok { background: #e7f4e4; border: 1px solid #8bbd7d; color: #2d5a22; }
.flash-error { background: #fbe4e4; border: 1px solid #d98c8c; color: #8a1010; }

/* ------------------------------------------------------------- Losung */
.losung { background: #fff7c2; border: 1px solid #e9d76a; padding: 10px; }
.losung h2 { font-size: 13px; }
.losung-vers { font-size: 11px; font-style: italic; text-align: right; }
.losung-copyright { font-size: 10px; color: var(--muted); }

/* ------------------------------------------------------------- Nachrichten (Verwaltung) */
.message { border-bottom: 1px dotted var(--muted); padding: 8px 0; }
.message-meta { display: block; font-size: 11px; color: var(--muted); }
.message-text { margin: 6px 0; white-space: normal; }

/* ------------------------------------------------------------- Fußbereich mit Zählern */
.counter {
  margin-top: 20px;
  padding: 14px 0 10px 10px;
  background: url(../img/VerlaufLinks.png) no-repeat;
  background-size: 100% 100%;
}
.counter p { margin: 0 0 4px; }
.update { font-size: 10px; text-align: right; color: #804000; }

/* ------------------------------------------------------------- Lightbox */
.lb {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(30, 10, 10, 0.92); color: #fff; padding: 20px;
}
/* display: flex oben würde sonst das hidden-Attribut überstimmen (Overlay bliebe stehen) */
.lb[hidden] { display: none; }
.lb img { max-width: 100%; max-height: calc(100vh - 110px); object-fit: contain; box-shadow: 0 4px 30px #000; }
.lb-caption { margin-top: 10px; min-height: 1.5em; text-align: center; max-width: 90%; }
.lb-btn {
  position: absolute; background: rgba(0, 0, 0, 0.4); border: 0; color: #fff;
  font-size: 28px; line-height: 1; padding: 10px 14px; cursor: pointer; border-radius: 4px;
}
.lb-btn:hover { background: rgba(0, 0, 0, 0.7); }
.lb-close { top: 10px; right: 10px; }
.lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 10px; top: 50%; transform: translateY(-50%); }

/* ------------------------------------------------------------- Schmale Bildschirme */
@media (max-width: 800px) {
  .page { grid-template-columns: minmax(0, 1fr); }
  .edge { display: none; }
  .sidebar {
    background: var(--pink);
    border-bottom: 4px dotted #fff;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    padding: 6px 10px;
  }
  .site-title { padding: 6px 0; font-size: 16px; text-align: left; }
  .site-title .title-first { display: inline; }
  .menu-toggle {
    display: inline-block; background: #fff; color: var(--text); border-color: #fff;
  }
  #hauptmenue { flex-basis: 100%; padding: 6px 0; position: static; }
  .js #hauptmenue { display: none; }
  .js #hauptmenue.open { display: block; }
  .menu a { text-align: left; padding: 6px 0; }
  .menu.level2 { padding-left: 16px; }
  .menu.level3 { padding-left: 16px; }
  .menu.level2 a, .menu.level3 a { color: #5a3a3a; font-size: 14px; }
  .content { padding: 0 10px; }
  .topbar { text-align: left; font-size: 12px; }
  .columns.has-right { grid-template-columns: minmax(0, 1fr); }
  .ce-images-intext-right, .ce-images-intext-left,
  .ce-images-beside-right, .ce-images-beside-left { float: none; margin: 0 0 10px; max-width: 100%; }
}
