/*
 * BVI Yacht Charters - front page
 * Loaded on the home page only (see front-page.php). Mobile first.
 *
 *   .panel          full-width band; grows with its content (no fixed heights)
 *   .panel--image   photo band: <img class="panel__bg"> sits behind the text
 *   .panel--solid   white band
 *   .cols           equal-width columns that stack on small screens
 *
 * Selectors are prefixed with .front-page so they win over the older global
 * rules in style.css without needing !important.
 */

/* Design tokens
--------------------------------------------- */

.front-page {
	--header-h: 73px;
	/* fixed header height, phones */
	--pad-x: clamp(16px, 4vw, 48px);
	--pad-y: clamp(40px, 7vw, 96px);
	--gap: clamp(20px, 3vw, 48px);
	--orange: #ff4800;
	--blue: #0350ac;
}

@media (min-width: 751px) {
	.front-page {
		--header-h: 113px;
	}

	/* logo stacked above nav */
}

@media (min-width: 1024px) {
	.front-page {
		--header-h: 88px;
	}

	/* logo and nav on one row */
}

/* Neutralise the Genesis wrappers so panels can run edge to edge
--------------------------------------------- */

.front-page .site-inner,
.front-page .site-inner>.wrap,
.front-page .content-sidebar-wrap,
.front-page .content {
	float: none;
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
}

/* Panel
--------------------------------------------- */

.front-page .content .panel {
	position: relative;
	isolation: isolate;
	display: flex;
	align-items: center;
	width: 100%;
	margin: 0;
	padding: var(--pad-y) var(--pad-x);
	overflow: hidden;
	scroll-margin-top: var(--header-h);
	background: #fff;
	color: #000;
	font-size: clamp(1rem, .94rem + .3vw, 1.25rem);
	line-height: 1.55;
}

.front-page .panel__inner {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
}

.front-page .panel__body {
	width: 100%;
	max-width: 46rem;
}

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

.front-page .content .panel--image {
	min-height: clamp(420px, 60vh, 760px);
	min-height: clamp(420px, 60svh, 760px);
	background-color: var(--blue);
	color: #fff;
	--focal: 50% 50%;
	/* override per panel to move the crop */
	--scrim: linear-gradient(rgba(0, 20, 50, .55), rgba(0, 20, 50, .55));
}

.front-page .panel__bg {
	position: absolute;
	inset: 0;
	z-index: -2;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: var(--focal);
}

/* Darkening layer so white text stays readable on any part of the photo */
.front-page .panel--image::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--scrim);
}

@media (min-width: 768px) {

	/* Text sits on the left, so darken left and let the photo breathe on the right */
	.front-page .content .panel--image:not(.panel--hero) {
		--scrim: linear-gradient(90deg, rgba(0, 20, 50, .72) 0%, rgba(0, 20, 50, .5) 50%, rgba(0, 20, 50, .12) 100%);
	}
}

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

.front-page .content .panel--hero {
	justify-content: center;
	min-height: clamp(520px, 88vh, 920px);
	min-height: clamp(520px, 88svh, 920px);
	padding-top: calc(var(--header-h) + var(--pad-y));
	text-align: center;
	--scrim: linear-gradient(180deg, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .15) 40%, rgba(0, 0, 0, .35) 100%);
}

.front-page .panel--hero .panel__inner {
	max-width: 960px;
}

.front-page .home-page-title .textwidget {
	float: none;
	width: auto;
}

.front-page .panel-subtitle {
	margin: 0 0 1.5em;
	font-size: clamp(1.15rem, .9rem + 1.6vw, 2.25rem);
	font-weight: 300;
	letter-spacing: .02em;
	line-height: 1.25;
	text-align: center;
	text-transform: none;
	color: #fff;
	text-shadow: 0 2px 6px rgba(0, 0, 0, .45);
}

.front-page .panel--hero .aligncenter {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin: 0;
}

@media (max-width: 480px) {
	.front-page .panel--hero .aligncenter .button {
		flex: 1 1 100%;
	}
}

/* Headings
--------------------------------------------- */

.front-page .panel .panel-title {
	margin: 0 0 .6em;
	font-size: clamp(1.75rem, 1.1rem + 3vw, 3.75rem);
	font-weight: 300;
	letter-spacing: .03em;
	line-height: 1.1;
	text-transform: uppercase;
	text-align: left;
	overflow-wrap: anywhere;
}

.front-page .panel--solid .panel-title {
	text-align: center;
	color: var(--orange);
	text-shadow: none;
}

.front-page .panel--image .panel-title {
	color: #fff;
	text-shadow: 0 2px 6px rgba(0, 0, 0, .45);
}

/* Hero title: kept below the generic title rule so it wins the tie */
.front-page .panel--hero .panel-title {
	margin: 0 0 .25em;
	font-size: clamp(2.1rem, 1rem + 4.5vw, 4.5rem);
	line-height: 1.05;
	text-align: center;
	text-transform: none;
	/* "BVI Yacht Charters", keep as typed */
}

/* Widget headings inside panels */
.front-page .panel--solid .widget-title {
	margin: 0 0 .6em;
	padding: 0;
	border: 0;
	font-size: clamp(1.4rem, 1.05rem + 1.4vw, 2.4rem);
	font-weight: 300;
	letter-spacing: .03em;
	line-height: 1.1;
	text-transform: uppercase;
	color: var(--orange);
}

.front-page .panel--image .textwidget :is(h2, h3, h4, h5, h6):not(.panel-title, .panel-subtitle) {
	margin: 1em 0 .4em;
	font-size: clamp(1.25rem, 1rem + 1vw, 2rem);
	line-height: 1.2;
	text-align: left;
	color: #fff;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}

.front-page .panel--image .textwidget> :first-child {
	margin-top: 0;
}

/* Body copy
--------------------------------------------- */

.front-page .panel p {
	margin: 0 0 1em;
	text-align: left;
}

.front-page .panel--image :is(p, li, .textwidget) {
	color: #fff;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}

.front-page .panel--image .textwidget ul {
	margin: 0 0 1.25em 1.25em;
	padding-left: 1em;
}

.front-page .panel--image .textwidget li {
	margin: 0 0 .35em;
	padding: 0;
	list-style: disc;
}

.front-page .panel--image a:not(.button) {
	color: #fff;
	text-decoration: underline;
	text-underline-offset: .15em;
}

.front-page .panel--image a:not(.button):hover {
	color: #7fd4ec;
}

/* Buttons: spacing + readable "clear" variant on photos */
.front-page .panel .button {
	margin: 0 .5rem .5rem 0;
}

.front-page .panel--hero .button {
	margin: 0;
}

.front-page .panel--image .button.clear {
	background-color: transparent;
	border-color: #fff;
	color: #fff;
}

.front-page .panel--image .button.clear:hover {
	background-color: #fff;
	border-color: #fff;
	color: #003;
}

/* Columns
--------------------------------------------- */

.front-page .cols {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--gap);
	align-items: start;
}

.front-page .cols__item {
	display: flow-root;
	/* contains floats from widget content */
	min-width: 0;
}

@media (min-width: 600px) {
	.front-page .cols--3 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	/* A lone third item gets the full row instead of half a row */
	.front-page .cols--3>.cols__item:last-child:nth-child(odd) {
		grid-column: 1 / -1;
	}
}

@media (min-width: 768px) {
	.front-page .cols--2 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 900px) {
	.front-page .cols--3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.front-page .cols--3>.cols__item:last-child:nth-child(odd) {
		grid-column: auto;
	}
}

/* Welcome
--------------------------------------------- */

/* Embedded video scales with its column instead of staying 300px wide */
.front-page .home-welcome iframe,
.front-page .home-welcome video {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	border: 0;
}

.front-page .home-welcome .featured-content img {
	display: block;
	width: 100%;
	height: auto;
	margin: 0 0 1em;
}

/* Fleet
--------------------------------------------- */

.front-page .home-page-fleet {
	margin: 0 0 var(--gap);
}

.front-page .home-fleet .widget p,
.front-page .home-fleet .widget-title {
	text-align: center;
}

.front-page .home-fleet .featured-content img {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 0 auto 1em;
}

/* Testimonials
--------------------------------------------- */

.front-page .home-testimonials .widget-wrap {
	display: flow-root;
}

.front-page .home-testimonials .textwidget {
	margin: 0 0 var(--gap);
}

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

.front-page .home-contact .contact-details .one-half {
	margin-bottom: 1em;
}
