/*
 * Care Point Boston – visual fixes, batch 2 (option cpd_vfix2_mode; markup in inc/vfix2.php).
 * Loaded on every page while the flag is on (designed templates, /blog/, the shared header and footer).
 */

/* ------------------------------------------------ mega menu: equal items --- */
/* Sub-pages (Generalized Anxiety Disorder under Anxiety …) are ordinary items: same colour, size, weight, no indent. */
body.cpd-vfix2 .cp-mega .cp-mega__link--sub,
body.cpd-vfix2 .cp-mega .cp-mega__link--child,
body.cpd-vfix2 .cp-drawer .cp-mmenu__link--sub,
body.cpd-vfix2 .cp-drawer .cp-mmenu__link--child { color: var(--cp-ink, #1a1e1d); padding-left: 10px; text-indent: 0; }
body.cpd-vfix2 .cp-drawer .cp-mmenu__link--sub,
body.cpd-vfix2 .cp-drawer .cp-mmenu__link--child { padding-left: 0; }
body.cpd-vfix2 .cp-mega .cp-mega__link--sub:hover,
body.cpd-vfix2 .cp-mega .cp-mega__link--sub:focus-visible { color: var(--cp-green, #256b2e); }

/* ------------------------------------------------------------ phones --- */
body.cpd-vfix2 a[href^="tel:"],
body.cpd-vfix2 .cpd-tel { white-space: nowrap; }
/* Admissions card: the number fits the card at every width (container units where supported). */
body.cpd-vfix2 .cpd .cpd-final__aside { container-type: inline-size; min-width: 0; }
body.cpd-vfix2 .cpd .cpd-final__tel { white-space: nowrap; font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem); }
@supports (font-size: 1cqi) {
	body.cpd-vfix2 .cpd .cpd-final__tel { font-size: min(2.5rem, 13.5cqi); }
}

/* -------------------------------------------------------------- map --- */
body.cpd-vfix2 .cpd .cpd-map--embed { display: block; height: 420px; min-height: 0; aspect-ratio: auto; background: #e5eee4; background-image: none; }
body.cpd-vfix2 .cpd .cpd-map--embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.cpd-map__dir { margin-top: 16px; }
/* The offset backing card of photo bands reads as a misaligned box behind a live map. */
body.cpd-vfix2 .cpd .cpd-mapband .cpd-split__media::before { display: none; }
@media (max-width: 767px) { body.cpd-vfix2 .cpd .cpd-map--embed { height: 320px; } }

/* ------------------------------------------- editorial + contributors --- */
.cpd-ed__head { max-width: 760px; margin: 0 0 34px; }
body .cpd .cpd-ed__lead p { margin: 0; color: var(--muted); font-size: 1.0625rem; }
.cpd-ed__cards { display: grid; gap: 22px; align-items: stretch; }
@media (min-width: 900px) { .cpd-ed__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; } }
.cpd-edcard { display: flex; flex-direction: column; min-width: 0; padding: 30px 28px 28px; border: 1px solid var(--line); border-radius: 22px; background: var(--mint); }
@media (min-width: 1024px) { .cpd-edcard { padding: 36px 36px 32px; } }
.cpd-edcard__ico { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 0 18px; border-radius: 14px; background: #fff; box-shadow: 0 1px 2px rgba(20, 50, 28, .06); }
.cpd-edcard__ico .cpd-ico { width: 24px; height: 24px; fill: var(--green); }
body .cpd .cpd-edcard__title { margin: 0 0 10px; font-size: 1.5rem; }
body .cpd .cpd-edcard__body p { margin: 0 0 12px; font-size: 1rem; line-height: 1.65; }
body .cpd .cpd-edcard__body p:last-child { margin-bottom: 0; }
.cpd-prows { display: grid; gap: 10px; margin: 20px 0 0; padding: 0; list-style: none; }
.cpd-prow { margin: 0; }
body .cpd .cpd-prow a { display: flex; align-items: center; gap: 14px; padding: 12px 16px 12px 12px; border: 1px solid var(--line); border-radius: 16px; background: #fff; text-decoration: none; transition: border-color .18s ease, box-shadow .18s ease; }
body .cpd .cpd-prow a:hover { border-color: var(--green-m); box-shadow: var(--shadow); }
body .cpd .cpd-prow a:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }
.cpd-prow__img { flex: none; width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--mint); }
.cpd-prow__img--none { display: grid; place-items: center; background: var(--green); color: #fff; font-weight: 800; }
.cpd-prow__text { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.cpd-prow__name { color: var(--green-d); font-size: 1rem; font-weight: 700; line-height: 1.35; }
.cpd-prow__role { color: var(--muted); font-size: .875rem; line-height: 1.4; }
.cpd-prow .cpd-ico { flex: none; width: 18px; height: 18px; fill: var(--green); transition: transform .18s ease; }
.cpd-prow a:hover .cpd-ico { transform: translateX(3px); }
.cpd-edcard__foot { margin-top: auto; padding-top: 26px; }
.cpd-edcard__foot .cpd-btn { margin: 0; }
@media (max-width: 639px) { body .cpd .cpd-edcard__foot .cpd-btn { width: 100%; justify-content: center; } }

/* ---------------------------------------------------------- blog cards --- */
/* Self-contained: also used on /blog/ (Elementor archive, without cpd.css). */
.cpd-bgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; margin: 0; padding: 0; }
@media (min-width: 700px) { .cpd-bgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) {
	.cpd-bgrid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 26px; }
	.cpd-bgrid > .cpd-bcard { grid-column: span 2; }
	/* Last row with two cards: they share the row; a lone last card is a wide horizontal card. */
	.cpd-bgrid > .cpd-bcard:nth-child(3n+1):nth-last-child(2),
	.cpd-bgrid > .cpd-bcard:nth-child(3n+2):last-child { grid-column: span 3; }
	.cpd-bgrid > .cpd-bcard:nth-child(3n+1):last-child { grid-column: 1 / -1; }
}
.cpd-bcard { position: relative; display: flex; flex-direction: column; min-width: 0; margin: 0; overflow: hidden; border: 1px solid #dbe6dc; border-radius: 18px; background: #fff; box-shadow: 0 1px 2px rgba(20, 50, 28, .05), 0 10px 28px rgba(20, 50, 28, .07); transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.cpd-bcard:hover { border-color: #367f3f; box-shadow: 0 2px 4px rgba(20, 50, 28, .06), 0 22px 50px rgba(20, 50, 28, .14); transform: translateY(-3px); }
.cpd-bcard:focus-within { outline: 3px solid #81bc2d; outline-offset: 3px; }
.cpd-bcard__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #e5eee4; }
.cpd-bcard__media picture { display: contents; }
.cpd-bcard__media source { display: none; }
.cpd-bcard .cpd-bcard__img { display: block; width: 100%; height: 100%; max-width: none; margin: 0; border-radius: 0; object-fit: cover; transition: transform .45s ease; }
.cpd-bcard:hover .cpd-bcard__img { transform: scale(1.04); }
.cpd-bcard__ph .cpd-ico { width: 28px; height: 28px; fill: #b5dc78; }
.cpd-bcard__ph { display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; height: 100%; padding: 18px 20px; background: linear-gradient(135deg, #1c4527 0%, #256b2e 55%, #81bc2d 130%); color: #fff; font-family: "Castoro", "Castoro Fallback", Georgia, serif; font-size: 1.375rem; line-height: 1.2; }
.cpd-bcard__body { display: flex; flex: 1; flex-direction: column; padding: 20px 22px 20px; }
.cpd-bcard .cpd-bcard__cat { align-self: flex-start; margin: 0 0 12px; padding: 4px 10px; border-radius: 999px; background: #f2f8ea; color: #256b2e; font-family: "Manrope", "Manrope Fallback", Arial, sans-serif; font-size: .6875rem; font-weight: 800; letter-spacing: .08em; line-height: 1.5; text-transform: uppercase; }
.cpd-bcard .cpd-bcard__title { display: -webkit-box; margin: 0 0 10px; overflow: hidden; color: #1c4527; font-family: "Castoro", "Castoro Fallback", Georgia, serif; font-size: 1.1875rem; font-weight: 400; letter-spacing: 0; line-height: 1.32; text-transform: none; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.cpd-bcard .cpd-bcard__title::before { display: none; }
.cpd-bcard .cpd-bcard__link,
.cpd-bcard .cpd-bcard__link:visited { color: inherit; text-decoration: none; }
.cpd-bcard .cpd-bcard__link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.cpd-bcard .cpd-bcard__link:focus-visible { outline: none; }
.cpd-bcard:hover .cpd-bcard__link { color: #256b2e; }
.cpd-bcard .cpd-bcard__ex { display: -webkit-box; margin: 0 0 16px; overflow: hidden; color: #50575b; font-family: "Manrope", "Manrope Fallback", Arial, sans-serif; font-size: .9375rem; line-height: 1.6; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; }
.cpd-bcard__foot { margin-top: auto; padding-top: 14px; border-top: 1px solid #e6eee4; }
.cpd-bcard .cpd-bcard__meta { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0; color: #5b6266; font-family: "Manrope", "Manrope Fallback", Arial, sans-serif; font-size: .8125rem; line-height: 1.5; }
.cpd-bcard .cpd-bcard__rev { display: flex; align-items: flex-start; gap: 6px; margin: 6px 0 0; color: #256b2e; font-family: "Manrope", "Manrope Fallback", Arial, sans-serif; font-size: .8125rem; font-weight: 600; line-height: 1.45; }
.cpd-bcard__rev .cpd-ico { flex: none; width: 16px; height: 16px; margin-top: 1px; fill: #256b2e; }
/* Tablet: an odd last card spans the row; desktop: a lone last card. Both read as a horizontal card. */
@media (min-width: 700px) and (max-width: 1023px) {
	.cpd-bgrid > .cpd-bcard:nth-child(odd):last-child { grid-column: 1 / -1; flex-direction: row; }
	.cpd-bgrid > .cpd-bcard:nth-child(odd):last-child .cpd-bcard__media { flex: 0 0 44%; aspect-ratio: auto; min-height: 220px; }
}
@media (min-width: 1024px) {
	.cpd-bgrid > .cpd-bcard:nth-child(3n+1):last-child { flex-direction: row; }
	.cpd-bgrid > .cpd-bcard:nth-child(3n+1):last-child .cpd-bcard__media { flex: 0 0 42%; aspect-ratio: auto; min-height: 240px; }
	.cpd-bgrid > .cpd-bcard:nth-child(3n+1):last-child .cpd-bcard__body { padding: 28px 32px; }
}
@media (prefers-reduced-motion: reduce) {
	.cpd-bcard, .cpd-bcard .cpd-bcard__img { transition: none; }
	.cpd-bcard:hover { transform: none; }
	.cpd-bcard:hover .cpd-bcard__img { transform: none; }
}

/* Homepage blogroll and Related Articles. */
.cpd-blogroll__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 40px; margin: 0 0 32px; }
.cpd-blogroll__head > div { max-width: 720px; }
body .cpd .cpd-blogroll__head p { margin: 0; color: var(--muted); font-size: 1.0625rem; }
body .cpd .cpd-blogroll__head .cpd-btn { margin: 0; }
.cpd-band--mint .cpd-bcard { border-color: #d5e3d2; }
body .cpd .cpd-relarticles h2 { margin-bottom: 28px; }

/* /blog/ listing (the Elementor posts widget's grid is replaced by .cpd-bgrid). */
body.blog.cpd-vfix2 .elementor-widget-posts .cpd-bgrid--listing { box-sizing: border-box; width: 100%; max-width: 1224px; margin: 0 auto 36px; padding: 0 20px; }
@media (min-width: 768px) { body.blog.cpd-vfix2 .elementor-widget-posts .cpd-bgrid--listing { padding: 0 32px; } }
body.blog.cpd-vfix2 .elementor-widget-posts .elementor-pagination { max-width: 1224px; margin-left: auto; margin-right: auto; }
