/*
 * JPO theme styles that theme.json can't express.
 * Colours and type sizes come from theme.json presets (see Styleguide CICD).
 */

/* ---------- Base ---------- */
@media (prefers-reduced-motion: no-preference) {
	html { scroll-behavior: smooth; }
}
body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	font-feature-settings: "cv11", "ss03";
}
::selection { background: var(--wp--preset--color--schwarz); color: var(--wp--preset--color--weiss); }
:where(a, button, input, select, textarea, summary, .wp-block-navigation-item__content):focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}
a { text-underline-offset: 0.18em; text-decoration-thickness: 1px; }

/* No white gaps between header, content and footer, or between full-width sections */
.wp-site-blocks > * + * { margin-block-start: 0; }
.jpo-main .wp-block-post-content > .alignfull { margin-block: 0; }
.jpo-main > .wp-block-post-content > :first-child:not(.alignfull) { margin-block-start: var(--wp--preset--spacing--50); }
.jpo-main > .wp-block-post-content > :last-child:not(.alignfull) { margin-block-end: var(--wp--preset--spacing--60); }

/* ---------- Typography helpers ---------- */
.jpo-lead { font-size: var(--wp--preset--font-size--heading-4); font-weight: 500; line-height: 1.45; }
.jpo-small { font-size: var(--wp--preset--font-size--klein); font-weight: 300; line-height: 1.45; }
.jpo-h3 { font-size: var(--wp--preset--font-size--heading-3); font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
.jpo-eyebrow { font-size: var(--wp--preset--font-size--klein); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; margin-block-end: 0.75rem; }
.jpo-eyebrow:empty { display: none; }
.jpo-measure { max-width: 46rem; }
.jpo-arrow-link a {
	font-weight: 500;
	text-decoration: none;
	border-bottom: 2px solid currentColor;
	padding-bottom: 2px;
}
.jpo-arrow-link a:hover { border-bottom-color: transparent; }
.jpo-hinweis { border: 2px dashed currentColor; padding: 1rem; }

/* The thin rule under headings (styleguide). The element spans the content
   width so it lines up with the text; the visible line is max. 28rem long. */
.wp-block-separator.jpo-rule {
	border: 0;
	height: 1px;
	width: 100% !important;
	opacity: 1;
	color: currentColor;
	background: linear-gradient(currentColor, currentColor) left center / min(100%, 28rem) 1px no-repeat;
	margin-block: 1.25rem 1.5rem;
}
.wp-block-separator.jpo-rule--grau {
	color: var(--wp--preset--color--grau);
	background-size: 100% 1px;
	margin-block: var(--wp--preset--spacing--40) 1.25rem;
}

/* Big pale section numbers ("01", "02" …) */
.jpo-has-watermark { position: relative; overflow: hidden; isolation: isolate; }
.jpo-has-watermark > .jpo-watermark {
	position: absolute;
	top: clamp(0.5rem, 3vw, 2.5rem);
	right: clamp(-0.5rem, 2vw, 3rem);
	left: auto;
	z-index: -1;
	margin: 0 !important;
	max-width: none !important;
	font-size: var(--wp--preset--font-size--ziffer);
	font-weight: 700;
	line-height: 0.8;
	letter-spacing: -0.04em;
	white-space: nowrap;
	color: rgba(255, 255, 255, 0.7);
	pointer-events: none;
	user-select: none;
}
.jpo-has-watermark:not(.has-background) > .jpo-watermark,
.jpo-has-watermark.has-weiss-background-color > .jpo-watermark { color: var(--wp--preset--color--hellblau); opacity: 0.6; }
.jpo-has-watermark.has-schwarz-background-color > .jpo-watermark { color: rgba(255, 255, 255, 0.08); }

/* ---------- Header ---------- */
.jpo-site-header { position: sticky; top: 0; z-index: 50; }
.admin-bar .jpo-site-header { top: var(--wp-admin--admin-bar--height, 32px); }
@media (max-width: 600px) {
	.admin-bar .jpo-site-header { top: 0; }
}
.jpo-header { border-bottom: 1px solid var(--wp--preset--color--hellblau); }
.jpo-brand .wp-block-site-logo img { display: block; height: auto; }
.jpo-brand .wp-block-site-title a { text-decoration: none; }
.jpo-brand:has(.wp-block-site-logo img) .wp-block-site-title {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.jpo-nav .wp-block-navigation-item__content {
	text-decoration: none;
	padding-block: 0.35rem;
	border-bottom: 2px solid transparent;
}
.jpo-nav .wp-block-navigation-item__content:hover { border-bottom-color: currentColor; }
.jpo-nav .jpo-nav-cta .wp-block-navigation-item__content {
	background: var(--wp--preset--color--schwarz);
	color: var(--wp--preset--color--weiss);
	border: 2px solid var(--wp--preset--color--schwarz);
	padding: 0.55rem 1.1rem;
}
.jpo-nav .jpo-nav-cta .wp-block-navigation-item__content:hover {
	background: var(--wp--preset--color--weiss);
	color: var(--wp--preset--color--schwarz);
}
/* Mobile overlay menu */
.jpo-nav .wp-block-navigation__responsive-container-open svg,
.jpo-nav .wp-block-navigation__responsive-container-close svg { width: 30px; height: 30px; }
.jpo-nav .wp-block-navigation__responsive-container.is-menu-open { padding: 1.25rem clamp(1rem, 4vw, 3rem); }
.jpo-nav .is-menu-open .wp-block-navigation__responsive-container-content { padding-top: 4rem !important; gap: 1.25rem !important; align-items: flex-start !important; }
.jpo-nav .is-menu-open .wp-block-navigation__container { align-items: flex-start !important; gap: 1.25rem !important; }
.jpo-nav .is-menu-open .wp-block-navigation-item__content {
	font-size: var(--wp--preset--font-size--heading-3);
	font-weight: 600;
	letter-spacing: -0.01em;
}
.jpo-nav .is-menu-open .jpo-nav-cta { margin-top: 1rem; }
.jpo-nav .is-menu-open .jpo-nav-cta .wp-block-navigation-item__content {
	background: var(--wp--preset--color--weiss);
	color: var(--wp--preset--color--schwarz);
	border-color: var(--wp--preset--color--weiss);
	font-size: var(--wp--preset--font-size--heading-4);
	padding: 0.8rem 1.4rem;
}

/* ---------- Page header ---------- */
.jpo-page-header .wp-block-post-title,
.jpo-page-header .wp-block-query-title { margin-block: 0; }
.jpo-page-header .wp-block-separator.jpo-rule { margin-block-end: 0; }
.jpo-event-meta { margin-block-start: 1.25rem; }
.jpo-event-meta p { margin: 0; }
.jpo-event-meta p:empty { display: none; }

/* ---------- Split hero ---------- */
.wp-block-columns.jpo-split { gap: 0; margin-block: 0; }
.jpo-split__text {
	padding-left: var(--wp--style--root--padding-left, 1rem) !important;
	display: flex;
	flex-direction: column;
	justify-content: center;
}
.jpo-split__text > * { max-width: 40rem; }
.jpo-split__text > .wp-block-heading { margin-block-start: 0; }
.jpo-hero__title {
	font-size: clamp(2.75rem, 1.4rem + 4.6vw, 4.75rem);
	line-height: 0.98;
	letter-spacing: -0.03em;
}
.jpo-split__media { position: relative; }
.jpo-split__media > .wp-block-image { margin: 0; }
.jpo-fill { position: relative; margin: 0; }
.jpo-fill img { display: block; width: 100%; }
.jpo-fill figcaption {
	position: absolute;
	right: 0;
	bottom: 0;
	max-width: 90%;
	margin: 0 !important;
	padding: 0.3rem 0.6rem;
	background: rgba(0, 0, 0, 0.65);
	color: var(--wp--preset--color--weiss);
	font-size: 0.75rem;
	opacity: 1 !important;
}
@media (min-width: 782px) {
	.jpo-hero { min-height: min(80vh, 48rem); }
	.jpo-split__media { min-height: 24rem; }
	.jpo-split__media > .jpo-fill { position: absolute; inset: 0; height: 100%; }
	.jpo-split__media > .jpo-fill img {
		position: absolute;
		inset: 0;
		height: 100% !important;
		aspect-ratio: auto !important;
		object-fit: cover;
	}
}

/* ---------- Images & captions ---------- */
.wp-block-image .wp-element-caption {
	margin-top: 0.4rem;
	margin-bottom: 0;
	font-size: 0.75rem;
	font-weight: 300;
	text-align: left;
	opacity: 0.85;
}
.wp-element-caption a { color: inherit; }
.jpo-mosaic .wp-block-image { margin: 0; }
.jpo-mosaic > .wp-block-group { margin-block-start: var(--wp--preset--spacing--20); }

/* ---------- Pillars (black section) ---------- */
.jpo-pillar {
	border-top: 1px solid var(--wp--preset--color--grau);
	padding-top: 1.25rem;
}
.jpo-pillar > * { margin: 0; }
.jpo-number {
	font-size: var(--wp--preset--font-size--heading-2);
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.03em;
	color: var(--wp--preset--color--grau);
	margin-bottom: 1rem !important;
}
.jpo-pillar__title { font-size: 1.375rem; font-weight: 600; line-height: 1.25; }

/* ---------- Event / post lists ---------- */
.jpo-list { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid currentColor; }
.jpo-list > li { margin: 0 !important; }
.jpo-list-row {
	display: grid !important;
	grid-template-columns: minmax(10rem, 15rem) 1fr;
	gap: 0.35rem 2rem;
	align-items: baseline;
	padding: 1.25rem 0;
	border-top: 1px solid currentColor;
}
.jpo-list-row > *,
.jpo-list-row__body > * { margin: 0 !important; }
.jpo-list-row__date { font-weight: 600; }
.jpo-list-row__date:empty,
.jpo-list-row__meta:empty { display: none; }
.jpo-list-row__title { font-size: var(--wp--preset--font-size--heading-4) !important; font-weight: 600 !important; line-height: 1.3; }
.jpo-list-row__title a { text-decoration: none; }
.jpo-list-row__title a:hover { text-decoration: underline; }
.jpo-list-row__body .wp-block-post-excerpt__excerpt { margin: 0.25rem 0 0; }
@media (max-width: 600px) {
	.jpo-list-row { grid-template-columns: 1fr; }
}
.jpo-empty {
	margin: 0;
	padding: 1.25rem 0;
	border-top: 1px solid currentColor;
	border-bottom: 1px solid currentColor;
}
.jpo-past-section:not(:has(.wp-block-post)) { display: none; }
.wp-block-query-pagination { margin-top: var(--wp--preset--spacing--40); font-weight: 500; }
.wp-block-query-pagination a { text-decoration: none; }

/* ---------- Cards & lists ---------- */
.jpo-card > :first-child { margin-top: 0; }
.jpo-card > :last-child { margin-bottom: 0; }
.jpo-card__title { font-size: 1.375rem; font-weight: 600; line-height: 1.25; margin: 0; }
.jpo-card .jpo-small { margin: 0; }
.jpo-checklist { list-style: none; padding-left: 0 !important; }
.jpo-checklist li { position: relative; padding-left: 2rem; margin-block: 0.6rem; }
.jpo-checklist li::before {
	content: "";
	position: absolute;
	left: 0.15rem;
	top: 0.45em;
	width: 0.9rem;
	height: 0.45rem;
	border-left: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(-45deg);
}

/* ---------- Buttons ---------- */
.wp-block-button__link { transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--schwarz);
	border: 2px solid var(--wp--preset--color--schwarz);
	padding: 0.85rem 1.5rem;
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover,
.wp-block-button.is-style-outline > .wp-block-button__link:focus-visible {
	background: var(--wp--preset--color--schwarz);
	color: var(--wp--preset--color--weiss);
}
.has-schwarz-background-color .wp-block-button:not(.is-style-outline) > .wp-block-button__link {
	background: var(--wp--preset--color--weiss);
	color: var(--wp--preset--color--schwarz);
	border-color: var(--wp--preset--color--weiss);
}
.has-schwarz-background-color .wp-block-button.is-style-outline > .wp-block-button__link {
	color: var(--wp--preset--color--weiss);
	border-color: var(--wp--preset--color--weiss);
}

/* ---------- Forms (Contact Form 7 and others) ---------- */
.wpcf7 form { display: grid; gap: 1.1rem; }
.wpcf7 form > p { margin: 0; }
.wpcf7 label { display: block; font-weight: 500; }
.wpcf7 input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.wpcf7 textarea,
.wpcf7 select,
.jpo-main input[type="search"] {
	display: block;
	width: 100%;
	box-sizing: border-box;
	margin-top: 0.35rem;
	padding: 0.8rem 0.9rem;
	font: inherit;
	font-weight: 400;
	color: var(--wp--preset--color--schwarz);
	background: var(--wp--preset--color--weiss);
	border: 1px solid var(--wp--preset--color--schwarz);
	border-radius: 0;
}
.wpcf7 textarea { min-height: 9rem; resize: vertical; }
.wpcf7 input:focus-visible, .wpcf7 textarea:focus-visible, .wpcf7 select:focus-visible {
	outline: 2px solid var(--wp--preset--color--schwarz);
	outline-offset: 1px;
}
.wpcf7 input[type="submit"] {
	appearance: none;
	cursor: pointer;
	font: inherit;
	font-weight: 500;
	padding: 0.85rem 1.75rem;
	background: var(--wp--preset--color--schwarz);
	color: var(--wp--preset--color--weiss);
	border: 2px solid var(--wp--preset--color--schwarz);
	border-radius: 0;
	transition: background-color 0.15s ease, color 0.15s ease;
}
.wpcf7 input[type="submit"]:hover { background: var(--wp--preset--color--weiss); color: var(--wp--preset--color--schwarz); }
.wpcf7 .wpcf7-not-valid { border-width: 2px !important; }
.wpcf7 .wpcf7-not-valid-tip { margin-top: 0.35rem; font-size: var(--wp--preset--font-size--klein); font-weight: 600; }
.wpcf7 form .wpcf7-response-output { margin: 0; padding: 0.9rem 1rem; border: 2px solid currentColor; }
.wpcf7-spinner { margin: 0 0 0 0.75rem; vertical-align: middle; }
.jpo-form-column .wp-block-shortcode,
.jpo-form-column .wpcf7 { margin-block-start: 1rem; }

/* ---------- Footer ---------- */
.jpo-footer a { color: var(--wp--preset--color--weiss); }
.jpo-footer p { margin: 0; }
.jpo-footer-title { font-size: var(--wp--preset--font-size--heading-4); font-weight: 700; }
.jpo-footer-label { color: var(--wp--preset--color--grau); font-size: var(--wp--preset--font-size--klein); font-weight: 500; }
.jpo-footer-links { list-style: none; padding: 0 !important; margin: 0; }
.jpo-footer-links li { margin: 0.35rem 0; }
.jpo-footer-links a { text-decoration: none; }
.jpo-footer-links a:hover { text-decoration: underline; }

/* ---------- Legal text ---------- */
.jpo-legal .jpo-h3 { margin-block-start: var(--wp--preset--spacing--40); }
.jpo-legal mark { background: var(--wp--preset--color--schwarz); color: var(--wp--preset--color--weiss); padding: 0 0.25em; }

/* ---------- Board member cards with photo ---------- */
.jpo-card--person { display: flex; flex-direction: column; }
.jpo-card--person > .jpo-card__photo { margin: 0; }
.jpo-card--person > .jpo-card__photo img { display: block; width: 100%; background: var(--wp--preset--color--hellblau); }
.jpo-card--person > .jpo-card__body { flex: 1; }
.jpo-card__body > * { margin-block: 0; }
.jpo-card__body > * + * { margin-block-start: 0.5rem; }

/* Board grid (rendered by [jpo_vorstand]) */
.jpo-board {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr));
	gap: var(--wp--preset--spacing--20);
	align-items: start;
}
@media (min-width: 1100px) {
	.jpo-board { grid-template-columns: repeat(3, 1fr); }
}
.jpo-board .jpo-card--person { background: var(--wp--preset--color--weiss); margin: 0; }
.jpo-board .jpo-card__photo { margin: 0; aspect-ratio: 4 / 5; overflow: hidden; background: var(--wp--preset--color--hellblau); }
.jpo-board .jpo-card__photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.jpo-board .jpo-card__body { padding: var(--wp--preset--spacing--30); }
.jpo-card__desc { font-size: var(--wp--preset--font-size--klein); }
.jpo-card__desc > * { margin: 0; }
.jpo-card__links { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
