/*
Theme Name: Phil Hartwick Counseling
Theme URI: https://philhartwickcounseling.com
Author: Just Works Marketing
Author URI: https://justworksmarketing.com
Description: Custom block theme for Phil Hartwick Counseling. Colors, type, spacing and section styles live in theme.json (Appearance > Editor > Styles). Every page is built from core blocks and the "Phil Hartwick" patterns.
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: phc
*/

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }
a { text-underline-offset: 3px; }
a[href^="tel:"] { white-space: nowrap; }
:where(a, button, summary, input, select, textarea, [tabindex]):focus-visible { outline: 3px solid var(--wp--preset--color--sunrise); outline-offset: 3px; }
[id] { scroll-margin-top: 110px; }
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Layout: full-width sections stack flush ---------- */
.wp-site-blocks > * { margin-block-start: 0; }
.wp-block-post-content > .alignfull,
.wp-block-post-content > .alignfull + * { margin-block-start: 0; }
.wp-site-blocks > header.wp-block-template-part { position: sticky; top: 0; z-index: 50; }
.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; } }
@media (max-width: 600px) { .admin-bar .wp-site-blocks > header.wp-block-template-part { top: 0; } }

/* ---------- Buttons ---------- */
.wp-block-button__link { display: inline-flex; align-items: center; justify-content: center; min-height: 56px; box-sizing: border-box; text-align: center; transition: background-color .15s, color .15s; }
.wp-block-button.is-style-secondary .wp-block-button__link:hover { background: var(--wp--preset--color--cream); color: var(--wp--preset--color--forest); }
.wp-block-button.is-style-dark .wp-block-button__link:hover { background: var(--wp--preset--color--forest); color: var(--wp--preset--color--cream); }
.wp-block-button.is-style-outline .wp-block-button__link:hover { background: var(--wp--preset--color--pine); color: var(--wp--preset--color--cream); }
.wp-block-button.is-small .wp-block-button__link { min-height: 48px; font-size: 16px; padding: 10px 22px; }

/* ---------- Text styles ---------- */
p.is-style-eyebrow { font-size: 15px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; line-height: 1.4; }
p.is-style-label { font-size: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; line-height: 1.4; }
p.is-style-arrow-link a { font-weight: 700; display: inline-flex; align-items: center; min-height: 44px; }
p.is-style-step-number,
p.is-style-service-number { display: flex; align-items: center; justify-content: center; font-family: var(--wp--preset--font-family--heading); line-height: 1; margin-bottom: 0; }
p.is-style-step-number { width: 52px; height: 52px; border-radius: 50%; font-size: 22px; background: var(--wp--preset--color--sunrise); color: var(--wp--preset--color--cta-ink); }
p.is-style-service-number { width: 48px; height: 48px; border-radius: 50% 50% 10px 10px; font-size: 18px; background: var(--wp--preset--color--pine); color: var(--wp--preset--color--peach); }
p.is-style-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; font-size: 15px; font-weight: 600; width: fit-content; }
p.is-style-pill a { text-decoration: none; color: inherit; }
.phc-stars { color: var(--wp--preset--color--star); letter-spacing: 2px; }

/* ---------- Lists ---------- */
ul.is-style-diamond, ul.is-style-inline-diamond, ul.is-style-plain, ul.is-style-chips { list-style: none; padding-left: 0; margin-left: 0; }
ul.is-style-diamond { display: flex; flex-direction: column; gap: 12px; }
ul.is-style-diamond > li, ul.is-style-inline-diamond > li { position: relative; padding-left: 24px; }
ul.is-style-diamond > li::before, ul.is-style-inline-diamond > li::before { content: ""; position: absolute; left: 0; top: .55em; width: 10px; height: 10px; transform: rotate(45deg); background: var(--wp--preset--color--sunrise); }
ul.is-style-inline-diamond { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 32px; font-size: 16px; font-weight: 500; }
ul.is-style-inline-diamond > li { padding-left: 18px; }
ul.is-style-inline-diamond > li::before { width: 8px; height: 8px; top: .6em; background: var(--wp--preset--color--peach); }
ul.is-style-plain { display: flex; flex-direction: column; gap: 10px; }
ul.is-style-plain a { text-decoration: none; }
ul.is-style-plain a:hover { text-decoration: underline; }
ul.is-style-chips { display: flex; flex-wrap: wrap; gap: 10px; }
ul.is-style-chips > li { font-size: 16px; font-weight: 500; padding: 8px 16px; border-radius: 999px; background: var(--wp--preset--color--sand); border: 1px solid var(--wp--preset--color--line); color: var(--wp--preset--color--pine); }
.is-style-section-sand ul.is-style-chips > li { background: var(--wp--preset--color--cream); border-color: var(--wp--preset--color--line-strong); }
ul.is-style-chips > li a { text-decoration: none; color: inherit; }

ul.is-style-inline-diamond.phc-justify-start { justify-content: flex-start; gap: 10px 22px; }
ul.is-style-tiles { list-style: none; padding-left: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; }
ul.is-style-tiles > li { position: relative; background: var(--wp--preset--color--sand); border-radius: 20px; padding: 22px 24px 22px 48px; }
ul.is-style-tiles > li::before { content: ""; position: absolute; left: 24px; top: calc(22px + .5em); width: 10px; height: 10px; transform: rotate(45deg); background: var(--wp--preset--color--sunrise); }
.is-style-section-sand ul.is-style-tiles > li { background: var(--wp--preset--color--cream); }
ol.is-style-steps { list-style: none; padding-left: 0; counter-reset: phc-step; display: flex; flex-direction: column; gap: 16px; }
ol.is-style-steps > li { counter-increment: phc-step; position: relative; padding-left: 56px; min-height: 40px; display: flex; align-items: center; }
ol.is-style-steps > li::before { content: counter(phc-step); position: absolute; left: 0; top: 0; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--wp--preset--font-family--heading); background: var(--wp--preset--color--sunrise); color: var(--wp--preset--color--cta-ink); }

/* ---------- Layout utilities ---------- */
.phc-align-center { align-items: center; }
.phc-align-start { align-items: start; }
/* Cards in equal-height grids: last item (link or name) pins to the bottom */
.phc-card { display: flex; flex-direction: column; gap: 16px; }
.phc-card > * { margin-block: 0; }
.phc-card > :last-child { margin-top: auto; }
.phc-header .wp-block-button__link { min-height: 48px; }
/* Services grid: when the last card lands alone in a row, it spans the full width (no empty slot). */
.phc-service-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.phc-service-card > .wp-block-image { flex: none; margin: 0; }
.phc-service-card > .wp-block-image img { border-radius: 16px; }
@media (max-width: 480px) { .phc-service-card > .wp-block-image img { width: 84px !important; height: 84px !important; } }

/* ---------- FAQ (Details block) ---------- */
.wp-block-details { border-bottom: 1px solid var(--wp--preset--color--line-strong); margin-block-start: 0; }
.wp-block-details summary { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 4px; min-height: 44px; font-size: 19px; font-weight: 600; line-height: 1.4; color: var(--wp--preset--color--pine); cursor: pointer; list-style: none; }
.wp-block-details summary::-webkit-details-marker { display: none; }
.wp-block-details summary::after { content: "+"; flex: none; font-size: 28px; line-height: 1; font-weight: 400; color: var(--wp--preset--color--clay); transition: transform .2s; }
.wp-block-details[open] summary::after { transform: rotate(45deg); }
.wp-block-details > :not(summary) { padding: 0 4px; max-width: 44em; margin-block-start: 0; }
.wp-block-details > :last-child:not(summary) { padding-bottom: 24px; }
.is-style-section-forest .wp-block-details, .is-style-section-pine .wp-block-details { border-color: var(--wp--preset--color--line-dark-strong); }
.is-style-section-forest .wp-block-details summary, .is-style-section-pine .wp-block-details summary { color: var(--wp--preset--color--cream); }
.is-style-section-forest .wp-block-details summary::after, .is-style-section-pine .wp-block-details summary::after { color: var(--wp--preset--color--peach); }

/* ---------- Video cards (Cover block styles) ---------- */
.wp-block-cover.is-style-video-card { border-radius: 28px; overflow: hidden; }
.wp-block-cover.is-style-video-card a { color: inherit; text-decoration: none; }
.wp-block-cover.is-style-video-card a::after { content: ""; position: absolute; inset: 0; z-index: 2; }
.wp-block-cover.is-style-video-card:focus-within { outline: 3px solid var(--wp--preset--color--sunrise); outline-offset: 4px; }
.wp-block-cover.is-style-video-card a:focus-visible { outline: none; }
p.is-style-play, p.is-style-play-stacked { position: relative; color: var(--wp--preset--color--on-dark); font-size: 15px; line-height: 1.4; }
p.is-style-play strong, p.is-style-play-stacked strong { display: block; font-family: var(--wp--preset--font-family--heading); font-weight: 400; color: var(--wp--preset--color--cream); }
p.is-style-play { padding-left: 84px; min-height: 68px; display: flex; flex-direction: column; justify-content: center; text-align: left; }
p.is-style-play strong { font-size: 22px; line-height: 1.25; }
p.is-style-play-stacked { text-align: center; padding-top: 98px; }
p.is-style-play-stacked strong { font-size: 26px; line-height: 1.2; margin-bottom: 6px; }
p.is-style-play::before, p.is-style-play-stacked::before { content: ""; position: absolute; border-radius: 50%; background: var(--wp--preset--color--sunrise) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l12-7z' fill='%231A120C'/%3E%3C/svg%3E") 55% 50% / 46% no-repeat; }
p.is-style-play::before { left: 0; top: 50%; width: 68px; height: 68px; transform: translateY(-50%); }
p.is-style-play-stacked::before { left: 50%; top: 0; width: 84px; height: 84px; transform: translateX(-50%); }

/* ---------- Header ---------- */
.phc-header .phc-brand { min-width: 0; }
.phc-header .phc-brand p { margin: 0; white-space: nowrap; line-height: 1.1; }
.phc-header .phc-brand a { color: inherit; text-decoration: none; }
.phc-header .wp-block-site-logo { flex: none; }
.phc-header .wp-block-site-logo img { display: block; }
.phc-header .phc-header-phone { white-space: nowrap; }
.phc-header .phc-header-phone a { text-decoration: none; }
.phc-header .phc-header-phone a:hover { color: var(--wp--preset--color--peach); }
.phc-header .wp-block-navigation .wp-block-navigation-item__content { white-space: nowrap; }
.phc-header .wp-block-navigation .current-menu-item > a,
.phc-header .wp-block-navigation a[aria-current="page"] { font-weight: 700; text-decoration: underline; text-decoration-color: var(--wp--preset--color--sunrise); text-decoration-thickness: 2px; text-underline-offset: 8px; }
.phc-header .wp-block-navigation__responsive-container-open { border: 2px solid var(--wp--preset--color--cream); border-radius: 999px; min-height: 48px; min-width: 48px; padding: 0 14px; align-items: center; justify-content: center; gap: 10px; color: var(--wp--preset--color--cream); font-weight: 700; font-size: 15px; }
.phc-header .wp-block-navigation__responsive-container-open::after { content: "Menu"; }
.phc-header .wp-block-navigation__responsive-container-close { min-height: 48px; min-width: 48px; }
/* The Navigation block collapses at 600px by default. This site collapses at 1100px. */
@media (min-width: 600px) and (max-width: 1099.98px) {
	.phc-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
	.phc-header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
}
@media (max-width: 1099.98px) {
	.phc-header .wp-block-navigation { order: 3; flex: none; }
	.phc-header .phc-header-phone { display: none; }
	.phc-header .phc-header-actions { margin-left: auto; }
}
@media (max-width: 767.98px) {
	.phc-header .phc-header-actions { display: none; }
	.phc-header .wp-block-navigation { margin-left: auto; }
}
.phc-header .wp-block-navigation__responsive-container.is-menu-open { padding: 20px clamp(16px, 4vw, 48px) 32px; }
.phc-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container { width: 100%; gap: 0; align-items: stretch; }
.phc-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item { border-bottom: 1px solid var(--wp--preset--color--line-dark); width: 100%; }
.phc-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 56px; font-family: var(--wp--preset--font-family--heading); font-size: 22px; font-weight: 400; }
.phc-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content::after { content: "\2192"; color: var(--wp--preset--color--peach); font-family: var(--wp--preset--font-family--body); font-size: 18px; }

@media (max-width: 480px) {
	.phc-header .phc-brand { gap: 10px !important; }
	.phc-header .phc-brand p:last-child { letter-spacing: .1em !important; font-size: 11px !important; }
	.phc-header .wp-block-navigation__responsive-container-open { padding: 0 12px; gap: 6px; }
}

/* ---------- Footer + mobile quick-contact bar ---------- */
.phc-footer a:hover { color: var(--wp--preset--color--white); }
.wp-block-buttons.phc-mobile-bar { display: none; }
@media (max-width: 767.98px) {
	.wp-block-buttons.phc-mobile-bar { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; margin: 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: var(--wp--preset--color--forest); border-top: 1px solid var(--wp--preset--color--line-dark); }
	.phc-mobile-bar .wp-block-button { width: 100%; margin: 0; }
	.phc-mobile-bar .wp-block-button__link { width: 100%; min-height: 50px; font-size: 16px; padding: 8px 12px; }
	.phc-footer { padding-bottom: 112px !important; }
}

/* ---------- Media + embeds ---------- */
.phc-map iframe { display: block; width: 100%; height: 320px; border: 0; border-radius: 28px; background: var(--wp--preset--color--sand); }
.phc-form-placeholder { border: 2px dashed var(--wp--preset--color--line-strong); border-radius: 16px; }
.wp-block-image.phc-ratio-5-4 img { aspect-ratio: 5 / 4; object-fit: cover; width: 100%; }

/* ---------- Blog ---------- */
.wp-block-post-featured-image img { border-radius: 24px; }
.wp-block-post-title a { text-decoration: none; color: inherit; }
.wp-block-post-title a:hover { color: var(--wp--preset--color--clay); }
.wp-block-post-terms a { text-decoration: none; }
.wp-block-categories.is-style-pills { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.wp-block-categories.is-style-pills a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--wp--preset--color--pine); color: var(--wp--preset--color--pine); font-size: 16px; font-weight: 600; text-decoration: none; }
.wp-block-categories.is-style-pills a:hover, .wp-block-categories.is-style-pills .current-cat > a { background: var(--wp--preset--color--pine); color: var(--wp--preset--color--cream); }
.wp-block-query-pagination a, .wp-block-query-pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; font-weight: 600; text-decoration: none; }
.phc-article { font-size: 19px; line-height: 1.75; }
.phc-article > h2 { font-size: clamp(26px, 2.8vw, 32px); margin-top: 1.6em; }
.phc-article > h3 { margin-top: 1.4em; }
.phc-sticky { position: sticky; top: 110px; }
.admin-bar .phc-sticky { top: 142px; }
@media (max-width: 781px) { .phc-sticky { position: static; } }

/* ---------- Editor-only helpers ---------- */
.editor-styles-wrapper .wp-block-buttons.phc-mobile-bar { display: flex; position: static; gap: 10px; padding: 10px 14px; background: var(--wp--preset--color--forest); }
