/*
Theme Name: Grupo Area 23
Theme URI: https://area23.es/
Author: Grupo Area 23
Description: Tema de bloques a medida para Grupo Area 23, consultoría fiscal y energética. Rápido, accesible y con SEO local integrado: títulos y descripciones por página, datos estructurados (AccountingService, servicios, preguntas frecuentes, artículos), migas de pan y Open Graph.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
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: area23
*/

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
strong { font-weight: 650; }

:where(a, button, input, select, textarea, summary, .wp-element-button):focus-visible {
	outline: 2px solid var(--wp--preset--color--ambar);
	outline-offset: 3px;
	border-radius: 6px;
}
::selection { background: var(--wp--preset--color--ambar-suave); color: var(--wp--preset--color--tinta); }

.wp-site-blocks > * { margin-block-start: 0; }
.wp-block-post-content > .alignfull { margin-block-start: 0; margin-block-end: 0; }

/* Etiqueta pequeña encima de los títulos */
.a23-antetitulo {
	display: inline-flex; align-items: center; gap: .55rem;
	font-family: var(--wp--preset--font-family--titulos); font-weight: 650;
	font-size: .82rem; letter-spacing: .08em; text-transform: uppercase;
	color: var(--wp--preset--color--marino);
}
.a23-antetitulo::before { content: ""; width: 22px; height: 3px; border-radius: 2px; background: var(--wp--preset--color--ambar); }

/* ---------- Cabecera ---------- */
.a23-cabecera { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92) !important; backdrop-filter: saturate(1.4) blur(10px); }
.admin-bar .a23-cabecera { top: 32px; }
@media (max-width: 782px) { .admin-bar .a23-cabecera { top: 46px; } }
.a23-cabecera .wp-block-navigation a:where(:not(.wp-element-button)) { text-decoration: none; }
.a23-cabecera .wp-block-navigation a:hover { color: var(--wp--preset--color--marino); }
.a23-cabecera .wp-block-navigation .current-menu-item > a,
.a23-cabecera .wp-block-navigation a[aria-current="page"] { color: var(--wp--preset--color--marino); box-shadow: inset 0 -2px 0 var(--wp--preset--color--ambar); }
.a23-cabecera .wp-block-navigation__submenu-container { background: #fff !important; border: 1px solid var(--wp--preset--color--linea) !important; border-radius: 12px; padding: .4rem !important; min-width: 17.5rem !important; box-shadow: 0 18px 40px -18px rgba(15,27,51,.35); }
.a23-cabecera .wp-block-navigation__submenu-container a { padding: .5rem .75rem !important; border-radius: 8px; }
.a23-cabecera .wp-block-navigation__submenu-container a:hover { background: var(--wp--preset--color--cielo); }
.a23-logo img, .a23-pie .wp-block-image img { display: block; height: auto; aspect-ratio: 437 / 120; }
@media (max-width: 760px) { .a23-cabecera .a23-boton-cabecera { display: none; } }

/* ---------- Botones ---------- */
.wp-block-button.is-style-outline > .wp-block-button__link { border: 1.5px solid var(--wp--preset--color--marino); background: transparent; color: var(--wp--preset--color--marino); }
.wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--wp--preset--color--marino); color: #fff; }
.a23-boton-ambar > .wp-block-button__link { background: var(--wp--preset--color--ambar); color: var(--wp--preset--color--tinta); }
.a23-boton-ambar > .wp-block-button__link:hover { background: #fff; color: var(--wp--preset--color--tinta); }

/* ---------- Portada: hero con papel pautado ---------- */
.a23-hero {
	position: relative; overflow: hidden;
	background-color: #fff;
	background-image:
		radial-gradient(ellipse 55% 70% at 88% 30%, rgba(245,165,36,.16), transparent 70%),
		radial-gradient(ellipse 60% 70% at 70% 90%, rgba(30,58,110,.10), transparent 70%),
		repeating-linear-gradient(180deg, transparent 0 35px, rgba(30,58,110,.055) 35px 36px);
}
.a23-hero h1 { font-size: clamp(2.35rem, 5.2vw, 3.9rem); }
.a23-hero h1 em { font-style: normal; color: var(--wp--preset--color--marino); background: linear-gradient(transparent 68%, rgba(245,165,36,.45) 68% 92%, transparent 92%); }

/* Fichas del hero (calendario fiscal y factura) */
.a23-fichas { position: relative; }
.is-style-ficha, .a23-ficha {
	background: #fff; border: 1px solid var(--wp--preset--color--linea); border-radius: 16px;
	padding: 1.3rem 1.4rem !important;
	box-shadow: 0 30px 60px -32px rgba(15,27,51,.38), 0 2px 6px rgba(15,27,51,.05);
}
.a23-ficha--energia { margin-left: clamp(0rem, 6vw, 4.5rem) !important; margin-top: -0.6rem !important; position: relative; z-index: 2; border-top: 4px solid var(--wp--preset--color--ambar); }
.a23-ficha--fiscal { margin-right: clamp(0rem, 4vw, 3rem) !important; border-top: 4px solid var(--wp--preset--color--marino); }
.a23-ficha__titulo { font-family: var(--wp--preset--font-family--titulos); font-weight: 700; font-size: 1.05rem; margin: 0 0 .7rem !important; display: flex; justify-content: space-between; gap: 1rem; }
.a23-ficha__titulo span { font-weight: 500; font-size: .8rem; color: var(--wp--preset--color--gris); }
.a23-filas { list-style: none; margin: 0; padding: 0; font-size: .93rem; }
.a23-filas li { display: flex; align-items: center; gap: .8rem; padding: .5rem 0; border-top: 1px dashed var(--wp--preset--color--linea); }
.a23-filas li:first-child { border-top: 0; }
.a23-filas b { flex: none; min-width: 5.2rem; text-align: center; font-family: var(--wp--preset--font-family--titulos); font-weight: 650; font-size: .8rem; padding: .22rem .5rem; border-radius: 6px; background: var(--wp--preset--color--cielo); color: var(--wp--preset--color--marino); }
.a23-barras { display: flex; align-items: flex-end; gap: .45rem; height: 88px; margin: .2rem 0 .7rem; padding-bottom: .4rem; border-bottom: 1px solid var(--wp--preset--color--linea); }
.a23-barras i { flex: 1; border-radius: 5px 5px 2px 2px; background: var(--wp--preset--color--cielo); }
.a23-barras i.ok { background: var(--wp--preset--color--ambar); }
.a23-checks { list-style: none; margin: 0; padding: 0; font-size: .9rem; display: grid; gap: .3rem; }
.a23-checks li { padding-left: 1.5rem; position: relative; }
.a23-checks li::before { content: ""; position: absolute; left: 0; top: .32em; width: .95rem; height: .95rem; border-radius: 50%; background: var(--wp--preset--color--ambar) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.2l2.6 2.5L12 5.5' fill='none' stroke='%230F1B33' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/80% no-repeat; }
.a23-nota { font-size: .78rem; color: var(--wp--preset--color--gris); margin-top: .6rem !important; }
@media (max-width: 781px) { .a23-ficha--energia, .a23-ficha--fiscal { margin-left: 0 !important; margin-right: 0 !important; } }

/* ---------- Las dos puertas: Fiscal / Energía ---------- */
.a23-puerta { position: relative; border-radius: 20px; padding: clamp(1.6rem, 4vw, 2.6rem) !important; overflow: hidden; height: 100%; }
.a23-puerta--fiscal { background: var(--wp--preset--gradient--marino); color: #fff; }
.a23-puerta--fiscal :is(h2,h3) { color: #fff; }
.a23-puerta--fiscal p { color: #C9D5EC; }
.a23-puerta--energia { background: var(--wp--preset--color--ambar-suave); border: 1px solid #F3DDB0; }
.a23-puerta::after { content: ""; position: absolute; right: -40px; bottom: -50px; width: 220px; height: 220px; opacity: .10; background: center/contain no-repeat; pointer-events: none; }
.a23-puerta--fiscal::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cpath d='M29 94 L60 27 L91 94' fill='none' stroke='%23fff' stroke-width='13' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.a23-puerta--energia::after { opacity: .18; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cpath d='M66 22 L37 70 L58 70 L48 102 L85 54 L63 54 Z' fill='%23F5A524'/%3E%3C/svg%3E"); }
.a23-puerta .a23-enlaces { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .1rem; position: relative; z-index: 1; }
.a23-puerta .a23-enlaces a { display: flex; justify-content: space-between; gap: 1rem; padding: .62rem 0; text-decoration: none; font-weight: 600; border-top: 1px solid rgba(255,255,255,.16); color: #fff; }
.a23-puerta--energia .a23-enlaces a { color: var(--wp--preset--color--tinta); border-top-color: #EBCF96; }
.a23-puerta .a23-enlaces a::after { content: "→"; transition: transform .15s ease; }
.a23-puerta .a23-enlaces a:hover::after { transform: translateX(4px); }
.a23-puerta--fiscal .a23-enlaces a:hover { color: var(--wp--preset--color--ambar); }
.a23-puerta--energia .a23-enlaces a:hover { color: var(--wp--preset--color--marino); }

/* ---------- Cifras / garantías ---------- */
.a23-sellos { border-top: 1px solid var(--wp--preset--color--linea); border-bottom: 1px solid var(--wp--preset--color--linea); }
.a23-sello { display: flex; gap: .8rem; align-items: flex-start; }
.a23-sello p { margin: 0; font-size: .95rem; color: var(--wp--preset--color--gris); }
.a23-sello strong { display: block; color: var(--wp--preset--color--tinta); font-family: var(--wp--preset--font-family--titulos); font-size: 1.05rem; }

/* ---------- Cabecera de página interior ---------- */
.a23-cabeza-pagina { position: relative; overflow: hidden; background-color: var(--wp--preset--color--cielo); background-image: repeating-linear-gradient(180deg, transparent 0 35px, rgba(30,58,110,.05) 35px 36px); }
.a23-cabeza-pagina::after {
	content: ""; position: absolute; right: max(1rem, calc(50% - 640px)); top: 50%; translate: 0 -50%;
	width: clamp(140px, 22vw, 260px); aspect-ratio: 1; opacity: .09; pointer-events: none;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cpath d='M29 94 L60 27 L91 94' fill='none' stroke='%231E3A6E' stroke-width='13' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M66 52 L47 77 L59 77 L53 97 L76 69 L63 69 Z' fill='%23F5A524'/%3E%3C/svg%3E") center/contain no-repeat;
}
.a23-cabeza-pagina > * { position: relative; z-index: 1; }
.a23-cabeza-pagina .wp-block-post-excerpt { max-width: 46rem; }
.a23-cabeza-pagina .wp-block-post-excerpt__excerpt { margin: 0; }

/* ---------- Tarjetas ---------- */
.is-style-tarjeta {
	position: relative; background: #fff;
	border: 1px solid var(--wp--preset--color--linea); border-radius: 14px;
	padding: 1.45rem !important;
	transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.is-layout-grid > .is-style-tarjeta { height: 100%; }
.is-style-tarjeta:hover { border-color: #C3CEE2; box-shadow: 0 18px 36px -24px rgba(15,27,51,.4); transform: translateY(-2px); }
.is-style-tarjeta :is(h2,h3,h4) a { color: inherit; text-decoration: none; }
.is-style-tarjeta :is(h2,h3,h4) a::after { content: ""; position: absolute; inset: 0; border-radius: 14px; }
.is-style-tarjeta:hover :is(h2,h3,h4) a { color: var(--wp--preset--color--marino); }
@media (prefers-reduced-motion: reduce) { .is-style-tarjeta, .is-style-tarjeta:hover { transition: none; transform: none; } }
.a23-icono { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; background: var(--wp--preset--color--cielo); color: var(--wp--preset--color--marino); margin-bottom: .35rem; }
.a23-icono--ambar { background: var(--wp--preset--color--ambar-suave); color: #B26F00; }
.a23-icono svg { width: 23px; height: 23px; }

/* ---------- Pasos ---------- */
.a23-paso-num { font-family: var(--wp--preset--font-family--titulos); font-weight: 800; font-size: 2.2rem; line-height: 1; color: var(--wp--preset--color--ambar); margin: 0 !important; }

/* ---------- Zonas ---------- */
.a23-zonas { display: flex; flex-wrap: wrap; gap: .55rem; list-style: none; padding: 0; margin: 0; }
.a23-zonas li { border-radius: 999px; background: #fff; border: 1px solid var(--wp--preset--color--linea); font-weight: 600; }
.a23-zonas a { display: block; padding: .55rem 1.1rem; text-decoration: none; color: var(--wp--preset--color--tinta); }
.a23-zonas li:hover { border-color: var(--wp--preset--color--marino); }

/* ---------- Lista con marcas ---------- */
.a23-check { list-style: none; padding-left: 0; }
.a23-check li { position: relative; padding-left: 1.85rem; margin: .6rem 0; }
.a23-check li::before { content: ""; position: absolute; left: 0; top: .3em; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--wp--preset--color--cielo) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.2l2.6 2.5L12 5.5' fill='none' stroke='%231E3A6E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/78% no-repeat; }
ol.wp-block-list li { margin: .5rem 0; }
ol.wp-block-list li::marker { font-weight: 700; color: var(--wp--preset--color--marino); }

/* ---------- Preguntas frecuentes ---------- */
.wp-block-details summary { cursor: pointer; font-weight: 650; font-size: 1.07rem; list-style: none; position: relative; padding-right: 2.2rem; }
.wp-block-details summary::-webkit-details-marker { display: none; }
.wp-block-details summary::after { content: "+"; position: absolute; right: 0; top: 50%; translate: 0 -50%; width: 1.6rem; height: 1.6rem; display: grid; place-items: center; border-radius: 50%; background: var(--wp--preset--color--cielo); color: var(--wp--preset--color--marino); font-weight: 700; }
.wp-block-details[open] summary::after { content: "−"; background: var(--wp--preset--color--ambar); color: var(--wp--preset--color--tinta); }
.wp-block-details > :not(summary) { margin-top: .6rem; color: var(--wp--preset--color--gris); }

/* ---------- Destacado (aviso, consejo) ---------- */
.a23-destacado { border-left: 4px solid var(--wp--preset--color--ambar); background: var(--wp--preset--color--ambar-suave); border-radius: 0 12px 12px 0; padding: 1.1rem 1.3rem !important; }
.a23-destacado p { margin: 0; }

/* ---------- Migas de pan ---------- */
.a23-migas ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; font-size: .85rem; color: var(--wp--preset--color--gris); }
.a23-migas li + li::before { content: "›"; margin-right: .35rem; color: #9AA6BD; }
.a23-migas a { color: var(--wp--preset--color--gris); text-decoration: none; }
.a23-migas a:hover { color: var(--wp--preset--color--marino); text-decoration: underline; }

/* ---------- Datos de contacto ---------- */
.a23-datos p { margin: 0; }
.a23-dato-etiqueta { font-size: .85rem; color: var(--wp--preset--color--gris); margin-top: 1rem !important; }
.a23-dato-etiqueta:first-child { margin-top: 0 !important; }
.a23-telefono a, .a23-correo a { font-family: var(--wp--preset--font-family--titulos); font-weight: 750; font-size: 1.35rem; color: var(--wp--preset--color--tinta); text-decoration: none; word-break: break-word; }
.a23-telefono a:hover, .a23-correo a:hover { color: var(--wp--preset--color--marino); }
.a23-boton-wa { display: inline-block; margin-top: .8rem; padding: .7rem 1.1rem; border-radius: 10px; background: #1f9d5c; color: #fff !important; font-weight: 600; text-decoration: none; }

/* ---------- Imágenes y blog ---------- */
.wp-block-post-featured-image img { object-fit: cover; border-radius: 14px; border: 1px solid var(--wp--preset--color--linea); }
.a23-entradas .wp-block-post-title a { text-decoration: none; }
.a23-entradas .wp-block-post-title a:hover { color: var(--wp--preset--color--marino); text-decoration: underline; }
.a23-articulo .wp-block-post-content > * + h2 { margin-top: 2.2rem; }
.wp-block-post-excerpt__more-link { font-weight: 600; }

/* ---------- Llamada a la acción ---------- */
.a23-llamada { position: relative; overflow: hidden; }
.a23-llamada::after { content: ""; position: absolute; right: -30px; top: -40px; width: 240px; height: 240px; opacity: .12; pointer-events: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cpath d='M66 22 L37 70 L58 70 L48 102 L85 54 L63 54 Z' fill='%23F5A524'/%3E%3C/svg%3E") center/contain no-repeat; }
.a23-llamada > * { position: relative; z-index: 1; }

/* ---------- WhatsApp ---------- */
.a23-whatsapp {
	position: fixed; right: clamp(.75rem, 2.5vw, 1.5rem); bottom: clamp(.75rem, 2.5vw, 1.5rem); z-index: 90;
	display: inline-flex; align-items: center; gap: .5rem;
	padding: .7rem 1.05rem .7rem .8rem; border-radius: 999px;
	background: #1f9d5c; color: #fff; font-weight: 600; text-decoration: none;
	box-shadow: 0 10px 28px rgba(15,27,51,.3);
}
.a23-whatsapp:hover, .a23-whatsapp:focus-visible { background: #188a50; color: #fff; }
@media (max-width: 600px) {
	.a23-whatsapp { padding: .8rem; }
	.a23-whatsapp__texto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- Formulario ---------- */
.wpcf7 form p { margin: 0 0 1.1rem; }
.wpcf7 label { display: block; font-weight: 600; font-size: .95rem; }
.wpcf7 input[type="text"], .wpcf7 input[type="email"], .wpcf7 input[type="tel"], .wpcf7 textarea, .wpcf7 select {
	display: block; width: 100%; margin-top: .4rem; padding: .8rem .9rem; font: inherit; font-weight: 400;
	color: var(--wp--preset--color--tinta); background: #fff; border: 1px solid #CDD5E3; border-radius: 10px; box-sizing: border-box;
}
.wpcf7 textarea { min-height: 9rem; resize: vertical; }
.wpcf7 input:focus, .wpcf7 textarea:focus, .wpcf7 select:focus { border-color: var(--wp--preset--color--marino); outline: 3px solid rgba(30,58,110,.15); outline-offset: 0; }
.wpcf7 .wpcf7-list-item { margin: 0; }
.wpcf7 .wpcf7-acceptance label { font-weight: 400; font-size: .9rem; color: var(--wp--preset--color--gris); display: flex; gap: .6rem; align-items: flex-start; }
.wpcf7 .wpcf7-acceptance input { margin-top: .3rem; accent-color: var(--wp--preset--color--marino); }
.wpcf7 input[type="submit"] { cursor: pointer; padding: .9rem 1.7rem; font: inherit; font-family: var(--wp--preset--font-family--titulos); font-weight: 650; color: #fff; background: var(--wp--preset--color--marino); border: 0; border-radius: 10px; }
.wpcf7 input[type="submit"]:hover { background: var(--wp--preset--color--tinta); }
.wpcf7 .wpcf7-response-output { border-radius: 10px; }

/* ---------- Tablas ---------- */
.wp-block-table table { border-collapse: collapse; width: 100%; background: #fff; }
.wp-block-table td, .wp-block-table th { border: 1px solid var(--wp--preset--color--linea); padding: .65rem .8rem; vertical-align: top; text-align: left; }
.wp-block-table th { background: var(--wp--preset--color--cielo); color: var(--wp--preset--color--tinta); font-family: var(--wp--preset--font-family--titulos); }

/* ---------- Pie ---------- */
.a23-pie a { text-decoration: none; color: #D6DEEE; }
.a23-pie a:hover { color: var(--wp--preset--color--ambar); }
.a23-pie p { margin: 0; }

/* Títulos dentro del contenido de páginas y artículos, algo más contenidos */
.wp-block-post-content.is-layout-constrained > h2.wp-block-heading { font-size: clamp(1.55rem, 2.6vw, 2.05rem); margin-top: 2.4rem; }
.wp-block-post-content.is-layout-constrained > h2.wp-block-heading:first-child { margin-top: 0; }
