/* H4R News Renderer – einheitliches H4R-Design */
.h4r-news-content {
    --h4r-navy: #102A43;
    --h4r-text: #526579;
    --h4r-blue: #075AA8;
    --h4r-yellow: #FFD34E;
    color: var(--h4r-text);
    font-family: "Montserrat", sans-serif;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.65;
    display: flex;
    flex-direction: column;
    gap: 40px;
}
.h4r-news-content * { box-sizing: border-box; }
.h4r-news-content h2,
.h4r-news-content h3,
.h4r-news-content h4 { font-family: "Montserrat", sans-serif; color: var(--h4r-navy); font-weight: 700; }
/* Einheitlicher Abstand ausschließlich ZWISCHEN Inhaltsmodulen.
   Innenabstände werden separat an den jeweiligen Modulen gesteuert. */
.h4r-news-block { margin: 0 !important; }
.h4r-news-block:last-child { margin-bottom: 0 !important; }
.h4r-news-text h2 { font-size: clamp(1.5rem, 2.4vw, 1.9rem); line-height: 1.25; margin: 0 0 12px; }
.h4r-news-text h3 { font-size: clamp(1.2rem, 2vw, 1.45rem); line-height: 1.3; margin: 0 0 10px; }
.h4r-news-richtext { color: var(--h4r-text); font-family: "Montserrat", sans-serif; }
.h4r-news-richtext p { margin: 0 0 1.05em; }
.h4r-news-richtext p:last-child { margin-bottom: 0; }
.h4r-news-richtext ul, .h4r-news-richtext ol { margin: 0 0 1.1em; padding-left: 1.45em; }
.h4r-news-richtext li { margin: 0 0 .35em; }
.h4r-news-richtext a { color: var(--h4r-blue); text-decoration: underline; text-underline-offset: 2px; }

/* Bilder aus dem WordPress-WYSIWYG-Editor
   Im Bilddialog unter "Bild-CSS-Klasse" h4r-news-image eintragen. */
.h4r-news-richtext {
    display: flow-root;
}

.h4r-news-richtext img.h4r-news-image {
    display: block;
    max-width: 100% !important;
    height: auto !important;
    border-radius: 14px;
}

/* WordPress ohne Bildunterschrift: das Bild selbst wird ausgerichtet.
   Der zusätzliche obere Abstand gleicht den Absatz-/Zeilenstart des Textes aus,
   damit Bildoberkante und erste Textzeile optisch bündig beginnen. */
.h4r-news-richtext img.h4r-news-image.alignleft {
    float: left;
    margin: 22px 28px 20px 0 !important;
}
.h4r-news-richtext img.h4r-news-image.alignright {
    float: right;
    margin: 22px 0 20px 28px !important;
}
.h4r-news-richtext img.h4r-news-image.aligncenter {
    display: block;
    float: none;
    margin: 20px auto 24px !important;
}
.h4r-news-richtext img.h4r-news-image.alignnone {
    float: none;
    margin: 12px 0 24px !important;
}

/* WordPress mit Bildunterschrift: je nach Editor-Version ist der Wrapper
   ein DIV oder FIGURE. Deshalb bewusst beide Elementtypen ansprechen. */
.h4r-news-richtext .wp-caption.alignleft,
.h4r-news-richtext figure.wp-caption.alignleft {
    float: left !important;
    margin: 6px 28px 20px 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-sizing: border-box;
    max-width: calc(100% - 28px) !important;
}
.h4r-news-richtext .wp-caption.alignright,
.h4r-news-richtext figure.wp-caption.alignright {
    float: right !important;
    margin: 6px 0 20px 28px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-sizing: border-box;
    max-width: calc(100% - 28px) !important;
}
.h4r-news-richtext .wp-caption.aligncenter,
.h4r-news-richtext figure.wp-caption.aligncenter {
    display: block;
    float: none !important;
    margin: 20px auto 24px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    max-width: 100% !important;
}

/* Bild im Caption-Wrapper füllt dessen definierte WordPress-Bildbreite. */
.h4r-news-richtext .wp-caption img.h4r-news-image {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    border-radius: 14px;
}
.h4r-news-richtext .wp-caption-text {
    display: block;
    margin: 8px 0 0 !important;
    padding: 0 !important;
    color: #718395;
    font-family: "Montserrat", sans-serif;
    font-size: 13px;
    font-style: italic;
    line-height: 1.5;
    text-align: left;
}

/* Floats werden innerhalb des Textbereichs beendet, ohne den Modulabstand zu verändern. */
.h4r-news-richtext::after {
    content: "";
    display: block;
    clear: both;
}
.h4r-news-block { clear: both; }

/* Bildergalerie – Variante A: ruhig, integriert und bildfüllend */
.h4r-news-gallery-description {
    margin: 0 0 14px;
    color: var(--h4r-text);
}
.h4r-news-gallery {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 14px;
    background: transparent;
    line-height: 0;
}
.h4r-news-gallery-track,
.h4r-news-gallery-slide {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
}
.h4r-news-gallery-slide[hidden] { display: none; }
.h4r-news-gallery-slide img.h4r-news-gallery-image {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain;
    object-position: center;
    margin: 0 !important;
    border-radius: 14px;
}
.h4r-news-gallery-prev,
.h4r-news-gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 50%;
    background: rgba(16,42,67,.82);
    color: #fff;
    font-family: "Montserrat", sans-serif;
    font-size: 25px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(16,42,67,.16);
    transition: background .2s ease, transform .2s ease;
}
.h4r-news-gallery-prev { left: 14px; }
.h4r-news-gallery-next { right: 14px; }
.h4r-news-gallery-prev:hover,
.h4r-news-gallery-next:hover {
    background: var(--h4r-blue);
    transform: translateY(-50%) scale(1.04);
}
.h4r-news-gallery-counter {
    position: absolute;
    right: 14px;
    bottom: 14px;
    padding: 7px 11px;
    border-radius: 30px;
    background: rgba(16,42,67,.84);
    color: #fff;
    font: 600 12px/1.3 "Montserrat", sans-serif;
    letter-spacing: .02em;
}
/* Zitat, Infobox und Video */
.h4r-news-quote { border-left: 4px solid var(--h4r-yellow); background: #F1F5F8; border-radius: 0 12px 12px 0; padding: 26px 30px; }
.h4r-news-quote blockquote { margin: 0; color: var(--h4r-navy); font: 700 clamp(1.25rem, 2.3vw, 1.7rem)/1.45 "Montserrat", sans-serif; }
.h4r-news-quote figcaption { display: flex; flex-direction: column; margin-top: 16px; line-height: 1.45; }
.h4r-news-quote figcaption strong { color: var(--h4r-navy); font-size: .92rem; }
.h4r-news-quote figcaption span { color: var(--h4r-text); font-size: .82rem; }
.h4r-news-infobox { border-radius: 12px; padding: 22px 24px; border: 1px solid #D5E4EF; background: #EDF4FA; }
.h4r-news-infobox h3 { margin: 0 0 8px; font-size: 1.15rem; }
.h4r-news-infobox--success { background: #EEF7F1; border-color: #CCE5D4; }
.h4r-news-infobox--warning { background: #FFF8E7; border-color: #F0DFA9; }
.h4r-news-video-frame { position: relative; aspect-ratio: 16/9; overflow: hidden; border-radius: 12px; background: var(--h4r-navy); }
.h4r-news-video-frame iframe, .h4r-news-video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; }

@media (max-width: 767px) {
    .h4r-news-content { font-size: 16px; line-height: 1.65; gap: 30px; }
    .h4r-news-text h2 { margin-bottom: 10px; }
    .h4r-news-text h3 { margin-bottom: 8px; }
    .h4r-news-richtext img.h4r-news-image.alignleft,
    .h4r-news-richtext img.h4r-news-image.alignright,
    .h4r-news-richtext .wp-caption.alignleft,
    .h4r-news-richtext .wp-caption.alignright {
        float: none !important;
        display: block;
        width: auto !important;
        max-width: 100% !important;
        margin: 16px auto 20px !important;
    }
    .h4r-news-gallery-slide img { max-height: 420px; }
    .h4r-news-gallery-prev, .h4r-news-gallery-next { width: 38px; height: 38px; font-size: 24px; }
    .h4r-news-gallery-prev { left: 9px; } .h4r-news-gallery-next { right: 9px; }
    .h4r-news-quote { padding: 20px; }
}
