/*
 * Siebert type system: one readable, professional scale for the whole site.
 * Loaded last, so it settles anything the other stylesheets or Divi modules disagree about.
 *
 *   Body            Lato 17 / 1.7, ink on white (11:1)
 *   H1              Raleway 700, 30 -> 50 (set per page)
 *   H2 section      Raleway 700, 26 -> 34 / 1.2
 *   H3              Raleway 700, 21 -> 24 / 1.3
 *   H4 / card title Raleway 700, 18 -> 20 / 1.3
 *   H5 / accordion  Raleway 600, 17 / 1.35
 *   Labels          Raleway 600 caps, 12.5+ with 4.5:1 contrast
 *
 * Blues were deepened one step so text, links, outline buttons and white-on-blue
 * all reach WCAG AA (4.5:1). Decorative lines and the light mist keep their tone.
 */
:root {
	--sb-steel: #3f6c8a;   /* text, links, headings: 5.6:1 on white, 5.2:1 on tint */
	--sb-dusty: #4d7a98;   /* surfaces that carry white text: 4.6:1 */
	--sb-muted: #566573;   /* secondary text: 6.0:1 */
}

/* ---------- Body copy ---------- */
body.sb-brand #et-main-area :is(p, li, dd, dt):not(#dsidx *):not(.sb-kit *):not(.dsm_card_carousel *) { line-height: 1.7; }
body.sb-brand #et-main-area :is(.et_pb_text_inner, .entry-content) > :is(p, ul, ol):not(#dsidx *):not(.sb-kit *) { font-size: 17px; }
body.sb-brand #et-main-area :is(.et_pb_text_inner, .entry-content) :is(ul, ol):not(#dsidx *) li { margin-bottom: .35em; }

/* Long lines tire the eye: cap reading width on the information pages. */
body.sb-brand:is(.page-id-1594, .page-id-607, .page-id-621, .page-id-614, .page-id-30) :is(.et_pb_text_inner, .entry-content) > :is(p, ul, ol) { max-width: 76ch; }

/* Links inside running text are underlined, so they never rely on colour alone. */
body.sb-brand #et-main-area :is(.et_pb_text_inner, .entry-content) :is(p, li) a:not(.et_pb_button):not([class*="sb-"]):not(.sb-backtop):not(.dsm_card_carousel a) {
	text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
}

/* ---------- Headings ---------- */
body.sb-brand #page-container :is(h1, h2, h3, h4, h5, h6) { text-transform: none; letter-spacing: 0; overflow-wrap: break-word; }

/* H2 section titles (script lettering retired: it was hard to read at any size) */
body.sb-brand #page-container #et-main-area :is(
	.et_pb_heading h2,
	.et_pb_text_inner > h2,
	.dsm-text-divider-wrapper h2.dsm-text-divider-header,
	.dsm-text-divider-wrapper h2.dsm-text-divider-header span
) {
	font-family: var(--sb-head) !important;
	font-size: clamp(26px, 1.2vw + 21px, 34px) !important;
	font-weight: 700 !important;
	line-height: 1.2 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	text-shadow: none !important;
}
/* Service-card titles on the home page are H2 in the markup but card titles by role. */
body.sb-brand.home #page-container #et-main-area .et_pb_section_2 .et_pb_heading h2 {
	text-shadow: none !important;
	font-size: clamp(19px, .6vw + 16px, 22px) !important;
	letter-spacing: .04em !important;
	text-transform: uppercase !important;
	line-height: 1.3 !important;
}
body.sb-brand #page-container .et_pb_section.sb-band-dusty :is(h1, h2, h3, h4, h5),
body.sb-brand.home .et_pb_section_4 :is(h1, h2, h3, h4, h5) { font-weight: 600 !important; letter-spacing: .03em !important; line-height: 1.3 !important; }

/* Thin-weight headings on dark bands read poorly: use a firm weight. */
body.sb-brand.home .et_pb_section_3 h2:first-of-type { font-weight: 600 !important; line-height: 1.2 !important; }
body.sb-brand.home .et_pb_section_3 h2 { line-height: 1.2 !important; }

/* H3 */
body.sb-brand #page-container #et-main-area :is(.et_pb_blurb h3, .et_pb_text_inner > h3, .entry-content > h3) {
	font-size: clamp(20px, .6vw + 17px, 23px) !important;
	font-weight: 700 !important;
	line-height: 1.3 !important;
	letter-spacing: 0 !important;
}
body.sb-brand.home #et-main-area .et_pb_section_4 .et_pb_text_inner > h3 { font-size: clamp(21px, 1vw + 16px, 26px) !important; text-transform: none !important; letter-spacing: .01em !important; }
body.sb-brand.home #page-container #et-main-area .et_pb_section_5 .et_pb_blurb h3 { text-transform: none !important; }

/* H4 and card titles */
body.sb-brand #page-container #et-main-area :is(.et_pb_blurb h4, h4.dsm_card_title, h2.dsm-entry-title, .dsm-entry-title a) {
	font-size: clamp(18px, .35vw + 16.5px, 20px) !important;
	font-weight: 700 !important;
	line-height: 1.3 !important;
	letter-spacing: 0 !important;
}
body.sb-brand #page-container :is(.et_pb_widget, .fwidget, #sidebar) h4 { font-size: 18px; line-height: 1.3; font-weight: 700; }

/* Accordion questions (FAQ) */
body.sb-brand #et-main-area h5.et_pb_toggle_title,
body.sb-brand #et-main-area .et_pb_toggle_title { font-size: 17px !important; font-weight: 600 !important; line-height: 1.4 !important; letter-spacing: 0 !important; }
body.sb-brand #et-main-area .et_pb_toggle_content { font-size: 16.5px; line-height: 1.7; }

/* Contact heading in the footer strip */
body.sb-brand :is(.et_pb_text_0_tb_footer, .et_pb_row_0_tb_footer) :is(h1, h2, h3, h4) { font-size: clamp(19px, 1vw + 15px, 24px) !important; line-height: 1.3 !important; font-weight: 700 !important; }

/* ---------- Small text floors ---------- */
/* Team cards */
body.sb-brand .dsm_card_carousel .dsm_card_carousel_child_badge_text { font-size: 11.5px !important; line-height: 1.25 !important; white-space: nowrap; left: 8px !important; bottom: 8px !important; padding: 4px 9px !important; }
body.sb-brand .dsm_card_carousel .dsm_card_carousel_child .et_pb_module_inner { grid-template-columns: 128px minmax(0, 1fr); }
body.sb-brand .dsm_card_carousel .dsm_card_carousel_child_description p { font-size: 15px; }
body.sb-brand .dsm_card_carousel .dsm_card_carousel_child_description a[href^="mailto:"] { font-size: 14px; }
body.sb-brand .dsm_card_carousel .et_pb_button_wrapper .et_pb_button { font-size: 14px !important; }

@media (max-width: 680px) {
	body.sb-brand .dsm_card_carousel .dsm_card_carousel_child .et_pb_module_inner { grid-template-columns: 108px minmax(0, 1fr); }
	body.sb-brand .dsm_card_carousel .dsm_card_carousel_child_badge_text { font-size: 11px !important; padding: 3px 8px !important; left: 6px !important; bottom: 6px !important; }
}

/* Form labels and helper text */
body.sb-brand #et-main-area label:not(#dsidx *),
body.sb-brand .et_pb_blurb_0 label { color: var(--sb-muted) !important; font-size: 12.5px !important; letter-spacing: .05em; }

/* Checkbox / inline labels read as sentences, not caps tags. */
body.sb-brand label:has(input[type="checkbox"]), body.sb-brand label:has(input[type="radio"]), body.sb-brand input[type="checkbox"] + label, body.sb-brand label.tml-label + * label { font-size: 14px !important; letter-spacing: 0 !important; }
body.sb-brand .tml-rememberme-wrap label, body.sb-brand .tml-field-wrap label[for*="remember"] { font-size: 14px !important; letter-spacing: 0 !important; }

/* Header utility bar and menu */
#sb-topbar { font-size: 13.5px; }
.sb-menu > li > a { color: var(--sb-muted); }
.sb-btn-outline { color: var(--sb-muted) !important; }

/* Listing search and detail pages */
body.sb-brand #dsidx { line-height: 1.6; }
body.sb-brand #dsidx :is(th, td) { line-height: 1.45; }
body.sb-brand #dsidx th, body.sb-brand #dsidx table th { font-size: 12.5px !important; line-height: 1.4 !important; }
body.sb-brand #dsidx :is(.col-5, .col-7, .col-12).p-1, body.sb-brand #dsidx .col-12.text-center { font-size: 13.5px !important; }
body.sb-brand #dsidx :is(.dsidx-result-line-small, .dsidx-secondary-data-line, .dsidx-result-line-small span) { font-size: 14px !important; line-height: 1.5 !important; }
body.sb-brand #dsidx :is(span, div):not([class]):not(:has(*)) { font-size: max(13.5px, 1em); }
body.sb-brand #dsidx :is(.dsidx-disclaimer, .details-tab-schoolinfo-districts-disclaimer, .dsidx-broker-attribution, .dsidx-footer p, .dsidx-footer div) { font-size: 12.5px; line-height: 1.55; color: #3f4e5b; }
body.sb-brand #dsidx .sb-mls { font-size: 12.5px; color: var(--sb-steel); }
body.sb-brand #dsidx .dsidx-header-title { font-family: var(--sb-head) !important; font-size: 13px; letter-spacing: .06em; }
body.sb-brand #dsidx .dsidx-navbar-contact, body.sb-brand #dsidx .dsidx-navbar-share { font-size: 14px !important; }

/* Link/body copy inside the home hero blurb and service blurbs */
body.sb-brand.home .et_pb_blurb .et_pb_blurb_description, body.sb-brand.home .et_pb_blurb_description p { line-height: 1.55; }
body.sb-brand #et-main-area .et_pb_blurb_description :is(span, p) { line-height: 1.5; }

/* Phones: slightly roomier body */
@media (max-width: 600px) {
	body.sb-brand #et-main-area :is(.et_pb_text_inner, .entry-content) > :is(p, ul, ol):not(#dsidx *):not(.sb-kit *) { font-size: 16.5px; }
}

/* Balanced line breaks: no single orphan word on a heading's last line. */
body.sb-brand #page-container :is(h1, h2, h3, h4) { text-wrap: balance; }
body.sb-brand #et-main-area :is(.et_pb_text_inner, .entry-content) > p { text-wrap: pretty; }
