/**
 * Peaches Mindcare — Client Documents
 * Screen + print styles for managed document pages.
 */

/* =========================================================
   TOOLBAR
   ========================================================= */
.peaches-doc-toolbar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin: 0 0 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--color-border, #EDD9CC);
}

/* Fallback styling in case the theme's .btn classes are unavailable */
.peaches-doc-print {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--color-peach, #E8956D);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.peaches-doc-print:hover,
.peaches-doc-print:focus {
    background: var(--color-peach-dark, #C97044);
}

.peaches-doc-back {
    color: var(--color-sage, #7A9E8A);
    text-decoration: none;
    font-weight: 600;
}

.peaches-doc-back:hover {
    text-decoration: underline;
}

/* =========================================================
   DOCUMENT META FOOTER
   ========================================================= */
.peaches-doc-meta {
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border, #EDD9CC);
}

.peaches-doc-meta p {
    font-size: 0.85rem;
    color: #7a6a60;
    margin: 0;
}

/* =========================================================
   HUB DOCUMENT LIST
   ========================================================= */
.peaches-doc-list {
    list-style: none;
    margin: 2rem 0;
    padding: 0;
    display: grid;
    gap: 1rem;
}

.peaches-doc-list__item {
    background: var(--color-off-white, #FDF8F5);
    border: 1px solid var(--color-border, #EDD9CC);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
}

.peaches-doc-list__link {
    font-family: var(--font-heading, 'Cormorant Garamond', Georgia, serif);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--color-warm-brown, #5C3D2E);
    text-decoration: none;
}

.peaches-doc-list__link:hover {
    color: var(--color-peach-dark, #C97044);
    text-decoration: underline;
}

.peaches-doc-list__desc {
    margin: 0.35rem 0 0;
    font-size: 0.95rem;
    color: #6b5a50;
}

/* =========================================================
   HAND-FILL FORM PRIMITIVES
   (used inside printable documents — filled in by pen)
   ========================================================= */
.peaches-field-line {
    display: inline-block;
    min-width: 220px;
    border-bottom: 1px solid #8a7a70;
    line-height: 1.8;
}

.peaches-field-line--short {
    min-width: 100px;
}

.peaches-field-line--long {
    min-width: 100%;
}

.peaches-checkbox {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 1.5px solid #5C3D2E;
    border-radius: 2px;
    margin-right: 0.5em;
    vertical-align: -2px;
}

.peaches-check-list {
    list-style: none;
    padding-left: 0;
    columns: 2;
    column-gap: 2.5rem;
}

.peaches-check-list li {
    margin-bottom: 0.5rem;
    break-inside: avoid;
}

.peaches-sig-block {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-top: 2.5rem;
    break-inside: avoid;
    page-break-inside: avoid;
}

.peaches-sig-block .peaches-sig-field {
    border-top: 1px solid #3A2E2A;
    padding-top: 0.4rem;
    font-size: 0.85rem;
    color: #5C3D2E;
}

.peaches-doc-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.peaches-doc-table th,
.peaches-doc-table td {
    border: 1px solid var(--color-border, #C9B8AC);
    padding: 0.6rem 0.9rem;
    text-align: left;
    vertical-align: top;
}

.peaches-doc-table th {
    background: var(--color-peach-light, #FFF0E6);
}

.peaches-initials {
    display: inline-block;
    min-width: 60px;
    border-bottom: 1px solid #8a7a70;
    margin-right: 0.5em;
}

.peaches-doc-callout {
    background: var(--color-sage-light, #EAF3EE);
    border-left: 4px solid var(--color-sage, #7A9E8A);
    border-radius: 0 8px 8px 0;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
}

@media (max-width: 600px) {
    .peaches-check-list {
        columns: 1;
    }

    .peaches-sig-block {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* =========================================================
   PRINT
   ========================================================= */
@media print {
    @page {
        margin: 2cm;
    }

    /*
     * Prevent the browser capping the printable area at the viewport
     * height — the most common cause of last-page truncation.
     */
    html,
    body {
        height: auto !important;
        overflow: visible !important;
    }

    .site-header,
    #site-header,
    #site-footer,
    .site-footer,
    .skip-link,
    .nav-toggle,
    .nav-overlay,
    .sidebar,
    .peaches-doc-toolbar {
        display: none !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
        font: 11pt/1.5 Georgia, 'Times New Roman', serif;
    }

    /*
     * Remove the theme's content-area padding (6 rem top + bottom) so it
     * doesn't eat into every printed page's usable space.
     */
    .site-main,
    .content-area {
        padding: 0 !important;
        overflow: visible !important;
        height: auto !important;
    }

    .container,
    .container--narrow {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /*
     * The theme constrains <p> to max-width: 70ch on screen.
     * Remove that limit so text fills the full print column.
     */
    p, li {
        max-width: none !important;
    }

    .entry-title,
    h1, h2, h3, h4 {
        color: #000 !important;
    }

    h2, h3 {
        break-after: avoid;
        page-break-after: avoid;
    }

    .peaches-doc-table tr,
    .peaches-sig-block,
    .peaches-doc-callout {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    /* Collapse multi-column checklist to a single column for print. */
    .peaches-check-list {
        column-count: 1 !important;
        columns: 1 !important;
    }

    .peaches-check-list li {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .peaches-doc-callout {
        background: #fff !important;
        border: 1px solid #000;
        border-left-width: 4px;
    }

    .peaches-doc-list__link {
        color: #000 !important;
    }

    /* Keep version/date visible on the signed paper copy */
    .peaches-doc-meta {
        border-top: 1px solid #000;
    }

    .peaches-doc-meta p {
        color: #000;
        font-size: 9pt;
    }

    a {
        color: #000 !important;
        text-decoration: none;
    }
}
