/*
Theme Name: 2nd Armored in Europe
Theme URI: https://www.2ndarmoredineurope.com
Author: 2nd Armored in Europe
Description: Block theme for 2nd Armored in Europe, WWII living history. Khaki paper, olive drab and the red, blue and yellow of the 2nd Armored Division patch. Everything is editable in Appearance > Editor.
Version: 1.4.1
Requires at least: 6.6
Tested up to: 7.2
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: second-armored
*/

/* ---------- Header ---------- */
.ad2-header {
	position: sticky;
	top: 0;
	z-index: 50;
	border-bottom: 4px solid var(--wp--preset--color--gold);
}
.admin-bar .ad2-header { top: var(--wp-admin--admin-bar--height, 32px); }
@media (max-width: 600px) { .admin-bar .ad2-header { top: 0; } }
.ad2-header .wp-block-navigation a:where(:not(.wp-element-button)) { padding: 9px 11px; text-decoration: none; }
.ad2-header .wp-block-navigation .current-menu-item > a,
.ad2-header .wp-block-navigation a[aria-current="page"] {
	background: var(--wp--preset--color--gold);
	color: var(--wp--preset--color--ink);
}
.ad2-header .wp-block-navigation a:hover { background: rgba(255, 255, 255, .08); }
.ad2-brand-sub {
	font-family: var(--wp--preset--font-family--condensed);
	font-weight: 600;
	font-size: .72rem;
	letter-spacing: .18em;
	text-transform: uppercase;
	opacity: .75;
	margin: 3px 0 0 !important;
	line-height: 1.2;
}
.ad2-header .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--wp--preset--color--olive) !important;
	color: var(--wp--preset--color--olive-ink) !important;
}

/* ---------- Hero cover ---------- */
.ad2-hero { border-bottom: 6px solid var(--wp--preset--color--red); }
.ad2-hero .wp-block-cover__image-background { filter: sepia(.25) contrast(1.05); }
.ad2-hero h1 mark, .ad2-hero h1 .has-inline-color { background: none; }

/* ---------- Block styles (registered in functions.php) ---------- */

/* Group: Paper sheet */
.wp-block-group.is-style-ad2-paper,
.wp-block-group.is-style-ad2-motto,
.wp-block-group.is-style-ad2-dispatch {
	background: var(--wp--preset--color--sheet);
	border: 1px solid var(--wp--preset--color--rule);
	padding: 26px 28px;
}
/* Group: Motto card, slightly tilted */
.wp-block-group.is-style-ad2-motto {
	transform: rotate(var(--wp--custom--rotate));
	box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .45);
	max-width: 360px;
}
.is-style-ad2-motto p:not(.is-style-ad2-label) {
	font-family: var(--wp--preset--font-family--condensed);
	font-weight: 700;
	font-size: 1.5rem;
	line-height: 1.35;
	letter-spacing: .06em;
	text-transform: uppercase;
	margin: 0;
}
.is-style-ad2-motto em {
	font-family: var(--wp--preset--font-family--stencil);
	font-weight: 400;
	font-style: normal;
	font-size: 1.75rem;
	color: var(--wp--preset--color--red);
	margin: 0 .15em;
	text-transform: none;
}
/* Group: Event dispatch, red top edge */
.wp-block-group.is-style-ad2-dispatch {
	border-top: 6px solid var(--wp--preset--color--red);
	padding: 0 0 8px;
}
.is-style-ad2-dispatch > :not(.wp-block-image):not(.wp-block-list) { padding-left: 24px; padding-right: 24px; }
.is-style-ad2-dispatch > .wp-block-image { margin: 0; }

/* Paragraph: typewriter label */
p.is-style-ad2-label {
	font-family: var(--wp--preset--font-family--typewriter);
	font-size: .9rem;
	line-height: 1.3;
	letter-spacing: .04em;
	color: var(--wp--preset--color--muted);
}
.has-olive-dark-background-color p.is-style-ad2-label,
.wp-block-cover p.is-style-ad2-label { color: inherit; }

/* Paragraph: rubber stamp */
p.is-style-ad2-stamp {
	display: inline-block;
	font-family: var(--wp--preset--font-family--typewriter);
	font-size: .82rem;
	line-height: 1;
	color: var(--wp--preset--color--red);
	border: 2px solid currentColor;
	padding: 5px 8px;
	transform: rotate(-3deg);
}

/* List: timeline */
ul.is-style-ad2-timeline, ol.is-style-ad2-timeline {
	list-style: none;
	margin: 0;
	padding: 0;
	border-left: 3px solid var(--wp--preset--color--olive);
}
.is-style-ad2-timeline > li { position: relative; padding: 0 0 26px 26px; margin: 0; }
.is-style-ad2-timeline > li::before {
	content: "";
	position: absolute;
	left: -9px;
	top: 6px;
	width: 15px;
	height: 15px;
	background: var(--wp--preset--color--gold);
	border: 3px solid var(--wp--preset--color--olive);
}
.is-style-ad2-timeline > li > strong:first-child {
	display: block;
	font-family: var(--wp--preset--font-family--stencil);
	font-weight: 400;
	font-size: 1.4rem;
	line-height: 1.1;
	color: var(--wp--preset--color--red);
}

/* List: route (country chain) */
ul.is-style-ad2-route { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.is-style-ad2-route > li {
	position: relative;
	font-family: var(--wp--preset--font-family--condensed);
	font-weight: 600;
	font-size: .9rem;
	line-height: 1;
	letter-spacing: .1em;
	text-transform: uppercase;
	padding: 9px 12px;
	margin: 0 14px 10px 0;
	background: var(--wp--preset--color--olive);
	color: var(--wp--preset--color--olive-ink);
}


/* List: documents (bulletins, PDFs) */
ul.is-style-ad2-docs { list-style: none; margin: 0; padding: 0; }
.is-style-ad2-docs > li { border-top: 1px dashed var(--wp--preset--color--rule); margin: 0; }
.is-style-ad2-docs > li > a {
	display: block;
	padding: 14px 24px;
	text-decoration: none;
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--condensed);
	font-weight: 700;
	font-size: 1.08rem;
	letter-spacing: .06em;
	text-transform: uppercase;
}
.is-style-ad2-docs > li > a::after { content: " ↗"; color: var(--wp--preset--color--red); }
.is-style-ad2-docs > li > a:hover { background: rgba(163, 36, 28, .07); }

/* Columns: fact strip */
.wp-block-columns.is-style-ad2-facts { gap: 1px !important; background: var(--wp--preset--color--rule); border: 1px solid var(--wp--preset--color--rule); }
.is-style-ad2-facts > .wp-block-column { background: var(--wp--preset--color--sheet); padding: 16px 18px; }
.is-style-ad2-facts p:first-child { font-family: var(--wp--preset--font-family--stencil); font-size: 2rem; line-height: 1; color: var(--wp--preset--color--red); margin: 0; }
.is-style-ad2-facts p:last-child { font-family: var(--wp--preset--font-family--condensed); font-weight: 600; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: var(--wp--preset--color--muted); margin: 6px 0 0; }

/* Gallery: photos get a light period tint */
.wp-block-gallery.has-nested-images figure.wp-block-image img { filter: sepia(.15) contrast(1.03); }

/* Button: outline version */
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--ink);
	border: 2px solid currentColor;
	padding: 12px 18px;
}

/* Forms from common plugins (Contact Form 7, WPForms, Jetpack) pick up the paper look */
.wpcf7 input:not([type=submit]), .wpcf7 textarea,
.wpforms-container input, .wpforms-container textarea,
.wp-block-jetpack-contact-form input, .wp-block-jetpack-contact-form textarea {
	font-family: var(--wp--preset--font-family--typewriter);
	background: var(--wp--preset--color--sheet);
	border: 1px solid var(--wp--preset--color--rule);
	border-bottom: 2px solid var(--wp--preset--color--olive);
	padding: 11px 12px;
	width: 100%;
}
.wpcf7 input[type=submit] {
	background: var(--wp--preset--color--red);
	color: #fff7ec;
	border: 0;
	font-family: var(--wp--preset--font-family--condensed);
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	padding: 14px 20px;
	cursor: pointer;
}

:focus-visible { outline: 3px solid var(--wp--preset--color--gold); outline-offset: 3px; }

/* Stencil heading used for event titles */
.wp-block-heading.ad2-stencil { font-family: var(--wp--preset--font-family--stencil); font-weight: 400; text-transform: none; letter-spacing: .02em; }
.ad2-hero .wp-block-heading { color: inherit; }
.is-style-ad2-dispatch > p.is-style-ad2-stamp { margin-left: 24px; padding: 5px 8px; }

/* ---------- Registration (v1.1) ---------- */
.is-style-ad2-dispatch > .ad2-dispatch-cta { margin: 6px 0 16px; }

.ad2-steps > .wp-block-column { display: flex; }
.ad2-steps .ad2-step { flex: 1; display: flex; flex-direction: column; }
.ad2-step > .wp-block-buttons { margin-top: auto; }
.ad2-step > h3 { margin-top: 0; }
.ad2-step p.is-style-ad2-stamp { align-self: flex-start; margin: 0; }
.ad2-step p.is-style-ad2-stamp:not(.is-open) { color: var(--wp--preset--color--muted); }



/* Staff Only access in the header (v1.3) */
.ad2-staff-only .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	background: transparent;
	color: var(--wp--preset--color--gold);
	border: 2px solid var(--wp--preset--color--gold);
	padding: 7px 11px;
	font-size: .82rem;
	letter-spacing: .12em;
	white-space: nowrap;
}
.ad2-staff-only .wp-block-button__link::before {
	content: "";
	width: 11px;
	height: 13px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 13'%3E%3Cpath d='M2 6V4a3.5 3.5 0 0 1 7 0v2h1a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm1.5 0h4V4a2 2 0 0 0-4 0z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 13'%3E%3Cpath d='M2 6V4a3.5 3.5 0 0 1 7 0v2h1a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm1.5 0h4V4a2 2 0 0 0-4 0z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ad2-staff-only .wp-block-button__link:hover { background: var(--wp--preset--color--gold); color: var(--wp--preset--color--ink); }

/* ---------- Mobile fixes (v1.4) ---------- */

/* Burger menu: items centred, large enough to tap, no empty half screen. */
.ad2-header .wp-block-navigation__responsive-container.is-menu-open {
	padding: calc(16px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)) !important;
}
.ad2-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	align-items: center !important;
	justify-content: center;
	min-height: 100%;
	padding-top: 0 !important;
}
.ad2-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	align-items: center !important;
	justify-content: center;
	gap: 6px !important;
	width: 100%;
}
.ad2-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
	width: 100% !important;
	max-width: 420px;
	margin: 0 auto !important;
	justify-content: center;
	align-self: center !important;
}
.ad2-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	padding-top: max(76px, 12vh) !important;
}
.ad2-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	display: block;
	box-sizing: border-box;
	width: 100% !important;
	margin: 0 !important;
	text-align: center;
	font-size: 1.35rem;
	letter-spacing: .14em;
	padding: 14px 16px !important;
	border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.ad2-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close {
	top: calc(14px + env(safe-area-inset-top, 0px));
	right: max(16px, env(safe-area-inset-right, 0px));
}
.ad2-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close svg { width: 32px; height: 32px; }
.ad2-header .wp-block-navigation__responsive-container-open svg { width: 30px; height: 30px; }

/* Phones in landscape and small tablets: the burger menu instead of a squeezed desktop menu. */
@media (min-width: 600px) and (max-width: 1099px) {
	.ad2-header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex !important; }
	.ad2-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none !important; }
	.ad2-header .wp-block-navigation__responsive-container.is-menu-open { display: flex !important; }
	.ad2-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close { display: flex !important; }
}

/* Footer icons: a 44px tap target. */
.wp-block-social-links .wp-block-social-link-anchor { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }

/* Forms on phones: fields stay inside the page, and text is 16px so iPhone Safari does not zoom in when a field is tapped. */
.wpcf7 input:not([type=submit]):not([type=checkbox]):not([type=radio]), .wpcf7 textarea, .wpcf7 select { box-sizing: border-box; max-width: 100%; font-size: max(16px, 1rem); }
.wpcf7 textarea { width: 100%; }
@media (max-width: 1024px) {
	input, select, textarea { font-size: max(16px, 1em) !important; }
}
