/*
Theme Name:        Rhein-Main-Dienstleistungen
Theme URI:         https://www.rm-dl.eu/
Author:            mp group GmbH
Author URI:        https://www.mp-group.net/
Description:       Block-Theme für Rhein-Main Dienstleistungen e.K. - 1:1-Überführung der bisherigen WPBakery-Seite. Alle Inhalte sind im Block-Editor pflegbar, Kopf- und Fußbereich im Website-Editor. Updates kommen über GitLab.
Version:           1.0.2
Requires at least: 7.0
Tested up to:      7.1
Requires PHP:      8.1
License:           Proprietär
Text Domain:       rm-dl
*/

/* ==========================================================================
   Globale Ergänzungen zu theme.json
   ========================================================================== */

html {
	scroll-behavior: smooth;
}

body {
	-webkit-font-smoothing: antialiased;
}

a {
	transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}

/* ---------- Header ------------------------------------------------------ */

.rmdl-header {
	position: sticky;
	top: 0;
	z-index: 100;
}

.admin-bar .rmdl-header {
	top: var(--wp-admin--admin-bar--height, 32px);
}

@media (max-width: 600px) {
	.admin-bar .rmdl-header {
		top: 0;
	}
}

.rmdl-header .wp-block-site-logo img {
	height: auto;
}

.rmdl-header__contact {
	font-family: var(--wp--preset--font-family--open-sans);
	font-size: 13px;
	line-height: 1.8;
}

.rmdl-header__contact strong {
	font-weight: 700;
}

.rmdl-header__contact a {
	color: var(--wp--preset--color--secondary);
	text-decoration: none;
}

.rmdl-header__contact a:hover {
	text-decoration: underline;
}

.rmdl-header__contact .rmdl-sep {
	display: inline-block;
	width: 1px;
	height: 14px;
	margin: 0 18px -2px;
	background: #dcdcdc;
}

.rmdl-header__nav {
	border-top: 1px solid #eeeeee;
	border-bottom: 1px solid #eeeeee;
}

.rmdl-header__nav .wp-block-navigation-item__content {
	position: relative;
	display: inline-block;
	line-height: 38px;
}

.rmdl-header__nav .wp-block-navigation-item__content::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2px;
	background: var(--wp--preset--color--primary);
	transform: scaleX(0);
	transition: transform .2s ease;
}

.rmdl-header__nav .wp-block-navigation-item__content:hover,
.rmdl-header__nav .current-menu-item > .wp-block-navigation-item__content {
	color: var(--wp--preset--color--primary);
}

.rmdl-header__nav .wp-block-navigation-item__content:hover {
	text-decoration: none;
}

.rmdl-header__nav .current-menu-item > .wp-block-navigation-item__content::after {
	transform: scaleX(1);
}

/* Zusatz-Einträge nur im mobilen Menü (Telefon, E-Mail, Suche) */
.rmdl-header__nav .rmdl-nav-contact,
.rmdl-header__nav .rmdl-nav-search,
.rmdl-logo-mono {
	display: none !important;
}

/* ==========================================================================
   Mobil + Tablet (unter 1100 px, wie im Original)
   ========================================================================== */

@media (max-width: 1099px) {

	/* Kopfbereich: 80 px, nur Monogramm, rundes Menü-Symbol rechts */
	.rmdl-header {
		position: relative;
		top: auto !important;
		box-shadow: 0 1px 3px rgba(0, 0, 0, .11);
	}

	.rmdl-header {
		padding-left: 0 !important;
		padding-right: 0 !important;
	}

	.rmdl-header > .wp-block-group:first-child {
		margin: 0 !important;
		padding-left: 35px !important;
		padding-right: 25px !important;
	}

	.rmdl-header__top {
		width: 100%;
		max-width: none !important;
		height: 80px;
		margin: 0 !important;
	}

	.rmdl-header__contact {
		display: none;
	}

	.rmdl-header .wp-block-site-logo img.custom-logo {
		display: none;
	}

	.rmdl-header .wp-block-site-logo img.rmdl-logo-mono {
		display: block !important;
		width: 65px;
		height: 66px;
		max-width: none;
	}

	.rmdl-header__nav {
		position: absolute;
		top: 20px;
		right: 25px;
		padding: 0 !important;
		border: 0;
		background: transparent;
	}

	/* WordPress schaltet erst bei 600 px um - hier auf 1100 px angehoben */
	.rmdl-header__nav .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}

	.rmdl-header__nav .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none;
	}

	.rmdl-header__nav .wp-block-navigation__responsive-container-open {
		width: 40px;
		height: 40px;
		align-items: center;
		justify-content: center;
		border-radius: 50%;
		box-shadow: inset 0 0 0 2px #e5e5e5;
		color: #666666;
	}

	/* Menü-Symbol mit drei Strichen (WordPress liefert nur zwei) */
	.rmdl-header__nav .wp-block-navigation__responsive-container-open svg {
		display: none;
	}

	.rmdl-header__nav .wp-block-navigation__responsive-container-open::before {
		content: "";
		width: 16px;
		height: 2px;
		border-radius: 1px;
		background: currentColor;
		box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
	}

	/* Menü-Panel von rechts, 320 px, Hintergrund abgedunkelt */
	.rmdl-header__nav .wp-block-navigation__responsive-container.is-menu-open {
		left: auto;
		right: 0;
		box-sizing: border-box;
		width: 320px;
		max-width: 85vw;
		padding: 50px 20px 30px !important;
		background: #ffffff !important;
		box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .5);
		animation: rmdl-slide-in .35s ease-out both;
		overflow-y: auto;
	}

	.admin-bar .rmdl-header__nav .wp-block-navigation__responsive-container.is-menu-open {
		top: var(--wp-admin--admin-bar--height, 0px);
	}

	/* Abgedunkelter Hintergrund: Schatten des Panels über die ganze Seite,
	   blendet beim Ausfahren mit ein. Der Kopfbereich liegt dabei mit unter
	   der Abdunklung, weil das Panel in seinem Stapelkontext ganz oben liegt. */
	.rmdl-header {
		z-index: 1000;
	}

	.rmdl-header__nav .is-menu-open .wp-block-navigation__responsive-close,
	.rmdl-header__nav .is-menu-open .wp-block-navigation__responsive-dialog {
		position: static;
		max-width: none;
		margin: 0;
	}

	.rmdl-header__nav .is-menu-open .wp-block-navigation__responsive-container-content {
		padding-top: 0 !important;
	}

	.rmdl-header__nav .is-menu-open .wp-block-navigation__responsive-container-close {
		top: 0;
		right: 0;
		width: 40px;
		height: 40px;
		display: flex;
		align-items: center;
		justify-content: center;
		background: #fafafa;
		color: #666666;
	}

	.rmdl-header__nav .is-menu-open .wp-block-navigation__container {
		width: 100%;
		gap: 0 !important;
		align-items: stretch !important;
	}

	.rmdl-header__nav .is-menu-open .wp-block-navigation-item {
		width: 100%;
		align-items: stretch !important;
	}

	.rmdl-header__nav .is-menu-open .wp-block-navigation-item__content {
		display: block;
		width: 100%;
		padding: 15px 25px 15px 0 !important;
		font-size: 14px;
		line-height: 24px;
		color: #333333;
		border-bottom: 1px solid #f0f0f0;
	}

	.rmdl-header__nav .is-menu-open .wp-block-navigation-item__content::after {
		display: none;
	}

	.rmdl-header__nav .is-menu-open .current-menu-item > .wp-block-navigation-item__content {
		color: var(--wp--preset--color--primary);
	}

	/* Telefon und E-Mail mit Symbol */
	.rmdl-header__nav .is-menu-open .rmdl-nav-contact {
		display: block !important;
	}

	.rmdl-header__nav .is-menu-open .rmdl-nav-phone {
		margin-top: 15px;
	}

	.rmdl-header__nav .is-menu-open .rmdl-nav-contact .wp-block-navigation-item__content {
		display: flex;
		align-items: center;
		gap: 8px;
		padding: 0 !important;
		font-size: 18px;
		color: #999999;
		border: 0;
	}

	.rmdl-header__nav .is-menu-open .rmdl-nav-contact .wp-block-navigation-item__content::before {
		content: "";
		flex: 0 0 16px;
		height: 16px;
		background: currentColor;
		-webkit-mask: var(--rmdl-icon) center / contain no-repeat;
		mask: var(--rmdl-icon) center / contain no-repeat;
	}

	.rmdl-header__nav .rmdl-nav-phone {
		--rmdl-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 10.8a15.1 15.1 0 0 0 6.6 6.6l2.2-2.2c.3-.3.7-.4 1-.2 1.1.4 2.3.6 3.6.6.6 0 1 .4 1 1V20c0 .6-.4 1-1 1A17 17 0 0 1 3 4c0-.6.4-1 1-1h3.5c.6 0 1 .4 1 1 0 1.3.2 2.5.6 3.6.1.3 0 .7-.2 1z'/%3E%3C/svg%3E");
	}

	.rmdl-header__nav .rmdl-nav-mail {
		--rmdl-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='5' width='18' height='14' rx='1'/%3E%3Cpath d='m3 6 9 7 9-7'/%3E%3C/svg%3E");
	}

	/* Suche */
	.rmdl-header__nav .is-menu-open .rmdl-nav-search {
		display: block !important;
		width: 100%;
		margin-top: 40px;
	}

	.rmdl-header__nav .rmdl-nav-search .wp-block-search__inside-wrapper {
		padding: 0;
		border: 1px solid #eeeeee;
		border-radius: 3px;
	}

	.rmdl-header__nav .rmdl-nav-search .wp-block-search__input {
		padding: 10px 12px;
		font-family: inherit;
		font-size: 14px;
		border: 0;
	}

	.rmdl-header__nav .rmdl-nav-search .wp-block-search__button {
		margin: 0;
		padding: 0 12px;
		color: #aaaaaa;
		background: transparent;
		border: 0;
	}
}

@keyframes rmdl-slide-in {
	from {
		transform: translateX(100%);
		box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0);
	}
	to {
		transform: translateX(0);
		box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .5);
	}
}

/* ---------- Seitenkopf (blaues Band) ----------------------------------- */

.rmdl-page-hero h1,
.rmdl-page-hero h2 {
	color: #ffffff;
}

.rmdl-page-hero h1 {
	line-height: 80px;
	-webkit-hyphens: auto;
	hyphens: auto;
	overflow-wrap: break-word;
}

.rmdl-page-hero h2 {
	line-height: 33px;
}

/* Abschluss unten: mehrstufige Dreiecke wie im Original (Ultimate Addons "multi triangle") */
.rmdl-page-hero {
	position: relative;
	overflow: hidden;
}

.rmdl-page-hero > * {
	position: relative;
	z-index: 1;
}

.rmdl-page-hero::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 41px;
	background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'><path d='M0 0 L50 50 L0 100' fill='rgba(255,255,255,.1)'/><path d='M100 0 L50 50 L100 100' fill='rgba(255,255,255,.1)'/><path d='M0 100 L50 50 L0 33.3' fill='rgba(255,255,255,.3)'/><path d='M100 100 L50 50 L100 33.3' fill='rgba(255,255,255,.3)'/><path d='M0 100 L50 50 L0 66.6' fill='rgba(255,255,255,.5)'/><path d='M100 100 L50 50 L100 66.6' fill='rgba(255,255,255,.5)'/><path d='M0 99.9 L50 49.9 L100 99.9 L0 99.9' fill='%23fff'/></svg>") no-repeat center bottom / 100% 100%;
	pointer-events: none;
}

/* ---------- Kontakt-Band (CTA) ----------------------------------------- */

.rmdl-cta {
	min-height: 300px;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.wp-block-button.is-style-outline-light .wp-block-button__link {
	background: transparent;
	color: #ffffff;
	border: 2px solid #ffffff;
	border-radius: 50px;
	padding: 15px 25px;
	font-size: 16px;
	font-weight: 400;
}

.wp-block-button.is-style-outline-light .wp-block-button__link:hover {
	background: #ffffff;
	color: var(--wp--preset--color--cta);
}

/* ---------- Leistungs-Karten (Startseite) ------------------------------ */

.rmdl-card .wp-block-image {
	margin: 0;
}

.rmdl-card .wp-block-image img {
	display: block;
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border-radius: 4px 4px 0 0;
}

.rmdl-card__body {
	flex-grow: 1;
}

.wp-block-button.is-style-small .wp-block-button__link {
	padding: 5px 10px;
	font-size: 16px;
	line-height: 22.4px;
	text-transform: uppercase;
	border: 1px solid var(--wp--preset--color--primary);
	border-radius: 4px;
}

.wp-block-columns.rmdl-cards > .wp-block-column {
	display: flex;
	flex-direction: column;
}

/* ---------- Überschrift mit Linie und Stern ---------------------------- */

.is-style-line-star {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 15px;
	color: var(--wp--preset--color--secondary);
	font-size: 22px;
	line-height: 1;
}

.is-style-line-star::before,
.is-style-line-star::after {
	content: "";
	flex: 1;
	border-bottom: 1px solid var(--wp--preset--color--secondary);
}

/* ---------- Listen ----------------------------------------------------- */

.entry-content ul:not(.wp-block-navigation__container),
.wp-block-post-content ul:not(.wp-block-navigation__container) {
	padding-left: 1.1em;
}

.is-style-large-list li {
	font-size: 24px;
	line-height: 1.8;
}

/* ---------- Bilder ----------------------------------------------------- */

.rmdl-service-image img {
	display: block;
	width: 100%;
	height: auto;
}

/* ---------- Footer ----------------------------------------------------- */

.rmdl-footer a {
	color: #ffffff;
	text-decoration: none;
}

.rmdl-footer a:hover {
	text-decoration: underline;
}

.rmdl-footer__menu .wp-block-navigation__container {
	width: 100%;
	gap: 0 !important;
}

.rmdl-footer__menu .wp-block-navigation-item {
	width: 100%;
	padding: 8px 0;
	border-bottom: 1px solid rgba(255, 255, 255, .55);
}

.rmdl-footer__menu .wp-block-navigation-item:last-child {
	border-bottom: 0;
}

/* ---------- Karte (2-Klick-Lösung) ------------------------------------- */

.rmdl-map {
	position: relative;
	min-height: 450px;
	background: #e9ecef;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
}

.rmdl-map iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.rmdl-map__consent {
	max-width: 520px;
	padding: 30px;
	font-size: 16px;
}

.rmdl-map__consent button {
	margin-top: 10px;
	padding: 10px 22px;
	font: inherit;
	color: #ffffff;
	background: var(--wp--preset--color--primary);
	border: 0;
	border-radius: 2px;
	cursor: pointer;
}

.rmdl-map__consent button:hover {
	background: var(--wp--preset--color--secondary);
}

/* ---------- Contact Form 7 -------------------------------------------- */

.wpcf7 form .rmdl-form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}

@media (max-width: 600px) {
	.wpcf7 form .rmdl-form-row {
		grid-template-columns: 1fr;
	}
}

.wpcf7 form p {
	margin: 0 0 18px;
}

.wpcf7 label {
	display: block;
	font-size: 16px;
	color: var(--wp--preset--color--body);
}

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 textarea {
	box-sizing: border-box;
	width: 100%;
	margin-top: 6px;
	padding: 10px 12px;
	font-family: inherit;
	font-size: 16px;
	font-weight: 300;
	color: #333333;
	background: #fcfcfc;
	border: 1px solid #dddddd;
	border-radius: 2px;
}

.wpcf7 input:focus,
.wpcf7 textarea:focus {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 0;
	border-color: var(--wp--preset--color--primary);
}

.wpcf7 textarea {
	height: 180px;
	resize: vertical;
}

.wpcf7 .wpcf7-acceptance .wpcf7-list-item {
	margin: 0;
}

.wpcf7 .wpcf7-acceptance label {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	font-size: 15px;
}

.wpcf7 .wpcf7-acceptance input {
	margin-top: 5px;
}

.wpcf7 input[type="submit"] {
	padding: 12px 28px;
	font-family: inherit;
	font-size: 16px;
	font-weight: 400;
	color: #ffffff;
	background: var(--wp--preset--color--primary);
	border: 0;
	border-radius: 2px;
	cursor: pointer;
}

.wpcf7 input[type="submit"]:hover {
	background: var(--wp--preset--color--secondary);
}

.wpcf7 .wpcf7-not-valid-tip {
	font-size: 14px;
}

.wpcf7 form .wpcf7-response-output {
	margin: 10px 0 0;
	padding: 10px 14px;
	font-size: 15px;
}

.rmdl-required-note {
	font-size: 14px;
}

/* ---------- Karten: Inhalt und Button unten bündig ---------------------- */

.rmdl-card__body {
	display: flex;
	flex-direction: column;
}

.rmdl-card__body > .wp-block-buttons {
	margin-top: auto !important;
	padding-top: 20px;
}

/* Bild und Textbox ohne Lücke, Abstände wie im Original */
.rmdl-card > .rmdl-card__body {
	margin-top: 0 !important;
}

.rmdl-card__body > h4 + p {
	margin-top: 0 !important;
}

/* ---------- Kontaktdaten-Tabelle --------------------------------------- */

.wp-block-table.rmdl-contact-table {
	display: flex;
	justify-content: center;
	margin: 10px 0 0;
}

.rmdl-contact-table table {
	width: auto;
	border: 0;
	font-size: 16px;
}

.rmdl-contact-table td {
	padding: 3px 6px;
	border: 0;
}

.rmdl-contact-table td:first-child {
	text-align: right;
}

/* ---------- Abstand Absatz -> Liste (wie Original) --------------------- */

.wp-block-column > p + .wp-block-list {
	margin-top: 25px;
}

/* ---------- Tablet: Karten 2x2 statt 4 schmaler Spalten ---------------- */

@media (min-width: 782px) and (max-width: 1099px) {
	.wp-block-columns.rmdl-cards {
		flex-wrap: wrap !important;
		row-gap: 30px;
	}

	.wp-block-columns.rmdl-cards > .wp-block-column {
		flex-basis: calc(50% - 15px) !important;
		flex-grow: 0 !important;
	}
}
