/**
 * MGMAC Site Content: section layout and block style variations.
 *
 * Colours use the MGMAC theme's palette presets, with the brand values as
 * fallbacks so the content still looks right under another theme.
 */

:root {
	--mgmac-navy: var(--wp--preset--color--navy, #0a3266);
	--mgmac-navy-dark: var(--wp--preset--color--navy-dark, #003471);
	--mgmac-blue: var(--wp--preset--color--blue, #0054a6);
	--mgmac-maroon: var(--wp--preset--color--maroon, #670603);
	--mgmac-surface: var(--wp--preset--color--surface, #f4f7fb);
	--mgmac-tint: var(--wp--preset--color--tint, #eaf2fb);
	--mgmac-border: var(--wp--preset--color--gray-light, #e6e6e6);
	--mgmac-text: var(--wp--preset--color--gray-text, #444);
	--mgmac-white: var(--wp--preset--color--white, #fff);
	--mgmac-radius: 8px;
	--mgmac-shadow: 0 1px 2px rgba(10, 50, 102, 0.06), 0 4px 16px rgba(10, 50, 102, 0.08);
	--mgmac-shadow-lift: 0 2px 4px rgba(10, 50, 102, 0.08), 0 10px 28px rgba(10, 50, 102, 0.14);
}

/* Sections ---------------------------------------------------------------- */

.mgmac-section {
	padding-top: clamp(40px, 6vw, 64px);
	padding-bottom: clamp(40px, 6vw, 64px);
}

.mgmac-section--alt {
	background: var(--mgmac-surface);
}

.mgmac-section--tight-bottom {
	padding-bottom: 24px;
}

.mgmac-section--tight-top {
	padding-top: 24px;
}

/* Full-width sections sit flush against each other and the page hero. */
.wp-block-post-content > .mgmac-section,
.wp-block-post-content > .mgmac-home-thanks,
.wp-block-post-content > .is-style-mgmac-slideshow,
.wp-block-post-content > .mgmac-section + *,
.mgmac-page-hero + .wp-block-post-content {
	margin-block-start: 0;
}

.mgmac-section > :first-child,
.is-style-mgmac-card > :first-child,
.is-style-mgmac-highlight > :first-child {
	margin-block-start: 0;
}

.mgmac-heading-tight {
	margin-block-start: 0;
	margin-bottom: 10px;
}

.mgmac-space-above {
	margin-block-start: 32px;
}

.mgmac-space-above-lg {
	margin-block-start: 56px;
}

.mgmac-space-below {
	margin-bottom: 40px;
}

.mgmac-intro {
	max-width: 640px;
	margin-right: auto;
	margin-left: auto;
	margin-bottom: 32px;
}

/* Card / highlight -------------------------------------------------------- */

.is-style-mgmac-card {
	padding: 28px;
	background: var(--mgmac-white);
	border: 1px solid var(--mgmac-border);
	border-radius: var(--mgmac-radius);
	box-shadow: var(--mgmac-shadow);
}

.is-style-mgmac-card .wp-block-heading {
	margin-top: 0;
}

.is-style-mgmac-highlight {
	padding: 32px;
	background: var(--mgmac-surface);
	border-left: 4px solid var(--mgmac-maroon);
	border-radius: var(--mgmac-radius);
}

.is-style-mgmac-highlight .wp-block-heading {
	margin-top: 0;
}

.is-style-mgmac-card .wp-block-quote,
.is-style-mgmac-highlight .wp-block-quote {
	margin: 16px 0;
	padding: 4px 20px;
	border-left: 4px solid var(--mgmac-blue);
	color: var(--mgmac-navy);
	font-style: italic;
}

/* Eyebrow and tag paragraphs ---------------------------------------------- */

p.is-style-mgmac-eyebrow {
	margin-bottom: 8px;
	color: var(--mgmac-maroon);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

p.is-style-mgmac-tag {
	width: fit-content;
	margin-bottom: 12px;
	padding: 4px 12px;
	background: var(--mgmac-maroon);
	border-radius: 999px;
	color: var(--mgmac-white);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

p.mgmac-demo-tag {
	width: fit-content;
	margin-bottom: 10px;
	padding: 3px 10px;
	background: var(--mgmac-tint);
	border-radius: 999px;
	color: var(--mgmac-blue);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

/* People ------------------------------------------------------------------ */

.wp-block-image.is-style-mgmac-avatar img {
	width: 96px;
	height: 96px;
	border-radius: 50%;
	object-fit: cover;
	box-shadow: 0 0 0 3px var(--mgmac-white), 0 0 0 5px var(--mgmac-tint);
}

.mgmac-person .wp-block-heading {
	margin: 0 0 2px;
	font-size: 1.05rem;
}

.mgmac-person .mgmac-person-role {
	margin: 0 0 10px;
	color: var(--mgmac-blue);
	font-size: 0.85rem;
	font-weight: 600;
}

.mgmac-person .mgmac-person-bio {
	margin: 0;
	font-size: 0.88rem;
}

.mgmac-person > * + * {
	margin-block-start: 0;
}

.mgmac-person .wp-block-image {
	margin-bottom: 16px;
}

/* Pricing ----------------------------------------------------------------- */

.mgmac-pricing {
	align-items: stretch;
}

.mgmac-price-card > * {
	margin-block: 0;
}

.mgmac-price-card .wp-block-heading {
	margin-bottom: 4px;
}

.mgmac-price-card.is-featured {
	border-color: var(--mgmac-navy);
	box-shadow: var(--mgmac-shadow-lift);
	transform: translateY(-6px);
}

.mgmac-price-via {
	font-size: 0.88rem;
}

.mgmac-price-card .mgmac-price-via {
	margin-bottom: 8px;
}

.mgmac-price {
	margin: 8px 0 4px;
	color: var(--mgmac-navy);
	font-size: 2rem;
	font-weight: 800;
	line-height: 1.2;
}

.mgmac-price-note {
	margin-bottom: 20px;
	font-size: 0.85rem;
}

@media (max-width: 900px) {
	.mgmac-price-card.is-featured {
		transform: none;
	}
}

/* Preview form ------------------------------------------------------------ */

.mgmac-join-card {
	max-width: 420px;
}

.mgmac-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.mgmac-form label {
	display: flex;
	flex-direction: column;
	gap: 6px;
	color: var(--mgmac-navy);
	font-size: 0.9rem;
	font-weight: 600;
}

.mgmac-form input {
	padding: 10px 12px;
	border: 1px solid #cbd5e1;
	border-radius: var(--mgmac-radius);
	font: inherit;
}

.mgmac-form input:focus {
	outline: 2px solid var(--mgmac-blue);
	outline-offset: 1px;
}

.mgmac-form button {
	align-self: flex-start;
	cursor: pointer;
}

/* Logo grid gallery ------------------------------------------------------- */

.wp-block-gallery.is-style-mgmac-logo-grid {
	--wp--style--unstable-gallery-gap: 20px;
	gap: 20px;
}

.wp-block-gallery.is-style-mgmac-logo-grid .wp-block-image {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 110px;
	padding: 20px;
	background: var(--mgmac-white);
	border: 1px solid var(--mgmac-border);
	border-radius: var(--mgmac-radius);
}

.wp-block-gallery.is-style-mgmac-logo-grid .wp-block-image {
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.wp-block-gallery.is-style-mgmac-logo-grid .wp-block-image:has(a):hover,
.wp-block-gallery.is-style-mgmac-logo-grid .wp-block-image:has(a:focus-visible) {
	border-color: var(--mgmac-tint);
	box-shadow: var(--mgmac-shadow-lift);
	transform: translateY(-2px);
}

.wp-block-gallery.is-style-mgmac-logo-grid .wp-block-image a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.wp-block-gallery.is-style-mgmac-logo-grid.has-nested-images figure.wp-block-image img {
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: 100%;
	object-fit: contain;
}

.wp-block-gallery.mgmac-logo-grid--pair {
	max-width: 460px;
	margin-right: auto;
	margin-left: auto;
}

/* Accordion (details block) ----------------------------------------------- */

.wp-block-details.is-style-mgmac-accordion {
	margin-bottom: 12px;
	overflow: hidden;
	border: 1px solid var(--mgmac-border);
	border-radius: var(--mgmac-radius);
}

.wp-block-details.is-style-mgmac-accordion + .wp-block-details.is-style-mgmac-accordion {
	margin-block-start: 0;
}

.wp-block-details.is-style-mgmac-accordion summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	background: var(--mgmac-surface);
	color: var(--mgmac-navy);
	font-weight: 700;
	list-style: none;
	cursor: pointer;
}

.wp-block-details.is-style-mgmac-accordion summary {
	transition: background-color 0.15s ease;
}

.wp-block-details.is-style-mgmac-accordion summary:hover {
	background: var(--mgmac-tint);
}

.wp-block-details.is-style-mgmac-accordion summary::-webkit-details-marker {
	display: none;
}

.wp-block-details.is-style-mgmac-accordion summary::after {
	content: "+";
	color: var(--mgmac-blue);
	font-size: 1.2rem;
}

.wp-block-details.is-style-mgmac-accordion[open] summary::after {
	content: "\2212";
}

.wp-block-details.is-style-mgmac-accordion > :not(summary) {
	margin: 0;
	padding: 16px 20px 20px;
	font-size: 0.92rem;
}

/* Table ------------------------------------------------------------------- */

.wp-block-table.is-style-mgmac-simple {
	overflow: hidden;
	background: var(--mgmac-white);
	border: 1px solid var(--mgmac-border);
	border-radius: var(--mgmac-radius);
	box-shadow: var(--mgmac-shadow);
}

.wp-block-table.is-style-mgmac-simple table {
	border-collapse: collapse;
}

.wp-block-table.is-style-mgmac-simple thead {
	border-bottom: 0;
}

.wp-block-table.is-style-mgmac-simple th,
.wp-block-table.is-style-mgmac-simple td {
	padding: 12px 16px;
	border: 0;
	border-bottom: 1px solid var(--mgmac-border);
	font-size: 0.92rem;
	text-align: left;
}

.wp-block-table.is-style-mgmac-simple tbody tr:nth-child(even) {
	background: #fafbfd;
}

.wp-block-table.is-style-mgmac-simple tbody tr:hover {
	background: var(--mgmac-tint);
}

.wp-block-table.is-style-mgmac-simple tbody tr:last-child td {
	border-bottom: 0;
}

.wp-block-table.is-style-mgmac-simple th {
	color: var(--mgmac-navy);
	font-size: 0.78rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

/* Home "thanks" strip ----------------------------------------------------- */

.mgmac-home-thanks {
	padding-top: 24px;
	padding-bottom: 24px;
	background: var(--mgmac-navy-dark);
	color: var(--mgmac-white);
}

.mgmac-home-thanks .wp-block-image {
	margin: 0;
}

.mgmac-linkedin-badge img {
	display: block;
	width: 48px;
	height: auto;
}

.mgmac-thanks {
	gap: 10px;
}

.mgmac-thanks p {
	margin: 0;
}

.mgmac-thanks-logo img {
	display: block;
	width: auto;
	height: 28px;
	padding: 2px 6px;
	background: var(--mgmac-white);
	border-radius: 4px;
}

/* Slideshow gallery ------------------------------------------------------- */

/*
 * Core gallery rules target figure.wp-block-image:not(#individual-image),
 * which has ID-level specificity, so the slide rules below repeat it.
 *
 * Without JavaScript (and in the editor) this is an ordinary gallery.
 * slideshow.js adds .is-mgmac-slideshow-ready and the controls.
 */
.wp-block-gallery.is-style-mgmac-slideshow.is-mgmac-slideshow-ready {
	position: relative;
	display: block;
	/* 16:9 of the viewport width, clamped. Not aspect-ratio: with a max-height
	   that would also cap the width and break the full-width alignment. */
	height: clamp(320px, 56.25vw, 560px);
	overflow: hidden;
	background: var(--mgmac-navy-dark);
	gap: 0;
}

.is-mgmac-slideshow-ready.is-style-mgmac-slideshow.wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) {
	position: absolute;
	inset: 0;
	width: 100%;
	margin: 0;
	opacity: 0;
	transition: opacity 1s ease;
}

.is-mgmac-slideshow-ready.is-style-mgmac-slideshow.wp-block-gallery.has-nested-images figure.wp-block-image.is-active:not(#individual-image) {
	z-index: 1;
	opacity: 1;
}

/* Blurred copy of the photo behind it, so portrait shots are letterboxed. */
.is-mgmac-slideshow-ready.is-style-mgmac-slideshow.wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image)::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: var(--mgmac-slide-bg);
	background-position: center;
	background-size: cover;
	filter: blur(28px) brightness(0.55) saturate(1.1);
	transform: scale(1.15);
}

.is-mgmac-slideshow-ready.is-style-mgmac-slideshow.wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) img {
	position: relative;
	z-index: 1;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/* Soft gradient behind the dots so they read on bright photos. */
.wp-block-gallery.is-style-mgmac-slideshow.is-mgmac-slideshow-ready::after {
	content: "";
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 2;
	height: 96px;
	background: linear-gradient(to bottom, rgba(0, 20, 50, 0), rgba(0, 20, 50, 0.45));
	pointer-events: none;
}

.mgmac-slideshow-arrow,
.mgmac-slideshow-toggle {
	position: absolute;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(3, 12, 26, 0.35);
	color: #fff;
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s ease;
}

.mgmac-slideshow-arrow {
	top: 50%;
	transform: translateY(-50%);
}

.mgmac-slideshow-arrow:hover,
.mgmac-slideshow-arrow:focus-visible,
.mgmac-slideshow-toggle:hover,
.mgmac-slideshow-toggle:focus-visible {
	background: rgba(3, 12, 26, 0.6);
}

.mgmac-slideshow-arrow.is-prev {
	left: 16px;
}

.mgmac-slideshow-arrow.is-next {
	right: 16px;
}

.mgmac-slideshow-toggle {
	right: 16px;
	bottom: 10px;
	width: 32px;
	height: 32px;
	font-size: 0.85rem;
}

.mgmac-slideshow-dots {
	position: absolute;
	right: 56px;
	bottom: 16px;
	left: 56px;
	z-index: 3;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
}

.mgmac-slideshow-dot {
	width: 9px;
	height: 9px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.85);
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	cursor: pointer;
	transition: background 0.15s ease, transform 0.15s ease;
}

.mgmac-slideshow-dot[aria-current="true"] {
	background: #fff;
	transform: scale(1.2);
}

@media (max-width: 700px) {
	.wp-block-gallery.is-style-mgmac-slideshow.is-mgmac-slideshow-ready {
		height: clamp(280px, 75vw, 420px);
	}

	.mgmac-slideshow-arrow {
		width: 34px;
		height: 34px;
		font-size: 1.3rem;
	}

	.mgmac-slideshow-dots {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wp-block-gallery.is-style-mgmac-logo-grid .wp-block-image:has(a):hover {
		transform: none;
	}

	.is-mgmac-slideshow-ready.is-style-mgmac-slideshow.wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) {
		transition: none;
	}
}
