/* Caravan brochure — screen preview, browser print, and PDF capture */

*, *::before, *::after { box-sizing: border-box; }

/* A4 content width at 96dpi — keeps screen, print, and html2canvas aligned */
:root {
    --cb-navy: #1a2942;
    --cb-gold: #C9A84C;
    --cb-muted: #64748b;
    --cb-page-w: 794px;
}

.brochure-print-body {
    margin: 0;
    font-family: 'Inter', Arial, Helvetica, sans-serif;
    font-size: 13px;
    color: #1e293b;
    background: #e8ecf1;
    line-height: 1.5;
}

/* Toolbar (screen only) */
.brochure-print-actions {
    max-width: var(--cb-page-w);
    margin: 0 auto 14px;
    padding: 16px 16px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.brochure-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: .875rem;
    font-weight: 600;
    text-decoration: none;
    font-family: inherit;
}

.brochure-btn-print { background: #1a2942; color: #fff; }
.brochure-btn-pdf   { background: #1a6b3c; color: #fff; }
.brochure-btn-pdf:disabled { opacity: .65; cursor: wait; }
.brochure-btn-close { background: #e5e7eb; color: #374151; }

.brochure-print-page {
    width: var(--cb-page-w);
    max-width: 100%;
    margin: 0 auto 24px;
    background: #fff;
    box-shadow: 0 6px 32px rgba(26, 41, 66, .14);
}

/* Force exact colours in print and PDF (html2canvas) */
.cbrochure,
.cbrochure * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
}

.cbrochure {
    width: 100%;
}

/* ---- Brochure content ---- */

.cb-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding: 22px 28px;
    background-color: #1a2942;
    color: #ffffff;
}

.cb-brand img {
    max-height: 48px;
    max-width: 160px;
    object-fit: contain;
    display: block;
    margin-bottom: 6px;
}

.cb-brand-name {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: .02em;
    color: #ffffff;
}

.cb-brand-tag {
    font-size: .7rem;
    color: rgba(255, 255, 255, .65);
    margin-top: 2px;
}

.cb-header-contact {
    text-align: right;
    font-size: .8rem;
    line-height: 1.7;
    color: #ffffff;
}

.cb-header-contact a { color: #ffffff; text-decoration: none; }

.cb-ribbon {
    background-color: #C9A84C;
    color: #1a2942;
    text-align: center;
    padding: 8px 16px;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.cb-hero {
    display: grid;
    grid-template-columns: 57% 43%;
    gap: 0;
    border-bottom: 3px solid #1a2942;
}

.cb-hero-image {
    position: relative;
    min-height: 260px;
    height: 100%;
    background-color: #f1f5f9;
    overflow: hidden;
}

.cb-hero-image img {
    width: 100%;
    height: 100%;
    min-height: 260px;
    object-fit: cover;
    display: block;
}

.cb-hero-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background-color: #C9A84C;
    color: #1a2942;
    padding: 6px 12px;
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    border-radius: 3px;
}

.cb-hero-info {
    padding: 24px 26px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: #f8fafc;
    background-image: linear-gradient(160deg, #f8fafc 0%, #ffffff 55%);
}

.cb-ref {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #64748b;
    font-family: ui-monospace, 'Courier New', monospace;
    margin-bottom: 6px;
}

.cb-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a2942;
    line-height: 1.25;
    margin: 0 0 12px;
}

.cb-price {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1a2942;
    margin-bottom: 16px;
}

.cb-price-reduced {
    display: inline-block;
    margin-left: 8px;
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    background-color: #16a34a;
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 20px;
    vertical-align: middle;
}

.cb-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.cb-spec {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 10px;
}

.cb-spec-label {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 2px;
}

.cb-spec-value {
    font-size: .85rem;
    font-weight: 600;
    color: #1a2942;
}

.cb-spec--wide { grid-column: 1 / -1; }

.cb-section {
    padding: 22px 28px;
    border-bottom: 1px solid #e2e8f0;
}

.cb-section:last-of-type { border-bottom: none; }

.cb-section-title {
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #1a2942;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #C9A84C;
    display: inline-block;
}

.cb-description {
    font-size: .9rem;
    line-height: 1.65;
    color: #334155;
}

.cb-description.post-content p { margin: 0 0 .75em; }
.cb-description.post-content p:last-child { margin-bottom: 0; }
.cb-description.post-content img { max-width: 100%; height: auto; border-radius: 4px; margin: .5em 0; }
.cb-description.post-content ul,
.cb-description.post-content ol { margin: .5em 0 .5em 1.25em; padding: 0; }
.cb-description.post-content li { margin-bottom: .35em; }
.cb-description.post-content a { color: #1a2942; }

.cb-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cb-feature {
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: .8rem;
    font-weight: 500;
    color: #1a2942;
}

.cb-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.cb-gallery-cell {
    position: relative;
    width: 100%;
    height: 128px;
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    background-color: #f1f5f9;
}

.cb-gallery-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cb-footer {
    background-color: #1a2942;
    color: #ffffff;
    padding: 20px 28px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
}

.cb-footer-brand { font-weight: 700; font-size: .95rem; color: #ffffff; }

.cb-footer-details {
    font-size: .78rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, .85);
}

.cb-footer-details a { color: #ffffff; }

.cb-footer-meta {
    text-align: right;
    font-size: .72rem;
    color: rgba(255, 255, 255, .6);
    line-height: 1.6;
}

.cb-footer-url {
    font-size: .78rem;
    color: #C9A84C;
    word-break: break-all;
}

.cb-disclaimer {
    padding: 12px 28px 16px;
    font-size: .68rem;
    color: #64748b;
    line-height: 1.5;
    background-color: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

/* PDF capture mode — lock layout width for html2canvas */
body.brochure-pdf-capture {
    background: #ffffff !important;
}

body.brochure-pdf-capture .brochure-print-actions {
    display: none !important;
}

body.brochure-pdf-capture .brochure-print-page {
    width: 794px !important;
    max-width: 794px !important;
    margin: 0 !important;
    box-shadow: none !important;
}

/* Browser print */
@media print {
    .no-print,
    .brochure-print-actions { display: none !important; }

    html, body {
        width: 100%;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
    }

    .brochure-print-page {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        box-shadow: none !important;
    }

    .cb-hero {
        display: grid !important;
        grid-template-columns: 57% 43% !important;
    }

    .cb-specs {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
    }

    .cb-gallery {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .cb-gallery-cell {
        height: 110px !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    /* Keep “Gallery” heading with the image grid */
    .cb-gallery-block {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .cb-section--gallery .cb-section-title {
        display: block;
        break-after: avoid;
        page-break-after: avoid;
    }

    @page {
        size: A4 portrait;
        margin: 10mm;
    }
}

/* Small screens — stack hero only on narrow viewports, not when printing */
@media screen and (max-width: 820px) {
    .brochure-print-page {
        width: 100%;
    }

    .cb-hero { grid-template-columns: 1fr; }
    .cb-gallery { grid-template-columns: repeat(2, 1fr); }
    .cb-header { flex-direction: column; }
    .cb-header-contact { text-align: left; }
}
