/* Legal / text pages (shop.pen PPtZA / VkMJd). Scope to .pen-legal — do not set * / body font-family. */

body:has(.pen-legal) {
    background: var(--pen-bg);
}

.pen-legal {
    font-family: var(--pen-font-body);
    color: var(--pen-text);
    padding: 0 0 72px;
}

.pen-legal__hero {
    margin: 0 0 36px;
}

.pen-legal__eyebrow {
    margin: 0 0 8px;
    font-family: var(--pen-font-head);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--pen-brand);
}

.pen-legal__heading {
    margin: 0 0 12px;
    font-family: var(--pen-font-head);
    font-size: 40px;
    font-weight: 800;
    line-height: 1.15;
    color: var(--pen-ink-navy);
}

.pen-legal__lead {
    margin: 0 0 18px;
    font-size: 16px;
    line-height: 1.5;
    color: var(--pen-text-muted);
}

.pen-legal__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.pen-legal__edition {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--pen-sky-50);
    border-radius: 10px;
    font-family: var(--pen-font-head);
    font-size: 13px;
    font-weight: 700;
    color: var(--pen-brand-ink);
}

.pen-legal__print {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 14px;
    background: var(--pen-bg);
    border: 1px solid var(--pen-line);
    border-radius: 10px;
    font-family: var(--pen-font-head);
    font-size: 13px;
    font-weight: 700;
    color: var(--pen-text);
    cursor: pointer;
}

.pen-legal__print:hover,
.pen-legal__print:focus {
    border-color: var(--pen-brand);
    color: var(--pen-brand-ink);
    outline: none;
}

.pen-legal__layout {
    display: flex;
    align-items: flex-start;
    gap: 40px;
}

.pen-legal__toc {
    flex: 0 0 280px;
    position: sticky;
    top: 96px;
    z-index: 1;
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 18px 16px;
    background: var(--pen-bg-soft);
    border: 1px solid var(--pen-line);
    border-radius: 16px;
}

.pen-legal__toc-title {
    margin: 0 0 12px;
    font-family: var(--pen-font-head);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--pen-text-muted);
}

.pen-legal__toc-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.pen-legal__toc-item {
    margin: 0;
}

.pen-legal__toc-item a {
    display: block;
    padding: 7px 8px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.35;
    color: var(--pen-text);
    text-decoration: none;
}

.pen-legal__toc-item--h3 a {
    padding-left: 16px;
    color: var(--pen-text-muted);
}

.pen-legal__toc-item a:hover,
.pen-legal__toc-item a:focus {
    background: var(--pen-sky-50);
    color: var(--pen-brand-ink);
    text-decoration: none;
}

.pen-legal__main {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 800px;
}

.pen-legal:not(.pen-legal--with-toc) .pen-legal__main {
    max-width: 800px;
}

.pen-legal__body {
    font-size: 15px;
    line-height: 1.7;
    color: var(--pen-text);
}

.pen-legal__body h2,
.pen-legal__body h3 {
    margin: 32px 0 12px;
    font-family: var(--pen-font-head);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.3;
    color: var(--pen-ink-navy);
}

.pen-legal__body h3 {
    font-size: 18px;
}

.pen-legal__body p {
    margin: 0 0 14px;
}

.pen-legal__body ul,
.pen-legal__body ol {
    margin: 0 0 16px;
    padding-left: 22px;
}

.pen-legal__body li {
    margin: 0 0 6px;
}

.pen-legal__body a,
.pen-legal__body a.href {
    color: var(--pen-brand);
    text-decoration: underline;
}

.pen-legal__body a:hover {
    color: var(--pen-brand-deep);
}

.pen-legal__body p:has(> b:first-child),
.pen-legal__body p:has(> strong:first-child) {
    padding: 14px 16px;
    background: var(--pen-bg);
    border: 1px solid var(--pen-line);
    border-left: 3px solid var(--pen-sky);
    border-radius: 12px;
}

.pen-legal__body img {
    max-width: 100%;
    height: auto;
    margin: 8px 8px 8px 0;
    vertical-align: middle;
}

.pen-legal__related {
    margin-top: 48px;
}

.pen-legal__related-title {
    margin: 0 0 16px;
    font-family: var(--pen-font-head);
    font-size: 22px;
    font-weight: 800;
    color: var(--pen-ink-navy);
}

.pen-legal__related-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.pen-legal__related-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 18px;
    background: var(--pen-bg);
    border: 1px solid var(--pen-line);
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
}

.pen-legal__related-card:hover,
.pen-legal__related-card:focus {
    border-color: var(--pen-brand);
    text-decoration: none;
    color: inherit;
}

.pen-legal__related-name {
    font-family: var(--pen-font-head);
    font-size: 15px;
    font-weight: 800;
    color: var(--pen-ink-navy);
}

.pen-legal__related-hint {
    font-size: 13px;
    color: var(--pen-text-muted);
}

.pen-legal__cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 28px;
    padding: 28px 32px;
    background: linear-gradient(135deg, var(--pen-sky-50), var(--pen-sky-100));
    border-radius: 20px;
    overflow: hidden;
}

.pen-legal__cta-title {
    margin: 0 0 6px;
    font-family: var(--pen-font-head);
    font-size: 22px;
    font-weight: 800;
    color: var(--pen-ink-navy);
}

.pen-legal__cta-text {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: var(--pen-text-muted);
}

.pen-legal__cta-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 22px;
    background: var(--pen-brand);
    border-radius: 12px;
    font-family: var(--pen-font-head);
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
}

.pen-legal__cta-btn:hover,
.pen-legal__cta-btn:focus {
    background: var(--pen-brand-deep);
    color: #fff;
    text-decoration: none;
}

@media (max-width: 991px) {
    .pen-legal__layout {
        flex-direction: column;
        gap: 24px;
    }

    .pen-legal__toc {
        flex: none;
        width: 100%;
        position: static;
        max-height: none;
    }

    .pen-legal__main {
        max-width: none;
    }
}

@media (max-width: 767px) {
    .pen-legal {
        padding-bottom: 40px;
    }

    .pen-legal__heading {
        font-size: 28px;
    }

    .pen-legal__related-grid {
        grid-template-columns: 1fr;
    }

    .pen-legal__cta {
        flex-direction: column;
        align-items: stretch;
        padding: 22px;
    }

    .pen-legal__cta-btn {
        width: 100%;
    }
}

@media print {
    .pen-header,
    .pen-footer,
    .breadcrumbs,
    .pen-legal__toc,
    .pen-legal__related,
    .pen-legal__cta,
    .pen-legal__print {
        display: none !important;
    }

    .pen-legal__layout,
    .pen-legal__main {
        display: block;
        max-width: none;
    }
}
