/*
Theme Name: Pisos Gandía
Theme URI: https://pisogandia.com
Author: Pisos Gandía
Description: Tema FSE fino para Pisos Gandía — estudio inmobiliario en Gandía. Presentación pura (tokens, plantillas, CSS); toda la funcionalidad vive en el plugin Pisos Gandía Core. Sistema visual "Aura Remodel".
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 8.0
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: pisogandia
Tags: full-site-editing, block-styles, custom-colors, custom-menu
*/

/* -------------------------------------------------------------------------
   Design tokens — fallbacks. brand-tokens.php overrides these in wp_head from
   the ACF Brand settings.
   ------------------------------------------------------------------------- */
:root {
	--pg-color-bg: #fafafa;
	--pg-color-fg: #18181b;
	--pg-color-primary: #ffffff;
	--pg-color-accent: #3f3f46;
	--pg-color-muted: #71717a;
	--pg-color-border: #e4e4e7;
	--pg-color-surface: #f4f4f5;
	--pg-overlay: rgba(9, 9, 11, 0.4);
	--pg-header-h: 76px;
}

/* The header is fixed and overlays the hero on hero pages; on every other page
   we reserve its height so content is never hidden underneath it. */
body:not(.pg-has-hero) {
	padding-top: var(--pg-header-h);
}

/* Mobile header is a slimmer bar (10px padding), so reserve less. */
@media (max-width: 860px) {
	:root {
		--pg-header-h: 68px;
	}
}

/* On hero pages, the hero must sit flush at the very top. WordPress adds a
   block-gap margin between the (fixed) header part and <main>; remove it so
   there is no white strip above the hero. */
body.pg-has-hero main {
	margin-top: 0;
}

/* -------------------------------------------------------------------------
   Base
   ------------------------------------------------------------------------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	/* Anchor targets clear the fixed header. */
	scroll-padding-top: calc(var(--pg-header-h, 4.5rem) + 1rem);
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.wp-site-blocks {
	display: flex;
	flex-direction: column;
	flex: 1 0 auto;
}

img {
	max-width: 100%;
	height: auto;
}

:where(a):focus-visible,
:where(button):focus-visible {
	outline: 2px solid var(--wp--preset--color--fg, #18181b);
	outline-offset: 2px;
}

/* -------------------------------------------------------------------------
   Layout helpers
   ------------------------------------------------------------------------- */
.pg-container {
	width: 100%;
	max-width: var(--wp--style--global--wide-size, 1280px);
	margin-inline: auto;
	padding-inline: 20px;
}

.pg-section {
	padding-block: var(--pg-section-space, clamp(3.5rem, 7vw, 6.5rem));
}

/* Two flow sections that share the same background read as one block — collapse
   the gap between them so we don't get a dead band. Sections that introduce
   their own surface/border keep full padding for breathing room. */
.pg-section + .pg-section {
	padding-top: clamp(3.5rem, 7vw, 6.5rem);
}

/* -------------------------------------------------------------------------
   Section heading + eyebrow label
   ------------------------------------------------------------------------- */
.pg-eyebrow {
	font-size: 0.8rem;
	font-weight: 500;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted, #71717a);
	margin: 0;
}

.pg-section-head {
	max-width: 40ch;
	margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

.pg-section-head__title {
	font-size: clamp(2rem, 5vw, 3.5rem);
	line-height: 1.05;
	letter-spacing: -0.03em;
	font-weight: 500;
	margin: 1rem 0 0;
	text-wrap: balance;
}

.pg-section-head__title em {
	font-style: italic;
}

/* -------------------------------------------------------------------------
   Buttons — shared UI primitive
   ------------------------------------------------------------------------- */
.pg-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.9rem 2rem;
	border-radius: 999px;
	border: 1px solid var(--wp--preset--color--fg, #18181b);
	font-size: 0.95rem;
	font-weight: 500;
	letter-spacing: -0.01em;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 250ms ease, color 250ms ease, transform 250ms ease, border-color 250ms ease;
}

.pg-btn--sm {
	padding: 0.6rem 1.25rem;
	font-size: 0.9rem;
}

.pg-btn--solid {
	background: var(--wp--preset--color--fg, #18181b);
	color: var(--wp--preset--color--primary, #fff);
}

.pg-btn--solid:hover {
	background: var(--wp--preset--color--accent, #3f3f46);
	border-color: var(--wp--preset--color--accent, #3f3f46);
}

.pg-btn--invert {
	background: var(--wp--preset--color--primary, #fff);
	color: var(--wp--preset--color--fg, #18181b);
	border-color: var(--wp--preset--color--primary, #fff);
}

.pg-btn--invert:hover {
	background: transparent;
	color: var(--wp--preset--color--primary, #fff);
	border-color: var(--wp--preset--color--primary, #fff);
}

.pg-btn--ghost {
	background: transparent;
	color: var(--wp--preset--color--fg, #18181b);
}

.pg-btn--ghost:hover {
	background: var(--wp--preset--color--fg, #18181b);
	color: var(--wp--preset--color--primary, #fff);
}

.pg-btn--on-dark {
	color: #fff;
	border-color: rgba(255, 255, 255, 0.5);
}

.pg-btn--on-dark:hover {
	background: #fff;
	color: #18181b;
	border-color: #fff;
}

/* -------------------------------------------------------------------------
   Piso card + grid — shared primitive (home grid, archive, related). Kept in
   the global stylesheet because several blocks render these classes.
   ------------------------------------------------------------------------- */
.pg-pisos-grid__grid {
	display: grid;
	grid-template-columns: repeat(var(--pg-cols, 3), minmax(0, 1fr));
	gap: clamp(1.5rem, 3vw, 2.5rem);
}

@media (max-width: 900px) {
	.pg-pisos-grid__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 560px) {
	.pg-pisos-grid__grid {
		grid-template-columns: 1fr;
	}
}

.pg-pisos-grid__cta {
	margin-top: 3rem;
	display: flex;
	justify-content: center;
}

.pg-card__link {
	display: block;
	color: inherit;
	text-decoration: none;
}

.pg-card__media {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: 2px;
	background: var(--wp--preset--color--surface, #f4f4f5);
}

.pg-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transform: scale(1);
	transition: transform 700ms ease-in-out;
}

.pg-card__img--placeholder {
	display: block;
	background: linear-gradient(135deg, #e4e4e7, #f4f4f5);
}

.pg-card__link:hover .pg-card__img,
.pg-card__link:focus-visible .pg-card__img {
	transform: scale(1.05);
}

.pg-card__tags {
	position: absolute;
	top: 0.75rem;
	left: 0.75rem;
	display: flex;
	gap: 0.4rem;
	flex-wrap: wrap;
}

.pg-tag {
	font-size: 0.72rem;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 0.3rem 0.6rem;
	border-radius: 999px;
	background: rgba(24, 24, 27, 0.9);
	color: #fff;
	backdrop-filter: blur(4px);
}

.pg-tag--muted {
	background: rgba(255, 255, 255, 0.9);
	color: #18181b;
}

.pg-card__body {
	padding-top: 1.15rem;
}

.pg-card__head {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}

.pg-card__title {
	font-size: 1.15rem;
	font-weight: 500;
	letter-spacing: -0.02em;
	margin: 0;
}

.pg-card__zona {
	margin: 0;
	color: var(--wp--preset--color--muted, #71717a);
	font-size: 0.9rem;
}

.pg-card__meta {
	list-style: none;
	margin: 0.85rem 0 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.85rem;
	color: var(--wp--preset--color--accent, #3f3f46);
	font-size: 0.9rem;
}

.pg-card__meta li {
	position: relative;
	padding-right: 0.85rem;
}

.pg-card__meta li:not(:last-child)::after {
	content: "";
	position: absolute;
	right: 0;
	top: 50%;
	width: 1px;
	height: 0.9em;
	transform: translateY(-50%);
	background: var(--wp--preset--color--border, #e4e4e7);
}

.pg-card__price {
	margin: 0.9rem 0 0;
	font-size: 1.1rem;
	font-weight: 500;
	letter-spacing: -0.01em;
}

/* -------------------------------------------------------------------------
   Editorial prose (legal pages, nosotros)
   ------------------------------------------------------------------------- */
.pg-prose :where(h2) {
	margin-top: 2.5em;
	margin-bottom: 0.6em;
	font-size: clamp(1.5rem, 2.6vw, 2rem);
	line-height: 1.2;
	letter-spacing: -0.02em;
	max-width: 30ch;
}

.pg-prose :where(h3) {
	margin-top: 2em;
	margin-bottom: 0.5em;
	font-size: clamp(1.2rem, 2vw, 1.4rem);
	line-height: 1.3;
	max-width: 40ch;
}

.pg-prose :where(p, ul, ol) {
	max-width: 68ch;
}

/* Plain pages (legal, etc.): anchor the title + prose to the site 1280 frame,
   left-aligned, so their edges line up with the header logo on every page. */
.pg-page__title {
	margin-top: 0;
	margin-bottom: clamp(2rem, 4vw, 3rem);
	max-width: 20ch;
}

@media (prefers-reduced-motion: reduce) {
	* {
		scroll-behavior: auto !important;
	}
}
