/*
Theme Name: Somovillas
Theme URI: https://somovillas.com
Author: Somovillas
Author URI: https://somovillas.com
Description: Tema FSE editorial para Somovillas — alquiler de villas en Ribamontán al Mar, Cantabria. Diseño minimal, tipografía display y fotografía protagonista.
Version: 0.1.0
Requires at least: 6.5
Tested up to: 6.7
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: somovillas
Tags: full-site-editing, block-templates, block-patterns, one-column, custom-colors, custom-menu, editor-style, featured-images, wide-blocks, block-styles
*/

/* =========================================================
   Config
   ========================================================= */

:root {
    /* Enables natural interpolation of font sizes and spacing in the editor,
       without needing clamp() or media queries. */
    interpolate-size: allow-keywords;

    --wp-admin-bar-height: var(--wp-admin--admin-bar--height, 0px);

    --sv-radius: 4px;
    --sv-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* =========================================================
   Base
   ========================================================= */

html { scroll-behavior: smooth; }

body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

main {
    /* Overridden by JS on load and resize */
    padding-top: var(--header-height);
}

/* =========================================================
   Navigation
   ========================================================= */

.js-nav-toggle {
    cursor: pointer;
    display: block;
    z-index: 10;
    transition: all 0.3s ease-out;
}

.js-nav-toggle.active {
    font-weight: bold;
}

.js-nav {
    transition: all 0.3s ease-out;
}

.wp-block-navigation__container:only-child {
    gap: 5px;
}

.wp-block-navigation .wp-block-navigation-item:not(:last-child)::after {
    content: '/';
    padding-left: 5px;
}

ul.apartments-menu::after {
    content: '/';
}

/* =========================================================
   Site header
   ========================================================= */

.site-header {
    position: fixed;
    top: var(--wp-admin-bar-height);
    z-index: 10;
    width: 100%;
    background: linear-gradient(
        180deg,
        rgba(236, 232, 225, 0.85) 0%,
        rgba(236, 232, 225, 0)    100%
    );
}

.site-header a {
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
}

.header-scroll-down,
.header-scroll-up {
    transition: transform 0.3s ease-in-out;
}

.header-scroll-down {
    transform: translateY(-100%);
}

.header-scroll-up {
    transform: translateY(0%);
    position: relative;
    z-index: 10;
    /*background-color: #00000030;*/
}

/* =========================================================
   Link animation — https://codepen.io/pauloc/pen/NWezZJo
   ========================================================= */

.js-anim-link a {
    overflow: hidden;
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    vertical-align: bottom;
    width: auto;
    height: auto;
    text-align: start;
    text-decoration: initial;
}

@media (min-width: 768px) {
    .js-anim-link a::after {
        content: attr(data-replace);
        position: absolute;
        inset: 0;
        transform-origin: 100% 50%;
        transform: translate3d(0, 120%, 0);
        transition: transform 0.3s cubic-bezier(0.76, 0, 0.24, 1);
    }

    .js-anim-link a:hover::after {
        transform: translate3d(0, 0, 0);
    }

    .js-anim-link a span {
        display: inline-block;
        transition: transform 0.5s cubic-bezier(0.76, 0, 0.24, 1);
    }

    .js-anim-link a:hover span {
        transform: translate3d(0, -120%, 0);
    }
}

/* =========================================================
   Utilities — z-index
   ========================================================= */

.sv-z-base { position: relative; z-index:   0; }
.sv-z-1    { position: relative; z-index:   1; }
.sv-z-2    { position: relative; z-index:   2; }
.sv-z-3    { position: relative; z-index:   3; }
.sv-z-10   { position: relative; z-index:  10; }
.sv-z-100  { position: relative; z-index: 100; }

/* =========================================================
   Icons inline — Utils::icon / sv_icon
   ========================================================= */

.sv-icon {
    flex: 0 0 auto;
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    vertical-align: middle;
}

.sv-icon path,
.sv-icon circle,
.sv-icon rect,
.sv-icon line,
.sv-icon polyline,
.sv-icon polygon {
    fill: currentColor;
}

/* =========================================================
   Servicios list — pattern villa-servicios
   ========================================================= */

.sv-servicios-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.sv-servicio {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sv-servicio .sv-icon {
    width: 1.1em;
    height: 1.1em;
}

/* =========================================================
   Logo lockup — "somo villas" with the second word mirrored as in brand mark
   ========================================================= */

.sv-logo {
	display: inline-flex;
	align-items: flex-start;
	gap: 0.75rem;
	line-height: 0.9;
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
}
.sv-logo__mark {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 400;
	font-size: clamp(1.75rem, 2.6vw, 2.4rem);
	letter-spacing: -0.02em;
	display: inline-block;
}
.sv-logo__mark span {
	display: block;
}
.sv-logo__mark .is-flip {
	transform: scaleY(-1);
}
.sv-logo__tag {
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.7rem;
	color: var(--wp--preset--color--muted);
	margin-top: 0.4rem;
	letter-spacing: 0.04em;
	max-width: 6ch;
	line-height: 1.2;
}

/* =========================================================
   Header nav
   ========================================================= */

.sv-nav a {
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.875rem;
	text-decoration: none;
	color: var(--wp--preset--color--contrast);
	letter-spacing: 0.02em;
}
.sv-nav a:hover { color: var(--wp--preset--color--accent); }
.sv-nav .sep { color: var(--wp--preset--color--line); margin: 0 0.6rem; }

/* =========================================================
   Typography
   ========================================================= */

/* Outlined display text used on top of hero image */
.sv-outline {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 300;
	font-size: clamp(6rem, 18vw, 18rem);
	line-height: 0.8;
	letter-spacing: -0.04em;
	color: transparent;
	-webkit-text-stroke: 1px var(--wp--preset--color--contrast);
	pointer-events: none;
	user-select: none;
}

/* Italic accent used inside stacked villa names */
.sv-italic { font-style: italic; font-weight: 300; }

/* =========================================================
   Components
   ========================================================= */

/* Image card hover */
.sv-card img {
	transition: transform 0.8s var(--sv-ease);
}
.sv-card:hover img { transform: scale(1.03); }

/* Floating "Reservar" pill (used in single villa) */
.sv-reservar {
	position: absolute;
	top: 1.5rem;
	right: 1.5rem;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 5rem;
	height: 5rem;
	border-radius: 50%;
	border: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--base-soft);
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.75rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--wp--preset--color--contrast);
	transition: background 0.3s var(--sv-ease), color 0.3s var(--sv-ease);
}
.sv-reservar:hover {
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

/* Thin divider line used in editorial sections */
.sv-rule {
	height: 1px;
	width: 100%;
	margin: 1rem 0;
	background: var(--wp--preset--color--line);
}

/* Servicios list with inline icon dot */
.sv-services li {
	list-style: none;
	position: relative;
	padding-left: 1.4rem;
	margin-bottom: 0.5rem;
	font-size: 0.95rem;
}
.sv-services li::before {
	content: "";
	position: absolute;
	top: 0.6em;
	left: 0;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--wp--preset--color--contrast);
}

/* =========================================================
   Animations
   ========================================================= */

/* Subtle entrance fade */
@media (prefers-reduced-motion: no-preference) {
	.sv-fade-in {
		animation: svFadeIn 0.9s var(--sv-ease) both;
	}
	@keyframes svFadeIn {
		from { opacity: 0; transform: translateY(12px); }
		to   { opacity: 1; transform: none; }
	}
}




/* =========================================================
   Extras
   ========================================================= */
.top-image {
    max-width: 50%;
    position: absolute;
    right: 0;
    top: 0;
    z-index: -1;
}
