/*
Theme Name: Abenteuerblatt Astra Child
Theme URI: https://abenteuerblatt.de/
Description: Eigenes Astra-Child-Theme für Abenteuerblatt. Anpassungen bleiben bei Astra-Updates erhalten.
Author: Abenteuerblatt
Author URI: https://abenteuerblatt.de/
Template: astra
Version: 1.3.7
Text Domain: abenteuerblatt-astra-child
*/

/*
 * Header und Footer orientieren sich an der ursprünglichen Rätselpost-Seite,
 * bleiben aber eigenständig für Abenteuerblatt und vollständig responsiv.
 */
:root {
	--ab-paper: #fffdf8;
	--ab-ink: #17352f;
	--ab-muted: #66756f;
	--ab-deep: #0b211c;
	--ab-green: #176b57;
	--ab-footer-text: #edf5ef;
	--ab-footer-muted: #b8cbc3;
	--ab-shell: 1160px;
}

/* Der eigene Child-Theme-Aufbau ersetzt nur Astra-Header und -Footer. */
#masthead,
.site-footer {
	display: none !important;
}

/*
 * Header und Footer liegen außerhalb des Astra-#page-Containers. Ohne diese
 * Korrektur erzeugt Astras Mindesthöhe auf kurzen Seiten eine leere
 * Bildschirmhöhe direkt vor dem eigenen Footer.
 */
body {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

body > #page {
	flex: 1 0 auto;
	min-height: 0 !important;
}

.ab-site-footer {
	margin-top: auto;
}

.ab-shell {
	width: min(var(--ab-shell), calc(100% - 48px));
	margin-inline: auto;
}

.ab-topline {
	position: relative;
	z-index: 100;
	padding: 9px 20px;
	background: var(--ab-green);
	color: #fff;
	font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.55;
	text-align: center;
}

.ab-topline span {
	display: inline-block;
}

.ab-topline-separator {
	margin-inline: 0.35em;
	opacity: 0.75;
}

.ab-site-header {
	position: relative;
	z-index: 99;
	border-bottom: 1px solid #e7ece8;
	background: var(--ab-paper);
	color: var(--ab-ink);
	font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.ab-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 76px;
	gap: 32px;
}

.ab-brand {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 11px;
	color: var(--ab-ink);
	text-decoration: none;
}

.ab-brand:hover,
.ab-brand:focus {
	color: var(--ab-green);
}

.ab-brand-mark {
	display: block;
	width: 48px;
	height: 48px;
	object-fit: contain;
}

.ab-brand > span {
	font-family: Georgia, "Times New Roman", serif;
	font-size: 23px;
	font-weight: 700;
	letter-spacing: 0.015em;
	line-height: 1;
	text-transform: uppercase;
}

.ab-main-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: clamp(16px, 1.7vw, 27px);
	margin-left: auto;
}

.ab-main-nav a,
.ab-footer-column a,
.ab-mobile-menu nav a {
	text-decoration: none;
}

.ab-main-nav > a,
.ab-nav-dropdown > summary {
	position: relative;
	display: flex;
	align-items: center;
	gap: 5px;
	padding-block: 27px;
	color: var(--ab-muted);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.55;
	list-style: none;
	white-space: nowrap;
	cursor: pointer;
}

.ab-nav-dropdown {
	position: relative;
}

.ab-nav-dropdown > summary::-webkit-details-marker,
.ab-mobile-section > summary::-webkit-details-marker {
	display: none;
}

.ab-nav-dropdown > summary svg {
	width: 14px;
	height: 14px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.8;
	transition: transform 160ms ease;
}

.ab-nav-dropdown > summary:focus-visible,
.ab-mobile-section > summary:focus-visible {
	outline: 2px solid var(--ab-green);
	outline-offset: 2px;
	border-radius: 7px;
}

.ab-nav-dropdown[open] > summary svg {
	transform: rotate(180deg);
}

.ab-main-nav > a::after,
.ab-nav-dropdown > summary::after {
	position: absolute;
	right: 0;
	bottom: 19px;
	left: 0;
	height: 2px;
	background: var(--ab-green);
	content: "";
	transform: scaleX(0);
	transform-origin: center;
	transition: transform 160ms ease;
}

.ab-main-nav > a:hover,
.ab-main-nav > a:focus,
.ab-main-nav > a[aria-current="page"],
.ab-nav-dropdown > summary:hover,
.ab-nav-dropdown > summary:focus,
.ab-nav-dropdown[open] > summary,
.ab-nav-dropdown.is-current > summary {
	color: var(--ab-green);
}

.ab-main-nav > a:hover::after,
.ab-main-nav > a:focus::after,
.ab-main-nav > a[aria-current="page"]::after,
.ab-nav-dropdown > summary:hover::after,
.ab-nav-dropdown > summary:focus::after,
.ab-nav-dropdown[open] > summary::after,
.ab-nav-dropdown.is-current > summary::after {
	transform: scaleX(1);
}

.ab-submenu {
	position: absolute;
	top: calc(100% - 8px);
	left: 50%;
	z-index: 120;
	display: grid;
	box-sizing: border-box;
	width: 224px;
	padding: 10px;
	border: 1px solid #dfe7e3;
	border-radius: 14px;
	background: var(--ab-paper);
	box-shadow: 0 18px 50px rgba(11, 33, 28, 0.16);
	transform: translateX(-50%);
}

.ab-submenu a {
	padding: 10px 12px;
	border-radius: 9px;
	color: var(--ab-ink);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
}

.ab-submenu a:hover,
.ab-submenu a:focus,
.ab-submenu a[aria-current="page"] {
	background: #edf6f2;
	color: var(--ab-green);
}

.ab-header-actions {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 9px;
}

.ab-cart-link {
	position: relative;
}

.ab-cart-count {
	position: absolute;
	top: -5px;
	right: -5px;
	display: inline-flex;
	min-width: 19px;
	height: 19px;
	padding: 0 4px;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	border: 2px solid var(--ab-paper);
	border-radius: 999px;
	background: #f0ba55;
	color: var(--ab-ink);
	font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 10px;
	font-weight: 800;
	line-height: 1;
	box-shadow: 0 3px 8px rgba(11, 33, 28, 0.2);
}

.ab-cart-count[hidden] {
	display: none;
}

.ab-icon-link,
.ab-mobile-menu > summary {
	display: grid;
	width: 40px;
	height: 40px;
	place-items: center;
	border: 1px solid #d9e3de;
	border-radius: 999px;
	background: transparent;
	color: var(--ab-ink);
	transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.ab-icon-link:hover,
.ab-icon-link:focus,
.ab-mobile-menu > summary:hover,
.ab-mobile-menu > summary:focus {
	border-color: var(--ab-green);
	background: var(--ab-green);
	color: #fff;
}

.ab-icon-link svg,
.ab-mobile-menu svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.7;
}

.ab-mobile-menu {
	display: none;
	position: relative;
}

.ab-mobile-menu > summary {
	cursor: pointer;
	list-style: none;
}

.ab-mobile-menu > summary::-webkit-details-marker {
	display: none;
}

.ab-mobile-menu nav {
	position: absolute;
	top: calc(100% + 12px);
	right: 0;
	display: grid;
	align-content: start;
	box-sizing: border-box;
	width: min(300px, calc(100vw - 32px));
	max-height: min(560px, calc(100vh - 150px));
	padding: 10px;
	overflow-y: auto;
	overscroll-behavior: contain;
	border: 1px solid #dfe7e3;
	border-radius: 14px;
	background: var(--ab-paper);
	box-shadow: 0 18px 50px rgba(11, 33, 28, 0.16);
	scrollbar-width: thin;
}

.ab-mobile-menu nav > a,
.ab-mobile-section > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 11px 13px;
	border-radius: 9px;
	color: var(--ab-ink);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
}

.ab-mobile-section > summary {
	list-style: none;
	cursor: pointer;
}

.ab-mobile-section > summary svg {
	width: 15px;
	height: 15px;
	flex: 0 0 auto;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.8;
	transition: transform 160ms ease;
}

.ab-mobile-section[open] > summary svg {
	transform: rotate(180deg);
}

.ab-mobile-section[open] > summary,
.ab-mobile-section.is-current > summary {
	background: #edf6f2;
	color: var(--ab-green);
}

.ab-mobile-submenu {
	display: grid;
	margin: 2px 8px 7px 18px;
	padding-left: 8px;
	border-left: 1px solid #d9e6e0;
}

.ab-mobile-submenu a {
	padding: 9px 11px;
	border-radius: 8px;
	color: var(--ab-muted);
	font-size: 13px;
	font-weight: 500;
	line-height: 1.35;
}

.ab-mobile-menu nav > a:hover,
.ab-mobile-menu nav > a:focus,
.ab-mobile-menu nav > a[aria-current="page"],
.ab-mobile-submenu a:hover,
.ab-mobile-submenu a:focus,
.ab-mobile-submenu a[aria-current="page"],
.ab-mobile-section > summary:hover,
.ab-mobile-section > summary:focus {
	background: #edf6f2;
	color: var(--ab-green);
}

.ab-site-footer {
	padding: 57px 0 24px;
	background: var(--ab-deep);
	color: var(--ab-footer-text);
	font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.ab-footer-grid {
	display: grid;
	grid-template-columns: 1.5fr repeat(3, 1fr);
	gap: 38px;
}

.ab-brand--footer {
	color: var(--ab-footer-text);
}

.ab-brand--footer:hover,
.ab-brand--footer:focus {
	color: #fff;
}

.ab-brand--footer .ab-brand-mark {
	width: 44px;
	height: 44px;
}

.ab-brand--footer > span {
	font-size: 21px;
}

.ab-footer-brand p {
	max-width: 360px;
	margin: 16px 0 0;
	color: var(--ab-footer-muted);
	font-size: 13px;
	line-height: 1.55;
}

.ab-footer-brand small {
	display: block;
	margin-top: 17px;
	color: #7fa096;
	font-size: 11px;
	line-height: 1.45;
}

.ab-footer-column {
	display: grid;
	align-content: start;
	gap: 8px;
}

.ab-footer-links {
	display: grid;
	gap: 8px;
}

.ab-footer-toggle {
	display: none;
}

/* Gutenberg/Astra list resets must not collapse the gap below the hero CTAs. */
.entry-content .ab-hero .ab-quick-links {
	margin: 28px 0 0;
	padding: 0;
	list-style: none;
}

.ab-footer-column strong {
	margin-bottom: 5px;
	color: #fff;
	font-size: 14px;
	font-weight: 650;
}

.ab-footer-column a {
	width: fit-content;
	color: var(--ab-footer-muted);
	font-size: 13px;
	line-height: 1.55;
}

.ab-footer-column a:hover,
.ab-footer-column a:focus,
.ab-footer-column a[aria-current="page"] {
	color: #fff;
}

.ab-footer-bottom {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 20px;
	margin-top: 38px;
	padding-top: 20px;
	padding-right: 52px;
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	color: #9db4aa;
	font-size: 12px;
	line-height: 1.55;
}

.ab-footer-copyright,
.ab-footer-credit {
	display: inline-flex;
	align-items: center;
}

.ab-footer-copyright {
	flex-wrap: wrap;
	gap: 8px 12px;
}

.ab-footer-credit {
	gap: 6px;
	color: inherit;
	text-decoration: none;
	transition: color 160ms ease;
}

.ab-footer-credit img {
	display: block;
	width: auto;
	height: 1.35em;
	max-width: none;
}

.ab-footer-credit:hover,
.ab-footer-credit:focus {
	color: #fff;
}

/* Astra-„Nach oben“-Button im Abenteuerblatt-Farbsystem. */
#ast-scroll-top {
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 8px;
	background: var(--ab-green);
	color: #fff;
	box-shadow: 0 8px 22px rgba(11, 33, 28, 0.24);
	transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

#ast-scroll-top:hover,
#ast-scroll-top:focus {
	background: #f0ba55;
	color: var(--ab-ink);
	transform: translateY(-2px);
}

@media (max-width: 1080px) {
	.ab-footer-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 28px;
	}

	.ab-footer-brand {
		grid-column: 1 / -1;
	}

	.ab-main-nav {
		display: none;
	}

	.ab-mobile-menu {
		display: block;
	}

	.ab-header-inner {
		gap: 18px;
	}
}

@media (max-width: 920px) {
	/* One outer gutter per page, including ordinary Astra and plugin pages. */
	body #content > .ast-container {
		width: 100%;
		max-width: none;
		padding-inline: 0 !important;
	}

	body #content #primary {
		min-width: 0;
		margin-inline: 0;
		padding-inline: 0;
	}

	body #content .ast-article-single {
		padding-inline: 16px !important;
	}

	body #content .ast-article-single:has(.ab-home, .rp-site, .abg-shell, .abm-magazin, .abm-article) {
		padding-inline: 0 !important;
	}

	body #content .ast-article-single:has(.abg-shell) > .entry-header,
	body #content .entry-content > :is(.abg-shell, .abg-page-lead, .abg-page-guide, .abg-after-game) {
		width: calc(100% - 32px);
		max-width: none;
		margin-inline: auto;
	}
}

@media (max-width: 760px) {
	.ab-shell {
		width: min(100% - 32px, var(--ab-shell));
	}

	.ab-topline {
		padding: 8px 12px;
		font-size: 11px;
	}

	.ab-topline-separator {
		margin-inline: 0.15em;
	}

	.ab-header-inner {
		min-height: 68px;
	}

	.ab-brand-mark {
		width: 42px;
		height: 42px;
	}

	.ab-brand > span {
		font-size: 18px;
	}

	.ab-header-actions .ab-icon-link:first-child {
		display: none;
	}

	.ab-site-footer {
		padding: 28px 0 64px;
	}

	.ab-footer-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 0;
	}

	.ab-footer-brand {
		grid-column: 1 / -1;
		padding-bottom: 22px;
	}

	.ab-footer-brand p {
		margin-top: 12px;
	}

	.ab-footer-brand small {
		display: none;
	}

	.ab-footer-column {
		padding-block: 12px;
		border-top: 1px solid rgb(255 255 255 / 14%);
	}

	.ab-footer-column.is-collapsible {
		gap: 0;
		padding: 0;
	}

	.is-collapsible > strong {
		display: none;
	}

	.ab-site-footer .ab-footer-toggle {
		display: flex;
		width: 100%;
		min-height: 52px;
		align-items: center;
		justify-content: space-between;
		padding: 12px 0;
		border: 0;
		border-radius: 0;
		background: transparent;
		color: #fff;
		font: 650 14px/1.4 system-ui, sans-serif;
		text-align: left;
		cursor: pointer;
	}

	.ab-footer-toggle::after {
		content: '+';
		font-size: 22px;
		font-weight: 400;
	}

	.ab-footer-toggle[aria-expanded="true"]::after {
		content: '−';
	}

	.ab-footer-toggle:focus-visible {
		outline: 2px solid #f0ba55;
		outline-offset: -2px;
	}

	.ab-footer-links {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0 16px;
		padding-bottom: 12px;
	}

	.ab-footer-links[hidden] {
		display: none;
	}

	.ab-footer-links a,
	.ab-footer-column--legal a {
		display: flex;
		align-items: center;
		min-height: 44px;
	}

	.ab-footer-column--legal {
		display: flex;
		flex-wrap: wrap;
		gap: 0 24px;
		padding-block: 6px;
	}

	.ab-footer-column--legal > strong {
		display: none;
	}

	.ab-footer-bottom {
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
		margin-top: 8px;
		padding: 16px 0 0;
	}

	.ab-footer-bottom > span {
		font-size: 11px;
	}
}

@media (max-width: 480px) {
	/* Hält den schwebenden Button von rechtsbündigen FAQ- und Kartenaktionen fern. */
	#ast-scroll-top {
		right: auto !important;
		bottom: 14px !important;
		left: 14px !important;
	}

	.ab-topline-separator:nth-child(4),
	.ab-topline-item:last-child {
		display: none;
	}

	.ab-brand {
		gap: 8px;
	}

	.ab-brand > span {
		font-size: 16px;
	}

	.ab-icon-link,
	.ab-mobile-menu > summary {
		width: 38px;
		height: 38px;
	}

	.ab-site-footer {
		padding: 28px 0 64px;
	}

	.ab-footer-grid {
		grid-template-columns: 1fr;
	}

	.ab-footer-brand {
		grid-column: auto;
	}

	.ab-footer-bottom {
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
		padding-right: 0;
	}
}

@media (max-width: 340px) {
	.ab-header-actions .ab-icon-link:first-child {
		display: none;
	}
}

@media (max-width: 300px) {
	.ab-header-inner {
		gap: 10px;
	}

	.ab-site-header .ab-brand-mark {
		width: 36px;
		height: 36px;
	}

	.ab-site-header .ab-brand > span {
		font-size: 14px;
		letter-spacing: 0;
	}
}

@media (max-width: 270px) {
	/* Auf extrem schmalen Viewports bleibt Logo + Menü vollständig sichtbar. */
	.ab-site-header .ab-brand > span {
		display: none;
	}
}
