/*
Theme Name: Ehrenmal
Theme URI: https://www.ehrenmal-heer.de/
Description: Child theme of Twenty Twenty-Five for the Kuratorium Ehrenmal des Deutschen Heeres e.V. Calm design based on the former site (sage/navy/blue), system fonts only, no external resources.
Author: [k:i] GmbH
Author URI: https://www.kigmbh.com/
Template: twentytwentyfive
Version: 1.4.2
Requires at least: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ehrenmal
*/

/* ---------- Accessibility: visible focus ---------- */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--wp--preset--color--accent-3);
	outline-offset: 2px;
	border-radius: 2px;
}
/* Light outline on dark (navy) areas */
.eh-navbar :where(a, button):focus-visible,
.eh-footer :where(a, button):focus-visible,
.has-accent-3-background-color :where(a, button):focus-visible,
.wp-block-navigation__responsive-container.is-menu-open :where(a, button):focus-visible {
	outline-color: #FFFFFF;
}
.skip-link.screen-reader-text:focus {
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--accent-3);
	outline: 3px solid var(--wp--preset--color--accent-3);
	font-weight: 700;
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ---------- Content ---------- */
.wp-block-post-content :where(p, li) a {
	text-underline-offset: 0.15em;
}
.wp-block-image figcaption,
.wp-block-gallery figcaption {
	color: var(--wp--preset--color--accent-4);
}

/* Box style recalling the former module boxes */
.is-style-eh-box {
	background: var(--wp--preset--color--accent-6);
	border: 1px solid var(--wp--preset--color--accent-2);
	border-top: 4px solid var(--wp--preset--color--accent-3);
	padding: 1rem 1.25rem;
}

/* ---------- Gallery template ---------- */
.eh-gallery .wp-block-gallery.has-nested-images figure.wp-block-image {
	background: var(--wp--preset--color--accent-6);
}
.eh-gallery .wp-block-gallery.has-nested-images figure.wp-block-image figcaption {
	background: linear-gradient(0deg, rgba(0, 25, 50, 0.85) 0%, rgba(0, 25, 50, 0.6) 70%, rgba(0, 25, 50, 0) 100%);
	color: #FFFFFF;
	font-size: 0.85rem;
}

/* ---------- Guestbook template ---------- */
.eh-guestbook .wp-block-comment-template > li {
	background: var(--wp--preset--color--accent-6);
	border-left: 4px solid var(--wp--preset--color--accent-2);
	padding: 1rem 1.25rem;
	margin-bottom: 1rem;
	list-style: none;
}
.eh-guestbook .wp-block-comment-template {
	padding-left: 0;
}
.eh-guestbook .comment-form input:not([type="submit"]):not([type="checkbox"]),
.eh-guestbook .comment-form textarea {
	border: 1px solid var(--wp--preset--color--accent-4);
	padding: 0.5em;
	width: 100%;
	box-sizing: border-box;
}

/* ---------- Page frame (as on the former site) ----------
 * Sage background, header across the full width, left column with module
 * boxes, white content area. Done as a grid on .wp-site-blocks so that every
 * template of the parent theme gets the same frame. */
body {
	background-color: var(--wp--preset--color--accent-2);
}
.wp-site-blocks {
	display: grid;
	grid-template-columns: 150px minmax(0, 1fr);
	grid-template-rows: auto 1fr auto;
	min-height: 100vh;
	padding: 0 !important;
}
.wp-site-blocks > * {
	margin-block-start: 0 !important;
}
.wp-site-blocks > header.wp-block-template-part {
	display: contents;
}
.eh-header {
	grid-column: 1 / -1;
	grid-row: 1;
	background-color: var(--wp--preset--color--accent-2);
	padding: 4px 4px 0;
}
.eh-sidebar {
	grid-column: 1;
	grid-row: 2 / 4;
	padding: 4px 0 1rem;
}
.wp-site-blocks > main {
	grid-column: 2;
	grid-row: 2;
	background-color: var(--wp--preset--color--base);
	margin: 0 !important;
	padding: 2rem 1.5rem 2.5rem;
}
.wp-site-blocks > main > .wp-block-group.alignfull {
	padding-top: 0 !important;
}
.wp-site-blocks > footer.wp-block-template-part {
	grid-column: 2;
	grid-row: 3;
	background-color: var(--wp--preset--color--base);
}

/* ---------- Header ---------- */
.eh-brand {
	display: flex;
	align-items: center;
	text-decoration: none;
	color: inherit;
}
.eh-brand__logo {
	flex: 0 0 auto;
	display: block;
	width: 120px;
	height: 120px;
}
.eh-brand__title {
	flex: 1 1 auto;
	min-width: 0;
	text-align: center;
}
.eh-brand__title img {
	display: inline-block;
	max-width: 100%;
	height: auto;
}

/* ---------- Module boxes in the left column ---------- */
.eh-box {
	background: var(--wp--preset--color--accent-6);
	border: 1px solid #000;
	margin: 4px 4px 10px 4px !important;
	padding-bottom: 10px;
	overflow: hidden;
}
.eh-box .eh-box__title {
	background: #D1D7DC url(assets/images/cellpic1.gif) repeat-x;
	margin: 0;
	height: 24px;
	line-height: 24px;
	font-size: 14px;
	font-weight: 700;
	text-align: center;
	color: var(--wp--preset--color--accent-1);
	font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
	font-weight: 700;
}
.eh-box__data {
	margin: 8px 5px 0;
	text-align: center;
}
.eh-box__data .eh-counter span {
	display: none;
}
.eh-box__data .eh-counter {
	margin: 0;
}
.eh-box__data img,
.eh-counter img {
	display: inline-block;
	max-width: 100%;
	height: auto;
}
.eh-sidebar .eh-nav {
	margin: 6px 5px 0;
	font-size: 14px;
	gap: 0.35rem;
}
.eh-sidebar .eh-nav .wp-block-navigation__container {
	gap: 0.35rem;
	width: 100%;
	align-items: center;
}
.eh-sidebar .eh-nav a {
	color: #00639C;
	text-decoration: none;
}
.eh-sidebar .eh-nav a:hover {
	color: #B30000;
	text-decoration: underline;
}
.eh-sidebar .eh-nav [aria-current="page"] {
	font-weight: 700;
	color: var(--wp--preset--color--accent-3);
}

/* ---------- Footer ---------- */
.eh-footer {
	border-top: 1px solid var(--wp--preset--color--accent-2);
	margin: 0 1.5rem;
	padding: 0.75rem 0 1rem;
	font-size: 0.8rem;
	color: var(--wp--preset--color--accent-4);
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.5rem 1.5rem;
}
.eh-footer p {
	margin: 0;
}
.eh-footer a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

/* ---------- Headings like the former page titles ---------- */
.wp-site-blocks > main :where(h1, h2, h3) {
	color: var(--wp--preset--color--accent-1);
}

/* ---------- Start page: large photo with shadow, centered headings ---------- */
.home .wp-site-blocks > main .wp-block-post-content > .wp-block-image {
	max-width: 860px;
	margin-top: 2.5rem;
	margin-left: auto;
	margin-right: auto;
}
.home .wp-site-blocks > main .wp-block-post-content > .wp-block-image img {
	width: 100%;
	height: auto;
}
.home .wp-site-blocks > main .wp-block-post-content > :where(h1, h2) {
	text-align: center;
	color: var(--wp--preset--color--accent-1);
	font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
	font-weight: 700;
}
.home .wp-site-blocks > main .wp-block-post-content > h1 {
	font-size: 26px;
	margin-top: 2rem;
	margin-bottom: 0.25rem;
}
.home .wp-site-blocks > main .wp-block-post-content > h2 {
	font-size: 22px;
	margin-top: 0;
}

/* ---------- Small screens: stack, boxes in a row ---------- */
@media (max-width: 781px) {
	.wp-site-blocks {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: auto auto 1fr auto;
	}
	.eh-sidebar {
		grid-column: 1;
		grid-row: 2;
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
		align-items: flex-start;
		padding: 0 0 4px;
	}
	.eh-box--menu {
		flex: 1 1 100%;
	}
	.eh-sidebar .eh-nav .wp-block-navigation__container {
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: center;
		gap: 0.4rem 1.1rem;
	}
	.wp-site-blocks > main {
		grid-column: 1;
		grid-row: 3;
		padding: 1.25rem 1rem 2rem;
	}
	.wp-site-blocks > footer.wp-block-template-part {
		grid-column: 1;
		grid-row: 4;
	}
	.eh-footer {
		margin: 0 1rem;
	}
	.eh-brand__logo {
		width: 64px;
		height: 64px;
	}
}
@media (max-width: 599px) {
	/* The counter image is still requested (and counted) while hidden. */
	.eh-box--counter {
		display: none;
	}
	.eh-box--menu {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0 10px 0 0;
	}
	.eh-box--menu .eh-box__title {
		background: none;
		padding-left: 10px;
	}
	.eh-sidebar .eh-nav {
		margin: 0;
	}
}

/* Faltblatt: flags in one row, equal height */
.eh-flags {
	gap: clamp(0.75rem, 3vw, 2rem);
	margin-block: 1.5rem;
}
.eh-flags .wp-block-image {
	margin: 0;
	flex: 0 0 auto;
}
.eh-flags img {
	width: clamp(64px, 16vw, 160px) !important;
	height: auto;
	aspect-ratio: 2 / 1;
	display: block;
	border: 0;
}

/* Draft marker and open items (Impressum) */
.eh-entwurf {
	border: 2px solid #B30000;
	background: #fff4f4;
	color: #B30000;
	padding: 0.75rem 1rem;
	text-align: center;
}
.eh-todo {
	background: #fff3b0;
	color: #5a4a00;
	padding: 0 0.2em;
}

/* Links page: section bands and uniform logo tiles */
.page-id-62 h2.wp-block-heading {
	background: #006699;
	color: #fff;
	padding: 0.5rem 1rem;
	margin-top: 2.5rem;
	margin-bottom: 1rem;
	font-size: 1.15rem;
	border-left: 8px solid #B30000;
}
.page-id-62 h2.wp-block-heading br { display: none; }
.page-id-62 .wp-block-columns {
	gap: 1rem;
	margin-block: 0 1rem;
}
.page-id-62 .wp-block-column {
	background: #fff;
	border: 1px solid #ccc;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 150px;
	padding: 10px;
	box-sizing: border-box;
}
.page-id-62 .wp-block-column .wp-block-image {
	margin: 0;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}
.page-id-62 .wp-block-column .wp-block-image a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}
.page-id-62 .wp-block-column img {
	width: auto;
	height: 100px;
	max-width: 85%;
	object-fit: contain;
}
@media (max-width: 781px) {
	.page-id-62 .wp-block-column { height: 120px; }
	.page-id-62 .wp-block-column img { height: 80px; }
}
@media (min-width: 782px) {
	.page-id-62 .wp-block-column { flex: 0 0 calc((100% - 2rem) / 3) !important; }
}
.page-id-62 .wp-block-column:not(:has(img)) { background: none; border: 0; }
@media (max-width: 781px) {
	.page-id-62 .wp-block-column:not(:has(img)) { display: none; }
}

/* Guestbook */
.page-id-63 .wp-block-comments { margin-top: 1.5rem; }
.page-id-63 .wp-block-comments-title { display: none; }
.page-id-63 .wp-block-comment-template { list-style: none; margin: 0; padding: 0; }
.page-id-63 .wp-block-comment-template > li {
	background: #EFEFEF;
	border: 1px solid #000;
	margin: 0 0 1rem;
	padding: 0.75rem 1rem;
}
.page-id-63 .wp-block-comment-template .wp-block-columns { margin: 0; }
.page-id-63 .wp-block-comment-author-name {
	font-weight: bold;
	color: #006699;
	font-size: 1.05rem;
}
.page-id-63 .wp-block-comment-author-name a { color: inherit; text-decoration: none; }
.page-id-63 .wp-block-comment-date { color: #555; font-size: 0.85rem; }
.page-id-63 .wp-block-comment-date a { color: inherit; text-decoration: none; }
.page-id-63 .wp-block-comment-content p { margin: 0.5rem 0; }
.page-id-63 .wp-block-comment-edit-link,
.page-id-63 .wp-block-comment-reply-link { display: none; }
.page-id-63 .wp-block-comments-pagination {
	justify-content: center;
	gap: 0.5rem;
	margin: 1.5rem 0;
	font-size: 0.95rem;
}
.page-id-63 .wp-block-comments-pagination a,
.page-id-63 .wp-block-comments-pagination .page-numbers {
	color: #00639C;
	padding: 0.15rem 0.5rem;
	border: 1px solid transparent;
}
.page-id-63 .wp-block-comments-pagination .page-numbers.current {
	border-color: #006699;
	background: #006699;
	color: #fff;
}
.page-id-63 .wp-block-comments-pagination a:hover { color: #B30000; }
.page-id-63 .comment-respond {
	background: #F7F7F7;
	border: 1px solid #ccc;
	padding: 1rem;
	margin-top: 2rem;
}
.page-id-63 .comment-respond input[type=text],
.page-id-63 .comment-respond input[type=email],
.page-id-63 .comment-respond textarea {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid #999;
	padding: 0.4rem;
	font: inherit;
}
.page-id-63 .comment-respond label { display: block; font-weight: bold; margin-bottom: 0.2rem; }
.page-id-63 .comment-respond .form-submit input[type=submit] {
	background: #006699;
	color: #fff;
	border: 0;
	padding: 0.5rem 1.25rem;
	cursor: pointer;
}
.page-id-63 .comment-respond .form-submit input[type=submit]:hover { background: #B30000; }
.page-id-63 .eh-gb-privacy { font-size: 0.85rem; color: #444; }
/* Guestbook: button to the form */
html { scroll-behavior: smooth; }
.page-id-63 #respond { scroll-margin-top: 1rem; }
.page-id-63 .eh-gb-new { margin-bottom: 1.25rem; }
.page-id-63 .eh-gb-new .wp-block-button__link {
	background: #006699;
	color: #fff;
	border-radius: 0;
	padding: 0.55rem 1.25rem;
	font-size: 1rem;
	text-decoration: none;
}
.page-id-63 .eh-gb-new .wp-block-button__link:hover { background: #B30000; }
.page-id-63 .eh-gb-img { display: block; max-width: 100%; height: auto; margin: 0.75rem auto; border: 1px solid #999; }

/* Image galleries */
.wp-block-gallery.eh-gallery {
	gap: 10px;
	margin-block: 1.5rem;
}
.wp-block-gallery.eh-gallery .wp-block-image {
	overflow: hidden;
	background: #222;
	box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.wp-block-gallery.eh-gallery .wp-block-image img {
	aspect-ratio: 4 / 3;
	object-fit: cover;
	transition: transform .35s ease, opacity .35s ease;
}
.wp-block-gallery.eh-gallery .wp-block-image:hover img {
	transform: scale(1.06);
	opacity: .9;
}
.wp-block-gallery.eh-gallery .wp-block-image figcaption {
	font-size: 0.8rem;
	line-height: 1.3;
	padding: 1.5rem 0.6rem 0.5rem;
	background: linear-gradient(transparent, rgba(0,0,0,.75));
	color: #fff;
	max-height: 55%;
	opacity: 0;
	transition: opacity .3s ease;
}
.wp-block-gallery.eh-gallery .wp-block-image:hover figcaption,
.wp-block-gallery.eh-gallery .wp-block-image:focus-within figcaption { opacity: 1; }
/* touch devices (no hover): no captions on the thumbnails - they would cover the image;
   the caption is shown at the bottom of the full-screen view (lightbox) instead */
@media (hover: none) {
	.wp-block-gallery.eh-gallery .wp-block-image figcaption { display: none !important; }
}
@media (max-width: 600px) {
	.wp-block-gallery.eh-gallery.columns-3 .wp-block-image { width: calc(50% - 5px) !important; }
}
/* Lightbox caption */
.wp-lightbox-overlay .lightbox-image-container figcaption { color: #fff; }
.wp-lightbox-overlay .scrim { background-color: #111 !important; }
.wp-lightbox-overlay.active .scrim { opacity: 1 !important; }
.wp-lightbox-overlay .close-button,
.wp-lightbox-overlay button { color: #fff !important; fill: #fff !important; }
.wp-lightbox-overlay svg { fill: #fff; }

/* Floating images with text wrap (e.g. Anfahrt) */
.wp-block-image.eh-float.alignleft {
	float: left;
	width: min(45%, 360px);
	margin: 0.3rem 1.5rem 1rem max(0px, calc((100% - var(--wp--style--global--content-size, 645px)) / 2)) !important;
}
.wp-block-image.eh-float img { width: 100%; height: auto; }
.entry-content h2, .wp-block-post-content h2 { clear: both; }
@media (max-width: 600px) {
	.wp-block-image.eh-float.alignleft { float: none; width: 100%; margin: 0 0 1rem; }
}
.page-id-67 .wp-block-image.aligncenter img { max-width: 100%; height: auto; }
.eh-credit { font-size: 0.8rem; color: #666; margin-top: -0.75rem; text-align: right; }

/* Mobile: one consistent side gutter. The block layout pulls alignfull blocks out by the root padding (30 px by
   default) while main only has 16 px on small screens - that caused 14 px horizontal overflow on every page. */
@media (max-width: 781px) {
	body {
		--wp--style--root--padding-left: 16px !important;
		--wp--style--root--padding-right: 16px !important;
	}
	.wp-block-table { overflow-x: auto; }
	.eh-credit { font-size: 0.85rem; }
}

/* Mobile menu overlay: logo and title on top, like the page header */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content::before {
	content: "";
	display: block;
	width: min(92vw, 420px);
	height: 120px;
	margin: 0 auto 1.5rem;
	background:
		url("assets/images/logo.webp") center top / 72px auto no-repeat,
		url("assets/images/titel.webp") center bottom / 100% auto no-repeat;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	padding-top: 1rem;
}
.wp-block-navigation__responsive-container.is-menu-open { background-color: #C6D3D3 !important; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { color: #00639C; font-size: 1.15rem; }
.wp-block-navigation__responsive-container-open svg { width: 28px; height: 28px; }

/* Mobile menu overlay: use the whole screen, large tap targets */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	min-height: calc(100dvh - 4rem);
	justify-content: flex-start !important;
	align-items: stretch !important;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	width: 100%;
	flex: 1;
	gap: 0 !important;
	justify-content: space-evenly;
	align-items: stretch !important;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
	width: 100%;
	border-top: 1px solid rgba(0, 0, 0, .15);
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item:last-child {
	border-bottom: 1px solid rgba(0, 0, 0, .15);
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	display: block;
	width: 100%;
	text-align: center;
	font-size: clamp(1.35rem, 6vw, 1.75rem) !important;
	font-weight: 600;
	padding: 0.65rem 0 !important;
}
.wp-block-navigation__responsive-container.is-menu-open .current-menu-item > .wp-block-navigation-item__content,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content[aria-current] {
	background: rgba(255, 255, 255, .55);
	color: #B30000;
}
.wp-block-navigation__responsive-container-close svg { width: 32px; height: 32px; }


/* ---------- accessibility and reflow (audit 2026-10-31) ---------- */

/* visually hidden text for screen readers */
.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

/* long German compounds must not overflow narrow screens (WCAG 1.4.10) */
h1, h2, h3, h4, h5, h6 {
	hyphens: auto;
	overflow-wrap: break-word;
}
main p, main li, main td, main th {
	overflow-wrap: break-word;
}

/* text links opening a new window get a small arrow; image links are announced only */
.entry-content a.eh-ext:not(.eh-ext--img)::after,
.wp-block-post-content a.eh-ext:not(.eh-ext--img)::after {
	content: "\2197";
	display: inline-block;
	margin-left: 0.15em;
	font-size: 0.8em;
	text-decoration: none;
}

/* table header rows: same look as the former bold first row */
.wp-block-table thead th {
	font-weight: 700;
	text-align: left;
	border-bottom-width: 2px;
}

/* guestbook error message above the form */
.eh-gb-error {
	background: #fdecea;
	border-left: 6px solid #B30000;
	color: #5c0000;
	padding: 0.75rem 1rem;
	font-weight: 600;
}

/* row headers (first column) keep the look of normal cells */
.wp-block-table tbody th[scope="row"] {
	font-weight: inherit;
	text-align: left;
}
