/**
 * Hamilton RASC theme — Mississauga-inspired layout styles.
 */

/* ── Layout containment ─────────────────────────────────────────────── */

/*
 * Full-width (alignfull) blocks use viewport breakout; without root padding
 * in theme.json that pairing can add ~1 scrollbar-width of horizontal scroll.
 */
html {
	overflow-x: clip;
}

body {
	overflow-x: clip;
}

.wp-site-blocks {
	max-width: 100%;
}

/*
 * Homepage sections inside constrained main should not use alignfull viewport breakout.
 * Hero (.hrasc-hero) stays full width intentionally.
 */
main.is-layout-constrained > .alignfull:not(.hrasc-hero) {
	box-sizing: border-box;
	width: 100% !important;
	max-width: var(--wp--style--global--content-size, 1080px) !important;
	margin-left: auto !important;
	margin-right: auto !important;
}

img,
video,
iframe,
embed,
object {
	max-width: 100%;
	height: auto;
}

/* ── Typography (Mississauga scale — 18px body, 30px h1; Open Sans unchanged) ─ */

body,
.wp-site-blocks {
	font-size: 1.125rem;
	line-height: 1.7;
}

main :where(h1, .wp-block-heading:where(h1)) {
	font-size: 1.875rem;
	font-weight: 500;
	line-height: 1.3;
}

main :where(h2, .wp-block-heading:where(h2)) {
	font-size: 1.625rem;
	font-weight: 500;
	line-height: 1.3;
}

main :where(h3, .wp-block-heading:where(h3)) {
	font-size: 1.375rem;
	font-weight: 500;
	line-height: 1.3;
}

main :where(p, .wp-block-paragraph) {
	font-size: inherit;
	line-height: 1.7;
}

/* ── Main header (Mississauga #main-header / #et-top-navigation) ───── */

#main-header {
	--hrasc-header-bg: rgba(78, 77, 142, 0.85);
	--hrasc-header-purple: #4e4d8e;
	--hrasc-nav-link: #fbee25;
	--hrasc-nav-link-hover: #ffffff;
	--hrasc-nav-current: #ffffff;
	width: 100%;
	background: var(--hrasc-header-bg);
	box-shadow: none;
	position: sticky;
	top: 0;
	z-index: 1000;
}

#main-header .main-header__container {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0;
	width: 100%;
	max-width: var(--wp--style--global--wide-size);
	margin-inline: auto;
	padding: var(--wp--preset--spacing--s) var(--wp--preset--spacing--m) 0;
	box-sizing: border-box;
}

#main-header .main-header__top {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--m);
	width: 100%;
}

#main-header .main-header__branding {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex: 1 1 auto;
	min-width: 0;
}

#main-header .main-header__login {
	flex: 0 0 auto;
}

#main-header .main-header__login a {
	display: inline-block;
	padding: 0.5rem 0.85rem;
	color: var(--hrasc-nav-link);
	font-size: 1.125rem;
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
	line-height: 1.4;
	letter-spacing: 0.02em;
}

#main-header .main-header__login a:hover {
	color: var(--hrasc-nav-link-hover);
}

#main-header .main-header__logo img {
	display: block;
	height: auto;
	max-height: 80px;
	width: auto;
	box-shadow: 0 0 8px rgba(0, 0, 0, 0.75);
	border-radius: 50%;
}

#main-header .main-header__site-title {
	margin: 0;
	font-size: 1.125rem;
	font-weight: 600;
}

#main-header .main-header__site-title a {
	color: var(--hrasc-nav-link);
	text-decoration: none;
}

#main-header .main-header__site-title a:hover {
	color: var(--hrasc-nav-link-hover);
}

#main-header #et-top-navigation {
	width: 100%;
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 1.375rem 0 1.375rem;
	background: transparent;
	border-top: none;
	box-sizing: border-box;
}

#main-header .main-header__menu-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 1px solid var(--hrasc-nav-link);
	border-radius: 3px;
	color: var(--hrasc-nav-link);
	cursor: pointer;
	padding: 0.5rem 0.75rem;
	margin-left: auto;
}

#main-header .main-header__menu-toggle:hover {
	color: var(--hrasc-nav-link-hover);
	border-color: var(--hrasc-nav-link-hover);
}

#main-header .main-header__menu-toggle-icon {
	display: block;
	width: 1.25rem;
	height: 2px;
	background: currentColor;
	box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}

#main-header #top-menu-nav {
	width: 100%;
}

#main-header #top-menu,
#main-header .main-header__menu {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 0;
	list-style: none;
	margin: 0;
	padding: 0;
}

#main-header #top-menu > li > a,
#main-header .main-header__menu > li > a {
	display: block;
	padding: 0.55rem 0.7rem;
	color: var(--hrasc-nav-link);
	font-size: 1.125rem;
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
	line-height: 1.4;
	letter-spacing: 0.06em;
}

#main-header #top-menu > li,
#main-header .main-header__menu > li {
	position: relative;
	margin: 0;
}

#main-header #top-menu > li > a:hover,
#main-header .main-header__menu > li > a:hover {
	color: var(--hrasc-nav-link-hover);
}

#main-header #top-menu .current-menu-ancestor > a,
#main-header #top-menu .current-menu-item > a,
#main-header #top-menu .current_page_item > a,
#main-header .main-header__menu .current-menu-ancestor > a,
#main-header .main-header__menu .current-menu-item > a,
#main-header .main-header__menu .current_page_item > a {
	color: var(--hrasc-nav-current);
}

#main-header #top-menu .sub-menu,
#main-header .main-header__menu .sub-menu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 14rem;
	margin: 0;
	padding: 0.35rem 0;
	list-style: none;
	background: var(--hrasc-header-bg);
	border: none;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
	z-index: 1001;
}

#main-header #top-menu li:hover > .sub-menu,
#main-header #top-menu li:focus-within > .sub-menu,
#main-header .main-header__menu li:hover > .sub-menu,
#main-header .main-header__menu li:focus-within > .sub-menu {
	display: block;
}

#main-header #top-menu .sub-menu a,
#main-header .main-header__menu .sub-menu a {
	display: block;
	padding: 0.5rem 1rem;
	color: var(--hrasc-nav-link);
	text-decoration: none;
	white-space: normal;
	letter-spacing: 0.06em;
}

#main-header #top-menu .sub-menu a:hover,
#main-header .main-header__menu .sub-menu a:hover {
	color: var(--hrasc-nav-link-hover);
	background: rgba(0, 0, 0, 0.12);
}

/* ── Hero ─────────────────────────────────────────────────────────── */

.hrasc-hero {
	background-image: linear-gradient(
		135deg,
		rgba(26, 42, 58, 0.92) 0%,
		rgba(30, 60, 80, 0.85) 50%,
		rgba(26, 42, 58, 0.92) 100%
	),
	url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='600' viewBox='0 0 1200 600'%3E%3Crect fill='%230a1628' width='1200' height='600'/%3E%3Ccircle cx='200' cy='120' r='1' fill='white' opacity='0.8'/%3E%3Ccircle cx='450' cy='80' r='1.5' fill='white' opacity='0.9'/%3E%3Ccircle cx='700' cy='200' r='1' fill='white' opacity='0.7'/%3E%3Ccircle cx='950' cy='150' r='2' fill='white' opacity='0.6'/%3E%3Ccircle cx='1100' cy='300' r='1' fill='white' opacity='0.8'/%3E%3Ccircle cx='300' cy='400' r='1.2' fill='white' opacity='0.75'/%3E%3Ccircle cx='600' cy='350' r='1' fill='white' opacity='0.85'/%3E%3Ccircle cx='850' cy='450' r='1.5' fill='white' opacity='0.7'/%3E%3C/svg%3E");
	background-size: cover;
	background-position: center;
}

.hrasc-hero .wp-block-cover__inner-container {
	max-width: 100%;
	padding-inline: var(--wp--preset--spacing--m);
	box-sizing: border-box;
}

.hrasc-hero__title {
	font-size: 1.875rem;
	font-weight: 500;
	line-height: 1.3;
	max-width: 52rem;
	margin-inline: auto;
}

.hrasc-hero__subtitle {
	font-size: 1.125rem;
	line-height: 1.7;
	max-width: 40rem;
	margin-inline: auto;
	opacity: 0.95;
}

.hrasc-hero__cta .wp-block-button__link {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--contrast);
	padding: 0.3em 1em;
	font-size: 1.25rem;
	font-weight: 600;
	border: none;
}

.hrasc-hero__cta .wp-block-button__link:hover {
	background: var(--wp--preset--color--accent-hover);
	color: var(--wp--preset--color--contrast);
}

/* ── Events glance (Mississauga et_pb_text_1 / next_event_horizontal) ─ */

.hrasc-events-glance {
	padding-top: 50px;
	padding-bottom: var(--wp--preset--spacing--xl);
	padding-inline: var(--wp--preset--spacing--m);
	background: var(--wp--preset--color--surface);
}

.hrasc-events-glance__intro {
	margin-bottom: 25px;
}

.hrasc-events-glance__intro h1 {
	margin-bottom: var(--wp--preset--spacing--m);
	font-size: 1.875rem;
	font-weight: 500;
}

.hrasc-events-glance__status {
	margin: 0 0 0.75rem;
	font-size: 1.125rem;
	font-weight: 400;
	color: var(--wp--preset--color--primary);
}

.hrasc-next-event-card {
	position: relative;
	width: 100%;
	max-width: var(--wp--style--global--content-size, 1080px);
	margin: 0 auto 25px;
	min-height: auto;
	padding: 16px 20px;
	box-sizing: border-box;
	background-color: rgba(46, 163, 242, 0.12);
	border: 1px solid rgba(46, 163, 242, 0.22);
	border-radius: 16px;
}

.hrasc-next-event-card__title h1 {
	margin: 0;
	padding: 0;
	font-size: 1.875rem;
	font-weight: 500;
	line-height: 1.3;
	color: var(--wp--preset--color--primary);
}

.hrasc-next-event-card__title p {
	margin: 0.35rem 0 0;
	padding: 0;
	font-size: 1.125rem;
	color: var(--wp--preset--color--heading);
}

.hrasc-next-event-card__more {
	margin: 0.5rem 0 0 !important;
}

.hrasc-next-event-card__more a {
	font-size: 1.125rem;
	font-weight: 400;
	color: var(--wp--preset--color--primary);
	text-decoration: underline;
}

.hrasc-next-event-card__more a:hover {
	color: var(--wp--preset--color--accent-hover);
}

.hrasc-events-glance__cta {
	margin-top: 25px;
}

.hrasc-events-glance__cta .wp-block-button__link {
	color: #000 !important;
	border: 2px solid #000;
	background: transparent !important;
	font-size: 1.25rem;
	font-weight: 600;
	padding: 0.3em 1em;
}

.hrasc-events-glance__cta .wp-block-button__link:hover {
	color: #000 !important;
	border-color: #000;
	background: rgba(0, 0, 0, 0.05) !important;
}

/* ── Feature columns ──────────────────────────────────────────────── */

.hrasc-features {
	padding-block: var(--wp--preset--spacing--xl);
	padding-inline: var(--wp--preset--spacing--m);
}

.hrasc-feature-card {
	text-align: center;
	padding: var(--wp--preset--spacing--l);
}

.hrasc-feature-card h2 {
	font-size: 1.375rem;
	font-weight: 600;
	margin-bottom: var(--wp--preset--spacing--s);
}

.hrasc-feature-card h2::before {
	content: "";
	display: block;
	width: 3rem;
	height: 3rem;
	margin: 0 auto var(--wp--preset--spacing--s);
	border-radius: 50%;
	background: var(--wp--preset--color--accent);
	opacity: 0.35;
}

/* ── Equipment loan ───────────────────────────────────────────────── */

.hrasc-equipment-loan {
	padding-block: var(--wp--preset--spacing--xl);
	padding-inline: var(--wp--preset--spacing--m);
	border-top: 1px solid var(--wp--preset--color--border);
	border-bottom: 1px solid var(--wp--preset--color--border);
}

/* ── President message (Mississauga et_pb_text_11 / et_pb_text_12) ─── */

.hrasc-president {
	padding-top: 50px;
	padding-bottom: var(--wp--preset--spacing--xl);
	background: var(--wp--preset--color--base);
}

.hrasc-president__title {
	margin-bottom: 0;
}

.hrasc-president__title h1 {
	margin: 0 0 25px;
	font-size: 1.875rem;
	font-weight: 500;
	line-height: 1.3;
	text-align: left;
	color: var(--wp--preset--color--heading);
}

.hrasc-president__body {
	margin-inline: 15px;
	padding: 25px;
	font-weight: 400;
	font-size: 1.125rem;
	text-align: left;
	color: var(--wp--preset--color--body);
	background: var(--wp--preset--color--base);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hrasc-president__body p {
	margin: 0 0 1em;
	line-height: 1.7;
}

.hrasc-president__body p:last-child {
	margin-bottom: 0;
}

.hrasc-president__signature {
	font-weight: 600;
}

/* Legacy flat layout before title/body split. */
.hrasc-president.has-surface-background-color {
	background: var(--wp--preset--color--base) !important;
}

.hrasc-president:not(:has(.hrasc-president__body)) {
	padding-inline: var(--wp--preset--spacing--m);
}

.hrasc-president:not(:has(.hrasc-president__body)) > .wp-block-heading {
	margin: 0 0 25px;
	font-size: 1.875rem;
	font-weight: 500;
	text-align: left;
}

@media (max-width: 781px) {
	.hrasc-president__body {
		margin-inline: 0;
	}
}

/* ── Footer (Mississauga #main-footer style) ───────────────────────── */

#main-footer {
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	margin-top: 0;
}

#main-footer .main-footer__container {
	width: 100%;
	max-width: var(--wp--style--global--content-size);
	margin-inline: auto;
	padding-inline: var(--wp--preset--spacing--m);
	box-sizing: border-box;
}

#footer-widgets {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--l);
	padding: var(--wp--preset--spacing--xl) 0 var(--wp--preset--spacing--l);
}

.footer-widget .title,
.footer-widget h4 {
	margin: 0 0 var(--wp--preset--spacing--s);
	color: var(--wp--preset--color--accent);
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.3;
	text-decoration: underline;
}

.footer-widget ul.menu {
	list-style: none;
	margin: 0;
	padding: 0;
}

.footer-widget ul.menu > li {
	margin: 0 0 0.5rem;
	padding: 0;
}

.footer-widget ul.menu a {
	color: var(--wp--preset--color--base);
	text-decoration: none;
	line-height: 1.5;
}

.footer-widget ul.menu a:hover {
	color: var(--wp--preset--color--accent-hover);
}

#et-footer-nav {
	border-top: 1px solid rgba(255, 255, 255, 0.15);
	padding: 0.85rem 0;
}

#et-footer-nav .bottom-nav {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 0.35rem 1.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

#et-footer-nav .bottom-nav > li {
	margin: 0;
	padding: 0;
}

#et-footer-nav .bottom-nav a {
	color: var(--wp--preset--color--base);
	text-decoration: none;
	font-size: 1.125rem;
	white-space: nowrap;
}

#et-footer-nav .bottom-nav a:hover {
	color: var(--wp--preset--color--accent-hover);
}

#footer-bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.15);
	padding: var(--wp--preset--spacing--l) 0 var(--wp--preset--spacing--xl);
}

.footer-bottom__inner {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: var(--wp--preset--spacing--m);
}

.footer-bottom__logo img {
	display: block;
	max-height: 125px;
	width: auto;
}

#main-footer .et-social-icons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

#main-footer .et-social-icons a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	color: var(--wp--preset--color--accent);
	text-decoration: none;
	font-size: 0;
}

#main-footer .et-social-icons a:hover {
	color: var(--wp--preset--color--accent-hover);
}

#main-footer .et-social-facebook a::before,
#main-footer .et-social-instagram a::before {
	font-family: dashicons;
	font-size: 1.25rem;
	line-height: 1;
	speak: never;
}

#main-footer .et-social-facebook a::before {
	content: "\f304";
}

#main-footer .et-social-instagram a::before {
	content: "\f128";
}

#footer-info {
	margin: 0;
	font-size: 1.125rem;
	opacity: 0.85;
	text-align: right;
	flex: 1 1 12rem;
}

/* ── General ──────────────────────────────────────────────────────── */

/* MonsterInsights verified badge (fallback if plugin output is cached). */
a[href*="utm_campaign=verifiedbyMonsterInsights"],
a[href*="monsterinsights.com"][href*="verifiedBadge"] {
	display: none !important;
}

main {
	margin-top: 0;
}

.post-card {
	padding-block: var(--wp--preset--spacing--m);
	border-bottom: 1px solid var(--wp--preset--color--border);
}

/* ── Responsive ───────────────────────────────────────────────────── */

@media (max-width: 980px) {
	#main-header .main-header__top {
		flex-wrap: wrap;
	}

	#main-header .main-header__login {
		margin-left: auto;
	}

	#main-header .main-header__menu-toggle {
		display: flex;
		order: 3;
	}

	#main-header #et-top-navigation {
		flex-wrap: wrap;
		justify-content: flex-end;
		padding-top: 0.5rem;
	}

	#main-header #top-menu-nav:not(.is-open) {
		display: none;
	}

	#main-header #top-menu,
	#main-header .main-header__menu {
		flex-direction: column;
		align-items: stretch;
	}

	#main-header #top-menu > li > a,
	#main-header .main-header__menu > li > a {
		white-space: normal;
		font-size: 1.125rem;
	}

	#main-header #top-menu .sub-menu,
	#main-header .main-header__menu .sub-menu {
		position: static;
		display: block;
		border: none;
		box-shadow: none;
		padding-left: 1rem;
		background: rgba(0, 0, 0, 0.1);
	}
}

@media (max-width: 781px) {
	.hrasc-features__grid {
		flex-direction: column;
	}

	.hrasc-equipment-loan__row {
		flex-direction: column;
	}

	#footer-widgets {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	#footer-info {
		text-align: left;
	}
}

@media (max-width: 600px) {
	#footer-widgets {
		grid-template-columns: 1fr;
	}

	.footer-bottom__inner {
		flex-direction: column;
		align-items: flex-start;
	}
}
