/*
 * Costa Mediteranea theme overrides / safety net.
 * Loaded last so it can correct anything after the bundled Elementor + Astra CSS.
 * The design relies entirely on inline SVG icons, so no icon webfont is required.
 */

/* Keep screen-reader-only labels hidden (they ship inside the carousel arrows). */
.elementor-screen-only,
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Ensure carousel arrow SVGs inherit a sensible size if a rule was missed. */
.elementor-swiper-button .e-font-icon-svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

/* Hero section: fill the full viewport height (overrides the 800/666/735px min-heights). */
.elementor-10 .elementor-element.elementor-element-f9e2849 {
	--min-height: 100vh;
	min-height: 100vh;
	min-height: 100svh;
	position: relative;
	overflow: hidden;
}

/* -------------------------------------------------------------------------
 * Animations
 * ---------------------------------------------------------------------- */

/* Ken Burns hero: move the background image onto a ::before layer so it can be
   scaled/panned without disturbing the hero's flex layout. The container's own
   background is dropped so it isn't painted twice. */
.elementor-10 .elementor-element.elementor-element-f9e2849:not(.elementor-motion-effects-element-type-background) {
	background-image: none !important;
}
.elementor-10 .elementor-element.elementor-element-f9e2849::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
	background-image: url("/wp-content/uploads/2024/09/Costamediterranea-home.png");
	background-position: center center;
	background-repeat: no-repeat;
	background-size: cover;
	transform: scale(1.06);
}
/* Keep hero content above the background layer. */
.elementor-10 .elementor-element.elementor-element-f9e2849 > * {
	position: relative;
	z-index: 1;
}

@media (prefers-reduced-motion: no-preference) {
	.elementor-10 .elementor-element.elementor-element-f9e2849::before {
		animation: costaKenBurns 26s ease-in-out infinite alternate;
	}

	/* Scroll reveal — class is added by animations.js, so no-JS keeps content visible. */
	.elementor-10 .costa-reveal {
		opacity: 0;
		transform: translateY(28px);
		transition: opacity 0.7s cubic-bezier(0.22, 0.61, 0.36, 1),
			transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
	}
	.elementor-10 .costa-reveal.is-visible {
		opacity: 1;
		transform: none;
	}

	/* Hero entrance. */
	.elementor-10 .costa-hero-in {
		opacity: 0;
		transform: translateY(24px);
		transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.22, 0.61, 0.36, 1);
		will-change: opacity, transform;
	}
	.elementor-10 .costa-hero-in.is-in {
		opacity: 1;
		transform: none;
	}
}

@keyframes costaKenBurns {
	from { transform: scale(1.06) translate(0, 0); }
	to   { transform: scale(1.16) translate(-1.5%, -1%); }
}

/* Hover polish (pointer devices only). */
@media (hover: hover) and (pointer: fine) {
	.elementor-10 .elementor-button {
		transition: transform 0.25s ease, box-shadow 0.25s ease,
			background-color 0.25s ease, color 0.25s ease;
	}
	.elementor-10 .elementor-button:hover {
		transform: translateY(-2px);
		box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
	}

	/* Zoom gallery slides within their frame. */
	.elementor-10 .swiper-slide {
		overflow: hidden;
	}
	.elementor-10 .elementor-carousel-image,
	.elementor-10 .swiper-slide-image {
		transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
	}
	.elementor-10 .swiper-slide:hover .elementor-carousel-image,
	.elementor-10 .swiper-slide:hover .swiper-slide-image {
		transform: scale(1.06);
	}

	/* Subtle lift on standalone content images. */
	.elementor-10 .elementor-widget-image img {
		transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
	}
	.elementor-10 .elementor-widget-image:hover img {
		transform: scale(1.04);
	}
}

/* -------------------------------------------------------------------------
 * Footer refinements
 * ---------------------------------------------------------------------- */

/* Give in-page anchor jumps a little breathing room from the top. */
#stay,
#amenities,
#contact {
	scroll-margin-top: 24px;
}

/* Contact links (address / phone / email): match the dark footer text,
   brand teal on hover — the saturated default blue clashed with the palette. */
.elementor-181 .elementor-element-20ee265 a {
	color: #272928;
	text-decoration: none;
	transition: color 0.2s ease;
}
.elementor-181 .elementor-element-20ee265 a:hover,
.elementor-181 .elementor-element-20ee265 a:focus-visible {
	color: #30b8a0;
}

/* Quick-nav row. */
.costa-footer-nav {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 10px 32px;
	margin: 4px 0 22px;
	padding: 0 15px;
}
.costa-footer-nav a {
	font-family: "Hanken Grotesk", sans-serif;
	font-size: 15px;
	font-weight: 500;
	letter-spacing: 0.02em;
	color: #272928;
	text-decoration: none;
	transition: color 0.2s ease;
}
.costa-footer-nav a:hover,
.costa-footer-nav a:focus-visible {
	color: #30b8a0;
}

/* Tighten the vertical rhythm (logo sat 60px from the top; trim the gaps). */
.elementor-181 .elementor-element-bf6e072 > .elementor-widget-container {
	margin-top: 32px;
}
.elementor-181 .elementor-element-20ee265 {
	--margin-top: 12px;
	--margin-bottom: 12px;
}
.elementor-181 .elementor-element-7e09a14 > .elementor-widget-container {
	margin-bottom: 18px;
}


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

/* The form widget sits in a flex column with align-items:flex-start, so it
   would otherwise shrink to its content. Make it fill the column width. */
.elementor-10 .elementor-element.elementor-element-fe984b8 {
	width: 100%;
}

.costa-form-fields {
	display: flex;
	flex-direction: column;
	gap: 26px;
	width: 100%;
	max-width: 480px;
}

.costa-field {
	position: relative;
	width: 100%;
	margin: 0;
}

/* Fields share the site's minimal underline look. */
.costa-form-fields .elementor-field-textual,
.costa-form-fields .costa-cc {
	width: 100%;
	min-height: 44px;
	padding: 18px 0 8px;
	background: transparent;
	border: none;
	border-bottom: 1px solid #272928;
	border-radius: 0;
	color: #272928;
	font: 400 16px/1.4 "Hanken Grotesk", sans-serif;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}
.costa-form-fields textarea.elementor-field-textual {
	min-height: 118px;
	padding-top: 22px;
	resize: vertical;
}

/* Floating label. */
.costa-field > label,
.costa-phone-input > label {
	position: absolute;
	left: 0;
	top: 18px;
	color: #8a8d8b;
	font: 400 16px/1 "Hanken Grotesk", sans-serif;
	pointer-events: none;
	transform-origin: left top;
	transition: transform 0.18s ease, color 0.18s ease;
}
.costa-field .elementor-field-textual:focus + label,
.costa-field .elementor-field-textual:not(:placeholder-shown) + label,
.costa-field textarea:focus + label,
.costa-field textarea:not(:placeholder-shown) + label,
.costa-phone-input .elementor-field-textual:focus + label,
.costa-phone-input .elementor-field-textual:not(:placeholder-shown) + label {
	transform: translateY(-16px) scale(0.72);
	color: #30b8a0;
}

/* Teal underline on focus. */
.costa-form-fields .elementor-field-textual:focus,
.costa-form-fields .costa-cc:focus {
	outline: none;
	border-bottom-color: #30b8a0;
	box-shadow: 0 1px 0 0 #30b8a0;
}

/* Phone row: compact country code + number that flexes to fill. */
.costa-field--phone .costa-phone {
	display: flex;
	align-items: flex-end;
	gap: 14px;
}
.costa-field--phone .costa-cc {
	flex: 0 0 124px;
	width: 124px;
	min-width: 0;
	min-height: 0;
	padding: 8px 22px 8px 0;
	cursor: pointer;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23272928' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 2px center;
}
.costa-phone-input {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
}

/* Number field: drop the native spinner. */
.costa-form-fields input[type="number"] {
	-moz-appearance: textfield;
}
.costa-form-fields input[type="number"]::-webkit-outer-spin-button,
.costa-form-fields input[type="number"]::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Inline error + invalid state. */
.costa-error {
	display: block;
	margin-top: 7px;
	color: #d9534f;
	font: 500 13px/1.35 "Hanken Grotesk", sans-serif;
}
.costa-error:empty {
	display: none;
}
.costa-field.costa-invalid .elementor-field-textual,
.costa-field.costa-invalid .costa-cc {
	border-bottom-color: #d9534f;
	box-shadow: 0 1px 0 0 #d9534f;
}
.costa-field.costa-invalid > label,
.costa-field.costa-invalid .costa-phone-input > label {
	color: #d9534f;
}

/* Honeypot — off-screen but still in the a11y tree. */
.costa-hp {
	position: absolute !important;
	left: -9999px !important;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Send button — full-width teal CTA (overrides the outlined original). */
.costa-submit-wrap {
	margin-top: 10px;
}
.elementor-10 .elementor-element.elementor-element-fe984b8 .elementor-button.costa-submit {
	width: 100%;
	padding: 16px 22px;
	background-color: #272928;
	color: #fff;
	border: none;
	border-radius: 8px;
	font: 600 16px/1 "Hanken Grotesk", sans-serif;
	letter-spacing: 0.02em;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.elementor-10 .elementor-element.elementor-element-fe984b8 .elementor-button.costa-submit:hover {
	background-color: #3d403e;
	color: #fff;
}
.elementor-10 .elementor-element.elementor-element-fe984b8 .elementor-button.costa-submit:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(39, 41, 40, 0.3);
}
.elementor-10 .elementor-element.elementor-element-fe984b8 .elementor-button.costa-submit[disabled] {
	opacity: 0.65;
	cursor: default;
}

/* Success / error card. */
.costa-form-notice {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 20px;
	padding: 14px 16px;
	border-radius: 10px;
	font: 500 15px/1.45 "Hanken Grotesk", sans-serif;
}
.costa-form-notice svg {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin-top: 1px;
}
.costa-form-notice--success {
	background: #e8f7f2;
	color: #1f7a67;
	border: 1px solid #bfe9df;
}
.costa-form-notice--error {
	background: #fdecea;
	color: #b23b36;
	border: 1px solid #f5c6c2;
}
