/*
Theme Name: Tower CVA
Theme URI: https://towercva.com
Author: Tower CVA S.L.
Description: Tema a medida para Tower CVA S.L. — conserjería, control de accesos, auxiliares de información, embolsado y servicios administrativos. Al activarlo crea las páginas, el menú y los textos legales. Los datos de empresa se editan en Apariencia > Datos Tower CVA.
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 7.4
Version: 1.2.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: towercva
*/

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
body .wp-site-blocks > * { margin-block-start: 0; }
body .wp-block-post-content > .alignfull { margin-block: 0; }
body .wp-block-post-content > .alignfull + .alignfull { margin-top: 0; }
body .wp-block-post-content > .tc-cta-wrap { margin-block: 0; }
body { -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; height: auto; }
.tc-eyebrow {
	display: inline-block;
	font-size: .8rem;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
	margin-bottom: .75rem !important;
}
.tc-lead { font-size: var(--wp--preset--font-size--large); color: var(--wp--preset--color--muted); max-width: 46rem; }
.tc-center { text-align: center; }
.tc-center .tc-lead { margin-inline: auto; }

/* ---------- Header ---------- */
.tc-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(255,255,255,.96);
	backdrop-filter: saturate(160%) blur(8px);
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.admin-bar .tc-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .tc-header { top: 46px; } }
.tc-logo { display: inline-flex; align-items: center; text-decoration: none; line-height: 0; }
.tc-logo img { height: 48px; width: auto; display: block; }
@media (max-width: 600px) { .tc-logo img { height: 40px; } }
.tc-footer .tc-logo img { height: 56px; border-radius: 4px; }
.tc-logo svg { width: 38px; height: 38px; flex: none; }
.tc-logo__text { display: flex; flex-direction: column; line-height: 1; }
.tc-logo__name { font-weight: 800; font-size: 1.25rem; letter-spacing: .04em; }
.tc-logo__name b { color: var(--wp--preset--color--primary); font-weight: 800; }
.tc-logo__tag { font-size: .62rem; letter-spacing: .18em; text-transform: uppercase; color: var(--wp--preset--color--muted); margin-top: .3rem; }
.tc-header .wp-block-navigation a { font-weight: 600; font-size: .95rem; }
.tc-header .wp-block-navigation a:hover { color: var(--wp--preset--color--primary); }
.tc-header .tc-header-tel .wp-block-button__link { padding: .6rem 1.1rem; font-size: .9rem; }
@media (max-width: 900px) { .tc-header .tc-header-tel { display: none; } }

/* ---------- Hero ---------- */
.tc-hero {
	position: relative; overflow: hidden;
	background:
		radial-gradient(1200px 500px at 85% -10%, rgba(232,161,58,.18), transparent 60%),
		linear-gradient(160deg, #0F1E36 0%, #16305A 60%, #1C3D70 100%);
	color: #fff;
}
.tc-hero::after {
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
	background-size: 48px 48px;
	mask-image: linear-gradient(to bottom, #000 30%, transparent 100%);
}
.tc-hero > * { position: relative; z-index: 1; }
.tc-hero h1 { color: #fff; }
.tc-hero .tc-lead { color: rgba(255,255,255,.82); }
.tc-hero .tc-eyebrow { color: var(--wp--preset--color--accent); }
.tc-hero .wp-block-button.is-style-outline .wp-block-button__link { color: #fff; border-color: rgba(255,255,255,.5); }
.tc-hero .wp-block-button.is-style-outline .wp-block-button__link:hover { background: #fff; color: var(--wp--preset--color--ink); }
.tc-hero-art svg { width: 100%; max-width: 440px; display: block; margin-inline: auto; }
@media (max-width: 781px) { .tc-hero-art { display: none; } }

.tc-page-hero {
	background: linear-gradient(160deg, #0F1E36 0%, #1C3D70 100%);
	color: #fff;
}
.tc-page-hero h1 { color: #fff; margin: 0; }

/* ---------- Puntos clave ---------- */
.tc-keys { background: var(--wp--preset--color--surface); border-bottom: 1px solid var(--wp--preset--color--line); }
.tc-keys .wp-block-column { border-left: 3px solid var(--wp--preset--color--accent); padding-left: 1rem; }
.tc-keys h3 { font-size: 1.05rem; margin: 0 0 .25rem; }
.tc-keys p { margin: 0; font-size: .92rem; color: var(--wp--preset--color--muted); }

/* ---------- Tarjetas de servicio ---------- */
.tc-cards { gap: 1.5rem !important; }
.tc-card {
	background: #fff;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 14px;
	padding: 2rem 1.6rem !important;
	transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
	height: 100%;
}
.tc-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -20px rgba(15,30,54,.35); border-color: transparent; }
.tc-card h3 { font-size: 1.2rem; margin: 1rem 0 .5rem; }
.tc-card p { color: var(--wp--preset--color--muted); font-size: .97rem; }
.tc-card a { font-weight: 700; text-decoration: none; }
.tc-card a:hover { text-decoration: underline; }
.tc-icon {
	width: 54px; height: 54px; border-radius: 12px;
	display: grid; place-items: center;
	background: rgba(31,78,140,.08); color: var(--wp--preset--color--primary);
}
.tc-icon svg { width: 28px; height: 28px; }

/* ---------- Sectores ---------- */
.tc-sectors { background: var(--wp--preset--color--surface); }
.tc-chips { list-style: none; padding: 0; margin: 2rem 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .7rem; }
.tc-chips li {
	background: #fff; border: 1px solid var(--wp--preset--color--line);
	border-radius: 999px; padding: .6rem 1.15rem; font-weight: 600; font-size: .95rem;
}

/* ---------- Pasos ---------- */
.tc-steps { counter-reset: paso; }
.tc-steps .wp-block-column { position: relative; padding-top: 3.2rem; }
.tc-steps .wp-block-column::before {
	counter-increment: paso; content: "0" counter(paso);
	position: absolute; top: 0; left: 0;
	font-size: 2.2rem; font-weight: 800; line-height: 1;
	color: var(--wp--preset--color--accent);
}
.tc-steps h3 { font-size: 1.1rem; margin: 0 0 .4rem; }
.tc-steps p { color: var(--wp--preset--color--muted); margin: 0; }

/* ---------- CTA ---------- */
.tc-cta {
	background: linear-gradient(120deg, var(--wp--preset--color--primary), #16305A);
	color: #fff; border-radius: 18px;
}
.tc-cta h2 { color: #fff; margin-top: 0; }
.tc-cta p { color: rgba(255,255,255,.85); }
.tc-cta .wp-block-button.is-style-outline .wp-block-button__link { color: #fff; border-color: rgba(255,255,255,.6); }

/* ---------- Página de servicios ---------- */
.tc-service { scroll-margin-top: 110px; border-bottom: 1px solid var(--wp--preset--color--line); }
.tc-service:last-of-type { border-bottom: 0; }
.tc-service .tc-icon { margin-bottom: 1rem; }
.tc-checks { list-style: none; padding: 0; }
.tc-checks li { position: relative; padding-left: 1.8rem; margin-bottom: .55rem; }
.tc-checks li::before {
	content: ""; position: absolute; left: 0; top: .35em;
	width: 1.05rem; height: 1.05rem; border-radius: 50%;
	background: var(--wp--preset--color--accent)
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/70% no-repeat;
}
.tc-values .wp-block-column { background: var(--wp--preset--color--surface); border-radius: 14px; padding: 1.6rem !important; }
.tc-values h3 { margin-top: 0; font-size: 1.1rem; }

/* ---------- Contacto ---------- */
.tc-contact-list { list-style: none; padding: 0; margin: 0; }
.tc-contact-list li { display: flex; gap: .85rem; padding: .9rem 0; border-bottom: 1px solid var(--wp--preset--color--line); }
.tc-contact-list li:last-child { border-bottom: 0; }
.tc-contact-list .tc-ci { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: rgba(31,78,140,.08); color: var(--wp--preset--color--primary); }
.tc-contact-list .tc-ci svg { width: 20px; height: 20px; }
.tc-contact-list strong { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--wp--preset--color--muted); }
.tc-contact-list a { text-decoration: none; }

/* ---------- Formulario ---------- */
.tc-form { background: #fff; border: 1px solid var(--wp--preset--color--line); border-radius: 14px; padding: clamp(1.25rem, 3vw, 2rem); }
.tc-form .tc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .tc-form .tc-row { grid-template-columns: 1fr; } }
.tc-form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
.tc-form input[type=text], .tc-form input[type=email], .tc-form input[type=tel], .tc-form select, .tc-form textarea, .tc-form input[type=file] {
	width: 100%; box-sizing: border-box; font: inherit;
	padding: .75rem .9rem; border: 1px solid #C9D1DC; border-radius: 8px; background: #fff;
}
.tc-form input:focus, .tc-form select:focus, .tc-form textarea:focus { outline: 2px solid var(--wp--preset--color--primary); outline-offset: 1px; border-color: transparent; }
.tc-form .tc-field { margin-bottom: 1rem; }
.tc-form .tc-consent { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; font-size: .88rem; }
.tc-form .tc-consent input { margin-top: .25rem; }
.tc-form .tc-hp { position: absolute !important; left: -9999px !important; }
.tc-form button {
	background: var(--wp--preset--color--accent); color: var(--wp--preset--color--ink);
	border: 0; border-radius: 8px; padding: .85rem 1.6rem; font: inherit; font-weight: 700; cursor: pointer;
}
.tc-form button:hover { filter: brightness(.95); }
.tc-form .tc-info { font-size: .78rem; color: var(--wp--preset--color--muted); margin-top: 1rem; line-height: 1.5; }
.tc-msg { padding: 1rem 1.2rem; border-radius: 8px; margin-bottom: 1rem; font-weight: 600; }
.tc-msg--ok { background: #E7F6EC; color: #17602F; }
.tc-msg--err { background: #FDECEC; color: #9B1C1C; }

/* ---------- Footer ---------- */
.tc-footer { background: #0F1E36; color: rgba(255,255,255,.75); font-size: .95rem; }
.tc-footer a { color: rgba(255,255,255,.85); text-decoration: none; }
.tc-footer a:hover { color: #fff; text-decoration: underline; }
.tc-footer h4 { color: #fff; font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; margin-top: 0; }
.tc-footer .tc-logo { color: #fff; }
.tc-footer .tc-logo__tag { color: rgba(255,255,255,.6); }
.tc-footer ul { list-style: none; padding: 0; margin: 0; }
.tc-footer li { margin-bottom: .5rem; }
.tc-footer .tc-contact-list li { border-color: rgba(255,255,255,.1); padding: .55rem 0; }
.tc-footer .tc-contact-list .tc-ci { background: rgba(255,255,255,.08); color: var(--wp--preset--color--accent); width: 32px; height: 32px; }
.tc-footer .tc-contact-list strong { color: rgba(255,255,255,.5); }
.tc-footer-bottom { border-top: 1px solid rgba(255,255,255,.1); font-size: .85rem; }
.tc-footer-bottom p { margin: 0; }
.tc-social { display: flex; gap: .6rem; margin-top: 1.2rem; }
.tc-social a { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.08); }
.tc-social a:hover { background: var(--wp--preset--color--accent); color: var(--wp--preset--color--ink); text-decoration: none; }
.tc-social svg { width: 18px; height: 18px; fill: currentColor; }

/* ---------- WhatsApp flotante ---------- */
.tc-wa {
	position: fixed; right: 18px; bottom: 18px; z-index: 60;
	width: 56px; height: 56px; border-radius: 50%;
	background: #25D366; color: #fff; display: grid; place-items: center;
	box-shadow: 0 10px 25px -8px rgba(0,0,0,.35);
}
.tc-wa svg { width: 30px; height: 30px; fill: currentColor; }

/* ---------- Legales ---------- */
.tc-legal h2 { font-size: 1.35rem; margin-top: 2.2rem; }
.tc-legal table { border-collapse: collapse; width: 100%; }
.tc-legal td, .tc-legal th { border: 1px solid var(--wp--preset--color--line); padding: .6rem .8rem; text-align: left; vertical-align: top; }

.tc-cta { padding: clamp(2rem, 4vw, 3.5rem) !important; }
.tc-cta .wp-block-buttons { justify-content: flex-end; }
@media (max-width: 781px) { .tc-cta .wp-block-buttons { justify-content: flex-start; } }

/* ---------- Facebook (carga bajo clic) ---------- */
.tc-fb { max-width: 500px; margin-inline: auto; }
.tc-fb__ph {
	border: 1px solid var(--wp--preset--color--line); border-radius: 14px; background: #fff;
	padding: 2.2rem 1.5rem; text-align: center;
}
.tc-fb__icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: #1877F2; color: #fff; }
.tc-fb__icon svg { width: 28px; height: 28px; fill: currentColor; }
.tc-fb__title { font-weight: 700; font-size: 1.1rem; margin: 1rem 0; }
.tc-fb__btn { background: #1877F2; color: #fff; border: 0; border-radius: 8px; padding: .8rem 1.4rem; font: inherit; font-weight: 700; cursor: pointer; }
.tc-fb__btn:hover { filter: brightness(.95); }
.tc-fb__note { font-size: .8rem; color: var(--wp--preset--color--muted); margin: 1rem 0 0; }
.tc-fb-section:not(:has(.tc-fb)) { display: none; }
.tc-fb-section .tc-fb { margin-top: 2rem; }

/* ---------- Noticias ---------- */
.tc-news-section:not(:has(.wp-block-post)) { display: none; }
.tc-news-grid { margin-top: 2rem; }
.tc-news-grid .wp-block-post-template { gap: 1.5rem; }
@media (max-width: 781px) { .tc-news-grid .wp-block-post-template.is-layout-grid { grid-template-columns: 1fr !important; } }
.tc-post-card {
	background: #fff; border: 1px solid var(--wp--preset--color--line); border-radius: 14px; overflow: hidden; height: 100%;
	transition: transform .2s ease, box-shadow .2s ease;
}
.tc-post-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -22px rgba(15,30,54,.35); }
.tc-post-card__img { margin: 0 !important; }
.tc-post-card__img img { width: 100%; object-fit: cover; display: block; }
.tc-post-card__body { padding: 1.25rem 1.4rem 1.5rem; }
.tc-post-card__body > * { margin-block: 0 .5rem; }
.tc-post-card .wp-block-post-date { font-size: .82rem; color: var(--wp--preset--color--muted); }
.tc-post-card .wp-block-post-title { font-size: 1.15rem; }
.tc-post-card .wp-block-post-title a { color: var(--wp--preset--color--ink); text-decoration: none; }
.tc-post-card .wp-block-post-title a:hover { color: var(--wp--preset--color--primary); }
.tc-post-card .wp-block-post-excerpt { font-size: .95rem; color: var(--wp--preset--color--muted); }
.tc-post-card .wp-block-post-excerpt__more-text { display: none; }
.tc-news-more { margin-top: 1.5rem; font-weight: 700; }
.tc-news-more a { text-decoration: none; }
.tc-page-hero .wp-block-post-date { color: var(--wp--preset--color--accent); }
.tc-single-img img { border-radius: 14px; width: 100%; height: auto; }
.wp-block-query-pagination { margin-top: 2.5rem; }

/* ---------- Gestor de noticias ---------- */
.tc-gestor { max-width: 760px; margin-inline: auto; }
.tc-gestor h2 { font-size: 1.4rem; margin-top: 0; }
.tc-gestor__bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; background: var(--wp--preset--color--surface); border-radius: 10px; padding: .8rem 1rem; margin-bottom: 1.5rem; font-size: .92rem; }
.tc-login #loginform p { margin-bottom: 1rem; }
.tc-login #loginform label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
.tc-login #loginform .login-remember label { display: flex; gap: .5rem; font-weight: 400; }
.tc-login #loginform input[type=text], .tc-login #loginform input[type=password] { width: 100%; box-sizing: border-box; font: inherit; padding: .75rem .9rem; border: 1px solid #C9D1DC; border-radius: 8px; }
.tc-login #loginform input[type=submit] { background: var(--wp--preset--color--accent); color: var(--wp--preset--color--ink); border: 0; border-radius: 8px; padding: .85rem 1.6rem; font: inherit; font-weight: 700; cursor: pointer; }
.tc-news-form { margin-bottom: 2.5rem; }
.tc-news-thumb { display: flex; align-items: center; gap: 1rem; margin-bottom: .75rem; }
.tc-news-thumb img { width: 140px; height: auto; border-radius: 8px; }
.tc-news-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; }
.tc-form button.tc-btn-sec { background: #fff; border: 2px solid var(--wp--preset--color--line); }
.tc-news-list ul { list-style: none; padding: 0; margin: 0; border: 1px solid var(--wp--preset--color--line); border-radius: 14px; overflow: hidden; }
.tc-news-list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--wp--preset--color--line); }
.tc-news-list li:last-child { border-bottom: 0; }
.tc-news-list small { color: var(--wp--preset--color--muted); }
.tc-news-list__acts { display: flex; gap: .9rem; flex: none; font-weight: 600; font-size: .92rem; }
.tc-news-list__acts a { text-decoration: none; }
.tc-news-list__acts .tc-del { color: #B42318; }
@media (max-width: 600px) { .tc-news-list li { flex-direction: column; align-items: flex-start; } }
.tc-badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; background: #FEF3E2; color: #8A5A10; }
.tc-badge--ok { background: #E7F6EC; color: #17602F; }
