/* =========================================================================
   Ponte Villas — homepage CSS (Elementor Phase 2)
   Deploy to wp-content/mu-plugins/ponte-villas-global/home.css
   Enqueued by ponte-villas-global.php only when is_front_page().

   SCOPE — deliberately limited to what Elementor's own controls cannot
   express, translated from prototype/assets/css/style.css v2.4:
     1. exact prototype compositions, plus the 900 / 720 / 560 breakpoints
        Elementor does not offer (its kit only has 1024 and 767)
     2. hero full-viewport media + gradient overlay
     3. rail overflow, scroll-snap and controls
     4. image crops (aspect-ratio + object-fit)
     5. sticky island copy column
     6. manual slider state (cross-fade)
     7. progressive reveal
     8. reduced motion + safe area

   Everything else — copy, images, colour, type, section spacing that the
   client may reasonably want to change — is Elementor widget settings and
   the Global Colours / Global Fonts in kit 56.

   Colour values reference Elementor global colour variables; the hex after
   the comma is the fallback used before the kit stylesheet loads.
   ========================================================================= */

:root {
	--pv-section-y: clamp(5rem, 13vw, 12rem);
	--pv-section-y-tight: clamp(3.5rem, 8vw, 6.5rem);
}

/* Section rhythm — one clamp, matching the prototype's --section-y. -------
   Elementor cannot express a clamp() in its padding control, so the two
   section paddings live here and the containers carry no padding of
   their own. */

.pv-home-section { padding-block: var(--pv-section-y); }
.pv-home-section--tight { padding-block: var(--pv-section-y-tight); }
.pv-home-section--flush-top { padding-top: 0; }

/* The three boxed containers on the page are the section wrappers, the hero
   copy block and the full-bleed copy block. Elementor puts the flex context
   on their inner element, so gutters and gaps are set there. */
.pv-home-section > .e-con-inner,
.pv-hero-inner > .e-con-inner,
.pv-fb-inner > .e-con-inner {
	padding-inline: var(--pv-gutter);
}

/* 1. HERO --------------------------------------------------------------
   Full viewport, headline bottom-left, photo behind. The media widget is
   taken out of flow so the hero content sits over it; nothing here waits
   on JavaScript, and the image is never hidden or faded in — it is the
   LCP element. */

.pv-hero {
	position: relative;
	min-height: 100svh;
	justify-content: flex-end;
	overflow: hidden;
	padding: 0;
	color: var(--e-global-color-ondark, #F1EFE9);
}

/* The fixed header sits under the admin bar; keep the hero clear of it. */
body.admin-bar .pv-hero { min-height: calc(100svh - var(--pv-admin-bar)); }

.pv-hero-media {
	position: absolute;
	inset: 0;
	z-index: 0;
	width: 100%;
	margin: 0;
}

.pv-hero-media .elementor-widget-container,
.pv-hero-media figure,
.pv-hero-media a { height: 100%; }

.pv-hero-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center 55%;
	/* The prototype's settle: a 6% overscan easing back to true scale. Pure
	   CSS and opacity never drops, so the LCP image paints immediately. */
	transform: scale(1.06);
	animation: pvHeroSettle 2.4s var(--pv-ease) forwards;
}

@keyframes pvHeroSettle { to { transform: scale(1); } }

/* Readability wash — the prototype gradient, top and bottom. */
.pv-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background: linear-gradient(180deg, rgba(30, 36, 32, .34) 0%, rgba(30, 36, 32, .04) 38%, rgba(30, 36, 32, .6) 100%);
}

.pv-hero-inner {
	position: relative;
	z-index: 2;
	padding-bottom: clamp(3rem, 8vw, 6rem);
}

.pv-hero-inner > .e-con-inner { gap: 0; align-items: flex-start; }

.pv-hero-title {
	max-width: 14ch;
	font-size: clamp(2.4rem, 6vw, 5.2rem);
	line-height: 1.12;
	color: var(--e-global-color-ondark, #F1EFE9);
}

.pv-hero-title .pv-display-i { font-style: italic; }

.pv-hero-lead {
	max-width: 38ch;
	margin-top: 1.4rem;
	color: rgba(241, 239, 233, .85);
}

/* Hero copy rises on load. A CSS animation, not a JS-gated reveal — it
   runs and completes whether or not home.js ever arrives. */
.pv-hero-title,
.pv-hero-lead {
	opacity: 0;
	transform: translateY(22px);
	animation: pvHeroUp 1.1s var(--pv-ease) forwards;
}

.pv-hero-lead { animation-delay: .18s; }

@keyframes pvHeroUp { to { opacity: 1; transform: none; } }

/* The prototype's cue: a word over a 40px hairline with a bright segment
   travelling down it. It carries no information a screen-reader user needs
   — "scroll down" is not an instruction, it is decoration — so the whole
   thing is aria-hidden in the markup and stays out of the accessibility
   tree whether or not any script runs. */
.pv-scroll-cue {
	position: absolute;
	left: 50%;
	bottom: calc(1.6rem + env(safe-area-inset-bottom, 0px));
	transform: translateX(-50%);
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: .7rem;
	font-family: "DM Sans", Arial, sans-serif;
	font-size: .58rem;
	font-weight: 500;
	letter-spacing: .3em;
	text-transform: uppercase;
	color: rgba(241, 239, 233, .7);
}

.pv-scroll-cue i {
	display: block;
	width: 1px;
	height: 40px;
	position: relative;
	overflow: hidden;
	background: rgba(241, 239, 233, .35);
}

.pv-scroll-cue i::after {
	content: "";
	position: absolute;
	top: -40px;
	left: 0;
	width: 100%;
	height: 40px;
	background: var(--e-global-color-ondark, #F1EFE9);
	animation: pvCue 2.4s var(--pv-ease) infinite;
}

@keyframes pvCue { to { top: 40px; } }

/* 2. STATEMENT — indented, generous air --------------------------------- */

.pv-statement {
	padding-left: clamp(0rem, 11vw, 13rem);
	max-width: 60rem;
}

.pv-statement-text p {
	max-width: 24ch;
	font-size: clamp(1.35rem, 2.9vw, 2.35rem);
	line-height: 1.42;
	letter-spacing: -.01em;
}

/* 3. OFFSET FEATURE — big image, copy dropped bottom-right --------------- */

.pv-offset {
	display: grid;
	grid-template-columns: minmax(0, 62%) minmax(0, 1fr);
	gap: clamp(1.8rem, 4vw, 4rem);
	align-items: end;
}

.pv-of-media { aspect-ratio: 5 / 4; }
.pv-of-body { padding-bottom: .5rem; }

/* 4. ACCOMMODATION RAIL ------------------------------------------------- */

.pv-rail {
	display: grid;
	grid-template-columns: minmax(0, 28%) minmax(0, 1fr);
	gap: clamp(2rem, 4vw, 4rem);
	align-items: start;
}

.pv-rail-head {
	position: sticky;
	top: 7rem;
	gap: 0;
}

.pv-rail-head .pv-eyebrow { margin-bottom: 1.4rem; }
.pv-rail-head .pv-rail-title { margin-bottom: 1.6rem; max-width: 12ch; }
.pv-rail-head .pv-rail-intro { max-width: 30ch; }

.pv-rail-controls {
	display: flex;
	gap: .6rem;
	margin-top: 1.4rem;
}

.pv-rail-btn {
	width: 44px;
	height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--e-global-color-text, #2B2C28);
	background: none;
	border: 1px solid var(--e-global-color-line, rgba(43, 44, 40, .14));
	cursor: pointer;
	transition: background .4s var(--pv-ease), color .4s var(--pv-ease), border-color .4s var(--pv-ease);
}

.pv-rail-btn:hover {
	background: var(--e-global-color-text, #2B2C28);
	color: var(--e-global-color-paper, #F4F2ED);
	border-color: var(--e-global-color-text, #2B2C28);
}

.pv-rail-controls .pv-rail-btn:hover {
	background: var(--e-global-color-text, #2B2C28);
	color: var(--e-global-color-paper, #F4F2ED);
	border-color: var(--e-global-color-text, #2B2C28);
}

.pv-rail-controls .pv-rail-btn {
	width: 44px;
	height: 44px;
	min-width: 44px;
	min-height: 44px;
	padding: 0;
	background: none;
	color: var(--e-global-color-text, #2B2C28);
	border: 1px solid var(--e-global-color-line, rgba(43, 44, 40, .14));
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
}

.pv-rail-controls .pv-rail-btn svg {
	width: 18px;
	height: 18px;
	flex: none;
}

/* Cards run off the right edge of the container, exactly as far as the
   gutter — never past the viewport, so this adds no horizontal overflow. */
.pv-rail-track {
	flex-direction: row;
	flex-wrap: nowrap;
	gap: clamp(1rem, 2vw, 1.8rem);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding-bottom: 1.6rem;
	margin-right: calc(-1 * var(--pv-gutter));
	padding-right: var(--pv-gutter);
	scrollbar-width: thin;
	scrollbar-color: var(--e-global-color-accent, #B7C4B2) transparent;
}

.pv-rail-track::-webkit-scrollbar { height: 2px; }
.pv-rail-track::-webkit-scrollbar-thumb { background: var(--e-global-color-accent, #B7C4B2); }

.pv-rail-item {
	position: relative;
	flex: 0 0 clamp(230px, 26vw, 340px);
	scroll-snap-align: start;
	gap: 0;
	padding: 0;
}

.pv-rail-track > .pv-rail-item {
	flex: 0 0 clamp(230px, 26vw, 340px);
}

.pv-ri-media {
	aspect-ratio: 4 / 3;
	margin-bottom: 1.1rem;
	overflow: hidden;
}

.pv-ri-title { margin-bottom: .35rem; }

/* One anchor per card, stretched over the whole card: the entire card is
   clickable, but there is still only a single link and a single tab stop. */
.pv-ri-title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 3;
}

/* 5. FULL-BLEED BREAK — one line only ----------------------------------- */

.pv-fullbleed {
	position: relative;
	min-height: clamp(20rem, 52vh, 34rem);
	justify-content: center;
	overflow: hidden;
	padding: 0;
	color: var(--e-global-color-ondark, #F1EFE9);
}

.pv-fb-media {
	position: absolute;
	inset: 0;
	z-index: 0;
	width: 100%;
	margin: 0;
}

.pv-fb-media .elementor-widget-container,
.pv-fb-media figure { height: 100%; }

.pv-fb-media img { width: 100%; height: 100%; object-fit: cover; }

.pv-fullbleed::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background: rgba(30, 36, 32, .38);
}

.pv-fb-inner { position: relative; z-index: 2; }
.pv-fb-inner > .e-con-inner { align-items: center; }

.pv-fb-text p {
	max-width: 20ch;
	margin-inline: auto;
	font-size: clamp(1.4rem, 3.2vw, 2.6rem);
	line-height: 1.35;
}

/* 6. EXPERIENCES COLLAGE — staggered, two different image heights ------- */

.pv-collage {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: clamp(1.2rem, 3vw, 3rem);
	align-items: start;
}

.pv-col-a { padding-top: clamp(0rem, 6vw, 5rem); }
.pv-col-head { margin-bottom: clamp(2rem, 4vw, 3.5rem); gap: 1.2rem; }
.pv-col-head .pv-collage-title { max-width: 13ch; }

/* The upper collage image is a temporary stand-in — the client has not
   supplied underwater/diving photography yet. The replacement note lives on
   the image widget itself, visible in the Elementor navigator. Nothing here
   needs to change when the real photo arrives: the crop is fixed. */
.pv-fig-a { aspect-ratio: 4 / 3; }
.pv-fig-b { aspect-ratio: 4 / 3; margin-top: clamp(3rem, 10vw, 9rem); }

.pv-figcaption { margin-top: .9rem; }
.pv-collage-foot { margin-top: clamp(2.5rem, 5vw, 4rem); }

/* 7. CENTRED FEATURE — wide image, caption tucked left ------------------ */

.pv-centred { text-align: center; }
.pv-centred .pv-eyebrow { margin-bottom: 1.3rem; }

.pv-centred-title {
	max-width: 20ch;
	margin: 0 auto clamp(2.5rem, 5vw, 3.5rem);
}

.pv-cf-media { aspect-ratio: 21 / 9; }

.pv-cf-caption {
	text-align: left;
	max-width: 32ch;
	margin-top: 1.6rem;
	align-items: flex-start;
	gap: 1.3rem;
}

/* 8. ISLAND — copy sticks while the slider scrolls ---------------------- */

.pv-island-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 42%);
	gap: clamp(2rem, 5vw, 5rem);
	align-items: start;
}

.pv-island-copy { position: sticky; top: 7rem; gap: 0; }
.pv-island-copy .pv-eyebrow { margin-bottom: 1.3rem; }
.pv-island-copy .pv-island-title { margin-bottom: 1.5rem; max-width: 14ch; }
.pv-island-copy .pv-island-text { margin-bottom: 1.2rem; }

/* Arrival information — label/value rows. Every row is two ordinary
   Elementor widgets, so travel times and fares stay client-editable and
   can be lifted into theme settings later without touching this file. */
.pv-arrival-list {
	margin-top: 2.2rem;
	border-top: 1px solid var(--e-global-color-line, rgba(43, 44, 40, .14));
	gap: 0;
	padding: 0;
}

.pv-arrival-row {
	flex-direction: row;
	align-items: baseline;
	justify-content: space-between;
	gap: 1.5rem;
	padding: 1rem 0;
	border-bottom: 1px solid var(--e-global-color-line, rgba(43, 44, 40, .14));
}

.pv-arrival-value { text-align: right; }
.pv-island-actions { margin-top: 2.2rem; }

.pv-island-media { aspect-ratio: 4 / 5; padding: 0; }

/* The slider is progressive enhancement. Without JavaScript the three
   photos simply stack in normal flow — nothing is hidden. Only once
   home.js marks the slider ready do the slides stack and cross-fade. */
.pv-island-slider {
	position: relative;
	width: 100%;
	height: 100%;
	overflow: hidden;
	padding: 0;
	gap: 0;
}

.pv-island-slider .pv-is-slide { width: 100%; margin: 0; }
.pv-island-slider .pv-is-slide img { width: 100%; height: 100%; object-fit: cover; }

.pv-island-slider.is-ready .pv-is-slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity .9s var(--pv-ease);
}

.pv-island-slider.is-ready .pv-is-slide.is-active { opacity: 1; }

.pv-island-slider.is-ready::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 38%;
	z-index: 1;
	pointer-events: none;
	background: linear-gradient(180deg, rgba(13, 20, 17, 0) 0%, rgba(13, 20, 17, .5) 100%);
}

/* The controls are meaningless without the slider script, so they stay
   hidden until it takes over. */
.pv-is-controls { display: none; }

.pv-island-slider.is-ready .pv-is-controls {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1.3rem 1.4rem;
	margin: 0;
}

.pv-is-count {
	font-family: "DM Sans", Arial, sans-serif;
	font-size: .68rem;
	font-weight: 500;
	letter-spacing: .18em;
	color: var(--e-global-color-ondark, #F1EFE9);
}

.pv-is-arrows { display: flex; gap: .5rem; }

.pv-is-arrow {
	width: 34px;
	height: 34px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid rgba(248, 243, 232, .5);
	border-radius: 50%;
	color: var(--e-global-color-ondark, #F1EFE9);
	background: none;
	cursor: pointer;
	transition: background .35s var(--pv-ease), border-color .35s var(--pv-ease), color .35s var(--pv-ease);
}

.pv-is-arrow:hover {
	background: var(--e-global-color-ondark, #F1EFE9);
	border-color: var(--e-global-color-ondark, #F1EFE9);
	color: var(--e-global-color-primary, #4F6355);
}

/* Shared image crops + the prototype's cream hover veil ------------------ */

.pv-of-media img,
.pv-ri-media img,
.pv-fig-a img,
.pv-fig-b img,
.pv-cf-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.pv-ri-media,
.pv-fig-a,
.pv-fig-b { position: relative; }

.pv-ri-media::after,
.pv-fig-a::after,
.pv-fig-b::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
	background: var(--e-global-color-paper, #F4F2ED);
	opacity: 0;
	transition: opacity .6s var(--pv-ease);
	pointer-events: none;
}

.pv-rail-item:hover .pv-ri-media::after,
.pv-rail-item:focus-within .pv-ri-media::after,
.pv-fig-a:hover::after,
.pv-fig-b:hover::after { opacity: .22; }

/* Text link — a real Elementor Button widget, styled as the prototype's
   underlined caps link so the client keeps the label and URL controls. */

.pv-textlink .elementor-button {
	display: inline-block;
	font-family: "DM Sans", Arial, sans-serif;
	font-size: .66rem;
	font-weight: 500;
	letter-spacing: .2em;
	text-transform: uppercase;
	color: var(--e-global-color-text, #2B2C28);
	background: none;
	border: 0;
	border-bottom: 1px solid var(--e-global-color-line, rgba(43, 44, 40, .14));
	border-radius: 0;
	padding: 0 0 .45rem;
	transition: border-color .45s var(--pv-ease), color .45s var(--pv-ease);
}

.pv-textlink .elementor-button:hover {
	color: var(--e-global-color-secondary, #7E9481);
	border-bottom-color: var(--e-global-color-secondary, #7E9481);
}

/* Micro-labels — the prototype's small caps set. These are design-system
   elements rather than page copy: the words stay editable as ordinary
   Heading widgets, only their treatment is fixed here. */

.pv-eyebrow,
.pv-ri-cat,
.pv-figcaption {
	font-family: "DM Sans", Arial, sans-serif;
	font-weight: 500;
	text-transform: uppercase;
	color: var(--e-global-color-muted, #6B6A63);
}

.pv-eyebrow { font-size: .66rem; letter-spacing: .26em; }
.pv-ri-cat { font-size: .62rem; letter-spacing: .22em; }
.pv-figcaption { font-size: .64rem; letter-spacing: .2em; }

.pv-arrival-label {
	font-family: "DM Sans", Arial, sans-serif;
	font-size: .9rem;
	color: var(--e-global-color-muted, #6B6A63);
}

.pv-arrival-value {
	font-family: var(--e-global-typography-primary-font-family, "Fraunces"), Georgia, serif;
	font-weight: 400;
	font-size: 1.05rem;
	color: var(--e-global-color-text, #2B2C28);
}

/* Container gaps the compositions depend on. Elementor's default container
   gap would otherwise stack on top of the margins set above. */

.pv-centred,
.pv-figure { gap: 0; }

.pv-figure { padding: 0; }
.pv-of-body { gap: 1.6rem; }
.pv-of-text p { max-width: 34ch; }

/* 9. Progressive reveal -------------------------------------------------
   Moved to global.css in Phase 3A.1 so every template shares one utility:
   .pv-reveal plus .pv-reveal-delay-1/2/3. Nothing reveal-related lives in
   this file any more. */

/* 10. Responsive — the prototype's own breakpoints ---------------------- */

@media (max-width: 1024px) {
	.pv-rail { grid-template-columns: 1fr; gap: 2rem; }
	.pv-rail-head { position: static; }
	.pv-island-copy { position: static; }
}

@media (max-width: 900px) {
	.pv-offset,
	.pv-island-grid { grid-template-columns: 1fr; gap: 2rem; }

	.pv-collage { grid-template-columns: 1fr; gap: 1.6rem; }
	.pv-col-a { padding-top: 0; }
	.pv-fig-b { margin-top: 0; }
	.pv-statement { padding-left: 0; }
	.pv-of-body { padding-bottom: 0; }
}

@media (max-width: 720px) {
	.pv-rail-track > .pv-rail-item { flex: 0 0 76vw; }
}

@media (max-width: 560px) {
	.pv-island-actions .elementor-button,
	.pv-island-actions .elementor-widget-button { width: 100%; }
	.pv-arrival-row { gap: 1rem; }
}

/* 11. Reduced motion ---------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.pv-island-slider.is-ready .pv-is-slide { transition: none; }
	.pv-scroll-cue i::after { display: none; }

	/* Everything arrives already in place — no settle, no rise, no cue. */
	.pv-hero-media img { transform: none; animation: none; }

	.pv-hero-title,
	.pv-hero-lead { opacity: 1; transform: none; animation: none; }

	.pv-rail-btn,
	.pv-is-arrow,
	.pv-textlink .elementor-button,
	.pv-ri-media::after,
	.pv-fig-a::after,
	.pv-fig-b::after { transition-duration: .001ms; }
}

/* 12. Elementor editor canvas ------------------------------------------
   The hero media and the fullbleed media are absolutely positioned, and
   the slider stacks its slides — all three would be unselectable in the
   editor. Put them back in flow there. */

body.elementor-editor-active .pv-hero,
body.elementor-editor-active .pv-fullbleed { min-height: 0; }

body.elementor-editor-active .pv-hero-media,
body.elementor-editor-active .pv-fb-media {
	position: relative;
	inset: auto;
}

body.elementor-editor-active .pv-hero::after,
body.elementor-editor-active .pv-fullbleed::after { display: none; }

body.elementor-editor-active .pv-island-slider .pv-is-slide {
	position: relative;
	inset: auto;
	opacity: 1;
}

body.elementor-editor-active .pv-is-controls { display: flex; position: relative; }

body.elementor-editor-active .pv-rail-head,
body.elementor-editor-active .pv-island-copy { position: static; }
