/*
Theme Name: Brote
Description: Tema de bloques de Brote (@plantasbrote.cl). Estilo editorial tipo herbario: lienzo crema, titulares gigantes en Fraunces, texto en Inter, líneas finas, enlaces subrayados y movimiento suave. Colores de Brote; el logo y el isotipo no se tocan.
Version: 0.5.2
Requires at least: 6.4
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: brote
*/
:root { --lado: clamp(20px, 4vw, 40px); --ink: #14442E; --ease: cubic-bezier(.25,.74,.22,.99); --ease-in-out: cubic-bezier(.86,0,.07,1); }
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: #A8C64B; color: #14442E; }
.wp-site-blocks > * { margin-block-start: 0 !important; }
button, input, textarea, select, .wp-element-button { border-radius: 0; }
img { height: auto; }

/* enlaces: solo subrayado fino; al pasar el mouse engrosa y cambia a coral */
a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: currentColor; transition: text-decoration-thickness .3s, text-decoration-color .3s; }
a:hover { text-decoration-thickness: 2px; text-decoration-color: #E8654A; }
:focus-visible { outline: 2px solid #14442E; outline-offset: 4px; }
.brote-cab a, .brote-nav a, .brote-pie a.sin { text-decoration: none; }
.brote-cab a:hover { text-decoration: underline; }

/* cabecera: 70 px, sin caja, con línea fina */
.brote-cab { position: relative; z-index: 10; height: 71px; box-sizing: border-box; padding: 0 var(--lado); border-bottom: 1px solid var(--ink); display: flex !important; flex-wrap: nowrap; align-items: center; gap: clamp(14px, 2.2vw, 28px); }
.brote-cab > * { margin: 0 !important; flex: 0 0 auto; }
.brote-cab > .wp-block-image { margin-right: auto !important; }
.brote-cab .wp-block-image img { width: 118px; height: auto; border-radius: 0; display: block; }
.brote-cab .brote-nav { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; }
.brote-cab .brote-cta { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
/* cuenta y carrito que agrega WooCommerce: chicos, en verde selva, sin cajas */
.brote-cab .wp-block-woocommerce-customer-account a, .brote-cab .wc-block-mini-cart__button { color: #14442E; text-decoration: none; }
.brote-cab .wp-block-woocommerce-customer-account svg, .brote-cab .wc-block-mini-cart__icon { width: 20px; height: 20px; }
@media (max-width: 780px) { .brote-cab .brote-cta { display: none; } }

/* portada */
.brote-hero { position: relative; overflow: hidden; min-height: calc(100svh); margin-top: -71px !important; padding: calc(71px + clamp(28px, 6vw, 80px)) var(--lado) 160px; background: linear-gradient(184deg, #C8C28F 0%, #DAD4B0 35%, #E8E3C8 65%, #F4F0E1 100%); }
.brote-display { font-family: var(--wp--preset--font-family--fraunces) !important; font-variation-settings: "SOFT" 100, "WONK" 1; font-optical-sizing: auto; font-size: clamp(46px, 9.8vw, 152px) !important; line-height: .95 !important; letter-spacing: -.03em !important; font-weight: 800; margin: 0; max-width: 100%; position: relative; z-index: 1; }
.brote-hero-planta { transform: translate3d(0, var(--py, 0px), 0); will-change: transform; position: absolute !important; z-index: 2; right: clamp(0px, 6vw, 120px); bottom: 40px; height: min(54%, 600px); margin: 0 !important; pointer-events: none; }
.brote-hero-planta img { height: 100%; width: auto; max-width: none; border-radius: 0; display: block; }
.brote-hero-pie { position: absolute; z-index: 3; left: var(--lado); bottom: 28px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.brote-hero-pie p { margin: 0; }

/* secciones: sin tarjetas; solo espacio y líneas finas */
.brote-seccion { padding: clamp(80px, 10vw, 120px) var(--lado); }
.brote-seccion.linea { border-top: 1px solid var(--ink); }
.brote-seccion.honda { background: var(--wp--preset--color--crema-honda); }
.brote-texto { max-width: 36em; }
.brote-texto p { margin: 0 0 14px; }
.brote-seccion h2 { margin: 0 0 clamp(28px, 4vw, 60px); letter-spacing: -.03em; }
.brote-etq { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 26px; }

/* plantas: grilla de 4 por fila (3 en tablet, 2 en celular), con una línea fina arriba de cada una */
.brote-grilla { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 56px var(--lado); }
.brote-especimen { display: flex; flex-direction: column; gap: 0; padding: 14px 0 0; border-top: 1px solid var(--ink); }
.brote-especimen .foto { margin: 0 0 16px; }
.brote-especimen .foto img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px; display: block; }
.brote-especimen .datos > * { margin: 0 0 6px; }
.brote-especimen .num { font-size: 14px; margin-bottom: 8px !important; }
.brote-especimen h3 { font-variation-settings: "SOFT" 100, "WONK" 1; font-size: clamp(22px, 2.1vw, 30px); line-height: 1.05; letter-spacing: -.02em; font-weight: 700; margin-bottom: 8px !important; }
.brote-especimen .cient { font-size: 14px; line-height: 1.35; }
@media (max-width: 1100px) { .brote-grilla { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) { .brote-grilla { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 14px; } }

/* pasos */
.brote-pasos { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--lado); }
.brote-pasos > * { border-top: 1px solid var(--ink); padding-top: 16px; margin: 0 !important; }
@media (max-width: 780px) { .brote-pasos { grid-template-columns: 1fr; } }

/* pie */
.brote-pie { padding: 60px var(--lado) 40px; border-top: 1px solid var(--ink); display: grid !important; grid-template-columns: repeat(3, 1fr); gap: var(--lado); font-size: 14px; }
.brote-pie .wp-block-image img { width: 160px; border-radius: 0; }
.brote-pie p { margin: 0 0 6px; }
@media (max-width: 780px) { .brote-pie { grid-template-columns: 1fr; } }

/* movimiento (solo si el JS está activo y la persona no pidió menos movimiento) */
.js .brote-reveal { opacity: 0; transform: translateY(40px); transition: opacity 1s var(--ease), transform 2s var(--ease); }
.js .brote-reveal.is-in { opacity: 1; transform: none; }
/* hasta que el script parte las palabras el titular espera; si el script no llega, aparece solo a los 3 s */
.js .brote-display:not(.is-split) { opacity: 0; animation: brote-aparece .01s 3s forwards; }
@keyframes brote-aparece { to { opacity: 1; } }
.js .brote-display .p { display: inline-block; overflow: hidden; vertical-align: top; padding: .1em 0 .12em; margin: -.1em 0 -.12em; }
.js .brote-display .w { display: inline-block; transform: translateY(110%); transition: transform 1.1s var(--ease) calc(var(--i, 0) * 70ms + 150ms); }
.js .brote-display.is-in .w { transform: none; }
.js .brote-hero-planta img { clip-path: inset(100% 0 0 0); transform: translateY(8%) scale(.92); transform-origin: 50% 100%; transition: clip-path 2.2s var(--ease) 1.1s, transform 2.4s var(--ease) 1.1s; }
.js .brote-hero-planta.is-in img { clip-path: inset(0 0 0 0); transform: none; }
/* fotos de las láminas: se descubren de abajo hacia arriba y se asientan con un zoom suave */
.brote-especimen .foto { overflow: hidden; border-radius: 4px; }
.js .brote-especimen .foto img { clip-path: inset(100% 0 0 0); transform: scale(1.14); transition: clip-path 1.5s var(--ease-in-out), transform 2.4s var(--ease); }
.js .brote-especimen .foto.is-in img { clip-path: inset(0 0 0 0); transform: none; }
.js .brote-reveal { transition-delay: var(--d, 0s); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .brote-reveal, .js .brote-display .w, .js .brote-hero-planta img, .js .brote-especimen .foto img { opacity: 1; transform: none; clip-path: none; transition: none; }
  .brote-hero-planta { transform: none; }
}

/* títulos: Fraunces suave y juguetona, como las curvas del logo */
h1, h2, h3 { font-variation-settings: "SOFT" 100, "WONK" 1; }

/* hoja gigante detrás del título */
.brote-hoja-fondo { position: absolute !important; z-index: 0; margin: 0 !important; pointer-events: none; width: min(96vw, 1150px); right: -14vw; top: 3vh; translate: calc(var(--mx, 0) * -28px) calc(var(--my, 0) * -20px); transition: translate .9s var(--ease); transform: translate3d(0, calc(var(--hs, 0) * .14px), 0) rotate(calc(var(--hs, 0) * .018deg)); will-change: transform; animation: brote-deriva 14s ease-in-out infinite; }
.brote-hoja-fondo img { width: 100%; height: auto; display: block; border-radius: 0; }
@keyframes brote-deriva { 0%, 100% { rotate: -5deg; } 50% { rotate: 5deg; } }
.js .brote-hoja-fondo img { transform: scale(.35) rotate(-70deg); opacity: 0; transition: transform 2.4s var(--ease), opacity 1s ease; }
.js .brote-hoja-fondo.is-in img { transform: none; opacity: 1; }

/* planta de la portada: se balancea suave y se inclina hacia el cursor */
.brote-hero-planta { transform-origin: 50% 100%; animation: brote-balanceo 7s ease-in-out 3.4s infinite; }
@keyframes brote-balanceo { 0%, 100% { rotate: -1.6deg; } 50% { rotate: 1.6deg; } }
.brote-hero-planta img { rotate: calc(var(--lean, 0) * 3deg); transform-origin: 50% 100%; }
.js .brote-hero-planta img { transition: clip-path 2.2s var(--ease) 1.1s, transform 2.4s var(--ease) 1.1s, rotate .8s var(--ease); }

/* la palabra "brote" crece como un brote */
.js .brote-display.is-in .marca .w { animation: brote-crece 1.3s var(--ease) 1.7s both; transform-origin: 50% 100%; }
@keyframes brote-crece { 0% { transform: scale(1, .86); } 55% { transform: scale(1.05, 1.12); } 100% { transform: none; } }
.brote-display .marca { position: relative; }

@media (max-width: 780px) { .brote-hoja-fondo { width: 130vw; right: -45vw; top: 8vh; } }
@media (prefers-reduced-motion: reduce) {
  .brote-hoja-fondo, .brote-hero-planta { animation: none !important; transform: none; translate: none; }
  .js .brote-hoja-fondo img, .js .brote-display .marca .w { transform: none; opacity: 1; animation: none; }
}
