/*
Theme Name: Esther Just Papelería
Theme URI: https://www.estherjust.es
Author: Infopid
Description: Tema juvenil para la papelería Esther Just (La Granja d'Escarp). Portada editable desde la página «Inicio», preparado para Complianz y con logos del Kit Digital en el pie.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: ej
*/

:root {
	--bg: #fff9f0;
	--paper: #ffffff;
	--ink: #2b2350;
	--muted: #6b6488;
	--pink: #ff4f8b;
	--pink-soft: #ffe3ed;
	--yellow: #ffc531;
	--yellow-soft: #fff2c7;
	--teal: #16bfae;
	--teal-soft: #d6f6f2;
	--blue: #4d7cfe;
	--blue-soft: #e1e9ff;
	--orange: #ff8a3d;
	--orange-soft: #ffe7d6;
	--purple: #8b5cf6;
	--purple-soft: #ece4ff;
	--line: #eee5d8;
	--radius: 22px;
	--shadow: 0 6px 0 rgba(43, 35, 80, .08), 0 18px 40px rgba(43, 35, 80, .08);
	--font: "Nunito", ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
	--font-display: "Fredoka", "Baloo 2", ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--pink); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .5em; font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: clamp(2.2rem, 5.5vw, 3.8rem); }
h2 { font-size: clamp(1.8rem, 3.8vw, 2.7rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 10px; left: 10px; z-index: 1000; width: auto; height: auto; clip: auto; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; }

.container { width: min(1180px, 100% - 40px); margin-inline: auto; }

/* ---------- Botones y etiquetas ---------- */
.btn {
	display: inline-flex; align-items: center; gap: .5em;
	padding: .85em 1.5em; border-radius: 999px; border: 2.5px solid var(--ink);
	font-family: var(--font-display); font-weight: 700; font-size: 1rem; line-height: 1;
	text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s;
}
.btn svg { width: 1.15em; height: 1.15em; }
.btn--primary { background: var(--pink); color: #fff; box-shadow: 4px 4px 0 var(--ink); }
.btn--primary:hover { color: #fff; transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn--ghost { background: var(--paper); color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.btn--ghost:hover { color: var(--ink); background: var(--yellow); transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn--sm { padding: .6em 1.1em; font-size: .92rem; box-shadow: 3px 3px 0 var(--ink); }

.eyebrow {
	display: inline-block; font-family: var(--font-display); font-weight: 700; font-size: .85rem;
	text-transform: uppercase; letter-spacing: .08em; color: var(--ink);
	background: var(--yellow); padding: .35em .9em; border-radius: 999px; transform: rotate(-2deg); margin-bottom: 1rem;
}
.hl { position: relative; white-space: nowrap; z-index: 0; }
.hl::after { content: ""; position: absolute; left: -4px; right: -4px; bottom: .08em; height: .38em; background: var(--yellow); border-radius: 6px; z-index: -1; transform: rotate(-1deg); }
.hl--pink { color: var(--pink); }
.hl--pink::after { background: var(--pink-soft); }

/* ---------- Cabecera ---------- */
.topbar { background: var(--ink); color: #fff; font-size: .88rem; }
.topbar .container { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; flex-wrap: wrap; }
.topbar a { color: #fff; text-decoration: none; }
.topbar a:hover { color: var(--yellow); }
.topbar span { display: inline-flex; align-items: center; gap: 6px; }
.topbar svg { width: 15px; height: 15px; }

.site-header { position: sticky; top: 0; z-index: 100; background: rgba(255, 249, 240, .92); backdrop-filter: blur(10px); border-bottom: 2px solid transparent; transition: border-color .2s, box-shadow .2s; }
.site-header.is-scrolled { border-color: var(--line); box-shadow: 0 6px 20px rgba(43, 35, 80, .06); }
.site-header .container { display: flex; align-items: center; gap: 24px; min-height: 78px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand__mark { width: 50px; height: 50px; flex: none; }
.brand__text { font-family: var(--font-display); font-weight: 800; font-size: 1.45rem; line-height: 1; }
.brand__text small { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--pink); margin-top: 4px; }
.custom-logo { max-height: 60px; width: auto; }

.main-nav { margin-left: auto; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.main-nav a { display: block; padding: .5em .95em; border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 700; }
.main-nav a:hover, .main-nav a.is-active, .main-nav .current-menu-item > a { background: var(--pink-soft); color: var(--pink); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; width: 46px; height: 46px; border-radius: 14px; border: 2.5px solid var(--ink); background: var(--yellow); cursor: pointer; padding: 0; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.nav-toggle span { display: block; width: 20px; height: 2.5px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
.menu-open .nav-toggle span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.menu-open .nav-toggle span:nth-child(2) { opacity: 0; }
.menu-open .nav-toggle span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ---------- Secciones ---------- */
.section { padding: clamp(64px, 9vw, 110px) 0; position: relative; }
section[id] { scroll-margin-top: 80px; }
.section--white { background: var(--paper); }
.section--teal { background: var(--teal-soft); }
.section--dots { background-color: var(--paper); background-image: radial-gradient(var(--line) 1.6px, transparent 1.6px); background-size: 22px 22px; }
.section-head { max-width: 720px; margin: 0 auto 48px; text-align: center; }
.section-head p { color: var(--muted); font-size: 1.1rem; }
.wave { display: block; width: 100%; height: 40px; }

/* Hero */
.hero { padding: clamp(40px, 7vw, 90px) 0 clamp(60px, 8vw, 110px); position: relative; overflow: hidden; }
.hero .container { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero .lead { font-size: 1.18rem; color: var(--muted); max-width: 560px; }
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; margin: 28px 0 32px; }
.hero__badges { display: flex; gap: 10px; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; }
.hero__badges li { background: var(--paper); border: 2px solid var(--line); border-radius: 999px; padding: .4em 1em; font-weight: 700; font-size: .92rem; display: inline-flex; gap: 6px; align-items: center; }
.hero__art { position: relative; }
.hero__art svg { width: 100%; filter: drop-shadow(0 18px 30px rgba(43, 35, 80, .12)); }
.hero__sticker { position: absolute; font-family: var(--font-display); font-weight: 800; background: var(--teal); color: #fff; border: 2.5px solid var(--ink); border-radius: 999px; padding: .5em 1.1em; box-shadow: 3px 3px 0 var(--ink); transform: rotate(-8deg); top: 4%; left: -2%; }
.hero__sticker--2 { background: var(--yellow); color: var(--ink); top: auto; left: auto; bottom: 6%; right: 0; transform: rotate(6deg); }
.blob { position: absolute; border-radius: 50%; z-index: -1; filter: blur(2px); }
.blob--1 { width: 360px; height: 360px; background: var(--pink-soft); top: -80px; right: -100px; }
.blob--2 { width: 220px; height: 220px; background: var(--teal-soft); bottom: -60px; left: -80px; }

/* Nosotros */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.about__card { background: var(--yellow-soft); border: 2.5px solid var(--ink); border-radius: 30px; padding: 36px; box-shadow: 8px 8px 0 var(--ink); transform: rotate(-1.5deg); position: relative; }
.about__card::before { content: ""; position: absolute; top: -16px; left: 50%; width: 120px; height: 32px; background: rgba(255, 79, 139, .55); transform: translateX(-50%) rotate(3deg); border-radius: 4px; }
.about__card p { font-size: 1.05rem; }
.about__card strong { color: var(--pink); }
.values { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
.values li { display: flex; gap: 14px; align-items: flex-start; }
.values .ico { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; border: 2px solid var(--ink); }
.values .ico svg { width: 24px; height: 24px; }
.values b { display: block; font-family: var(--font-display); font-size: 1.1rem; }
.values span { color: var(--muted); }

/* Categorías */
.cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.cat { background: var(--paper); border: 2.5px solid var(--ink); border-radius: var(--radius); padding: 28px; box-shadow: 5px 5px 0 var(--ink); transition: transform .2s, box-shadow .2s; }
.cat:nth-child(odd) { transform: rotate(-.8deg); }
.cat:nth-child(even) { transform: rotate(.8deg); }
.cat:hover { transform: translate(-3px, -3px) rotate(0); box-shadow: 9px 9px 0 var(--ink); }
.cat__icon { width: 74px; height: 74px; border-radius: 22px; display: grid; place-items: center; margin-bottom: 18px; border: 2px solid var(--ink); }
.cat__icon svg { width: 40px; height: 40px; }
.cat p { color: var(--muted); margin: 0; }
.bg-pink { background: var(--pink-soft); color: var(--pink); }
.bg-yellow { background: var(--yellow-soft); color: #c98c00; }
.bg-teal { background: var(--teal-soft); color: #0b958a; }
.bg-blue { background: var(--blue-soft); color: var(--blue); }
.bg-orange { background: var(--orange-soft); color: #e46a17; }
.bg-purple { background: var(--purple-soft); color: var(--purple); }

/* Servicios */
.services { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.service { background: var(--paper); border-radius: var(--radius); padding: 26px 22px; text-align: center; border: 2px solid var(--line); }
.service .cat__icon { margin: 0 auto 14px; width: 64px; height: 64px; border-radius: 50%; }
.service .cat__icon svg { width: 32px; height: 32px; }
.service h3 { font-size: 1.15rem; }
.service p { color: var(--muted); font-size: .96rem; margin: 0; }

/* Franja CTA */
.cta-band { background: var(--pink); color: #fff; border: 2.5px solid var(--ink); border-radius: 34px; padding: clamp(32px, 5vw, 56px); display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: center; box-shadow: 8px 8px 0 var(--ink); position: relative; overflow: hidden; }
.cta-band h2 { color: #fff; }
.cta-band p { margin: 0; font-size: 1.1rem; opacity: .95; }
.cta-band .btn--ghost { background: var(--yellow); }
.cta-band::after { content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255, 255, 255, .14); }

/* Contacto */
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 48px; align-items: start; }
.contact-intro { color: var(--muted); }
.contact-info { display: grid; gap: 14px; margin-top: 24px; }
.contact-item { display: flex; gap: 14px; align-items: center; background: var(--paper); border: 2px solid var(--line); border-radius: 18px; padding: 14px 16px; }
.contact-item .icon { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; }
.contact-item .icon svg { width: 22px; height: 22px; }
.contact-item small { display: block; color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: .72rem; letter-spacing: .08em; }
.contact-item a, .contact-item span { color: var(--ink); font-weight: 700; text-decoration: none; }
.contact-item a:hover { color: var(--pink); }
.contact-map { margin-top: 18px; }

.form { background: var(--paper); border: 2.5px solid var(--ink); border-radius: 28px; padding: clamp(24px, 4vw, 38px); box-shadow: 8px 8px 0 var(--teal); }
.form h3 { margin-bottom: 18px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 800; font-size: .92rem; margin-bottom: 6px; }
.field input, .field textarea, .field select { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 2px solid var(--line); border-radius: 14px; padding: .75em 1em; transition: border-color .15s, background .15s; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--blue); background: #fff; }
.field textarea { min-height: 130px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; margin-bottom: 12px; cursor: pointer; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--pink); flex: none; }
.form-legal { background: var(--bg); border-radius: 14px; padding: 14px 16px; font-size: .8rem; color: var(--muted); margin: 6px 0 20px; line-height: 1.5; }
.form-legal b { color: var(--ink); display: block; margin-bottom: 4px; }
.form-legal p { margin: 0; }
.hp { position: absolute; left: -9999px; }
.notice { padding: 12px 16px; border-radius: 14px; margin-bottom: 18px; font-weight: 700; }
.notice--ok { background: var(--teal-soft); color: #0b7a70; }
.notice--err { background: var(--pink-soft); color: #c4245b; }

/* ---------- Páginas interiores ---------- */
.page-content { padding: 56px 0 90px; }
.page-content article { max-width: 860px; margin: 0 auto; background: var(--paper); border: 2px solid var(--line); border-radius: 28px; padding: clamp(24px, 5vw, 56px); }
.page-content h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.entry h2 { font-size: 1.45rem; margin-top: 1.6em; }
.entry table { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 1em 0 1.5em; display: block; overflow-x: auto; }
.entry th, .entry td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.entry th { background: var(--yellow-soft); }
.entry ul { padding-left: 1.3em; }

/* ---------- Pie ---------- */
.site-footer { background: var(--ink); color: #d9d4ee; margin-top: 0; position: relative; }
.site-footer .wave { position: absolute; top: -39px; left: 0; color: var(--ink); }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding: 64px 0 40px; }
.site-footer .brand, .site-footer .brand:hover { color: #fff; }
.site-footer h4 { color: var(--yellow); font-size: 1.05rem; margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--yellow); }
.footer-claim { margin-top: 14px; max-width: 360px; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-top: 1px solid rgba(255, 255, 255, .14); padding: 20px 0; font-size: .9rem; }
.footer-bottom ul { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.funding { background: #fff; padding: 22px 0 18px; text-align: center; }
.funding img { margin: 0 auto; width: min(100%, 980px); }
.funding p { color: #4a4a4a; font-size: .8rem; margin: 10px 0 0; }

/* ---------- Animación de aparición ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .cat.reveal.is-visible:nth-child(odd) { transform: rotate(-.8deg); }
.js .cat.reveal.is-visible:nth-child(even) { transform: rotate(.8deg); }
.js .cat.reveal.is-visible:hover { transform: translate(-3px, -3px) rotate(0); }
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.js .reveal { opacity: 1; transform: none; transition: none; }
	.btn, .cat { transition: none; }
}

/* ---------- Complianz: banner siempre por encima de la cabecera ---------- */
.cmplz-cookiebanner { z-index: 99999 !important; }
#cmplz-manage-consent .cmplz-manage-consent { z-index: 99998 !important; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
	.hero .container, .split, .contact-grid { grid-template-columns: 1fr; }
	.hero__art { max-width: 520px; margin: 0 auto; }
	.cats { grid-template-columns: repeat(2, 1fr); }
	.services { grid-template-columns: repeat(2, 1fr); }
	.footer-top { grid-template-columns: 1fr 1fr; }
	.footer-top > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
	.nav-toggle { display: inline-flex; }
	.main-nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--bg); border-bottom: 2px solid var(--line); padding: 10px 20px 20px; display: none; }
	.main-nav.is-open { display: block; }
	.main-nav ul { flex-direction: column; }
	.main-nav a { padding: .8em 1em; }
	.header-actions .btn { display: none; }
	.header-actions { margin-left: auto; }
	.cta-band { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
	body { font-size: 16px; }
	.cats, .services, .form__row, .footer-top { grid-template-columns: 1fr; }
	.topbar .tb-hide { display: none; }
	.brand__mark { width: 42px; height: 42px; }
	.brand__text { font-size: 1.25rem; }
	.hero__sticker { font-size: .85rem; }
}
