/*
Theme Name: JQ Abogado
Description: Tema ligero de Javier Quezada, Abogado. Sin constructor visual ni dependencias.
Version: 0.6.5
Requires at least: 6.5
Requires PHP: 8.0
Text Domain: jq-abogado
*/

:root {
	--azul: #1B1464;
	--azul-2: #2E247A;
	--rojo: #C1272D;
	--verde: #17663A;
	--verde-2: #125230;
	--tinta: #1B1B2B;
	--gris: #4A5568;
	--linea: #C9CED6;
	--fondo: #F6F7F9;
	--blanco: #FFFFFF;
	--serif: "Source Serif 4", Georgia, "Times New Roman", serif;
	--sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--ancho: 1080px;
	--texto: 720px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
	margin: 0;
	background: var(--blanco);
	color: var(--tinta);
	font-family: var(--sans);
	font-size: 17px;
	line-height: 1.6;
	padding-bottom: 72px; /* espacio para la barra fija en celular */
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--azul); text-underline-offset: 3px; }
a:hover { color: var(--rojo); }
a:focus-visible,
button:focus-visible,
summary:focus-visible { outline: 3px solid var(--rojo); outline-offset: 2px; }

h1, h2, h3 {
	font-family: var(--serif);
	color: var(--azul);
	line-height: 1.15;
	margin: 0 0 16px;
	text-wrap: balance;
}
h1 { font-size: clamp(32px, 5.2vw, 52px); font-weight: 700; }
h2 { font-size: clamp(25px, 3.2vw, 34px); font-weight: 600; }
h3 { font-size: 21px; font-weight: 600; line-height: 1.25; }
p { margin: 0 0 16px; }
ul, ol { margin: 0 0 16px; padding-left: 22px; }
li { margin-bottom: 8px; }

.jq-wrap { max-width: var(--ancho); margin: 0 auto; padding: 0 20px; }

.jq-skip {
	position: absolute; left: -9999px; top: 0;
	background: var(--azul); color: var(--blanco); padding: 12px 16px; z-index: 100;
}
.jq-skip:focus { left: 8px; top: 8px; }

/* ---------- Encabezado ---------- */
.jq-header { background: var(--blanco); border-bottom: 1px solid var(--linea); position: relative; z-index: 20; }
.jq-header-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; }
.jq-logo img { width: 150px; }
.jq-header-tools { display: flex; align-items: center; gap: 6px; }
.jq-lang { font-weight: 600; text-decoration: none; padding: 12px 10px; font-size: 15px; }
.jq-burger {
	width: 44px; height: 44px; background: var(--blanco); color: var(--azul);
	border: 1px solid var(--linea); border-radius: 6px;
	display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer;
}
.jq-nav {
	display: none; position: absolute; left: 0; right: 0; top: 100%;
	background: var(--blanco); border-bottom: 1px solid var(--linea);
	padding: 8px 20px 20px; flex-direction: column;
}
.jq-nav.is-open { display: flex; }
.jq-nav a { padding: 14px 0; text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--fondo); }
.jq-nav a.jq-nav-book {
	margin-top: 14px; border: 2px solid var(--azul); border-radius: 6px; text-align: center; font-weight: 600; padding: 12px;
}

/* ---------- Secciones ---------- */
.jq-section { padding: 48px 20px; }
.jq-section.jq-alt { background: var(--fondo); }
.jq-in { max-width: var(--texto); margin: 0 auto; }
.jq-in > *:last-child { margin-bottom: 0; }
.jq-section.jq-alt .jq-in:has(.jq-cards),
.jq-section .jq-in:has(.jq-cards),
.jq-section .jq-in:has(.jq-two) { max-width: var(--ancho); }

.jq-eyebrow { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--gris); font-weight: 600; margin-bottom: 10px; }
.jq-lead { font-size: 19px; line-height: 1.55; }
.jq-trust { font-size: 15px; color: var(--gris); margin-top: 4px; }
.jq-more a { font-weight: 600; }
.jq-more a::after { content: " →"; }

/* ---------- Portada ---------- */
.jq-hero { background: var(--fondo); padding-top: 40px; padding-bottom: 0; }
.jq-hero-in { max-width: var(--ancho); display: grid; gap: 24px; }
.jq-hero-text { padding-bottom: 8px; }
.jq-hero-img { margin: 0; }
.jq-hero-img img { width: 100%; max-height: 420px; object-fit: cover; object-position: 50% 12%; border-radius: 6px 6px 0 0; }
.jq-hero.jq-hero-simple { padding-bottom: 48px; }
.jq-hero.jq-hero-simple .jq-in { max-width: var(--texto); }

/* ---------- Botones ---------- */
.jq-cta { display: flex; flex-direction: column; gap: 12px; margin: 24px 0 16px; }
.jq-cta a {
	display: flex; align-items: center; justify-content: center; text-align: center;
	min-height: 52px; padding: 12px 20px; border-radius: 6px;
	font-weight: 600; font-size: 17px; text-decoration: none;
	background: var(--blanco); color: var(--azul); border: 2px solid var(--azul);
}
.jq-cta a:hover { background: var(--azul); color: var(--blanco); }
.jq-cta a[href*="wa.me"] { background: var(--verde); border-color: var(--verde); color: var(--blanco); }
.jq-cta a[href*="wa.me"]:hover { background: var(--verde-2); border-color: var(--verde-2); }

/* ---------- Tarjetas ---------- */
.jq-cards { display: grid; gap: 16px; margin-top: 24px; }
.jq-card { background: var(--blanco); border: 1px solid var(--linea); border-top: 4px solid var(--azul); border-radius: 6px; padding: 22px; }
.jq-card > *:last-child { margin-bottom: 0; }
.jq-cards-plain .jq-card { border-top-width: 1px; }
.jq-section:not(.jq-alt) .jq-cards-plain .jq-card { background: var(--fondo); border-color: var(--fondo); }

/* ---------- Pasos ---------- */
.jq-steps { list-style: none; padding: 0; counter-reset: paso; margin-top: 24px; }
.jq-steps li { counter-increment: paso; position: relative; padding-left: 52px; margin-bottom: 20px; min-height: 36px; }
.jq-steps li::before {
	content: counter(paso); position: absolute; left: 0; top: 0;
	width: 36px; height: 36px; border-radius: 50%; background: var(--azul); color: var(--blanco);
	font-weight: 600; display: flex; align-items: center; justify-content: center;
}

/* ---------- Listas ---------- */
.jq-checks { list-style: none; padding: 0; }
.jq-checks li { position: relative; padding-left: 30px; margin-bottom: 12px; }
.jq-checks li::before {
	content: ""; position: absolute; left: 2px; top: 9px; width: 14px; height: 8px;
	border-left: 3px solid var(--azul); border-bottom: 3px solid var(--azul); transform: rotate(-45deg);
}
.jq-services { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.jq-services li { margin: 0; border: 1px solid var(--linea); border-radius: 999px; padding: 8px 16px; font-size: 16px; background: var(--blanco); }
.jq-services a { text-decoration: none; font-weight: 500; }

/* ---------- Aviso ---------- */
.jq-alert { background: var(--blanco); border: 1px solid var(--linea); border-top: 4px solid var(--rojo); border-radius: 6px; padding: 16px 18px; margin: 24px 0 0; }
.jq-alert p { margin: 0; font-weight: 600; color: var(--rojo); }

/* ---------- Precios ---------- */
.jq-prices { display: grid; gap: 16px; margin: 24px 0; }
.jq-price { background: var(--blanco); border: 1px solid var(--linea); border-radius: 6px; padding: 22px; }
.jq-price > *:last-child { margin-bottom: 0; }
.jq-amount { font-family: var(--serif); font-size: 40px; font-weight: 700; line-height: 1.05; color: var(--azul); margin-bottom: 10px; }

.jq-price-wide { margin-top: 20px; }
.jq-price-wide p { margin-bottom: 12px; }

/* ---------- Asuntos reales ---------- */
.jq-case { background: var(--blanco); border-left: 4px solid var(--azul); padding: 20px 22px; margin-top: 20px; border-radius: 0 6px 6px 0; }
.jq-section:not(.jq-alt) .jq-case { background: var(--fondo); }
.jq-case > *:last-child { margin-bottom: 0; }

/* ---------- Dos columnas ---------- */
.jq-two { display: grid; gap: 32px; }

/* ---------- Bloque oscuro ---------- */
.jq-dark { background: var(--azul); color: #E6EAF2; }
.jq-dark h2 { color: var(--blanco); }
.jq-dark a { color: var(--blanco); }

/* ---------- Preguntas ---------- */
.jq-faq { margin-top: 20px; border-top: 1px solid var(--linea); }
.jq-faq details { border-bottom: 1px solid var(--linea); }
.jq-faq summary {
	cursor: pointer; list-style: none; padding: 16px 36px 16px 0; font-weight: 500; position: relative; color: var(--azul);
}
.jq-faq summary::-webkit-details-marker { display: none; }
.jq-faq summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font-size: 24px; font-weight: 400; }
.jq-faq details[open] summary::after { content: "−"; }
.jq-faq details p { padding-right: 20px; }

/* ---------- Video pendiente ---------- */
.jq-video { background: var(--azul); color: var(--blanco); border-radius: 6px; padding: 40px 20px; text-align: center; margin: 24px 0; }
.jq-video p { margin: 0; }

/* ---------- Cierre ---------- */
.jq-close { text-align: left; }

/* ---------- Páginas sin molde ---------- */
.jq-plain { padding: 48px 0; }
.jq-plain > *:not(.jq-wrap) { max-width: var(--texto); margin-left: auto; margin-right: auto; padding-left: 20px; padding-right: 20px; }

/* ---------- Pie ---------- */
.jq-footer { background: var(--azul); color: #E6EAF2; padding: 40px 0 24px; font-size: 15px; }
.jq-footer a { color: var(--blanco); }
.jq-footer-in { display: grid; gap: 24px; }
.jq-footer-logo { width: 150px; }
.jq-footer-h { font-weight: 600; color: var(--blanco); margin-bottom: 6px; }
.jq-footer-legal { margin-top: 28px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .2); font-size: 13px; color: #C9D2E3; }
.jq-footer-legal p { margin: 0; }

/* ---------- Barra fija en celular ---------- */
.jq-bar {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
	background: var(--blanco); border-top: 1px solid var(--linea);
	padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
	display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
}
.jq-bar a {
	display: flex; align-items: center; justify-content: center; min-height: 48px;
	border-radius: 6px; font-weight: 600; font-size: 15px; text-decoration: none;
}
.jq-bar-wa { background: var(--verde); color: var(--blanco); }
.jq-bar-book { background: var(--azul); color: var(--blanco); }
.jq-bar-call { background: var(--blanco); color: var(--azul); border: 2px solid var(--azul); }
.jq-bar a:hover { opacity: .9; color: inherit; }
.jq-bar-wa:hover, .jq-bar-book:hover { color: var(--blanco); }

/* ---------- Pantallas medianas y grandes ---------- */
@media (min-width: 720px) {
	.jq-cta { flex-direction: row; flex-wrap: wrap; }
	.jq-cards { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
	.jq-prices { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
	.jq-two { grid-template-columns: 1fr 1fr; }
	.jq-footer-in { grid-template-columns: 1fr 1fr 1.4fr; }
	.jq-hero-img img { border-radius: 6px; }
	.jq-section { padding: 64px 24px; }
}

@media (min-width: 960px) {
	body { padding-bottom: 0; font-size: 18px; }
	.jq-bar { display: none; }
	.jq-burger { display: none; }
	.jq-logo img { width: 180px; }
	.jq-header-in { min-height: 92px; }
	.jq-nav {
		display: flex; position: static; flex-direction: row; align-items: center; gap: 26px;
		border: 0; padding: 0; background: none; margin-left: auto;
	}
	.jq-nav a { border: 0; padding: 8px 0; font-size: 16px; }
	.jq-nav a.jq-nav-book { margin: 0; padding: 10px 18px; }
	.jq-nav a.jq-nav-book:hover { background: var(--azul); color: var(--blanco); }
	.jq-hero { padding-top: 0; }
	.jq-hero-in { grid-template-columns: 1.15fr .85fr; align-items: end; gap: 48px; }
	.jq-hero-text { padding: 72px 0 64px; }
	.jq-hero-img img { max-height: 560px; }
	.jq-hero.jq-hero-simple { padding-top: 72px; padding-bottom: 64px; }
	.jq-lead { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
}

/* Foto del despacho junto al cierre de Agendar */
.jq-two { align-items: center; }
.jq-office { margin: 0; }
.jq-office img { width: 100%; max-height: 520px; object-fit: cover; border-radius: 6px; }

/* Foto de la portada en el escritorio: Javier está a la derecha */
.jq-hero-desk img { object-position: 68% 30%; }

/* Videos: miniatura y reproductor bajo demanda */
.jq-videos .jq-in { max-width: var(--ancho); }
.jq-yt-grid { display: grid; gap: 24px; }
.jq-yt { margin: 0; }
.jq-yt button, .jq-yt iframe { display: block; position: relative; width: 100%; aspect-ratio: 16 / 9; border: 0; padding: 0; border-radius: 6px; overflow: hidden; background: #000; cursor: pointer; }
.jq-yt-short button, .jq-yt-short iframe { aspect-ratio: 9 / 16; max-width: 340px; margin: 0 auto; }
.jq-yt img { width: 100%; height: 100%; object-fit: cover; display: block; }
.jq-yt-play { position: absolute; left: 50%; top: 50%; width: 68px; height: 48px; margin: -24px 0 0 -34px; border-radius: 12px; background: #C4302B; }
.jq-yt-play::after { content: ""; position: absolute; left: 27px; top: 14px; border-style: solid; border-width: 10px 0 10px 17px; border-color: transparent transparent transparent #fff; }
.jq-yt button:hover .jq-yt-play, .jq-yt button:focus-visible .jq-yt-play { background: #FF0000; }
.jq-yt-t { margin: 10px 0 0; font-size: 15px; font-weight: 600; color: var(--azul, #1B1464); }
.jq-yt-short .jq-yt-t { max-width: 340px; margin-left: auto; margin-right: auto; }
@media (min-width: 720px) {
	.jq-yt-grid { grid-template-columns: repeat(2, 1fr); }
	.jq-yt-grid-shorts { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 960px) {
	.jq-hero-desk img { height: 540px; max-height: none; }
}
/* En celular, los Shorts se deslizan de lado en lugar de apilarse */
@media (max-width: 719px) {
	.jq-yt-grid-shorts { grid-auto-flow: column; grid-auto-columns: 62%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
	.jq-yt-grid-shorts .jq-yt { scroll-snap-align: start; }
	.jq-yt-grid-shorts .jq-yt-t { font-size: 14px; }
}

/* Foto ancha dentro de una página */
.jq-photo .jq-in { max-width: var(--ancho); }
.jq-wide-photo { margin: 0; }
.jq-wide-photo img { width: 100%; max-height: 560px; object-fit: cover; object-position: 60% 35%; border-radius: 6px; }

/* Reseñas */
.jq-reviews .jq-in { max-width: var(--ancho); }
.jq-review-grid { display: grid; gap: 20px; }
.jq-review { margin: 0; padding: 22px 24px; background: #fff; border: 1px solid #E3E6EC; border-left: 4px solid var(--azul); border-radius: 6px; }
.jq-review p { margin: 0 0 12px; font-size: 17px; line-height: 1.55; }
.jq-review cite { font-style: normal; font-size: 14px; font-weight: 600; color: var(--azul); }
@media (min-width: 720px) { .jq-review-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); } }

/* Mapa */
.jq-map { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: #E3E6EC; }
.jq-map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (max-width: 719px) { .jq-map { aspect-ratio: 4 / 5; } }
