/*
 * Site-wide styles: design tokens, header/nav, footer, sticky CTA bar, and
 * generic page/blog layout. Loaded on every page. Front-page-only sections
 * (hero, services grid, FAQ, etc.) live in landing.css, enqueued only for
 * is_front_page() so other pages don't pay for CSS they don't use.
 */

:root {
	--htl-bg: #f0ece4;
	--htl-surface: #eae9e9;
	--htl-text: #201e1d;
	--htl-divider: color-mix(in srgb, #201e1d 40%, transparent);

	--htl-neutral-100: #f8f4f4;
	--htl-neutral-300: #d7d3d3;
	--htl-neutral-700: #605d5d;
	--htl-neutral-900: #2d2b2b;

	--htl-accent: #ec3013;
	--htl-accent-100: #fff2ef;
	--htl-accent-400: #ff9783;
	--htl-accent-600: #dd2b0f;
	--htl-accent-700: #ae1800;
	--htl-accent-800: #7c1405;

	--htl-whatsapp: #25d366;

	--htl-font-heading: 'Alexandria', system-ui, sans-serif;
	--htl-font-body: 'Alexandria', system-ui, sans-serif;

	--htl-shadow-sm: 0 1px 2px color-mix(in srgb, #2d2b2b 14%, transparent);
	--htl-shadow-md: 0 3px 10px color-mix(in srgb, #2d2b2b 16%, transparent);
	--htl-shadow-lg: 0 12px 32px color-mix(in srgb, #2d2b2b 22%, transparent);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.hometech-site {
	margin: 0;
	background: var(--htl-bg);
	color: var(--htl-text);
	font-family: var(--htl-font-body);
	font-weight: 400;
	line-height: 1.6;
}
body.hometech-site.has-floating-bar { padding-bottom: 64px; }
img { display: block; max-width: 100%; height: auto; }

/* Full heading scale, matching the design system's type ramp. Sections that
   need a different size (hero H1, service card H3, etc.) set it via their
   own class, which — being a class selector — always wins over these bare
   element rules regardless of source order. */
h1, h2, h3, h4, h5, h6 {
	font-family: var(--htl-font-heading);
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: -0.01em;
	margin: 0 0 12px;
}
h1 { font-size: 42px; }
h2 { font-size: 32px; }
h3 { font-size: 25px; }
h4 { font-size: 20px; }
h5 { font-size: 16px; }
h6 { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }

a { color: var(--htl-accent); text-decoration: none; transition: color .15s; }
/* `a:hover` outranks a plain class rule like `.htl-btn-primary { color: ... }`
   (pseudo-classes add specificity), so any accent-background button that
   doesn't re-declare `color` on its own :hover loses its text color to this
   rule instead — invisible text on a red hover background. Every such
   button's :hover rule below re-declares color explicitly to stay above it. */
a:hover { color: var(--htl-accent-600); }
p { margin: 0 0 12px; }
strong, b { font-weight: 700; }
small { font-size: 13px; }
::selection { background: color-mix(in srgb, var(--htl-accent) 30%, transparent); }
:focus-visible { outline: 2px solid var(--htl-accent); outline-offset: 2px; }

.htl-container { max-width: 1200px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 64px); }
.htl-eyebrow {
	display: block; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase;
	color: var(--htl-accent-700); font-weight: 700; margin-bottom: 16px;
}
.htl-eyebrow-light { color: #fff; text-transform: none; margin-bottom: 14px; }
.htl-hr { height: 2px; border: 0; margin: 16px 0; background: var(--htl-divider); }
.htl-ltr { direction: ltr; unicode-bidi: isolate; }

.htl-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	cursor: pointer; text-decoration: none; font-family: var(--htl-font-heading);
	font-weight: 800; font-size: 15px; padding: 16px 30px; border-radius: 12px;
	border: 1.5px solid transparent; transition: filter .15s;
}
.htl-btn:hover { filter: brightness(0.96); transform: translateY(-1px); }
.htl-btn:active { filter: brightness(0.9); transform: translateY(0); }
.htl-btn-white { background: #fff; color: var(--htl-accent-700); }
.htl-btn-white:hover { color: var(--htl-accent-800); }
.htl-btn-whatsapp { background: var(--htl-whatsapp); border-color: var(--htl-whatsapp); color: #fff; }
.htl-btn-whatsapp:hover { background: #1ebc59; border-color: #1ebc59; color: #fff; }
/* On a red/whatsapp-green button background, pure white gives noticeably
   better text contrast than the cream --htl-bg token, so buttons use #fff
   explicitly rather than that token. */
.htl-btn-primary { background: var(--htl-accent); color: #fff; font-size: 14px; padding: 8px 15px; }
.htl-btn-primary:hover { background: var(--htl-accent-600); color: #fff; }
.htl-btn-ghost { background: transparent; color: var(--htl-accent-700); padding: 8px 4px; border-radius: 0; }
.htl-btn-ghost:hover { color: var(--htl-accent-600); transform: none; }
.htl-cta-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 32px; }

/* ---------- header / nav ---------- */
.htl-visually-hidden {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.htl-nav {
	display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
	padding: 12px 16px; background: var(--htl-bg); border-bottom: 2px solid var(--htl-divider);
}
.htl-nav-brand { display: flex; align-items: center; gap: 10px; margin-inline-end: auto; }
.htl-nav-brand a,
.htl-nav-brand-link { display: flex; align-items: center; gap: 10px; color: inherit; }
.htl-nav-brand a:hover,
.htl-nav-brand-link:hover { color: inherit; }
.htl-nav-logo,
.htl-nav-brand .custom-logo { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; }
.htl-nav-brand span { font-family: var(--htl-font-heading); font-weight: 800; font-size: 18px; }
.htl-nav-menu { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.htl-nav-links { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.htl-nav-menu a,
.htl-nav-links a { color: inherit; font-size: 14px; }
.htl-nav-menu a:hover,
.htl-nav-links a:hover { color: var(--htl-accent); }

/* Sidebar-only chrome (hamburger, overlay, drawer head/CTA) — invisible and
   inert on desktop, activated entirely inside the mobile media query below. */
.htl-menu-toggle {
	display: none; flex-direction: column; justify-content: center; align-items: center;
	gap: 5px; width: 40px; height: 40px; border: none; background: transparent;
	cursor: pointer; padding: 0; border-radius: 8px;
}
.htl-menu-toggle:hover { background: var(--htl-surface); }
.htl-menu-toggle span {
	display: block; width: 22px; height: 2px; background: var(--htl-text); border-radius: 2px;
	transition: transform .25s, opacity .25s;
}
.htl-menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.htl-menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.htl-menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.htl-nav-overlay {
	position: fixed; inset: 0; z-index: 998; background: color-mix(in srgb, var(--htl-neutral-900) 55%, transparent);
	opacity: 0; pointer-events: none; transition: opacity .25s;
}
.htl-nav-overlay.is-open { opacity: 1; pointer-events: auto; }

.htl-nav-menu-head,
.htl-nav-menu-cta { display: none; }

body.has-nav-open { overflow: hidden; }
body.has-nav-open .htl-sticky-bar { display: none; }

/* ---------- footer ---------- */
.htl-footer {
	max-width: 1200px; margin: 0 auto; padding: 24px clamp(20px, 5vw, 64px);
	font-size: 13px; display: flex; flex-direction: column; gap: 16px;
}
.htl-footer-row { display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; align-items: center; opacity: .7; }
.htl-footer-bottom { padding-top: 16px; border-top: 1px solid var(--htl-divider); opacity: 1; }

.htl-social-icons { display: flex; gap: 10px; }
.htl-social-icon {
	display: flex; align-items: center; justify-content: center; width: 34px; height: 34px;
	border-radius: 50%; background: var(--htl-surface); color: var(--htl-text);
	transition: background .15s, color .15s;
}
.htl-social-icon:hover { background: var(--htl-accent); color: #fff; }
.htl-social-icon-wa:hover { background: var(--htl-whatsapp); color: #fff; }

.htl-footer-legal { display: flex; gap: 16px; flex-wrap: wrap; }
.htl-footer-legal a { color: var(--htl-text); opacity: .75; }
.htl-footer-legal a:hover { opacity: 1; color: var(--htl-accent); }

/* ---------- sticky mobile bar ---------- */
.htl-sticky-bar {
	position: fixed; inset-inline: 0; bottom: 0; display: flex; gap: 2px;
	background: var(--htl-neutral-900); z-index: 999;
}
.htl-sticky-btn {
	flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
	font-family: var(--htl-font-heading); font-weight: 800; font-size: 15px;
	padding: 14px 8px; min-height: 44px; transition: background .15s;
}
.htl-sticky-call { background: var(--htl-accent); color: #fff; }
.htl-sticky-call:hover { background: var(--htl-accent-600); color: #fff; }
.htl-sticky-wa { background: var(--htl-whatsapp); color: #fff; }
.htl-sticky-wa:hover { background: #1ebc59; color: #fff; }

/* ---------- generic page / blog ---------- */
.htl-page { padding: 48px clamp(20px, 5vw, 64px); max-width: 860px; }
.htl-page-title { font-size: clamp(28px, 4vw, 40px); margin-bottom: 20px; }

/* Full prose styling for the_content() — covers every block a page/post can
   contain (lists, quotes, code, tables, embeds, captions), since post
   authors write in the block editor and any of these can show up. */
.htl-page-content { font-size: 16px; line-height: 1.8; }
.htl-page-content > *:last-child { margin-bottom: 0; }
.htl-page-content h1 { font-size: 34px; }
.htl-page-content h2 { font-size: 27px; margin-top: 40px; }
.htl-page-content h3 { font-size: 21px; margin-top: 32px; }
.htl-page-content h4 { font-size: 18px; margin-top: 24px; }
.htl-page-content p { margin-bottom: 16px; }
.htl-page-content a { text-decoration: underline; text-underline-offset: 3px; }
.htl-page-content ul, .htl-page-content ol { margin: 0 0 16px; padding-inline-start: 22px; }
.htl-page-content li { margin-bottom: 6px; }
.htl-page-content ul { list-style: disc; }
.htl-page-content ol { list-style: decimal; }
.htl-page-content blockquote {
	margin: 20px 0; padding: 4px 20px; border-inline-start: 3px solid var(--htl-accent);
	font-size: 17px; opacity: .85; font-style: normal;
}
.htl-page-content code {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px;
	background: var(--htl-surface); padding: 2px 6px; border-radius: 4px;
}
.htl-page-content pre {
	background: var(--htl-neutral-900); color: #f8f4f4; padding: 16px 18px; border-radius: 12px;
	overflow-x: auto; margin: 0 0 16px;
}
.htl-page-content pre code { background: none; padding: 0; }
.htl-page-content table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 14px; }
.htl-page-content th, .htl-page-content td { padding: 8px 12px; border-bottom: 1px solid var(--htl-divider); text-align: start; }
.htl-page-content th { font-family: var(--htl-font-heading); font-weight: 700; }
.htl-page-content img { border-radius: 12px; margin: 0 0 8px; }
.htl-page-content figure { margin: 0 0 16px; }
.htl-page-content figcaption { font-size: 13px; opacity: .6; margin-top: 6px; }
.htl-page-content hr { border: 0; height: 2px; background: var(--htl-divider); margin: 32px 0; }
.htl-page-content iframe, .htl-page-content embed, .htl-page-content video { max-width: 100%; border-radius: 12px; }

.htl-post-meta { opacity: .6; font-size: 13px; margin-bottom: 20px; }
.htl-post-hero { margin: 0 0 24px; border-radius: 16px; overflow: hidden; }
.htl-archive-header { margin-bottom: 24px; }
.htl-post-list { display: grid; gap: 28px; }
.htl-post-card { padding-bottom: 24px; border-bottom: 1px solid var(--htl-divider); }
.htl-post-thumb { display: block; margin-bottom: 12px; border-radius: 16px; overflow: hidden; }
.htl-post-thumb img { transition: transform .3s; }
.htl-post-thumb:hover img { transform: scale(1.04); }
.htl-post-title { font-size: 22px; margin-bottom: 8px; }
.htl-post-title a { color: var(--htl-text); }
.htl-post-title a:hover { color: var(--htl-accent); }
.htl-post-excerpt { opacity: .78; margin-bottom: 8px; }

/* the_posts_pagination() core markup: nav.htl-pagination > .nav-links > .page-numbers */
.htl-pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.htl-pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 40px; height: 40px; padding: 0 12px; border-radius: 10px;
	background: #fff; color: var(--htl-text); font-family: var(--htl-font-heading); font-weight: 700; font-size: 14px;
	box-shadow: var(--htl-shadow-sm); transition: background .15s, color .15s;
}
.htl-pagination .page-numbers:hover { background: var(--htl-accent); color: #fff; }
.htl-pagination .page-numbers.current { background: var(--htl-accent); color: #fff; }
.htl-pagination .page-numbers.dots { box-shadow: none; background: none; }

/* WP core search form + comment template classes, styled to match. */
.search-form { display: flex; gap: 8px; margin-bottom: 24px; }
.search-form .search-field {
	flex: 1; min-height: 44px; padding: 10px 14px; font: inherit; font-size: 15px;
	background: #fff; border: 1.5px solid var(--htl-divider); border-radius: 10px; color: var(--htl-text);
}
.search-form .search-field:focus-visible { border-color: var(--htl-accent); outline-offset: 0; }
.search-form .search-submit {
	display: inline-flex; align-items: center; justify-content: center;
	font-family: var(--htl-font-heading); font-weight: 800; font-size: 14px;
	padding: 0 20px; border-radius: 10px; border: none; background: var(--htl-accent); color: #fff;
	cursor: pointer; transition: background .15s;
}
.search-form .search-submit:hover { background: var(--htl-accent-600); }

.htl-comments { margin-top: 40px; }
.htl-comments .comments-title,
.htl-comments .comment-reply-title { font-size: 22px; margin-bottom: 20px; }
.htl-comments ol.comment-list { list-style: none; margin: 0 0 32px; padding: 0; }
.htl-comments .comment-body { padding: 18px 0; border-top: 1px solid var(--htl-divider); }
.htl-comments li:first-child > .comment-body { border-top: none; }
.htl-comments .comment-author .fn { font-family: var(--htl-font-heading); font-weight: 700; font-style: normal; }
.htl-comments .comment-metadata { font-size: 12px; opacity: .6; margin-bottom: 8px; }
.htl-comments .comment-content p { margin-bottom: 8px; }
.htl-comments .comment-reply-link {
	display: inline-flex; font-size: 13px; font-weight: 700; color: var(--htl-accent-700);
	margin-top: 6px;
}
.htl-comments .comment-reply-link:hover { color: var(--htl-accent-600); }
.htl-comments .comment-form p { margin-bottom: 14px; }
.htl-comments .comment-form label { display: block; font-size: 13px; margin-bottom: 6px; opacity: .75; }
.htl-comments .comment-form input[type="text"],
.htl-comments .comment-form input[type="email"],
.htl-comments .comment-form input[type="url"],
.htl-comments .comment-form textarea {
	width: 100%; padding: 10px 14px; font: inherit; font-size: 15px;
	background: #fff; border: 1.5px solid var(--htl-divider); border-radius: 10px; color: var(--htl-text);
}
.htl-comments .comment-form input:focus-visible,
.htl-comments .comment-form textarea:focus-visible { border-color: var(--htl-accent); outline-offset: 0; }
.htl-comments .comment-form textarea { min-height: 120px; resize: vertical; }
.htl-comments .form-submit input[type="submit"] {
	font-family: var(--htl-font-heading); font-weight: 800; font-size: 14px; cursor: pointer;
	padding: 12px 26px; border-radius: 12px; border: none; background: var(--htl-accent); color: #fff;
	transition: background .15s;
}
.htl-comments .form-submit input[type="submit"]:hover { background: var(--htl-accent-600); }

/* ---------- mobile nav: hamburger + off-canvas sidebar ---------- */
@media (max-width: 768px) {
	.htl-nav { justify-content: space-between; }
	.htl-nav-call { display: none; }
	.htl-menu-toggle { display: flex; }

	/* inset-inline-start = the "start" edge — the right side of the screen in
	   this RTL theme — so the drawer sits flush against the right, and slides
	   fully off past it (translateX(100%), a physical rightward shift) when closed. */
	.htl-nav-menu {
		position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 1000;
		width: min(82vw, 320px); max-width: 320px; height: 100%;
		background: #fff; flex-direction: column; align-items: stretch; gap: 0;
		padding: 20px; box-shadow: var(--htl-shadow-lg); overflow-y: auto;
		transform: translateX(100%); transition: transform .3s ease;
	}
	.htl-nav-menu.is-open { transform: translateX(0); }

	.htl-nav-menu-head {
		display: flex; align-items: center; justify-content: space-between;
		margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--htl-divider);
	}
	.htl-nav-menu-title { font-family: var(--htl-font-heading); font-weight: 800; font-size: 15px; }
	.htl-nav-close {
		display: flex; align-items: center; justify-content: center;
		width: 36px; height: 36px; border: none; border-radius: 50%;
		background: var(--htl-surface); color: var(--htl-text); cursor: pointer; transition: background .15s;
	}
	.htl-nav-close:hover { background: var(--htl-accent-100); color: var(--htl-accent-700); }

	.htl-nav-menu,
	.htl-nav-links { flex-direction: column; align-items: stretch; gap: 2px; }
	.htl-nav-menu > a,
	.htl-nav-links > li > a {
		display: block; padding: 13px 10px; font-size: 15.5px; font-weight: 600; border-radius: 10px;
	}
	.htl-nav-menu > a:hover,
	.htl-nav-links > li > a:hover { background: var(--htl-surface); color: var(--htl-accent); }

	.htl-nav-menu-cta {
		display: flex; flex-direction: column; gap: 10px; margin-top: 20px; padding-top: 20px;
		border-top: 1px solid var(--htl-divider);
	}
	.htl-nav-menu-cta .htl-btn { width: 100%; padding: 13px; font-size: 14.5px; }
}
