/**
 * Legal / Privacy page — Pencil design match.
 *
 * Scoped to page-templates/template-legal.php only. Values (hex, px)
 * are copied directly from the .pen source; colors that don't have a
 * matching design token in style.css are kept as literal hex.
 */

/* ==========================================================================
   Section
   ========================================================================== */

.cst-pencil-legal.cst-section {
    background: var(--cst-color-white);
    padding-block: var(--cst-space-3xl);
}

.cst-pencil-legal__layout {
    display: flex;
    align-items: flex-start;
    gap: 56px;
}

/* ==========================================================================
   TOC Sidebar
   ========================================================================== */

.cst-pencil-legal__toc {
    flex: 0 0 280px;
    width: 280px;
    box-sizing: border-box;
    position: sticky;
    top: 120px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 24px;
    background: #F4F7FC;
    border: 1px solid #E3E9F4;
    border-radius: 14px;
}

.cst-pencil-legal__toc-title {
    margin: 0 0 4px;
    font-family: var(--cst-font-body);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #8791A8;
}

#cst-toc-nav {
    display: block;
}

.cst-pencil-legal__toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cst-pencil-legal__toc-item {
    margin: 0;
}

.cst-pencil-legal__toc-item--sub {
    padding-left: 1em;
}

.cst-pencil-legal__toc-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    text-decoration: none;
    background: transparent;
    transition: background-color 0.15s ease;
}

.cst-pencil-legal__toc-link:hover,
.cst-pencil-legal__toc-link:focus-visible {
    background: #EAF0FB;
}

.cst-pencil-legal__toc-bar {
    flex: 0 0 3px;
    width: 3px;
    height: 16px;
    border-radius: 2px;
    background: transparent;
    transition: background-color 0.15s ease;
}

.cst-pencil-legal__toc-label {
    font-family: var(--cst-font-body);
    font-size: 14px;
    font-weight: 500;
    color: #5B6680;
    transition: color 0.15s ease, font-weight 0.15s ease;
}

.cst-pencil-legal__toc-link.is-active {
    background: #EAF0FB;
}

.cst-pencil-legal__toc-link.is-active .cst-pencil-legal__toc-bar {
    background: var(--cst-color-blue-primary);
}

.cst-pencil-legal__toc-link.is-active .cst-pencil-legal__toc-label {
    color: var(--cst-color-navy);
    font-weight: 700;
}

/* ==========================================================================
   Content
   ========================================================================== */

.cst-pencil-legal__content {
    flex: 1 1 auto;
    min-width: 0;
}

.cst-pencil-legal__content > :last-child {
    margin-bottom: 0;
}

.cst-pencil-legal__updated {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 28px;
    padding: 9px 14px;
    border-radius: 20px;
    background: #EAF0FB;
    color: #5B6680;
    font-family: var(--cst-font-body);
    font-size: 13px;
    font-weight: 600;
}

.cst-pencil-legal__updated-icon {
    flex: 0 0 auto;
    color: var(--cst-color-blue-primary);
}

.cst-pencil-legal__content h2 {
    margin: 28px 0 10px;
    font-family: var(--cst-font-heading);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--cst-color-navy);
}

.cst-pencil-legal__content > h2:first-of-type {
    margin-top: 0;
}

.cst-pencil-legal__content h3 {
    margin: 20px 0 10px;
    font-family: var(--cst-font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--cst-color-navy);
}

.cst-pencil-legal__content p {
    margin: 0 0 16px;
    font-family: var(--cst-font-body);
    font-size: 16px;
    font-weight: normal;
    line-height: 1.7;
    color: #5B6680;
}

.cst-pencil-legal__content ul,
.cst-pencil-legal__content ol {
    margin: 0 0 16px;
    padding-left: var(--cst-space-xl);
    font-family: var(--cst-font-body);
    font-size: 16px;
    line-height: 1.7;
    color: #5B6680;
}

.cst-pencil-legal__content li {
    margin-bottom: 6px;
}

.cst-pencil-legal__content a {
    color: var(--cst-color-blue-dark);
    text-decoration: underline;
}

.cst-pencil-legal__content a:hover,
.cst-pencil-legal__content a:focus-visible {
    color: var(--cst-color-navy);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
    .cst-pencil-legal__layout {
        gap: 32px;
    }

    .cst-pencil-legal__toc {
        flex-basis: 240px;
        width: 240px;
    }
}

@media (max-width: 768px) {
    .cst-pencil-legal__layout {
        flex-direction: column;
    }

    .cst-pencil-legal__toc {
        position: static;
        width: 100%;
        flex-basis: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cst-pencil-legal__toc-link,
    .cst-pencil-legal__toc-bar,
    .cst-pencil-legal__toc-label {
        transition: none;
    }
}
