:root {
    --stsl-blue: #1b467a;
    --stsl-blue-dark: #102f55;
    --stsl-burgundy: #9a183c;
    --stsl-burgundy-dark: #73112c;
    --stsl-text: #172033;
    --stsl-muted: #5e6878;
    --stsl-border: #dfe4eb;
    --stsl-light: #f5f7fa;
    --stsl-white: #ffffff;
    --stsl-shadow: 0 16px 40px rgba(19, 36, 61, 0.09);
    --stsl-radius: 14px;
}

.stsl-library *,
.stsl-standard-guide * {
    box-sizing: border-box;
}

.stsl-library,
.stsl-standard-guide {
    color: var(--stsl-text);
    font-size: 17px;
    line-height: 1.7;
}

.stsl-container {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.stsl-library h1,
.stsl-library h2,
.stsl-library h3,
.stsl-standard-guide h1,
.stsl-standard-guide h2,
.stsl-standard-guide h3 {
    color: var(--stsl-blue-dark);
    line-height: 1.2;
    margin-top: 0;
}

.stsl-library h1,
.stsl-standard-guide h1 {
    font-size: clamp(2.25rem, 5vw, 4.2rem);
    letter-spacing: -0.035em;
    margin-bottom: 22px;
}

.stsl-library h2,
.stsl-standard-guide h2 {
    font-size: clamp(1.65rem, 3vw, 2.4rem);
    letter-spacing: -0.02em;
}

.stsl-eyebrow {
    color: var(--stsl-burgundy);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    margin: 0 0 14px;
    text-transform: uppercase;
}

.stsl-button {
    align-items: center;
    border: 2px solid transparent;
    border-radius: 8px;
    display: inline-flex;
    font-size: 0.93rem;
    font-weight: 750;
    justify-content: center;
    min-height: 50px;
    padding: 11px 23px;
    text-decoration: none;
    transition:
        background-color 180ms ease,
        border-color 180ms ease,
        color 180ms ease,
        transform 180ms ease;
}

.stsl-button:hover {
    transform: translateY(-2px);
}

.stsl-button:focus-visible,
.stsl-card-link:focus-visible,
.stsl-standard-card h3 a:focus-visible,
.stsl-toc a:focus-visible {
    outline: 3px solid #f0b323;
    outline-offset: 3px;
}

.stsl-button-primary {
    background: var(--stsl-burgundy);
    border-color: var(--stsl-burgundy);
    color: var(--stsl-white);
}

.stsl-button-primary:hover {
    background: var(--stsl-burgundy-dark);
    border-color: var(--stsl-burgundy-dark);
    color: var(--stsl-white);
}

.stsl-button-secondary {
    background: var(--stsl-white);
    border-color: var(--stsl-blue);
    color: var(--stsl-blue);
}

.stsl-button-secondary:hover {
    background: var(--stsl-blue);
    color: var(--stsl-white);
}

.stsl-button-light {
    background: var(--stsl-white);
    border-color: var(--stsl-white);
    color: var(--stsl-blue-dark);
}

.stsl-button-light:hover {
    background: transparent;
    color: var(--stsl-white);
}

.stsl-button-outline-light {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.72);
    color: var(--stsl-white);
}

.stsl-button-outline-light:hover {
    background: var(--stsl-white);
    border-color: var(--stsl-white);
    color: var(--stsl-blue-dark);
}

/* Standards archive hero */

.stsl-hero,
.stsl-guide-hero {
    background:
        radial-gradient(
            circle at 85% 10%,
            rgba(255, 255, 255, 0.13),
            transparent 32%
        ),
        linear-gradient(135deg, var(--stsl-blue-dark), var(--stsl-blue));
    color: var(--stsl-white);
    overflow: hidden;
    position: relative;
}

.stsl-hero {
    padding: clamp(76px, 10vw, 132px) 0;
}

.stsl-hero .stsl-container {
    max-width: 940px;
    margin-left: max(20px, calc((100vw - 1180px) / 2));
}

.stsl-hero h1,
.stsl-guide-hero h1 {
    color: var(--stsl-white);
}

.stsl-hero .stsl-eyebrow,
.stsl-guide-hero .stsl-eyebrow {
    color: #f3c5d2;
}

.stsl-hero-intro {
    font-size: clamp(1.08rem, 2vw, 1.32rem);
    max-width: 850px;
    margin: 0 0 24px;
}

.stsl-disclaimer {
    border-left: 3px solid #f3c5d2;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.92rem;
    margin: 30px 0 0;
    max-width: 790px;
    padding-left: 16px;
}

/* Standards finder */

.stsl-finder {
    background: var(--stsl-light);
    padding: clamp(62px, 8vw, 100px) 0;
}

.stsl-section-heading {
    max-width: 800px;
}

.stsl-section-heading > p:last-child {
    color: var(--stsl-muted);
}

.stsl-filter-form {
    background: var(--stsl-white);
    border: 1px solid var(--stsl-border);
    border-radius: var(--stsl-radius);
    box-shadow: var(--stsl-shadow);
    margin-top: 36px;
    padding: clamp(24px, 4vw, 42px);
}

.stsl-search-field,
.stsl-filter-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stsl-search-field label,
.stsl-filter-field label {
    color: var(--stsl-blue-dark);
    font-size: 0.86rem;
    font-weight: 750;
}

.stsl-search-field input,
.stsl-filter-field select {
    appearance: none;
    background-color: var(--stsl-white);
    border: 1px solid #c9d0db;
    border-radius: 7px;
    color: var(--stsl-text);
    font: inherit;
    min-height: 52px;
    padding: 11px 14px;
    width: 100%;
}

.stsl-filter-field select {
    background-image:
        linear-gradient(45deg, transparent 50%, var(--stsl-blue) 50%),
        linear-gradient(135deg, var(--stsl-blue) 50%, transparent 50%);
    background-position:
        calc(100% - 19px) 22px,
        calc(100% - 14px) 22px;
    background-repeat: no-repeat;
    background-size: 5px 5px;
    padding-right: 40px;
}

.stsl-search-field input:focus,
.stsl-filter-field select:focus {
    border-color: var(--stsl-blue);
    box-shadow: 0 0 0 3px rgba(27, 70, 122, 0.13);
    outline: none;
}

.stsl-filter-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 20px;
}

.stsl-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

/* Results */

.stsl-results {
    padding: clamp(66px, 8vw, 108px) 0;
}

.stsl-results-header {
    align-items: end;
    display: flex;
    justify-content: space-between;
    margin-bottom: 34px;
}

.stsl-results-header h2 {
    margin-bottom: 0;
}

.stsl-results-header p {
    color: var(--stsl-muted);
    margin: 0;
}

.stsl-card-grid {
    display: grid;
    gap: 22px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stsl-standard-card {
    background: var(--stsl-white);
    border: 1px solid var(--stsl-border);
    border-radius: var(--stsl-radius);
    display: flex;
    flex-direction: column;
    min-height: 310px;
    padding: 28px;
    position: relative;
    transition:
        border-color 180ms ease,
        box-shadow 180ms ease,
        transform 180ms ease;
}

.stsl-standard-card:hover {
    border-color: rgba(27, 70, 122, 0.45);
    box-shadow: var(--stsl-shadow);
    transform: translateY(-4px);
}

.stsl-standard-card::before {
    background: var(--stsl-burgundy);
    border-radius: 14px 14px 0 0;
    content: "";
    height: 4px;
    inset: 0 0 auto;
    position: absolute;
}

.stsl-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 18px;
}

.stsl-card-meta span {
    background: #edf2f8;
    border-radius: 999px;
    color: var(--stsl-blue);
    font-size: 0.72rem;
    font-weight: 750;
    padding: 4px 10px;
}

.stsl-standard-card h3 {
    font-size: 1.4rem;
    margin-bottom: 14px;
}

.stsl-standard-card h3 a {
    color: var(--stsl-blue-dark);
    text-decoration: none;
}

.stsl-standard-card p {
    color: var(--stsl-muted);
    font-size: 0.94rem;
    margin: 0 0 24px;
}

.stsl-card-link {
    color: var(--stsl-burgundy);
    display: inline-flex;
    font-size: 0.9rem;
    font-weight: 800;
    gap: 8px;
    margin-top: auto;
    text-decoration: none;
}

.stsl-card-link:hover {
    color: var(--stsl-burgundy-dark);
}

.stsl-pagination {
    margin-top: 46px;
}

.stsl-pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.stsl-pagination .page-numbers {
    align-items: center;
    border: 1px solid var(--stsl-border);
    border-radius: 6px;
    color: var(--stsl-blue);
    display: inline-flex;
    justify-content: center;
    min-height: 42px;
    min-width: 42px;
    padding: 6px 12px;
    text-decoration: none;
}

.stsl-pagination .page-numbers.current,
.stsl-pagination .page-numbers:hover {
    background: var(--stsl-blue);
    border-color: var(--stsl-blue);
    color: var(--stsl-white);
}

.stsl-no-results {
    background: var(--stsl-light);
    border-radius: var(--stsl-radius);
    padding: clamp(30px, 5vw, 56px);
    text-align: center;
}

/* Standard guide */

.stsl-guide-hero {
    padding: clamp(62px, 9vw, 112px) 0;
}

.stsl-breadcrumbs {
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.82rem;
    gap: 9px;
    margin-bottom: 38px;
}

.stsl-breadcrumbs a {
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
}

.stsl-guide-subtitle {
    font-size: clamp(1.05rem, 2vw, 1.3rem);
    font-weight: 650;
    margin: -8px 0 22px;
    max-width: 880px;
}

.stsl-guide-summary {
    color: rgba(255, 255, 255, 0.86);
    font-size: 1.08rem;
    max-width: 850px;
}

.stsl-guide-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 34px;
}

.stsl-guide-body {
    background: var(--stsl-light);
    padding: clamp(60px, 8vw, 100px) 0;
}

.stsl-guide-layout {
    align-items: start;
    display: grid;
    gap: clamp(30px, 5vw, 64px);
    grid-template-columns: minmax(245px, 310px) minmax(0, 1fr);
}

.stsl-guide-sidebar {
    display: grid;
    gap: 22px;
    position: sticky;
    top: 28px;
}

.stsl-facts-card,
.stsl-toc {
    background: var(--stsl-white);
    border: 1px solid var(--stsl-border);
    border-radius: 12px;
    padding: 25px;
}

.stsl-facts-card h2,
.stsl-toc h2 {
    font-size: 1.08rem;
    margin-bottom: 18px;
}

.stsl-facts-card dl {
    margin: 0;
}

.stsl-facts-card dl > div {
    border-top: 1px solid var(--stsl-border);
    padding: 13px 0;
}

.stsl-facts-card dt {
    color: var(--stsl-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.stsl-facts-card dd {
    color: var(--stsl-text);
    font-size: 0.92rem;
    font-weight: 650;
    margin: 3px 0 0;
}

.stsl-official-link {
    color: var(--stsl-burgundy);
    display: inline-flex;
    font-size: 0.84rem;
    font-weight: 800;
    gap: 6px;
    margin-top: 16px;
    text-decoration: none;
}

.stsl-toc ol {
    display: grid;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.stsl-toc a {
    color: var(--stsl-muted);
    font-size: 0.84rem;
    text-decoration: none;
}

.stsl-toc a:hover {
    color: var(--stsl-burgundy);
}

.stsl-guide-content {
    min-width: 0;
}

.stsl-content-section {
    background: var(--stsl-white);
    border: 1px solid var(--stsl-border);
    border-radius: 12px;
    margin-bottom: 24px;
    padding: clamp(25px, 5vw, 46px);
    scroll-margin-top: 30px;
}

.stsl-content-section h2 {
    border-bottom: 2px solid #edf0f4;
    margin-bottom: 24px;
    padding-bottom: 16px;
}

.stsl-rich-text > :first-child,
.stsl-content-section > :first-child {
    margin-top: 0;
}

.stsl-rich-text > :last-child,
.stsl-content-section > :last-child {
    margin-bottom: 0;
}

.stsl-rich-text p,
.stsl-rich-text li,
.stsl-content-section p,
.stsl-content-section li {
    color: #3f4958;
}

.stsl-rich-text ul,
.stsl-rich-text ol {
    padding-left: 1.35em;
}

.stsl-rich-text li + li {
    margin-top: 8px;
}

.stsl-rich-text table {
    border-collapse: collapse;
    display: block;
    max-width: 100%;
    overflow-x: auto;
    width: 100%;
}

.stsl-rich-text th,
.stsl-rich-text td {
    border: 1px solid var(--stsl-border);
    padding: 12px 14px;
    text-align: left;
}

.stsl-rich-text th {
    background: var(--stsl-blue-dark);
    color: var(--stsl-white);
}

.stsl-related-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stsl-related-grid a {
    border: 1px solid var(--stsl-border);
    border-radius: 9px;
    color: var(--stsl-blue-dark);
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 18px;
    text-decoration: none;
}

.stsl-related-grid a:hover {
    border-color: var(--stsl-burgundy);
}

.stsl-related-grid span {
    color: var(--stsl-muted);
    font-size: 0.85rem;
}

.stsl-legal-note {
    background: #fff8ea;
    border-left: 5px solid #d79513;
    border-radius: 8px;
    padding: 24px 27px;
}

.stsl-legal-note h2 {
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.stsl-legal-note p {
    color: #5c4b28;
    font-size: 0.86rem;
    margin: 0;
}

/* Shared CTA */

.stsl-assessment {
    background: linear-gradient(135deg, var(--stsl-burgundy-dark), var(--stsl-burgundy));
    color: var(--stsl-white);
    padding: clamp(56px, 7vw, 86px) 0;
}

.stsl-assessment-inner {
    align-items: center;
    display: flex;
    gap: 40px;
    justify-content: space-between;
}

.stsl-assessment h2 {
    color: var(--stsl-white);
    margin-bottom: 12px;
}

.stsl-assessment .stsl-eyebrow {
    color: #f5c8d4;
}

.stsl-assessment p:last-child {
    color: rgba(255, 255, 255, 0.84);
    margin-bottom: 0;
    max-width: 800px;
}

/* Responsive */

@media (max-width: 960px) {
    .stsl-filter-grid,
    .stsl-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stsl-filter-field:last-child {
        grid-column: 1 / -1;
    }

    .stsl-guide-layout {
        grid-template-columns: 1fr;
    }

    .stsl-guide-sidebar {
        position: static;
    }

    .stsl-toc {
        display: none;
    }
}

@media (max-width: 680px) {
    .stsl-container {
        width: min(100% - 28px, 1180px);
    }

    .stsl-hero .stsl-container {
        margin-left: auto;
    }

    .stsl-filter-grid,
    .stsl-card-grid,
    .stsl-related-grid {
        grid-template-columns: 1fr;
    }

    .stsl-filter-field:last-child {
        grid-column: auto;
    }

    .stsl-results-header,
    .stsl-assessment-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .stsl-standard-card {
        min-height: 0;
    }

    .stsl-button,
    .stsl-filter-actions .stsl-button {
        width: 100%;
    }

    .stsl-guide-actions {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    .stsl-button,
    .stsl-standard-card {
        transition: none;
    }
}
