/*
Theme Name: Aparicio Law
Theme URI: https://apariciolawoffice.com/
Author: Aparicio Law Office LLC
Description: Custom block theme for Aparicio Law Office. Replaces Elementor with native WordPress blocks, adds a bilingual (English/Spanish) structure, a built-in consultation form and LegalService structured data.
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 7.4
Version: 1.1.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: aparicio-law
*/

/* Most styling lives in theme.json. This file holds what theme.json can't express. */

:root {
	--alo-header-h: 84px;
}

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

/* Accessible focus ring everywhere */
:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 3px solid var(--wp--preset--color--gold);
	outline-offset: 2px;
	border-radius: 2px;
}

.skip-link.screen-reader-text:focus {
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--navy);
	padding: 12px 16px;
	z-index: 100000;
}

/* ---------- Header ---------- */
.alo-topbar { font-size: 0.875rem; }
.alo-topbar a { color: inherit; text-decoration: none; }
.alo-topbar a:hover { text-decoration: underline; }

/* The whole header template part sticks (top bar is hidden on phones, so it stays compact there). */
.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 50;
	box-shadow: 0 1px 0 rgba(22, 22, 63, 0.08);
}
.admin-bar .wp-site-blocks > header.wp-block-template-part { top: 32px; }
@media (max-width: 782px) { .admin-bar .wp-site-blocks > header.wp-block-template-part { top: 46px; } }
.wp-site-blocks > header.wp-block-template-part + * { margin-block-start: 0; }

.alo-header .wp-block-site-logo img,
.alo-header .alo-logo img { max-height: 56px; width: auto; }

.alo-header .wp-block-navigation a { text-decoration: none; }
.alo-header .wp-block-navigation .current-menu-item > a,
.alo-header .wp-block-navigation a[aria-current="page"] {
	box-shadow: inset 0 -2px 0 var(--wp--preset--color--gold);
}

.alo-lang-switch {
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-decoration: none;
	white-space: nowrap;
}

/* Top bar: hours show on wide screens only */
@media (max-width: 1099px) { .alo-topbar-hours { display: none; } }

/* Top bar rating link */
.alo-topbar .alo-rating { font-weight: 600; color: var(--wp--preset--color--gold); }

/* Header tools: menu, language switch, phone icon */
.alo-mobile-call { display: none; color: var(--wp--preset--color--navy); line-height: 0; padding: 8px; }
.alo-header .alo-nav-phone { display: none !important; }
/* On desktop the language switch lives in the top bar; on phones (no top bar) it sits next to the menu */
@media (min-width: 782px) { .alo-header .alo-lang-switch { display: none; } }
.alo-topbar .alo-lang-switch { color: inherit; }

/* Tablets and small laptops: keep the menu on one line; the consultation button moves to the bottom call bar */
@media (max-width: 1099px) {
	.alo-header .alo-header-cta { display: none !important; }
	.alo-header .wp-block-site-logo img { max-height: 46px; }
}

/* Below 900px the menu collapses behind a "Menu" button on the right */
@media (min-width: 600px) and (max-width: 899px) {
	.alo-header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
	.alo-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
}
@media (max-width: 899px) {
	.alo-header .alo-header-tools > .wp-block-navigation { order: 3; }
	.alo-header .alo-header-tools { gap: 0.75rem !important; }
	.alo-mobile-call { display: inline-flex; }
	.alo-header .wp-block-navigation__responsive-container-open {
		display: flex; flex-direction: column; align-items: center; gap: 2px;
		padding: 6px; color: var(--wp--preset--color--navy);
	}
	.alo-header .wp-block-navigation__responsive-container-open::after {
		content: "Menu"; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
	}
	:lang(es) .alo-header .wp-block-navigation__responsive-container-open::after { content: "Menú"; }
	/* Opened menu: large tap targets, phone and consultation button at the bottom */
	.alo-header .wp-block-navigation__responsive-container.is-menu-open { padding: 24px max(20px, env(safe-area-inset-left, 0px)) 32px; }
	.alo-header .is-menu-open .wp-block-navigation__container { gap: 6px !important; width: 100%; }
	.alo-header .is-menu-open .wp-block-navigation-item__content { font-size: 1.25rem; padding: 10px 0; }
	.alo-header .is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content { font-size: 1.0625rem; padding: 6px 0 6px 12px; }
	.alo-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
	.alo-header .is-menu-open .wp-block-navigation__container,
	.alo-header .is-menu-open .wp-block-navigation-item,
	.alo-header .is-menu-open .wp-block-navigation__submenu-container { align-items: flex-start !important; text-align: left; }
	.alo-header .is-menu-open .wp-block-navigation__submenu-container { padding-left: 0 !important; }
	.alo-header .is-menu-open .wp-block-navigation-item__content { font-weight: 600; }
	.alo-header .is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content { font-weight: 400; }
	html.has-modal-open .alo-callbar { display: none !important; }
	.alo-header .is-menu-open .alo-nav-phone { display: flex !important; margin-top: 12px; font-weight: 700; }
	.alo-header .is-menu-open .alo-header-cta { display: flex !important; margin-top: 8px; }
}

/* Phones: compact header, no top bar */
@media (max-width: 781px) {
	.alo-topbar { display: none !important; }
	.alo-header .wp-block-site-logo img,
	.alo-header .alo-logo img { max-height: 40px; }
}

/* ---------- Mobile call bar ---------- */
.alo-callbar { display: none; }
@media (max-width: 1099px) {
	.alo-callbar {
		display: grid;
		grid-template-columns: 1fr 1fr;
		position: fixed;
		left: 0; right: 0; bottom: 0;
		z-index: 60;
		box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.15);
	}
	.alo-callbar a {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 8px;
		min-height: 56px;
		font-weight: 600;
		font-size: 1rem;
		text-decoration: none;
	}
	.alo-callbar .alo-callbar-call { background: var(--wp--preset--color--navy); color: var(--wp--preset--color--white); }
	.alo-callbar .alo-callbar-book { background: var(--wp--preset--color--gold); color: var(--wp--preset--color--navy); }
	body { padding-bottom: 56px; }
}

/* ---------- Cards ---------- */
.alo-card {
	height: 100%;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.alo-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(22, 22, 63, 0.12); }
@media (prefers-reduced-motion: reduce) { .alo-card, .alo-card:hover { transition: none; transform: none; } }
.alo-card .alo-card-link a { font-weight: 600; text-decoration: none; }
.alo-card .alo-card-link a::after { content: " \2192"; }

/* Team cards */
.alo-team-photo img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
/* Two attorneys: keep cards at a three-across size, centered, instead of stretching to half the page. */
.wp-block-columns.alo-attorneys { max-width: 760px; margin-left: auto !important; margin-right: auto !important; }
.alo-attorneys .wp-block-column,
.wp-block-group:has(> .alo-attorneys) > .wp-block-heading,
.wp-block-group:has(> .alo-attorneys) > p { text-align: center; }
.alo-initials {
	aspect-ratio: 4 / 5;
	display: flex !important;
	align-items: center;
	justify-content: center;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 3rem;
}

/* Stats */
.alo-stat-number { font-variant-numeric: tabular-nums; }

/* ---------- FAQ (details block) ---------- */
.wp-block-details {
	border-bottom: 1px solid var(--wp--preset--color--line);
	padding: 18px 0;
}
.wp-block-details summary {
	cursor: pointer;
	font-weight: 600;
	font-size: 1.0625rem;
	color: var(--wp--preset--color--navy);
	list-style: none;
	display: flex;
	justify-content: space-between;
	gap: 16px;
}
.wp-block-details summary::-webkit-details-marker { display: none; }
.wp-block-details summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--wp--preset--color--gold-dark); }
.wp-block-details[open] summary::after { content: "\2212"; }
.wp-block-details > :not(summary) { margin-top: 12px; }

/* Steps list */
.alo-steps { counter-reset: alo-step; list-style: none; padding-left: 0; }
.alo-steps li {
	counter-increment: alo-step;
	position: relative;
	padding-left: 56px;
	margin-bottom: 20px;
}
.alo-steps li::before {
	content: counter(alo-step);
	position: absolute;
	left: 0; top: -2px;
	width: 38px; height: 38px;
	border-radius: 50%;
	background: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--white);
	display: flex; align-items: center; justify-content: center;
	font-weight: 700;
}

/* Check lists */
.alo-checklist { list-style: none; padding-left: 0; }
.alo-checklist li { position: relative; padding-left: 30px; margin-bottom: 10px; }
.alo-checklist li::before {
	content: "";
	position: absolute; left: 4px; top: 0.45em;
	width: 12px; height: 7px;
	border-left: 2px solid var(--wp--preset--color--gold-dark);
	border-bottom: 2px solid var(--wp--preset--color--gold-dark);
	transform: rotate(-45deg);
}

/* Reviews widget wrapper */

/* ---------- Contact form ---------- */
.alo-form { display: grid; gap: 18px; }
.alo-form .alo-row { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) { .alo-form .alo-row { grid-template-columns: 1fr; } }
.alo-form label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--wp--preset--color--navy); }
.alo-form .alo-req { color: #a3312b; }
.alo-form input[type="text"],
.alo-form input[type="email"],
.alo-form input[type="tel"],
.alo-form select,
.alo-form textarea {
	width: 100%;
	padding: 12px 14px;
	font: inherit;
	font-size: 1rem;
	border: 1px solid #b9b9c6;
	border-radius: 4px;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--ink);
	box-sizing: border-box;
}
.alo-form textarea { min-height: 150px; resize: vertical; }
.alo-form .alo-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9375rem; }
.alo-form .alo-consent input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.alo-form .alo-consent label { font-weight: 400; color: var(--wp--preset--color--ink); margin: 0; }
.alo-form button {
	justify-self: start;
	background: var(--wp--preset--color--gold);
	color: var(--wp--preset--color--navy);
	border: 0;
	border-radius: 4px;
	padding: 14px 28px;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}
.alo-form button:hover { background: var(--wp--preset--color--gold-dark); color: var(--wp--preset--color--white); }
.alo-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.alo-notice { padding: 14px 18px; border-radius: 4px; font-weight: 600; }
.alo-notice-success { background: #e6f2ea; color: #1d5b33; border-left: 4px solid #2e7d4a; }
.alo-notice-error { background: #fbeaea; color: #7a1f1a; border-left: 4px solid #a3312b; }

/* Footer */
.alo-footer a { color: inherit; }
.alo-footer .alo-footer-links { list-style: none; }
.alo-footer .alo-footer-links a { text-decoration: none; }
.alo-footer .alo-footer-links a:hover { text-decoration: underline; }
.alo-disclaimer { opacity: 0.85; }

/* Stats: 2 x 2 on phones instead of one tall column */
@media (max-width: 781px) {
	.wp-block-columns.alo-stats { display: grid !important; grid-template-columns: 1fr 1fr; gap: 24px 16px; }
	.wp-block-columns.alo-stats > .wp-block-column { flex-basis: auto !important; }
	.alo-stats .alo-stat-number { font-size: 2rem !important; }
}

/* ---------- Page header proof card ---------- */
@media (max-width: 1023px) {
	.alo-hero .alo-hero-card { display: none !important; }
	.alo-hero .alo-hero-cols > .wp-block-column:first-child { flex-basis: 100% !important; }
}
.alo-hero .alo-hero-card .alo-rating { color: var(--wp--preset--color--white); font-weight: 600; }
.alo-hero .wp-block-columns { margin-block-start: 0; }

/* ---------- Breadcrumbs ---------- */
.alo-breadcrumbs ol { list-style: none; margin: 0 0 4px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 0.875rem; }
.alo-breadcrumbs li { opacity: 0.85; }
.alo-breadcrumbs li + li::before { content: "›"; margin-right: 8px; opacity: 0.7; }
.alo-breadcrumbs a { color: inherit; text-decoration: none; }
.alo-breadcrumbs a:hover { text-decoration: underline; }
.alo-breadcrumbs [aria-current] { font-weight: 600; opacity: 1; }

/* ---------- Service cards ---------- */
.alo-service h3 { margin-bottom: 0.4em; }
.alo-service .alo-service-summary { font-size: 1.0625rem; color: var(--wp--preset--color--ink); margin-bottom: 1rem; }
.alo-service .alo-checklist { font-size: 0.9375rem; border-top: 1px solid var(--wp--preset--color--line); padding-top: 1rem; margin-top: 0; }
.alo-service .alo-checklist li { margin-bottom: 6px; }

/* FAQ section: two columns */
.alo-faq-section > .wp-block-column:first-child h2 { margin-top: 0; }
.alo-faq-section .wp-block-details:first-child { padding-top: 0; }

/* ---------- Reviews ---------- */
.alo-review {
	margin: 0;
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--line);
	border-top: 3px solid var(--wp--preset--color--gold);
	padding: 24px;
	display: flex; flex-direction: column; gap: 12px;
}
.alo-review blockquote { margin: 0; padding: 0; border: 0; }
.alo-review blockquote p { margin: 0; font-size: 1rem; line-height: 1.65; }
.alo-review figcaption { font-size: 0.875rem; color: var(--wp--preset--color--muted); margin-top: auto; }
.alo-review figcaption strong { color: var(--wp--preset--color--navy); }
.alo-stars { color: #C8962E; letter-spacing: 2px; font-size: 1rem; }
.alo-reviews-carousel { position: relative; }
.alo-reviews-track {
	display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 48px) / 3);
	gap: 24px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px;
}
.alo-reviews-track::-webkit-scrollbar { display: none; }
.alo-reviews-track > .alo-review { scroll-snap-align: start; }
@media (max-width: 1023px) { .alo-reviews-track { grid-auto-columns: calc((100% - 24px) / 2); } }
@media (max-width: 640px) { .alo-reviews-track { grid-auto-columns: 88%; } }
.alo-reviews-controls { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.alo-reviews-controls button {
	width: 44px; height: 44px; border-radius: 50%;
	border: 1px solid var(--wp--preset--color--navy); background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--navy); font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.alo-reviews-controls button:hover { background: var(--wp--preset--color--navy); color: var(--wp--preset--color--white); }
.alo-reviews-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 24px; }
.alo-reviews-more { margin-top: 16px; font-size: 0.9375rem; }
.alo-reviews-more .alo-rating { font-weight: 700; margin-right: 8px; }
.alo-hero .alo-hero-card .alo-stat-number a { color: inherit; text-decoration: none; }
.alo-hero .alo-hero-card p { margin-block: 0 0.5em; }
.alo-hero .alo-hero-card .alo-stat-headline { text-wrap: balance; }

/* Legal page: "On this page" list beside the text */
.alo-toc { position: sticky; top: 140px; }
.alo-toc ul { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--wp--preset--color--line); }
.alo-toc li { margin: 0; }
.alo-toc a { display: block; padding: 6px 0 6px 16px; text-decoration: none; color: var(--wp--preset--color--muted); font-size: 0.9375rem; }
.alo-toc a:hover { color: var(--wp--preset--color--navy); }
.alo-legal h2 { scroll-margin-top: 140px; }
@media (max-width: 781px) { .alo-toc { position: static; } }
.alo-two-col .alo-checklist { columns: 2; column-gap: 32px; font-size: 1.0625rem; }
.alo-two-col .alo-checklist li { break-inside: avoid; margin-bottom: 14px; }
@media (max-width: 600px) { .alo-two-col .alo-checklist { columns: 1; } }

/* Areas we serve: balanced three-column list, each area with a small label. */
.wp-block-group.alo-areas {
	columns: 3 260px;
	column-gap: 48px;
	margin-top: var(--wp--preset--spacing--40);
	padding-top: var(--wp--preset--spacing--40);
	border-top: 1px solid var(--wp--preset--color--line);
}
.alo-areas > .alo-area { break-inside: avoid; margin: 0 0 28px !important; }
.alo-areas .alo-area-label {
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--gold-dark);
	margin: 0 0 6px;
}
.alo-areas .alo-area p { margin: 0; font-size: 0.9375rem; line-height: 1.65; }
.alo-areas-close {
	margin-top: 16px !important;
	padding-top: var(--wp--preset--spacing--30);
	border-top: 1px solid var(--wp--preset--color--line);
	font-size: 0.9375rem;
}

/* Social icons */
.alo-social { display: flex; gap: 10px; list-style: none; margin: 0; padding: 0; align-items: center; }
.alo-social li { margin: 0; }
.alo-social a { display: inline-flex; align-items: center; justify-content: center; color: inherit; opacity: 0.85; transition: opacity 0.15s, color 0.15s; }
.alo-social a:hover, .alo-social a:focus-visible { opacity: 1; color: var(--wp--preset--color--gold); }
.alo-topbar .alo-social svg { width: 16px; height: 16px; }
.alo-footer .alo-social { margin-top: var(--wp--preset--spacing--30); gap: 12px; }
.alo-footer .alo-social a { width: 40px; height: 40px; border: 1px solid #ffffff4d; border-radius: 50%; }
.alo-footer .alo-social a:hover, .alo-footer .alo-social a:focus-visible { border-color: var(--wp--preset--color--gold); }
@media (max-width: 1099px) { .alo-topbar .alo-social { display: none; } }
