/*
Theme Name:   Astra Child – Kleintierpraxis Dr. Martina Rufer
Theme URI:    https://www.tierarztpraxis-rufer.de/
Description:  Child Theme für Astra im Stil der bisherigen Praxis-Website (graue Bühne, türkise Seitenbänder, dunkle Inhaltsspalte, weißer Footer), modernisiert. Mit Block-Stilen, Block-Vorlagen, Praxis-Footer (Kontakt, Sprechzeiten, Notdienst) und DSGVO-konformer Karte.
Author:       Kleintierpraxis Dr. Martina Rufer
Template:     astra
Version:      1.11.0
Requires at least: 6.4
Requires PHP: 7.4
License:      GNU General Public License v2 or later
License URI:  https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  astra-child
*/

/* ==========================================================================
   1. Design-Token – abgeleitet von der bisherigen Website
   ========================================================================== */
:root {
	/* Farben der bisherigen Seite */
	--rufer-color-primary:     #0da3b1; /* Türkis: Seitenbänder, Überschriften im Footer   */
	--rufer-color-slate:       #3d4652; /* dunkle Inhaltsspalte                          */
	--rufer-color-slate-2:     #4a5462; /* Karten in der Inhaltsspalte                   */
	--rufer-color-dark:        #2b3240; /* aktiver Menüpunkt, Rahmen, Impressum          */
	--rufer-color-page:        #dcdcdc; /* graue Bühne außen                             */
	--rufer-color-base:        #ffffff;

	/* Navigation: Original-Türkis #0da3b1 mit weißer Schrift erreicht nur 3:1.
	   #09828e ist der hellste Türkiston mit ausreichendem Kontrast (4,6:1).
	   Für exakt den alten Farbton hier #0da3b1 eintragen.                      */
	--rufer-color-nav:         #09828e;
	--rufer-color-nav-active:  var(--rufer-color-dark);

	/* Lesbare Varianten für Text */
	--rufer-color-on-slate:    #e6ebef; /* Fließtext auf Dunkel (8:1)                    */
	--rufer-color-link-slate:  #7fdbe4; /* Links auf Dunkel (6:1)                        */
	--rufer-color-teal-text:   #087883; /* türkiser Fließtext auf Weiß (5,2:1)           */
	--rufer-color-teal-gray:   #066670; /* Telefonnummer auf Grau (4,9:1)                */
	--rufer-color-ink:         #0b2a2e; /* Schrift auf Türkis-Flächen (5:1)              */
	--rufer-color-text:        #3b4b50;
	--rufer-color-border:      #cfe3e6;

	--rufer-color-notice-bg:     #fff3d1;
	--rufer-color-notice-accent: #e0a526;
	--rufer-color-notice-text:   #3d2c00;
	--rufer-color-emergency:     #a3261c;
	--rufer-color-emergency-bg:  #fcebea;

	/* Schriften */
	--rufer-font-heading: 'Fjalla One', Arial, 'Arial Unicode MS', Helvetica, sans-serif;
	--rufer-font-body:    Arial, 'Arial Unicode MS', Helvetica, sans-serif; /* wird automatisch durch die Customizer-Fließtextschrift ersetzt */

	/* Maße */
	--rufer-site-width:    1040px; /* Seitenbreite; none = volle Browserbreite                   */
	--rufer-text-measure:  80ch;   /* max. Zeilenlänge für Fließtext (none = ohne Begrenzung)     */
	--rufer-logo-width:    120px;  /* Husky-Logo                                                 */
	--rufer-logo-overlap:  70px;   /* so weit ragt das Logo über die weiße Kopfleiste            */

	--rufer-fs-sm:    1rem;      /* 16 px */
	--rufer-fs-base:  1.125rem;  /* 18 px */
	--rufer-fs-lg:    1.25rem;   /* 20 px */
	--rufer-fs-h1:    clamp(2.25rem, 1.7rem + 2.4vw, 3.25rem);
	--rufer-fs-h2:    clamp(1.625rem, 1.35rem + 1.2vw, 2.125rem);
	--rufer-fs-h3:    1.375rem;
	--rufer-fs-quote: clamp(1.5rem, 1.2rem + 1.4vw, 2.125rem);

	--rufer-space-xs: 0.5rem;
	--rufer-space-s:  0.75rem;
	--rufer-space-m:  1.25rem;
	--rufer-space-l:  2rem;
	--rufer-space-xl: clamp(2.5rem, 2rem + 2.5vw, 4rem);

	--rufer-radius:   4px;
	--rufer-tap:      48px;
}

/* ==========================================================================
   2. Basis & graue Bühne
   ========================================================================== */

/* Astra verkleinert je nach Customizer-Einstellung die Grundgröße (rem).
   Damit alle Größen des Themes verlässlich sind: 1rem = Browser-Standard (16 px). */
html {
	font-size: 100% !important;
}

body,
body.ast-separate-container,
body.ast-plain-container,
body.ast-page-builder-template {
	background-color: var(--rufer-color-page);
	font-family: var(--rufer-font-body);
	font-size: var(--rufer-fs-base);
	color: var(--rufer-color-text);
}

/* Astra setzt die Schrift auch direkt auf Absätze, Listen und Formulare */
body :where(p, li, td, th, dd, dt, blockquote, input, select, textarea, button, label, .entry-content) {
	font-family: var(--rufer-font-body);
}

#page {
	max-width: var(--rufer-site-width);
	margin-inline: auto;
	background: transparent;
}

h1, h2, h3, h4, h5, h6,
.entry-content :where(h1, h2, h3, h4, h5, h6) {
	font-family: var(--rufer-font-heading);
	font-weight: 400; /* Fjalla One hat nur einen Schnitt */
	letter-spacing: 0.01em;
	hyphens: auto;             /* lange deutsche Wörter sauber trennen */
	overflow-wrap: break-word;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--rufer-color-primary);
	outline-offset: 2px;
}

/* ==========================================================================
   3. Kopfbereich (Astra Header Builder)
   Aufbau: Obere Leiste „Above Header“ = Telefonnummer rechts,
           Hauptleiste = Logo + Titel links, Menü rechts.
   ========================================================================== */
.site-header,
.ast-above-header-wrap,
.ast-above-header-bar,
.ast-above-header.ast-above-header-bar {
	background: transparent !important;
	border: 0 !important;
}

/* Graue Zone über der Kopfleiste: so hoch wie der Logo-Überstand, damit
   die Ohren des Huskys nie abgeschnitten werden – auch ohne obere Leiste.
   Die Telefonnummer (obere Leiste) liegt in dieser Zone rechts oben. */
.site-header {
	position: relative;
	padding-top: var(--rufer-logo-overlap);
}

.ast-above-header-wrap {
	position: absolute;
	inset: 0 0 auto 0;
	z-index: 2;
}

.ast-above-header-bar .ast-builder-grid-row,
.ast-above-header-bar .site-above-header-wrap {
	min-height: 0 !important;
}

.ast-above-header-bar,
.ast-above-header-bar a {
	color: var(--rufer-color-teal-gray) !important;
	font-size: 0.875rem;
	letter-spacing: 0.08em;
	text-decoration: none;
}

/* weiße Kopfleiste, Logo ragt nach oben heraus */
.ast-primary-header-bar,
.main-header-bar {
	background: var(--rufer-color-base) !important;
	border-bottom: 0 !important;
	overflow: visible;
}

.ast-primary-header-bar .site-primary-header-wrap,
.ast-primary-header-bar .ast-builder-grid-row,
.ast-primary-header-bar .site-header-section {
	overflow: visible;
}

.site-branding {
	display: flex;
	align-items: flex-end;
	gap: var(--rufer-space-m);
}

.site-logo-img .custom-logo,
.site-logo-img img {
	display: block;
	width: var(--rufer-logo-width) !important;
	max-width: none !important;
	height: auto;
	margin-top: calc(-1 * var(--rufer-logo-overlap));
	margin-bottom: 0; /* Unterkante bündig mit der Kopfleiste */
}

/* „Kleintierpraxis“ über „Dr. Martina Rufer“, linksbündig untereinander.
   „Kleintierpraxis“ kommt aus dem Theme selbst – unabhängig davon, ob
   Astra den Untertitel einblendet. Ein Astra-Untertitel wird ausgeblendet,
   damit nichts doppelt erscheint. */
.ast-site-title-wrap {
	display: block;
}

.site-branding .site-description {
	display: none !important;
}

.site-branding .site-title,
.site-branding .site-title a {
	margin: 0;
	color: var(--rufer-color-primary) !important;
	font-family: var(--rufer-font-heading) !important;
	font-weight: 400 !important;
	line-height: 1.15;
	text-decoration: none;
	text-transform: none;
}

.site-branding .site-title {
	display: block;
	padding: 0 !important;
}

.site-branding .site-title::before {
	content: "Kleintierpraxis";
	display: block;
	color: var(--rufer-color-primary);
	font-family: var(--rufer-font-heading);
	font-size: 1.125rem;
	line-height: 1.2;
	white-space: nowrap;
}

.site-branding .site-title a {
	display: block;
	padding-inline-start: 0 !important;
	font-size: 1.625rem !important;
}

@media (min-width: 922px) { .site-branding .site-title a { white-space: nowrap; } }

/* Menü als Kacheln – nur Desktop-Kopf, das mobile Menü ist unten eigens gestaltet */
#ast-desktop-header .main-header-menu {
	flex-wrap: nowrap; /* Menü immer in einer Zeile */
	justify-content: flex-end;
	gap: 5px;
}

#ast-desktop-header .main-header-menu > .menu-item { flex: 0 0 auto; }

#ast-desktop-header .main-header-menu > .menu-item > .menu-link {
	display: flex;
	align-items: center;
	min-height: 46px;
	padding: 0 0.8em !important;
	border-radius: var(--rufer-radius);
	background: var(--rufer-color-nav);
	color: #fff !important;
	font-family: var(--rufer-font-body);
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1;
	text-transform: uppercase;
	text-decoration: none;
}

#ast-desktop-header .main-header-menu > .menu-item:hover > .menu-link,
#ast-desktop-header .main-header-menu > .menu-item > .menu-link:focus-visible,
#ast-desktop-header .main-header-menu > .menu-item.current-menu-item > .menu-link,
#ast-desktop-header .main-header-menu > .menu-item.current-menu-ancestor > .menu-link {
	background: var(--rufer-color-nav-active);
	color: #fff !important;
}

/* Mobil */
/* ---------- Mobiles Menü (Ausklappmenü und Off-Canvas von Astra) ---------- */
.ast-mobile-header-wrap .ast-primary-header-bar { padding-block: var(--rufer-space-s); }

/* Menü-Button */
.ast-mobile-header-wrap .menu-toggle,
.ast-mobile-header-wrap .ast-mobile-menu-trigger-minimal,
.ast-mobile-header-wrap .ast-mobile-menu-trigger-fill {
	min-width: var(--rufer-tap);
	min-height: var(--rufer-tap);
	border-radius: var(--rufer-radius) !important;
	background: var(--rufer-color-nav) !important;
	color: #fff !important;
}
.ast-mobile-header-wrap .menu-toggle :is(svg, .ast-mobile-svg) { fill: #fff !important; }

/* Container des aufgeklappten Menüs */
:is(#ast-mobile-header, #ast-mobile-popup) :is(.ast-mobile-header-content, .ast-mobile-popup-content, .main-header-bar-navigation, .main-navigation, .main-header-menu) {
	background: #fff !important;
}

:is(#ast-mobile-header, #ast-mobile-popup) .main-header-menu {
	display: block;
	margin: 0;
	padding: 0;
	border-top: 1px solid var(--rufer-color-border);
}

/* Einträge: dunkle Schrift auf Weiß, eine Zeile, gut tippbar */
:is(#ast-mobile-header, #ast-mobile-popup) .main-header-menu .menu-item > .menu-link {
	display: flex !important;
	align-items: center;
	min-height: var(--rufer-tap) !important;
	height: auto !important;
	margin: 0 !important;
	padding: 0.75rem 1.25rem !important;
	border: 0 !important;
	border-bottom: 1px solid var(--rufer-color-border) !important;
	border-radius: 0 !important;
	background: #fff !important;
	color: var(--rufer-color-dark) !important;
	font-family: var(--rufer-font-body);
	font-size: 0.9375rem !important;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1.3 !important;
	text-transform: uppercase;
	text-decoration: none;
}

:is(#ast-mobile-header, #ast-mobile-popup) .main-header-menu .menu-item:hover > .menu-link,
:is(#ast-mobile-header, #ast-mobile-popup) .main-header-menu .menu-item > .menu-link:focus-visible {
	background: var(--rufer-color-surface) !important;
	color: var(--rufer-color-dark) !important;
}

:is(#ast-mobile-header, #ast-mobile-popup) .main-header-menu :is(.current-menu-item, .current-menu-ancestor) > .menu-link {
	background: var(--rufer-color-nav) !important;
	color: #fff !important;
}

/* Untermenüs eingerückt, Pfeile sichtbar */
:is(#ast-mobile-header, #ast-mobile-popup) .sub-menu .menu-link { padding-inline-start: 2.25rem !important; font-weight: 400; }
:is(#ast-mobile-header, #ast-mobile-popup) .ast-menu-toggle { color: inherit !important; background: transparent !important; }

/* Fjalla One im Kopf des Off-Canvas-Menüs nicht nötig */
#ast-mobile-popup .menu-toggle-close { color: var(--rufer-color-dark) !important; }

/* ==========================================================================
   4. Inhaltsbereich: dunkle Fläche über die volle Seitenbreite
   ========================================================================== */
#content.site-content,
.site-content {
	background: var(--rufer-color-slate);
}

.site-content > .ast-container {
	display: block;
	max-width: none;
	padding: 0;
}

#primary,
.ast-separate-container #primary,
.ast-plain-container #primary {
	float: none;
	width: 100%;
	max-width: none;
	margin: 0 !important;
	padding: clamp(1.5rem, 4vw, 3rem) clamp(1.25rem, 4vw, 3rem) var(--rufer-space-xl) !important;
	background: var(--rufer-color-slate);
	color: var(--rufer-color-on-slate);
	font-size: var(--rufer-fs-base);
	line-height: 1.65;
}

/* Alte Inhalte bringen teils feste Schriftgrößen mit (z. B. style="font-size: 10pt"
   oder <font size>). Diese werden auf die Theme-Größe zurückgesetzt. */
#primary .entry-content [style*="font-size"]:not(h1, h2, h3, h4, h5, h6),
#primary .entry-content font[size] {
	font-size: inherit !important;
}

#primary .entry-content :is(ul, ol):not([class*="rnd-"]) {
	font-size: var(--rufer-fs-base);
	line-height: 1.6;
	padding-inline-start: 1.4em;
}

#primary .entry-content li {
	font-size: inherit;
	margin-block: 0.4em;
}

#primary .entry-content li::marker { color: var(--rufer-color-primary); }

/* Fließtext bleibt lesbar, Bilder, Spalten und Karten nutzen die volle Breite */
#primary .entry-content > :where(p, ul, ol, .wp-block-list) {
	max-width: var(--rufer-text-measure);
}

#secondary { display: none; } /* das Design hat keine Seitenleisten */

.ast-separate-container .ast-article-single,
.ast-separate-container .ast-article-post,
.ast-separate-container .comments-area,
.ast-plain-container .ast-article-single {
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
}

#primary :where(h1, h2, h3, h4, h5, h6),
#primary .entry-title {
	color: #fff;
}

#primary .entry-title { font-size: var(--rufer-fs-h1); margin-block-end: var(--rufer-space-l); }

/* Startseite: Seitentitel („Home“) ausblenden – die Begrüßung ist die Überschrift */
.home .entry-header,
.home .ast-single-entry-banner,
.home #primary .entry-title { display: none; }

#primary .entry-content a:where(:not(.wp-block-button__link)) {
	color: var(--rufer-color-link-slate);
	text-underline-offset: 0.15em;
}

/* Bilder mit weißem Rahmen wie bisher */
#primary .wp-block-image img,
#primary .wp-block-gallery img {
	border: 4px solid #fff;
	border-radius: var(--rufer-radius);
	background: #fff;
}

#primary .wp-block-gallery { gap: var(--rufer-space-l); }

.rufer-section { margin-block: var(--rufer-space-xl); }

.rufer-section-title {
	margin-block-end: var(--rufer-space-m);
	font-size: var(--rufer-fs-h2);
}

/* ==========================================================================
   5. Hinweis-Banner „Aktuell“ (core/group → rufer-notice)
   ========================================================================== */
.is-style-rufer-notice {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--rufer-space-xs) var(--rufer-space-m);
	margin-block: 0 var(--rufer-space-l);
	padding: var(--rufer-space-s) var(--rufer-space-m);
	background: var(--rufer-color-notice-bg);
	border-radius: var(--rufer-radius);
	color: var(--rufer-color-notice-text);
	font-size: var(--rufer-fs-lg);
	line-height: 1.45;
}

.is-style-rufer-notice > * { margin: 0 !important; }

.is-style-rufer-notice .rufer-notice__title {
	padding: 0.2em 0.75em;
	border-radius: var(--rufer-radius);
	background: var(--rufer-color-notice-accent);
	font-family: var(--rufer-font-body);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

#primary .is-style-rufer-notice a { color: inherit; }

/* ==========================================================================
   6. Startseite: Begrüßung
   ========================================================================== */
.rufer-hero.wp-block-columns {
	display: flex;
	flex-direction: column;   /* Text über die volle Breite, Bild darunter */
	flex-wrap: nowrap !important;
	align-items: stretch !important;
	gap: var(--rufer-space-l);
	margin-block: 0 var(--rufer-space-xl);
}

.rufer-hero > .wp-block-column {
	flex-basis: auto !important;
	width: 100%;
	align-self: stretch !important;
}

/* Reihenfolge im Textbereich: Kicker, Überschrift, Anruf-Button, Begrüßungstext */
.rufer-hero > .wp-block-column:first-child {
	display: flex;
	flex-direction: column;
}
.rufer-hero > .wp-block-column:first-child > * { order: 3; }
.rufer-hero > .wp-block-column:first-child > .rufer-hero__kicker { order: 0; }
.rufer-hero > .wp-block-column:first-child > :is(h1, .wp-block-heading) { order: 1; }
.rufer-hero > .wp-block-column:first-child > .rufer-hero__actions { order: 2; }

.rufer-hero__kicker {
	margin-block-end: var(--rufer-space-xs) !important;
	color: var(--rufer-color-link-slate);
	font-family: var(--rufer-font-heading);
	font-size: var(--rufer-fs-lg);
}

.rufer-hero h1 {
	margin-block: 0 var(--rufer-space-m);
	font-size: var(--rufer-fs-h1);
	line-height: 1.1;
	text-wrap: balance;
}

.rufer-hero p { font-size: var(--rufer-fs-lg); line-height: 1.6; }

.rufer-hero__actions {
	margin-block: 0 var(--rufer-space-l) !important;
	gap: var(--rufer-space-s);
}

.rufer-hero__image { margin: 0; }

.rufer-hero__image img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

/* ==========================================================================
   7. Buttons
   ========================================================================== */
.wp-block-button .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: var(--rufer-tap);
	padding: 0.7em 1.4em;
	border-radius: var(--rufer-radius);
	font-family: var(--rufer-font-body);
	font-size: 0.875rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	line-height: 1.2;
	text-transform: uppercase;
	text-decoration: none;
}

.is-style-rufer-call .wp-block-button__link {
	background: var(--rufer-color-primary);
	color: var(--rufer-color-ink);
}

.is-style-rufer-call .wp-block-button__link:hover,
.is-style-rufer-call .wp-block-button__link:focus-visible {
	background: #fff;
	color: var(--rufer-color-dark);
}

#primary .wp-block-button.is-style-outline > .wp-block-button__link {
	border: 2px solid #fff !important;
	background: transparent !important;
	color: #fff !important;
}

#primary .wp-block-button.is-style-outline > .wp-block-button__link:hover,
#primary .wp-block-button.is-style-outline > .wp-block-button__link:focus-visible {
	background: #fff !important;
	color: var(--rufer-color-dark) !important;
}

/* ==========================================================================
   8. Praxisbild + Zitat
   ========================================================================== */
.rufer-philosophy.wp-block-columns {
	gap: var(--rufer-space-l);
	align-items: center;
}

/* Zitat über die volle Breite, zentriert. Eine Spalte, die nur noch ein
   Bild enthält (früheres Teamfoto), wird ausgeblendet. */
.rufer-philosophy > .wp-block-column { flex-basis: 100% !important; }
.rufer-philosophy > .wp-block-column:has(> .wp-block-image:only-child) { display: none; }
.rufer-philosophy .wp-block-quote.is-style-rufer-quote {
	max-width: 46rem;
	margin-inline: auto;
	text-align: center;
}

.wp-block-quote.is-style-rufer-quote {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
}

.wp-block-quote.is-style-rufer-quote::before {
	content: "„";
	display: block;
	height: 0.45em;
	margin-block-end: var(--rufer-space-s);
	color: var(--rufer-color-primary);
	font-family: Georgia, serif;
	font-size: 6rem;
	line-height: 0;
}

.wp-block-quote.is-style-rufer-quote p {
	color: #fff;
	font-family: var(--rufer-font-heading);
	font-size: var(--rufer-fs-quote);
	font-style: normal;
	line-height: 1.3;
	text-wrap: balance;
}

.wp-block-quote.is-style-rufer-quote cite {
	display: block;
	margin-block-start: var(--rufer-space-s);
	color: var(--rufer-color-link-slate);
	font-size: var(--rufer-fs-sm);
	font-style: normal;
	font-weight: 700;
	letter-spacing: 0.08em;
}

/* ==========================================================================
   9. Karten (core/group → rufer-card)
   ========================================================================== */
.rufer-grid.wp-block-columns { gap: var(--rufer-space-m); align-items: stretch; }
.rufer-grid > .wp-block-column { display: flex; }

.is-style-rufer-card {
	flex: 1;
	padding: var(--rufer-space-m) var(--rufer-space-m) var(--rufer-space-l);
	background: var(--rufer-color-slate-2);
	border-top: 4px solid var(--rufer-color-primary);
	border-radius: var(--rufer-radius);
	font-size: var(--rufer-fs-base);
}

.is-style-rufer-card h3 {
	margin-block: 0 var(--rufer-space-s);
	font-size: var(--rufer-fs-h3);
}

.is-style-rufer-card > :last-child { margin-block-end: 0; }

.rufer-lead {
	color: #fff;
	font-family: var(--rufer-font-heading);
	font-size: var(--rufer-fs-quote);
	line-height: 1.3;
}

/* Kontaktseite: Seitentitel, erster Satz und Kontakt-Boxen zentriert */
#primary:has(.rufer-lead) .entry-title,
#primary .entry-content > .rufer-lead {
	max-width: none;
	text-align: center;
}
#primary .rufer-lead ~ .rufer-grid .is-style-rufer-card { text-align: center; }

.rufer-contact-big {
	font-size: var(--rufer-fs-lg);
	font-weight: 700;
	overflow-wrap: anywhere;
}

.rufer-cta {
	margin: var(--rufer-space-l) auto 0;
	text-align: center;
	font-size: var(--rufer-fs-lg);
}

.rufer-cta .wp-block-buttons { justify-content: center; }

/* ==========================================================================
   10. Praxis-Footer: weiß, Rahmen, türkise Schrift – wie bisher
   ========================================================================== */
.site-footer,
.site-primary-footer-wrap,
.site-below-footer-wrap,
.site-above-footer-wrap {
	background: transparent !important;
	border: 0 !important;
}

.rufer-footer {
	padding: var(--rufer-space-xl) clamp(1.25rem, 3vw, 2rem);
	background: var(--rufer-color-base);
	border: 1px solid var(--rufer-color-dark);
	border-top: 0;
	color: var(--rufer-color-teal-text);
	font-size: 1.0625rem;
	letter-spacing: 0.03em;
	line-height: 1.7;
	scroll-margin-top: 6rem;
}

.rufer-footer > .ast-container { max-width: none; padding: 0; }

.rufer-footer .wp-block-columns { gap: clamp(1.5rem, 4vw, 3rem); }

.rufer-footer h2,
.rufer-footer h3 {
	margin-block: 0 var(--rufer-space-m);
	color: var(--rufer-color-primary);
	font-size: 1.375rem;
	letter-spacing: 0.01em;
}

.rufer-footer h3 { margin-block-start: var(--rufer-space-l); font-size: 1.1875rem; }

.rufer-footer p { margin-block-end: var(--rufer-space-m); }

.rufer-footer a { color: var(--rufer-color-teal-text); }
.rufer-footer a[href^="tel:"],
.rufer-footer a[href^="mailto:"] { white-space: nowrap; }

.rufer-footer__legal,
.rufer-footer__legal a { color: var(--rufer-color-dark) !important; }

/* Notdienst-Box: weiße Karte mit dunkler Schrift – im Footer und im dunklen Inhaltsbereich */
.rnd-current,
#primary .rnd-current {
	border: 1px solid var(--rufer-color-border);
	color: var(--rufer-color-text);
	letter-spacing: 0;
}
.rnd-current h3,
#primary .rnd-current h3 { margin-block-start: 0; font-size: 1.125rem; color: var(--rufer-color-dark); }
.rnd-current.is-active h3,
#primary .rnd-current.is-active h3 { color: var(--rufer-color-emergency); }
#primary .entry-content .rnd-current a:not(.rnd-call) { color: var(--rufer-color-teal-text); }

.rnd-current .rnd-call {
	border-radius: var(--rufer-radius);
	font-size: 0.8125rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

/* Spalten im Footer dürfen schmaler werden als ihr Inhalt (verhindert Überlauf) */
.rufer-footer .wp-block-column { min-width: 0; }

/* Copyright-Zeile von Astra unter dem Footer */
.site-below-footer-wrap,
.site-below-footer-wrap a {
	color: var(--rufer-color-dark) !important;
	font-size: 0.8125rem;
}

/* ==========================================================================
   11. Sprechzeiten (core/table → rufer-hours)
   ========================================================================== */
.wp-block-table.is-style-rufer-hours {
	container-type: inline-size;
	margin: 0 0 var(--rufer-space-m);
}

.wp-block-table.is-style-rufer-hours table {
	width: 100%;
	border: 0 !important;
	border-collapse: collapse;
	background: transparent !important;
	font-variant-numeric: tabular-nums;
}

/* Astra/WordPress färben Tabellenzeilen ein – hier neutralisieren,
   Farbe kommt immer vom umgebenden Bereich (dunkel oder Footer) */
.wp-block-table.is-style-rufer-hours :is(thead, tbody, tfoot, tr, td, th) {
	background: transparent !important;
	border: 0 !important;
	color: inherit !important;
}

.wp-block-table.is-style-rufer-hours td {
	padding: var(--rufer-space-xs) 0;
	border: 0;
	text-align: start;
	vertical-align: top;
}

.wp-block-table.is-style-rufer-hours td:first-child {
	padding-inline-end: var(--rufer-space-m);
	font-weight: 700;
	white-space: nowrap;
}

#primary .wp-block-table.is-style-rufer-hours td:first-child { color: #fff !important; }
#primary .wp-block-table.is-style-rufer-hours tr + tr td { border-top: 1px solid rgba(255, 255, 255, 0.15) !important; }

@container (max-width: 420px) {
	.wp-block-table.is-style-rufer-hours tr { display: block; padding-block: var(--rufer-space-xs); }
	.wp-block-table.is-style-rufer-hours td { display: block; padding: 0; }
	.wp-block-table.is-style-rufer-hours td:first-child { white-space: normal; }
}

/* ==========================================================================
   12. Karte mit Einwilligung ([rufer_map])
   ========================================================================== */
.rufer-map { margin-block-end: var(--rufer-space-m); }

.rufer-embed {
	position: relative;
	aspect-ratio: 16 / 9;
	max-width: 100%;
	background: #f2f6f7;
	border: 1px solid var(--rufer-color-border);
	overflow: hidden;
	letter-spacing: 0;
}

.rufer-footer .rufer-embed { aspect-ratio: 1 / 1; max-width: 260px; }

.rufer-embed iframe { display: block; width: 100%; height: 100%; border: 0; }

.rufer-embed__placeholder {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: var(--rufer-space-s);
	height: 100%;
	padding: var(--rufer-space-s);
	color: var(--rufer-color-text);
	font-size: 0.8125rem;
	line-height: 1.45;
}

.rufer-embed__placeholder p { margin: 0 !important; }

.rufer-embed__button {
	align-self: flex-start;
	min-height: 40px;
	padding: 0.5em 1em;
	border: 0;
	border-radius: var(--rufer-radius);
	background: var(--rufer-color-nav);
	color: #fff;
	font: inherit;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	cursor: pointer;
}

.rufer-embed__button:hover { background: var(--rufer-color-dark); }

.rufer-map__route { display: inline-block; margin-block-start: var(--rufer-space-xs); font-weight: 700; }

/* ==========================================================================
   13. Social Media ([rufer_social])
   ========================================================================== */
.rufer-social ul {
	display: flex;
	flex-wrap: wrap;
	gap: var(--rufer-space-xs);
	margin: var(--rufer-space-m) 0 0;
	padding: 0;
	list-style: none;
}

.rufer-social a {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 0.35em 1em;
	border-radius: var(--rufer-radius);
	background: var(--rufer-color-nav);
	color: #fff !important;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-decoration: none;
}

.rufer-social a:hover { background: var(--rufer-color-dark); }

.rufer-admin-hint {
	padding: var(--rufer-space-xs) var(--rufer-space-s);
	border: 1px dashed var(--rufer-color-notice-accent);
	font-size: var(--rufer-fs-sm);
}

/* ==========================================================================
   13b. Blog „Aktuell“ (Übersicht, Kategorie, Suche) und einzelne Beiträge
   ========================================================================== */
body:is(.blog, .archive, .search) #primary :is(article.ast-article-post, .ast-article-inner, .post-content) {
	background: var(--rufer-color-slate-2) !important;
	color: var(--rufer-color-on-slate) !important;
	box-shadow: none !important;
}

body:is(.blog, .archive, .search) #primary article.ast-article-post {
	border-top: 4px solid var(--rufer-color-primary);
	border-radius: var(--rufer-radius);
	overflow: hidden;
}

body:is(.blog, .archive, .search) #primary .ast-article-inner {
	padding: var(--rufer-space-m) var(--rufer-space-m) var(--rufer-space-l) !important;
}

body:is(.blog, .archive, .search) #primary .ast-article-inner .post-content {
	padding: 0 !important;
}

body:is(.blog, .archive, .search) #primary .entry-title {
	margin: 0 0 var(--rufer-space-s);
	font-size: 1.5rem !important;
	line-height: 1.2 !important;
}

body:is(.blog, .archive, .search) #primary .entry-title a {
	color: #fff !important;
	text-decoration: none;
}

body:is(.blog, .archive, .search) #primary .entry-title a:hover,
body:is(.blog, .archive, .search) #primary .entry-title a:focus-visible {
	color: var(--rufer-color-link-slate) !important;
}

#primary :is(.entry-meta, .entry-meta *, .cat-links, .cat-links a, .ast-taxonomy-container a, .posted-on, .byline, .author-name) {
	color: var(--rufer-color-link-slate) !important;
	font-size: var(--rufer-fs-sm);
}

body:is(.blog, .archive, .search) #primary :is(.ast-excerpt-container, .entry-content, .ast-excerpt-container p) {
	color: var(--rufer-color-on-slate) !important;
	font-size: var(--rufer-fs-base);
	overflow-wrap: anywhere; /* lange Links im Anrisstext */
}

#primary :is(.read-more a, .ast-read-more-container a) {
	color: var(--rufer-color-link-slate) !important;
	font-weight: 700;
}

/* Archiv-Überschrift (z. B. „Kategorie: Allgemein“) */
#primary .ast-archive-description,
.ast-archive-description {
	background: transparent !important;
	color: var(--rufer-color-on-slate);
	padding: 0 0 var(--rufer-space-l) !important;
}
.ast-archive-description .ast-archive-title { color: #fff; font-size: var(--rufer-fs-h2); }

/* Seitennummerierung */
#primary .ast-pagination :is(a, span) { color: var(--rufer-color-link-slate); }
#primary .ast-pagination .current { color: #fff; }

/* Einzelner Beitrag: Titel nicht ganz so groß wie auf Seiten */
.single #primary .entry-title { font-size: var(--rufer-fs-h2); line-height: 1.2; }
.single #primary .entry-content { overflow-wrap: anywhere; }
.single #primary :is(.post-navigation, .ast-single-related-posts-container) a { color: var(--rufer-color-link-slate); }

/* ==========================================================================
   14. Responsiv
   ========================================================================== */
@media (min-width: 922px) and (max-width: 1100px) {
	#ast-desktop-header .main-header-menu > .menu-item > .menu-link { padding: 0 0.6em !important; letter-spacing: 0.04em; }
	.site-branding .site-title a { font-size: 1.375rem !important; }
}

@media (max-width: 921px) {
	:root { --rufer-logo-width: 76px; --rufer-logo-overlap: 34px; }
	.site-branding .site-title a { font-size: 1.25rem !important; }
	.site-branding .site-title::before { font-size: 0.9375rem; }
}

@media (max-width: 781px) {
	.rufer-hero__actions .wp-block-button { flex: 1 1 100%; }
	.rufer-hero__actions .wp-block-button__link { width: 100%; }
	.is-style-rufer-notice { font-size: var(--rufer-fs-base); }
	.rufer-footer { border-inline: 0; }
}

@media (prefers-reduced-motion: no-preference) {
	.wp-block-button__link,
	.site-header .menu-link,
	.rufer-embed__button,
	.rufer-social a { transition: background-color 0.15s ease, color 0.15s ease; }
}

@media print {
	body { background: #fff; }
	.site-content, #primary { background: #fff; color: #000; }
	.rufer-embed, .rufer-social, .rufer-hero__actions { display: none; }
}
