/* Stayly Homepage — Airbnb-inspired, container-agnostic sections */

/* ─── Sensible defaults; overridden by inline vars from settings ─── */
body.stayly-home-page {
	--sh-hero-h-d: 620px;
	--sh-hero-h-t: 520px;
	--sh-hero-h-m: 460px;
	--sh-content-max: 1200px;
	--sh-section-py: 64px;
	--sh-section-px-d: 24px;
	--sh-section-px-m: 16px;
	--sh-section-gap: 0px;
	--sh-radius: 14px;
	--sh-brand: #0f766e;
	--sh-overlay: 0.55;
}

/* ─── Container overrides ─── */
/* Neutralise theme layout constraints on 2025 / TT4 / Twenty-Twenty-Four */
html:has(body.stayly-home-page) {
	overflow-x: hidden;
	margin: 0 !important;
	padding: 0 !important;
}
body.stayly-home-page {
	overflow-x: hidden;
	margin: 0 !important;
	padding: 0 !important;
	/* Kill the block-editor global width vars on this page. */
	--wp--style--global--content-size: none !important;
	--wp--style--global--wide-size: none !important;
	--wp--preset--spacing--50: 0 !important;
	--wp--preset--spacing--60: 0 !important;
	--wp--preset--spacing--70: 0 !important;
	--wp--preset--spacing--80: 0 !important;
}
body.stayly-home-page .wp-site-blocks,
body.stayly-home-page .wp-block-post-content,
body.stayly-home-page .wp-block-group,
body.stayly-home-page .wp-block-group.has-global-padding,
body.stayly-home-page .is-layout-constrained,
body.stayly-home-page .is-layout-flow,
body.stayly-home-page .entry-content,
body.stayly-home-page .site-main,
body.stayly-home-page main,
body.stayly-home-page article,
body.stayly-home-page .post,
body.stayly-home-page .page,
body.stayly-home-page #stayly-fullwidth-main,
body.stayly-home-page .stayly-fullwidth-root {
	max-width: none !important;
	width: 100% !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}
body.stayly-home-page .wp-block-post-content > *,
body.stayly-home-page .entry-content > * {
	max-width: none !important;
}
/* Hide the page title — hero owns the headline */
body.stayly-home-page .entry-title,
body.stayly-home-page .wp-block-post-title,
body.stayly-home-page .page-title,
body.stayly-home-page h1.entry-title,
body.stayly-home-page header.entry-header,
body.stayly-home-page .wp-block-post-featured-image {
	display: none !important;
}

/* When Page Template is active, the classic PHP template renders the shortcode
   directly inside <main id="stayly-fullwidth-main">, so there's no block wrapper
   at all — the sections truly go edge-to-edge with no CSS wrestling needed. */
body.stayly-fullwidth-template #stayly-fullwidth-main {
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
}

/* ─── Sections ─── */
/* Force viewport-width with the classic breakout trick — combined with the
   html/body overflow-x:hidden above this cannot produce a horizontal scroll. */
.stayly-hero,
.stayly-section {
	position: relative;
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(-50vw + 50%);
	margin-right: calc(-50vw + 50%);
	color: #111827;
	box-sizing: border-box;
	left: 0; right: 0;
}
/* Optional vertical breathing room between two sections. */
body.stayly-home-page .stayly-section + .stayly-section,
body.stayly-home-page .stayly-hero + .stayly-section {
	margin-top: var(--sh-section-gap, 0);
}
.stayly-hero *, .stayly-hero *::before, .stayly-hero *::after,
.stayly-section *, .stayly-section *::before, .stayly-section *::after { box-sizing: border-box; }

.stayly-section__inner {
	max-width: var(--sh-content-max, 1200px);
	margin: 0 auto;
	padding: var(--sh-section-py, 64px) var(--sh-section-px-d, 24px);
}
.stayly-section__header {
	display: flex; justify-content: space-between; align-items: baseline;
	gap: 12px; margin-bottom: 24px; flex-wrap: wrap;
}
.stayly-section__title {
	font-size: clamp(22px, 3vw, 30px);
	margin: 0 0 24px;
	color: #111827;
	line-height: 1.2;
}
.stayly-section__title--center { text-align: center; }
.stayly-section__header .stayly-section__title { margin: 0; }
.stayly-section__more {
	color: var(--sh-brand, #0f766e);
	text-decoration: none; font-weight: 600; font-size: 14px;
	white-space: nowrap;
}
.stayly-section__more:hover { text-decoration: underline; }

/* ─── Hero ─── */
.stayly-hero {
	min-height: var(--sh-hero-h-d, 620px);
	background-size: cover;
	background-position: center;
	background-color: var(--sh-brand, #0f766e);
	background-image: linear-gradient(135deg, #0f766e 0%, #0ea5e9 50%, #6366f1 100%);
	display: flex; align-items: center; justify-content: center;
	position: relative; overflow: hidden;
	color: #fff;
}
.stayly-hero__overlay {
	position: absolute; inset: 0;
	background: linear-gradient(180deg, rgba(0,0,0,calc(var(--sh-overlay, 0.55) - 0.2)) 0%, rgba(0,0,0, var(--sh-overlay, 0.55)) 100%);
}
.stayly-hero__inner {
	position: relative; z-index: 1;
	max-width: 900px; padding: 40px 20px;
	text-align: center; width: 100%;
}
.stayly-hero__title {
	color: #fff !important;
	font-size: clamp(28px, 5vw, 54px);
	font-weight: 800;
	margin: 0 0 12px;
	line-height: 1.15;
	text-shadow: 0 2px 12px rgba(0,0,0,.35);
	letter-spacing: -0.02em;
}
.stayly-hero__subtitle {
	color: rgba(255,255,255,.95);
	font-size: clamp(14px, 1.8vw, 19px);
	margin: 0 auto 28px;
	max-width: 640px;
	line-height: 1.5;
	text-shadow: 0 1px 8px rgba(0,0,0,.35);
	padding: 0 8px;
}

/* Search bar */
.stayly-hero__search {
	display: flex; align-items: stretch; gap: 0;
	background: #fff; border-radius: 999px;
	padding: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.25);
	max-width: 820px; margin: 0 auto;
}
.stayly-hero__field {
	display: flex; flex-direction: column;
	padding: 10px 18px;
	flex: 1; min-width: 0;
	position: relative;
	border-radius: 999px;
	cursor: text;
	transition: background .15s ease;
	text-align: left;
}
.stayly-hero__field:hover { background: #f3f4f6; }
.stayly-hero__field + .stayly-hero__field { border-left: 1px solid #e5e7eb; }
.stayly-hero__field > span {
	font-size: 11px; font-weight: 700; color: #6b7280;
	text-transform: uppercase; letter-spacing: .04em;
	margin-bottom: 3px;
}
.stayly-hero__field select,
.stayly-hero__field input {
	border: 0; padding: 0; background: transparent;
	font: 600 14px inherit; color: #111827; outline: none;
	width: 100%; min-width: 0;
}
.stayly-hero__field--wide { flex: 1.4; }
.stayly-hero__field--narrow { flex: 0.7; }

.stayly-hero__submit {
	background: var(--sh-brand, #0f766e);
	color: #fff; border: 0;
	border-radius: 999px;
	padding: 0 24px;
	font: 600 14px inherit;
	cursor: pointer;
	display: inline-flex; align-items: center; gap: 6px;
	min-height: 52px;
	transition: background .15s ease, transform .1s ease;
	white-space: nowrap;
}
.stayly-hero__submit:hover { filter: brightness(.9); }
.stayly-hero__submit:active { transform: scale(.98); }

/* Responsive breakpoints */
@media (max-width: 1024px) { .stayly-hero { min-height: var(--sh-hero-h-t, 520px); } }
@media (max-width: 720px) {
	.stayly-hero { min-height: var(--sh-hero-h-m, 460px); }
	.stayly-hero__search {
		border-radius: 20px; flex-direction: column; padding: 8px;
		box-shadow: 0 6px 20px rgba(0,0,0,.2);
	}
	.stayly-hero__field { border-radius: 12px; padding: 12px 14px; }
	.stayly-hero__field + .stayly-hero__field { border-left: 0; border-top: 1px solid #f3f4f6; }
	.stayly-hero__submit {
		border-radius: 12px; margin-top: 6px;
		padding: 14px; min-height: auto;
		width: 100%; justify-content: center;
	}
	.stayly-section__inner { padding: calc(var(--sh-section-py, 64px) * 0.7) var(--sh-section-px-m, 16px); }
}

/* ─── Destinations ─── */
.stayly-destinations__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 16px;
}
@media (max-width: 480px) {
	.stayly-destinations__grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
.stayly-destination {
	position: relative;
	display: block;
	aspect-ratio: 4 / 5;
	border-radius: var(--sh-radius, 14px);
	overflow: hidden;
	color: #fff !important;
	text-decoration: none;
	background-size: cover; background-position: center;
	transition: transform .2s ease, box-shadow .2s ease;
}
.stayly-destination:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,0,0,.15); }
.stayly-destination__overlay {
	position: absolute; inset: 0;
	background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.65) 100%);
}
.stayly-destination__body {
	position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 1;
	display: flex; flex-direction: column; gap: 2px;
}
.stayly-destination__body strong { font-size: clamp(14px, 2.5vw, 18px); font-weight: 700; line-height: 1.2; }
.stayly-destination__body small { font-size: 12px; opacity: .9; letter-spacing: .02em; }

/* ─── How it works ─── */
.stayly-how { background: #f9fafb; }
.stayly-how__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 24px;
	max-width: 900px;
	margin: 0 auto;
}
.stayly-how__step {
	background: #fff;
	border-radius: var(--sh-radius, 14px);
	padding: 28px 22px;
	position: relative;
	border: 1px solid #e5e7eb;
	text-align: center;
	transition: transform .18s ease, box-shadow .18s ease;
}
.stayly-how__step:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,.06); }
.stayly-how__number {
	position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
	width: 36px; height: 36px; border-radius: 50%;
	background: var(--sh-brand, #0f766e); color: #fff;
	display: grid; place-items: center;
	font-weight: 800; font-size: 15px;
	box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.stayly-how__icon { font-size: 40px; display: block; margin: 8px 0 4px; }
.stayly-how__step h3 { margin: 8px 0 6px; font-size: 18px; }
.stayly-how__step p { margin: 0; color: #6b7280; font-size: 14px; line-height: 1.5; }

/* ─── Host CTA ─── */
.stayly-host-cta {
	background: linear-gradient(135deg, var(--sh-brand, #0f766e) 0%, #0ea5e9 100%);
	color: #fff;
}
.stayly-host-cta__inner {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 32px;
}
.stayly-host-cta__body h2 { color: #fff; font-size: clamp(22px, 3vw, 30px); margin: 0 0 8px; }
.stayly-host-cta__body p { color: rgba(255,255,255,.95); font-size: 15px; margin: 0 0 20px; max-width: 620px; line-height: 1.55; }
.stayly-host-cta__button {
	display: inline-block;
	background: #fff !important; color: var(--sh-brand, #0f766e) !important;
	padding: 12px 24px; border-radius: 999px;
	font-weight: 700; text-decoration: none;
	transition: transform .12s ease;
}
.stayly-host-cta__button:hover { transform: translateY(-2px); }
.stayly-host-cta__art { font-size: 96px; line-height: 1; opacity: .9; }
@media (max-width: 640px) {
	.stayly-host-cta__inner { grid-template-columns: 1fr; text-align: center; }
	.stayly-host-cta__art { font-size: 64px; }
}

/* ─── Debug Mode ─── */
/* Outlines every ancestor of stayly sections + shows its padding/margin so
   the user can identify exactly which element is stealing edge space. */
body.stayly-debug-mode .stayly-debug-ancestor {
	outline: 2px dashed #ef4444 !important;
	outline-offset: -2px;
	position: relative !important;
}
body.stayly-debug-mode .stayly-debug-ancestor::before {
	content: attr(data-stayly-debug);
	position: absolute; top: 0; left: 0; z-index: 99999;
	background: #ef4444; color: #fff;
	padding: 3px 8px; font: 700 11px/1.2 monospace;
	pointer-events: none;
	white-space: nowrap;
	max-width: 90vw; overflow: hidden; text-overflow: ellipsis;
}
body.stayly-debug-mode .stayly-hero,
body.stayly-debug-mode .stayly-section {
	outline: 3px solid #10b981 !important;
	outline-offset: -3px;
}
body.stayly-debug-mode .stayly-debug-legend {
	position: fixed; top: 12px; right: 12px; z-index: 999999;
	background: #111827; color: #fff;
	padding: 10px 14px; border-radius: 8px;
	font: 500 12px/1.4 system-ui, sans-serif;
	box-shadow: 0 4px 20px rgba(0,0,0,.3);
	max-width: 280px;
}
body.stayly-debug-mode .stayly-debug-legend strong { color: #fbbf24; display: block; margin-bottom: 4px; }
body.stayly-debug-mode .stayly-debug-legend .stayly-debug-swatch {
	display: inline-block; width: 12px; height: 12px; vertical-align: middle; margin-right: 4px;
}
