/* PDF-Download auf den Rechtstext-Seiten (marcherlab.com/agb/ und /avv/).
   Eine Meta-Zeile unter dem Untertitel: Stand-Badge und Download-Button, am Ende des Dokuments
   dieselbe Aktion als ruhiger Textlink. Das PDF entsteht mit tools/rechtstexte-pdf.mjs aus der Seite;
   der Generator hasht diese Datei mit, damit Druck-Layout und PDF zusammenpassen. */

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 2rem;
}
.doc-meta .date-badge { margin-top: 0; }

/* Outline-Button: das einzige Gold-Element im Kopf neben dem Zurück-Button der Kopfleiste. */
.pdf-download {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0.6rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--gold);
  background: transparent;
  border: 1.5px solid var(--gold);
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.pdf-download svg { flex-shrink: 0; }
.pdf-download:hover { background: var(--gold); color: var(--navy); }
.pdf-download:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* Wiederholung am Dokumentende */
.pdf-download-ende {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.pdf-download-ende a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
  border-bottom: 2px solid var(--gold);
}
.pdf-download-ende a:hover { border-bottom-color: var(--gold-dark); }
.pdf-download-ende a:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; }

@media (max-width: 700px) {
  .doc-meta { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
  .doc-meta { align-items: stretch; }
  .doc-meta .date-badge { align-self: flex-start; }
  .pdf-download { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .pdf-download { transition: none; }
}
@media print {
  .doc-meta .pdf-download, .pdf-download-ende { display: none !important; }
  /* Ueberschrift nie allein am Seitenende */
  .section-block h2, .section-block h3 { break-after: avoid; page-break-after: avoid; }
  .section-block h2 + p, .section-block h2 + ul, .section-block h3 + p, .section-block h3 + ul { break-before: avoid; page-break-before: avoid; }
}
