/* ==========================================================================
   schloss-hainewalde.de – responsive layer (loaded after schloss-hainewalde.css)
   Desktop (>= 800px) keeps the original 766px layout; below that the page
   becomes a single fluid column with a collapsible menu.
   ========================================================================== */

/* ---------- all sizes ---------- */
body {
	position: static;           /* was absolute; breaks scrolling on mobile */
	-webkit-text-size-adjust: 100%;
}
img {
	max-width: 100%;
}
#main_content img {
	height: auto;
}
#main_content iframe {
	max-width: 100%;
}
#main_content table {
	max-width: 100%;
}
.nav-toggle {
	display: none;
}
.skip-link {
	position: absolute;
	left: -9999px;
}
.skip-link:focus {
	left: 8px;
	top: 8px;
	z-index: 200;
	background: #fff;
	padding: 6px 10px;
}
:focus-visible {
	outline: 2px solid #0057da;
	outline-offset: 2px;
}

/* ---------- lightbox (replaces jQuery fancybox) ---------- */
.lb {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(20, 22, 12, .88);
	padding: 40px 12px;
	box-sizing: border-box;
}
.lb[hidden] {
	display: none;
}
.lb figure {
	margin: 0;
	max-width: 100%;
	max-height: 100%;
	text-align: center;
}
.lb img {
	box-sizing: border-box;
	max-width: 100%;
	max-height: calc(100vh - 110px);
	background: #fff;
	padding: 6px;
	box-shadow: 0 4px 30px rgba(0, 0, 0, .5);
}
.lb figcaption {
	color: #fff;
	font-size: 1.1em;
	margin-top: 8px;
}
.lb button {
	position: absolute;
	background: rgba(255, 255, 255, .15);
	color: #fff;
	border: 0;
	border-radius: 50%;
	width: 44px;
	height: 44px;
	font-size: 26px;
	line-height: 44px;
	cursor: pointer;
}
.lb button:hover,
.lb button:focus-visible {
	background: rgba(255, 255, 255, .35);
}
.lb .lb-close { top: 10px; right: 10px; }
.lb .lb-prev { left: 10px; top: 50%; margin-top: -22px; }
.lb .lb-next { right: 10px; top: 50%; margin-top: -22px; }

/* ---------- mobile / tablet ---------- */
@media (max-width: 799px) {
	body {
		font-size: 87.5%;
		background-color: #dfe3c9;
	}
	#main_holder,
	#holder,
	#main {
		width: auto;
		margin: 0;
		float: none;
		border: 0;
	}

	/* header: logo + name, original background graphic */
	#header {
		width: auto;
		height: auto;
		min-height: 70px;
		padding: 10px 64px 8px 0;
		font-size: 1.55em;
		background-size: 765px auto;
		box-sizing: border-box;
	}
	#header img {
		margin: 0 8px 0 10px;
		height: 52px;
		width: auto;
	}
	#head_text {
		position: static;
		width: auto;
		font-size: .5em;
		margin: 4px 12px 0;
	}
	#header_strip {
		width: 100%;
		height: auto;
		aspect-ratio: 765 / 114;
		background-size: cover;
	}

	/* navigation: collapsible */
	#left_holder {
		float: none;
		width: auto;
		position: static;
	}
	.nav-toggle {
		display: block;
		position: absolute;
		top: 14px;
		right: 10px;
		z-index: 20;
		background: #fafaf7;
		border: 1px solid #86924e;
		color: #444;
		font: bold 1em Verdana, Arial, sans-serif;
		padding: 8px 12px;
		border-radius: 3px;
		cursor: pointer;
	}
	.nav-toggle::before {
		content: "\2630\00a0";
	}
	#left_nav {
		display: none;
		float: none;
		width: auto;
		margin: 0;
		border-width: 1px 0;
		background: #fdfdfc;
	}
	.nav-open #left_nav {
		display: block;
	}
	#left_nav li {
		float: none;
		width: auto;
	}
	#left_nav li a,
	#left_nav li a:visited,
	#left_nav li span {
		height: auto;
		padding: 11px 14px;
		background-size: cover;
		border-bottom: 1px solid #eceee2;
	}
	#left_nav ul li a,
	#left_nav ul li a:visited,
	#left_nav .active li span {
		padding: 9px 14px 9px 30px;
		font-size: 1em;
	}
	.fb_iframe {
		display: none;
		float: none;
		margin: 0;
		padding: 11px 14px;
		background: #fdfdfc;
		border-bottom: 1px solid #86924e;
	}
	.nav-open .fb_iframe {
		display: block;
	}

	/* content */
	#main_content {
		float: none;
		width: auto;
		margin: 0 14px;
		min-height: 0;
	}
	#breadcrumb {
		width: auto;
		float: none;
		overflow: hidden;
		padding: 4px 8px;
	}
	.fl-left,
	.flLeft,
	.fl-right,
	.flRight {
		float: none;
		margin: 6px 0 10px;
	}
	div.image {
		max-width: 100%;
	}
	div.image p {
		width: auto !important;
	}
	.two_col .col_1,
	.two_col .col_2 {
		float: none;
		width: auto;
		margin: 0;
	}
	#main_content table {
		display: block;
		overflow-x: auto;
	}

	/* gallery */
	#gallery,
	#gallery div,
	#gallery div div {
		width: auto;
		float: none;
	}
	#gallery div div {
		display: flex;
		flex-wrap: wrap;
		gap: 8px;
	}
	#gallery div.box {
		float: none;
	}
	#gallery a:link,
	#gallery a:visited {
		margin: 0;
	}
	#gallery div.box span {
		display: none;
	}

	/* forms */
	.frm label {
		float: none;
		width: auto;
		margin-top: 8px;
	}
	.frm input,
	.frm textarea,
	.frm select {
		float: none;
		width: 100%;
		height: auto;
		box-sizing: border-box;
		font-size: 16px;            /* prevents iOS zoom */
		padding: 6px;
	}
	.frm p.fsbmt input,
	.frm p.button input {
		margin-left: 0;
		padding: 10px 18px;
		width: auto;
	}
	.frm p.radio input.radio,
	.frm p input.checkbox {
		width: auto;
		display: inline-block;
	}
	.frm p.radio label.radio {
		display: inline-block;
		float: none;
	}

	/* footer */
	#bottom {
		width: auto;
		top: 0;
		padding: 10px 14px;
		margin: 0;
		background: #fafaf7;
	}
	#bottom_corner {
		display: none;
	}
	#bot_links {
		padding: 0;
		display: flex;
		flex-wrap: wrap;
		gap: 4px 0;
	}
	#bot_links li {
		float: none;
		padding-bottom: 4px;
		font-size: .95em;
	}
	#bot_links .flt_right {
		float: none;
		margin-left: auto;
	}
}

/* ==========================================================================
   New content modules (CKEditor based)
   ========================================================================== */
.ck-content > :first-child { margin-top: 0; }
.ck-content h2 { font-size: 1.4em; font-family: Georgia, "Times New Roman", serif; margin: 14px 0 6px; }
.ck-content h3 { font-size: 1.1em; margin: 12px 0 6px; }
.ck-content ul, .ck-content ol { margin: 8px 0 10px; }
.ck-content blockquote { border-left: 3px solid #86924e; margin: 10px 0; padding: 2px 0 2px 14px; font-style: italic; }
.ck-content table { border-collapse: collapse; margin: 10px 0; width: 100%; }
.ck-content th, .ck-content td { border: 1px solid #d9dcc8; padding: 5px 8px; text-align: left; vertical-align: top; }
.ck-content th { background: #eef0e3; }

/* Text mit Bild / Bild */
.m-text::after { content: ""; display: block; clear: both; }
.m-fig { margin: 4px 0 12px; }
.m-fig img { display: block; max-width: 100%; height: auto; }
.m-fig figcaption { font-size: .91em; padding-top: 4px; line-height: 1.35; }
.m-fig--right { float: right; margin: 4px 0 10px 18px; }
.m-fig--left { float: left; margin: 4px 18px 10px 0; }
.m-fig--top, .m-fig--bottom { margin: 8px 0 12px; }
.m-fig--block.m-fig--center { margin-left: auto; margin-right: auto; }
.m-fig--block.m-fig--end { margin-left: auto; }
.m-image::after { content: ""; display: block; clear: both; }

/* Text zweispaltig */
.m-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }

/* Downloads */
.m-dl__list { margin: 6px 0 12px; padding: 0; }
#main_content .m-dl__list li { list-style: none; list-style-image: none; margin: 0; padding: 0; }
.m-dl__item a { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; padding: 8px 10px 8px 34px; border-bottom: 1px solid #e6e8da;
	background: url(/media/icon_pdf.png) no-repeat 8px 9px; text-decoration: none !important; }
.m-dl__item a:hover { background-color: #f3f4ec; }
.m-dl__title { text-decoration: underline; }
.m-dl__meta { color: #888; font-size: .9em; }

/* Video (2-Klick) */
.m-video__frame { position: relative; aspect-ratio: 16 / 9; background: #2d3020 center / cover no-repeat; display: flex; flex-direction: column;
	align-items: center; justify-content: center; color: #fff; margin: 8px 0 6px; overflow: hidden; }
.m-video__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.m-video__play { display: inline-flex; align-items: center; gap: 10px; background: rgba(0, 0, 0, .65); color: #fff; border: 2px solid #fff; border-radius: 30px;
	padding: 10px 20px; font: bold 1.05em Verdana, Arial, sans-serif; cursor: pointer; }
.m-video__play:hover, .m-video__play:focus-visible { background: #86924e; }
.m-video__icon { font-size: 1.2em; }
.m-video__note { position: absolute; bottom: 0; left: 0; right: 0; margin: 0; padding: 6px 10px; font-size: .85em; background: rgba(0, 0, 0, .55); text-align: center; }
#main_content .m-video__note a { color: #fff; }
.m-video__caption { font-size: .91em; margin-top: 4px; }

/* Hinweisbox / Zitat */
.m-box { margin: 12px 0; padding: 12px 16px; border-left: 4px solid #86924e; background: #f1f3e6; }
.m-box--important { border-color: #d98a1c; background: #fdf3e2; }
.m-box__title { font-weight: bold; margin: 0 0 6px; }
.m-box--quote { background: none; border-color: #c9cdb1; }
.m-box--quote blockquote { font-family: Georgia, "Times New Roman", serif; font-size: 1.25em; font-style: italic; line-height: 1.45; margin: 0; }
.m-box--quote figcaption { margin-top: 6px; color: #888; }

/* Button */
.m-btn-row { margin: 12px 0; }
.m-btn-row--center { text-align: center; }
.m-btn-row--end { text-align: right; }
#main_content a.m-btn { display: inline-block; padding: 9px 18px; border-radius: 3px; font-weight: bold; text-decoration: none; border: 2px solid #86924e; }
#main_content a.m-btn--primary { background: #86924e; color: #fff; }
#main_content a.m-btn--primary:hover, #main_content a.m-btn--primary:focus-visible { background: #6f7a3e; border-color: #6f7a3e; color: #fff; }
#main_content a.m-btn--secondary { background: transparent; color: #5c6630; }
#main_content a.m-btn--secondary:hover { background: #f1f3e6; }

/* Termin */
.m-event { display: flex; gap: 14px; margin: 12px 0; padding: 12px 0; border-bottom: 1px solid #e6e8da; }
.m-event__date { flex: 0 0 64px; text-align: center; background: #86924e; color: #fff; border-radius: 3px; padding: 6px 0; align-self: flex-start; line-height: 1.15; }
.m-event__day { display: block; font: bold 1.9em Georgia, serif; }
.m-event__month { display: block; font-weight: bold; }
.m-event__year { display: block; font-size: .85em; opacity: .85; }
.m-event__body { flex: 1; min-width: 0; }
#main_content .m-event__title { font-family: Georgia, "Times New Roman", serif; font-size: 1.3em; margin: 0 0 4px; }
.m-event__meta { margin: 0 0 6px; color: #555; font-weight: bold; }
.m-event__info { background: #f1f3e6; padding: 4px 8px; display: inline-block; }
.m-event--past { opacity: .6; }
.m-event::after { content: ""; display: block; clear: both; }

@media (max-width: 799px) {
	.m-fig--right, .m-fig--left { float: none; margin: 6px 0 12px; max-width: 100% !important; }
	.m-fig { max-width: 100% !important; }
	.m-cols { grid-template-columns: 1fr; }
	.m-event__date { flex-basis: 56px; }
	.m-video__play { padding: 8px 14px; font-size: .95em; }
}
