/*
Theme Name: Meredith Sherwood
Theme URI: https://meredithsherwood.com
Author: WH&A
Description: Custom theme for Meredith Sherwood, Denton County listing agent. Ports the Meredith Sherwood Design System (liquid glass, Quicksand/Rouge Script, hot pink / warm black) with server-rendered JSON-LD and no page-builder dependency.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 8.1
License: Proprietary
Text Domain: meredith
*/

/* ==========================================================================
   1. Fonts
   ========================================================================== */

@font-face {
  font-family: "Quicksand";
  src: url("assets/fonts/quicksand-var.woff2") format("woff2-variations"),
       url("assets/fonts/quicksand-var.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Rouge Script";
  src: url("assets/fonts/rouge-script.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ==========================================================================
   2. Tokens — ported 1:1 from the design system. Do not invent new hues.
   ========================================================================== */

:root {
  /* Locked brand palette */
  --pink-500: #FF46A2;
  --ink-900: #190A12;
  --white: #FFFFFF;

  --pink-100: color-mix(in oklch, var(--pink-500) 14%, white);
  --pink-200: color-mix(in oklch, var(--pink-500) 30%, white);
  --pink-300: color-mix(in oklch, var(--pink-500) 55%, white);
  --pink-400: color-mix(in oklch, var(--pink-500) 80%, white);
  --pink-600: color-mix(in oklch, var(--pink-500) 85%, black);
  --pink-700: color-mix(in oklch, var(--pink-500) 65%, black);

  --ink-800: color-mix(in oklch, var(--ink-900) 88%, white);
  --ink-600: color-mix(in oklch, var(--ink-900) 60%, white);
  --ink-400: color-mix(in oklch, var(--ink-900) 38%, white);
  --ink-200: color-mix(in oklch, var(--ink-900) 16%, white);
  --ink-100: color-mix(in oklch, var(--ink-900) 6%, white);

  --surface-page: var(--white);
  --surface-dark: var(--ink-900);
  --surface-sunken: var(--ink-100);
  --text-primary: var(--ink-900);
  --text-secondary: var(--ink-600);
  --text-on-dark: var(--white);
  --text-on-dark-muted: color-mix(in oklch, var(--white) 70%, transparent);
  --border-subtle: color-mix(in oklch, var(--ink-900) 10%, white);
  --border-on-dark: color-mix(in oklch, var(--white) 22%, transparent);
  --action-primary: var(--pink-500);

  --font-body: "Quicksand", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-script: "Rouge Script", "Brush Script MT", cursive;

  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --text-3xl: 2.75rem;
  --text-4xl: 3.75rem;

  --leading-tight: 1.08;
  --leading-snug: 1.25;
  --leading-normal: 1.55;

  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --tracking-wider: 0.12em;

  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;
  --space-9: 96px; --space-10: 128px;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --content-max: 1200px;
  --measure: 68ch;
  --gutter: clamp(20px, 5vw, 64px);

  --glass-bg-light: color-mix(in oklch, var(--white) 55%, transparent);
  --glass-bg-dark: color-mix(in oklch, var(--white) 14%, transparent);
  --glass-bg-pink: color-mix(in oklch, var(--pink-500) 78%, transparent);
  --glass-border-light: color-mix(in oklch, var(--white) 65%, transparent);
  --glass-border-dark: color-mix(in oklch, var(--white) 30%, transparent);
  --glass-blur: 18px;
  --glass-blur-strong: 28px;

  --shadow-sm: 0 2px 8px color-mix(in oklch, var(--ink-900) 10%, transparent);
  --shadow-md: 0 8px 24px color-mix(in oklch, var(--ink-900) 14%, transparent);
  --shadow-lg: 0 24px 60px color-mix(in oklch, var(--ink-900) 22%, transparent);
  --shadow-glass: 0 8px 32px color-mix(in oklch, var(--ink-900) 18%, transparent),
                  inset 0 1px 0 color-mix(in oklch, var(--white) 60%, transparent);
  --shadow-pink-glow: 0 10px 30px color-mix(in oklch, var(--pink-500) 45%, transparent);

  --ease-standard: cubic-bezier(.22, .61, .36, 1);
  --duration-fast: 150ms;
  --duration-base: 240ms;

  --callbar-h: 0px;
}

/* ==========================================================================
   3. Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: var(--weight-medium);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: var(--surface-page);
  text-wrap: pretty;
  overflow-x: hidden;
  padding-bottom: var(--callbar-h);
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: var(--weight-bold);
  letter-spacing: -0.01em;
  line-height: var(--leading-snug);
  text-wrap: balance;
}

h1 { font-size: clamp(2.1rem, 5vw, var(--text-4xl)); line-height: var(--leading-tight); }
h2 { font-size: clamp(1.7rem, 3.6vw, var(--text-3xl)); line-height: var(--leading-tight); }
h3 { font-size: clamp(1.25rem, 2.2vw, var(--text-xl)); }
h4 { font-size: var(--text-lg); }

p { margin: 0; }

a { color: var(--pink-700); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--pink-600); }

img, svg, video { max-width: 100%; height: auto; display: block; }

button, input, select, textarea { font-family: inherit; font-size: inherit; }

:focus-visible {
  outline: 3px solid var(--pink-500);
  outline-offset: 2px;
  border-radius: 4px;
}

.ms-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.ms-skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink-900); color: var(--white);
  padding: 12px 20px; border-radius: 0 0 var(--radius-sm) 0; text-decoration: none;
}
.ms-skip:focus { left: 0; }

/* ==========================================================================
   4. Layout primitives
   ========================================================================== */

.ms-wrap { width: 100%; max-width: var(--content-max); margin-inline: auto; padding-inline: var(--gutter); }
.ms-wrap--narrow { max-width: 820px; }

.ms-section { padding-block: clamp(56px, 8vw, var(--space-9)); }
.ms-section--tight { padding-block: clamp(40px, 5vw, var(--space-8)); }
.ms-section--sunken { background: var(--surface-sunken); }
.ms-section--dark { background: var(--surface-dark); color: var(--text-on-dark); }
.ms-section--dark h1, .ms-section--dark h2, .ms-section--dark h3 { color: var(--text-on-dark); }
.ms-section--dark p { color: var(--text-on-dark-muted); }
.ms-section--dark a { color: var(--pink-300); }

.ms-grid { display: grid; gap: var(--space-5); }
@media (min-width: 700px)  { .ms-grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 700px)  { .ms-grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .ms-grid--3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 700px)  { .ms-grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .ms-grid--4 { grid-template-columns: repeat(4, 1fr); } }

/* ==========================================================================
   5. Typography helpers
   ========================================================================== */

/* The site's "bold": one word per heading in Rouge Script + hot pink. */
.ms-accent {
  font-family: var(--font-script);
  color: var(--pink-500);
  font-size: 1.35em;
  line-height: 1;
  font-weight: 400;
  letter-spacing: 0;
  /* Script descenders need breathing room so they do not clip. */
  padding-inline: 0.04em;
}
.ms-section--dark .ms-accent { color: var(--pink-400); }

.ms-kicker {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--pink-600);
  margin-bottom: var(--space-2);
}
.ms-section--dark .ms-kicker { color: var(--pink-400); }

.ms-lede { font-size: var(--text-lg); color: var(--text-secondary); line-height: var(--leading-normal); }
.ms-section--dark .ms-lede { color: var(--text-on-dark-muted); }

.ms-heading { margin-bottom: var(--space-5); }
.ms-heading--center { text-align: center; max-width: 680px; margin-inline: auto; }
.ms-heading p { margin-top: var(--space-3); color: var(--text-secondary); }

/* ==========================================================================
   6. Buttons
   ========================================================================== */

.ms-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  padding: 13px 26px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: transform var(--duration-fast) var(--ease-standard),
              box-shadow var(--duration-base) var(--ease-standard),
              background var(--duration-base) var(--ease-standard);
  will-change: transform;
}
.ms-btn:hover { transform: translateY(-1px) scale(1.01); text-decoration: none; }
.ms-btn:active { transform: scale(.97); }
.ms-btn--lg { padding: 17px 32px; font-size: var(--text-base); }
.ms-btn--sm { padding: 9px 19px; font-size: var(--text-xs); }
.ms-btn--block { width: 100%; }

.ms-btn--pink {
  background: var(--glass-bg-pink);
  color: var(--white);
  border-color: color-mix(in oklch, var(--white) 35%, transparent);
  box-shadow: var(--shadow-pink-glow);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
}
.ms-btn--pink:hover { color: var(--white); background: color-mix(in oklch, var(--pink-500) 90%, transparent); }

.ms-btn--light {
  background: var(--glass-bg-light);
  color: var(--ink-900);
  border-color: var(--glass-border-light);
  box-shadow: var(--shadow-glass);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
}
.ms-btn--light:hover { color: var(--ink-900); }

.ms-btn--dark {
  background: var(--glass-bg-dark);
  color: var(--white);
  border-color: var(--glass-border-dark);
  box-shadow: var(--shadow-glass);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
}
.ms-btn--dark:hover { color: var(--white); }

.ms-btn--ghost { background: transparent; color: var(--ink-900); border-color: var(--border-subtle); }
.ms-btn--ghost:hover { color: var(--ink-900); border-color: var(--pink-400); }

.ms-btn__icon { display: inline-block; transition: transform var(--duration-base) var(--ease-standard); }
.ms-btn:hover .ms-btn__icon { transform: translateX(3px); }

.ms-btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* ==========================================================================
   7. Glass surfaces
   ========================================================================== */

.ms-glass {
  background: var(--glass-bg-light);
  border: 1px solid var(--glass-border-light);
  border-radius: var(--radius-lg);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-glass);
  padding: var(--space-5);
}
.ms-glass--dark {
  background: var(--glass-bg-dark);
  border-color: var(--glass-border-dark);
  color: var(--white);
}

.ms-card {
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-base) var(--ease-standard),
              box-shadow var(--duration-base) var(--ease-standard);
}
.ms-card h3 { margin-bottom: var(--space-2); }
.ms-card p { color: var(--text-secondary); font-size: var(--text-sm); }

a.ms-card, .ms-card--link { display: block; text-decoration: none; color: inherit; }
a.ms-card:hover, .ms-card--link:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--pink-300);
  text-decoration: none;
  color: inherit;
}
.ms-card__more { display: inline-flex; align-items: center; gap: 6px; margin-top: var(--space-4); color: var(--pink-700); font-weight: var(--weight-semibold); font-size: var(--text-sm); }

/* ==========================================================================
   8. Badges / trust strip
   ========================================================================== */

.ms-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--glass-bg-light);
  border: 1px solid var(--glass-border-light);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-glass);
  color: var(--ink-900);
  font-size: var(--text-xs);
}
.ms-badge--dark { background: var(--glass-bg-dark); border-color: var(--glass-border-dark); color: var(--white); }
.ms-badge__icon {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
  background: var(--pink-500); color: var(--white);
  font-size: 11px; font-weight: var(--weight-bold); line-height: 1;
}
.ms-badge__label { display: block; font-weight: var(--weight-semibold); line-height: 1.15; }
.ms-badge__sub { display: block; font-size: 10px; opacity: .75; line-height: 1.3; }

.ms-badge-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* Trust strip — sits under the hero CTA on area + service pages */
.ms-trust {
  display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5);
  align-items: center;
  font-size: var(--text-xs);
  color: var(--text-on-dark-muted);
}
.ms-trust li { display: flex; align-items: center; gap: 7px; }
.ms-trust ul { display: contents; }
.ms-trust__dot { width: 5px; height: 5px; border-radius: 50%; background: var(--pink-500); flex-shrink: 0; }

/* ==========================================================================
   9. Header / nav
   ========================================================================== */

.ms-header {
  position: absolute;
  inset-inline: 0;
  top: 0;
  z-index: 60;
  padding: 18px var(--gutter);
}
.ms-header--solid {
  position: sticky;
  background: color-mix(in oklch, var(--ink-900) 97%, transparent);
  padding-block: 12px;
}

.ms-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  max-width: var(--content-max);
  margin-inline: auto;
  padding: 10px 10px 10px 20px;
  border-radius: var(--radius-pill);
  background: var(--glass-bg-dark);
  border: 1px solid var(--glass-border-dark);
  -webkit-backdrop-filter: blur(var(--glass-blur-strong));
  backdrop-filter: blur(var(--glass-blur-strong));
  box-shadow: var(--shadow-glass);
}

.ms-nav__brand {
  font-family: var(--font-script);
  font-size: var(--text-lg);
  color: var(--white);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.1;
  flex-shrink: 0;
}
.ms-nav__brand:hover { color: var(--white); text-decoration: none; }

/* Links are the one element allowed to shrink (via a smaller font at the
   breakpoint below) — brand and actions stay fixed so nothing overflows the
   pill's rounded edge. */
.ms-nav__links {
  display: none; align-items: center; gap: var(--space-3);
  list-style: none; margin: 0; padding: 0; min-width: 0; overflow: hidden;
}
@media (min-width: 1040px) { .ms-nav__links { display: flex; } }
@media (min-width: 1200px) { .ms-nav__links { gap: var(--space-4); } }

.ms-nav__links a {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-on-dark-muted);
  text-decoration: none;
  white-space: nowrap;
  padding-block: 6px;
  transition: color var(--duration-fast) var(--ease-standard);
}
@media (min-width: 1200px) { .ms-nav__links a { font-size: var(--text-sm); } }

.ms-nav__links a:hover,
.ms-nav__links .current-menu-item > a,
.ms-nav__links .current-menu-ancestor > a { color: var(--white); }

.ms-nav__actions { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }
.ms-nav__cta { display: none; }
@media (min-width: 700px) { .ms-nav__cta { display: inline-flex; padding: 9px 18px; font-size: var(--text-xs); } }
@media (min-width: 1200px) { .ms-nav__cta { padding: 10px 22px; font-size: var(--text-sm); } }

.ms-nav__toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  border-radius: 50%;
  background: var(--glass-bg-dark);
  border: 1px solid var(--glass-border-dark);
  color: var(--white); cursor: pointer;
}
@media (min-width: 1040px) { .ms-nav__toggle { display: none; } }
.ms-nav__toggle span { display: block; width: 18px; height: 2px; background: currentColor; position: relative; }
.ms-nav__toggle span::before, .ms-nav__toggle span::after {
  content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: currentColor;
}
.ms-nav__toggle span::before { top: -6px; }
.ms-nav__toggle span::after { top: 6px; }

/* Mobile drawer */
.ms-drawer {
  position: fixed; inset: 0; z-index: 100;
  background: color-mix(in oklch, var(--ink-900) 97%, transparent);
  -webkit-backdrop-filter: blur(var(--glass-blur-strong));
  backdrop-filter: blur(var(--glass-blur-strong));
  padding: var(--space-6) var(--gutter);
  overflow-y: auto;
  display: none;
}
.ms-drawer[data-open="true"] { display: block; }
.ms-drawer__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-7); }
.ms-drawer__close {
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  background: var(--glass-bg-dark); border: 1px solid var(--glass-border-dark);
  color: var(--white); font-size: 22px; line-height: 1;
}
.ms-drawer ul { list-style: none; margin: 0 0 var(--space-6); padding: 0; }
.ms-drawer li { border-bottom: 1px solid var(--border-on-dark); }
.ms-drawer li a {
  display: block; padding: 16px 2px;
  color: var(--white); font-size: var(--text-lg); font-weight: var(--weight-semibold); text-decoration: none;
}
.ms-drawer .sub-menu { margin: 0 0 var(--space-3) var(--space-4); }
.ms-drawer .sub-menu li { border-bottom: none; }
.ms-drawer .sub-menu a { font-size: var(--text-base); font-weight: var(--weight-medium); color: var(--text-on-dark-muted); padding: 9px 2px; }
body.ms-drawer-open { overflow: hidden; }

/* ==========================================================================
   10. Hero
   ========================================================================== */

.ms-hero {
  position: relative;
  isolation: isolate;
  background: var(--ink-900);
  color: var(--white);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 620px;
  padding-top: 128px;
}
.ms-hero--home { min-height: min(92vh, 900px); }

/* Layer 1: the house photo */
.ms-hero__bg {
  position: absolute; inset: 0; z-index: -3;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 60%;
}
/* Layer 2: dark overlay. Two gradients rather than one — a lighter overall
   wash so the house is actually legible (it is a real estate site), plus a
   heavier scrim on the left where the headline sits, which is what carries the
   AA contrast. Lightening the wash alone would have failed contrast. */
.ms-hero::before {
  content: "";
  position: absolute; inset: 0; z-index: -2;
  background:
    linear-gradient(90deg,
      rgba(14, 5, 9, .72) 0%,
      rgba(14, 5, 9, .45) 42%,
      rgba(14, 5, 9, 0) 70%),
    linear-gradient(160deg,
      rgba(58, 20, 40, .80) 0%,
      rgba(25, 10, 18, .84) 55%,
      rgba(14, 5, 9, .90) 100%);
}
/* Layer 3: hot pink gradient bloom, per the design system */
.ms-hero::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(90% 70% at 12% 88%, color-mix(in oklch, var(--pink-500) 34%, transparent) 0%, transparent 62%),
    radial-gradient(60% 50% at 92% 8%, color-mix(in oklch, var(--pink-500) 20%, transparent) 0%, transparent 70%);
  mix-blend-mode: screen;
  opacity: .85;
  pointer-events: none;
}

.ms-hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding: 0 var(--gutter) clamp(48px, 7vw, 88px);
  display: grid;
  gap: var(--space-6);
}
@media (min-width: 900px) {
  .ms-hero__inner { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: end; }
}

.ms-hero__copy { max-width: 620px; }
.ms-hero__copy h1 { color: var(--white); margin-bottom: var(--space-4); }
.ms-hero__sub {
  font-size: clamp(1rem, 1.5vw, var(--text-lg));
  color: rgba(255, 255, 255, .82);
  line-height: var(--leading-normal);
  margin-bottom: var(--space-6);
  max-width: 52ch;
}
.ms-hero__cta { margin-bottom: var(--space-5); }
.ms-hero__badges { margin-bottom: var(--space-4); }

/* Meredith cutout, anchored to the hero baseline */
.ms-hero__figure {
  position: relative;
  justify-self: center;
  align-self: end;
  margin-bottom: calc(clamp(48px, 7vw, 88px) * -1);
  pointer-events: none;
}
.ms-hero__figure img {
  width: auto;
  max-height: min(62vh, 560px);
  filter: drop-shadow(0 30px 50px rgba(0, 0, 0, .45));
}
@media (max-width: 899px) {
  .ms-hero__figure { display: none; }
}

/* Interior (non-home) hero: no figure, shorter */
.ms-hero--page { min-height: 460px; }
.ms-hero--page .ms-hero__inner { grid-template-columns: 1fr; }
.ms-hero--page .ms-hero__copy { max-width: 780px; }

/* ==========================================================================
   11. Breadcrumbs
   ========================================================================== */

.ms-crumbs { font-size: var(--text-xs); margin-bottom: var(--space-4); color: rgba(255, 255, 255, .62); }
.ms-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.ms-crumbs a { color: rgba(255, 255, 255, .78); text-decoration: none; }
.ms-crumbs a:hover { color: var(--white); text-decoration: underline; }
.ms-crumbs li + li::before { content: "/"; margin-right: 6px; opacity: .5; }

/* ==========================================================================
   12. Prose (post_content)
   ========================================================================== */

.ms-prose { max-width: var(--measure); font-size: var(--text-base); line-height: var(--leading-normal); }
.ms-prose > * + * { margin-top: var(--space-5); }
.ms-prose h2 { margin-top: var(--space-8); }
.ms-prose h3 { margin-top: var(--space-6); }
.ms-prose h2 + p, .ms-prose h3 + p { margin-top: var(--space-3); }
.ms-prose ul, .ms-prose ol { padding-left: 1.25em; }
.ms-prose li + li { margin-top: var(--space-2); }
.ms-prose li::marker { color: var(--pink-500); }
.ms-prose strong { font-weight: var(--weight-bold); }
.ms-prose a { color: var(--pink-700); font-weight: var(--weight-semibold); }

.ms-prose blockquote,
.ms-callout {
  margin-inline: 0;
  padding: var(--space-5) var(--space-6);
  background: var(--pink-100);
  border-left: 3px solid var(--pink-500);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: var(--text-base);
}
.ms-callout__label {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--pink-700);
  margin-bottom: var(--space-2);
}

/* Data tables — used heavily on the cost/fee guides */
.ms-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ms-prose table, .ms-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  min-width: 520px;
}
.ms-prose th, .ms-table th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  background: var(--ink-900);
  color: var(--white);
  font-weight: var(--weight-semibold);
  font-size: var(--text-xs);
  letter-spacing: .03em;
  text-transform: uppercase;
}
.ms-prose th:first-child, .ms-table th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.ms-prose th:last-child,  .ms-table th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }
.ms-prose td, .ms-table td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-subtle); }
.ms-prose tbody tr:nth-child(even), .ms-table tbody tr:nth-child(even) { background: var(--surface-sunken); }

/* ==========================================================================
   13. FAQ (accordion, also the FAQPage schema source)
   ========================================================================== */

.ms-faq { display: grid; gap: var(--space-3); max-width: 860px; }
.ms-faq details {
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--duration-base) var(--ease-standard);
}
.ms-faq details[open] { border-color: var(--pink-300); }
.ms-faq summary {
  cursor: pointer;
  list-style: none;
  padding: var(--space-5) var(--space-6);
  font-weight: var(--weight-semibold);
  font-size: var(--text-base);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
}
.ms-faq summary::-webkit-details-marker { display: none; }
.ms-faq summary::after {
  content: "+";
  flex-shrink: 0;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--pink-100);
  color: var(--pink-700);
  font-size: var(--text-lg);
  line-height: 1;
  transition: transform var(--duration-base) var(--ease-standard);
}
.ms-faq details[open] summary::after { content: "\2212"; transform: rotate(180deg); }
.ms-faq__body { padding: 0 var(--space-6) var(--space-5); color: var(--text-secondary); font-size: var(--text-sm); }
.ms-faq__body > * + * { margin-top: var(--space-3); }

/* ==========================================================================
   14. Process steps / stats
   ========================================================================== */

.ms-step { display: flex; gap: var(--space-4); }
.ms-step__num {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--pink-100); color: var(--pink-700);
  font-weight: var(--weight-bold); font-size: var(--text-lg);
}
.ms-section--dark .ms-step__num { background: color-mix(in oklch, var(--pink-500) 24%, transparent); color: var(--white); }
.ms-step__title { font-weight: var(--weight-bold); font-size: var(--text-lg); margin-bottom: var(--space-1); }
.ms-step__body { color: var(--text-secondary); font-size: var(--text-sm); }
.ms-section--dark .ms-step__body { color: var(--text-on-dark-muted); }

.ms-stat__value { font-size: var(--text-3xl); font-weight: var(--weight-bold); line-height: 1; }
.ms-stat__label { font-size: var(--text-xs); margin-top: 6px; color: var(--text-secondary); }
.ms-section--dark .ms-stat__label { color: var(--text-on-dark-muted); }

/* ==========================================================================
   15. Forms — Go High Level embed
   ========================================================================== */

/* The GHL iframe renders its own light UI, so it gets a white card to sit on
   rather than floating as a bare rectangle on the dark CTA band. */
.ms-formcard {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  padding: var(--space-2);
}
.ms-formcard iframe {
  display: block;
  width: 100%;
  min-height: 892px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--white);
}
.ms-formcard__fallback {
  padding: var(--space-6);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* ==========================================================================
   16. CTA band
   ========================================================================== */

.ms-cta {
  position: relative;
  isolation: isolate;
  background: var(--ink-900);
  color: var(--white);
  overflow: hidden;
}
.ms-cta::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(80% 90% at 15% 100%, color-mix(in oklch, var(--pink-500) 30%, transparent) 0%, transparent 65%);
  pointer-events: none;
}
.ms-cta h2 { color: var(--white); }
.ms-cta p { color: var(--text-on-dark-muted); }
.ms-cta__grid { display: grid; gap: var(--space-7); align-items: center; }
@media (min-width: 900px) { .ms-cta__grid { grid-template-columns: 1fr 1fr; gap: var(--space-9); } }

/* ==========================================================================
   17. Link clusters (internal linking blocks)
   ========================================================================== */

.ms-linkgrid { display: grid; gap: var(--space-3); }
@media (min-width: 620px) { .ms-linkgrid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .ms-linkgrid--3 { grid-template-columns: repeat(3, 1fr); } }

.ms-linkgrid a {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  transition: border-color var(--duration-base) var(--ease-standard), transform var(--duration-base) var(--ease-standard);
}
.ms-linkgrid a::after { content: "→"; color: var(--pink-500); flex-shrink: 0; }
.ms-linkgrid a:hover { border-color: var(--pink-400); transform: translateX(2px); color: var(--text-primary); }

.ms-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; margin: 0; padding: 0; }
.ms-chips a {
  display: inline-block;
  padding: 7px 15px;
  border-radius: var(--radius-pill);
  background: var(--surface-sunken);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-decoration: none;
}
.ms-chips a:hover { background: var(--pink-100); border-color: var(--pink-300); color: var(--pink-700); }
.ms-section--dark .ms-chips a { background: var(--glass-bg-dark); border-color: var(--glass-border-dark); color: var(--white); }
.ms-section--dark .ms-chips a:hover { background: color-mix(in oklch, var(--pink-500) 30%, transparent); }

/* ==========================================================================
   18. Sticky mobile call bar
   ========================================================================== */

@media (max-width: 899px) {
  :root { --callbar-h: 68px; }
  .ms-callbar {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 90;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: color-mix(in oklch, var(--ink-900) 96%, transparent);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border-top: 1px solid var(--border-on-dark);
  }
  .ms-callbar .ms-btn { width: 100%; padding-block: 13px; }
}
@media (min-width: 900px) { .ms-callbar { display: none; } }

/* ==========================================================================
   19. Footer
   ========================================================================== */

.ms-footer { background: var(--ink-900); color: var(--text-on-dark-muted); padding-block: var(--space-8) var(--space-6); font-size: var(--text-sm); }
.ms-footer a { color: rgba(255, 255, 255, .8); text-decoration: none; }
.ms-footer a:hover { color: var(--white); text-decoration: underline; }
.ms-footer h4 { color: var(--white); font-size: var(--text-xs); letter-spacing: var(--tracking-wider); text-transform: uppercase; margin-bottom: var(--space-4); }
.ms-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }

.ms-footer__top { display: grid; gap: var(--space-7); }
@media (min-width: 760px)  { .ms-footer__top { grid-template-columns: 1.4fr 1fr 1fr; } }
@media (min-width: 1040px) { .ms-footer__top { grid-template-columns: 1.5fr 1fr 1fr 1fr; } }

.ms-footer__brand { font-family: var(--font-script); font-size: var(--text-2xl); color: var(--white); display: block; margin-bottom: var(--space-3); }
.ms-footer__nap { font-style: normal; line-height: 1.7; }
.ms-footer__nap a { color: var(--pink-300); }

.ms-footer__logo { width: 64px; height: 64px; border-radius: var(--radius-sm); margin-bottom: var(--space-4); }

/* Compliance block — TREC + KW requirements. 11px is above the 8pt minimum. */
.ms-compliance {
  border-top: 1px solid var(--border-on-dark);
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  font-size: 11px;
  line-height: var(--leading-normal);
  color: rgba(255, 255, 255, .62);
}
.ms-compliance > * + * { margin-top: 7px; }
/* TREC 531.20(b) requires the IABS link at >= 10pt. 13.4px ~= 10pt. */
.ms-compliance__legal { font-size: 13.4px; }
.ms-compliance__legal a { color: var(--pink-300); text-decoration: underline; }
.ms-compliance__eho { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.ms-compliance__eho svg { flex-shrink: 0; }

/* ==========================================================================
   20. Utility
   ========================================================================== */

.ms-updated { font-size: var(--text-xs); color: var(--text-secondary); }
.ms-mt-0 { margin-top: 0 !important; }
.ms-center { text-align: center; }

/* Reduce paint cost on low-end mobile: large blurred surfaces are the most
   expensive thing in this design. Small glass elements (nav, buttons, badges)
   keep the effect; big panels fall back to a solid tint. */
@media (max-width: 899px) {
  .ms-glass {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: color-mix(in oklch, var(--white) 88%, transparent);
  }
  .ms-glass--dark { background: color-mix(in oklch, var(--ink-900) 55%, transparent); }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .ms-nav, .ms-drawer { background: color-mix(in oklch, var(--ink-900) 95%, transparent); }
  .ms-btn--pink { background: var(--pink-500); }
  .ms-btn--light, .ms-badge { background: color-mix(in oklch, var(--white) 90%, transparent); }
  .ms-btn--dark, .ms-badge--dark { background: color-mix(in oklch, var(--ink-900) 70%, transparent); }
}

/* ==========================================================================
   21. Blog
   ========================================================================== */

.ms-postmeta {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-bottom: var(--space-5);
}
.ms-postmeta a { font-weight: var(--weight-semibold); }

.ms-figure { margin: 0 0 var(--space-6); }
.ms-figure__img {
  width: 100%;
  max-width: 612px; /* Source photo is 612px wide; do not upscale it. */
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.ms-card--post { padding: var(--space-4); }
.ms-card__img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
}
.ms-card__kicker {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--pink-700);
  margin-bottom: var(--space-2);
}
.ms-card--post h3 { margin-bottom: var(--space-2); }

/* Pagination on the blog index */
.navigation.pagination { margin-top: var(--space-7); }
.nav-links { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: center; }
.nav-links .page-numbers {
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--white);
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  text-decoration: none;
}
.nav-links .page-numbers.current { background: var(--pink-500); border-color: var(--pink-500); color: var(--white); }
