/* afacad-regular - latin_latin-ext_math_symbols */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Afacad';
  font-style: normal;
  font-weight: 500;
  src: url('../fonts/afacad-v2-latin_latin-ext_math_symbols-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
html, body {
	height: 100%;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	font-family: Afacad, Tahoma, Arial, Serif, sans-serif;
}
.wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-top: 14em; /* total height of fixed header + nav */
}
.header {
	background-color: #810;
	color: white;
	height: 2em;
	display: flex;
	justify-content: flex-end;
	align-items: center;
	padding: 0;
	padding-right: 1em;
	position: fixed;
	top: 0;
	width: 100%;
	z-index: 997;
	box-sizing: border-box;
}
.header a {
	font-size: 0.8em;
	color: white;
	text-decoration: none;
	margin-left: 1em;
}
.navigation {
	display: flex;
	position: fixed;
	top: 2em;
	width: 100%;
	padding: 1em;
	align-items: center;
	background-color: #f4f4f4;
	z-index: 999;
	box-sizing: border-box;
}
.logo {
	height: 190px;
	position: absolute;
    bottom: -30px; /* Overlapping effect */
    left: 10px;
	z-index: 1000;
}
.nav-container {
	flex-grow: 1;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	margin-left: 250px; /* Adjust based on logo width */
	overflow: visible;
}
.nav-title {
	font-size: 2em;
	font-weight: normal;
}
.menu {
	list-style: none;
	padding: 0;
	display: flex;
	gap: 1em;
	position: relative;
	flex-wrap: nowrap;
	z-index: 1001;
}
.menu > li {
	position: relative;
	font-weight: 600;
}
.menu a {
	text-decoration: none;
	color: #333;
	padding: 0.5em;
	display: block;
}
.submenu {
	display: none;
	position: absolute;
    border-radius: 9px;
	background-color: #f4f4f4;
	list-style: none;
	padding: 0;
	margin: 0;
	top: 100%;
	left: 0;
	min-width: 150px;
	box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
	z-index: 1002;
}
.submenu li {
	width: 100%;
}
.submenu a {
	padding: 0.5em;
	display: block;
	white-space: nowrap;
	color: white;
	background-color: #8b1313;
}
.submenu a:hover {
	background-color: #e77979;
	color: #f9f9a7;
}
.menu > li:hover .submenu {
	display: block;
}
.menu > li:nth-last-child(2) .submenu {
	right: -4em;
	left: auto;
}
.menu > li:last-child .submenu {
	right: 0;
	left: auto;
}
.content {
	flex: 1;
	overflow-y: auto;
	padding-top: 1em;
	padding-left: 2em;
    padding-right: 2em;
	padding-bottom: 0;
	min-width: 80%;  /* tinymce toolbar fix */
    max-width: 100%; /* tinymce toolbar fix */
    box-sizing: border-box; /* tinymce toolbar fix */
	display: flex;
	flex-direction: column;
}
.loginbox {
	margin: 2em auto; 
	padding: 1.5em; 
	width: 300px; 
	background-color: #f9f9f9; 
	border-radius: 8px; 
	box-shadow: 0 2px 10px rgba(0,0,0,0.4); 
	text-align: left
}
.loginbox h3 {
	margin: 0 0 1em 0; 
	font-size: 1.5em; 
	text-align: center;
}
/* Hide the toggle button on desktop */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1em;
    margin: 0.5em;
    cursor: pointer;
}
.editor-controls button:hover {
    background-color: #eaeaea;
}
/* Toast style notifications for user feedback */
#toast-container {
    position: fixed;   /* This is critical: stays relative to the viewport */
    top: 1em;
    right: 1em;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.toast-message {
    background-color: #333;
    color: #fff;
    padding: 0.8em 1.2em;
    margin-top: 0.5em;
    border-radius: 5px;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.4s ease, transform 0.4s ease;
    font-size: 0.9em;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    min-width: 200px;
    max-width: 350px;
	cursor: pointer;  /* Visual hint that it's clickable */
}
.toast-success { background-color: #099229; }
.toast-error { background-color: #f85044; }
.toast-info { background-color: #38cefc; }
.tox-editor-header {
	min-width: 100% !important;
}
/* Important: Restrict TinyMCE iframe height */
.tox.tox-tinymce {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 14em); /* adjust header/nav height */
    width: 100%;
}
/* The iframe inside TinyMCE */
.tox-edit-area__iframe {
    flex: 1;
    width: 100% !important;
    height: 100% !important;
    min-height: 300px;
}
/* Google Maps Embed Responsiveness */
.map-embed {
  aspect-ratio: 16/7;
  width: 100%;
  max-width: 800px;   /* maximale Breite am Desktop */
  min-width: 300px;   /* Mindestbreite, solange genug Platz da ist */
  margin: 0 auto;     /* mittig zentriert */
  border-radius: 8px;
  overflow: hidden;
}

.map-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Mobile-Fallback: wenn das Viewport kleiner als 300px ist,
   soll die Karte trotzdem 100% breit laufen */
@media (max-width: 300px) {
  .map-embed {
    min-width: auto;  /* Mindestbreite aufheben */
    width: 100%;      /* volle Breite */
  }
}
/* Mobile Styles */
@media (max-width: 768px) {
    .header {
		position:fixed;
		top: 6em;
        display: flex;
        flex-wrap: wrap;             /* ✅ allow links to wrap */
        justify-content: flex-end;   /* or center */
        align-items: flex-start;
        height: auto;
        padding: 1em;
		padding-left: 3em;
        box-sizing: border-box;
    }
    .header a {
        display: inline-flex;        /* ✅ keep icon + text on same line */
        align-items: center;
        white-space: nowrap;         /* ✅ prevent text from wrapping */
        padding: 0.2em 0.2em;
        font-size: 0.8em;
        background-color: transparent;
    }
    .header i {
        margin-right: 0.3em;
    }
	/* Make header & navigation stack vertically */
	.navigation {
		position: fixed;       /* ✅ stays fixed */
		top: 0;
		width: 100%;
		z-index: 999;
	}
	/* Logo size and positioning */
	.logo {
		top: 1.6em;
		height: 100px;
		position: absolute;
		bottom: 0; /* Overlapping effect */
		left: 0.4em;
		z-index: 1002;
	}
	/* Adjust nav container spacing */
	.nav-container {
		margin-left: 0;
		align-items: center;
	}
	/* Title text smaller on mobile */
	.nav-title {
		font-size: 1em;
		margin-bottom: 0.5em;
		align-self: flex-end;
		text-align: right;
	}
	.menu-toggle {
        display: block;
        z-index: 1001;
    }
	/* Stack menu items vertically */
	.menu {
		display: none;
		flex-direction: column;
		width: 100%;
		align-items: center;
		gap: 0;
		background-color: #f4f4f4;
	}
	.menu.active {
        display: flex;
    }
	.menu li {
		width: 100%;
	}
	.menu a {
		width: 100%;
		padding: 0.5em;
		text-align: center;
		border-top: 1px solid #ccc;
	}
	/* Submenu behaves like accordion or inline list */
	.submenu {
		position: static;
		box-shadow: none;
		width: 100%;
	}
	.menu li:hover .submenu {
		display: block;
	}
	.submenu a {
		background-color: #555;
		color: white;
	}
	.submenu a:hover {
		background-color: #eee;
		color: #000;
	}
	.content {
		font-size: 0.9em;
		padding-top: 0; 
		padding-left: 1em;
		padding-right: 1em;
		padding-bottom: 1em;
	}
	#toast-container {
        top: 0.5em;
        right: 0.5em;
    }
    .toast-message {
        max-width: 90vw;
    }
}