/* ==========================================================================
   MGC — homepage mockup redesign (2026-08-12)
   Loaded after mgc.css and mgc-fixes.css. Uses only tokens already declared
   at :root by mgc.css. No new tokens are introduced.
   ========================================================================== */

/* ---- Masthead (site-wide) --------------------------------------------- */
/* Two tiers, per the client's mockup. The brand band carries the lockup and the
   typeset wordmark; the rail under it carries the utilities the mockup does not
   show but the site needs. The negative `top`
   parks the band above the viewport as the page scrolls, so the full masthead
   greets the visitor on arrival and only the rail follows them down — no
   script, and no layout shift, because the header's flow height never changes. */
/* The sticky element has to be the template-part wrapper, not .mgc-header: a
   sticky box may only travel inside its parent's box, and .mgc-header's parent
   IS the wrapper, sized to exactly the header's own height — which is why
   `position: sticky` in mgc.css never actually stuck to anything. The wrapper's
   parent is .wp-site-blocks, i.e. the whole page. Every template inserts this
   part as `{"slug":"header","tagName":"header"}` at the top level, so the child
   selector reaches all of them without editing sixteen template files. */
.wp-site-blocks > header.wp-block-template-part {
	--mast-logo: clamp(56px, 5.9vw, 88px);
	--mast-band-pad: clamp(12px, 1.3vw, 18px);
	--mast-rail: 58px;
	--mast-gutter: 28px;

	position: sticky;
	top: calc(-1 * (var(--mast-logo) + var(--mast-band-pad) * 2));
	z-index: 30;
	background: var(--paper);
}
/* WordPress gives every top-level child of .wp-site-blocks a root block-gap
   margin-block-start, which opened a 24px strip of page background between the
   masthead and the first section on every template. Only the seam directly
   below the header is closed; the gap above the footer is left as authored. */
.wp-site-blocks > header.wp-block-template-part + * { margin-block-start: 0; }
.mgc-header {
	position: static;
	background: var(--paper);
	border-bottom: 0;
	/* mgc.css blurs the header. Any backdrop-filter makes this element the
	   containing block for `position: fixed` descendants, which traps the
	   navigation overlay inside the header box. Dropping the filter outright is
	   simpler than neutralising it only while the menu is open (the narrower
	   workaround in mgc-fixes.css). */
	backdrop-filter: none;
}
/* Flow layout gives every child but the first a block-gap margin, which would
   push the rail and the brand rule apart. */
.mgc-header > *,
.mgc-header__band > *,
.mgc-header__rail > * { margin-block-start: 0; }

.mgc-header__band {
	padding: var(--mast-band-pad) 0;
}

.mgc-brand {
	max-width: 1320px;
	margin: 0 auto;
	padding: 0 var(--mast-gutter);
	display: flex;
	align-items: center;
	gap: clamp(14px, 1.6vw, 26px);
	text-decoration: none;
	color: inherit;
}
.mgc-brand__mark {
	flex: none;
	height: var(--mast-logo);
	width: auto;
	display: block;
}
/* The lockup already prints "MGC INTERNATIONAL ASSOCIATION" at the size of a
   trademark line; this is the readable version of the same name, set at roughly
   a third of the mark's height as the mockup does. */
.mgc-brand__word {
	font-family: var(--font-heading);
	font-weight: var(--weight-regular);
	font-size: clamp(1.05rem, 2.55vw, 2.5rem);
	line-height: 1;
	letter-spacing: 0.012em;
	text-transform: uppercase;
	color: var(--ink-900);
	white-space: nowrap;
}
.mgc-brand__word-lead { font-weight: var(--weight-bold); }

.mgc-header__rail {
	position: relative;
	z-index: 1;
	background: var(--paper-warm);
	border-top: 1px solid var(--border-subtle);
}
.mgc-header__controls {
	max-width: 1320px;
	margin: 0 auto;
	padding: 0 var(--mast-gutter);
	min-height: var(--mast-rail);
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 14px;
}
.mgc-header__cta { flex: none; white-space: nowrap; }
/* mgc.css styles the switcher but leaves it without a focus indicator. */
.mgc-header__rail .mgc-lang a:focus-visible {
	outline: 2px solid var(--focus-ring);
	outline-offset: 1px;
}

/* ---- Navigation ------------------------------------------------------- */
/* Desktop shows the links inline; tablet and phone collapse them into the
   overlay sheet. WordPress's own switch is hard-coded to 600px, so the two
   rules that implement it are restated at the theme's 1024px tablet edge in
   the media queries at the foot of this file. */
.mgc-header .wp-block-navigation__responsive-container-open {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 44px;
	height: 44px;
	/* The icon's own side bearing is ~9px; pulling the button out by that much
	   optically aligns the bars with the gutter instead of the button box. */
	margin-right: -9px;
	padding: 0;
	border: 0;
	border-radius: var(--radius-md);
	background: transparent;
	color: var(--ink-900);
	cursor: pointer;
	transition: background var(--duration-fast) var(--ease-standard),
		color var(--duration-fast) var(--ease-standard);
}
.mgc-header .wp-block-navigation__responsive-container-open:hover {
	background: var(--ink-100);
	color: var(--color-primary);
}
.mgc-header .wp-block-navigation__responsive-container-open:focus-visible {
	outline: 3px solid var(--focus-ring);
	outline-offset: 2px;
}
.mgc-header .wp-block-navigation__responsive-container-open svg {
	width: 26px;
	height: 26px;
	fill: currentColor;
}

/* The sheet's ink ground is set through the block's customOverlayBackgroundColor
   attribute, not here: core paints a white default from
   `.wp-block-navigation:not(.has-background) …:not(.disable-default-overlay)`,
   which outranks any selector this stylesheet can reasonably write. */
.mgc-header .wp-block-navigation__responsive-container.is-menu-open {
	padding: 0;
	animation: mgc-nav-sheet-in var(--duration-base) var(--ease-standard);
}
/* The brand rule carries over onto the sheet. */
.mgc-header .wp-block-navigation__responsive-container.is-menu-open::before {
	content: "";
	position: absolute;
	inset: 0 0 auto 0;
	height: var(--rule-brand);
	background: var(--red-500);
}
.mgc-header .is-menu-open .wp-block-navigation__responsive-container-close {
	position: absolute;
	top: 20px;
	right: calc(var(--mast-gutter) - 9px);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: var(--radius-md);
	background: transparent;
	color: #fff;
	cursor: pointer;
	transition: background var(--duration-fast) var(--ease-standard);
}
.mgc-header .is-menu-open .wp-block-navigation__responsive-container-close:hover {
	background: rgba(255, 255, 255, 0.14);
}
.mgc-header .is-menu-open .wp-block-navigation__responsive-container-close:focus-visible {
	outline: 3px solid var(--gold-500);
	outline-offset: 2px;
}
.mgc-header .is-menu-open .wp-block-navigation__responsive-container-close svg {
	width: 26px;
	height: 26px;
	fill: currentColor;
}
.mgc-header .is-menu-open .wp-block-navigation__responsive-close,
.mgc-header .is-menu-open .wp-block-navigation__responsive-dialog {
	width: 100%;
	height: 100%;
}
.mgc-header .is-menu-open .wp-block-navigation__responsive-container-content {
	width: 100%;
	height: 100%;
	max-width: 1320px;
	margin: 0 auto;
	/* Top padding clears the close button. */
	padding: 88px var(--mast-gutter) 56px;
	align-items: flex-start;
	justify-content: flex-start;
	overflow-y: auto;
}
/* Auto block margins centre the list when the viewport has room and collapse to
   normal scrolling when it does not — `justify-content: center` would push the
   first items out of reach on a short screen. */
.mgc-header .is-menu-open .wp-block-navigation__container {
	flex-direction: column;
	align-items: flex-start;
	gap: 0;
	width: 100%;
	/* `flex: none` keeps the list at its content height; without it the list
	   stretches to fill the sheet and the auto margins have no slack to centre. */
	flex: none;
	height: auto;
	margin-block: auto;
}
.mgc-header .is-menu-open .wp-block-navigation-item__content {
	display: block;
	padding: 6px 0;
	font-family: var(--font-heading);
	font-weight: var(--weight-semibold);
	font-size: clamp(1.6rem, 4.6vw, 2.75rem);
	line-height: 1.18;
	letter-spacing: -0.015em;
	color: #fff;
	text-decoration: none;
	transition: color var(--duration-base) var(--ease-standard);
}
.mgc-header .is-menu-open .wp-block-navigation-item__content:hover,
.mgc-header .is-menu-open .wp-block-navigation-item__content:focus-visible {
	color: var(--gold-500);
}
.mgc-header .is-menu-open .wp-block-navigation-item__content:focus-visible {
	outline: 3px solid var(--gold-500);
	outline-offset: 4px;
}

/* Opening the sheet is the one authored moment in the chrome: the panel fades
   up and the items resolve out of a blur in reading order. */
@keyframes mgc-nav-sheet-in {
	from { opacity: 0; }
	to { opacity: 1; }
}
@keyframes mgc-nav-item-in {
	from { opacity: 0; transform: translateY(16px); filter: blur(4px); }
	to { opacity: 1; transform: none; filter: blur(0); }
}
.mgc-header .is-menu-open .wp-block-navigation-item {
	animation: mgc-nav-item-in 460ms var(--ease-standard) backwards;
}
.mgc-header .is-menu-open .wp-block-navigation-item:nth-child(1) { animation-delay: 30ms; }
.mgc-header .is-menu-open .wp-block-navigation-item:nth-child(2) { animation-delay: 70ms; }
.mgc-header .is-menu-open .wp-block-navigation-item:nth-child(3) { animation-delay: 110ms; }
.mgc-header .is-menu-open .wp-block-navigation-item:nth-child(4) { animation-delay: 150ms; }
.mgc-header .is-menu-open .wp-block-navigation-item:nth-child(5) { animation-delay: 190ms; }
.mgc-header .is-menu-open .wp-block-navigation-item:nth-child(6) { animation-delay: 230ms; }
.mgc-header .is-menu-open .wp-block-navigation-item:nth-child(7) { animation-delay: 270ms; }
.mgc-header .is-menu-open .wp-block-navigation-item:nth-child(8) { animation-delay: 310ms; }

/* ---- Split hero ------------------------------------------------------- */
.mgc-hero {
	display: grid;
	grid-template-columns: 58fr 42fr;
	align-items: stretch;
}
/* Desktop height is set here rather than left to the tiles. The tile column is
   42% of a full-bleed row, so square tiles made the hero grow with the viewport
   — past 590px on a 1400px screen, which pushed everything below it off the
   fold. The stacked layout below 1025px is unaffected: this floor is far under
   the height the stacked cover and tiles already take. */
@media (min-width: 1025px) {
	/* 460px is the midpoint of the two figures Gabriela sent — 450-500 in her
	   own mail, 420-480 in the brief she forwarded — and the smallest height
	   that still seats two rows of tiles without clipping the longest label.
	   The cover block carries its own min-height in the page content; both
	   read 460 now, and they must be changed together or the larger wins. */
	.mgc-hero { --hero-h: 460px; min-height: var(--hero-h); }
	.mgc-tiles { grid-template-rows: 1fr 1fr; }
}
/* The hero is a flow-layout group in the block markup, so WordPress gives every
   child but the first a block-gap margin-block-start. Once the group is a grid
   that margin becomes a blank strip above the tiles, so it is cleared here. */
.mgc-hero > * { min-width: 0; margin-block-start: 0; }
.mgc-hero__media.wp-block-cover { height: 100%; margin: 0; }

/* Gabriela named two elements to bring down 15-20% with the banner: the
   slogan and the join button. 17%: h1 3rem -> 2.5rem, button onto the --sm
   metrics the header CTA already uses. Scoped to the hero cover so the same
   h1 size elsewhere on the site is untouched.

   The eyebrow is deliberately NOT scaled with them. It is gold on the dimmed
   photo and measures 3.13:1 against the lightest pixel behind it — already
   under the 4.5:1 that WCAG asks of text this size — so shrinking it would
   make the one element on the banner that is hardest to read smaller still.
   She asked for the banner text to be checked for legibility in the same
   mail, which is the opposite instruction. */
.mgc-hero__media h1 {
	font-size: 2.5rem;
	margin-top: 8px;
	margin-bottom: 14px;
}
.mgc-hero__media .mgc-btn {
	padding: 6px 14px;
	min-height: 34px;
	font-size: var(--text-sm);
}

/* ---- Tile grid -------------------------------------------------------- */
.mgc-tiles {
	display: grid;
	grid-template-columns: 1fr 1fr;
}
.mgc-tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 16px;
	text-align: center;
	text-decoration: none;
	transition: background var(--duration-base) var(--ease-standard);
}
.mgc-tile svg {
	width: 96px;
	height: 96px;
	transition: transform var(--duration-base) var(--ease-standard);
}
.mgc-tile:hover svg { transform: translateY(-2px); }
.mgc-tile__label {
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: var(--text-xl);
	letter-spacing: 0.02em;
	line-height: 1.2;
}
.mgc-tile:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }

.mgc-tile--red  { background: var(--red-500);  color: #fff; }
.mgc-tile--red:hover  { background: var(--red-600);  color: #fff; }
.mgc-tile--ink  { background: var(--ink-900);  color: #fff; }
.mgc-tile--ink:hover  { background: var(--ink-800);  color: #fff; }
.mgc-tile--blue { background: var(--blue-500); color: #fff; }
.mgc-tile--blue:hover { background: var(--blue-600); color: #fff; }
/* Gold carries ink, not white: white on #EDD900 measures ~1.6:1 and fails AA. */
.mgc-tile--gold { background: var(--gold-500); color: var(--ink-900); }
.mgc-tile--gold:hover { background: var(--gold-600); color: var(--ink-900); }
.mgc-tile--gold:focus-visible { outline-color: var(--ink-900); }

/* ---- Button variant for use on the hero photo ------------------------- */
.mgc-btn--onphoto {
	background: #fff;
	color: var(--ink-900);
	border-color: #fff;
}
.mgc-btn--onphoto:hover {
	background: var(--ink-100);
	border-color: var(--ink-100);
	color: var(--ink-900);
}

/* ---- Three-up row ----------------------------------------------------- */
/* The last item's rule would otherwise dangle above the "Сите →" link. */
.mgc-threeup .mgc-threeup__item:last-of-type { border-bottom: none; }
.mgc-threeup__col .wp-block-heading {
	font-size: var(--text-2xl);
	margin: 0 0 4px;
}
.mgc-threeup__item {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	padding: 14px 0;
	border-bottom: 1px solid var(--border-subtle);
}
.mgc-threeup__item .wp-block-post-featured-image {
	flex: none;
	width: 96px;
	margin: 0;
}
.mgc-threeup__item .wp-block-post-featured-image img {
	width: 96px;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: var(--radius-md);
}
.mgc-threeup__item .wp-block-post-title {
	margin: 0 0 4px;
	font-size: var(--text-base);
	line-height: 1.35;
}
.mgc-threeup__more {
	display: inline-block;
	margin-top: 14px;
	font-family: var(--font-heading);
	font-weight: 600;
	font-size: var(--text-sm);
	color: var(--color-primary);
	text-decoration: none;
}
.mgc-threeup__more:hover { text-decoration: underline; }

/* ---- Footer social row ------------------------------------------------ */
.mgc-social {
	display: flex;
	gap: 10px;
	align-items: center;
	margin-top: 18px;
}
.mgc-social a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: var(--radius-full);
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	transition: background var(--duration-fast) var(--ease-standard);
}
.mgc-social a:hover { background: var(--red-500); color: #fff; }
.mgc-social svg { width: 18px; height: 18px; fill: currentColor; }

/* ---- Responsive ------------------------------------------------------- */
/* max-width: 1024px so the tablet breakpoint (1024px viewport, e.g. iPad
   landscape) gets the stacked hero and 4:3 tiles, not the desktop split —
   at max-width:1023px a 1024px-wide viewport fell through to the desktop
   58fr/42fr hero with square tiles, which overflowed horizontally. */
@media (max-width: 1024px) {
	.mgc-hero { grid-template-columns: 1fr; }
	.mgc-tile { aspect-ratio: 4 / 3; }
	.mgc-tile svg { width: 76px; height: 76px; }
}
/* Core switches the navigation to its inline form at 600px. Between 600px and
   the theme's tablet edge those two rules are reversed so the sheet keeps
   running: the inline list stays hidden and the hamburger stays shown. Both
   selectors carry one class more than core's, and this file loads after
   wp-includes/blocks/navigation, so they win on specificity and order alike. */
@media (min-width: 600px) and (max-width: 1024px) {
	.mgc-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none;
	}
	.mgc-header .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}
}
/* Desktop: the links lead the rail and the utilities settle against the right
   edge, so the eye meets navigation before the call to action. */
@media (min-width: 1025px) {
	.mgc-header .mgc-nav { order: -1; margin-right: auto; }
	.mgc-header .wp-block-navigation__responsive-container-open { display: none; }
}
@media (max-width: 900px) {
	.wp-site-blocks > header.wp-block-template-part { --mast-rail: 54px; --mast-gutter: 20px; }
}
/* Below this the typeset wordmark would crowd the mark, and the lockup carries
   the name on its own. */
@media (max-width: 720px) {
	.mgc-brand__word { display: none; }
}
@media (max-width: 600px) {
	.mgc-tile { aspect-ratio: 1; padding: 12px; }
	.mgc-tile svg { width: 58px; height: 58px; }
	/* Label stays at --text-xl (20px/700) at every width: below ~18.66px
	   bold it drops out of WCAG's "large text" bucket, and white-on-blue
	   (#2A94D0, 3.36:1) only clears AA as large text — shrinking it here
	   would fail contrast on the blue tile at mobile widths. */
}
/* The rail has to seat four language codes, the join button and the menu on a
   phone, so its own spacing tightens before anything is dropped. */
@media (max-width: 480px) {
	.wp-site-blocks > header.wp-block-template-part { --mast-gutter: 16px; }
	.mgc-header__controls { gap: 8px; }
	.mgc-header__cta { padding: 6px 12px; }
	.mgc-lang a { padding: 3px 5px; }
}
