/* The document template, shared by the Privacy Policy, the Customer Terms, the service terms,
   the product pages and their archives. Loaded after site.css and before the page's own
   <style>. */

/* Policy document */
.policy {
    max-width: 800px;
    margin: 0 auto;
}

.policy-header {
    margin-bottom: var(--space-8);
}

.policy-title {
    font-size: var(--text-4xl);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    margin-bottom: var(--space-3);
}

.policy-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
    list-style: none;
    color: var(--text-muted);
    font-size: var(--text-base);
    margin-bottom: var(--space-6);
}

/* The version line is a list too: keep it flush with the title, not indented like body lists */
.policy .policy-meta {
    padding-left: 0;
}

.policy-preamble {
    font-size: var(--text-xl);
    color: var(--text-secondary);
}

/* Archived version notice, above the title */
.policy-archive-notice {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--brand-blue);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-5);
    margin-bottom: var(--space-8);
    color: var(--text-secondary);
    font-size: var(--text-md);
}

.policy .policy-archive-notice p {
    margin: 0;
}

/* Table of contents */
.policy-toc {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin-bottom: var(--space-10);
}

.policy-toc-label {
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: var(--space-4);
}

.policy-toc ol {
    list-style: none;
    columns: 2;
    column-gap: var(--space-8);
}

.policy-toc li {
    break-inside: avoid;
    margin-bottom: var(--space-2);
}

.policy-toc a {
    display: inline-block;
    color: var(--text-secondary);
    font-size: var(--text-md);
    transition: color var(--transition-fast);
}

.policy-toc a:hover {
    color: var(--link-color);
}

/* Body text */
.policy h2 {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    margin: var(--space-12) 0 var(--space-4);
    scroll-margin-top: 6rem;
}

.policy h3 {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    line-height: var(--leading-tight);
    margin: var(--space-8) 0 var(--space-3);
    scroll-margin-top: 6rem;
}

.policy p {
    margin-bottom: var(--space-4);
}

.policy ul {
    padding-left: var(--space-6);
    margin-bottom: var(--space-4);
}

.policy > ol {
    padding-left: var(--space-6);
    margin-bottom: var(--space-4);
}

.policy li {
    margin-bottom: var(--space-2);
}

/* A list item with its own sub-list and follow-up paragraph */
.policy li > ul {
    margin-top: var(--space-2);
    margin-bottom: var(--space-2);
}

.policy li > p {
    margin-bottom: 0;
}

/* Divider between the policy body and its version history */
.policy hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: var(--space-12) 0 var(--space-8);
}

.policy hr + h2 {
    margin-top: 0;
}

.policy strong {
    font-weight: var(--font-semibold);
}

.policy p a,
.policy td a,
.policy > ul a,
.policy > ol a {
    color: var(--link-color);
    text-decoration: underline;
    text-underline-offset: 0.15em;
    overflow-wrap: anywhere;
    transition: color var(--transition-fast);
}

.policy p a:hover,
.policy td a:hover,
.policy > ul a:hover,
.policy > ol a:hover {
    color: var(--text-primary);
}

/* Tables */
.table-wrap {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin: var(--space-4) 0 var(--space-6);
    overflow-x: auto;
}

.policy table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-md);
    line-height: var(--leading-normal);
}

.policy th,
.policy td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border-color);
}

.policy th {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.policy tbody tr:last-child td {
    border-bottom: none;
}

.policy td:first-child {
    width: 42%;
    font-weight: var(--font-medium);
}

/* Version history: three equal columns */
.table-wrap--history table {
    table-layout: fixed;
}

.table-wrap--history th,
.table-wrap--history td:first-child {
    width: calc(100% / 3);
}

/* Service terms tables: Confluence's column widths (colgroup) as preferred widths. The
   automatic layout never squeezes a column below its longest word, so a table wider than
   the screen scrolls sideways inside its frame (.table-wrap) instead of overlapping. */
.table-wrap--sized td:first-child {
    width: auto;
}

/* Six or more columns: tighter cells so the table fits the page width */
.table-wrap--dense th,
.table-wrap--dense td {
    padding-left: var(--space-2);
    padding-right: var(--space-2);
}

.table-wrap--dense th:first-child,
.table-wrap--dense td:first-child {
    padding-left: var(--space-4);
}

.table-wrap--dense th {
    letter-spacing: 0;
}

.policy th.cell-center,
.policy td.cell-center {
    text-align: center;
}

/* A row that names the group of rows below it */
.policy td.table-group {
    background: var(--bg-tertiary);
}

/* Callouts: Confluence's warning and info panels, in Atlassian's colors (tokens in brand.css).
   Solid fill, no visible border (the transparent one shows in forced-colors mode). */
.callout {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    background: var(--callout-bg);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: var(--space-4) var(--space-5);
    margin: var(--space-4) 0;
}

.callout--warning {
    --callout-bg: var(--callout-warning-bg);
    --callout-icon: var(--callout-warning-icon);
}

.callout--info {
    --callout-bg: var(--callout-info-bg);
    --callout-icon: var(--callout-info-icon);
}

.callout svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 0.2em;
    color: var(--callout-icon);
}

.policy .callout p {
    margin-bottom: 0;
}

/* The version this page shows, marked in its Version history */
.history-this {
    color: var(--text-muted);
    font-size: var(--text-sm);
    white-space: nowrap;
}

@media (max-width: 768px) {
    .policy-title {
        font-size: var(--text-3xl);
    }

    .policy h2 {
        scroll-margin-top: 5rem;
    }

    .policy h3 {
        scroll-margin-top: 5rem;
    }
}

/* Mobile */
@media (max-width: 600px) {
    .policy-toc ol {
        columns: 1;
    }

    /* Tables keep their columns on phones (a check mark needs its plan's column) */
    .table-wrap--sized th,
    .table-wrap--sized td {
        padding: var(--space-2) var(--space-3);
    }

    /* Version history on phones: one block per version, as on the policy pages */
    .table-wrap--history table,
    .table-wrap--history tbody,
    .table-wrap--history tr,
    .table-wrap--history td {
        display: block;
    }

    .table-wrap--history thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .table-wrap--history tr {
        border-bottom: 1px solid var(--border-color);
    }

    .table-wrap--history tbody tr:last-child {
        border-bottom: none;
    }

    .table-wrap--history td {
        border-bottom: none;
    }

    .table-wrap--history td:first-child {
        width: auto;
        font-weight: var(--font-semibold);
        padding-bottom: 0;
    }
}

@media (max-width: 480px) {
    .policy-title {
        font-size: var(--text-2xl);
    }

    .policy-preamble {
        font-size: var(--text-lg);
    }

    .policy-toc {
        padding: var(--space-5);
    }
}

/* Print styles */
@media print {
    .header, .theme-toggle, .office-link {
        display: none;
    }

    .policy p a,
    .policy td a,
    .policy > ul a,
    .policy > ol a {
        color: inherit;
    }

    .policy h2 {
        break-after: avoid;
    }

    .policy-toc, .table-wrap, .callout, .office-card {
        border: 1px solid #ccc;
        break-inside: avoid;
    }

    .policy tr {
        break-inside: avoid;
    }
}
