/* Pet Health Man theme components. Colors and fonts come from theme.json. */

:root {
	--phm-ink: var(--wp--preset--color--ink, #1F2A44);
	--phm-muted: var(--wp--preset--color--muted, #5B6478);
	--phm-mist: var(--wp--preset--color--mist, #F4F7FB);
	--phm-sun: var(--wp--preset--color--sun, #FFD25A);
	--phm-coral: var(--wp--preset--color--coral, #FF7A59);
	--phm-teal: var(--wp--preset--color--teal, #0B6E6E);
	--phm-display: var(--wp--preset--font-family--display, system-ui, sans-serif);
	--phm-line: #EEF1F6;
	--phm-radius: 24px;
}

a:where(:not(.wp-element-button)):focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible {
	outline: 3px solid var(--phm-teal);
	outline-offset: 2px;
}

.phm-eyebrow {
	display: block;
	font-size: 0.8125rem;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--phm-muted);
}

/* ---------- Header ---------- */

.phm-header {
	border-bottom: 1px solid var(--phm-line);
	position: relative;
	z-index: 50;
	background: #fff;
}
.phm-header__inner { gap: 12px 24px; }

.phm-brand__link {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--phm-ink);
	text-decoration: none;
}
.phm-brand__mark {
	width: 44px;
	height: 44px;
	border-radius: 15px;
	background: var(--phm-sun);
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
}
.phm-brand__name {
	font-family: var(--phm-display);
	font-weight: 800;
	font-size: clamp(1.25rem, 1rem + 1vw, 1.625rem);
	line-height: 1;
	white-space: nowrap;
}

.phm-header .wp-block-navigation a { text-decoration: none; font-weight: 800; }
.phm-header .wp-block-navigation-item__content { padding: 10px 12px; border-radius: 20px; }
.phm-header .wp-block-navigation-item__content:hover { background: var(--phm-mist); }
.phm-header .wp-block-navigation__responsive-container-open {
	width: 44px;
	height: 44px;
	border-radius: 22px;
	background: var(--phm-mist);
	display: flex;
	align-items: center;
	justify-content: center;
}
.phm-header .wp-block-search { margin: 0; }
.phm-header .wp-block-search__inside-wrapper {
	background: var(--phm-mist);
	border: 0 !important;
	border-radius: 23px;
	padding: 2px 4px 2px 14px;
	min-height: 46px;
}
.phm-header .wp-block-search__input { background: transparent; border: 0; font-size: 15px; min-width: 0; }
.phm-header .wp-block-search__button { background: transparent; color: var(--phm-ink); padding: 8px; margin: 0; }
@media (max-width: 781px) {
	.phm-header .phm-header__search { display: none; }
	.phm-brand__mark { width: 40px; height: 40px; border-radius: 14px; }
}

/* ---------- Pet type menu ---------- */

.phm-pets { position: relative; }
.phm-pets__details { position: relative; }
.phm-pets__button {
	list-style: none;
	cursor: pointer;
	height: 44px;
	box-sizing: border-box;
	padding: 0 10px 0 14px;
	border: 2px solid var(--phm-ink);
	border-radius: 22px;
	background: #fff;
	color: var(--phm-ink);
	display: flex;
	align-items: center;
	gap: 6px;
	font-weight: 800;
	font-size: 15px;
	white-space: nowrap;
	user-select: none;
}
.phm-pets__button::-webkit-details-marker { display: none; }
.phm-pets__details[open] .phm-pets__chev { transform: rotate(180deg); }
.phm-pets__badge {
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	box-sizing: border-box;
	border-radius: 11px;
	background: var(--phm-teal);
	color: #fff;
	font-size: 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.phm-pets__panel {
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	z-index: 100;
	width: min(340px, calc(100vw - 24px));
	box-sizing: border-box;
	padding: 10px;
	border-radius: var(--phm-radius);
	border: 1px solid #E3E8F0;
	background: #fff;
	box-shadow: 0 16px 40px rgba(31, 42, 68, 0.18);
	max-height: min(70vh, 640px);
	overflow-y: auto;
}
@media (min-width: 782px) {
	.phm-pets__panel { left: 0; right: auto; }
}
.phm-pets__panel fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.phm-pets__panel legend { padding: 8px 10px 6px; }
.phm-pets__item {
	min-height: 44px;
	box-sizing: border-box;
	padding: 6px 10px;
	border-radius: 14px;
	display: flex;
	align-items: center;
	gap: 12px;
	cursor: pointer;
}
.phm-pets__item:hover { background: var(--phm-mist); }
.phm-pets__item:has(input:checked) { background: #E3F2F1; }
.phm-pets__item input { width: 20px; height: 20px; margin: 0; accent-color: var(--phm-teal); flex: 0 0 auto; }
.phm-pets__item > span { display: flex; flex-direction: column; }
.phm-pets__name { font-weight: 800; font-size: 16px; }
.phm-pets__sub { font-size: 13px; color: var(--phm-muted); line-height: 1.35; }
.phm-pets__actions {
	display: flex;
	gap: 8px;
	margin-top: 8px;
	padding: 10px 4px 2px;
	border-top: 1px solid var(--phm-line);
}
.phm-pets__clear,
.phm-pets__apply {
	height: 46px;
	border-radius: 14px;
	font: inherit;
	font-weight: 800;
	font-size: 15px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	text-decoration: none;
}
.phm-pets__clear { flex: 1 1 0; background: var(--phm-mist); color: var(--phm-ink); }
.phm-pets__apply { flex: 2 1 0; background: var(--phm-teal); color: #fff; border: 0; }

.phm-showing { margin: 0; font-size: 15px; font-weight: 700; color: var(--phm-muted); }

/* ---------- Homepage ---------- */

.phm-hero {
	position: relative;
	overflow: hidden;
	border-radius: 32px;
}
.phm-hero::before,
.phm-hero::after {
	content: "";
	position: absolute;
	border-radius: 50%;
	pointer-events: none;
}
.phm-hero::before { width: 240px; height: 240px; right: -70px; top: -70px; background: var(--wp--preset--color--sun-light); }
.phm-hero::after { width: 48px; height: 48px; right: 56px; top: 130px; background: var(--phm-coral); }
.phm-hero > * { position: relative; }
.phm-hero h1 { max-width: 12ch; }
.phm-hero p { max-width: 34ch; }

.phm-home-search .wp-block-search__inside-wrapper {
	background: var(--phm-mist);
	border: 0 !important;
	border-radius: 28px;
	min-height: 56px;
	padding: 4px 6px 4px 18px;
}
.phm-home-search .wp-block-search__input { background: transparent; border: 0; font-size: 16px; }
.phm-home-search .wp-block-search__button { border-radius: 22px; }

.phm-panel {
	border: 2px solid var(--phm-ink);
	border-radius: 32px;
}

.phm-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 20px;
}
@media (max-width: 599px) {
	.phm-cards {
		display: flex;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		gap: 12px;
		margin-inline: calc(-1 * var(--wp--style--root--padding-left, 20px));
		padding: 0 var(--wp--style--root--padding-left, 20px) 6px;
	}
	.phm-cards > .phm-card { flex: 0 0 236px; scroll-snap-align: start; }
}
.phm-card {
	border-radius: 28px;
	color: var(--phm-ink);
	text-decoration: none;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transition: transform 0.15s ease;
}
.phm-card:hover { transform: translateY(-3px); }
.phm-card__media {
	height: 150px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}
.phm-card__img { width: 100%; height: 100%; object-fit: cover; }
.phm-card__paw {
	width: 84px;
	height: 84px;
	border-radius: 50%;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
}
.phm-card__body {
	margin: 0 8px 8px;
	padding: 16px 18px 20px;
	border-radius: 22px;
	background: #fff;
	display: flex;
	flex-direction: column;
	gap: 10px;
	flex-grow: 1;
}
.phm-card__title { font-family: var(--phm-display); font-weight: 700; font-size: 1.25rem; line-height: 1.15; flex-grow: 1; }
.phm-card__more { font-size: 15px; font-weight: 800; color: var(--phm-teal); }

.phm-uhoh { display: flex; flex-direction: column; gap: 8px; }
.phm-uhoh__item {
	min-height: 56px;
	box-sizing: border-box;
	padding: 8px 16px 8px 10px;
	border-radius: 18px;
	background: var(--phm-mist);
	color: var(--phm-ink);
	text-decoration: none;
	display: flex;
	align-items: center;
	gap: 12px;
}
.phm-uhoh__item:hover { background: #E9EEF5; }
.phm-uhoh__icon {
	flex: 0 0 36px;
	height: 36px;
	border-radius: 12px;
	background: var(--phm-coral);
	color: var(--phm-ink);
	display: flex;
	align-items: center;
	justify-content: center;
}
.phm-uhoh__label { flex-grow: 1; font-family: var(--phm-display); font-weight: 700; font-size: 1.1875rem; line-height: 1.15; }
.phm-uhoh__arrow { font-weight: 800; color: var(--phm-teal); }

.phm-topics {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 12px;
}
.phm-topic {
	min-height: 140px;
	box-sizing: border-box;
	padding: 20px;
	border-radius: 28px;
	color: var(--phm-ink);
	text-decoration: none;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
}
.phm-topic:hover { filter: brightness(0.97); }
.phm-topic__name { font-family: var(--phm-display); font-weight: 800; font-size: clamp(1.1875rem, 1rem + 0.8vw, 1.625rem); line-height: 1.1; }
.phm-topic__count { font-size: 15px; font-weight: 700; }

.phm-rows { display: flex; flex-direction: column; }
.phm-row {
	display: flex;
	align-items: center;
	gap: 18px;
	padding: 14px 0;
	border-bottom: 1px solid var(--phm-line);
	color: var(--phm-ink);
	text-decoration: none;
}
.phm-row__thumb { flex: 0 0 84px; height: 72px; border-radius: 20px; overflow: hidden; }
.phm-row__img { width: 100%; height: 100%; object-fit: cover; }
.phm-row__text { display: flex; flex-direction: column; gap: 2px; }
.phm-row__title { font-family: var(--phm-display); font-weight: 700; font-size: 1.25rem; line-height: 1.15; }
.phm-row:hover .phm-row__title { text-decoration: underline; }

.phm-button {
	align-self: flex-start;
	margin-top: 20px;
	min-height: 52px;
	padding: 0 28px;
	border-radius: 26px;
	background: var(--phm-teal);
	color: #fff !important;
	display: inline-flex;
	align-items: center;
	font-weight: 800;
	text-decoration: none !important;
}
.phm-button:hover { background: #084F4F; }

.phm-empty {
	margin: 0;
	padding: 20px 24px;
	border-radius: var(--phm-radius);
	background: var(--phm-mist);
	font-weight: 700;
}

/* ---------- Signup ---------- */

.phm-signup {
	padding: clamp(22px, 4vw, 34px);
	border-radius: 32px;
	background: var(--phm-teal);
	color: #fff;
}
.phm-signup__title { margin: 0 0 8px; color: #fff; font-size: clamp(1.5rem, 1.2rem + 1vw, 1.875rem); }
.phm-signup__intro { margin: 0 0 12px; }
.phm-signup__form { margin: 0; }
.phm-signup__fields { display: flex; flex-direction: column; gap: 10px; }
.phm-signup__label { font-size: 14px; font-weight: 700; }
.phm-signup__input {
	height: 52px;
	box-sizing: border-box;
	padding: 0 16px;
	border: 0;
	border-radius: 16px;
	font: inherit;
	font-size: 16px;
	color: var(--phm-ink);
	width: 100%;
}
.phm-signup__button {
	height: 52px;
	border: 0;
	border-radius: 16px;
	background: var(--phm-sun);
	color: var(--phm-ink);
	font-family: var(--phm-display);
	font-weight: 800;
	font-size: 19px;
	cursor: pointer;
	position: relative;
}
.phm-signup__button:hover { filter: brightness(0.96); }
.phm-signup__fine { margin: 10px 0 0; font-size: 13px; opacity: 0.9; }
.phm-signup--compact .phm-signup__fields { flex-direction: row; flex-wrap: wrap; }
.phm-signup--compact .phm-signup__label { flex-basis: 100%; }
.phm-signup--compact .phm-signup__input { flex: 1 1 200px; width: auto; }
.phm-signup--compact .phm-signup__button { flex: 0 0 auto; padding: 0 22px; }
.phm-signup .formkit-alert { list-style: none; margin: 0 0 10px; padding: 0; }
.phm-signup .formkit-alert:empty { display: none; }
.phm-signup .formkit-alert li { padding: 12px 14px; border-radius: 14px; background: #fff; color: var(--phm-ink); font-weight: 700; }
.phm-signup .formkit-spinner { display: none; }

/* ---------- Article ---------- */

.phm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.phm-chip {
	padding: 6px 12px;
	border-radius: 14px;
	font-size: 13px;
	font-weight: 800;
	color: var(--phm-ink) !important;
	text-decoration: none !important;
}

.phm-byline { display: flex; align-items: center; gap: 12px; }
.phm-byline__avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--wp--preset--color--lilac);
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--phm-display);
	font-weight: 800;
	flex: 0 0 auto;
}
.phm-byline__text { display: flex; flex-direction: column; font-size: 14px; line-height: 1.35; }
.phm-byline__author { font-weight: 800; }
.phm-byline__meta { color: var(--phm-muted); }

.wp-block-post-content h2 { margin-top: 2.25rem; }
.wp-block-post-content :where(p, li) { font-size: 1.0625rem; }
.wp-block-post-content img { border-radius: var(--phm-radius); height: auto; }

/* Callouts from the theme's patterns. */
.phm-callout { border-radius: var(--phm-radius); }
.phm-callout > :first-child { margin-top: 0; }
.phm-callout > :last-child { margin-bottom: 0; }
.phm-callout--alert { border: 2px solid var(--phm-coral); }
.phm-callout ul { padding-left: 1.25rem; }

/* ---------- Lists (archives, search) ---------- */

.phm-grid .wp-block-post-template {
	gap: 20px;
}
.phm-grid .wp-block-post {
	border-radius: 28px;
	background: var(--phm-mist);
	padding: 8px 8px 20px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.phm-grid .wp-block-post-featured-image { margin: 0; }
.phm-grid .wp-block-post-featured-image img { aspect-ratio: 16 / 10; object-fit: cover; border-radius: 22px; }
.phm-grid .wp-block-post > :not(.wp-block-post-featured-image) { padding-inline: 12px; }
.phm-grid .wp-block-post-title { margin: 0; font-size: 1.25rem; line-height: 1.15; }
.phm-grid .wp-block-post-title a { color: var(--phm-ink); text-decoration: none; }
.phm-grid .wp-block-post-title a:hover { text-decoration: underline; }
.phm-grid .wp-block-post-terms { font-size: 13px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.phm-grid .wp-block-post-terms a { color: var(--phm-muted); text-decoration: none; }
.phm-grid .wp-block-post-excerpt { font-size: 15px; color: var(--phm-muted); margin: 0; }
.phm-grid .wp-block-post-excerpt__more-text { display: none; }

.wp-block-query-pagination { font-weight: 800; gap: 12px; }
.wp-block-query-pagination a { text-decoration: none; }

/* ---------- Footer ---------- */

.phm-footer a { color: #fff; text-decoration: none; font-weight: 700; }
.phm-footer a:hover { text-decoration: underline; }
.phm-footer .wp-block-navigation-item__content { padding: 6px 0; }
.phm-footer-note p { margin: 0 0 8px; font-size: 14px; line-height: 1.55; color: #C9D1E0; }

@media (prefers-reduced-motion: reduce) {
	.phm-card { transition: none; }
	.phm-card:hover { transform: none; }
}

/* ---------- Main menu ---------- */

.phm-nav ul { list-style: none; margin: 0; padding: 0; }
.phm-nav__inline { display: flex; flex-wrap: wrap; gap: 2px; }
.phm-nav__inline a {
	display: block;
	padding: 10px 12px;
	border-radius: 20px;
	color: var(--phm-ink);
	font-weight: 800;
	text-decoration: none;
}
.phm-nav__inline a:hover { background: var(--phm-mist); }
.phm-nav__details { position: relative; display: none; }
.phm-nav__open {
	list-style: none;
	width: 44px;
	height: 44px;
	border-radius: 22px;
	background: var(--phm-mist);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}
.phm-nav__open::-webkit-details-marker { display: none; }
.phm-nav__panel {
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	z-index: 100;
	width: min(320px, calc(100vw - 24px));
	box-sizing: border-box;
	padding: 12px;
	border-radius: var(--phm-radius);
	border: 1px solid #E3E8F0;
	background: #fff;
	box-shadow: 0 16px 40px rgba(31, 42, 68, 0.18);
}
.phm-nav__panel li a {
	display: block;
	padding: 12px 10px;
	border-radius: 14px;
	color: var(--phm-ink);
	font-family: var(--phm-display);
	font-weight: 700;
	font-size: 1.1875rem;
	text-decoration: none;
}
.phm-nav__panel li a:hover { background: var(--phm-mist); }
.phm-nav__search { margin-top: 8px; padding: 12px 6px 4px; border-top: 1px solid var(--phm-line); display: flex; flex-direction: column; gap: 6px; }
.phm-nav__search input { height: 48px; border: 0; border-radius: 24px; background: var(--phm-mist); padding: 0 16px; font: inherit; font-size: 16px; }
@media (max-width: 781px) {
	.phm-nav__inline { display: none; }
	.phm-nav__details { display: block; }
	.phm-subscribe { display: none; }
}

.phm-subscribe__link {
	min-height: 46px;
	padding: 0 20px;
	border-radius: 23px;
	background: var(--phm-teal);
	color: #fff !important;
	display: inline-flex;
	align-items: center;
	font-weight: 800;
	text-decoration: none !important;
	white-space: nowrap;
}
.phm-subscribe__link:hover { background: #084F4F; }

.phm-footer-links { display: flex; flex-wrap: wrap; gap: 32px 56px; }
.phm-footer-links .phm-eyebrow { color: #C9D1E0; margin-bottom: 6px; }
.phm-footer-links ul { list-style: none; margin: 0; padding: 0; }
.phm-footer-links li a { display: inline-block; padding: 6px 0; }

.phm-footer .phm-brand__link,
.phm-footer .phm-brand__link:hover { color: #fff; text-decoration: none; }
.phm-footer .phm-brand__mark { color: var(--phm-ink); }
.phm-footer__about { max-width: 420px; }
.phm-header .phm-brand__mark { color: var(--phm-ink); }
@media (max-width: 1180px) {
	.phm-header .phm-header__search { display: none; }
}
.phm-panel .wp-block-heading { margin: 0; }

/* Fit the header on small phones. */
html, body { overflow-x: clip; }
@media (max-width: 781px) {
	.phm-header__inner { gap: 8px !important; }
	.phm-header__right { gap: 6px !important; }
	.phm-brand__link { gap: 8px; }
	.phm-brand__mark { width: 36px; height: 36px; border-radius: 12px; }
	.phm-header .phm-brand__name { font-size: 1.125rem; }
	.phm-pets__button { padding: 0 8px 0 12px; font-size: 14px; }
	.phm-hero::after { display: none; }
	.phm-hero::before { width: 160px; height: 160px; right: -60px; top: -60px; }
}
@media (max-width: 359px) {
	.phm-header .phm-brand__name { display: none; }
}
.phm-nav__inline { flex-wrap: nowrap; }
.phm-nav__inline a { padding: 10px; white-space: nowrap; }
@media (max-width: 1360px) {
	.phm-header .phm-header__search { display: none; }
}
@media (max-width: 781px) {
	.phm-pets__panel,
	.phm-nav__panel {
		position: fixed;
		top: 76px;
		left: 12px;
		right: 12px;
		width: auto;
	}
}
