/*
 * Page components ("Remiza" redesign). Used by the page HTML in Elementor text widgets
 * (sources: redesign/pages/*.html). Everything is prefixed osp- and wrapped in .osp-page.
 */

/* ------------------------------------------------------------ page shell */
/* A designed page takes the full width; components set their own width. */

body:has(.osp-page) .content-limiter,
body:has(.osp-page) .real-content,
body:has(.osp-page) .formatter {
	max-width: none;
	width: auto;
	padding: 0;
	margin: 0;
}

body:has(.osp-page) #content .content-box,
body:has(.osp-page) #content .elementor-widget-text-editor,
body:has(.osp-page) #content .elementor-widget-container {
	padding: 0;
	margin: 0;
}

body:has(.osp-page) .elementor-element.e-con {
	--padding-top: 0;
	--padding-bottom: 0;
	--padding-left: 0;
	--padding-right: 0;
	--gap: 0;
}

.osp-page {
	overflow-x: clip;
}

.osp-page > :last-child {
	margin-bottom: 0;
}

.osp-wrap {
	box-sizing: border-box;
	max-width: calc(var(--osp-wide) + 2 * var(--osp-gutter));
	margin-left: auto;
	margin-right: auto;
	padding-left: var(--osp-gutter);
	padding-right: var(--osp-gutter);
}

/* Rife indents lists in content; component lists sit flush */
#content .osp-page ul.osp-tiles,
#content .osp-page ul.osp-fbl__list {
	margin-left: 0;
	margin-right: 0;
}

/* the latest-posts row directly after a white section: one gap, not two */
.osp-section:not(.osp-section--plaster):not(.osp-section--dark) + .osp-fbl {
	padding-top: 0;
}

.osp-prose {
	max-width: var(--osp-prose);
}

.osp-page p {
	margin: 0 0 1em;
}

.osp-page p:last-child {
	margin-bottom: 0;
}

/* ------------------------------------------------------------ page header */
/* Photo of the unit, title bottom-left on a graphite scrim, chevron stripe on the edge. */

.osp-head {
	position: relative;
	display: flex;
	align-items: flex-end;
	min-height: clamp(300px, 46vw, 500px);
	background: var(--osp-graphite);
	color: var(--osp-white);
	isolation: isolate;
}

.osp-head__media {
	position: absolute;
	inset: 0;
	z-index: -1;
}

.osp-head__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: var(--osp-focus, 50% 50%);
}

.osp-head__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(42, 44, 48, 0.88) 0%, rgba(42, 44, 48, 0.55) 38%, rgba(42, 44, 48, 0) 72%);
}

.osp-head__inner {
	width: 100%;
	padding-top: 3rem;
	padding-bottom: clamp(2.25rem, 5vw, 3.5rem);
}

#content .osp-head h1 {
	margin: 0;
	color: var(--osp-white);
	font-size: var(--osp-h1);
	line-height: 1;
	max-width: 20ch;
}

.osp-page .osp-head__lead {
	max-width: 38rem;
	margin: 0.9rem 0 0;
	font-size: clamp(1.1rem, 1.6vw, 1.3rem);
	line-height: 1.45;
	color: rgba(255, 255, 255, 0.92);
}

/* parent page link above the title (JOT sub-pages) */
.osp-page .osp-head__up {
	display: inline-block;
	margin: 0 0 0.6rem;
	font-weight: 600;
}

#content .osp-head__up a {
	color: var(--osp-white);
	text-decoration: underline;
	text-decoration-color: rgba(255, 255, 255, 0.5);
}

/* chevron stripe: the reflective marking on the back of a fire engine */
.osp-head::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 8px;
	background: repeating-linear-gradient(-45deg, var(--osp-red) 0 12px, var(--osp-white) 12px 24px);
}

/* no photo: plaster band, graphite text */
.osp-head--plain {
	min-height: 0;
	background: var(--osp-plaster);
	color: var(--osp-graphite);
}

.osp-head--plain .osp-head__inner {
	padding-top: clamp(2.5rem, 6vw, 4.5rem);
}

#content .osp-head--plain h1 {
	color: var(--osp-graphite);
}

.osp-head--plain .osp-head__lead {
	color: var(--osp-graphite-2);
}

#content .osp-head--plain .osp-head__up a {
	color: var(--osp-red);
	text-decoration-color: currentColor;
}

/* vehicles page: graphite band, the Steyr parked on the chevron stripe */
.osp-head--vehicle {
	min-height: 0;
	align-items: stretch;
}

.osp-head--vehicle .osp-head__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
	align-items: end;
	gap: 1rem clamp(1.5rem, 4vw, 3rem);
	padding-top: clamp(2.5rem, 5vw, 3.5rem);
	padding-bottom: 0;
}

.osp-head--vehicle .osp-head__text {
	padding-bottom: clamp(2.25rem, 5vw, 3.5rem);
}

.osp-head__vehicle img {
	display: block;
	width: 100%;
	max-width: 560px;
	height: auto;
	margin: 0 0 -2px auto;
	position: relative;
	z-index: 1;
}

/* --------------------------------------------------------------- sections */

.osp-section {
	padding-top: var(--osp-section);
	padding-bottom: var(--osp-section);
}

/* two white sections in a row share one gap */
.osp-section:not(.osp-section--plaster):not(.osp-section--dark) + .osp-section:not(.osp-section--plaster):not(.osp-section--dark) {
	padding-top: 0;
}

.osp-section--plaster {
	background: var(--osp-plaster);
}

.osp-section--dark {
	background: var(--osp-graphite);
	color: #DADCE0;
}

#content .osp-section--dark h2,
#content .osp-section--dark h3 {
	color: var(--osp-white);
}

#content .osp-page h2 {
	margin: 0 0 0.6em;
}

#content .osp-page h3 {
	margin: 0 0 0.4em;
}

.osp-intro {
	max-width: var(--osp-prose);
	margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
}

.osp-intro p {
	color: var(--osp-graphite-2);
}

.osp-lead {
	font-size: clamp(1.2rem, 1.8vw, 1.375rem);
	line-height: 1.5;
	color: var(--osp-graphite);
}

/* ---------------------------------------------------------------- contact */

.osp-contact {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	gap: clamp(2rem, 5vw, 4.5rem);
	align-items: start;
}

.osp-contact__list {
	margin: 0;
}

.osp-contact__list div {
	padding: 1.1rem 0;
	border-top: 1px solid var(--osp-line);
}

.osp-contact__list div:first-child {
	border-top: 0;
	padding-top: 0;
}

.osp-contact__list dt {
	margin: 0 0 0.2rem;
	font-family: var(--osp-font-display);
	font-size: 1.15rem;
	font-weight: 600;
	color: var(--osp-graphite-2);
}

.osp-contact__list dd {
	margin: 0;
	font-size: 1.1875rem;
	line-height: 1.5;
}

#content .osp-contact__list a {
	font-weight: 600;
	text-decoration: underline;
}

.osp-contact__map {
	position: relative;
	aspect-ratio: 4 / 3;
	background: var(--osp-plaster);
	border: 1px solid var(--osp-line);
}

.osp-contact__map iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* emergency note: the unit's phone is not an alarm line */
.osp-alarm {
	display: flex;
	align-items: baseline;
	gap: 0.9rem;
	margin-top: 2rem;
	padding: 1rem 1.25rem;
	background: var(--osp-graphite);
	color: var(--osp-white);
	border-left: 6px solid var(--osp-red);
}

.osp-alarm strong {
	font-family: var(--osp-font-display);
	font-size: 2rem;
	line-height: 1;
	font-weight: 700;
	color: var(--osp-white);
}

#content .osp-alarm a {
	color: var(--osp-white);
}

/* ----------------------------------------------------------- facts / tiles */

/* short list of requirements or key facts: columns divided by rules, no boxes */
.osp-facts {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0 clamp(1.5rem, 4vw, 3rem);
	margin: 0;
}

.osp-facts > div {
	padding-top: 1rem;
	border-top: 3px solid var(--osp-graphite);
}

.osp-facts dt {
	margin: 0 0 0.4rem;
	font-family: var(--osp-font-display);
	font-size: 1.6rem;
	font-weight: 700;
	line-height: 1.1;
	color: var(--osp-graphite);
}

.osp-facts dd {
	margin: 0;
	color: var(--osp-graphite-2);
}

/* tile showing an object cut out on a transparent background (equipment, vehicles) */
.osp-tile__media--object {
	background: var(--osp-plaster);
}

.osp-tile__media--object img {
	object-fit: contain;
	padding: 8% 10%;
	box-sizing: border-box;
}

.osp-section--plaster .osp-tile__media--object {
	background: var(--osp-white);
}

/* ------------------------------------------------------------ stats / crew */

/* counts from the unit's own data (qualifications, years) */
.osp-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem clamp(1.5rem, 4vw, 3.5rem);
	margin: 2rem 0 0;
}

.osp-stats > div {
	min-width: 7rem;
}

.osp-stats dt {
	font-family: var(--osp-font-display);
	font-size: clamp(2.75rem, 5vw, 3.75rem);
	font-weight: 700;
	line-height: 1;
	color: var(--osp-red);
}

.osp-stats dd {
	margin: 0.3rem 0 0;
	color: var(--osp-graphite-2);
	line-height: 1.3;
	max-width: 11rem;
}

/* phones: two even columns, centred, an odd last number sits in the middle */
@media (max-width: 600px) {
	.osp-stats {
		justify-content: center;
		gap: 1.75rem 1rem;
		text-align: center;
	}

	.osp-stats > div {
		flex: 0 0 calc(50% - 0.5rem);
		min-width: 0;
	}

	.osp-stats dd {
		margin-inline: auto;
	}
}

/* crew roster: rank insignia, name, function */
#content .osp-page ol.osp-crew {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 clamp(1.5rem, 4vw, 3rem);
	margin: 0;
	padding: 0;
	list-style: none;
}

.osp-crew li {
	display: grid;
	grid-template-columns: 48px 1fr;
	grid-template-rows: auto auto;
	column-gap: 1rem;
	align-items: center;
	margin: 0;
	padding: 0.85rem 0;
	border-bottom: 1px solid var(--osp-line);
}

.osp-crew li::before {
	content: none;
}

.osp-crew__rank {
	grid-row: 1 / 3;
	width: 48px;
	height: auto;
}

.osp-crew__name {
	align-self: end;
	font-weight: 600;
	line-height: 1.3;
}

.osp-crew__role {
	align-self: start;
	font-size: var(--osp-small);
	line-height: 1.35;
	color: var(--osp-graphite-2);
}

/* ------------------------------------------------------------------ specs */
/* equipment / vehicles: object photo on plaster + name + description, rows split by rules */

.osp-specs {
	border-top: 1px solid var(--osp-line);
}

.osp-spec {
	display: grid;
	grid-template-columns: minmax(200px, 340px) minmax(0, 1fr);
	gap: clamp(1.25rem, 4vw, 3.5rem);
	align-items: center;
	padding: clamp(1.75rem, 4vw, 2.75rem) 0;
	border-bottom: 1px solid var(--osp-line);
}

.osp-spec__media {
	aspect-ratio: 4 / 3;
	background: var(--osp-plaster);
}

.osp-spec__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 8%;
	box-sizing: border-box;
	mix-blend-mode: multiply; /* white backgrounds of non-transparent photos melt into plaster */
}

.osp-spec__body {
	max-width: var(--osp-prose);
}

#content .osp-spec h2,
#content .osp-spec h3 {
	font-size: clamp(1.5rem, 2.4vw, 1.9rem);
	margin: 0 0 0.5rem;
}

.osp-spec__body p {
	color: var(--osp-graphite);
}

/* key data of a vehicle or device */
.osp-spec__data {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0.25rem 1.25rem;
	margin: 1rem 0 0;
	font-size: var(--osp-small);
}

.osp-spec__data dt {
	font-weight: 600;
	color: var(--osp-graphite-2);
}

.osp-spec__data dd {
	margin: 0;
}

/* --------------------------------------------------------------- timeline */
/* Historia: a real sequence, so years are the markers; a red rule joins them */

#content .osp-page ol.osp-timeline {
	position: relative;
	margin: 0;
	padding: 0;
	list-style: none;
}

#content .osp-page .osp-timeline__item {
	position: relative;
	display: grid;
	grid-template-columns: 11rem minmax(0, 1fr);
	gap: 0 clamp(1.5rem, 4vw, 3rem);
	margin: 0;
	padding: 0 0 clamp(2.25rem, 5vw, 3.5rem);
}

.osp-timeline__item::before {
	content: none;
}

/* the rule runs between the year column and the text */
.osp-timeline__item::after {
	content: "";
	position: absolute;
	top: 0.4rem;
	bottom: 0;
	left: calc(11rem + clamp(0.75rem, 2vw, 1.5rem) - 1px);
	width: 2px;
	background: var(--osp-line);
}

.osp-timeline__item:last-child::after {
	bottom: auto;
	height: 2.5rem;
}

.osp-page .osp-timeline__year {
	position: relative;
	margin: 0;
	font-family: var(--osp-font-display);
	font-size: clamp(1.9rem, 3.2vw, 2.6rem);
	font-weight: 700;
	line-height: 1;
	color: var(--osp-red);
	text-align: right;
}

/* marker on the rule */
.osp-page .osp-timeline__year::after {
	content: "";
	position: absolute;
	top: 0.35em;
	right: calc(-1 * clamp(0.75rem, 2vw, 1.5rem) - 7px);
	width: 12px;
	height: 12px;
	border: 3px solid var(--osp-red);
	background: var(--osp-white);
	border-radius: 50%;
	z-index: 1;
}

.osp-timeline__body {
	max-width: var(--osp-prose);
	padding-left: 0.5rem;
}

#content .osp-timeline__body h3 {
	font-size: clamp(1.45rem, 2.4vw, 1.8rem);
	margin-bottom: 0.6rem;
}

.osp-timeline__body .osp-spec__data {
	margin: 0 0 0.6rem;
	font-size: 1rem;
}

#content .osp-timeline__body ul {
	margin: 0 0 1em;
	padding-left: 1.2rem;
}

#content .osp-timeline__body ul li {
	margin-bottom: 0.5em;
}

/* --------------------------------------------------------- figure, closing */

.osp-figure {
	margin: 0 0 clamp(2rem, 4vw, 3rem);
}

.osp-figure img {
	display: block;
	width: 100%;
	height: auto;
}

.osp-figure figcaption {
	margin-top: 0.75rem;
	font-size: var(--osp-small);
	color: var(--osp-graphite-2);
}

.osp-closing {
	margin: 0;
}

/* ---------------------------------------------------------- band, gallery */

/* text + one action on a dark band */
.osp-band {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem clamp(2rem, 5vw, 4rem);
}

.osp-band > div {
	max-width: var(--osp-prose);
}

.osp-page .osp-band > p {
	margin: 0;
}

/* photo grid; links open Elementor's lightbox */
#content .osp-page ul.osp-gallery {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

#content .osp-page .osp-gallery li {
	margin: 0;
	padding: 0;
}

.osp-gallery li::before {
	content: none;
}

.osp-gallery a,
.osp-gallery img {
	display: block;
}

.osp-gallery img {
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
	transition: opacity 0.15s ease;
}

.osp-gallery a:hover img {
	opacity: 0.85;
}

#content .osp-gallery a:focus-visible {
	outline-offset: 2px;
}

/* ------------------------------------------------------------ note, embed */

/* short announcement next to running text */
.osp-page .osp-note {
	margin-top: 1.5rem;
	padding: 0.9rem 1.15rem;
	border-left: 4px solid var(--osp-yellow);
	background: var(--osp-plaster);
	font-weight: 500;
}

/* third-party widget (zrzutka.pl) in a fixed-height frame */
.osp-embed {
	position: relative;
	height: 500px;
	border: 1px solid var(--osp-line);
	background: var(--osp-plaster);
}

.osp-embed iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* ------------------------------------------------------------- homepage */

.osp-head--home {
	min-height: clamp(520px, 78vh, 760px);
}

.osp-head--home .osp-head__media::after {
	background: linear-gradient(to top, rgba(42, 44, 48, 0.9) 0%, rgba(42, 44, 48, 0.6) 34%, rgba(42, 44, 48, 0.1) 70%, rgba(42, 44, 48, 0.25) 100%);
}

#content .osp-head--home h1 {
	max-width: none;
	font-size: clamp(3rem, 8vw, 6.75rem);
	line-height: 0.95;
}

.osp-head__pre {
	display: block;
	margin-bottom: 0.35rem;
	font-size: clamp(1.35rem, 2.6vw, 2.1rem);
	font-weight: 600;
	line-height: 1.1;
}

.osp-page .osp-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 1.75rem;
}

/* emergency number, full-width bar under the homepage photo */
.osp-alarmbar {
	background: var(--osp-graphite);
	color: var(--osp-white);
}

.osp-alarmbar .osp-alarm {
	margin: 0;
	padding: 1.15rem 0;
	border-left: 0;
	background: none;
	font-size: 1.125rem;
}

.osp-alarmbar .osp-alarm strong {
	font-size: 2.4rem;
	color: var(--osp-yellow);
}

/* photo links to the main sections */
.osp-tiles {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--osp-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.osp-tiles > li {
	margin: 0;
	padding: 0;
}

.osp-tiles > li::before {
	content: none;
}

#content a.osp-tile {
	display: flex;
	flex-direction: column;
	height: 100%;
	color: var(--osp-graphite);
	text-decoration: none !important;
}

.osp-tile__media {
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--osp-plaster);
}

.osp-tile__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: var(--osp-focus, 50% 50%);
}

.osp-tile__title {
	display: block;
	margin-top: 1rem;
	font-family: var(--osp-font-display);
	font-size: 1.75rem;
	font-weight: 700;
	line-height: 1.1;
}

.osp-tile__text {
	display: block;
	margin-top: 0.35rem;
	color: var(--osp-graphite-2);
}

#content a.osp-tile:hover .osp-tile__title,
#content a.osp-tile:focus-visible .osp-tile__title {
	color: var(--osp-red);
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 0.12em;
}

/* photo + text, side by side */
.osp-split {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: clamp(2rem, 5vw, 4.5rem);
	align-items: center;
}

.osp-split__media img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
}

.osp-split__body .osp-btn {
	margin-top: 1.5rem;
}

/* grant notice (required by the NIW / PROO grant) */
.osp-grant {
	padding-top: clamp(2.5rem, 5vw, 3.5rem);
	padding-bottom: clamp(2.5rem, 5vw, 3.5rem);
	border-top: 1px solid var(--osp-line);
}

.osp-grant a {
	display: block;
	max-width: 1030px; /* the trimmed NIW/PROO strip's own width (osp_grant_1030), so it stays sharp */
	margin: 0 auto;
}

.osp-grant img {
	display: block;
	width: 100%;
	height: auto;
}

@media (max-width: 900px) {
	.osp-tiles {
		grid-template-columns: 1fr 1fr;
	}

	.osp-facts {
		grid-template-columns: 1fr;
		gap: 1.75rem;
	}

	#content .osp-page ol.osp-crew {
		grid-template-columns: 1fr;
	}

	.osp-spec {
		grid-template-columns: 1fr;
	}

	#content .osp-page .osp-timeline__item {
		grid-template-columns: 1fr;
		padding-left: 1.75rem;
	}

	.osp-timeline__item::after {
		left: 0.35rem;
	}

	.osp-page .osp-timeline__year {
		text-align: left;
		margin-bottom: 0.5rem;
	}

	.osp-page .osp-timeline__year::after {
		right: auto;
		left: calc(-1.75rem - 1px);
	}

	.osp-timeline__body {
		padding-left: 0;
	}

	#content .osp-page ul.osp-gallery {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.osp-spec__media {
		max-width: 420px;
	}

	.osp-split {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 600px) {
	.osp-tiles {
		grid-template-columns: 1fr;
	}

	#content .osp-page ul.osp-gallery {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.osp-head.osp-head--home {
		min-height: 540px;
	}
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 900px) {
	.osp-contact {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 767px) {
	.osp-head {
		min-height: 360px;
	}

	.osp-head--plain,
	.osp-head--vehicle {
		min-height: 0;
	}

	.osp-head--vehicle .osp-head__inner {
		grid-template-columns: 1fr;
	}

	.osp-head--vehicle .osp-head__text {
		padding-bottom: 0;
	}

	.osp-head__vehicle img {
		max-width: 340px;
		margin-left: auto;
	}
}
