/**
 * MPYPCP Course Brochure - Multi-Page PDF
 * Color pattern aligned with course details page
 */
:root {
    /* Same as course details page (100-hours-yoga-teacher-training.html etc) */
    --primary-red: #c62828;
    --accent-red: #b71c1c;
    --course-red: #d32f2f;
    --text-dark: #333333;
    --text-light: #666666;
    --bg-light: #f4f6f9;
    --card-tint: #fff5f5;
    /* Brochure aliases */
    --brochure-primary: var(--primary-red);
    --brochure-accent: var(--accent-red);
    --brochure-dark: #0f0f0f;
    --brochure-text: var(--text-dark);
    --brochure-light: var(--text-light);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--brochure-text);
    background: var(--bg-light);
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

/* ===== ACTIONS BAR - matches course page hero-buttons-section ===== */
.brochure-actions {
    position: sticky;
    top: 0;
    z-index: 100;
    background: white;
    padding: 10px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

.brochure-download-btn, .brochure-back-link {
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.brochure-download-btn {
    background: var(--primary-red);
    color: white !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.brochure-download-btn:hover {
    background: var(--accent-red);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(198,40,40,0.3);
}

#brochure-print-btn {
    background: white !important;
    color: var(--primary-red) !important;
    border: 2px solid var(--primary-red);
}

#brochure-print-btn:hover {
    background: var(--primary-red) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(198,40,40,0.3);
}

.brochure-back-link {
    color: var(--primary-red);
    border: 2px solid var(--primary-red);
}

.brochure-back-link:hover {
    background: var(--primary-red);
    color: white !important;
}

/* ===== CONTAINER - A4 Portrait, Multi-Page ===== */
.brochure-container {
    position: relative;
    width: 210mm;
    min-width: 210mm;
    margin: 0 auto 24px;
    background: white;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    padding: 0;
    overflow: hidden;
}

/* ===== WATERMARK - light repeat; never blocks taps (pointer-events none) =====
 * Fill colour lives in each page’s inline SVG (data URL). That alpha is NOT controlled by
 * other CSS rules — only this element’s opacity (and the SVG rgba) sets strength.
 * Tune --brochure-watermark-opacity (0–1) once; applies to every brochure that uses this file.
 */
.brochure-watermark {
    --brochure-watermark-opacity: 0.28;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 100%;
    background-repeat: repeat;
    background-size: 240px 160px;
    pointer-events: none;
    z-index: 0;
    opacity: var(--brochure-watermark-opacity);
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.brochure-brand,
.brochure-hero,
.brochure-main,
.brochure-section,
.brochure-cta,
.brochure-other-courses,
.brochure-contact,
.brochure-reviews,
.brochure-institution-hindi,
.brochure-institution {
    position: relative;
    z-index: 1;
}

/* Center A4 portrait on screen (desktop) */
body { display: flex; flex-direction: column; align-items: center; padding: 20px; }
.brochure-actions { width: 100%; max-width: 794px; }

/* ===== COMPACT LAYOUT - All in one A4 ===== */
.brochure-brand {
    padding: 12px 14px;
    border-bottom: 3px solid var(--primary-red);
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px 12px;
    background: white;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    width: 100%;
    /* allow wrapped title lines; clip only if needed at container edge */
    overflow-x: hidden;
    overflow-y: visible;
}

/*
 * Logo column height = reference band for 3 text lines (title / tagline / URL).
 * Text uses compact line-height + gap so the block stays within ~the same visual height as the logo.
 */
.brochure-brand-logo {
    --brand-logo-size: 72px;
    display: grid;
    grid-template-columns: var(--brand-logo-size) minmax(0, 1fr);
    align-items: center;
    column-gap: 12px;
    flex: 1 1 0;
    min-width: 0;
    max-width: 100%;
}

.brochure-brand-logo img {
    width: var(--brand-logo-size);
    height: var(--brand-logo-size);
    max-width: var(--brand-logo-size);
    max-height: var(--brand-logo-size);
    object-fit: contain;
    object-position: center;
    justify-self: center;
}

.brochure-brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-self: center;
    gap: 2px;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
    text-align: left;
}

.brochure-brand-text h2 {
    font-size: 11px;
    font-weight: 700;
    line-height: 1.18;
    color: var(--brochure-dark);
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
    margin: 0;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
}

.brochure-brand-text p {
    font-size: 9px;
    line-height: 1.2;
    color: var(--brochure-light);
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
}

.brochure-brand-text .brochure-brand-url {
    margin: 0;
    font-size: 9px;
    font-weight: 600;
    line-height: 1.15;
    color: var(--course-red);
    white-space: normal;
    overflow: visible;
}

.brochure-brand-text .brochure-brand-url a {
    color: inherit;
    text-decoration: none;
    display: inline;
    min-height: 0;
    padding: 0;
    white-space: normal;
}

.brochure-brand-text .brochure-brand-url a:hover {
    text-decoration: underline;
}

.brochure-badge {
    font-size: 10px;
    padding: 5px 10px;
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-weight: 700;
    flex: 0 0 auto;
    white-space: nowrap;
    max-width: 100%;
    text-align: center;
    box-sizing: border-box;
    margin-left: auto;
}

.brochure-hero {
    background: linear-gradient(180deg, var(--primary-red) 0%, var(--accent-red) 100%);
    color: white;
    padding: 14px 16px;
    text-align: center;
}

.brochure-hero h1 { font-size: 22px; font-weight: 800; margin-bottom: 8px; line-height: 1.3; color: white; }
.brochure-hero .sub-headline { font-size: 14px; opacity: 0.95; }

/* Main content - single column for multi-page flow */
.brochure-main {
    display: block;
    padding: 16px 20px;
}

.brochure-section {
    padding: 14px 0;
    border-bottom: 1px solid #eee;
}

.brochure-full-width { display: block; }

.brochure-section-title {
    color: var(--course-red);
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--course-red);
}

.brochure-section.brochure-about {
    background: rgba(255, 255, 255, 0.8);
    padding: 16px 20px;
    border-radius: 8px;
}
.brochure-about p { font-size: 13px; line-height: 1.55; margin-bottom: 8px; }
.brochure-about-subtitle {
    font-size: 14px;
    font-weight: 600;
    color: var(--course-red);
    margin: 14px 0 8px 0;
    padding-top: 10px;
    border-top: 1px solid #eee;
}
.brochure-about-para {
    font-size: 13px;
    line-height: 1.55;
    color: var(--brochure-text);
    margin: 0;
    text-align: justify;
}

/* Institution / about sub-section - matches course detail-card */
.brochure-institution-hindi,
.brochure-institution {
    background: linear-gradient(135deg, var(--card-tint) 0%, #ffffff 100%);
    border-left: 4px solid var(--course-red);
}
.brochure-hindi-para {
    font-family: 'Noto Sans Devanagari', 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    line-height: 1.7;
    color: var(--brochure-text);
    margin: 0 0 12px 0;
    text-align: justify;
}
.brochure-english-para {
    font-size: 13px;
    line-height: 1.7;
    color: var(--brochure-text);
    margin: 0;
    text-align: justify;
}

.brochure-highlights {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.brochure-highlight-card {
    padding: 12px 14px;
    background: white;
    border-top: 4px solid var(--course-red);
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.brochure-highlight-card h4 { font-size: 13px; font-weight: 600; color: var(--course-red); margin-bottom: 6px; }
.brochure-highlight-card p { font-size: 12px; line-height: 1.5; }

/* Detail cards - teal accent */
.brochure-detail-card {
    padding: 12px 14px;
    background: linear-gradient(135deg, #e0f2f1 0%, #ffffff 100%);
    border-left: 4px solid #00897b;
    border-radius: 10px;
    text-align: center;
}

.brochure-detail-card h4 { font-size: 12px; color: #00695c; margin-bottom: 6px; }
.brochure-detail-card .value { font-size: 14px; font-weight: 700; }

.brochure-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

/* Testimonials - green touch */
.brochure-testimonials {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.brochure-testimonial {
    padding: 12px 14px;
    background: linear-gradient(135deg, #e8f5e9 0%, #ffffff 100%);
    border-radius: 10px;
    border-left: 4px solid #22c55e;
}

.brochure-testimonial p { font-size: 12px; font-style: italic; line-height: 1.5; margin-bottom: 6px; }
.brochure-testimonial cite { font-size: 11px; color: var(--brochure-light); }

.brochure-benefits-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Benefit items - amber touch */
.brochure-benefit-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    background: linear-gradient(135deg, #fff8e1 0%, #ffffff 100%);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-left: 3px solid #ffa726;
}

.brochure-benefit-item i { color: #f57c00; font-size: 14px; margin-top: 3px; }
.brochure-benefit-item h4 { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.brochure-benefit-item p { font-size: 12px; line-height: 1.5; }

.brochure-modules {
    display: grid;
    /* auto-fit: खाली कॉलम गिराकर तीनों कार्ड पूरी पंक्ति भरें (auto-fill से चौथा खाली ट्रैक संकीर्ण करता था) */
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

/* Module cards - indigo/purple touch */
.brochure-module-card {
    padding: 12px 14px;
    background: linear-gradient(135deg, #e8eaf6 0%, #ffffff 100%);
    border-radius: 10px;
    border-left: 4px solid #5c6bc0;
}

.brochure-module-card .num {
    display: inline-block;
    width: 28px;
    height: 28px;
    background: #5c6bc0;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 28px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
}

.brochure-module-card h4 { font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #3949ab; }
.brochure-module-card p { font-size: 12px; line-height: 1.5; }

.brochure-outcomes ul {
    list-style: none;
    background: rgba(255, 255, 255, 0.8);
    padding: 16px 20px;
    border-radius: 8px;
    margin: 0;
}
.brochure-outcomes li {
    display: flex;
    gap: 10px;
    padding: 6px 0;
    font-size: 12px;
    line-height: 1.5;
}

.brochure-outcomes li i { color: #22c55e; font-size: 12px; }

/* Other Popular Courses - Image Cards (like details page) */
.brochure-popular-courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px 18px;
}

.brochure-course-card {
    display: block;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-decoration: none;
    color: var(--brochure-text);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e0e0e0;
}

.brochure-course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.brochure-course-card-img {
    height: 90px;
    overflow: hidden;
    background: #f0f0f0;
}

.brochure-course-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brochure-course-card-header {
    background: linear-gradient(180deg, var(--primary-red) 0%, var(--accent-red) 100%);
    padding: 10px 12px;
    color: white;
}

.brochure-course-card-header h4 {
    font-size: 12px;
    font-weight: 700;
    margin: 0;
    color: rgba(255,255,255,0.95);
    line-height: 1.35;
}

.brochure-course-card-body {
    padding: 12px 14px;
}

.brochure-course-card-body p {
    font-size: 10px;
    line-height: 1.4;
    margin-bottom: 6px;
    color: var(--brochure-text);
}

.brochure-course-card-body p i {
    color: var(--card-accent, var(--course-red));
    width: 14px;
    margin-right: 4px;
}

.brochure-course-intro {
    font-size: 9px !important;
    line-height: 1.4;
    color: var(--brochure-light);
    margin-top: 4px;
}

.brochure-view-all {
    margin-top: 12px;
    text-align: center;
}

.brochure-view-all a {
    color: var(--course-red);
    font-weight: 600;
    text-decoration: none;
    font-size: 13px;
}

/* Admission Process – Complete Cycle */
/* Admission process - blue accent */
.brochure-admission-process {
    background: linear-gradient(135deg, #e3f2fd 0%, #ffffff 100%);
    border: 1px solid rgba(33,150,243,0.3);
    border-radius: 10px;
    padding: 16px 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.brochure-admission-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px 4px;
    margin: 12px 0;
}

.brochure-admission-step {
    flex: 1 1 140px;
    min-width: 120px;
    background: white;
    border-radius: 8px;
    padding: 12px 14px;
    border-left: 4px solid #2196f3;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.brochure-admission-num {
    display: inline-block;
    width: 24px;
    height: 24px;
    background: #2196f3;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
}

.brochure-admission-step h4 {
    font-size: 12px;
    font-weight: 700;
    color: #1976d2;
    margin-bottom: 4px;
}

.brochure-admission-step p {
    font-size: 10px;
    line-height: 1.45;
    color: var(--brochure-text);
    margin: 0;
}

.brochure-admission-arrow {
    flex: 0 0 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2196f3;
    font-size: 10px;
}

.brochure-admission-links {
    text-align: center;
    margin-top: 12px;
    font-size: 12px;
}

.brochure-admission-links a {
    color: #1976d2;
    font-weight: 600;
    text-decoration: none;
}

.brochure-view-all a:hover {
    text-decoration: underline;
}

/* Contact block: frosted white panel (DNYS brochure) */
.brochure-contact-panel {
    background: rgba(255, 255, 255, 0.88);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: 0 8px 28px rgba(15, 15, 25, 0.08);
}

.brochure-contact-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.brochure-contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brochure-contact-item i { color: var(--course-red); font-size: 14px; }
.brochure-contact-item a { font-size: 13px; color: var(--brochure-text); text-decoration: none; }

.brochure-cta {
    background: linear-gradient(180deg, var(--primary-red) 0%, var(--accent-red) 100%);
    color: white;
    padding: 16px 18px;
    text-align: center;
}

.brochure-cta h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.brochure-cta p { font-size: 13px; margin-bottom: 10px; }
.brochure-cta-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.brochure-cta .cta-btn {
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.brochure-cta .cta-btn { background: white; color: var(--primary-red); }
.brochure-cta .cta-btn-secondary { background: transparent; color: white; border: 2px solid white; }

/* ===== Brochure reviews (DNYS) — 4 static white cards, no carousel ===== */
/* ★★★★★ 5.0 only inside each card — Google-style yellow */
#brochure-content .brochure-review-card-rating {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    color: #fbbc04;
}

#brochure-content .brochure-review-card-rating-stars {
    letter-spacing: 0.35px;
    line-height: 1;
    text-shadow: 0 0.5px 0 rgba(0, 0, 0, 0.06);
}

#brochure-content .brochure-review-card-rating-score {
    font-variant-numeric: tabular-nums;
}

.brochure-reviews-lead {
    font-size: 12px;
    color: var(--brochure-light);
    margin: 0 0 12px 0;
    line-height: 1.45;
}

#brochure-content .brochure-reviews-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
}

#brochure-content .brochure-review-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 12px 14px;
    box-sizing: border-box;
    min-width: 0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

#brochure-content .brochure-review-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

#brochure-content .brochure-review-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
}

#brochure-content .brochure-review-avatar[data-tone="blue"] { background: #2563eb; }
#brochure-content .brochure-review-avatar[data-tone="red"] { background: #dc2626; }
#brochure-content .brochure-review-avatar[data-tone="amber"] { background: #d97706; }
#brochure-content .brochure-review-avatar[data-tone="green"] { background: #16a34a; }

#brochure-content .brochure-review-meta { min-width: 0; }

#brochure-content .brochure-review-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--brochure-dark);
    line-height: 1.3;
    margin-bottom: 3px;
}

#brochure-content .brochure-review-role {
    font-size: 9.5px;
    font-weight: 400;
    color: var(--brochure-light);
    line-height: 1.35;
}

#brochure-content .brochure-review-quote {
    font-size: 9.5px;
    line-height: 1.5;
    color: #444;
    margin: 0;
    text-align: left;
}

@media screen and (max-width: 720px) {
    #brochure-content .brochure-reviews-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}

@media screen and (max-width: 380px) {
    #brochure-content .brochure-reviews-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== MOBILE — A4 sheet scaled to viewport; isolate from site CSS (responsive.css overflow-x:hidden etc.) ===== */
@media screen and (max-width: 900px) {
    /*
     * Higher specificity than global `html, body { overflow-x: hidden }` so users can pan when
     * zoom/layout differs (Firefox, older WebKit) and the ~794px sheet is wider than the screen.
     */
    html:has(#brochure-content) {
        overflow-x: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        max-width: 100%;
        min-height: 100%;
        min-height: 100dvh;
        min-height: -webkit-fill-available;
        overscroll-behavior-x: contain;
        -webkit-text-size-adjust: 100%;
    }

    body:has(#brochure-content) {
        display: block;
        margin: 0;
        padding: 0;
        padding-left: env(safe-area-inset-left, 0px);
        padding-right: env(safe-area-inset-right, 0px);
        padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
        text-align: center;
        min-height: 100%;
        min-height: 100dvh;
        min-height: -webkit-fill-available;
        box-sizing: border-box;
        overflow-x: auto;
        overflow-y: auto;
        max-width: none;
        width: 100%;
        position: relative;
        -webkit-font-smoothing: antialiased;
    }

    /* One row: compact buttons; scroll horizontally on very narrow screens instead of wrapping */
    body:has(#brochure-content) .brochure-download-btn,
    body:has(#brochure-content) #brochure-print-btn,
    body:has(#brochure-content) .brochure-back-link {
        min-width: 0;
        min-height: 40px;
        flex: 0 1 auto;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        white-space: nowrap;
        font-size: clamp(0.68rem, 2.6vw, 0.78rem);
        padding: 6px 8px;
        gap: 4px;
    }

    body:has(#brochure-content) .brochure-actions {
        display: flex;
        flex-wrap: nowrap;
        justify-content: center;
        align-items: center;
        gap: 6px;
        padding: 8px max(8px, env(safe-area-inset-left, 0px)) 8px max(8px, env(safe-area-inset-right, 0px));
        padding-top: max(8px, env(safe-area-inset-top, 0px));
        width: 100%;
        max-width: none;
        box-sizing: border-box;
        margin: 0 0 6px;
        position: sticky;
        top: 0;
        z-index: 100;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    body:has(#brochure-content) .brochure-actions::-webkit-scrollbar {
        height: 4px;
    }

    /*
     * ~794px logical width ≈ 210mm @ 96dpi — zoom scales layout + paint (iOS Safari / Chrome).
     * Prefer dynamic viewport width on phones (address bar). Fallback: 100vw.
     */
    body:has(#brochure-content) .brochure-container {
        width: 210mm;
        min-width: 210mm;
        max-width: 210mm;
        margin: 0 auto 16px;
        display: inline-block;
        text-align: left;
        vertical-align: top;
        zoom: min(1, calc((100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)) / 794));
    }

    @supports (width: 100dvw) {
        body:has(#brochure-content) .brochure-container {
            zoom: min(1, calc((100dvw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)) / 794));
        }
    }

    body:has(#brochure-content) .brochure-brand {
        padding: 10px 10px;
        gap: 8px;
        align-items: flex-start;
        overflow-x: hidden;
        overflow-y: visible;
    }

    /* Same band height as desktop: --brand-logo-size drives logo + text column */
    body:has(#brochure-content) .brochure-brand-logo {
        --brand-logo-size: 68px;
        grid-template-columns: var(--brand-logo-size) minmax(0, 1fr);
        align-items: center;
        column-gap: 10px;
        flex: 1 1 min(0, 100%);
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    body:has(#brochure-content) .brochure-brand-logo img {
        width: var(--brand-logo-size);
        height: var(--brand-logo-size);
        max-width: var(--brand-logo-size);
        max-height: var(--brand-logo-size);
        object-fit: contain;
    }

    /* Tighter vertical rhythm between the 3 lines (title / tagline / URL) */
    body:has(#brochure-content) .brochure-brand-text {
        gap: 2px;
    }

    /* Global responsive.css / mobile rules must not single-line or ellipsis brochure titles */
    body:has(#brochure-content) .brochure-brand-text h2,
    body:has(#brochure-content) .brochure-brand-text p {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: unset !important;
        max-width: 100% !important;
    }

    body:has(#brochure-content) .brochure-brand-text h2 {
        font-size: 11px;
        line-height: 1.18;
    }

    body:has(#brochure-content) .brochure-brand-text p {
        font-size: 9px;
        line-height: 1.2;
    }

    body:has(#brochure-content) .brochure-brand-text .brochure-brand-url {
        font-size: 9px;
        line-height: 1.15;
        margin: 0;
    }

    body:has(#brochure-content) .brochure-brand-text .brochure-brand-url a {
        display: inline !important;
        min-height: 0 !important;
        padding: 0 !important;
        align-items: unset !important;
    }

    body:has(#brochure-content) .brochure-badge {
        flex: 1 1 100%;
        margin-left: 0;
        white-space: normal;
        font-size: 9.5px;
        padding: 5px 8px;
        line-height: 1.3;
    }

    body:has(#brochure-content) .brochure-contact-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Narrow phones — keep same side‑by‑side header as reference; scale type slightly */
@media screen and (max-width: 480px) {
    body:has(#brochure-content) .brochure-contact-grid {
        grid-template-columns: 1fr;
    }

    body:has(#brochure-content) .brochure-brand {
        padding: 10px 8px;
    }

    body:has(#brochure-content) .brochure-brand-logo {
        --brand-logo-size: 62px;
        grid-template-columns: var(--brand-logo-size) minmax(0, 1fr);
        align-items: center;
        column-gap: 8px;
    }

    body:has(#brochure-content) .brochure-brand-logo img {
        width: var(--brand-logo-size);
        height: var(--brand-logo-size);
        max-width: var(--brand-logo-size);
        max-height: var(--brand-logo-size);
    }

    body:has(#brochure-content) .brochure-brand-text {
        gap: 1px;
    }

    body:has(#brochure-content) .brochure-brand-text h2 {
        font-size: 10.5px;
        line-height: 1.16;
    }

    body:has(#brochure-content) .brochure-brand-text p {
        font-size: 8.5px;
        line-height: 1.18;
    }

    body:has(#brochure-content) .brochure-brand-text .brochure-brand-url {
        font-size: 8.5px;
        line-height: 1.12;
        margin: 0;
    }
}

/* Landscape phone: keep single-row bar compact */
@media screen and (max-width: 900px) and (orientation: landscape) {
    body:has(#brochure-content) .brochure-actions {
        padding-top: max(6px, env(safe-area-inset-top, 0px));
        padding-bottom: 6px;
    }

    body:has(#brochure-content) .brochure-download-btn,
    body:has(#brochure-content) #brochure-print-btn,
    body:has(#brochure-content) .brochure-back-link {
        min-height: 36px;
        padding: 5px 8px;
    }
}

/* ===== PRINT / PDF - A4 Portrait, Clear Page Fit ===== */
@media print {
    /* Top a bit more than sides/bottom; html2pdf first margin bumped to match */
    @page { size: A4 portrait; margin: 16mm 14mm 12mm 14mm; }
    body { background: white !important; display: block !important; padding: 0 !important; }
    .brochure-actions { display: none !important; }
    .brochure-container {
        width: 100% !important;
        max-width: 210mm !important;
        min-width: auto !important;
        height: auto !important;
        min-height: auto !important;
        box-shadow: none !important;
        overflow: visible !important;
    }
    /* पूरा ब्रोशर बहु-पृष्ठ पर दिखे — कहीं max-height/overflow से कटाव न हो */
    html:has(#brochure-content) #brochure-content,
    html:has(#brochure-content) .brochure-main {
        overflow: visible !important;
        max-height: none !important;
    }

    /* Tighter vertical rhythm so more content fits per sheet */
    .brochure-main {
        padding: 10px 14px !important;
    }
    .brochure-section {
        padding: 8px 0 !important;
        page-break-inside: auto !important;
        break-inside: auto !important;
    }
    /* Avoid huge blank gaps: whole sections may split across pages; cards stay intact */
    .brochure-highlights,
    .brochure-details-grid,
    .brochure-benefits-grid,
    .brochure-testimonials,
    .brochure-modules,
    .brochure-popular-courses-grid {
        page-break-inside: auto !important;
        break-inside: auto !important;
    }
    .brochure-section-title {
        page-break-after: avoid;
        break-after: avoid;
    }

    .brochure-brand {
        page-break-inside: avoid;
        break-inside: avoid-page;
        padding: 8px 12px !important;
    }
    .brochure-brand-logo {
        --brand-logo-size: 20mm;
    }
    .brochure-brand-text h2 {
        font-size: 10pt;
        line-height: 1.15;
    }
    .brochure-brand-text p,
    .brochure-brand-text .brochure-brand-url {
        font-size: 8pt;
        line-height: 1.15;
    }
    .brochure-brand-text {
        gap: 1px;
    }

    .brochure-hero {
        page-break-inside: avoid;
        break-inside: avoid-page;
        padding: 10px 14px !important;
    }
    .brochure-hero h1 { font-size: 16pt !important; margin-bottom: 4px !important; }
    .brochure-hero .sub-headline { font-size: 10pt !important; }

    /* CTA: सफ़ेद टेक्स्ट + ग्रेडिएंट — बिना बैकग्राउंड प्रिंट पर सब अदृश्य लगता है */
    .brochure-cta {
        page-break-inside: avoid;
        break-inside: avoid-page;
        background: linear-gradient(180deg, #c62828 0%, #b71c1c 100%) !important;
        color: #ffffff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    .brochure-cta h3,
    .brochure-cta p {
        color: #ffffff !important;
    }
    .brochure-cta .cta-btn {
        background: #ffffff !important;
        color: #c62828 !important;
        border: 1px solid #ffffff !important;
    }
    .brochure-cta .cta-btn-secondary {
        background: transparent !important;
        color: #ffffff !important;
        border: 2px solid #ffffff !important;
    }

    /* Contact: backdrop-filter क्रोम प्रिंट में अक्सर खाली बॉक्स — हटाकर ठोस पृष्ठभूमि */
    .brochure-contact-panel {
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        box-shadow: none !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    .brochure-contact-item,
    .brochure-contact-item a {
        color: #333333 !important;
    }
    .brochure-contact-item i {
        color: #c62828 !important;
    }

    /* 2×2 on paper reads better than 4 narrow columns */
    #brochure-content .brochure-reviews-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    #brochure-content .brochure-review-card {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Cards: do not split a single card across pages */
    .brochure-highlight-card,
    .brochure-testimonial,
    .brochure-review-card,
    .brochure-module-card,
    .brochure-course-card,
    .brochure-admission-process,
    .brochure-institution-hindi,
    .brochure-institution {
        page-break-inside: avoid !important;
        break-inside: avoid-page !important;
    }
}

/* PDF generation - ensure clean fit (used by html2canvas) */
.brochure-container {
    max-width: 210mm;
    box-sizing: border-box;
}

/*
 * Brochure HTML loads this file before responsive.css / mobile-first.css.
 * Global `body { overflow-x: hidden }` must not clip the ~794px-wide sheet when zoom is absent.
 * !important beats later non-brochure rules; :has(#brochure-content) limits scope to brochure pages.
 */
@media screen and (max-width: 900px) {
    html:has(#brochure-content) {
        overflow-x: auto !important;
        overflow-y: auto !important;
    }
    body:has(#brochure-content) {
        overflow-x: auto !important;
        overflow-y: auto !important;
    }
}
