/*
 * Casa Blanca — styles that theme.json cannot express.
 * Every colour comes from a theme.json preset. Motifs: assets/motifs/*.svg.
 * Reference: docs/09-analyse-brochure.md and docs/04-charte-graphique.md.
 */

:root {
	--cb-estrella: url("../motifs/estrella.svg");
	--cb-espiral: url("../motifs/espiral.svg");
	--cb-curvas: url("../motifs/curvas-de-nivel.svg");
}

/* ---------- Logo (site title): "casa / blanca" stacked like the brochure ---------- */
.wp-block-site-title a { display: inline-block; }
.cb-logo-stack .wp-block-site-title { overflow-wrap: normal; word-break: normal; }
.cb-logo-stack .wp-block-site-title a { width: min-content; overflow-wrap: normal; word-break: keep-all; white-space: normal; }

/* ---------- Groups ---------- */

/* Rounded olive panel laid over photos (brochure: olive at 83 % opacity, radius ≈ 51/1920). */
.wp-block-group.is-style-panel,
.wp-block-column.is-style-panel {
	background-color: color-mix(in srgb, var(--wp--preset--color--olivo) 86%, transparent);
	color: var(--wp--preset--color--blanco);
	border-radius: var(--wp--custom--radius--panel);
	padding: var(--wp--preset--spacing--50);
}
.is-style-panel :where(h1, h2, h3, h4) { color: var(--wp--preset--color--blanco); }
.is-style-panel a:where(:not(.wp-element-button)) { color: var(--wp--preset--color--oro); }

/* Topographic contour lines in the background of olive sections. */
.is-style-textura { position: relative; isolation: isolate; }
.is-style-textura::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--cb-curvas) center / cover no-repeat;
	pointer-events: none;
}

/* Decorative spirals cut by the left and right edges. */
.is-style-espirales { position: relative; overflow: hidden; isolation: isolate; }
.is-style-espirales::before,
.is-style-espirales::after {
	content: "";
	position: absolute;
	width: clamp(140px, 20vw, 300px);
	aspect-ratio: 1;
	background: var(--cb-espiral) center / contain no-repeat;
	opacity: 0.45;
	pointer-events: none;
	z-index: 1;
}
.is-style-espirales::before { left: clamp(-150px, -10vw, -70px); bottom: 6%; }
.is-style-espirales::after { right: clamp(-150px, -10vw, -70px); top: 8%; transform: rotate(180deg); }

/* Simple card (light sections). */
.wp-block-group.is-style-tarjeta {
	background: var(--wp--preset--color--blanco);
	border-radius: var(--wp--custom--radius--panel);
	box-shadow: var(--wp--custom--shadow);
	overflow: hidden;
}

/* Olive sections: readable defaults. */
.has-olivo-background-color :where(h1, h2, h3, h4) { color: var(--wp--preset--color--blanco); }
.has-olivo-background-color a:where(:not(.wp-element-button)) { color: var(--wp--preset--color--oro); }
.has-olivo-background-color .wp-block-details summary { color: var(--wp--preset--color--oro); }

/* ---------- Text styles ---------- */

/* BIENVENID@ / ISLA FUERTE / POR PERSONA */
p.is-style-etiqueta {
	font-family: var(--wp--preset--font-family--texto);
	font-size: 0.8125rem;
	font-weight: 500;
	letter-spacing: var(--wp--custom--tracking--label);
	text-transform: uppercase;
	line-height: 1.5;
}

/* Outlined pill label ("ISLA FUERTE", "un hogar nacido de un sueño familiar"). */
p.is-style-pildora {
	display: table;
	margin-inline: auto;
	padding: 0.55em 2.2em;
	border: 2px solid currentColor;
	border-radius: var(--wp--custom--radius--pill);
	letter-spacing: var(--wp--custom--tracking--label);
	text-transform: uppercase;
	font-size: clamp(0.85rem, 1.6vw, 1.15rem);
	line-height: 1.3;
	text-align: center;
}
p.is-style-pildora.has-titulos-font-family {
	letter-spacing: 0.02em;
	text-transform: none;
	font-size: clamp(1.15rem, 2.2vw, 1.6rem);
	padding: 0.35em 1.4em;
}

/* Short manifesto paragraph (brochure p.2: gold, widely spaced, centred). */
p.is-style-manifiesto {
	letter-spacing: var(--wp--custom--tracking--manifesto);
	line-height: 2;
	font-weight: 300;
	max-width: 46ch;
	margin-inline: auto;
}

/* Prices */
p.is-style-precio {
	font-family: var(--wp--preset--font-family--texto);
	font-weight: 600;
	font-size: clamp(1.5rem, 3vw, 2rem);
	letter-spacing: 0.08em;
	line-height: 1.2;
	font-variant-numeric: tabular-nums;
}

/* Headings framed by two stars (✷ SERVICIOS ✷) or preceded by one (✷ Isla Fuerte). */
h1.is-style-estrellas, h2.is-style-estrellas, h3.is-style-estrellas,
h1.is-style-estrella, h2.is-style-estrella, h3.is-style-estrella {
	display: flex;
	align-items: center;
	gap: 0.35em;
}
h1.is-style-estrellas, h2.is-style-estrellas, h3.is-style-estrellas { justify-content: center; }
:is(h1, h2, h3, h4).is-style-estrellas::before, :is(h1, h2, h3, h4).is-style-estrellas::after, :is(h1, h2, h3, h4).is-style-estrella::before {
	content: "";
	flex: 0 0 auto;
	width: 0.62em;
	height: 0.62em;
	background-color: currentColor;
	-webkit-mask: var(--cb-estrella) center / contain no-repeat;
	mask: var(--cb-estrella) center / contain no-repeat;
}
.has-text-align-center.is-style-estrella { justify-content: center; }

/* Star bullets (Ubicación, Contamos con). */
ul.is-style-estrellas { list-style: none; padding-left: 0; display: grid; gap: 1rem; }
ul.is-style-estrellas > li { position: relative; padding-left: 2.6rem; }
ul.is-style-estrellas > li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.1em;
	width: 1.6rem;
	height: 1.6rem;
	background-color: var(--wp--preset--color--oro);
	-webkit-mask: var(--cb-estrella) center / contain no-repeat;
	mask: var(--cb-estrella) center / contain no-repeat;
}
.has-crema-background-color ul.is-style-estrellas > li::before,
.has-blanco-background-color ul.is-style-estrellas > li::before { background-color: var(--wp--preset--color--olivo); }

/* Arched image (programate cards). */
.wp-block-image.is-style-arco img { border-radius: 999px 999px var(--wp--custom--radius--small) var(--wp--custom--radius--small); }

/* Decorative star as an image-free element: <p class="cb-estrella" aria-hidden="true"></p> */
.cb-estrella {
	width: 3rem;
	height: 3rem;
	margin: 0;
	background-color: currentColor;
	-webkit-mask: var(--cb-estrella) center / contain no-repeat;
	mask: var(--cb-estrella) center / contain no-repeat;
}

/* ---------- Buttons ---------- */
.wp-block-button.is-style-contorno .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--oro);
	border-color: currentColor;
}
.wp-block-button.is-style-contorno .wp-block-button__link:hover {
	background: var(--wp--preset--color--oro);
	color: var(--wp--preset--color--olivo);
	border-color: var(--wp--preset--color--oro);
}
.has-crema-background-color .wp-block-button.is-style-contorno .wp-block-button__link,
.has-blanco-background-color .wp-block-button.is-style-contorno .wp-block-button__link { color: var(--wp--preset--color--olivo); }

/* ---------- Header ---------- */
.cb-header { transition: background-color 0.2s ease; }
.cb-header .wp-block-navigation a { color: var(--wp--preset--color--blanco); }
.cb-header .wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--wp--preset--color--olivo) !important;
	color: var(--wp--preset--color--blanco) !important;
}

/* ☰ menu open: links as 44 px touch targets (core draws them 24 px high), larger text. */
.cb-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	display: inline-flex; align-items: center; min-height: 44px; padding-block: 0.4rem; font-size: 1.0625rem;
}

/* ---------- Cover (photos with dark veil) ---------- */
/* Small gold labels over busy photos stay readable. */
.wp-block-cover p.is-style-etiqueta { text-shadow: 0 1px 4px rgb(0 0 0 / 0.75); font-weight: 600; }
.wp-block-cover .wp-block-cover__inner-container :where(h1, h2, h3) { color: var(--wp--preset--color--blanco); }

/* ---------- Collage (brochure p.3) ---------- */
.cb-collage { display: grid; gap: 0.6rem; grid-template-columns: repeat(2, 1fr); }
.cb-collage figure { margin: 0; }
.cb-collage img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; display: block; }
@media (min-width: 782px) {
	.cb-collage {
		grid-template-columns: 1.35fr 1fr 1.35fr;
		grid-template-rows: repeat(4, 9.5vw);
		grid-template-areas: "a b c" "a d c" "e d f" "e d f";
	}
	.cb-collage > :nth-child(1) { grid-area: a; }
	.cb-collage > :nth-child(2) { grid-area: b; }
	.cb-collage > :nth-child(3) { grid-area: c; }
	.cb-collage > :nth-child(4) { grid-area: d; }
	.cb-collage > :nth-child(5) { grid-area: e; }
	.cb-collage > :nth-child(6) { grid-area: f; }
}
@media (max-width: 781px) {
	.cb-collage { grid-auto-rows: 38vw; }
}
.cb-palette { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.cb-palette span { width: 3.2rem; height: 2.4rem; border-radius: 2px; }

/* ---------- FAQ ---------- */
.wp-block-details summary { cursor: pointer; font-weight: 500; color: var(--wp--preset--color--olivo); }

/* ---------- Floating WhatsApp button (markup from islafuerte-core) ---------- */
.islafuerte-whatsapp {
	position: fixed;
	right: 1rem;
	bottom: 1rem;
	z-index: 50;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.75rem 1.1rem;
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--oro);
	color: var(--wp--preset--color--olivo);
	font-weight: 500;
	font-size: 0.875rem;
	text-decoration: none;
	box-shadow: var(--wp--custom--shadow);
}
.islafuerte-whatsapp:hover,
.islafuerte-whatsapp:focus { background: var(--wp--preset--color--blanco); color: var(--wp--preset--color--olivo); }
.islafuerte-whatsapp svg { width: 1.25rem; height: 1.25rem; fill: currentColor; }
/* Phones: icon-only round button (the label stays for screen readers) so it never hides the main
   button; hidden on the quote form page, where it would cover the fields (the page links to WhatsApp). */
@media (max-width: 781px) {
	.islafuerte-whatsapp { right: 0.5rem; bottom: 0.75rem; width: 2.75rem; height: 2.75rem; padding: 0; justify-content: center; gap: 0; }
	.islafuerte-whatsapp svg { width: 1.6rem; height: 1.6rem; }
	.islafuerte-whatsapp span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
	body:has(.cb-cotiza) .islafuerte-whatsapp { display: none; }
}
/* Keep the last footer line clear of the fixed WhatsApp button (inline padding needs !important). */
.cb-pie { padding-bottom: calc(var(--wp--preset--spacing--50) + 3.5rem) !important; }

/* ---------- Accessibility ---------- */
.screen-reader-text{border:0;clip:rect(1px,1px,1px,1px);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute!important;width:1px;word-wrap:normal!important}
.screen-reader-text:focus{background:var(--wp--preset--color--crema);clip:auto!important;clip-path:none;display:block;height:auto;left:5px;padding:1rem;top:5px;width:auto;z-index:100000}

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

/* ---------- Layout helpers ---------- */
.wp-block-column > .wp-block-cover { height: 100%; margin: 0; }
.cb-sin-radio img { border-radius: 0 !important; }
/* Anchors land below the sticky header; smooth scroll unless reduced motion. */
html { scroll-behavior: smooth; }
:where(h2, h3, .wp-block-group)[id] { scroll-margin-top: 6.5rem; }

/* Header: switch to the ☰ menu below 1100 px so 7 links never wrap (core switches at 600 px). */
@media (max-width: 1099px) {
	.cb-header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex !important; }
	.cb-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none !important; }
}

/* ☰ open / close buttons: 44 px touch targets (core draws them 24 px), icon unchanged. */
.cb-header .wp-block-navigation__responsive-container-open,
.cb-header .wp-block-navigation__responsive-container-close {
	min-width: 44px; min-height: 44px; justify-content: center; align-items: center;
}

/* Galería (pattern galeria). */
.cb-galeria.wp-block-gallery img { border-radius: var(--wp--custom--radius--small); }
.cb-galeria-nav { gap: 0.5rem; }
@media (max-width: 599px) {
	.cb-galeria-nav .wp-block-button__link { padding: 0.6em 1.1em; letter-spacing: 0.12em; font-size: var(--wp--preset--font-size--small); }
}

/* Hospedaje: alternate photo side on desktop (pattern habitaciones). */
@media (min-width: 782px) { .cb-columnas-invertidas { flex-direction: row-reverse; } }
.wp-block-columns.alignfull { margin-block: 0; }
.cb-header .wp-block-button__link { padding: 0.7rem 1.2rem; font-size: 0.72rem; letter-spacing: 0.22em; }
.wp-block-cover .is-style-panel { margin-block: var(--wp--preset--spacing--40); }
@media (max-width: 781px) {
	.cb-header .wp-block-buttons { display: none; }
	.wp-block-column[style*="border-left"] { border-left: 0 !important; padding-left: 0 !important; }
	.is-not-stacked-on-mobile > .wp-block-column:nth-child(n+3) { display: none; }
}

/* Full-width sections touch each other (no cream gaps), like the brochure pages. */
.wp-site-blocks > main,
.wp-site-blocks > footer,
.wp-block-post-content > .alignfull,
.wp-block-post-content > .alignfull + *,
.wp-block-post-content > :first-child { margin-block-start: 0; }
.wp-block-post-content > .alignfull { margin-block-end: 0; }

/* Outline buttons back to gold when inside an olive panel placed on a light section. */
.has-crema-background-color :is(.is-style-panel, .has-olivo-background-color) .wp-block-button.is-style-contorno .wp-block-button__link,
.has-blanco-background-color :is(.is-style-panel, .has-olivo-background-color) .wp-block-button.is-style-contorno .wp-block-button__link { color: var(--wp--preset--color--oro); }

/* Language switcher « 🌐 ES ˅ » at the far right of the header; a click opens a small menu with the
   language names in their own language (block islafuerte/idiomas, native <details>, ADR-006). */
.cb-idiomas__menu { position: relative; }
.cb-idiomas summary {
	display: flex; align-items: center; justify-content: center; gap: 0.35rem;
	min-width: 44px; min-height: 44px; padding-inline: 0.4rem;
	list-style: none; cursor: pointer; color: var(--wp--preset--color--blanco);
	font-size: var(--wp--preset--font-size--small); font-weight: 500; letter-spacing: 0.12em;
	border-radius: var(--wp--custom--radius--small);
}
.cb-idiomas summary::-webkit-details-marker { display: none; }
.cb-idiomas summary:hover, .cb-idiomas summary:focus-visible, .cb-idiomas__menu[open] summary { color: var(--wp--preset--color--oro); }
.cb-idiomas summary:focus-visible { outline: 2px solid var(--wp--preset--color--oro); outline-offset: 2px; }
.cb-idiomas__globo { flex: none; }
.cb-idiomas__flecha { flex: none; transition: transform 0.15s ease; }
.cb-idiomas__menu[open] .cb-idiomas__flecha { transform: rotate(180deg); }
.cb-idiomas ul {
	position: absolute; right: 0; top: calc(100% + 0.4rem); z-index: 100;
	margin: 0; padding: 0.35rem; list-style: none; min-width: 9rem;
	background: var(--wp--preset--color--olivo);
	border: 1px solid var(--wp--preset--color--salvia);
	border-radius: var(--wp--custom--radius--small);
	box-shadow: 0 8px 24px rgb(0 0 0 / 0.25);
}
.cb-idiomas ul a {
	display: flex; align-items: center;
	min-height: 44px; padding: 0.3rem 0.9rem; border-radius: var(--wp--custom--radius--small);
	color: var(--wp--preset--color--blanco); text-decoration: none; font-size: var(--wp--preset--font-size--small);
}
.cb-idiomas ul a:hover, .cb-idiomas ul a:focus-visible { background: rgb(255 255 255 / 0.08); color: var(--wp--preset--color--oro); }
.cb-idiomas ul a[aria-current] { color: var(--wp--preset--color--oro); font-weight: 600; }
.cb-cabecera-acciones { gap: var(--wp--preset--spacing--30); }

/* « Cotiza tu reserva » in the ☰ menu (last item, class cb-menu-cotiza from the content sync):
   hidden in the desktop header and the footer, shown as a gold button when the ☰ menu is open. */
.wp-block-navigation .cb-menu-cotiza { display: none; }
.cb-header .wp-block-navigation__responsive-container.is-menu-open .cb-menu-cotiza { display: flex; margin-top: var(--wp--preset--spacing--40); }
.cb-header .wp-block-navigation__responsive-container.is-menu-open .cb-menu-cotiza > a {
	padding: 0.85rem 1.6rem; border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--oro); color: var(--wp--preset--color--olivo) !important;
	font-size: 0.8rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
}
