:root {
    --bg: #f6f8fb;
    --surface: #fff;
    --text: #1c2733;
    --muted: #5b6b7b;
    --line: #e2e8f0;
    --brand: #0b5fff;
    --brand-dark: #0847c2;
    --brand-soft: #e8f0ff;
    --accent: #ff7a1a;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(16,24,40,.06), 0 4px 16px rgba(16,24,40,.06);
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 17px/1.7 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-dark); }

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 20;
    background: rgba(255,255,255,.92);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { font-weight: 800; font-size: 20px; letter-spacing: -.02em; color: var(--text); text-decoration: none; }
.brand span { color: var(--brand); }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a { color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: 15px; font-weight: 500; }
.nav a:hover { background: var(--brand-soft); color: var(--brand-dark); }
.nav a.nav-cta { background: var(--accent); color: #fff; font-weight: 700; margin-left: 8px; }
.nav a.nav-cta:hover { background: #e8650a; color: #fff; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 20px; line-height: 1; cursor: pointer; }

@media (max-width: 820px) {
    .nav-toggle { display: block; }
    .nav { display: none; position: absolute; left: 0; right: 0; top: 64px; flex-direction: column; align-items: stretch; background: #fff; border-bottom: 1px solid var(--line); padding: 8px 20px 16px; margin: 0; }
    .nav.open { display: flex; }
    .nav a.nav-cta { margin: 8px 0 0; text-align: center; }
}

/* ---------- search ---------- */
.search { position: relative; margin: 28px 0 8px; }
.search input {
    width: 100%; padding: 16px 20px 16px 52px; font: inherit; font-size: 18px;
    border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='none' stroke='%235b6b7b' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='9' cy='9' r='7'/%3E%3Cpath d='m15 15 5 5'/%3E%3C/svg%3E") no-repeat 18px 50%;
    box-shadow: var(--shadow); outline: none; color: var(--text);
}
.search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search-results {
    position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 15; margin: 0; padding: 6px; list-style: none;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(16,24,40,.14);
    max-height: 380px; overflow-y: auto;
}
.search-results[hidden] { display: none; }
.search-results a { display: block; padding: 10px 14px; border-radius: 8px; color: var(--text); text-decoration: none; }
.search-results li.active a, .search-results a:hover { background: var(--brand-soft); color: var(--brand-dark); }
.search-results .none { padding: 12px 14px; color: var(--muted); }

/* ---------- content ---------- */
#wrapper { padding-bottom: 56px; }
h1 { font-size: clamp(26px, 4vw, 38px); line-height: 1.2; letter-spacing: -.02em; margin: 32px 0 20px; }
h2 { font-size: clamp(21px, 3vw, 27px); line-height: 1.3; letter-spacing: -.01em; margin: 40px 0 12px; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 0 4px; font-weight: 700; }
p { margin: 0 0 20px; }
h3:empty, p:empty { display: none; }
ul, ol { padding-left: 1.3em; margin: 0 0 20px; }
li { margin-bottom: 6px; }
table { border-collapse: collapse; width: 100%; margin: 0 0 28px; background: var(--surface); border-radius: 10px; overflow: hidden; display: block; overflow-x: auto; }
table td, table th { padding: 10px 14px; border: 1px solid var(--line); }
img { max-width: 100%; height: auto; }

/* Article and detail pages: one narrow readable column for search, text, cards and CTA.
   Pages with a notary grid (home, city lists) keep the full width. */
#wrapper:not(:has(> .notary-list)) { max-width: 820px; }

/* legacy grid helpers kept for existing markup */
.row { display: block; }
.notary-list {
    display: grid !important; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin: 0 0 24px;
}
.notary-list > div { min-width: 0; }
.notary-list a { display: block; text-decoration: none; height: 100%; }
.notary-list a div {
    height: 100%; min-height: 76px; display: flex; align-items: center; justify-content: center; text-align: center;
    padding: 14px 16px; font-weight: 600; font-size: 17px; line-height: 1.3;
    background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); transition: transform .15s, border-color .15s, color .15s;
}
.notary-list a:hover div { transform: translateY(-2px); border-color: var(--brand); color: var(--brand); }

/* notary detail card: heading-less rows after h1 */
#wrapper > .row:not(.notary-list) > .col-lg-12 {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 8px 28px 12px; margin-bottom: 24px;
}
#wrapper > .row:not(.notary-list) > .col-lg-12 > h3:first-child { margin-top: 18px; }
#wrapper > .row:not(.notary-list) > .col-lg-12 p { margin-bottom: 8px; font-size: 18px; }

/* ---------- CTA ---------- */
.cta {
    display: flex; align-items: center; gap: 24px; justify-content: space-between; flex-wrap: wrap;
    margin: 40px 0 0; padding: 28px 32px; border-radius: 18px; color: #fff;
    background: linear-gradient(135deg, #0b3fae, #0b5fff 70%);
    box-shadow: 0 10px 30px rgba(11,95,255,.25);
}
.cta h2 { color: #fff; margin: 0 0 6px; font-size: 24px; max-width: none !important; }
.cta p { margin: 0 !important; opacity: .92; max-width: 560px; }
.cta a.btn {
    display: inline-block; background: var(--accent); color: #fff; text-decoration: none; font-weight: 700;
    padding: 14px 26px; border-radius: 12px; white-space: nowrap;
}
.cta a.btn:hover { background: #e8650a; color: #fff; }
.cta .cta-links { margin-top: 10px; font-size: 15px; }
.cta .cta-links a { color: #fff; margin-right: 14px; }

/* ---------- footer ---------- */
.site-footer { background: #0f1b2d; color: #c4cfdd; padding: 48px 0 28px; font-size: 15px; }
.site-footer a { color: #c4cfdd; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 28px; }
.site-footer h4 { color: #fff; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer .legal { border-top: 1px solid #25344b; margin-top: 32px; padding-top: 20px; font-size: 13px; color: #8d9db3; }
.site-footer .legal p { margin: 0 0 6px; }

@media (max-width: 600px) {
    body { font-size: 16px; }
    .cta { padding: 22px; }
    #wrapper > .row:not(.notary-list) > .col-lg-12 { padding: 4px 18px 8px; }
}
