/**
 * Maritime SAR interaction and responsive polish.
 */

/* -------- Hover feedback (subtle) -------- */

.wp-block-button__link {
	transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
}
.wp-block-button__link:hover,
.wp-block-button__link:focus-visible {
	transform: translateY(-2px) scale(1.02);
	box-shadow: var(--wp--custom--shadow--md);
}

/* Outline buttons: readable orange text and border on light sections. Outline
   buttons placed on dark/orange bands set their own colour and are left alone. */
.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color) {
	color: var(--wp--preset--color--msar-accent);
	border-color: var(--wp--preset--color--msar-accent);
}
.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color):hover {
	color: #ffffff;
	background-color: var(--wp--preset--color--msar-accent);
}

.msar-card {
	box-shadow: var(--wp--custom--shadow--sm);
	transition: transform .25s ease, box-shadow .25s ease;
}
.msar-card:hover {
	transform: translateY(-6px) scale(1.01);
	box-shadow: var(--wp--custom--shadow--lg);
}

/* -------- Page & archive titles -------- */

/* Short orange rule under a centred page/archive title. */
.msar-page-title::after {
	content: "";
	display: block;
	width: 64px;
	height: 3px;
	background: var(--wp--preset--color--msar-accent);
	border-radius: 2px;
	margin: 18px auto 0;
}
.msar-title-icon {
	display: inline-flex;
	align-items: center;
}
.msar-title-icon svg {
	display: block;
}

/* Header: fluid logo so the logo, hamburger and buttons stay on one line. */
.wp-block-site-logo {
	width: clamp(120px, 30vw, 230px) !important;
}
.wp-block-site-logo img {
	width: 100% !important;
	height: auto !important;
}
@media (max-width: 600px) {
	.msar-login {
		width: 38px;
		height: 38px;
	}
}

/* Primary navigation (from Appearance > Menus). */
header .wp-block-site-logo {
	flex: 0 0 auto;
}
.msar-header-right {
	flex: 1 1 auto;
	min-width: 0;
}
/* Only the menu flexes; the login icon and button keep their width. */
.msar-header-right > .wp-block-buttons,
.msar-header-right > .msar-login {
	flex: 0 0 auto;
}
.msar-nav {
	display: flex;
	align-items: center;
	flex: 1 1 auto;
	min-width: 0;
}
.msar-nav__panel {
	display: flex;
	align-items: center;
	width: 100%;
	min-width: 0;
}
.msar-nav__toggle,
.msar-nav__close {
	display: none;
}
.msar-nav__list {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 28px;
	list-style: none;
	margin: 0;
	padding: 0;
	width: 100%;
	flex-wrap: nowrap;
	/* Hidden until the overflow script runs, then set visible so dropdowns are not clipped. */
	overflow: hidden;
}
.msar-nav--ready .msar-nav__list {
	overflow: visible;
}
.msar-nav__more {
	position: relative;
	flex: 0 0 auto;
}
.msar-nav__more-toggle {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	font: inherit;
	font-weight: 600;
	font-size: 16px;
	color: var(--wp--preset--color--msar-fg);
	transition: color .2s ease;
}
.msar-nav__more-toggle:hover {
	color: var(--wp--preset--color--msar-accent);
}
.msar-nav__more > .sub-menu {
	left: auto;
	right: 0;
}
.msar-nav__more:hover > .sub-menu,
.msar-nav__more:focus-within > .sub-menu,
.msar-nav__more--open > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.msar-nav__list a {
	display: block;
	text-decoration: none;
	color: var(--wp--preset--color--msar-fg);
	font-weight: 600;
	font-size: 16px;
	transition: color .2s ease;
}
.msar-nav__list a:hover,
.msar-nav__list a:focus-visible,
.msar-nav__list .current-menu-item > a {
	color: var(--wp--preset--color--msar-accent);
}
.msar-nav__list li {
	position: relative;
}
.msar-nav__list .sub-menu {
	position: absolute;
	left: 0;
	top: 100%;
	min-width: 210px;
	list-style: none;
	margin: 0;
	padding: 8px 0;
	background: #ffffff;
	border-radius: var(--wp--custom--radius--sm);
	box-shadow: var(--wp--custom--shadow--lg);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity .2s ease, transform .2s ease, visibility .2s;
	z-index: 60;
}
.msar-nav__list li:hover > .sub-menu,
.msar-nav__list li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.msar-nav__list .sub-menu a {
	padding: 9px 20px;
	font-weight: 500;
}

/* -------- Hero -------- */

.msar-hero-grid {
	display: flex;
	flex-direction: column;
	gap: clamp(1.25rem, 4vw, 3rem);
}
.msar-hero-img {
	margin: 0;
	border-radius: var(--wp--custom--radius--lg);
	box-shadow: var(--wp--custom--shadow--lg);
}
@media (min-width: 900px) {
	.msar-hero-grid {
		flex-direction: row;
		align-items: center;
		gap: clamp(2rem, 4vw, 3.5rem);
	}
	.msar-hero-text {
		flex: 1 1 0;
		min-width: 0;
		justify-content: center;
	}
	.msar-hero-img {
		flex: 1.12 1 0;
		min-width: 0;
	}
}
@media (max-width: 899px) {
	/* Unwrap the text group so the buttons can sit after the image. */
	.msar-hero-text {
		display: contents !important;
	}
	.msar-hero-img {
		order: 3;
	}
	.msar-hero-actions {
		order: 4;
	}
}

/* -------- Partners -------- */

.msar-marquee .msar-partner {
	height: calc(var(--msar-h, 48) * 1.2px);
	max-width: 300px;
}

/* -------- Footer -------- */

/* Links flush-left directly under the column headings (no bullets/indent). */
.msar-footer-list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.msar-footer-list li {
	margin: 0;
	padding: 0;
}
/* Footer column links: comfortable tap area and an orange hover. */
.msar-footer-cols a {
	text-decoration: none;
	transition: color .2s ease;
}
.msar-footer-cols a:hover {
	color: var(--wp--preset--color--msar-accent);
}
.msar-footer-list a {
	display: inline-block;
	padding: 5px 0;
}

/* Rebalanced footer: a wider brand column (logo/blurb/social) and three narrower
   link columns, with all content centred. */
.msar-footer-cols {
	grid-template-columns: 1.6fr 1fr 1fr 1fr !important;
	align-items: start;
	text-align: center;
}
/* Centre the logo within the brand column. */
footer .wp-block-site-logo {
	margin-left: auto;
	margin-right: auto;
}

/* Social icons centred under the logo, with the same hover lift as the buttons. */
footer .wp-block-social-links {
	margin-top: 16px;
	justify-content: center;
}
footer .wp-block-social-link {
	transition: transform .2s ease;
}
footer .wp-block-social-link:hover {
	transform: translateY(-2px) scale(1.05);
}

/* Bottom bar: keep the copyright and "built by" credit on one aligned row. */
/* Bottom bar: copyright centred with the "built by" credit centred beneath it. */
.msar-footer-bar {
	flex-direction: column !important;
	align-items: center;
	text-align: center;
	row-gap: 10px;
}
.msar-footer-bar p {
	margin: 0;
}

/* -------- Courses -------- */

/* "View course" link on the course cards. */
.wp-block-query .wp-block-read-more,
.wp-block-read-more {
	display: inline-block;
	color: var(--wp--preset--color--msar-accent) !important;
	-webkit-text-fill-color: var(--wp--preset--color--msar-accent) !important;
	font-weight: 700;
	text-decoration: none;
}
.wp-block-read-more:hover {
	text-decoration: underline;
}

/* Course cards: vertically centred content. */
.msar-course-card {
	display: flex;
	flex-direction: column;
	height: 100%;
}
.msar-course-body {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	align-items: center;
	text-align: center;
}
/* Keep course titles compact so a long course name (with IMO refs) no longer
   towers over the card; equal-height cards + bottom-aligned CTA do the rest. */
.msar-course-body .wp-block-post-title {
	margin: 0;
	/* !important to beat WordPress's has-large-font-size preset class. */
	font-size: 1.2rem !important;
	line-height: 1.3;
}
/* Push the "View course" link to the bottom so it lines up across cards of
   differing content length (with equal-height cards from the grid). */
.msar-course-body .wp-block-read-more {
	margin-top: auto;
	/* padding, not margin, so there is always a gap below the title even on the
	   tallest card where the auto margin collapses to nothing. */
	padding-top: 18px;
}
/* Hide empty meta lines (dates/location) and the "From <price>" row until a
   price is entered, so cards never show a stray "From" or a blank gap. */
.msar-course-body > p:empty {
	display: none;
}
.msar-course-body > .wp-block-group:has(p:empty) {
	display: none;
}

/* -------- News cards (homepage "Latest news", the /news archive and "More news") -------- */
/* A news card is any post-template card that carries an excerpt (course cards do not),
   so this styles them consistently without needing per-template classes. */
.wp-block-post > .wp-block-group:not(.msar-course-card):has(.wp-block-post-excerpt) {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	border-radius: var(--wp--custom--radius--md);
	background: var(--wp--preset--color--msar-bg-alt);
}
.wp-block-post > .wp-block-group:not(.msar-course-card):has(.wp-block-post-excerpt) > .wp-block-group {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 12px;
}
/* Styled date, matching the accent eyebrow used elsewhere. */
.wp-block-post > .wp-block-group:not(.msar-course-card):has(.wp-block-post-excerpt) .wp-block-post-date {
	margin: 0;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	color: var(--wp--preset--color--msar-accent);
}
.wp-block-post > .wp-block-group:not(.msar-course-card):has(.wp-block-post-excerpt) .wp-block-post-title {
	margin: 0;
	/* !important to beat WordPress's has-large-font-size preset class. */
	font-size: 1.2rem !important;
	line-height: 1.3;
}
/* The title text sits inside an <a>, so the line-clamp has to go on the link,
   not the heading, or it never takes effect. */
.wp-block-post > .wp-block-group:not(.msar-course-card):has(.wp-block-post-excerpt) .wp-block-post-title a {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.wp-block-post > .wp-block-group:not(.msar-course-card):has(.wp-block-post-excerpt) .wp-block-post-excerpt {
	margin: 0;
	color: var(--wp--custom--fg-muted);
}
/* Keep the excerpt to a tidy few lines so the cards stay uniform. */
.wp-block-post > .wp-block-group:not(.msar-course-card):has(.wp-block-post-excerpt) .wp-block-post-excerpt__excerpt {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
/* Push the read-more link to the bottom so it lines up across cards. */
.wp-block-post > .wp-block-group:not(.msar-course-card):has(.wp-block-post-excerpt) .wp-block-post-excerpt__more-link {
	display: inline-block;
	margin-top: 10px;
	font-weight: 700;
	/* Match the "View course" link size (16px) so both cards read the same. */
	font-size: 16px;
	/* Inline !important + text-fill-color needed to beat GoDaddy's injected reset. */
	color: var(--wp--preset--color--msar-accent) !important;
	-webkit-text-fill-color: var(--wp--preset--color--msar-accent) !important;
}
/* Card thumbnails in every listing (course cards + news cards, on the home page,
   the Training page, /courses and /news): a uniform 16:9 window with the photo
   cropped and centred, whatever shape the original image is. Scoping to the query
   loop leaves single-post/course hero images untouched. */
.wp-block-query .wp-block-post-featured-image {
	position: relative;
	margin: 0;
	width: 100%;
	max-width: none;
	aspect-ratio: 16 / 9;
	overflow: hidden;
}
.wp-block-query .wp-block-post-featured-image img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

/* Single course / news hero image: a tidy, contained size rather than a huge banner,
   aligned to the same width as the course details panel below it. */
.wp-block-post-featured-image.msar-single-hero {
	max-width: 860px;
	margin-left: auto;
	margin-right: auto;
}

/* Course details panel on the single course page: a light, readable spec card
   (label column + value column), rather than a heavy solid-orange block. */
.msar-course-details {
	max-width: 860px;
	margin: 0 auto;
	background: var(--wp--preset--color--msar-bg-alt);
	color: var(--wp--preset--color--msar-fg);
	border: 1px solid rgba(var(--wp--custom--accent-rgb), .18);
	border-radius: var(--wp--custom--radius--md);
	padding: clamp(1.5rem, 4vw, 2.25rem);
}
.msar-course-details__title {
	margin: 0 0 10px;
	font-size: var(--wp--preset--font-size--medium);
	color: var(--wp--preset--color--msar-accent);
}
.msar-course-details__list {
	list-style: none;
	margin: 0 0 22px;
	padding: 0;
}
.msar-course-details__list li {
	display: grid;
	grid-template-columns: minmax(130px, 32%) 1fr;
	gap: 4px 22px;
	padding: 13px 0;
	border-bottom: 1px solid rgba(0, 0, 0, .08);
}
.msar-course-details__list li:last-child {
	border-bottom: none;
}
.msar-course-details__list span {
	color: var(--wp--preset--color--msar-accent);
	font-size: 0.82em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	padding-top: 2px;
}
.msar-course-details__list strong {
	color: var(--wp--preset--color--msar-fg);
	font-weight: 600;
	line-height: 1.5;
}
@media (max-width: 600px) {
	.msar-course-details__list li {
		grid-template-columns: 1fr;
		gap: 2px;
	}
}
.msar-course-book {
	display: inline-block;
	background: var(--wp--preset--color--msar-accent);
	color: #ffffff;
	font-weight: 700;
	padding: 12px 32px;
	border-radius: 50px;
	text-decoration: none;
	transition: transform .2s ease, box-shadow .2s ease;
}
.msar-course-book:hover {
	transform: translateY(-2px);
	box-shadow: var(--wp--custom--shadow--md);
}

/* -------- Membership benefits checklist -------- */

.msar-benefits {
	list-style: none;
	margin: 0;
	padding: 0;
}
.msar-benefits li {
	position: relative;
	padding-left: 34px;
	margin-bottom: 14px;
	line-height: 1.5;
}
.msar-benefits li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 2px;
	width: 20px;
	height: 20px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F57521' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* Membership grade cards: centred content, tidy list, smaller monthly price. */
.msar-grade {
	text-align: center;
	/* Top-align the content so titles and prices line up across every card. */
	justify-content: flex-start !important;
}
/* Equal-height cards across each row, sized and centring a partial last row. */
.msar-grades {
	align-items: stretch;
}
.msar-grades > .msar-grade {
	flex: 1 1 20rem;
	max-width: 24rem;
	/* Uniform height across all cards regardless of how much content each holds
	   (floor clears the tallest card, the three-benefit Member grade). */
	min-height: 30rem;
}
/* Full-bleed banner should sit flush against the sections above and below it. */
.msar-banner {
	margin-top: 0;
	margin-bottom: 0;
}
.msar-grade .wp-block-list {
	list-style: disc;
	text-align: left;
	margin: 0;
	padding-left: 1.25em;
}
.msar-grade .wp-block-list li {
	margin-bottom: 6px;
}
.msar-grade__month {
	font-size: 0.78em;
	opacity: 0.7;
}

/* -------- Privacy "in short" callout -------- */

.msar-inshort {
	border-left: 3px solid var(--wp--preset--color--msar-accent);
	border-radius: 0 var(--wp--custom--radius--sm) var(--wp--custom--radius--sm) 0;
	padding: 12px 18px;
	background: var(--wp--preset--color--msar-bg-alt);
	color: var(--wp--custom--fg-muted);
	font-style: italic;
}

/* Privacy / legal pages: clearer separation above each numbered section. */
.msar-legal h2.wp-block-heading {
	margin-top: clamp(1.75rem, 4vw, 2.75rem);
}

/* Testimonial quote (case studies). display:flow-root keeps it a tidy padded
   callout even when it sits beside a floated case-study photo. */
.msar-quote {
	display: flow-root;
	margin: clamp(1.25rem, 3vw, 1.75rem) 0;
	border-left: 3px solid var(--wp--preset--color--msar-accent);
	border-radius: 0 var(--wp--custom--radius--sm) var(--wp--custom--radius--sm) 0;
	padding: clamp(0.9rem, 2.5vw, 1.25rem) clamp(1.1rem, 3vw, 1.5rem);
	background: rgba(var(--wp--custom--accent-rgb), .05);
	font-size: 1.05rem;
	font-style: italic;
	color: var(--wp--custom--fg-muted);
}
.msar-quote cite {
	display: block;
	margin-top: 12px;
	font-style: normal;
	font-weight: 700;
	color: var(--wp--preset--color--msar-fg);
}

/* Case study: a wide photo banner (the focal point) sits on top of the card,
   with the copy flowing beneath it, so the image is prominent and balanced. */
.wp-block-columns.msar-casestudy {
	display: flex;
	flex-direction: column;
	gap: clamp(1.25rem, 3vw, 1.75rem);
	padding: clamp(1.5rem, 4vw, 2.25rem);
	background: var(--wp--preset--color--msar-bg-alt);
	border-radius: var(--wp--custom--radius--lg);
}
.wp-block-columns.msar-casestudy > .wp-block-column {
	width: 100% !important;
	flex-basis: auto !important;
	min-width: 0;
}
.wp-block-columns.msar-casestudy figure.wp-block-image {
	width: 100%;
	margin: 0;
}
.wp-block-columns.msar-casestudy figure.wp-block-image img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: var(--wp--custom--radius--md);
}
.wp-block-columns.msar-casestudy .msar-imgph {
	aspect-ratio: 16 / 9;
	min-height: 0;
}
/* "CASE STUDY" eyebrow label above the case-study title. */
.msar-cs-label {
	margin-bottom: 6px;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: var(--wp--preset--color--msar-accent);
}
/* Portrait case-study photo: floats beside the copy so the text wraps around it,
   rather than being cropped into the wide banner the other case studies use. */
.msar-cs-portrait {
	display: flow-root;
	padding: clamp(1.5rem, 4vw, 2.25rem);
	background: var(--wp--preset--color--msar-bg-alt);
	border-radius: var(--wp--custom--radius--lg);
}
.msar-cs-portrait .wp-block-image.alignleft {
	float: left;
	width: min(300px, 40%);
	margin: 4px clamp(1.25rem, 3vw, 1.75rem) 1rem 0;
}
.msar-cs-portrait .wp-block-image.alignleft img {
	width: 100%;
	height: auto;
}
@media (max-width: 600px) {
	/* Drop the photo to full width on narrow screens instead of a cramped float. */
	.msar-cs-portrait .wp-block-image.alignleft {
		float: none;
		width: 100%;
		margin: 0 0 1.25rem;
	}
}

/* Highlighted panel for a list sitting on the dark Organisation Membership band. */
.msar-access-box {
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: var(--wp--custom--radius--md);
	margin: clamp(1.5rem, 3.5vw, 2.25rem) auto;
	text-align: center;
}
/* Centre the box's intro line but keep the checklist itself left-aligned as a group. */
.msar-access-box .wp-block-list {
	display: inline-block;
	text-align: left;
}

/* -------- Content pages: "coming soon" placeholders -------- */

.msar-placeholder {
	border: 2px dashed #d9d9d9;
	border-radius: var(--wp--custom--radius--md);
	padding: 40px 32px;
	text-align: center;
	color: #7a7a7a;
	background: #fafafa;
	font-style: italic;
}
.msar-placeholder strong {
	display: block;
	margin-bottom: 6px;
	color: var(--wp--preset--color--msar-stroke);
	font-style: normal;
}

/* Image placeholder; swap the wp:html block for an Image or Cover block once the photo is ready. */
.msar-imgph {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	width: 100%;
	aspect-ratio: 4 / 3;
	min-height: 220px;
	border-radius: var(--wp--custom--radius--md);
	border: 1px solid rgba(var(--wp--custom--accent-rgb), .16);
	background:
		radial-gradient(120% 120% at 15% 10%, rgba(var(--wp--custom--accent-rgb), .12), rgba(var(--wp--custom--accent-rgb), 0) 55%),
		linear-gradient(135deg, #fff4ec 0%, var(--wp--preset--color--msar-bg-alt) 100%);
	color: #c07a41;
	text-align: center;
	box-shadow: var(--wp--custom--shadow--md);
	overflow: hidden;
}
.msar-imgph svg {
	width: 46px;
	height: 46px;
	opacity: .8;
}
.msar-imgph span {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	opacity: .75;
}
.msar-imgph--band {
	aspect-ratio: auto;
	min-height: 320px;
	border-radius: var(--wp--custom--radius--lg);
}
.msar-imgph--tall {
	aspect-ratio: 3 / 4;
}

/* -------- Reusable icon badge -------- */

.msar-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: rgba(var(--wp--custom--accent-rgb), .12);
	color: var(--wp--preset--color--msar-accent);
	flex: 0 0 auto;
}
.msar-icon svg {
	width: 28px;
	height: 28px;
}

/* -------- Audience / feature cards -------- */

.msar-tile {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	height: 100%;
	padding: 30px 28px;
	border-radius: var(--wp--custom--radius--md);
	background: #ffffff;
	border: 1px solid #eee;
	text-align: center;
}
.msar-tile h3 {
	margin: 0;
}
.msar-tile p {
	margin: 0;
	color: var(--wp--custom--fg-muted);
}
.msar-tile .msar-tile__link {
	margin-top: auto;
	font-weight: 700;
	color: var(--wp--preset--color--msar-accent);
	text-decoration: none;
}
.msar-tile .msar-tile__link:hover {
	text-decoration: underline;
}
/* Make the whole audience card clickable via the "Learn more" link. */
.msar-tile .msar-tile__link a::after {
	content: "";
	position: absolute;
	inset: 0;
}

/* -------- Check-marked feature lists -------- */

.msar-benefits.is-2col {
	margin: 0;
}
@media (min-width: 720px) {
	/* Flow the checklist down two even columns (top-to-bottom, then the next column)
	   so every check keeps a consistent vertical rhythm, instead of the ragged rows a
	   two-column grid produces when items wrap to different numbers of lines. */
	.msar-benefits.is-2col {
		column-count: 2;
		column-gap: 44px;
	}
	.msar-benefits.is-2col li {
		break-inside: avoid;
	}
}

/* -------- FAQ accordion (built by the [maritime_sar_faq] shortcode) -------- */

.msar-faq {
	max-width: 820px;
	margin: clamp(1.25rem, 3vw, 2rem) auto 0;
	padding: 4px clamp(1.25rem, 3.5vw, 2rem);
	background: var(--wp--preset--color--msar-bg-alt);
	border-radius: var(--wp--custom--radius--md);
}
.msar-faq details {
	border-bottom: 1px solid #e7e7e7;
}
.msar-faq summary {
	cursor: pointer;
	list-style: none;
	position: relative;
	padding: 20px 46px 20px 0;
	font-weight: 600;
	font-size: 1.05rem;
	color: var(--wp--preset--color--msar-fg);
}
.msar-faq summary::-webkit-details-marker {
	display: none;
}
.msar-faq summary::after {
	content: "+";
	position: absolute;
	right: 6px;
	top: 18px;
	font-size: 1.6rem;
	line-height: 1;
	color: var(--wp--preset--color--msar-accent);
	transition: transform .2s ease;
}
.msar-faq details[open] summary::after {
	transform: rotate(45deg);
}
.msar-faq summary:hover {
	color: var(--wp--preset--color--msar-accent);
}
.msar-faq__a {
	padding: 0 0 22px;
	color: var(--wp--custom--fg-muted);
	line-height: 1.7;
}
.msar-faq__a p {
	margin: 0;
}

/* -------- Inner content pages: vertical rhythm -------- */

/* Keep the first content section close to the page title (the section's own
   top padding otherwise leaves a large gap under the heading). */
.wp-block-post-content > section:first-child,
.wp-block-post-content > div:first-child {
	padding-top: 1.75rem !important;
}

/* Trim the vertical padding on the grey content bands so they don't feel empty. */
.wp-block-post-content section.has-msar-bg-alt-background-color,
.wp-block-post-content section.has-msar-bg-inv-background-color {
	padding-top: clamp(2.25rem, 5vw, 3.5rem) !important;
	padding-bottom: clamp(2.25rem, 5vw, 3.5rem) !important;
}

/* Clear space below a section heading before its content. */
.wp-block-post-content section > .wp-block-heading {
	margin-bottom: clamp(1rem, 2.4vw, 1.7rem);
}

/* Padding above and below content call-to-action buttons. */
.wp-block-post-content section > .wp-block-buttons {
	margin-top: clamp(1.75rem, 3.6vw, 2.6rem);
	margin-bottom: clamp(1.75rem, 3.6vw, 2.6rem);
}

/* Space between the heading and the FAQ accordion. */
.wp-block-post-content .msar-faq {
	margin-top: clamp(1rem, 2.2vw, 1.5rem);
}

/* Spacing around in-section placeholders. */
.wp-block-post-content section > .msar-placeholder {
	margin-top: clamp(1rem, 2.5vw, 1.75rem);
	margin-bottom: clamp(1rem, 2.5vw, 1.75rem);
}

/* Space above the course query-loop results. */
.wp-block-post-content section > .wp-block-query {
	margin-top: clamp(.75rem, 2vw, 1.5rem);
}

/* Inline prose links inside page content: clearly orange and underlined. */
.wp-block-post-content p:not(.msar-tile__link) a,
.wp-block-post-content li a {
	color: var(--wp--preset--color--msar-accent);
	text-decoration: underline;
	text-underline-offset: 2px;
}
.wp-block-post-content p:not(.msar-tile__link) a:hover,
.wp-block-post-content li a:hover {
	color: var(--wp--preset--color--msar-accent-secondary);
}

/* -------- Contact form -------- */

.msar-form__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
.msar-form label {
	display: block;
	font-weight: 600;
	margin-bottom: 16px;
}
.msar-form__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}
.msar-form input,
.msar-form textarea {
	display: block;
	width: 100%;
	margin-top: 6px;
	padding: 12px 14px;
	border: 1px solid #d8d8d8;
	border-radius: var(--wp--custom--radius--sm);
	font: inherit;
	font-weight: 400;
	background: #ffffff;
	color: var(--wp--preset--color--msar-fg);
}
.msar-form input:focus,
.msar-form textarea:focus {
	outline: none;
	border-color: var(--wp--preset--color--msar-accent);
	box-shadow: 0 0 0 1px var(--wp--preset--color--msar-accent);
}
/* Some managed hosts (e.g. GoDaddy Managed WordPress) inject a form/reset
   stylesheet that strips the field border and background, leaving the inputs
   invisible. Re-assert the essentials so they stay visible everywhere. */
.msar-form input:not([type="hidden"]),
.msar-form textarea {
	box-sizing: border-box !important;
	width: 100% !important;
	border: 1px solid #d8d8d8 !important;
	background: #ffffff !important;
}
.msar-form input:focus,
.msar-form textarea:focus {
	border-color: var(--wp--preset--color--msar-accent) !important;
}
.msar-form button {
	margin-top: 6px;
	border: none;
	cursor: pointer;
}
.msar-form-note {
	padding: 14px 18px;
	border-radius: var(--wp--custom--radius--sm);
	margin-bottom: 20px;
	font-weight: 600;
}
.msar-form-note--ok {
	background: rgba(var(--wp--custom--accent-rgb), .12);
	color: #b4530f;
}
.msar-form-note--err {
	background: #fdecea;
	color: #b3271e;
}
@media (max-width: 480px) {
	.msar-form__row {
		grid-template-columns: 1fr;
	}
}

/* -------- Reduced motion -------- */

@media (prefers-reduced-motion: reduce) {
	.wp-block-button__link:hover,
	.wp-block-button__link:focus-visible,
	.msar-card:hover,
	footer .wp-block-social-link:hover,
	.msar-course-book:hover {
		transform: none;
	}
}

/* -------- Mobile menu (hamburger overlay) -------- */

@media (max-width: 900px) {
	.msar-nav {
		flex: 0 0 auto;
	}
	.msar-nav__toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		padding: 0;
		background: none;
		border: none;
		color: var(--wp--preset--color--msar-fg);
		cursor: pointer;
	}
	.msar-nav__panel {
		position: fixed;
		inset: 0;
		z-index: 9998;
		display: flex;
		flex-direction: column;
		align-items: center;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		background: var(--wp--preset--color--msar-accent);
		transform: translateX(100%);
		transition: transform .3s ease;
	}
	.msar-nav--open .msar-nav__panel {
		transform: translateX(0);
	}
	.msar-nav__close {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		position: fixed;
		top: 18px;
		right: 18px;
		width: 48px;
		height: 48px;
		padding: 0;
		background: rgba(255, 255, 255, .18);
		border: none;
		border-radius: 50%;
		color: #ffffff;
		cursor: pointer;
		z-index: 2;
	}
	.msar-nav__list {
		flex: 1 1 auto;
		flex-direction: column;
		width: 100%;
		max-width: 420px;
		margin: 0 auto;
		gap: 0;
		padding: 74px 20px 32px;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}
	.msar-nav__list > li {
		width: 100%;
		text-align: center;
		border-bottom: 1px solid rgba(255, 255, 255, .28);
	}
	.msar-nav__list > li:last-child {
		border-bottom: none;
	}
	/* Keep mobile links white (no colour change on tap). */
	.msar-nav__list a,
	.msar-nav__list a:hover,
	.msar-nav__list a:focus-visible,
	.msar-nav__list .current-menu-item > a {
		display: block;
		color: #ffffff !important;
		-webkit-text-fill-color: #ffffff !important;
		font-size: 18px;
		padding: 12px 0;
	}
	.msar-nav__list .sub-menu {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		background: transparent;
		box-shadow: none;
		padding: 0;
	}
	.msar-nav__list .sub-menu a {
		color: rgba(255, 255, 255, .85) !important;
		-webkit-text-fill-color: rgba(255, 255, 255, .85) !important;
		font-size: 15px;
		padding: 8px 0;
	}
}

/* -------- Other mobile refinements -------- */

@media (max-width: 781px) {
	/* Comfortably tappable, full-width buttons. */
	.wp-block-buttons:not(.is-content-justification-center):not(.msar-join) .wp-block-button {
		width: 100%;
	}
	.wp-block-buttons:not(.is-content-justification-center):not(.msar-join) .wp-block-button .wp-block-button__link {
		display: block;
		text-align: center;
	}

	/* Centre the membership Join button. */
	.msar-join {
		width: 100%;
		justify-content: center;
		margin-left: 0 !important;
	}
}

/* Footer: drop from four columns to a tidy two-by-two, then a single column. */
@media (max-width: 900px) {
	.msar-footer-cols {
		grid-template-columns: 1fr 1fr !important;
	}
}

@media (max-width: 600px) {
	.msar-marquee .msar-partner {
		height: calc(var(--msar-h, 48) * 0.92px);
		max-width: 220px;
	}
	.msar-banner {
		min-height: 300px !important;
	}
	/* Footer on phones: compact 2-column (logo/about spans the top), and fully
	   centred so the logo, social icons, headings and links all line up cleanly. */
	.msar-footer-cols {
		grid-template-columns: 1fr 1fr !important;
		gap: 1.75rem 1.5rem !important;
		text-align: center;
	}
	.msar-footer-cols > :first-child,
	.msar-footer-cols > :last-child {
		grid-column: 1 / -1;
	}
	footer .wp-block-site-logo {
		width: min(190px, 55vw) !important;
		margin-left: auto !important;
		margin-right: auto !important;
	}
	footer .wp-block-social-links {
		justify-content: center !important;
	}
	.msar-footer-bar {
		justify-content: center;
		text-align: center;
	}
}

/* -------- Image that text flows/wraps around (page intros) -------- */
.msar-wrap-img {
	float: right;
	width: min(42%, 420px);
	margin: 4px 0 20px 32px;
}
.msar-wrap-img img {
	border-radius: var(--wp--custom--radius--md);
}
@media (max-width: 700px) {
	.msar-wrap-img {
		float: none;
		width: 100%;
		margin: 0 0 24px 0;
	}
}

/* -------- CTA on the orange band: keep the outline "Contact us" button white.
   Some managed hosts (GoDaddy) render it in the dark body colour otherwise. -------- */
.has-msar-accent-background-color .wp-block-button.is-style-outline > .wp-block-button__link {
	color: #ffffff !important;
	border-color: #ffffff !important;
}
