/* ==========================================================================
   DivorceMaybe — main stylesheet
   Mobile-first. Ordered: tokens → reset → type → layout → components.
   ========================================================================== */

:root {
    /* Color */
    --bg:           #f5f1ea;
    --bg-2:         #efeae0;
    --surface:      #ffffff;
    --surface-warm: #fbf7ef;
    --text:         #1c1c1e;
    --text-2:       #3a3a3d;
    --muted:        #6b6b73;
    --muted-2:      #9a9aa0;
    --border:       #e3ddd1;
    --border-2:     #d4cbb8;

    --primary:      #3f5d7a;
    --primary-d:    #2f4a64;
    --primary-l:    #d6dde7;
    --primary-bg:   #eaeff5;

    --accent:       #a87c5b;
    --accent-d:     #8d6748;
    --accent-l:     #ecdfd2;

    --danger:       #b03a3a;
    --success:      #2f7a4a;

    /* Type */
    --font-serif:   "Iowan Old Style", "Charter", Georgia, "Times New Roman", serif;
    --font-sans:    -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, "Helvetica Neue", Arial, sans-serif;

    /* Type scale */
    --text-xs:      0.75rem;
    --text-sm:      0.875rem;
    --text-base:    1rem;
    --text-lg:      1.0625rem;
    --text-xl:      1.25rem;
    --text-2xl:     1.5rem;
    --text-3xl:     1.875rem;
    --text-4xl:     2.25rem;

    /* Spacing */
    --space-1:      0.25rem;
    --space-2:      0.5rem;
    --space-3:      0.75rem;
    --space-4:      1rem;
    --space-5:      1.25rem;
    --space-6:      1.5rem;
    --space-8:      2rem;
    --space-10:     2.5rem;
    --space-12:     3rem;
    --space-16:     4rem;

    /* Radii / shadows */
    --radius:       10px;
    --radius-lg:    16px;
    --radius-pill:  999px;

    --shadow-sm:    0 1px 2px rgba(28, 28, 30, .04), 0 1px 1px rgba(28, 28, 30, .03);
    --shadow:       0 4px 16px rgba(28, 28, 30, .06);
    --shadow-md:    0 10px 28px rgba(28, 28, 30, .08);

    --max-w:        1080px;
    --transition:   200ms cubic-bezier(.2, .8, .2, 1);

    /* Min tap target */
    --tap:          44px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; }

body {
    font-family: var(--font-sans);
    background: var(--bg);   /* full dawn-wash background is defined in the themed body rule below */
    color: var(--text);
    line-height: 1.6;
    font-size: var(--text-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
/* Fixed full-page backdrop: a generated dawn-wash SVG with faint topographic
   contour lines, with a whisper of paper grain over it. Sits behind everything
   (z-index:-1) so it fills the page margins/gutters around the centered content. */
body::before {
    content: "";
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(circle at 1px 1px, rgba(28, 28, 30, .02) 1px, transparent 0) 0 0 / 24px 24px,
        url("../img/page-bg.svg") center center / cover no-repeat;
}

img, svg { max-width: 100%; display: block; }
button { font: inherit; }
input, textarea, select, button { font-family: inherit; }

/* iOS prevents zoom-on-focus when inputs are >=16px */
input, textarea, select { font-size: 16px; }
@media (min-width: 768px) {
    input, textarea, select { font-size: var(--text-base); }
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5 {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: var(--text);
    margin: 0 0 var(--space-4);
}
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); margin-top: var(--space-10); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

@media (min-width: 768px) {
    h1 { font-size: var(--text-4xl); }
    h2 { font-size: var(--text-3xl); }
    h3 { font-size: var(--text-2xl); }
}

p { margin: 0 0 var(--space-4); }
p:last-child { margin-bottom: 0; }

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--primary-d); text-decoration: underline; text-underline-offset: 0.2em; }

ul, ol { padding-left: 1.25em; }
li { margin-bottom: var(--space-2); }

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.92em;
    background: var(--bg-2);
    padding: 0.1em 0.4em;
    border-radius: 4px;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: var(--space-10) 0;
}

.muted    { color: var(--muted); }
.muted-2  { color: var(--muted-2); }
.small    { font-size: var(--text-sm); }
.inline   { display: inline; }
.text-center { text-align: center; }

/* ---------- Layout ---------- */
.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--space-4);
}
@media (min-width: 768px) {
    .container { padding: 0 var(--space-6); }
}

.site-main {
    padding: var(--space-6) var(--space-4);
    min-height: calc(100vh - 280px);
}
@media (min-width: 768px) {
    .site-main { padding: var(--space-10) var(--space-6); }
}

/* ---------- Header / nav ---------- */
.site-header {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.header-row {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
}
@media (min-width: 768px) {
    .header-row { padding: var(--space-4) var(--space-6); gap: var(--space-6); }
}

.brand {
    display: inline-flex;
    align-items: baseline;
    gap: 0.18em;
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 1.4rem;
    letter-spacing: -0.01em;
    color: var(--text);
    flex-shrink: 0;
}
.brand:hover { text-decoration: none; color: var(--text); }
.brand-dot {
    color: var(--accent);
    font-size: 0.6em;
    transform: translateY(-0.1em);
}

/* Nav toggle (mobile) */
.nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--tap);
    height: var(--tap);
    margin-left: auto;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text);
}
.nav-toggle:hover { background: var(--bg-2); }
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open  { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

/* Mobile-first: nav hides; reveal panel when toggle is open */
.site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: var(--space-4);
    flex-direction: column;
    gap: var(--space-2);
}
.site-nav.is-open { display: flex; }

.site-nav .nav-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}
.site-nav .nav-section + .nav-section {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
}
.site-nav a, .site-nav .link-button {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    min-height: var(--tap);
    border-radius: var(--radius);
    color: var(--text);
    font-weight: 500;
}
.site-nav a:hover, .site-nav .link-button:hover {
    background: var(--bg-2);
    text-decoration: none;
}
.site-nav a.is-current {
    background: var(--primary-bg);
    color: var(--primary-d);
}
.site-nav .nav-cta { background: var(--primary); color: white; justify-content: center; }
.site-nav .nav-cta:hover { background: var(--primary-d); color: white; }
.site-nav form { width: 100%; }
.site-nav form .link-button { width: 100%; justify-content: flex-start; }

@media (min-width: 1024px) {
    .nav-toggle { display: none; }
    .site-nav {
        display: flex;
        position: static;
        flex-direction: row;
        align-items: center;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
        gap: var(--space-5);
        flex: 1;
    }
    .site-nav .nav-section {
        flex-direction: row;
        align-items: center;
        gap: var(--space-1);
    }
    .site-nav .nav-section + .nav-section {
        margin-top: 0;
        padding-top: 0;
        margin-left: auto;
        border-top: none;
        border-left: none;
    }
    .site-nav a, .site-nav .link-button {
        padding: var(--space-2) var(--space-3);
        min-height: 0;
        font-weight: 500;
    }
    .site-nav .nav-section.primary a {
        position: relative;
        color: var(--text-2);
    }
    .site-nav .nav-section.primary a.is-current {
        background: transparent;
        color: var(--text);
    }
    .site-nav .nav-section.primary a.is-current::after {
        content: "";
        position: absolute;
        left: var(--space-3);
        right: var(--space-3);
        bottom: -2px;
        height: 2px;
        background: var(--accent);
        border-radius: 2px;
    }
    .site-nav .nav-section.user a:not(.nav-cta) { color: var(--muted); }
    .site-nav .nav-section.user a:not(.nav-cta):hover { color: var(--text); }
    .site-nav .nav-cta { padding: var(--space-2) var(--space-4); }
}

.user-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--surface-warm);
    border-top: 1px solid var(--border);
    margin-top: var(--space-12);
    padding: var(--space-10) 0;
}
.footer-row {
    display: grid;
    gap: var(--space-6);
    grid-template-columns: 1fr;
}
@media (min-width: 768px) {
    .footer-row { grid-template-columns: 2fr 1fr 1fr; align-items: start; }
}
.footer-row h4 {
    font-size: var(--text-sm);
    font-family: var(--font-sans);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: var(--space-3);
}
.footer-row p, .footer-row a { font-size: var(--text-sm); margin: 0 0 var(--space-2); }
.footer-row a { color: var(--text-2); display: block; }
.footer-row a:hover { color: var(--primary-d); }
.footer-brand .brand { margin-bottom: var(--space-3); }
.footer-disclaimer {
    margin-top: var(--space-5);
    padding-top: var(--space-5);
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: var(--text-xs);
    text-align: center;
}

.crisis-strip {
    margin-top: var(--space-8);
    padding: var(--space-4) var(--space-5);
    background: #fdf3e2;
    border: 1px solid #ead7a8;
    color: #5a3a00;
    border-radius: var(--radius);
    font-size: var(--text-sm);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3) var(--space-5);
    align-items: center;
}
.crisis-strip strong { color: #5a3a00; }
.crisis-strip a { color: #7a5400; font-weight: 600; }
.crisis-strip a:hover { color: #4a3000; }
.crisis-strip abbr {
    font-weight: 700;
    text-decoration: none;
    margin-right: var(--space-1);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: var(--tap);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-weight: 500;
    font-size: var(--text-base);
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition), border-color var(--transition), transform 80ms;
    user-select: none;
}
.btn:hover { background: var(--bg-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-d); border-color: var(--primary-d); color: white; }

.btn-accent {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}
.btn-accent:hover { background: var(--accent-d); border-color: var(--accent-d); color: white; }

.btn-danger {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}
.btn-danger:hover { background: #8b2c2c; border-color: #8b2c2c; color: white; }

.btn-ghost {
    background: transparent;
    border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-2); }

.btn-sm {
    min-height: 36px;
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
}
.btn-block { width: 100%; }

.link-button {
    background: none;
    border: none;
    padding: 0;
    color: var(--muted);
    font: inherit;
    cursor: pointer;
}
.link-button:hover { color: var(--text); }

/* ---------- Forms ---------- */
.form { max-width: 480px; }
.form-row { margin-bottom: var(--space-5); }
.form-row label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: 500;
    font-size: var(--text-sm);
    color: var(--text-2);
}
.form-row input,
.form-row textarea,
.form-row select {
    width: 100%;
    min-height: var(--tap);
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(63, 93, 122, .15);
}
.form-row textarea { min-height: 130px; resize: vertical; line-height: 1.5; }
.form-row .hint {
    font-size: var(--text-sm);
    color: var(--muted);
    margin-top: var(--space-2);
}
.form-actions {
    display: flex;
    gap: var(--space-3);
    align-items: center;
    flex-wrap: wrap;
    margin-top: var(--space-6);
}

/* Auth form: centered card on its own, narrow */
.auth-card {
    max-width: 420px;
    margin: var(--space-8) auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: var(--space-8) var(--space-6);
}
.auth-card .brand {
    justify-content: center;
    width: 100%;
    margin-bottom: var(--space-3);
}
.auth-card h1 {
    text-align: center;
    font-size: var(--text-2xl);
    margin-top: 0;
    margin-bottom: var(--space-2);
}
.auth-card .auth-sub {
    text-align: center;
    color: var(--muted);
    margin-bottom: var(--space-6);
}
.auth-card .form { max-width: none; }
.auth-card .form-actions { flex-direction: column; align-items: stretch; gap: var(--space-3); }
.auth-card .form-actions .btn-primary { width: 100%; }
.auth-card .auth-foot {
    text-align: center;
    margin-top: var(--space-6);
    font-size: var(--text-sm);
    color: var(--muted);
}
@media (min-width: 768px) {
    .auth-card { padding: var(--space-10) var(--space-8); }
}

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.card-link, a.card { color: inherit; text-decoration: none; display: block; }
.card-link:hover, a.card:hover {
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--border-2);
}
@media (hover: none) {
    .card-link:hover, a.card:hover { transform: none; box-shadow: var(--shadow-sm); }
    .card-link:active, a.card:active { transform: scale(0.99); }
}
.card + .card { margin-top: var(--space-4); }
.card-list { display: grid; gap: var(--space-4); }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    background:
        radial-gradient(1200px 320px at 80% -10%, var(--accent-l) 0%, transparent 60%),
        radial-gradient(900px 260px at 0% 110%, var(--primary-l) 0%, transparent 60%),
        linear-gradient(180deg, var(--surface-warm) 0%, var(--bg-2) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-10) var(--space-5);
    margin-bottom: var(--space-10);
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute; inset: 0;
    background-image: radial-gradient(circle at 1px 1px, rgba(28, 28, 30, .035) 1px, transparent 0);
    background-size: 22px 22px;
    pointer-events: none;
    opacity: 0.6;
}
.hero-inner { position: relative; max-width: 640px; margin: 0 auto; text-align: center; }
.hero h1 {
    font-size: var(--text-3xl);
    line-height: 1.1;
    margin-bottom: var(--space-4);
    letter-spacing: -0.02em;
}
.hero .hero-lead {
    font-size: var(--text-lg);
    color: var(--text-2);
    margin: 0 auto var(--space-6);
    max-width: 36ch;
}
.hero-actions {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
    flex-wrap: wrap;
}
.hero-actions .btn { min-width: 220px; }
.hero-eyebrow {
    display: inline-block;
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-d);
    margin-bottom: var(--space-3);
}
@media (min-width: 768px) {
    .hero { padding: var(--space-16) var(--space-10); }
    .hero h1 { font-size: var(--text-4xl); }
    .hero .hero-lead { font-size: var(--text-xl); }
    .hero-actions .btn { min-width: 0; }
}

/* ---------- Feature grid ---------- */
.feature-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
    margin-bottom: var(--space-10);
}
@media (min-width: 600px)  { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px)  { .feature-grid { grid-template-columns: repeat(4, 1fr); } }
.feature {
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.feature .feat-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--primary-bg);
    color: var(--primary-d);
    margin-bottom: var(--space-2);
}
.feature .feat-icon svg { width: 22px; height: 22px; }
.feature h3 { margin: 0; font-size: var(--text-lg); }
.feature p { margin: 0; color: var(--muted); font-size: var(--text-sm); }
.feature .feat-link {
    margin-top: auto;
    padding-top: var(--space-3);
    font-weight: 500;
    color: var(--primary);
}

/* ---------- Listing grid + cards ---------- */
.listing-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
}
@media (min-width: 600px) { .listing-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .listing-grid { grid-template-columns: repeat(3, 1fr); } }

.listing-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    height: 100%;
}
.listing-card .listing-meta { margin: 0; }
.listing-card .listing-snippet {
    color: var(--text-2);
    font-size: var(--text-sm);
    flex: 1;
}
.listing-card .listing-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: var(--text-sm);
}

.listing-meta {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    color: var(--muted);
    font-size: var(--text-sm);
    margin: var(--space-2) 0;
}
.listing-meta span {
    background: var(--bg-2);
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
}

/* ---------- Forum ---------- */
.forum-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
}
@media (min-width: 720px) { .forum-grid { grid-template-columns: repeat(2, 1fr); } }
.forum-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    border-left: 4px solid var(--accent);
}
.forum-card h3 { margin: 0; font-size: var(--text-xl); }
.forum-card .forum-desc { color: var(--muted); font-size: var(--text-sm); margin: 0; flex: 1; }
.forum-card .forum-stats {
    display: flex;
    gap: var(--space-4);
    color: var(--muted);
    font-size: var(--text-sm);
}
.forum-card .forum-stats strong { color: var(--text-2); font-weight: 600; }

.thread-list {
    list-style: none;
    padding: 0;
    margin: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.thread-list li {
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
    transition: background var(--transition);
}
.thread-list li:last-child { border-bottom: none; }
.thread-list li:hover { background: var(--bg-2); }
.thread-title { font-weight: 600; font-size: var(--text-base); }
.thread-title a { color: var(--text); }
.thread-title a:hover { color: var(--primary); text-decoration: none; }
.thread-meta {
    color: var(--muted);
    font-size: var(--text-sm);
    text-align: right;
    flex-shrink: 0;
}

/* ---------- Posts (forum / DMs) ---------- */
.post {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-4) var(--space-5);
    margin-bottom: var(--space-3);
}
.post-head {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    color: var(--muted);
    font-size: var(--text-sm);
    margin-bottom: var(--space-3);
    align-items: center;
}
.post-body { white-space: pre-wrap; word-wrap: break-word; line-height: 1.6; }
.post.is-mine { border-left: 3px solid var(--primary); background: var(--primary-bg); }
.post-author {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-2);
    text-decoration: none;
}
.post-author:hover { color: var(--primary-d); text-decoration: none; }
.post-author:hover strong { color: var(--primary-d); }
.post-author strong { color: var(--text-2); font-weight: 600; }

/* ---------- Conversation list ---------- */
.convo-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
}
@media (min-width: 768px) {
    .convo-grid { grid-template-columns: 300px 1fr; }
}
.convo-list {
    list-style: none;
    padding: 0;
    margin: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.convo-list li {
    border-bottom: 1px solid var(--border);
}
.convo-list li:last-child { border-bottom: none; }
.convo-list a {
    display: block;
    padding: var(--space-3) var(--space-4);
    color: var(--text);
    transition: background var(--transition);
}
.convo-list a:hover, .convo-list a.is-current {
    background: var(--bg-2);
    text-decoration: none;
}
.convo-list a.is-current { background: var(--primary-bg); }
.convo-row {
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
}
.convo-row .convo-text {
    display: block;
    flex: 1;
    min-width: 0;
}
.convo-row .convo-text strong {
    display: block;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}
.convo-list .convo-meta {
    display: block;
    font-size: var(--text-xs);
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.convo-list .unread { color: var(--primary-d); }

/* ---------- Filter bar ---------- */
.filter-bar {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-6);
}
.filter-bar .form-row { margin: 0; flex: 1; min-width: 160px; }
.filter-bar > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 600;
    color: var(--text-2);
    user-select: none;
    min-height: 36px;
}
.filter-bar > summary::-webkit-details-marker { display: none; }
.filter-bar > summary::after {
    content: "+";
    margin-left: auto;
    font-size: var(--text-lg);
    color: var(--muted);
}
.filter-bar[open] > summary::after { content: "−"; }
.filter-bar .filter-fields {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-3);
}
@media (min-width: 768px) {
    .filter-bar > summary { display: none; }
    .filter-bar .filter-fields {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: end;
        gap: var(--space-3);
        margin-top: 0;
    }
}

/* ---------- Flash messages ---------- */
.flash {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius);
    margin-bottom: var(--space-5);
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}
.flash-error   { background: #fdecec; border-color: #f4c1c1; color: #6e1b1b; }
.flash-success { background: #e6f4ec; border-color: #b9deca; color: #1e4d2f; }
.flash-info    { background: #ecf2fa; border-color: #c4d4ea; color: #2a4263; }

/* ---------- Avatars ---------- */
.avatar {
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-2);
    border: 1px solid var(--border);
}
.avatar-xs { width: 1.6rem;  height: 1.6rem; }
.avatar-sm { width: 2.4rem;  height: 2.4rem; }
.avatar-md { width: 3.25rem; height: 3.25rem; }
.avatar-lg { width: 8rem;    height: 8rem; }
.avatar-verified {
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
}

.byline {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: var(--space-2) 0 var(--space-5);
}
.byline > div { flex: 1; min-width: 0; }

.profile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
    align-items: start;
    margin-bottom: var(--space-8);
}
.profile-avatar-block { text-align: center; }
@media (min-width: 600px) {
    .profile-grid { grid-template-columns: auto 1fr; gap: var(--space-8); }
    .profile-avatar-block { text-align: left; }
}

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--bg-2);
    color: var(--muted);
    vertical-align: middle;
}
.badge-verified { background: #e6f4ec; border-color: #b9deca; color: #1e4d2f; }
.badge-pending  { background: #fdf3e2; border-color: #ead7a8; color: #7a5400; }

/* ---------- Admin tables ---------- */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-4);
    font-size: var(--text-sm);
}
.admin-table th, .admin-table td {
    text-align: left;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.admin-table th {
    background: var(--bg-2);
    font-weight: 600;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(28, 28, 30, .015); }

/* Make admin tables scroll horizontally on mobile rather than wrap */
.admin-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-lg);
}
@media (max-width: 720px) {
    .admin-table { font-size: var(--text-xs); }
    .admin-table th, .admin-table td { padding: var(--space-2) var(--space-3); }
}

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    gap: var(--space-1);
    flex-wrap: wrap;
    align-items: center;
    margin: var(--space-8) 0 0;
    font-size: var(--text-sm);
}
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: var(--space-1) var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    min-width: 36px;
    text-align: center;
}
.pagination a:hover { background: var(--bg-2); text-decoration: none; }
.pagination .is-current {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    font-weight: 600;
}
.pagination .is-disabled { color: var(--muted-2); background: var(--bg-2); }
.pagination .muted { border: none; background: none; padding: var(--space-1); }

/* ---------- Empty states ---------- */
.empty-state {
    text-align: center;
    padding: var(--space-10) var(--space-4);
    color: var(--muted);
}
.empty-state svg {
    width: 140px;
    height: 140px;
    margin: 0 auto var(--space-4);
    opacity: 0.85;
}
.empty-state h3 {
    color: var(--text-2);
    margin: 0 0 var(--space-2);
}
.empty-state p { max-width: 36ch; margin: 0 auto var(--space-4); }

/* ---------- Moderator post actions ---------- */
.post-mod {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px dashed var(--border-2);
    display: flex;
    gap: var(--space-2);
}
.post.is-deleted { background: var(--bg-2); border-color: var(--border-2); }

/* ---------- Cookie banner ---------- */
.cookie-banner {
    position: fixed;
    bottom: var(--space-4);
    left: var(--space-4);
    right: var(--space-4);
    max-width: 560px;
    margin: 0 auto;
    z-index: 60;
    background: var(--surface);
    border: 1px solid var(--border-2);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner p {
    flex: 1;
    margin: 0;
    font-size: var(--text-sm);
    color: var(--text-2);
    min-width: 200px;
}

/* ---------- Search ---------- */
mark {
    background: #fef3c7;
    color: var(--text);
    padding: 0 2px;
    border-radius: 3px;
}

/* ---------- Section header / eyebrow ---------- */
.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
    flex-wrap: wrap;
}
.section-head h2 { margin: 0; }
.section-head .section-link { font-size: var(--text-sm); }

/* ---------- Firms, free-consult, featured, pricing (Phase A/B) ---------- */
.badge-consult {
    background: #e4f3f0;
    border-color: #b4d8ce;
    color: #1a5b48;
}
.badge-featured, .featured-flag {
    background: #fff3cf;
    border-color: #f3da7c;
    color: #6b4a00;
}
.featured-flag {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid;
    line-height: 1.4;
}
.listing-card { position: relative; }
.listing-card.is-featured {
    border-color: #f3da7c;
    box-shadow: 0 0 0 1px #f3da7c inset, var(--shadow-sm);
}

.firm-logo {
    width: 96px;
    height: 96px;
    border-radius: 14px;
    background: #eaeef3;
    color: #3f5d7a;
    display: flex; align-items: center; justify-content: center;
}
.firm-logo svg { width: 56px; height: 56px; }

.checkbox-row { display: flex; align-items: flex-start; gap: var(--space-2); }
.check-label {
    display: flex; align-items: flex-start; gap: var(--space-2);
    cursor: pointer; font-weight: 400; line-height: 1.45;
}
.check-label input { margin-top: 0.2rem; }

.pricing-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-5);
    margin: var(--space-8) 0;
}
@media (min-width: 720px) {
    .pricing-grid { grid-template-columns: repeat(3, 1fr); }
}
.pricing-card { position: relative; padding: var(--space-6); }
.pricing-card h3 { margin: 0 0 var(--space-2); }
.pricing-card .pricing-price {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--text);
    margin: var(--space-3) 0;
}
.pricing-card .pricing-price span {
    font-size: var(--text-base);
    font-weight: 400;
    color: var(--muted);
}
.pricing-card ul {
    list-style: none; padding: 0; margin: var(--space-3) 0 0;
    display: grid; gap: var(--space-2);
}
.pricing-card ul li::before { content: "✓ "; color: #1e4d2f; font-weight: 700; }
.pricing-card.pricing-featured {
    border-color: #f3da7c;
    box-shadow: 0 0 0 2px #f3da7c inset, var(--shadow-md);
}
.pricing-flag {
    position: absolute;
    top: -10px; left: 50%;
    transform: translateX(-50%);
    background: #fff3cf;
    color: #6b4a00;
    border: 1px solid #f3da7c;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ---------- Quick exit (Phase C) ---------- */
body.has-quick-exit { padding-top: 52px; }
.quick-exit {
    position: fixed;
    top: 8px; right: 8px;
    z-index: 9999;
    background: #b54545;
    color: white;
    font-weight: 700;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    font-size: var(--text-sm);
    letter-spacing: 0.02em;
}
.quick-exit:hover, .quick-exit:focus { background: #8b2c2c; color: white; }

/* ---------- Safety hub ---------- */
.safety-hero {
    background: linear-gradient(135deg, #fdf3e2 0%, #f7e3c5 100%);
    border: 1px solid #ead7a8;
    padding: var(--space-8) var(--space-6);
    border-radius: 14px;
    margin-bottom: var(--space-6);
}
.safety-hero h1 { margin-top: 0; color: #5a3a00; }
.safety-hotlines {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-3);
    list-style: none;
    padding: 0;
}
@media (min-width: 560px) { .safety-hotlines { grid-template-columns: 1fr 1fr; } }
.safety-hotlines li {
    background: var(--surface);
    padding: var(--space-4);
    border-radius: 10px;
    border: 1px solid var(--border);
}
.safety-hotlines strong { display: block; margin-bottom: 4px; }
.safety-hotlines a { font-weight: 600; }

/* ---------- City / specialty / faq generic ---------- */
.kw-cloud { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.kw-cloud a {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: var(--text-sm);
    text-decoration: none;
}
.kw-cloud a:hover { background: #eaeef3; }

.faq-q { font-weight: 600; margin: var(--space-5) 0 var(--space-2); }
.faq-a { color: var(--muted); margin: 0 0 var(--space-3); }

/* ---------- Pre-launch strip (home) ---------- */
.prelaunch-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    background: var(--bg-2);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-5);
    margin: var(--space-6) 0;
    font-size: var(--text-sm);
}
.prelaunch-strip strong { color: var(--text); }
.prelaunch-strip > div { color: var(--text-2); }
@media (max-width: 720px) {
    .prelaunch-strip { grid-template-columns: 1fr; }
}

/* ---------- Pre-launch empty state (directories) ---------- */
.empty-state.prelaunch {
    text-align: left;
    background: linear-gradient(180deg, var(--surface), var(--bg-2));
    border: 1px solid var(--border-2);
    border-radius: var(--radius-lg);
    padding: var(--space-6) var(--space-6);
    max-width: 680px;
}
.empty-state.prelaunch h3 { margin-top: 0; }
.empty-state.prelaunch p  { color: var(--text-2); }

/* ==========================================================================
   DivorceMaybe — warmth pass (2026-05-20)
   Adds sage secondary accent, rotates feature-card icon colors, introduces
   trust strip, featured-pros row, and testimonial cards.
   ========================================================================== */

:root {
    /* Secondary palette — sage / clay / honey / rose. Soft, warm, varied. */
    --sage:        #6f8a76;
    --sage-d:      #51695a;
    --sage-l:      #dce6dd;
    --sage-bg:     #ecf1ec;

    --clay:        #b07a55;
    --clay-l:      #f0dfd0;
    --clay-bg:     #f6ebe1;

    --honey:       #c69b4a;
    --honey-l:     #f1e1c0;
    --honey-bg:    #f7eed7;

    --rose:        #b07590;
    --rose-l:      #ebd2dc;
    --rose-bg:     #f3e1e9;

    --slate-bg:    #eaeff5;   /* alias for existing primary-bg, used in rotation */
}

/* ---------- Soft body backdrop with a faint gradient + decorative blobs ---------- */
/* Layered behind the page so it never blocks content, just adds warmth.            */
body {
    /* Soft full-page dawn wash that echoes the hero illustration: a warm honey
       sun-glow top-right, sage to the left, a clay note bottom-right, over a
       gentle top-down warm band. Fixed so it stays put while you scroll. */
    background:
        radial-gradient(1250px 700px at 88% -12%, var(--honey-l) 0%, transparent 58%),
        radial-gradient(1000px 560px at -8% 16%, var(--sage-l) 0%, transparent 52%),
        radial-gradient(1000px 620px at 112% 94%, var(--clay-l) 0%, transparent 55%),
        linear-gradient(180deg, var(--surface-warm) 0%, var(--bg) 42%, var(--bg) 100%);
    background-attachment: fixed;
}

/* ---------- Hero — add a soft sage gradient stripe + decorative SVG ---------- */
.hero {
    background:
        radial-gradient(1200px 320px at 80% -10%, var(--sage-l) 0%, transparent 60%),
        radial-gradient(900px 260px at 0% 110%, var(--honey-l) 0%, transparent 60%),
        linear-gradient(180deg, var(--surface-warm) 0%, var(--bg-2) 100%);
    border-color: var(--sage-l);
}
.hero-eyebrow { color: var(--sage-d); }

/* ---------- Trust strip (4 inline trust signals below the hero) ---------- */
.trust-strip {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-5);
    margin: 0 0 var(--space-6) 0;
    box-shadow: var(--shadow-sm);
}
@media (min-width: 768px) {
    .trust-strip { grid-template-columns: repeat(4, 1fr); }
}
.trust-strip .trust-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    font-size: var(--text-sm);
    color: var(--text-2);
}
.trust-strip .trust-item strong { display: block; color: var(--text); font-weight: 600; }
.trust-strip .trust-icon {
    flex: 0 0 36px;
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.trust-strip .trust-item:nth-child(1) .trust-icon { background: var(--sage-bg); color: var(--sage-d); }
.trust-strip .trust-item:nth-child(2) .trust-icon { background: var(--honey-bg); color: #8a6826; }
.trust-strip .trust-item:nth-child(3) .trust-icon { background: var(--rose-bg); color: #8a4a64; }
.trust-strip .trust-item:nth-child(4) .trust-icon { background: var(--slate-bg); color: var(--primary-d); }
.trust-strip svg { width: 18px; height: 18px; }

/* ---------- Feature card icon color rotation ---------- */
.feature-grid > .feature:nth-child(4n+1) .feat-icon { background: var(--sage-bg);  color: var(--sage-d); }
.feature-grid > .feature:nth-child(4n+2) .feat-icon { background: var(--honey-bg); color: #8a6826; }
.feature-grid > .feature:nth-child(4n+3) .feature .feat-icon, /* fallthrough no-op */
.feature-grid > .feature:nth-child(4n+3) .feat-icon { background: var(--clay-bg); color: var(--clay); }
.feature-grid > .feature:nth-child(4n+0) .feat-icon { background: var(--rose-bg); color: #8a4a64; }

.feature .feat-icon { border-radius: 12px; }
.feature {
    transition: transform var(--transition), box-shadow var(--transition);
}
.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ---------- Featured pros (home page section) ---------- */
.featured-pros {
    margin: var(--space-10) 0;
}
.featured-pros .pros-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
}
@media (min-width: 720px)  { .featured-pros .pros-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .featured-pros .pros-grid { grid-template-columns: repeat(3, 1fr); } }
.pro-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
    text-decoration: none;
    color: inherit;
}
.pro-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.pro-card .pro-head { display: flex; gap: var(--space-3); align-items: center; }
.pro-card .pro-head img.avatar { width: 56px; height: 56px; flex: 0 0 56px; border-radius: 50%; object-fit: cover; }
.pro-card .pro-head h3 { margin: 0; font-size: var(--text-lg); line-height: 1.2; }
.pro-card .pro-head .pro-sub { color: var(--muted); font-size: var(--text-sm); margin: 2px 0 0; }
.pro-card .pro-tags {
    display: flex; flex-wrap: wrap; gap: 6px;
    font-size: var(--text-xs);
}
.pro-card .pro-tags > span {
    background: var(--bg-2);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-pill);
    padding: 2px 10px;
    color: var(--text-2);
}
.pro-card .pro-tags > .tag-verified { background: var(--sage-bg); border-color: var(--sage-l); color: var(--sage-d); }
.pro-card .pro-tags > .tag-free     { background: var(--honey-bg); border-color: var(--honey-l); color: #8a6826; }
.pro-card .pro-snip { color: var(--text-2); font-size: var(--text-sm); flex: 1; }
.pro-card .pro-foot {
    display: flex; align-items: center; justify-content: space-between;
    padding-top: var(--space-3); border-top: 1px solid var(--border);
    font-size: var(--text-sm); color: var(--muted);
}
.pro-card .pro-foot .pro-link { color: var(--primary); font-weight: 500; }

/* ---------- Testimonials ---------- */
.testimonials {
    margin: var(--space-10) 0 var(--space-12);
}
.testimonials .quotes {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
}
@media (min-width: 720px)  { .testimonials .quotes { grid-template-columns: repeat(3, 1fr); } }
.quote-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    position: relative;
    box-shadow: var(--shadow-sm);
}
.quote-card::before {
    content: "\201C";
    position: absolute;
    top: 6px; left: 14px;
    font-family: var(--font-serif);
    font-size: 4rem;
    color: var(--sage-l);
    line-height: 1;
    pointer-events: none;
}
.quote-card blockquote {
    margin: 0;
    font-size: var(--text-base);
    color: var(--text);
    font-style: italic;
    position: relative;
    padding-left: 0;
}
.quote-card .quote-attrib {
    margin-top: var(--space-4);
    font-size: var(--text-sm);
    color: var(--muted);
    font-style: normal;
}
.quote-card .quote-attrib strong {
    color: var(--text-2);
    font-weight: 600;
    font-style: normal;
    display: block;
}

/* ---------- Section head polish (used on home) ---------- */
.section-eyebrow {
    display: block;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--sage-d);
    font-weight: 600;
    margin-bottom: var(--space-2);
}

/* ---------- Listing-card byline avatar pop + featured badge ---------- */
.listing-card { transition: transform var(--transition), box-shadow var(--transition); }
.listing-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.listing-card .avatar-verified {
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--sage-l);
}
.listing-card.is-featured {
    border-color: var(--honey-l);
    box-shadow: 0 0 0 1px var(--honey-l), var(--shadow-sm);
}
.listing-card .featured-flag {
    background: var(--honey-bg);
    color: #8a6826;
    border: 1px solid var(--honey-l);
    border-radius: var(--radius-pill);
    padding: 2px 10px;
    font-size: var(--text-xs);
    font-weight: 600;
    align-self: flex-start;
}
.badge-verified {
    background: var(--sage-bg);
    color: var(--sage-d);
    border: 1px solid var(--sage-l);
    border-radius: var(--radius-pill);
    padding: 1px 8px;
    font-size: var(--text-xs);
    font-weight: 600;
    margin-left: 6px;
}
.badge-consult {
    background: var(--honey-bg);
    color: #8a6826;
    border: 1px solid var(--honey-l);
    border-radius: var(--radius-pill);
    padding: 1px 8px;
    font-size: var(--text-xs);
    font-weight: 600;
    margin-left: 6px;
}

/* Hero background illustration — soft layered horizon ("path through"). */
.hero {
    background:
        url("../img/hero-bg.svg") no-repeat center bottom / 100% auto,
        radial-gradient(1200px 320px at 80% -10%, var(--sage-l) 0%, transparent 60%),
        radial-gradient(900px 260px at 0% 110%, var(--honey-l) 0%, transparent 60%),
        linear-gradient(180deg, var(--surface-warm) 0%, var(--bg-2) 100%);
    padding-bottom: var(--space-16);
}
@media (min-width: 768px) {
    .hero { padding-bottom: calc(var(--space-16) + var(--space-6)); }
}

/* ---------- Stage card illustrations (home "For every stage") ---------- */
.stage-card .stage-illu {
    width: 100%;
    max-width: 240px;
    height: auto;
    display: block;
    margin: 0 auto var(--space-3);
}

/* ---------- Directory page hero (counselors / lawyers / firms) ---------- */
.dir-hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
    align-items: center;
    margin-bottom: var(--space-6);
}
.dir-hero-text { max-width: 640px; }
.dir-hero-illu { width: 100%; max-width: 320px; height: auto; justify-self: center; }
@media (min-width: 760px) {
    .dir-hero { grid-template-columns: 1fr 320px; }
    .dir-hero-illu { justify-self: end; }
}

/* ---------- 2026-05-20 hotfix: listing-card FEATURED badge no longer absolute ---------- */
.listing-card .featured-flag {
    position: static;
    align-self: flex-start;
    order: -1;          /* sits as the very first row of the card */
    margin: 0 0 var(--space-1);
}
.listing-card .byline { margin-top: 0; }
/* Make sure long titles wrap and never overflow next to the avatar. */
.listing-card h3,
.listing-card .byline > div h3 {
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
    padding-right: 0;
}
.listing-card .byline > div { min-width: 0; }
/* Inline badges inside h3 should not push to a new line awkwardly. */
.listing-card h3 .badge-consult,
.listing-card h3 .badge-verified {
    vertical-align: middle;
    white-space: nowrap;
}

/* ==========================================================================
   Mobile pass — 2026-05-20
   Targets: <380px (small), <600px (mobile), 600–768px (large mobile).
   ========================================================================== */

/* Hard guard against horizontal overflow caused by long-word wrapping. */
html, body { overflow-x: hidden; }
img, svg, video { max-width: 100%; height: auto; }

/* ---------- Mobile (<600px) ---------- */
@media (max-width: 599px) {
    /* Container: slightly tighter than var(--space-4) so we get a bit more breathing room next to the edge. */
    .container { padding: 0 var(--space-3); }
    .site-main { padding: var(--space-4) var(--space-3); }

    /* Hero: smaller padding, type stack one notch down. */
    .hero { padding: var(--space-8) var(--space-4); padding-bottom: var(--space-12); }
    .hero h1 { font-size: 1.65rem; line-height: 1.15; }
    .hero .hero-lead { font-size: 0.98rem; }
    .hero-actions { gap: var(--space-2); }
    .hero-actions .btn { min-width: 0; width: 100%; }

    /* Section heads — make the title + section-link stack cleanly. */
    .section-head { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
    .section-head .section-link { font-size: var(--text-sm); }

    /* Trust strip: 1 column on tiny phones so the icon + text don't crowd. */
    .trust-strip { grid-template-columns: 1fr; gap: var(--space-3); padding: var(--space-4); }
    .trust-strip .trust-item { font-size: var(--text-sm); }

    /* Prelaunch strip already stacks at 720px — bump padding down for tiny screens. */
    .prelaunch-strip { padding: var(--space-3) var(--space-4); }

    /* Feature & listing & pro cards: tighter inner padding. */
    .feature { padding: var(--space-5); }
    .listing-card { padding: var(--space-5); }
    .pro-card    { padding: var(--space-4); }

    /* Listing card byline: align avatar with text top instead of center so the wrap looks intentional. */
    .listing-card .byline { align-items: flex-start; gap: var(--space-3); }
    .listing-card .byline > div h3 { font-size: 1rem; line-height: 1.25; }
    .listing-card .listing-meta { font-size: var(--text-xs); gap: 6px; }

    /* Directory hero: illustration sits below text, slightly smaller. */
    .dir-hero-illu { max-width: 240px; }

    /* Footer columns stack vertically with consistent gap. */
    .footer-row { grid-template-columns: 1fr; gap: var(--space-6); }
    .footer-row h4 { margin-bottom: var(--space-2); }
    .crisis-strip {
        flex-direction: column; align-items: flex-start;
        font-size: var(--text-sm); gap: var(--space-1);
    }
    .crisis-strip > span { white-space: normal; }

    /* Quote / testimonial cards: don't let the large quote glyph leak into the text. */
    .quote-card { padding: var(--space-4) var(--space-4) var(--space-4) var(--space-5); }
    .quote-card::before { font-size: 3rem; top: 2px; left: 10px; }

    /* Cookie banner: full-width on small phones, sit flush near bottom. */
    .cookie-banner {
        left: var(--space-3); right: var(--space-3);
        bottom: var(--space-3); padding: var(--space-3);
    }

    /* Forum index cards: tighter padding, smaller header. */
    .forum-card h3 { font-size: var(--text-lg); }

    /* Filter bar: stack form rows full-width. */
    .filter-fields { grid-template-columns: 1fr !important; }
    .filter-fields .form-row { width: 100%; }

    /* Stage cards stay single column with smaller illustration so they don't dominate. */
    .stage-card .stage-illu { max-width: 200px; }
}

/* ---------- Extra-small (<380px) ---------- */
@media (max-width: 379px) {
    .hero h1 { font-size: 1.45rem; }
    .hero-eyebrow { font-size: 0.65rem; letter-spacing: 0.08em; }
    .brand { font-size: 1.15rem; }
}

/* ---------- Large mobile (600px – 768px) ---------- */
@media (min-width: 600px) and (max-width: 767px) {
    .trust-strip { grid-template-columns: repeat(2, 1fr); }
    .hero { padding: var(--space-10) var(--space-5); }
}

/* ---------- Section-head layout helper (works everywhere) ---------- */
.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
}

/* ---------- Footer columns — explicit grid so they don't squish at tablet widths ---------- */
.footer-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-8);
    padding: var(--space-8) 0 var(--space-6);
}
@media (min-width: 600px) { .footer-row { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .footer-row { grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--space-6); } }
.footer-row > div a { display: block; padding: 2px 0; color: var(--text-2); font-size: var(--text-sm); }
.footer-row > div a:hover { color: var(--primary); }
.footer-row > div h4 { font-size: var(--text-sm); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 var(--space-3); }

/* ---------- Brand mark (2026-05-20) ---------- */
.brand { gap: var(--space-2); }
.brand-mark {
    width: 36px;
    height: 36px;
    display: inline-block;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(28,28,30,.06));
    transition: transform var(--transition);
}
.brand:hover .brand-mark { transform: rotate(-3deg) scale(1.03); }
.brand-word {
    font-family: var(--font-serif);
    font-weight: 600;
    letter-spacing: -0.01em;
}
.brand-dot { color: #c69b4a; }  /* honey-toned dot to match the sun in the mark */
@media (max-width: 379px) {
    .brand-mark { width: 32px; height: 32px; }
}

/* ---------- Spoken here strip (home) ---------- */
.spoken-here {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px var(--space-3);
    padding: var(--space-3) var(--space-4);
    margin: 0 0 var(--space-6);
    background: var(--sage-bg);
    border: 1px solid var(--sage-l);
    border-radius: var(--radius-lg);
}
.spoken-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--sage-d);
    margin-right: var(--space-2);
}
.spoken-chip {
    background: var(--surface);
    border: 1px solid var(--sage-l);
    color: var(--sage-d);
    border-radius: var(--radius-pill);
    padding: 3px 12px;
    font-size: var(--text-sm);
    font-weight: 500;
}
.spoken-chip.muted-chip { color: var(--muted); border-style: dashed; background: transparent; }

/* ---------- Why DivorceMaybe (anti-DIY) ---------- */
.why-us {
    margin: var(--space-10) 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
}
.why-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
    align-items: start;
}
@media (min-width: 760px) {
    .why-grid { grid-template-columns: 1.1fr 1fr; gap: var(--space-8); }
}
.why-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: var(--space-3);
}
.why-list li {
    background: var(--bg-2);
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    color: var(--text-2);
    position: relative;
    padding-left: 2.3rem;
}
.why-list li::before {
    content: "✓";
    position: absolute;
    left: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--sage-bg);
    color: var(--sage-d);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}
.why-list li strong { color: var(--text); display: inline; font-weight: 600; }

/* Mobile tightening for the new sections */
@media (max-width: 599px) {
    .spoken-here { padding: var(--space-3); }
    .spoken-label { width: 100%; margin-right: 0; margin-bottom: 4px; }
    .why-us { padding: var(--space-5) var(--space-4); }
}

/* Sample chip on testimonial cards */
.quote-card { position: relative; }
.quote-card .sample-chip {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    background: var(--bg-2);
    color: var(--muted);
    border: 1px dashed var(--border-2);
    border-radius: var(--radius-pill);
    padding: 2px 10px;
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ==========================================================================
   DivorceMaybe — revision pass (2026-05-30)
   Safety quick-exit/header coexistence, populated directory, professional
   profile page, forum category colors, safety refinements, hero tightening.
   ========================================================================== */

/* ---------- Quick Exit ↔ header coexistence (P0) --------------------------
   Quick Exit now rides INSIDE the sticky header as a flow element, so it can
   never overlap the hamburger toggle or any heading. It stays visible at all
   times because the header is position: sticky. */
body.has-quick-exit { padding-top: 0; }   /* the old fixed-overlay band is gone */
.site-header .quick-exit {
    position: static;
    order: 3;
    margin-left: auto;        /* pushes the exit + hamburger group to the right */
    flex-shrink: 0;
    align-self: center;
    white-space: nowrap;
    padding: 8px 16px;
}
.site-nav { order: 2; }       /* sits left of Quick Exit on desktop; absolute on mobile */
.has-quick-exit .header-row .nav-toggle { order: 4; margin-left: var(--space-2); }
.quick-exit .quick-exit-short { display: none; }
@media (max-width: 360px) {
    /* On the very narrowest phones, shrink the label to "Exit" so brand +
       exit + hamburger all fit comfortably on one row. */
    .site-header .quick-exit { padding: 8px 12px; }
    .quick-exit .quick-exit-full  { display: none; }
    .quick-exit .quick-exit-short { display: inline; }
}

/* ---------- Directory search bar (P1) ------------------------------------- */
.dir-search { margin: 0 0 var(--space-4); }
.dir-search form { position: relative; display: block; }
.dir-search .dir-search-icon {
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    width: 20px; height: 20px;
    color: var(--muted);
    pointer-events: none;
}
.dir-search input[type="search"] {
    width: 100%;
    padding: var(--space-4) var(--space-4) var(--space-4) calc(var(--space-6) + 18px);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-pill);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.dir-search input[type="search"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}
.dir-search .dir-search-go {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
}
/* Tighten the space between filters and results so the grid feels populated */
.dir-count { margin: 0 0 var(--space-3); }

/* ---------- Language pills on listing cards (P1) -------------------------- */
.lang-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.lang-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--sage-bg);
    color: var(--sage-d);
    border: 1px solid var(--sage-l);
    border-radius: var(--radius-pill);
    padding: 2px 10px;
    font-size: var(--text-xs);
    font-weight: 600;
}

/* ---------- Professional profile page (P1) -------------------------------- */
.profile-band {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-5);
    background: linear-gradient(180deg, var(--surface-warm), var(--surface));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-sm);
}
.profile-band .pb-head { display: flex; gap: var(--space-4); align-items: flex-start; }
.profile-band .pb-head > div { min-width: 0; }
.profile-band h1 { margin: 0 0 var(--space-1); font-size: var(--text-2xl); line-height: 1.15; }
.profile-band .pb-cred { color: var(--muted); margin: 0 0 var(--space-2); font-size: var(--text-sm); }
.profile-band .pb-meta { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); color: var(--text-2); font-size: var(--text-sm); margin: 0; }
.profile-band .pb-meta span { display: inline-flex; align-items: center; gap: 6px; }

.profile-layout { display: grid; grid-template-columns: 1fr; gap: var(--space-6); align-items: start; }
.profile-aside { order: -1; }   /* mobile: contact CTA sits right under the header band */
@media (min-width: 860px) {
    .profile-layout { grid-template-columns: 1fr 320px; }
    .profile-main, .profile-aside { order: 0; }   /* desktop: back to source order (main left, aside right) */
}
.profile-section { margin-bottom: var(--space-6); }
.profile-section > h2 { font-size: var(--text-xl); margin: 0 0 var(--space-3); }

/* Specialty / approach chips */
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.chip {
    display: inline-flex;
    align-items: center;
    background: var(--clay-bg);
    color: var(--accent-d);
    border: 1px solid var(--clay-l);
    border-radius: var(--radius-pill);
    padding: 4px 12px;
    font-size: var(--text-sm);
    font-weight: 500;
}

/* Practical details grid */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3) var(--space-5); margin: 0; }
.detail-grid dt { color: var(--muted); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px; }
.detail-grid dd { margin: 0 0 var(--space-2); font-weight: 600; color: var(--text); }

/* Verification panel — makes "manually verified" concrete */
.verify-panel {
    background: #e9f4ee;
    border: 1px solid #b9deca;
    border-radius: var(--radius-lg);
    padding: var(--space-5);
}
.verify-panel h2 { margin: 0 0 var(--space-2); display: flex; align-items: center; gap: var(--space-2); color: #1e4d2f; font-size: var(--text-lg); }
.verify-panel svg { width: 22px; height: 22px; color: #2f7a4a; flex-shrink: 0; }
.verify-panel ul { margin: var(--space-2) 0 0; padding-left: 1.1rem; color: var(--text-2); font-size: var(--text-sm); }
.verify-panel li { margin-bottom: 4px; }

/* Contact-flow explainer — defuses the "flooded inbox" fear */
.contact-flow { background: var(--surface); border: 1px dashed var(--border-2); border-radius: var(--radius-lg); padding: var(--space-5); }
.contact-flow ol { margin: var(--space-2) 0 0; padding-left: 1.2rem; color: var(--text-2); font-size: var(--text-sm); }
.contact-flow li { margin-bottom: var(--space-2); }

/* Sticky contact card (desktop) / fixed bottom bar (mobile) */
.profile-cta {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow);
}
@media (min-width: 860px) {
    .profile-cta { position: sticky; top: calc(64px + var(--space-4)); }
}
.profile-cta h2 { margin: 0 0 var(--space-2); font-size: var(--text-lg); }
.profile-cta .btn { width: 100%; }
.profile-cta .muted { font-size: var(--text-sm); }
.profile-cta .priv-note { display: flex; gap: var(--space-2); align-items: flex-start; margin-top: var(--space-3); color: var(--muted); font-size: var(--text-xs); }
.profile-cta .priv-note svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }

/* Structured-feedback note (we deliberately avoid open star ratings) */
.feedback-note { color: var(--muted); font-size: var(--text-sm); background: var(--bg-2); border-radius: var(--radius); padding: var(--space-4); }

/* ---------- Forum category colors (P2) -----------------------------------
   One consistent color per category, reused on forum cards AND the homepage
   community tags, so color becomes a wayfinding cue across the site. */
.cat-general  { --cat: #3f5d7a; }
.cat-kids     { --cat: #c69b4a; }
.cat-finances { --cat: #6f8a76; }
.cat-legal    { --cat: #2f4a64; }
.cat-support  { --cat: #b07590; }
.cat-desi     { --cat: #b07a55; }
.cat-women    { --cat: #a85a78; }
.cat-lgbtq    { --cat: #8a6d9c; }
.cat-faith    { --cat: #b08a3e; }
.cat-abuse    { --cat: #a85f4a; }
.cat-after    { --cat: #51695a; }
.cat-therapy  { --cat: #5e8a82; }

.forum-card { border-left-color: var(--cat, var(--accent)); position: relative; }
.forum-card .cat-dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--cat, var(--accent));
    margin-right: 6px;
    flex-shrink: 0;
}
.forum-card .forum-title-row { display: flex; align-items: center; }
.forum-card .forum-latest {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--text-2);
}
.forum-card .forum-latest .fl-label { color: var(--muted); }
.forum-card .forum-latest a { color: var(--text); font-weight: 600; }
.forum-card.is-quiet { opacity: 0.96; }
.forum-card .forum-invite { margin: 0; font-size: var(--text-sm); color: var(--muted); font-style: italic; }

/* Homepage community tags pick up the same category color as a left accent */
.kw-cloud a[class*="cat-"] { border-left: 3px solid var(--cat, var(--accent)); padding-left: 10px; }

/* ---------- Safety hub refinements (P2) ----------------------------------- */
.region-jump { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-3) 0 var(--space-5); }
.region-jump a {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-pill);
    padding: 6px 14px;
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
    color: var(--text-2);
}
.region-jump a:hover { background: var(--bg-2); }
.hotline-region { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); margin-bottom: var(--space-3); overflow: hidden; }
.hotline-region > summary {
    cursor: pointer;
    list-style: none;
    padding: var(--space-4) var(--space-5);
    font-weight: 600;
    font-family: var(--font-serif);
    font-size: var(--text-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.hotline-region > summary::-webkit-details-marker { display: none; }
.hotline-region > summary::after { content: "+"; color: var(--muted); font-size: var(--text-xl); }
.hotline-region[open] > summary::after { content: "−"; }
.hotline-region .safety-hotlines { padding: 0 var(--space-5) var(--space-5); }
.checklist-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; margin-top: var(--space-4); }
.hide-reminder {
    display: flex;
    gap: var(--space-3);
    align-items: center;
    background: #fdf3e2;
    border: 1px solid #ead7a8;
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-5);
    margin: var(--space-6) 0;
    color: #5a3a00;
    font-size: var(--text-sm);
}
.hide-reminder svg { width: 22px; height: 22px; flex-shrink: 0; }

/* Print: a clean, ink-friendly safety checklist; hide site chrome */
@media print {
    .site-header, .site-footer, .cookie-banner, .quick-exit,
    .safety-hero, .region-jump, .hide-reminder, .checklist-actions { display: none !important; }
    body { background: #fff; color: #000; }
    body::before { display: none; }
    .card { border: 1px solid #999; box-shadow: none; }
    a { color: #000; text-decoration: none; }
}

/* ---------- Homepage hero — raise the CTAs (P2) ---------------------------
   Trim the generous vertical padding so the headline + buttons sit higher and
   "Find a counselor" lands comfortably above the fold. */
.hero { padding-top: var(--space-8); padding-bottom: var(--space-10); }
@media (min-width: 768px) {
    .hero { padding-top: var(--space-10); padding-bottom: var(--space-12); }
}

/* ==========================================================================
   DivorceMaybe — styling polish (2026-05-30b)
   Header auth buttons stay one-line; testimonial "Sample" chip no longer
   overlaps the quote; the cramped tablet range (768–1023px) now uses the tidy
   hamburger menu (see the nav breakpoint raised to 1024px above); small mobile
   margin tidy-ups.
   ========================================================================== */

/* Keep "Log in" and "Sign up" each on a single line — never wrap mid-word. */
.site-nav a,
.site-nav .link-button,
.site-nav .nav-cta { white-space: nowrap; }
/* Insurance: if the desktop nav is ever too wide for its row (e.g. a logged-in
   admin with many links), let whole items wrap to a second line gracefully
   instead of overflowing — each item still stays a clean one-liner. */
@media (min-width: 1024px) {
    .site-nav { flex-wrap: wrap; row-gap: var(--space-2); }
}

/* Testimonials: reserve top space so the quote clears the "Sample" chip (and the
   decorative quote-mark) instead of running underneath it. */
.quote-card { padding-top: var(--space-10); }
.quote-card .sample-chip { top: var(--space-4); }

/* Mobile margin tidy-ups. */
@media (max-width: 600px) {
    /* Hero: pull the CTAs a little higher on small screens. */
    .hero { padding-top: var(--space-6); padding-bottom: var(--space-8); }
    /* Section rhythm: avoid oversized gaps that read as "empty" on a phone. */
    .testimonials { margin: var(--space-8) 0; }
    .featured-pros, .why-us { margin-top: var(--space-8); }
    /* Comfortable, tappable full-width primary actions. */
    .hero-actions { gap: var(--space-2); }
}
