/* Carzzy Apps: shared styles for the legal pages (Privacy Policy, Terms of Use).
   Load after /catalog/catalog.css. Behaviour lives in /legal.js. */

/* catalog.css sets overflow-x: hidden on body, which turns body into its own
   scroll box and stops position: sticky from following the window. clip hides
   sideways overflow the same way without doing that. */
body { overflow-x: clip; }

/* ---------- Header ---------- */
.pp-hero { padding-bottom: 8px; }
.pp-meta { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; }
.pp-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(21, 21, 21, 0.8);
    color: var(--dim);
    font-size: 0.85rem;
    font-weight: 600;
}
.pp-chip[hidden] { display: none; }
.pp-chip svg { color: var(--accent); flex: none; }
.pp-chip time { color: var(--text); }
.pp-switch { margin-top: 22px; }

/* ---------- Layout ---------- */
.pp-layout {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 48px;
    align-items: start;
    padding: 44px 0 90px;
}

/* ---------- "On this page" ---------- */
.pp-toc {
    position: sticky;
    top: 100px;
    z-index: 1;
}
.pp-toc-box {
    max-height: calc(100vh - 124px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
    padding: 20px 14px 14px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background:
        radial-gradient(260px 140px at 0% 0%, rgba(0, 209, 178, 0.10), transparent 70%),
        rgba(21, 21, 21, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
.pp-toc summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    list-style: none;
    cursor: pointer;
}
.pp-toc summary::-webkit-details-marker { display: none; }
.pp-toc-caret { flex: none; transition: transform 0.25s; }
.pp-toc-label { min-width: 0; }
.pp-toc-current { display: none; }
.pp-toc-box[open] .pp-toc-caret { transform: rotate(180deg); }

.pp-progress {
    height: 3px;
    margin: 14px 8px 12px;
    border-radius: 3px;
    background: var(--line-soft);
    overflow: hidden;
}
.pp-progress span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #00a88f, var(--accent));
    box-shadow: 0 0 10px var(--accent-glow);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.15s linear;
}

.pp-toc ol { counter-reset: pp-toc; margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.pp-toc li { counter-increment: pp-toc; }
.pp-toc ol a {
    position: relative;
    display: flex;
    gap: 10px;
    padding: 7px 10px 7px 12px;
    border-radius: 10px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.88rem;
    line-height: 1.35;
    transition: background 0.2s, color 0.2s;
}
.pp-toc ol a::before {
    content: counter(pp-toc, decimal-leading-zero);
    flex: none;
    min-width: 1.5em;
    color: var(--dim);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.6;
    font-variant-numeric: tabular-nums;
    transition: color 0.2s;
}
.pp-toc ol a::after {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 3px;
    background: var(--accent);
    transform: scaleY(0);
    transition: transform 0.25s;
}
.pp-toc ol a:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.pp-toc ol a.is-active { color: var(--text); background: var(--accent-soft); font-weight: 600; }
.pp-toc ol a.is-active::before { color: var(--accent); }
.pp-toc ol a.is-active::after { transform: scaleY(1); }

.pp-toc-top {
    display: block;
    margin: 12px 8px 0;
    padding-top: 12px;
    border-top: 1px solid var(--line-soft);
    color: var(--dim);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
}
.pp-toc-top:hover { color: var(--accent); }

/* ---------- Sections ---------- */
.pp-body { max-width: 780px; line-height: 1.75; color: #ddd; font-size: 1.02rem; }
.pp-body section {
    position: relative;
    padding: 30px 32px;
    margin-bottom: 18px;
    border: 1px solid var(--line-soft);
    border-radius: var(--r);
    background: rgba(21, 21, 21, 0.72);
    scroll-margin-top: 100px;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.pp-body section:hover { border-color: #2c2c2c; }
.pp-body section:target {
    border-color: var(--accent-line);
    box-shadow: 0 0 0 1px var(--accent-line), 0 0 34px rgba(0, 209, 178, 0.10);
}
.pp-body h2 {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin: 0 0 16px;
    color: var(--text);
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.25;
}
.pp-num {
    flex: none;
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
}
.pp-body h2 .pp-anchor {
    margin-left: auto;
    padding-left: 8px;
    color: var(--dim);
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
}
.pp-body section:hover .pp-anchor, .pp-body .pp-anchor:focus-visible { opacity: 1; }
.pp-body .pp-anchor:hover { color: var(--accent); }
.pp-body .pp-anchor.is-copied { opacity: 1; color: var(--accent); }
.pp-body .pp-anchor.is-copied::after { content: " Copied"; font-size: 0.75rem; font-weight: 700; }

.pp-body h3 { margin: 24px 0 8px; color: var(--text); font-size: 1.06rem; font-weight: 700; }
.pp-body p { margin: 0 0 12px; }
.pp-body p:last-child, .pp-body ul:last-child, .pp-body ol:last-child { margin-bottom: 0; }
.pp-body ul { margin: 0 0 12px; padding: 0; list-style: none; }
.pp-body ul li { position: relative; margin-bottom: 8px; padding-left: 22px; }
.pp-body ul li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 0.72em;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}
.pp-body strong { color: var(--text); }
.pp-body a { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
.pp-body a:hover { text-decoration-color: var(--accent); }

/* Last section ("Contact us") gets a friendlier card */
.pp-body section#contact {
    background:
        radial-gradient(420px 200px at 100% 0%, rgba(0, 209, 178, 0.14), transparent 70%),
        rgba(21, 21, 21, 0.85);
    border-color: var(--accent-line);
}

/* ---------- Smaller screens ---------- */
@media (max-width: 900px) {
    .pp-layout { grid-template-columns: 1fr; gap: 20px; padding-top: 28px; }
    .pp-toc { top: 84px; z-index: 2; }
    .pp-toc-box { max-height: calc(100vh - 110px); padding: 14px 12px; }
    .pp-toc summary { gap: 12px; padding: 4px 6px; }
    .pp-body section { scroll-margin-top: 172px; }
    /* Collapsed: show which section you're in under the label */
    .pp-toc-box:not([open]) .pp-toc-current {
        display: block;
        margin-top: 4px;
        overflow: hidden;
        color: var(--text);
        font-size: 0.92rem;
        font-weight: 700;
        letter-spacing: 0;
        text-transform: none;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
    .pp-progress { margin: 12px 6px 0; }
    .pp-toc-box[open] .pp-progress { margin-bottom: 10px; }
}
@media (max-width: 640px) {
    .pp-body section { padding: 22px 18px; }
    .pp-body h2 { font-size: 1.25rem; gap: 10px; }
    .pp-body h2 .pp-anchor { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .pp-progress span, .pp-toc ol a::after, .pp-toc-caret { transition: none; }
}

/* Numbered checklist (e.g. what to include in an infringement report) */
.pp-body ol.pp-steps {
    counter-reset: pp-step;
    list-style: none;
    margin: 4px 0 16px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.pp-body ol.pp-steps li {
    counter-increment: pp-step;
    position: relative;
    margin: 0;
    padding: 12px 16px 12px 54px;
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    background: var(--surface-2);
}
.pp-body ol.pp-steps li::before {
    content: counter(pp-step);
    position: absolute;
    left: 14px;
    top: 11px;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 800;
}

/* Highlighted note at the end of a section */
.pp-body .pp-callout {
    padding: 14px 18px;
    border-left: 3px solid var(--accent);
    border-radius: 0 12px 12px 0;
    background: var(--accent-soft);
    color: var(--text);
}
