/*
Theme Name: Reserva Tijiky
Theme URI: https://tijiky.com
Author: Landaku
Description: Tema de bloques a medida para la Reserva Tijiky (Tibacuy, Cundinamarca). Todo se edita desde Apariencia → Editor: colores, tipografías, encabezado, pie y páginas. Incluye patrones listos para Medicina ancestral, Ruta del café y Agrosolidaria, y Talleres. No depende de constructores ni plugins.
Requires at least: 7.0
Tested up to: 7.1
Requires PHP: 7.4
Version: 2.5.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tijiky-reserva
Tags: full-site-editing, block-patterns, custom-colors, editor-style
*/

/* Solo detalles que theme.json no cubre. Todo lo demás se ajusta en el Editor. */

html { scroll-behavior: smooth; }
img { height: auto; }

/* Encabezado fijo al hacer scroll */
.tijiky-header {
	position: sticky;
	top: 0;
	z-index: 50;
	backdrop-filter: saturate(1.2) blur(8px);
	-webkit-backdrop-filter: saturate(1.2) blur(8px);
}
.admin-bar .tijiky-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .tijiky-header { top: 0; } }

/* Antetítulo con figura de petroglifo */
.is-style-antetitulo {
	display: inline-flex;
	align-items: center;
	gap: .6em;
	text-transform: uppercase;
	letter-spacing: .14em;
	font-size: .8125rem !important;
	font-weight: 700;
}
.is-style-antetitulo::before {
	content: "";
	width: 1.35em;
	height: 1.35em;
	flex: none;
	background-color: currentColor;
	-webkit-mask: var(--tijiky-petroglifo) center / contain no-repeat;
	mask: var(--tijiky-petroglifo) center / contain no-repeat;
}
.has-text-align-center.is-style-antetitulo { display: flex; justify-content: center; }

:root {
	--tijiky-petroglifo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg fill='none' stroke='%23000' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='20' cy='7' r='3.6'/%3E%3Cpath d='M20 11v15M8 4v8h24V4M20 26l-8 3v8M20 26l8 3v8'/%3E%3C/g%3E%3C/svg%3E");
}

/* Separador con petroglifo al centro */
.wp-block-separator.is-style-petroglifo {
	border: 0 !important;
	height: 28px;
	max-width: 260px !important;
	opacity: 1;
	background:
		linear-gradient(currentColor, currentColor) left center / calc(50% - 26px) 1px no-repeat,
		linear-gradient(currentColor, currentColor) right center / calc(50% - 26px) 1px no-repeat;
	position: relative;
}
.wp-block-separator.is-style-petroglifo::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 0;
	width: 28px;
	height: 28px;
	transform: translateX(-50%);
	background-color: currentColor;
	-webkit-mask: var(--tijiky-petroglifo) center / contain no-repeat;
	mask: var(--tijiky-petroglifo) center / contain no-repeat;
}

/* Tarjeta */
.is-style-tarjeta {
	border-radius: var(--wp--custom--radio);
	overflow: hidden;
	box-shadow: var(--wp--preset--shadow--suave);
	transition: transform .25s ease, box-shadow .25s ease;
}
.is-style-tarjeta:hover { transform: translateY(-3px); }
.is-style-tarjeta > .wp-block-image:first-child { margin-top: 0; }
.is-style-tarjeta > .wp-block-image:first-child img { border-radius: 0; }

/* Imagen con forma de piedra */
.wp-block-image.is-style-piedra img,
.wp-block-cover.is-style-piedra {
	border-radius: 58% 42% 46% 54% / 44% 52% 48% 56% !important;
}

/* Lista con hojas */
ul.is-style-hojas { list-style: none; padding-left: 0; }
ul.is-style-hojas li { position: relative; padding-left: 1.75em; margin-bottom: .45em; }
ul.is-style-hojas li::before {
	content: "";
	position: absolute;
	left: 0;
	top: .35em;
	width: 1em;
	height: 1em;
	background-color: var(--wp--preset--color--reserva);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 3C9 3 4 9 4 16c0 1.7.4 3.3 1 5 1-4 4-8 9-10-4 3-6.5 6-7.6 10.2C14.6 21 21 15 20 3z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 3C9 3 4 9 4 16c0 1.7.4 3.3 1 5 1-4 4-8 9-10-4 3-6.5 6-7.6 10.2C14.6 21 21 15 20 3z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.has-flor-color ul.is-style-hojas li::before,
ul.is-style-hojas.has-flor-color li::before { background-color: var(--wp--preset--color--flor); }

/* Paso numerado (ruta) */
.is-style-paso { counter-increment: paso; position: relative; }
.tijiky-ruta { counter-reset: paso; }
.is-style-paso::before {
	content: counter(paso, decimal-leading-zero);
	display: block;
	font-family: var(--wp--preset--font-family--titulos);
	font-size: 2.75rem;
	font-style: italic;
	line-height: 1;
	color: var(--wp--preset--color--barro);
	margin-bottom: .5rem;
}

/* Botón flotante de WhatsApp */
.wp-block-buttons.is-style-flotante {
	position: fixed;
	right: clamp(12px, 3vw, 28px);
	bottom: clamp(12px, 3vw, 28px);
	z-index: 60;
	margin: 0 !important;
}
.wp-block-buttons.is-style-flotante .wp-block-button__link {
	box-shadow: 0 10px 30px -8px rgba(0,0,0,.45);
	background-color: #1f8f4e;
}
.wp-block-buttons.is-style-flotante .wp-block-button__link:hover { background-color: var(--wp--preset--color--monte); }
.editor-styles-wrapper .wp-block-buttons.is-style-flotante { position: static; }

/* Ajustes generales */
.wp-block-navigation .wp-block-navigation-item__content { text-decoration: none; }
.wp-block-navigation .current-menu-item > a,
.wp-block-navigation .wp-block-navigation-item__content:hover { text-decoration: underline; text-underline-offset: .35em; }
.wp-block-details summary { cursor: pointer; font-weight: 600; font-size: 1.0625rem; }
:where(.wp-block-group.has-background) { border-radius: 0; }
.has-monte-background-color :where(h1,h2,h3,h4,h5,h6),
.has-madera-background-color :where(h1,h2,h3,h4,h5,h6),
.has-contrast-background-color :where(h1,h2,h3,h4,h5,h6),
.has-reserva-background-color :where(h1,h2,h3,h4,h5,h6),
.wp-block-cover:not(.is-light) :where(h1,h2,h3,h4,h5,h6) { color: inherit; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.is-style-tarjeta { transition: none; }
	.is-style-tarjeta:hover { transform: none; }
}

/* Páginas libres: las secciones a ancho completo van pegadas */
.tijiky-landing > .alignfull { margin-top: 0; margin-bottom: 0; }

/* Portadas: el contenido se alinea con el ancho del sitio */
.wp-block-cover.alignfull.has-custom-content-position .wp-block-cover__inner-container { width: 100% !important; }
.wp-site-blocks > footer { margin-block-start: 0; }

/* Cita sin borde (estilo "Simple") */
.wp-block-quote.is-style-plain { border: 0; padding-left: 0; text-align: center; }
.wp-block-quote.is-style-plain cite {
	display: block;
	margin-top: 1rem;
	font-family: var(--wp--preset--font-family--texto);
	font-size: var(--wp--preset--font-size--small);
	font-style: normal;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--flor);
}

/* =========================================================
   v2 · Más vida
   ========================================================= */

/* Títulos con palabra destacada en cursiva: escribe la palabra en cursiva en el editor */
:where(h1, h2, h3) em { font-style: italic; font-weight: 400; color: var(--wp--preset--color--barro); }
.wp-block-cover :where(h1, h2, h3) em,
.has-monte-background-color :where(h1, h2, h3) em,
.has-reserva-background-color :where(h1, h2, h3) em { color: var(--wp--preset--color--flor); }
.has-flor-background-color :where(h1, h2, h3) em { color: var(--wp--preset--color--colibri); }

/* Encabezado transparente sobre la portada */
.tijiky-header-wrap {
	position: fixed;
	top: 0; left: 0; right: 0;
	z-index: 70;
	margin: 0 !important;
	transition: background-color .35s ease, box-shadow .35s ease, padding .35s ease;
	background: linear-gradient(180deg, rgba(14,44,31,.55), rgba(14,44,31,0));
}
.admin-bar .tijiky-header-wrap { top: 32px; }
@media (max-width: 782px) { .admin-bar .tijiky-header-wrap { top: 46px; } }
.tijiky-header-wrap.is-scrolled {
	background: rgba(14,44,31,.92);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	box-shadow: 0 10px 30px -18px rgba(0,0,0,.6);
}
.tijiky-header-wrap .tijiky-header-flotante { transition: padding .35s ease; }
.tijiky-header-wrap.is-scrolled .tijiky-header-flotante { padding-top: .45rem !important; padding-bottom: .45rem !important; }
.tijiky-header-wrap .wp-block-site-logo img { transition: width .35s ease; filter: drop-shadow(0 6px 14px rgba(0,0,0,.35)); }
.tijiky-header-wrap.is-scrolled .wp-block-site-logo img { width: 104px !important; }
.tijiky-header-wrap .wp-block-navigation .wp-block-navigation-item__content { text-shadow: 0 1px 10px rgba(0,0,0,.35); }
.tijiky-header-wrap .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { text-shadow: none; }
.tijiky-header-wrap .wp-block-navigation__responsive-container-open { color: #fff; }
@media (max-width: 600px) { .tijiky-header-wrap .wp-block-site-logo img { width: 112px !important; } }

/* Portada viva: zoom lento de la imagen */
.wp-block-cover.is-style-vivo { overflow: hidden; }
.wp-block-cover.is-style-vivo .wp-block-cover__image-background {
	animation: tj-kenburns 22s ease-out both;
	transform-origin: 60% 40%;
}
@keyframes tj-kenburns { from { transform: scale(1.14); } to { transform: scale(1); } }

/* Entrada del contenido de la portada */
.tijiky-hero .wp-block-cover__inner-container > * > * { animation: tj-sube 1s cubic-bezier(.2,.7,.2,1) both; }
.tijiky-hero .wp-block-cover__inner-container > * > *:nth-child(2) { animation-delay: .15s; }
.tijiky-hero .wp-block-cover__inner-container > * > *:nth-child(3) { animation-delay: .3s; }
.tijiky-hero .wp-block-cover__inner-container > * > *:nth-child(4) { animation-delay: .45s; }
@keyframes tj-sube { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

/* Indicador para bajar */
.tijiky-bajar { display: flex; justify-content: center; }
.tijiky-bajar a {
	display: inline-flex; align-items: center; justify-content: center;
	width: 46px; height: 46px; border-radius: 50%;
	border: 1.5px solid rgba(255,255,255,.7); color: #fff !important; text-decoration: none;
	animation: tj-flota 2.2s ease-in-out infinite;
}
@keyframes tj-flota { 0%,100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* La portada deja espacio para las tarjetas que se montan encima */
.tijiky-hero:has(+ .tijiky-solapa) { padding-bottom: clamp(9rem, 15vw, 13rem) !important; }

/* Tarjetas que se montan sobre la portada */
.tijiky-solapa { position: relative; z-index: 5; margin-top: calc(-1 * clamp(7rem, 12vw, 10rem)) !important; margin-bottom: var(--wp--preset--spacing--60) !important; }
.tijiky-camino { border-radius: 22px; overflow: hidden; box-shadow: 0 30px 60px -30px rgba(14,44,31,.7); }
.tijiky-camino .wp-block-cover__image-background { transition: transform .9s cubic-bezier(.2,.7,.2,1); }
.tijiky-camino:hover .wp-block-cover__image-background { transform: scale(1.07); }
.tijiky-camino a { color: inherit; }
.tijiky-camino .tijiky-num {
	font-family: var(--wp--preset--font-family--titulos);
	font-style: italic; font-size: 1.1rem; color: var(--wp--preset--color--flor);
	border: 1px solid rgba(246,185,59,.6); border-radius: 999px; padding: .1rem .7rem; display: inline-block;
}

/* Marquesina */
.tijiky-marquesina { overflow: hidden; }
p.is-style-marquesina {
	display: inline-block;
	white-space: nowrap;
	margin: 0 !important;
	font-family: var(--wp--preset--font-family--titulos);
	font-style: italic;
	animation: tj-marquesina 45s linear infinite;
	will-change: transform;
}
@keyframes tj-marquesina { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tijiky-marquesina:hover p.is-style-marquesina { animation-play-state: paused; }
.editor-styles-wrapper p.is-style-marquesina { animation: none; white-space: normal; }

/* Onda superior en secciones de color */
.wp-block-group.is-style-onda { position: relative; overflow: visible; }
.wp-block-group.is-style-onda::before {
	content: ""; position: absolute; left: 0; right: 0; top: -58px; height: 60px;
	background: inherit; pointer-events: none; z-index: 3;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 60' preserveAspectRatio='none'%3E%3Cpath d='M0 60V34c120-20 260-34 420-18s300 34 470 26 330-38 550-30v48z'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 60' preserveAspectRatio='none'%3E%3Cpath d='M0 60V34c120-20 260-34 420-18s300 34 470 26 330-38 550-30v48z'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat;
}

/* Galería en mosaico */
.wp-block-gallery.is-style-mosaico.has-nested-images {
	display: grid !important;
	grid-template-columns: repeat(4, 1fr);
	grid-auto-rows: clamp(140px, 17vw, 240px);
	gap: clamp(8px, 1.2vw, 16px) !important;
}
.wp-block-gallery.is-style-mosaico.has-nested-images figure.wp-block-image {
	width: auto !important; margin: 0 !important; border-radius: 18px; overflow: hidden;
}
.wp-block-gallery.is-style-mosaico.has-nested-images figure.wp-block-image img { width: 100%; height: 100% !important; object-fit: cover; border-radius: 0; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.wp-block-gallery.is-style-mosaico figure.wp-block-image:hover img { transform: scale(1.06); }
.wp-block-gallery.is-style-mosaico.has-nested-images { grid-auto-flow: dense; }
.wp-block-gallery.is-style-mosaico figure:nth-child(6n+1) { grid-column: span 2; grid-row: span 2; }
.wp-block-gallery.is-style-mosaico figure:nth-child(6n+3) { grid-row: span 2; }
.wp-block-gallery.is-style-mosaico figure:nth-child(6n+6) { grid-column: span 3; }
@media (max-width: 700px) {
	.wp-block-gallery.is-style-mosaico.has-nested-images { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 150px; }
	.wp-block-gallery.is-style-mosaico figure:nth-child(6n+5),
	.wp-block-gallery.is-style-mosaico figure:nth-child(6n+6) { grid-column: span 2; }
}

/* Video vertical tipo celular */
.wp-block-video.is-style-vertical { margin: 0; }
.wp-block-video.is-style-vertical video {
	width: 100%; aspect-ratio: 9 / 16; object-fit: cover; display: block;
	border-radius: 28px; box-shadow: 0 30px 60px -28px rgba(0,0,0,.65);
	border: 6px solid rgba(255,255,255,.12);
}
.tijiky-desfase { margin-top: clamp(2rem, 6vw, 5rem) !important; }

/* Texto gigante */
.tijiky-manifiesto { line-height: 1.08 !important; letter-spacing: -.02em; }

/* Aparición al hacer scroll (solo con JavaScript activo) */
.tj-anim .tj-reveal { opacity: 0; transform: translateY(34px); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1); }
.tj-anim .tj-reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
	.wp-block-cover.is-style-vivo .wp-block-cover__image-background,
	.tijiky-hero .wp-block-cover__inner-container > * > *,
	.tijiky-bajar a,
	.is-style-marquesina > span { animation: none !important; }
	.tijiky-camino .wp-block-cover__image-background { transition: none; }
}

/* Ajustes v2.1 */
.wp-block-cover.is-style-vivo .wp-block-cover__image-background { filter: saturate(1.25) contrast(1.05); }
.has-selva-gradient-background :where(h1, h2, h3) em { color: var(--wp--preset--color--flor); }
ul.is-style-hojas.has-hoja-color li::before { background-color: var(--wp--preset--color--flor); }

/* Botón de sonido sobre los videos */
.tijiky-video-sonido { position: relative; }
.tijiky-sonido {
	position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
	display: inline-flex; align-items: center; gap: .45rem;
	padding: .5rem .9rem; border: 0; border-radius: 999px; cursor: pointer;
	font: 600 .8125rem/1 var(--wp--preset--font-family--texto);
	color: #fff; background: rgba(14,44,31,.72);
	backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
	box-shadow: 0 6px 18px -6px rgba(0,0,0,.5);
	white-space: nowrap; transition: background-color .2s ease;
}
.tijiky-sonido:hover { background: var(--wp--preset--color--flor); color: var(--wp--preset--color--monte); }
.tijiky-sonido:focus-visible { outline: 2px solid var(--wp--preset--color--flor); outline-offset: 3px; }
.tijiky-sonido svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.tijiky-sonido[aria-pressed="true"] { background: var(--wp--preset--color--flor); color: var(--wp--preset--color--monte); }

/* Ondas: color sólido para que empalmen sin cortes (también sobre degradados) */
.wp-block-group.is-style-onda::before { background: var(--tj-onda, inherit); top: -59px; height: 61px; }
.has-selva-gradient-background { --tj-onda: var(--wp--preset--color--reserva); }
.has-atardecer-gradient-background { --tj-onda: var(--wp--preset--color--flor); }


/* =========================================================
   v2.3
   ========================================================= */

/* Botón flotante de WhatsApp (lo dibuja el tema; se configura en Apariencia → Ajustes de Tijiky) */
.wp-block-buttons.is-style-flotante { display: none !important; } /* versión anterior */
.tijiky-wa {
	position: fixed; right: clamp(14px, 3vw, 28px); bottom: clamp(14px, 3vw, 28px); z-index: 9990;
	display: inline-flex; align-items: center; gap: .6rem;
	padding: .8rem 1.25rem .8rem 1rem; border-radius: 999px;
	background: #25D366; color: #fff !important; text-decoration: none !important;
	font: 700 1rem/1 var(--wp--preset--font-family--texto);
	box-shadow: 0 12px 28px -10px rgba(0,0,0,.55), 0 0 0 4px rgba(37,211,102,.18);
	transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.tijiky-wa svg { width: 28px; height: 28px; fill: #fff; flex: none; }
.tijiky-wa:hover, .tijiky-wa:focus-visible {
	background: #128C7E; color: #fff !important; transform: translateY(-2px);
	box-shadow: 0 16px 32px -10px rgba(0,0,0,.6), 0 0 0 6px rgba(37,211,102,.22);
}
.tijiky-wa:focus-visible { outline: 3px solid var(--wp--preset--color--flor); outline-offset: 3px; }
@media (max-width: 700px) {
	.tijiky-wa { padding: 14px; }
	.tijiky-wa span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
	.tijiky-wa svg { width: 30px; height: 30px; }
}

/* Imagen redonda */
.wp-block-image.is-style-circulo { max-width: 220px; margin-left: auto !important; margin-right: auto !important; }
.wp-block-image.is-style-circulo img { border-radius: 50% !important; box-shadow: 0 18px 36px -22px rgba(14,44,31,.7); }

/* Pasos numerados sobre fondos oscuros */
.has-monte-background-color .is-style-paso::before,
.has-reserva-background-color .is-style-paso::before { color: var(--wp--preset--color--flor); }

/* Títulos sin palabras sueltas al final */
h1, h2, h3 { text-wrap: balance; }

/* Encabezado: el menú nunca se parte en dos líneas.
   Entre 600 y 1100 px se usa el menú de hamburguesa. */
.tijiky-header-wrap .wp-block-navigation__container,
.tijiky-header .wp-block-navigation__container { flex-wrap: nowrap; white-space: nowrap; gap: clamp(.9rem, 1.4vw, 1.6rem); }
header .wp-block-button__link { white-space: nowrap; }
@media (max-width: 1100px) {
	header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex !important; }
	header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none !important; }
}
