/* ==========================================================================
   MGC redesign layer (2026-11)
   Loaded last (inc/zz-redesign.php). Same brand, same information architecture:
   this file refines spacing, type rhythm, states, cards, forms and empty
   states on top of mgc.css, mgc-fixes.css, mgc-home.css and mgc-nav.css.
   Direction: accessible institutional. Warm paper, ink type, the solid red
   rule as the one accent device, quiet cards that lift on hover, strong
   visible focus.

   Tokens come from mgc.css. The additions below are a focus ring size, a
   card padding, a measure and a lift.
   ========================================================================== */

/* ---- Tokens ------------------------------------------------------------ */
html:root {
	/* Link blue on paper was 4.17:1 (blue-600). blue-700 is 5.99:1. */
	--text-link: var(--blue-700);
	--text-link-hover: var(--ink-900);
	--wp--preset--color--secondary-hover: var(--blue-700);
	--ring: 3px;
	--ring-offset: 2px;
	--card-pad: clamp(20px, 2.2vw, 28px);
	--measure: 68ch;
	--lift: translateY(-3px);
	--success-700: #24633e;
}

/* ---- Base: type rhythm, links, focus ----------------------------------- */
body { line-height: 1.6; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
h1, h2, h3, .wp-block-post-title { text-wrap: balance; }
p, li { text-wrap: pretty; }
h2.wp-block-heading { line-height: 1.12; }

/* Long German and Croatian compounds break at syllables instead of overflowing
   a card, a tile or a column. */
html:lang(de) :is(.mgc-card, .mgc-pillar, .mgc-tile__label, .mgc-threeup__col, .wp-block-column, h1, h2, h3),
html:lang(hr) :is(.mgc-card, .mgc-pillar, .mgc-tile__label, .mgc-threeup__col, .wp-block-column, h1, h2, h3) {
	hyphens: auto;
	overflow-wrap: break-word;
}

.wp-site-blocks :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: var(--ring) solid var(--focus-ring);
	outline-offset: var(--ring-offset);
	border-radius: var(--radius-sm);
}
main p a:not(.mgc-btn):not(.wp-element-button):not(.wp-block-post-excerpt__more-link):not(.mgc-card a),
main li a:not(.mgc-btn):not(.wp-element-button):not(.wp-block-post-excerpt__more-link):not(.mgc-card a) {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}
main p a:not(.mgc-btn):not(.wp-element-button):not(.wp-block-post-excerpt__more-link):not(.mgc-card a):hover,
main li a:not(.mgc-btn):not(.wp-element-button):not(.wp-block-post-excerpt__more-link):not(.mgc-card a):hover {
	color: var(--text-link-hover);
	text-decoration-thickness: 2px;
}
.mgc-eyebrow { margin-bottom: 0; line-height: 1.3; }

/* ---- Buttons ----------------------------------------------------------- */
.wp-element-button, .mgc-btn {
	min-height: 44px;
	cursor: pointer;
	transition: background var(--duration-fast) var(--ease-standard),
		border-color var(--duration-fast) var(--ease-standard),
		color var(--duration-fast) var(--ease-standard),
		box-shadow var(--duration-fast) var(--ease-standard),
		transform var(--duration-fast) var(--ease-standard);
}
.wp-element-button:hover, .mgc-btn:hover { box-shadow: var(--shadow-sm); }
.wp-element-button:active, .mgc-btn:active { transform: translateY(1px); box-shadow: none; }
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: var(--ink-900);
	border: 1.5px solid var(--ink-900);
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--ink-900);
	color: #fff;
}
.mgc-btn--sm { min-height: 44px; }
.mgc-btn--onphoto:focus-visible { outline-color: var(--gold-500); outline-offset: 3px; }
.mgc-section--dark :focus-visible,
.mgc-footer :focus-visible { outline-color: var(--gold-500); }

/* ---- Header and footer ------------------------------------------------- */
.mgc-header__rail .mgc-lang a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	min-width: 36px;
	padding: 0 8px;
	font-size: var(--text-xs);
}
.mgc-header__cta { font-size: var(--text-sm); }
.mgc-brand:focus-visible { outline: var(--ring) solid var(--focus-ring); outline-offset: 4px; border-radius: var(--radius-sm); }

.mgc-footer { font-size: var(--text-sm); }
.mgc-footer__brand { letter-spacing: 0.06em; margin: 0 0 12px; }
.mgc-footer__list li { margin: 0; }
.mgc-footer__list a,
.mgc-footer p a[href^="mailto"] {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	text-decoration: none;
	color: var(--ink-200);
}
.mgc-footer__list a:hover, .mgc-footer p a:hover { color: #fff; text-decoration: underline; }
.mgc-footer__list { line-height: 1.4 !important; }
.mgc-footer__h { padding-bottom: 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.14); display: inline-block; }
.mgc-footer__legal { color: var(--ink-300); font-size: 0.8125rem; line-height: 1.6; }
.mgc-footer__legal a { color: #fff; display: inline-flex; align-items: center; min-height: 44px; }
.mgc-flags img { height: 20px; width: auto; }

/* ---- Home hero: polish only. Grid, height and stacking are unchanged. --- */
/* Local scrim. The gold eyebrow measured 3.14:1 against the lightest pixel
   behind it. This gradient sits only behind the text block, dark at the left
   edge and fading out toward the photo, so the picture keeps its brightness on
   the right and the gold stays gold. */
.wp-block-cover__inner-container { position: relative; }
.mgc-hero__media .wp-block-cover__inner-container::before {
	content: "";
	position: absolute;
	z-index: -1;
	inset: -600px -96px -600px -56px;
	background: linear-gradient(90deg, rgba(28, 27, 25, 0.66) 0%, rgba(28, 27, 25, 0.54) 55%, rgba(28, 27, 25, 0) 100%);
	pointer-events: none;
}
.mgc-hero__media .mgc-eyebrow { letter-spacing: 0.12em; margin: 0; }
.mgc-hero__media h1 { margin-top: 12px; margin-bottom: 0; line-height: 1.1; text-wrap: balance; }
.mgc-hero__media .mgc-btn { min-height: 44px; padding: 10px 20px; font-size: var(--text-sm); }
.mgc-hero__media .mgc-btn--onphoto:hover { transform: translateY(-1px); }

.mgc-tile { gap: 12px; }
.mgc-tile__label {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	min-height: 2.4em;
	text-wrap: balance;
}
.mgc-tile svg { flex: none; }
.mgc-tile:hover svg { transform: translateY(-3px) scale(1.03); }
.mgc-tile:active { filter: brightness(0.96); }
.mgc-tile:focus-visible { outline: 4px solid #fff; outline-offset: -8px; border-radius: 0; }

/* Home three-up row */
.mgc-threeup__item .wp-block-post-title a { color: var(--ink-900); text-decoration: none; }
.mgc-threeup__item .wp-block-post-title a:hover { color: var(--color-primary); text-decoration: underline; }
.mgc-threeup__more { display: inline-flex; align-items: center; min-height: 44px; margin-top: 4px; color: var(--red-600); }

/* ---- Cards ------------------------------------------------------------- */
.mgc-card { position: relative; border-radius: var(--radius-lg); border-color: var(--border-subtle);
	transition: box-shadow var(--duration-base) var(--ease-standard),
		transform var(--duration-base) var(--ease-standard),
		border-color var(--duration-base) var(--ease-standard); }
.wp-block-group.mgc-card.mgc-card--tricolor > .mgc-card__pad,
.mgc-card__pad { padding: var(--card-pad); }
.wp-block-group.mgc-card:not(.mgc-card--tricolor) { padding: var(--card-pad); }

/* Equal-height cards in query grids and column rows. */
.wp-block-post-template.is-layout-grid > li { display: flex; flex-direction: column; }
.wp-block-post-template.is-layout-grid > li > .mgc-card { flex: 1; }
.wp-block-columns > .wp-block-column > .wp-block-group:is(.mgc-card, .mgc-pillar) { height: 100%; }

/* Cards that link somewhere (query cards) are one big target. The title link
   stretches over the card; badges stay above it. */
.mgc-card .wp-block-post-title a { color: var(--ink-900); text-decoration: none; }
.mgc-card .wp-block-post-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.mgc-card .wp-block-post-terms, .mgc-card .wp-block-post-terms a { position: relative; z-index: 2; }
.mgc-card:has(.wp-block-post-title a):hover { transform: var(--lift); box-shadow: var(--shadow-md); border-color: var(--border-default); }
.mgc-card:has(.wp-block-post-title a):hover .wp-block-post-title a { color: var(--color-primary); }
.mgc-card:has(a:focus-visible) { outline: var(--ring) solid var(--focus-ring); outline-offset: var(--ring-offset); }
.mgc-card a:focus-visible { outline: none; }
.mgc-card .wp-block-post-featured-image { overflow: hidden; border-radius: var(--radius-md); margin-top: 0; }
.mgc-card .wp-block-post-featured-image img { transition: transform var(--duration-base) var(--ease-standard); }
.mgc-card:hover .wp-block-post-featured-image img { transform: scale(1.03); }
.mgc-card .wp-block-post-excerpt__excerpt { margin: 0 0 4px; line-height: 1.55; }
.wp-block-post-excerpt__more-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	font-family: var(--font-heading);
	font-weight: var(--weight-semibold);
	font-size: var(--text-sm);
	color: var(--red-600);
	text-decoration: none;
}
.wp-block-post-excerpt__more-link::after { content: "\2192"; transition: transform var(--duration-fast) var(--ease-standard); }
.mgc-card:hover .wp-block-post-excerpt__more-link::after { transform: translateX(3px); }

/* Event date line on cards */
.mgc-card p.has-primary-color { font-family: var(--font-heading); letter-spacing: 0.01em; color: var(--red-600); }

/* Badges: every pair at or above 4.5:1. */
.mgc-badge { font-family: var(--font-heading); font-size: 0.6875rem; letter-spacing: 0.04em; text-transform: uppercase; padding: 4px 10px; line-height: 1.2; }
.mgc-badge a { color: inherit; text-decoration: none; }
/* The badge is a small link: its hit area is widened past the visible pill. */
.mgc-badge a { position: relative; }
.mgc-badge a::after { content: ""; position: absolute; inset: -16px -8px; }
.mgc-card > .mgc-card__pad > p > a, .mgc-card > p > a { display: inline-flex; align-items: center; min-height: 44px; }
.mgc-badge--gold { color: var(--ink-900); }
.mgc-badge--success { color: var(--success-700); }
.mgc-badge--blue { color: var(--blue-700); }

.mgc-pillar { border-radius: var(--radius-lg); background: var(--surface-card); }

/* ---- Initials avatar (inc/person-avatar.php) --------------------------- */
.mgc-avatar {
	background: var(--blue-100);
	color: var(--blue-700);
	border: 1px solid var(--border-subtle);
	border-radius: var(--radius-md);
	font-weight: var(--weight-extrabold);
	letter-spacing: 0.06em;
}
li:nth-child(3n+2) > .mgc-card .mgc-avatar { background: var(--red-50); color: var(--red-700); }
li:nth-child(3n+3) > .mgc-card .mgc-avatar { background: var(--gold-100); color: var(--ink-900); }
.mgc-avatar--round { border-radius: var(--radius-full); }

/* ---- Empty states and notices ------------------------------------------ */
.mgc-alert { border-radius: var(--radius-md); align-items: flex-start; }
.mgc-alert__title { font-size: var(--text-lg); }
.mgc-alert--warning {
	display: block;
	text-align: center;
	background: var(--surface-card);
	border: 1.5px dashed var(--border-default);
	border-radius: var(--radius-lg);
	padding: clamp(28px, 5vw, 56px) var(--space-5);
	color: var(--text-body);
}
.mgc-alert--warning::before {
	content: "";
	display: block;
	width: 64px;
	height: 3px;
	margin: 0 auto var(--space-4);
	background: var(--red-500);
}
.mgc-alert--warning .mgc-alert__title { color: var(--ink-900); font-size: var(--text-xl); margin-bottom: 6px; }
.mgc-alert--warning > div { max-width: 52ch; margin: 0 auto; }
.mgc-alert:not(.mgc-alert--warning) a { font-weight: var(--weight-semibold); }

/* ---- Pagination -------------------------------------------------------- */
.wp-block-query-pagination { gap: 8px; font-family: var(--font-heading); font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.wp-block-query-pagination :is(a, .page-numbers) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 12px;
	border: 1px solid var(--border-default);
	border-radius: var(--radius-md);
	background: var(--surface-card);
	color: var(--ink-900);
	text-decoration: none;
}
.wp-block-query-pagination a:hover { background: var(--ink-900); color: #fff; border-color: var(--ink-900); }
.wp-block-query-pagination .page-numbers.current { background: var(--ink-900); color: #fff; border-color: var(--ink-900); }
.wp-block-query-pagination-numbers { display: flex; gap: 8px; }

/* ---- Cover headers (archives, singles, pages) --------------------------- */
.mgc-cover:not(.mgc-hero__media) .wp-block-cover__inner-container::before {
	content: "";
	position: absolute;
	z-index: -1;
	inset: -600px -64px -600px -200px;
	background: linear-gradient(90deg, rgba(28, 27, 25, 0.55) 0%, rgba(28, 27, 25, 0.35) 55%, rgba(28, 27, 25, 0) 100%);
	pointer-events: none;
}
.mgc-cover h1 { text-shadow: 0 1px 2px rgba(28, 27, 25, 0.35); }
.mgc-cover .mgc-eyebrow { letter-spacing: 0.12em; }
/* The cover turns every paragraph light and every link white. That erased the
   labels of the white date chips and the pale branch badge on event pages. */
.mgc-cover .mgc-datechip { box-shadow: var(--shadow-md); }
.mgc-cover .mgc-datechip p:not(.mgc-datechip__mon) { color: var(--ink-900); }
.mgc-cover .mgc-datechip p.mgc-datechip__mon { color: var(--red-700); font-weight: var(--weight-bold); }
.mgc-cover .mgc-badge { background: #fff; color: var(--blue-700); }
.mgc-cover .mgc-badge a { color: var(--blue-700); text-decoration: none; }

/* ---- Singles ------------------------------------------------------------ */
.wp-block-post-content { line-height: 1.7; }
.wp-block-post-featured-image img { border-radius: var(--radius-lg); }
.single main p > a[href$="/events/"], .single main p > a[href$="/projects/"],
.single main p > a[href$="/people/"], .single main p > a[href$="/news/"] {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	font-weight: var(--weight-semibold);
}

/* ---- Contact Form 7 ----------------------------------------------------- */
.wpcf7 .mgc-field { margin-bottom: 20px; gap: 0; }
.wpcf7 .mgc-field > p { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.wpcf7 form > p { margin: 8px 0 0; }
.wpcf7 label { font-size: var(--text-sm); line-height: 1.35; }
.wpcf7 .mgc-req { color: var(--red-600); font-weight: var(--weight-bold); }
.wpcf7 :is(input[type=text], input[type=email], input[type=tel], input[type=url], input[type=number], input[type=date], select, textarea) {
	min-height: 48px;
	padding: 10px 14px;
	border: 1.5px solid var(--ink-500);
	border-radius: var(--radius-md);
	font-size: 1rem;
	outline: none;
}
.wpcf7 textarea { min-height: 140px; }
.wpcf7 :is(input, select, textarea):hover { border-color: var(--ink-900); }
.wpcf7 :is(input, select, textarea):focus,
.wpcf7 :is(input, select, textarea):focus-visible {
	border-color: var(--blue-700);
	box-shadow: 0 0 0 3px var(--blue-100), 0 0 0 5px var(--blue-700);
	outline: none;
}
.wpcf7 .wpcf7-form-control-wrap { display: block; }
.wpcf7 [aria-invalid="true"], .wpcf7 .wpcf7-not-valid {
	border-color: var(--red-600) !important;
	box-shadow: 0 0 0 3px var(--danger-100) !important;
	background: #fff;
}
/* Inline error sits directly under its field, with a mark that does not rely on color alone. */
.wpcf7 .wpcf7-not-valid-tip {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	margin-top: 6px;
	font-size: var(--text-sm);
	font-weight: var(--weight-semibold);
	line-height: 1.35;
	color: var(--red-700);
}
.wpcf7 .wpcf7-not-valid-tip::before {
	content: "!";
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	margin-top: 1px;
	border-radius: 50%;
	background: var(--red-700);
	color: #fff;
	font-size: 12px;
	font-weight: 800;
	line-height: 1;
}
.wpcf7 .wpcf7-acceptance .wpcf7-list-item { margin: 0; }
.wpcf7 .wpcf7-acceptance label { display: flex; align-items: flex-start; gap: 10px; font-weight: var(--weight-regular); font-size: var(--text-sm); line-height: 1.5; min-height: 44px; }
.wpcf7 input[type=checkbox] { width: 22px; height: 22px; flex: none; margin: 1px 0 0; accent-color: var(--red-500); }
.wpcf7 input[type=submit], .wpcf7 .mgc-btn[type=submit] { min-height: 52px; padding: 13px 32px; }
.wpcf7 input[type=submit]:focus-visible { outline: var(--ring) solid var(--blue-700); outline-offset: 3px; }
.wpcf7 .wpcf7-spinner { margin: 0 0 0 12px; }
.wpcf7-response-output { font-weight: var(--weight-semibold); border-width: 1px 1px 1px 4px; border-style: solid; border-color: var(--info-500); }
.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output { border-color: var(--danger-500); background: var(--danger-100); color: var(--red-700); }
.wpcf7 form.sent .wpcf7-response-output { color: var(--success-700); }
.wpcf7 form.init .wpcf7-response-output { display: none; }
/* The honeypot stays off-canvas (mgc.css). It is never restyled or revealed. */

/* ---- Page layouts: about, membership, contact --------------------------- */
.wp-block-columns .mgc-card h3, .wp-block-columns .mgc-pillar h3 { margin-top: 0; }
.mgc-card p, .mgc-pillar p { line-height: 1.6; }

/* ---- 404 ---------------------------------------------------------------- */
.error404 main > .mgc-eyebrow {
	font-family: var(--font-heading);
	font-weight: var(--weight-extrabold);
	font-size: clamp(4.5rem, 16vw, 9rem);
	line-height: 0.95;
	letter-spacing: 0.02em;
	color: var(--red-500);
}
.error404 main > .mgc-eyebrow::after {
	content: "";
	display: block;
	width: 96px;
	height: 6px;
	margin: 16px auto 0;
	background: var(--red-500);
}
.error404 main > h1 { margin-top: 0.6em; font-size: clamp(1.75rem, 4vw, 2.5rem); }
.error404 main > .mgc-lead { max-width: 52ch; margin-left: auto; margin-right: auto; }

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 782px) {
	.mgc-card:has(.wp-block-post-title a):hover { transform: none; }
}
@media (max-width: 600px) {
	/* mgc.css sizes every .wp-block-post-title at 36px on phones; card and list titles are h3. */
	.mgc-card .wp-block-post-title { font-size: 1.25rem !important; }
	.mgc-threeup__item .wp-block-post-title { font-size: 1rem !important; }
	h2.wp-block-heading { font-size: clamp(1.5rem, 6.4vw, 2.25rem); overflow-wrap: break-word; }
}
@media (max-width: 480px) {
	.mgc-header__rail .mgc-lang a { min-width: 32px; padding: 0 5px; }
}
@media (hover: none) {
	.mgc-card:has(.wp-block-post-title a):hover { transform: none; box-shadow: var(--shadow-xs); }
	.mgc-card:hover .wp-block-post-featured-image img { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
	.mgc-card, .mgc-card *, .mgc-tile, .mgc-tile *, .wp-element-button, .mgc-btn {
		transition: none !important;
		transform: none !important;
	}
}
