/* State startup guide (_includes/state-guide.html).
   Loaded by the include itself, so it only reaches pages that render a guide.
   Everything is namespaced .sg-* and sits inside the post's .post-body, so the
   article's own type, tables, answer block, disclaimer and FAQ styles (defined in
   _layouts/post.html) still apply. Colour is a secondary cue: every agency chip
   also prints the agency's name. */

.state-guide {
    --sg-navy: #8da2d0;
    --sg-slate: #9aa5ba;
    --sg-gold: #C5A572;
    --sg-sage: #6fbf9a;
    --sg-clay: #d98c6e;
    /* The site's --text-muted (#64748B) is 4.44:1 on --bg-alt, just under AA for small
       text; this is 5.56:1 there and 5.96:1 on white. */
    --sg-muted: #9aa5ba;
}

/* ── Agency chips and cost badges ── */
.state-guide .sg-chip,
.state-guide .sg-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.18rem 0.65rem 0.18rem 0.5rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-alt);
    font-family: var(--font-sans);
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text);
    white-space: nowrap;
}

.state-guide .sg-chip::before {
    content: "";
    width: 0.62rem;
    height: 0.62rem;
    border-radius: 50%;
    background: var(--sg-navy);
    flex: none;
}

.state-guide .sg-chip--navy::before { background: var(--sg-navy); }
.state-guide .sg-chip--slate::before { background: var(--sg-slate); }
.state-guide .sg-chip--gold::before { background: var(--sg-gold); }
.state-guide .sg-chip--sage::before { background: var(--sg-sage); }
.state-guide .sg-chip--clay::before { background: var(--sg-clay); }

.state-guide .sg-badge {
    padding: 0.18rem 0.7rem;
    border-radius: 0.9rem;
    background: var(--bg-alt);
    color: var(--gold-ink);
    white-space: normal;
}

/* ── Download card ── */
.state-guide .sg-download {
    display: grid;
    grid-template-columns: 11.5rem 1fr;
    gap: 1.75rem;
    align-items: center;
    margin: 2rem 0 2.5rem;
    padding: 1.5rem 1.75rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-top: 3px solid var(--gold);
    border-radius: var(--radius);
}

.state-guide .sg-download-cover {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: 3px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.16);
    background: var(--navy);
    aspect-ratio: 8.5 / 11;
}

.state-guide .sg-download .sg-kicker {
    margin: 0 0 0.35rem;
    font-family: var(--font-sans);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold-ink);
}

.state-guide .sg-download .sg-download-title {
    margin: 0 0 0.5rem;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--ink);
}

.state-guide .sg-download .sg-download-text {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-light);
}

.state-guide .sg-download ul.sg-includes {
    margin: 0 0 1.1rem;
    padding: 0;
    list-style: none;
    font-family: var(--font-sans);
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--text);
}

.state-guide .sg-download ul.sg-includes li {
    position: relative;
    margin: 0 0 0.3rem;
    padding-left: 1.35rem;
}

.state-guide .sg-download ul.sg-includes li::before {
    content: "";
    position: absolute;
    left: 0.15rem;
    top: 0.5em;
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: var(--gold);
}

.state-guide .sg-download .sg-free-link {
    margin: 0.9rem 0 0;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    color: var(--sg-muted);
}

.state-guide .sg-download .sg-free-link a { color: var(--accent); font-weight: 600; }

.state-guide .sg-peek {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
    gap: 0.85rem;
    margin: -1.25rem 0 2.5rem;
}

.state-guide .sg-peek figure { margin: 0; }

.state-guide .sg-peek a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.state-guide .sg-peek img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--border);
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.1);
    background: var(--bg-alt);
}

.state-guide .sg-peek figcaption {
    margin-top: 0.4rem;
    font-family: var(--font-sans);
    font-size: 0.72rem;
    color: var(--sg-muted);
}

@media (max-width: 640px) {
    .state-guide .sg-download {
        grid-template-columns: 1fr;
        gap: 1.1rem;
        padding: 1.25rem 1.1rem;
    }
    .state-guide .sg-download-cover { max-width: 9.5rem; }
}

/* ── Roadmap ── */
.state-guide .sg-roadmap {
    position: relative;
    margin: 1.5rem 0 2.25rem;
    padding: 0;
    list-style: none;
}

.state-guide .sg-roadmap::before {
    content: "";
    position: absolute;
    left: 1.15rem;
    top: 1.2rem;
    bottom: 1.2rem;
    width: 2px;
    background: var(--border);
}

.state-guide .sg-roadmap li {
    position: relative;
    margin: 0;
    padding: 0.5rem 0 0.5rem 3.5rem;
}

.state-guide .sg-num {
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    border: 2px solid var(--gold);
    box-shadow: 0 0 0 4px #fff;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: calc(2.3rem - 4px);
    text-align: center;
}

.state-guide .sg-road-label {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 1.02rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--ink);
    text-decoration: none;
}

.state-guide .sg-road-label:hover { color: var(--accent); text-decoration: underline; }

.state-guide .sg-road-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.3rem;
}

.state-guide .sg-road-note {
    margin: 0.75rem 0 0;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--text-light);
}

/* ── Steps ── */
.state-guide .sg-step {
    margin: 2.25rem 0 0;
    padding-top: 1.75rem;
    border-top: 1px solid var(--border);
    scroll-margin-top: 5.5rem;
}

/* The first step sits directly under the section heading, which has its own rule. */
.state-guide h2 + .sg-step {
    margin-top: 1.25rem;
    padding-top: 0;
    border-top: 0;
}

.post-body .sg-step h3 {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin: 0 0 0.6rem;
    font-size: 1.2rem;
    line-height: 1.35;
}

.state-guide .sg-step h3 .sg-num {
    position: static;
    flex: none;
    width: 1.9rem;
    height: 1.9rem;
    box-shadow: none;
    font-size: 0.8rem;
    line-height: calc(1.9rem - 4px);
    transform: translateY(0.12rem);
}

.state-guide .sg-step-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 0 1rem;
}

.state-guide .sg-note {
    margin: 1.25rem 0;
    padding: 0.9rem 1.1rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-left: 3px solid var(--gold);
    border-radius: 4px;
    font-family: var(--font-sans);
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-light);
}

.state-guide .sg-note strong { color: var(--ink); }

.state-guide .sg-links {
    margin: 0 0 0.9rem;
    padding: 0;
    list-style: none;
    font-family: var(--font-sans);
    font-size: 0.9rem;
}

.state-guide .sg-links li { margin: 0 0 0.3rem; padding-left: 1.15rem; position: relative; }

.state-guide .sg-links li::before {
    content: "\2192";
    position: absolute;
    left: 0;
    color: var(--gold-ink);
}

.state-guide .sg-links a { color: var(--accent); font-weight: 600; }

.state-guide .sg-cite {
    margin: 0 0 0.25rem;
    font-family: var(--font-sans);
    font-size: 0.74rem;
    line-height: 1.7;
    color: var(--sg-muted);
}

.state-guide .sg-cite a { color: var(--sg-muted); text-decoration: underline; text-decoration-color: var(--border); }
.state-guide .sg-cite a:hover { color: var(--accent); }

/* ── Fee bars (inside .tye-fig) ── */
.state-guide .sg-bars { margin: 0.25rem 0 0; padding: 0; list-style: none; }

.state-guide .sg-bar-row {
    display: grid;
    grid-template-columns: 10.5rem 1fr;
    gap: 0.75rem;
    align-items: center;
    margin: 0 0 0.9rem;
}

.state-guide .sg-bar-label {
    font-family: var(--font-sans);
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--ink);
}

.state-guide .sg-bar-track { display: flex; align-items: center; gap: 0.6rem; }

.state-guide .sg-bar {
    display: flex;
    flex: none;
    width: calc((100% - 4.4rem) * var(--r, 1));
    height: 2.4rem;
    min-width: 0;
    border-radius: 3px;
    overflow: hidden;
}

.state-guide .sg-seg {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 700;
    color: #0b1020;
    border-right: 2px solid #fff;
}

.state-guide .sg-seg:last-child { border-right: 0; }
.state-guide .sg-seg--filing { background: var(--sg-navy); }
.state-guide .sg-seg--list { background: var(--sg-gold); }
.state-guide .sg-seg--license { background: var(--sg-slate); }

.state-guide .sg-bar-total {
    flex: none;
    width: 3.2rem;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink);
}

.state-guide .sg-bar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.25rem;
    margin: 0.5rem 0 0;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--text-light);
}

.state-guide .sg-bar-legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.state-guide .sg-bar-legend i { width: 11px; height: 11px; border-radius: 2px; display: inline-block; }

.state-guide .tye-fig .sg-cite {
    margin: 0.9rem 0 0;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

@media (max-width: 640px) {
    .state-guide .sg-bar-row { grid-template-columns: 1fr; gap: 0.35rem; }
}

/* ── Ways-to-apply cards (the EIN article uses these too) ── */
.state-guide .sg-routes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.9rem;
    margin: 0.25rem 0 0;
    padding: 0;
    list-style: none;
}

.state-guide .sg-route {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin: 0;
    padding: 1.1rem 1.1rem 1.15rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-top: 4px solid var(--sg-navy);
    border-radius: 4px;
}

.state-guide .sg-route--fax { border-top-color: var(--sg-gold); }
.state-guide .sg-route--mail { border-top-color: var(--sg-slate); }

.state-guide .sg-route-kicker {
    font-family: var(--font-sans);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--sg-muted);
}

.state-guide .sg-route-time {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--ink);
}

.state-guide .sg-route-sub {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-light);
}

.state-guide .sg-route-who {
    margin-top: 0.55rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border-light);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-light);
}

@media (max-width: 640px) {
    .state-guide .sg-routes { grid-template-columns: 1fr; }
}

/* ── Tables that carry a link or a phone number ── */
.state-guide table a { color: var(--accent); font-weight: 600; }
.state-guide td .sg-sub { display: block; margin-top: 0.2rem; font-size: 0.78rem; line-height: 1.45; color: var(--sg-muted); }
.state-guide td .sg-cite { margin: 0.45rem 0 0; font-size: 0.7rem; line-height: 1.6; }
.state-guide td.sg-amt { text-align: right; white-space: nowrap; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.post-body .state-guide table thead th:nth-child(2) { white-space: nowrap; }

/* Fee-table stage headers: a quiet band, not a zebra row. */
.post-body .state-guide table tbody tr.sg-group,
.post-body .state-guide table tbody tr.sg-group:nth-child(even) { background: var(--bg-alt); }
.state-guide tr.sg-group th {
    padding: 1.05rem 0.9rem 0.45rem;
    border-bottom: 2px solid var(--gold);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-align: left;
    text-transform: uppercase;
    color: var(--gold-ink);
}

/* ── Local jurisdictions ── */
.state-guide .sg-local { margin: 0 0 1.5rem; }

.post-body .sg-local h3 { margin: 1.75rem 0 0.6rem; }

.state-guide .sg-local-link { margin: 0 0 1rem; font-family: var(--font-sans); font-size: 0.88rem; }
.state-guide .sg-local-link a { color: var(--accent); font-weight: 600; }

.state-guide .sg-variant {
    margin-top: 2.5rem;
    padding: 1.75rem 1.6rem 1rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-top: 3px solid var(--gold);
    border-radius: var(--radius);
}

.post-body .sg-tax h3 { margin: 1.5rem 0 0.4rem; font-size: 1.08rem; }
.state-guide .sg-tax p { margin: 0 0 0.5rem; }

.state-guide .sg-help li { margin-bottom: 0.65rem; }
.state-guide .sg-help .sg-help-what { display: block; margin-top: 0.1rem; color: var(--text-light); font-weight: 400; }

.state-guide .sg-fine {
    margin: 0.6rem 0 0;
    font-family: var(--font-sans);
    font-size: 0.78rem;
    color: var(--sg-muted);
}

/* ── Glossary ── */
.state-guide .sg-gloss { margin: 1.5rem 0; }

.state-guide .sg-gloss dt {
    margin: 1.1rem 0 0.15rem;
    font-family: var(--font-sans);
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--ink);
}

.state-guide .sg-gloss dd { margin: 0; color: var(--text-light); font-size: 0.97rem; line-height: 1.65; }

/* ── Related reading ── */
.state-guide .sg-related { margin: 1rem 0 2rem; padding: 0; list-style: none; }

.state-guide .sg-related li {
    margin: 0 0 0.7rem;
    padding: 0 0 0.7rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.95rem;
}

.state-guide .sg-related a { color: var(--accent); font-weight: 600; }
.state-guide .sg-related .sg-why { display: block; color: var(--sg-muted); font-size: 0.85rem; }

/* ── Sources ── */
.state-guide .sg-sources {
    margin: 2.5rem 0 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    font-family: var(--font-sans);
}

.state-guide .sg-sources h2.sg-sources-title {
    margin: 0 0 0.75rem;
    padding: 0;
    border: 0;
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--sg-muted);
}

.state-guide .sg-sources ol { margin: 0 0 1rem; padding-left: 1.4rem; font-size: 0.82rem; line-height: 1.55; color: var(--text-light); }
.state-guide .sg-sources li { margin: 0 0 0.35rem; }
.state-guide .sg-sources a { color: var(--accent); }
.state-guide .sg-sources .sg-kind { color: var(--sg-muted); }
.state-guide .sg-sources p { font-size: 0.8rem; line-height: 1.6; color: var(--sg-muted); margin: 0; }

@media print {
    .state-guide .sg-download,
.state-guide .sg-peek { display: none; }
}


/* ── Data tables become stacked rows on a phone, so nothing scrolls sideways ── */
@media (max-width: 640px) {
    .post-body .state-guide table.sg-table {
        display: block;
        overflow: visible;
    }

    .state-guide table.sg-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .state-guide table.sg-table tbody,
    .state-guide table.sg-table tr,
    .state-guide table.sg-table td,
    .state-guide table.sg-table th {
        display: block;
    }

    .state-guide table.sg-table caption { display: block; }

    .post-body .state-guide table.sg-table tbody tr {
        padding: 0.85rem 0.9rem;
        border-bottom: 1px solid var(--border);
    }

    .post-body .state-guide table.sg-table tbody tr.sg-group {
        padding: 0;
        border-bottom: 0;
    }

    .post-body .state-guide table.sg-table td {
        padding: 0.2rem 0;
        border: 0;
    }

    .state-guide table.sg-table td::before {
        content: attr(data-label);
        display: block;
        margin-top: 0.35rem;
        font-size: 0.64rem;
        font-weight: 700;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: var(--sg-muted);
    }

    .state-guide table.sg-table td:first-child::before { display: none; }

    .state-guide table.sg-table td:first-child {
        font-weight: 600;
        color: var(--ink);
    }

    .state-guide table.sg-table td.sg-amt { text-align: left; }
}
