/*
 * Rocketsites front-end base styles.
 *
 * Structural defaults use :where() (zero specificity) so any layout setting
 * overrides them. Resets that must beat theme element styles (h2, hr,
 * button, figure…) use .rs-layout-scoped selectors instead.
 *
 * Defaults come from custom properties set in the inline global CSS:
 * --rs-row-max, --rs-row-pad-y, --rs-row-pad-x, --rs-gap, --rs-module-spacing.
 */

/* ---------- Structure ---------- */

:where(.rs-layout) {
	width: 100%;
}

:where(.rs-row, .rs-row-inner, .rs-columns, .rs-col, .rs-col-inner, .rs-module, .rs-module-content) {
	box-sizing: border-box;
}

:where(.rs-row) {
	position: relative;
	isolation: isolate;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	padding: var(--rs-row-pad-y, 40px) var(--rs-row-pad-x, 20px);
	/* Columns reach out by half the column gap; when that is more than the row's side
	   padding (a wide gap on a narrow screen) they would scroll the page sideways.
	   clip (unlike hidden) leaves vertical overflow alone, e.g. rows with negative margins. */
	overflow-x: clip;
}

:where(.rs-row-fixed) {
	width: 100%;
	max-width: var(--rs-row-max, 1100px);
	margin-left: auto;
	margin-right: auto;
}

:where(.rs-row-inner) {
	position: relative;
	z-index: 1;
	width: 100%;
	margin-left: auto;
	margin-right: auto;
}

:where(.rs-content-fixed) > :where(.rs-row-inner) {
	max-width: var(--rs-row-max, 1100px);
}

:where(.rs-columns) {
	display: flex;
	flex-wrap: wrap;
	margin-left: calc(var(--rs-gap, 30px) / -2);
	margin-right: calc(var(--rs-gap, 30px) / -2);
}

:where(.rs-col) {
	display: flex;
	flex: 0 0 100%;
	max-width: 100%;
	min-width: 0;
	padding-left: calc(var(--rs-gap, 30px) / 2);
	padding-right: calc(var(--rs-gap, 30px) / 2);
}

:where(.rs-col-inner) {
	position: relative;
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-width: 0;
}

:where(.rs-module) {
	min-width: 0;
	margin-bottom: var(--rs-module-spacing, 20px);
}

:where(.rs-col-inner > .rs-module:last-child) {
	margin-bottom: 0;
}

.rs-layout img {
	max-width: 100%;
	height: auto;
}

/* ---------- Row backgrounds ---------- */

:where(.rs-bg-video, .rs-bg-overlay) {
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
}

:where(.rs-bg-video) {
	overflow: hidden;
}

:where(.rs-bg-video video) {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

:where(.rs-has-bg-video) {
	overflow: hidden;
}

/* ---------- Heading & text ---------- */

.rs-layout .rs-heading {
	margin: 0;
}

:where(.rs-heading a) {
	color: inherit;
	text-decoration: none;
}

.rs-layout .rs-text > :first-child,
.rs-layout .rs-callout-text > :first-child,
.rs-layout .rs-cta-text > :first-child,
.rs-layout .rs-accordion-content > :first-child,
.rs-layout .rs-tab-panel > :first-child {
	margin-top: 0;
}

.rs-layout .rs-text > :last-child,
.rs-layout .rs-callout-text > :last-child,
.rs-layout .rs-cta-text > :last-child,
.rs-layout .rs-accordion-content > :last-child,
.rs-layout .rs-tab-panel > :last-child {
	margin-bottom: 0;
}

/* ---------- Photo ---------- */

.rs-layout .rs-photo {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	margin: 0;
}

:where(.rs-photo > a) {
	display: block;
	max-width: 100%;
}

:where(.rs-photo-img) {
	display: block;
	max-width: 100%;
	height: auto;
}

:where(.rs-photo > a > .rs-photo-img) {
	width: 100%;
}

:where(.rs-photo-caption) {
	margin-top: 8px;
	font-size: 0.875em;
	opacity: 0.8;
}

/* ---------- Button ---------- */

.rs-layout .rs-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	padding: 0.75em 1.5em;
	border: 0 solid transparent;
	border-radius: 4px;
	background-color: #222;
	color: #fff;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.rs-layout .rs-button:hover,
.rs-layout .rs-button:focus-visible {
	background-color: #444;
	color: #fff;
	text-decoration: none;
}

:where(.rs-button-full .rs-button) {
	display: flex;
	width: 100%;
}

:where(.rs-buttons) {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}

/* ---------- Icon ---------- */

:where(.rs-icon-wrap, .rs-icon-link) {
	display: flex;
	align-items: center;
	gap: 0.6em;
}

:where(.rs-icon-link) {
	display: inline-flex;
	color: inherit;
	text-decoration: none;
}

:where(.rs-icon) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	font-size: 32px;
	line-height: 1;
	transition: color 0.2s, background-color 0.2s;
}

:where(.rs-icon-shape) {
	width: 2em;
	height: 2em;
	background-color: rgba(0, 0, 0, 0.08);
}

:where(.rs-icon-circle) {
	border-radius: 50%;
}

:where(.rs-icon-rounded) {
	border-radius: 20%;
}

:where(.rs-icon-shape i) {
	font-size: 0.5em;
}

/* ---------- Spacer & divider ---------- */

:where(.rs-spacer) {
	height: 40px;
}

.rs-layout .rs-divider {
	width: 100%;
	height: 0;
	margin: 0 auto;
	border: 0;
	border-top: 1px solid #ccc;
	background: none;
}

/* ---------- Video ---------- */

:where(.rs-video) {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #000;
}

:where(.rs-video iframe, .rs-video video) {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

:where(.rs-video video) {
	object-fit: contain;
}

/* ---------- Gallery & lightbox ---------- */

:where(.rs-gallery) {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
}

.rs-layout .rs-gallery-item {
	margin: 0;
}

:where(.rs-gallery-link) {
	display: block;
	cursor: zoom-in;
}

:where(.rs-gallery-img) {
	display: block;
	width: 100%;
	height: auto;
}

:where(.rs-gallery-caption) {
	margin-top: 6px;
	font-size: 0.85em;
}

.rs-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 56px 72px;
	background: rgba(0, 0, 0, 0.92);
}

.rs-lightbox img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.rs-lightbox-caption {
	position: absolute;
	left: 16px;
	right: 16px;
	bottom: 16px;
	color: #fff;
	font-size: 15px;
	text-align: center;
}

.rs-lightbox button {
	position: absolute;
	padding: 8px 14px;
	border: 0;
	background: none;
	color: #fff;
	font-size: 34px;
	line-height: 1;
	cursor: pointer;
}

.rs-lightbox button:focus-visible {
	outline: 2px solid #fff;
}

.rs-lightbox-close {
	top: 8px;
	right: 8px;
}

.rs-lightbox-prev,
.rs-lightbox-next {
	top: 50%;
	transform: translateY(-50%);
}

.rs-lightbox-prev {
	left: 8px;
}

.rs-lightbox-next {
	right: 8px;
}

@media (max-width: 600px) {
	.rs-lightbox {
		padding: 56px 12px;
	}
}

/* ---------- Callout ---------- */

:where(.rs-callout) {
	--rs-callout-gap: 16px;
}

:where(.rs-callout-left, .rs-callout-right) {
	display: flex;
	align-items: flex-start;
	gap: var(--rs-callout-gap);
}

:where(.rs-callout-body) {
	flex: 1 1 auto;
	min-width: 0;
}

:where(.rs-callout-left > .rs-callout-media, .rs-callout-right > .rs-callout-media) {
	flex: 0 0 auto;
	max-width: 50%;
}

:where(.rs-callout-above-title .rs-callout-media, .rs-callout-below-title .rs-callout-media) {
	margin-bottom: var(--rs-callout-gap);
}

.rs-layout .rs-callout-title {
	margin: 0 0 0.5em;
}

:where(.rs-callout-title a, .rs-callout-media a) {
	color: inherit;
	text-decoration: none;
}

:where(.rs-callout-media a) {
	display: inline-block;
}

:where(.rs-callout-title-row) {
	display: flex;
	align-items: center;
	gap: var(--rs-callout-gap);
	margin-bottom: 0.5em;
}

.rs-layout .rs-callout-title-row .rs-callout-title {
	margin: 0;
}

:where(.rs-callout-center .rs-callout-title-row) {
	justify-content: center;
}

:where(.rs-callout-cta) {
	margin-top: 1em;
}

:where(.rs-callout-glyph) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	font-size: 40px;
	line-height: 1;
}

:where(.rs-callout-shape) {
	min-width: 2em;
	height: 2em;
	padding: 0 0.4em;
	background-color: rgba(0, 0, 0, 0.08);
}

:where(.rs-callout-shape-circle) {
	border-radius: 999px;
}

:where(.rs-callout-shape-rounded) {
	border-radius: 0.4em;
}

:where(.rs-callout-shape i) {
	font-size: 0.5em;
}

:where(.rs-callout-number) {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

:where(.rs-callout-img) {
	display: inline-block;
	max-width: 100%;
	height: auto;
	vertical-align: top;
}

/* ---------- Equal height boxes (callout / CTA "Equal height") ---------- */

/* The module fills what's left of its column (columns are flex columns), and the box fills the module. */
.rs-layout .rs-module-fill,
.rs-layout .rs-module-fill > .rs-module-content {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
}

.rs-layout .rs-module-fill > .rs-module-content > :is(.rs-callout, .rs-cta) {
	flex: 1 1 auto;
}

/* Callouts: the body grows so the call to action can sit at the bottom. */
.rs-layout .rs-module-fill .rs-callout:not(.rs-callout-left, .rs-callout-right) {
	display: flex;
	flex-direction: column;
}

.rs-layout .rs-module-fill .rs-callout-body {
	display: flex;
	flex-direction: column;
	align-self: stretch;
}

.rs-layout .rs-module-fill .rs-callout-cta {
	margin-top: auto;
	padding-top: 1em;
}

/* Stacked CTAs: the text grows so the button sits at the bottom. */
.rs-layout .rs-module-fill .rs-cta-stacked > .rs-cta-content {
	flex: 1 1 auto;
}

/* ---------- Call to action ---------- */

:where(.rs-cta) {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

:where(.rs-cta-inline) {
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
}

:where(.rs-cta-inline .rs-cta-content) {
	flex: 1 1 auto;
	min-width: 0;
}

:where(.rs-cta-inline .rs-cta-action) {
	flex: 0 0 auto;
}

.rs-layout .rs-cta-title {
	margin: 0 0 0.4em;
}

/* ---------- Accordion ---------- */

:where(.rs-accordion) {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.rs-layout .rs-accordion-item {
	margin: 0;
	overflow: hidden;
	border: 1px solid #ddd;
}

.rs-layout .rs-accordion-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1em;
	margin: 0;
	padding: 14px 18px;
	font-weight: 600;
	list-style: none;
	cursor: pointer;
}

.rs-layout .rs-accordion-title::-webkit-details-marker {
	display: none;
}

.rs-layout .rs-accordion-title::marker {
	content: "";
}

.rs-accordion-icon {
	position: relative;
	flex: 0 0 14px;
	width: 14px;
	height: 14px;
}

.rs-accordion-icon::before,
.rs-accordion-icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 2px;
	margin-top: -1px;
	background: currentColor;
	transition: transform 0.2s;
}

.rs-accordion-icon::after {
	transform: rotate(90deg);
}

.rs-accordion-item[open] > .rs-accordion-title .rs-accordion-icon::after {
	transform: rotate(0deg);
}

:where(.rs-accordion-content) {
	padding: 0 18px 16px;
}

/* ---------- Tabs ---------- */

:where(.rs-tabs-vertical) {
	display: flex;
	align-items: stretch;
}

.rs-layout .rs-tab-list {
	display: flex;
	flex-wrap: wrap;
	margin: 0;
	padding: 0;
}

:where(.rs-tabs-vertical .rs-tab-list) {
	flex-direction: column;
	flex: 0 0 auto;
	max-width: 35%;
}

.rs-layout .rs-tab {
	appearance: none;
	margin: 0 -1px -1px 0;
	padding: 12px 20px;
	border: 1px solid #ddd;
	border-radius: 0;
	background: #f3f3f3;
	box-shadow: none;
	color: inherit;
	font: inherit;
	line-height: 1.3;
	letter-spacing: normal;
	text-align: left;
	text-transform: none;
	cursor: pointer;
}

.rs-layout .rs-tab[aria-selected="true"] {
	position: relative;
	z-index: 1;
	background: #fff;
	font-weight: 600;
}

:where(.rs-tab-panels) {
	flex: 1 1 auto;
	min-width: 0;
	border: 1px solid #ddd;
}

:where(.rs-tab-panel) {
	padding: 20px;
}

.rs-layout .rs-tab-panel[hidden] {
	display: none;
}

/* ---------- Helpers ---------- */

.rs-layout .screen-reader-text,
.rs-part .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

:where(.rs-module-placeholder) {
	margin: 0;
	padding: 16px;
	border: 1px dashed #b5bfc9;
	color: #50575e;
	font-size: 14px;
	text-align: center;
}

.rs-skip-link {
	position: absolute;
	left: 8px;
	top: -100px;
	z-index: 100000;
	padding: 8px 14px;
	background: #fff;
	color: #000;
}

.rs-skip-link:focus {
	top: 8px;
}

/* ---------- Menu ---------- */

.rs-layout .rs-menu-list,
.rs-layout .rs-menu-list .sub-menu {
	list-style: none;
	margin: 0;
	padding: 0;
}

:where(.rs-menu-horizontal) > :where(.rs-menu-list) {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
}

:where(.rs-menu-vertical) > :where(.rs-menu-list) {
	display: flex;
	flex-direction: column;
}

.rs-layout .rs-menu-list li {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	margin: 0;
}

.rs-layout .rs-menu-list a {
	display: block;
	flex: 1 1 auto;
	text-decoration: none;
	color: inherit;
	transition: color 0.15s, background-color 0.15s;
}

:where(.rs-menu-horizontal) :where(.sub-menu) {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 1000;
	min-width: 220px;
	padding: 6px 0;
	background: #fff;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
	visibility: hidden;
	opacity: 0;
	transform: translateY(6px);
	transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}

:where(.rs-menu-horizontal) :where(.sub-menu .sub-menu) {
	top: 0;
	left: 100%;
}

:where(.rs-menu-horizontal) :where(li:hover, li:focus-within) > :where(.sub-menu) {
	visibility: visible;
	opacity: 1;
	transform: none;
}

.rs-layout .rs-menu .sub-menu {
	text-align: left;
}

.rs-layout .rs-menu .sub-menu li {
	width: 100%;
}

:where(.rs-menu) {
	position: relative;
}

/* Dropdowns open over what follows: rows isolate their layers, so lift rows that hold a menu,
   and the header part above the content. */
:where(.rs-row:has(.rs-module-menu)) {
	z-index: 20;
}

:where(.rs-part-header) {
	position: relative;
	z-index: 1000;
}

:where(.rs-menu-vertical) :where(.sub-menu) {
	width: 100%;
	padding-left: 16px;
}

.rs-layout .rs-menu-toggle,
.rs-layout .rs-submenu-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 10px 14px;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: inherit;
	font: inherit;
	line-height: 1;
	cursor: pointer;
}

.rs-layout .rs-submenu-toggle {
	padding: 10px 14px;
	margin-left: auto;
}

.rs-layout li.is-open > .rs-submenu-toggle i {
	transform: rotate(180deg);
}

/* ---------- Slider ---------- */

:where(.rs-slider) {
	position: relative;
	display: grid;
	overflow: hidden;
	min-height: 480px;
	color: #fff;
}

:where(.rs-slides) {
	display: grid;
	grid-area: 1 / 1;
}

:where(.rs-slide) {
	grid-area: 1 / 1;
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	background-color: #222;
	background-size: cover;
	background-position: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.8s ease, visibility 0.8s;
}

:where(.rs-slide.is-active) {
	opacity: 1;
	visibility: visible;
}

:where(.rs-slide-overlay) {
	position: absolute;
	inset: 0;
}

:where(.rs-slide-inner) {
	position: relative;
	width: 100%;
	max-width: var(--rs-row-max, 1100px);
	margin: 0 auto;
	padding: 40px 20px;
}

.rs-layout .rs-slide-heading {
	margin: 0 0 0.4em;
	color: inherit;
	font-size: clamp(30px, 5vw, 52px);
	line-height: 1.1;
}

:where(.rs-slide-text) > :last-child {
	margin-bottom: 0;
}

:where(.rs-slide-buttons) {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 24px;
}

.rs-layout .rs-slider-arrow {
	position: absolute;
	top: 50%;
	z-index: 2;
	width: 44px;
	height: 44px;
	margin: -22px 0 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.35);
	color: #fff;
	font-size: 18px;
	cursor: pointer;
}

.rs-layout .rs-slider-prev {
	left: 12px;
}

.rs-layout .rs-slider-next {
	right: 12px;
}

:where(.rs-slider-dots) {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 16px;
	z-index: 2;
	display: flex;
	justify-content: center;
	gap: 8px;
}

.rs-layout .rs-slider-dot {
	width: 12px;
	height: 12px;
	margin: 0;
	padding: 0;
	border: 2px solid #fff;
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
}

.rs-layout .rs-slider-dot.is-active {
	background: #fff;
}

@media (prefers-reduced-motion: reduce) {
	:where(.rs-slide) {
		transition: none;
	}
}

/* ---------- Posts ---------- */

:where(.rs-posts) {
	display: grid;
	gap: 30px;
}

:where(.rs-posts-grid) {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

:where(.rs-post) {
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow: hidden;
}

:where(.rs-posts-list .rs-post) {
	flex-direction: row;
	gap: 24px;
}

:where(.rs-posts-list .rs-post-image) {
	flex: 0 0 34%;
}

.rs-layout .rs-post-img {
	display: block;
	width: 100%;
	height: auto;
}

:where(.rs-post-body) {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	padding: 16px 0;
}

.rs-layout .rs-post-title {
	margin: 0 0 0.4em;
	font-size: 20px;
}

.rs-layout .rs-post-title a {
	color: inherit;
	text-decoration: none;
}

.rs-layout .rs-post-meta {
	margin: 0 0 0.6em;
	font-size: 0.875em;
	opacity: 0.8;
}

.rs-layout .rs-post-excerpt {
	margin: 0 0 1em;
}

:where(.rs-post-more) {
	margin-top: auto;
	font-weight: 600;
}

:where(.rs-posts-pagination) {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	margin-top: 30px;
}

:where(.rs-posts-pagination) :where(.page-numbers) {
	padding: 6px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	text-decoration: none;
}

:where(.rs-posts-pagination) :where(.page-numbers.current) {
	background: #222;
	border-color: #222;
	color: #fff;
}

@media (max-width: 768px) {
	:where(.rs-posts-list .rs-post) {
		flex-direction: column;
	}
}

/* ---------- Breadcrumbs, search, social ---------- */

:where(.rs-breadcrumbs) {
	font-size: 14px;
}

:where(.rs-breadcrumbs) a {
	color: inherit;
}

:where(.rs-breadcrumbs-sep) {
	margin: 0 0.35em;
	opacity: 0.7;
}

:where(.rs-search) {
	display: flex;
	max-width: 100%;
}

.rs-layout .rs-search-input {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	padding: 10px 12px;
	border: 1px solid #ccc;
	border-right: 0;
	background: #fff;
	color: #222;
	font: inherit;
}

.rs-layout .rs-search-button {
	flex: 0 0 auto;
	border: 0;
	cursor: pointer;
}

:where(.rs-social) {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	font-size: 16px;
}

.rs-layout .rs-social-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: inherit;
	text-decoration: none;
	transition: color 0.15s, background-color 0.15s;
}

:where(.rs-social-shape) :where(.rs-social-link) {
	width: 2.2em;
	height: 2.2em;
	background: rgba(0, 0, 0, 0.08);
}

:where(.rs-social-circle) :where(.rs-social-link) {
	border-radius: 50%;
}

:where(.rs-social-rounded) :where(.rs-social-link) {
	border-radius: 0.4em;
}

/* ---------- Post content ---------- */

:where(.rs-post-content) :where(img) {
	max-width: 100%;
	height: auto;
}

:where(.rs-post-content) > :last-child {
	margin-bottom: 0;
}

/* ---------- Default templates (Rocketsites draws the page, no part set) ---------- */

:where(.rs-default) {
	max-width: var(--rs-row-max, 1100px);
	margin: 0 auto;
	padding: 48px 20px;
}

:where(.rs-default-meta) {
	opacity: 0.75;
	font-size: 0.9em;
}

:where(.rs-default-image) {
	margin: 0 0 24px;
}

:where(.rs-default-item) {
	padding: 0 0 24px;
	margin: 0 0 24px;
	border-bottom: 1px solid #e5e5e5;
}
