/* Busatis – Ergänzungen für WordPress-Blöcke (entspricht css_styled_content der alten Seite) */

/* Absätze wie TYPO3 "bodytext" */
#maincontent p, .htmlarea-content-body p, #overview_headertext p, .overview p { margin: 0; }

/* Bilder */
.wp-block-image { margin: 0 0 10px 0; }
.wp-block-image img { display: block; height: auto; max-width: 100%; }
.wp-block-image.alignright, .wp-block-image .alignright { float: right; margin: 0 0 10px 10px; }
.wp-block-image.alignleft, .wp-block-image .alignleft { float: left; margin: 0 10px 10px 0; }
.wp-block-image.aligncenter, .wp-block-image .aligncenter { text-align: center; margin-left: auto; margin-right: auto; display: table; }
.wp-block-image figcaption, .wp-element-caption { font-size: 13px; color: #5b6575; text-align: left; margin: 3px 0 0 0; }
.busatis-ce { clear: both; }
.busatis-ce::after { content: ""; display: table; clear: both; }

/* Galerien (mehrspaltige Bildblöcke) */
.wp-block-gallery { margin: 0 0 10px 0; gap: 10px; }
.wp-block-gallery.has-nested-images figure.wp-block-image { margin: 0; }
.wp-block-gallery.has-nested-images figure.wp-block-image img { height: auto; }
.wp-block-gallery.alignright { float: right; margin-left: 10px; max-width: 50%; }
.wp-block-gallery.alignleft { float: left; margin-right: 10px; max-width: 50%; }
#maincontent .wp-block-gallery li, #maincontent .wp-block-gallery figure { background: none; padding-left: 0; }

/* Listen in Bildgalerien nicht mit Bullet */
#maincontent figure li { background-image: none; padding-left: 0; }

/* Downloads (Dateiblöcke, ersetzt csc-uploads) */
.wp-block-file { background: #EDEBF1; padding: .8em 1em .8em 34px; margin: 0 0 2px 0; position: relative; border-radius: 3px; }
.wp-block-file::before { content: ""; position: absolute; left: 10px; top: 1.05em; width: 16px; height: 16px;
  background: url(../images/icon_pdf.png) no-repeat center / contain; }
.wp-block-file a { color: #3366cc; }
.wp-block-file .wp-block-file__button { display: none; }

/* Teaser auf Übersichtsseiten (Karten im Raster #teasertable, siehe styles.css) */
.busatis-teaser .img { display: block; overflow: hidden; }
.busatis-teaser img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 1; object-fit: cover; transition: transform .3s; }
.busatis-teaser:hover img { transform: scale(1.04); }
.busatis-teaser h2 { font-weight: 600; color: #3366cc; font-size: 17px; line-height: 1.3; margin: 12px 0 6px; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
.busatis-teaser h2 a { color: #3366cc; }
.busatis-teaser .teasertext { font-size: 15px; color: #5b6575; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
.busatis-teaser .teasertext p { margin: 0; }
.busatis-teaser .more { font-weight: 600; white-space: nowrap; }
.overview-main { min-width: 0; }

/* Zeitleiste-Sortlinks */
.sortlink img { vertical-align: middle; }
.sortlink_selected img { border-color: #3366cc; }

/* Formular */
.busatis-form .formular { width: 100%; max-width: 560px; border-collapse: collapse; }
.busatis-form .formular td { padding: 0 15px 0 0; width: 50%; vertical-align: top; }
.busatis-form .formular td[colspan] { width: 100%; }
.busatis-form input, .busatis-form textarea { width: 100%; font: inherit; border: 1px solid #c9d1dd; border-radius: 4px; padding: 6px 9px; background: #fff; }
.busatis-form input:focus, .busatis-form textarea:focus { border-color: #3366cc; outline: 2px solid #3366cc; outline-offset: 1px; }
.busatis-form textarea { min-height: 120px; }
.busatis-form button { margin-top: 14px; border: 0; border-radius: 4px; background: #3366cc; color: #fff; padding: 9px 22px; font: inherit; font-weight: 600; cursor: pointer; }
.busatis-form button:hover { background: #2a55aa; }
@media (max-width: 760px) {
  .busatis-form .formular, .busatis-form .formular tbody, .busatis-form .formular tr, .busatis-form .formular td { display: block; width: 100%; padding-right: 0; }
}
.busatis-form-errors { color: #b00; margin-bottom: 10px; }
.busatis-form-ok { color: #063; font-weight: bold; }

/* Tabellen aus dem alten RTE */
#maincontent table.contenttable td, #maincontent table.contenttable th { padding: 6px 8px; vertical-align: top; }
@media (max-width: 760px) { #maincontent table.contenttable, .overview table.contenttable { display: block; overflow-x: auto; } }

/* Druck */
@media print { .hideonprint { display: none; } }

/* Links wie parseFunc der alten Seite */
/* » vor Textlinks (formatLink), nicht vor Bildlinks und "mehr"-Links */
.wp-block-paragraph a:not(:has(img)):not(.more)::before,
.wp-block-list a:not(:has(img)):not(.more)::before { content: "\00bb\00a0"; }
img.dl_icon { vertical-align: middle; }
/* Überschriften von Bild-/Header-Elementen (css_styled_content) */
h1.csc-header { font-weight: 600; font-size: 28px; }

/* Audit: "Nach oben"-Link (csc-linkToTop) und Dateilisten wie csc-uploads */
p.csc-linkToTop { text-align: right; margin-top: 10px; }
.wp-block-file .busatis-file-size { margin-left: 8px; color: #666; }

/* Wie live (styles.css: csc-textpic-center ohne Zentrierung): "zentrierte" Bilder/Galerien stehen links */
#maincontent .wp-block-image.aligncenter, #maincontent .wp-block-image .aligncenter,
.overview-main .wp-block-image.aligncenter, .overview-main .wp-block-image .aligncenter,
.overview .wp-block-image .aligncenter { margin-left: 0; margin-right: 0; text-align: left; }
#maincontent .wp-block-gallery, .overview-main .wp-block-gallery { justify-content: flex-start; }

/* Galerie wie csc-textpic-imagerow: feste Bildbreite (aus TYPO3), Spalten nebeneinander, linksbündig */
.wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) { width: auto !important; flex: 0 0 auto; }
#maincontent .wp-block-gallery, .overview-main .wp-block-gallery { align-items: flex-start; }
.wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image img { height: auto; object-fit: initial; }

/* Zwei-Klick-Video */
.busatis-video-consent { position: relative; width: 100%; background: #000; overflow: hidden; }
.busatis-video-consent > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.busatis-video-consent > iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.busatis-video-consent__box { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px; background: rgba(0,0,0,.7); color: #fff; text-align: center; }
.busatis-video-consent__box p { margin: 8px 0 0; font-size: 13px; line-height: 1.4; color: #fff; }
.busatis-video-consent__box a { color: #9cc3ff; text-decoration: underline; }
.busatis-video-consent__btn { cursor: pointer; padding: 7px 18px; border: 0; border-radius: 3px; background: #237afc; color: #fff; font-size: 13px; font-weight: bold; }
.busatis-video-consent__btn:hover, .busatis-video-consent__btn:focus-visible { background: #015aaa; outline: 2px solid #fff; outline-offset: 2px; }
.wp-block-embed.wp-has-aspect-ratio .busatis-video-consent { position: relative; }

/* 1.3.1: mobil keine schmalen Textspalten neben Float-Bildern, breite Alt-Tabellen scrollbar */
@media (max-width: 760px) {
  .wp-block-image.alignright, .wp-block-image .alignright,
  .wp-block-image.alignleft, .wp-block-image .alignleft,
  .wp-block-gallery.alignright, .wp-block-gallery.alignleft { float: none; display: table; margin: 0 auto 16px; max-width: 100%; }
  .wp-block-image img { max-width: 100%; height: auto; }
  #maincontent table:not([class]) td, .overview table:not([class]) td { width: auto; padding-left: 4px; padding-right: 4px; font-size: 14px; }
  #maincontent table:not([class]) td h3, .overview table:not([class]) td h3, #maincontent table:not([class]) td h2 { font-size: 15px; }
  #maincontent table:not([class]), .overview table:not([class]) { display: block; width: auto !important; max-width: 100%; overflow-x: auto; }
}
.busatis-form-errors { border: 2px solid #b00; border-radius: 4px; padding: 10px 14px; }
.busatis-form-errors:focus { outline: 2px solid #b00; outline-offset: 2px; }
.busatis-form-errors ul { margin: 6px 0 0; padding-left: 20px; }
.busatis-form-errors a { color: #b00; text-decoration: underline; }
.busatis-form .field-error { display: block; color: #b00; font-size: 14px; margin-top: 2px; }
.busatis-form [aria-invalid="true"] { border-color: #b00; }
.busatis-form-hint { font-size: 14px; color: #5b6575; margin: 0 0 8px; }

/* Tabellen-Überschriften (h2 statt h3, A11y-Überschriftenfolge) wie h3 darstellen */
#maincontent td h2 { margin: 0; font-size: 16px; line-height: 1.35; }
