/*
Theme Name: BLC Theme
Description: Best Local Cleaners block theme (Book With Ease direction: blue/navy, clear service choices, easy quote journey). Presentation only: content and content blocks live in the BLC Core plugin.
Version: 0.7.0
Requires at least: 7.0
Requires PHP: 8.0
Author: Best Local Cleaners rebuild
License: GPL-2.0-or-later
Text Domain: blc-theme
*/

/* Everything not expressible in theme.json. Tokens: theme.json presets (--wp--preset--color--*). */

body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
:where(a) { text-underline-offset: .15em; }
:focus-visible { outline: 3px solid var(--wp--preset--color--blue); outline-offset: 2px; }
img { max-width: 100%; height: auto; }
.wp-site-blocks { padding: 0; }
.wp-site-blocks > * { margin-block-start: 0; }
.blc-logo { flex: none; display: inline-block; line-height: 0; }
.blc-logo img, .blc-logo svg { display: block; height: auto; }
.blc-nav__menu > li > .blc-nav__row > a { white-space: nowrap; }
main.blc-main { margin-block: 0; }
main.blc-main > .wp-block-post-content > :not(.blc-section):not(.wp-block-block) { max-width: var(--wp--style--global--content-size); margin-inline: auto; padding-inline: clamp(16px, 4vw, 32px); }
main.blc-main > .wp-block-post-content > :not(.blc-section):first-child { margin-top: clamp(32px, 5vw, 56px); }
.blc-page-title { max-width: var(--wp--style--global--content-size); margin: clamp(32px, 5vw, 56px) auto 1rem; padding-inline: clamp(16px, 4vw, 32px); }

/* Header */
.blc-header { position: sticky; top: 0; z-index: 50; background: var(--wp--preset--color--base); border-bottom: 1px solid var(--wp--preset--color--line); }
.admin-bar .blc-header { top: var(--wp-admin--admin-bar--height, 32px); }
.blc-header__inner { display: flex; align-items: center; gap: 1rem; max-width: var(--wp--style--global--wide-size); margin-inline: auto; padding: .6rem clamp(16px, 4vw, 32px); }
.blc-header .wp-block-site-logo { flex: none; }
.blc-header .wp-block-site-logo img { max-height: 56px; width: auto; }
.blc-header .wp-block-site-title { margin: 0; font-size: 1.15rem; font-weight: 800; }
.blc-header .wp-block-site-title a { color: var(--wp--preset--color--navy); text-decoration: none; }
.blc-actions { display: flex; align-items: center; gap: .75rem; margin-left: auto; }
.blc-actions__phone { display: none; align-items: center; gap: .4rem; color: var(--wp--preset--color--navy); font-weight: 700; text-decoration: none; white-space: nowrap; }
.blc-actions__phone svg { width: 18px; height: 18px; color: var(--wp--preset--color--blue); }
.blc-actions__quote { white-space: nowrap; }
@media (min-width: 1100px) { .blc-actions__phone { display: inline-flex; } }
/* Phones: the quote button lives in the bottom call/quote bar; keep the header to logo + menu. */
@media (max-width: 699.98px) {
	.blc-actions__quote { display: none; }
	.blc-header .wp-block-site-logo { min-width: 0; flex: 0 1 auto; }
	.blc-header .wp-block-site-logo img { max-height: 44px; }
	.blc-nav { margin-left: auto; }
}

/* Navigation */
.blc-nav__toggle { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--wp--preset--color--line); background: none; border-radius: 8px; padding: .5rem .7rem; font: inherit; font-weight: 600; color: var(--wp--preset--color--navy); cursor: pointer; }
.blc-nav__toggle svg { width: 20px; height: 20px; }
.blc-nav__menu, .blc-nav__menu ul { list-style: none; margin: 0; padding: 0; }
.blc-nav__menu a { color: var(--wp--preset--color--ink); text-decoration: none; }
.blc-nav__menu a:hover { color: var(--wp--preset--color--blue); }
.blc-nav__sub-toggle { border: 0; background: none; padding: .35rem .5rem; cursor: pointer; color: inherit; font: inherit; line-height: 1; }
.blc-nav__sub-toggle::before { content: ""; display: inline-block; width: .5em; height: .5em; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-25%) rotate(45deg); transition: transform .15s; }
.is-sub-open > .blc-nav__row > .blc-nav__sub-toggle::before { transform: translateY(15%) rotate(-135deg); }
.blc-nav__row { display: flex; align-items: center; justify-content: space-between; gap: .25rem; }

@media (max-width: 1099.98px) {
	.blc-nav { order: 3; }
	.blc-nav__panel { display: none; position: fixed; inset: var(--blc-header-h, 72px) 0 0 0; background: var(--wp--preset--color--base); overflow-y: auto; padding: 1rem clamp(16px, 4vw, 32px) 6rem; border-top: 1px solid var(--wp--preset--color--line); }
	.blc-nav.is-open .blc-nav__panel { display: block; }
	.blc-nav__menu li { border-bottom: 1px solid var(--wp--preset--color--line); }
	.blc-nav__menu li li { border: 0; }
	.blc-nav__menu a { display: block; padding: .7rem 0; font-weight: 600; }
	.blc-nav__menu ul { display: none; padding-left: 1rem; }
	.blc-nav__menu .is-sub-open > ul { display: block; }
	.blc-nav__menu ul a { font-weight: 400; padding: .45rem 0; }
}
@media (min-width: 1100px) {
	.blc-nav { margin-left: auto; }
	.blc-nav + .blc-actions { margin-left: 1rem; }
	.blc-nav__toggle { display: none; }
	.blc-nav__menu { display: flex; gap: 1.4rem; }
	.blc-nav__menu > li { position: relative; }
	.blc-nav__menu > li > .blc-nav__row > a { font-weight: 600; padding-block: 1.2rem; }
	.blc-nav__menu > li > ul { display: none; position: absolute; top: 100%; left: -1rem; min-width: 260px; max-height: 70vh; overflow-y: auto; background: var(--wp--preset--color--base); border: 1px solid var(--wp--preset--color--line); border-radius: 10px; box-shadow: 0 18px 40px rgba(11, 37, 69, .14); padding: .75rem 1rem; }
	.blc-nav__menu > li:is(:hover, .is-sub-open) > ul { display: block; } /* keyboard: the sub-menu button opens it (no focus-within, so closed menus are skipped) */
	.blc-nav__menu > li > ul:has(> li > ul) { display: none; width: min(880px, 80vw); columns: 3 220px; column-gap: 1.5rem; }
	.blc-nav__menu > li:is(:hover, .is-sub-open) > ul:has(> li > ul) { display: block; }
	.blc-nav__menu > li:last-child > ul, .blc-nav__menu > li:nth-last-child(2) > ul { left: auto; right: -1rem; }
	.blc-nav__menu ul li { break-inside: avoid; }
	.blc-nav__menu ul a { display: block; padding: .3rem 0; font-size: .95rem; }
	.blc-nav__menu ul ul { padding-left: .8rem; border-left: 1px solid var(--wp--preset--color--line); margin-block: .1rem .4rem; }
	.blc-nav__menu ul ul a { font-size: .875rem; color: var(--wp--preset--color--muted); padding-block: .15rem; }
	.blc-nav__menu ul .blc-nav__sub-toggle { display: none; }
	.blc-nav__menu ul ul ul { display: none; }
	.blc-nav__menu ul ul li.is-sub-open > ul, .blc-nav__menu ul ul li:focus-within > ul { display: block; }
	.blc-nav__menu ul ul .blc-nav__sub-toggle { display: inline-block; padding: .1rem .3rem; }
}

/* Footer */
.blc-footer { background: var(--wp--preset--color--navy); color: #dbe5f3; padding: clamp(40px, 6vw, 64px) clamp(16px, 4vw, 32px) 1.5rem; }
.blc-footer a { color: #fff; }
.blc-footer__inner { max-width: var(--wp--style--global--wide-size); margin-inline: auto; display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.blc-footer h2 { color: #fff; font-size: 1rem; letter-spacing: .06em; text-transform: uppercase; margin: 0 0 .75rem; }
.blc-footer .blc-menu-list { columns: 1; }
.blc-footer__legal { max-width: var(--wp--style--global--wide-size); margin: 2rem auto 0; padding-top: 1.25rem; border-top: 1px solid rgba(255, 255, 255, .15); font-size: .875rem; }
.blc-footer__areas { white-space: pre-line; margin: 0; }

/* Mobile call / quote bar */
.blc-mobile-bar { position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--wp--preset--color--line); box-shadow: 0 -6px 20px rgba(11, 37, 69, .12); padding-bottom: env(safe-area-inset-bottom); }
.blc-mobile-bar a { display: flex; align-items: center; justify-content: center; gap: .45rem; padding: .85rem; font-weight: 700; text-decoration: none; background: var(--wp--preset--color--base); color: var(--wp--preset--color--navy); }
.blc-mobile-bar a.is-quote { background: var(--wp--preset--color--blue); color: #fff; }
.blc-mobile-bar svg { width: 18px; height: 18px; }
body:has(.blc-mobile-bar) { padding-bottom: 56px; }
@media (min-width: 700px) { .blc-mobile-bar { display: none; } body:has(.blc-mobile-bar) { padding-bottom: 0; } }

/* Posts */
.blc-post-meta { color: var(--wp--preset--color--muted); font-size: .9rem; }
.wp-block-latest-posts.is-grid { gap: 1.5rem; }
.wp-block-latest-posts__featured-image img { border-radius: 10px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Base header: fits 1100-1400 px wide screens (seven top-level menu items + phone + quote). */
@media (min-width: 1100px) and (max-width: 1399.98px) {
	.blc-header .wp-block-site-logo img { max-height: 46px; }
	.blc-nav__menu { gap: .9rem; }
	.blc-nav__menu > li > .blc-nav__row > a { font-size: .92rem; }
	.blc-actions__phone { display: none; }
}
