/* ==========================================================================
   print.css — Print styles for PDF exports and paper printouts.
   Applied via <link media="print">.
   ========================================================================== */

/* الاتجاه الافتراضي: عمودي (ملف الإنجاز، الاختبارات، أوراق العمل...).
   سجل الطلاب يُطبع بالعرض: print-students.js يحقن قاعدة @page بالعرض
   لحظة الطباعة ثم يزيلها — لأن @page لا يقبل التبديل بالأصناف في سفاري
   القديم، والحقن الديناميكي مضمون في كل المتصفحات. */
@page {
    size: A4 portrait;
    margin: 18mm 15mm;
}

@media print {
    body.is-printing > #app { display: none !important; }
    body.is-printing > #print-root { display: block !important; }
}

@media print {
    :root {
        --bg: #FFFFFF;
        --surface: #FFFFFF;
        --surface-alt: #FFFFFF;
        --text: #000000;
        --text-muted: #333333;
        --border: #CCCCCC;
    }

    html, body {
        background: #FFFFFF !important;
        color: #000000 !important;
        font-size: 12pt;
        line-height: 1.5;
    }

    /* Hide interactive chrome */
    .app-header,
    .app-footer,
    .toast-container,
    .bottom-nav,
    .drawer-root,
    .hamburger-btn,
    .section-header .btn,
    .btn{
        display: none !important;
    }

    /* Restore desktop grid layouts during print — mobile viewport rules
       would otherwise collapse everything into a single column. */
    .grid.grid-4 { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
    .grid.grid-2 { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }

    /* Cards shouldn't reshape into the mobile 2×2 layout when printing */
    .stat-card {
        display: flex !important;
        flex-direction: column !important;
        grid-template-areas: none !important;
        padding: 12pt !important;
        border: 1px solid #CBD5E1 !important;
        background: #fff !important;
        box-shadow: none !important;
    }
    .stat-card .stat-icon  { margin-bottom: 4pt !important; font-size: 18pt !important; }
    .stat-card .stat-label { text-align: right !important; color: #555 !important; font-size: 9pt !important; }
    .stat-card .stat-value { font-size: 20pt !important; justify-self: start !important; }


    /* عنوانُ البطاقة لا يُيتَّم في قاع الصفحة. */
    .card-title {
        page-break-after: avoid !important;
        break-after:      avoid !important;
    }
    .card {
        page-break-inside: avoid !important;
        break-inside:      avoid !important;
    }

    .app-main { padding: 0 !important; }

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

    .card {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        background: transparent !important;
    }

    /* Shared print header/footer for documents */
    .print-header {
        display: block !important;
        text-align: center;
        border-bottom: 2px solid #000;
        padding-bottom: 8mm;
        margin-bottom: 8mm;
    }

    .print-header {
        position: relative;
    }
    .print-header h1 {
        font-size: 18pt;
        margin: 0 0 4mm;
    }

    .cover-page .cover-logo {
        width: 40mm;
        height: 40mm;
        object-fit: contain;
        margin: 0 auto 10mm;
        display: block;
    }

    .print-header .meta {
        font-size: 10pt;
        color: #333;
    }

    /* Page break control */
    .page-break        { page-break-after: always; }
    .avoid-break       { page-break-inside: avoid; }
    h1, h2, h3         { page-break-after: avoid; }
    /* NOTE: tables are allowed to break so long rosters paginate correctly.
       Images/figures still stay whole. */
    figure, img        { page-break-inside: avoid; }

    /* Tables */
    table {
        width: 100%;
        border-collapse: collapse;
    }
    th, td {
        border: 1px solid #666;
        padding: 6pt 8pt;
        text-align: right;
    }
    thead { display: table-header-group; }
    tfoot { display: table-footer-group; }

    /* Keep links readable on paper */
    a, a:visited {
        color: #000;
        text-decoration: underline;
    }


    /* Exam / worksheet document */
    .print-doc {
        font-family: 'IBM Plex Sans Arabic', sans-serif;
        direction: rtl;
        color: #000;
    }
    .line {
        border-bottom: 1px solid #AAA;
        height: 7mm;
        margin-bottom: 2mm;
    }

    /* ---------- Portfolio document ---------- */
    .portfolio-doc h2, .portfolio-doc h3, .portfolio-doc h4 {
        color: #000;
    }

    /* ---------- Portfolio cover (B/W official) ---------- */
    .cover-page {
        background: #FFFFFF;
        padding: 4mm;
        border: 1pt solid #000000;
        max-width: 170mm;
        min-height: 250mm;
        /* ٤مم لا ١٠مم: المتاح في A4 بعد هوامش @page هو ٢٦١مم، و250mm+2×10mm
           كان يترك أقل من مليمتر فسحة — فأي فرق في المتصفح أو الطابعة يُفيض
           الكتلة فينزل جزء منها على الصفحة التالية (تداخل الأقسام). */
        margin: 4mm auto;
        page-break-after: always;
    }

    .cover-inner {
        border: 0.5pt solid #000000;
        padding: 12mm 10mm;
        min-height: calc(250mm - 24mm);
        display: flex;
        flex-direction: column;
    }

    /* ══ الغلافُ في مسرح التصدير وحدَه ══
       الطباعةُ الحقيقيّةُ تقتطع ١٨مم علويّةً وسفليّةً بـ`@page`، فيتوسّط
       الإطارُ بها. أمّا مسرحُ `PdfCore` — وهو مسارُ التصدير الفعليّ، إذ
       `window.print()` خامدٌ على iOS — فصفحتُه ٢٩٧مم كاملةً بلا حشو،
       و`@page` مُهمَلةٌ فيه عمداً (المُرقِّم يبني صناديقَه بنفسه).

       وهناك ينهار هامشُ الغلاف العلويُّ خارجَ حاويته فيلتصق الإطارُ
       بالحافّة: قِيس **صفرٌ فوق و٣٨٫٣مم تحت**. (بلاغُ المعلّم ٣٠ أغسطس
       ٢٠٢٦ بصورة.)

       فـ`flow-root` على حاوية الصفحة تُنشئ سياقاً يمنع الانهيار، والارتفاعُ
       يملأ ما بين الهامشين. والقواعدُ محصورةٌ بـ`.pdfcore-page` فلا تمسّ
       الطباعةَ الحقيقيّة — الصنفُ لا وجودَ له خارج المسرح. */
    .pdfcore-page > div { display: flow-root; }

    /* والأربعُ المؤطَّرةُ سواءٌ في العلّة والعلاج: الغلافُ والفهرسُ وبطاقةُ
       الشاهد وفاصلُ القسم — كلُّها مكتوبةٌ بالنمط نفسِه (حدٌّ خارجيّ ١pt،
       وحشوٌ ٤مم، وداخلٌ بحدٍّ ٠٫٥pt، وارتفاعٌ أدنى ٢٥٠مم). وهي التي
       يصنّفها المرقّمُ «framed». */
    .pdfcore-page .cover-page,
    .pdfcore-page .toc-page,
    .pdfcore-page .cert-card,
    .pdfcore-page .section-divider {
        /* `border-box` ليضمَّ الارتفاعُ الحدَّ والحشوَ: بدونه يزيد سُمكُ
           الحدِّ (١pt = ٠٫٣٥مم لكلّ ضلع) على الارتفاع فتختلّ الفجوتان
           بـ٠٫٦مم — قِيست ١٢ فوق و١١٫٤ تحت. */
        box-sizing: border-box;
        height: 273mm;              /* ٢٩٧ − ٢×١٢ */
        margin: 12mm auto;
    }

    /* والداخلُ يملأ ما بين الحدّين، فلا يقصر عن إطاره الخارجيّ. */
    .pdfcore-page .cover-inner,
    .pdfcore-page .toc-page-inner,
    .pdfcore-page .cert-card-inner,
    .pdfcore-page .section-divider-inner {
        box-sizing: border-box;
        min-height: 100%;
    }

    .cover-header {
        text-align: center;
        padding-bottom: 5mm;
        border-bottom: 1pt solid #000000;
    }

    .cover-country {
        font-size: 9pt;
        color: #555555;
        margin-bottom: 1mm;
    }

    .cover-ministry {
        font-size: 11pt;
        color: #000000;
        font-weight: 600;
    }

    .cover-region {
        font-size: 8pt;
        color: #777777;
        margin-top: 1mm;
    }

    .cover-body {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 12mm 0;
    }

    .cover-page .cover-logo {
        font-size: 28pt;
        margin: 0 auto 10mm;
        color: #000000;
    }

    .cover-title-frame-outer {
        border: 1.5pt solid #000000;
        padding: 1.5mm;
        display: inline-block;
        margin-bottom: 12mm;
    }

    .cover-title-frame-inner {
        border: 0.5pt solid #000000;
        padding: 5mm 12mm;
    }

    .cover-title {
        font-size: 22pt;
        font-weight: 600;
        color: #000000;
        margin: 0;
        padding: 0;
        background: transparent;
    }

    .cover-divider {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5mm;
        margin-bottom: 6mm;
    }

    .cover-divider-line {
        display: inline-block;
        width: 12mm;
        height: 0.5pt;
        background: #000000;
    }

    .cover-divider-text {
        font-size: 10pt;
        color: #555555;
    }

    .cover-teacher-name {
        font-size: 16pt;
        font-weight: 600;
        color: #000000;
        margin-bottom: 12mm;
    }

    .cover-school-info {
        margin-top: 6mm;
    }

    .cover-school {
        font-size: 11pt;
        color: #000000;
        font-weight: 500;
    }

    .cover-year {
        font-size: 10pt;
        color: #555555;
        margin-top: 1mm;
    }

    .cover-footer {
        border-top: 1pt solid #000000;
        padding-top: 4mm;
        text-align: right;
        font-size: 9pt;
        color: #555555;
    }


    .portfolio-section-heading {
        display: flex;
        align-items: center;
        gap: 6mm;
        border-bottom: 2px solid #C9A961;   /* gold underline for elegance */
        padding-bottom: 4mm;
        margin-bottom: 8mm;
    }
    .portfolio-section-heading .section-number {
        width: 14mm;
        height: 14mm;
        border-radius: 50%;
        background: #0F2C5C;
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: bold;
        font-size: 16pt;
    }
    .portfolio-section-heading h2 {
        margin: 0;
        font-size: 20pt;
    }

    .info-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 11pt;
        margin-bottom: 8mm;
    }
    .info-table th {
        background: #F8F6F0;          /* ivory */
        color: #0F2C5C;
        font-weight: 600;
        text-align: right;
        padding: 3mm 5mm;
        border: 1px solid #E8D9A8;    /* light gold */
        width: 40mm;
    }
    .info-table td {
        padding: 3mm 5mm;
        color: #2C2C2A;               /* charcoal */
        border: 1px solid #E8D9A8;
    }

    /* سجلّ تطبيق الاستراتيجية: ثلاثة أعمدة، عمود «ما نُفِّذ» يأخذ الباقي. */
    .mini-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 10pt;
        margin-bottom: 6mm;
    }
    .mini-table th {
        background: #F8F6F0;
        color: #0F2C5C;
        font-weight: 600;
        text-align: right;
        padding: 2mm 4mm;
        border: 1px solid #E8D9A8;
    }
    .mini-table th:first-child { width: 22mm; }
    .mini-table th:nth-child(2) { width: 32mm; }
    .mini-table td {
        padding: 2mm 4mm;
        color: #2C2C2A;
        border: 1px solid #E8D9A8;
        vertical-align: top;
    }

    .report-article {
        margin-bottom: 10mm;
    }
    .report-article h3 {
        font-size: 16pt;
        color: #0F2C5C;
        margin-bottom: 2mm;
    }
    .report-article .meta-line {
        font-size: 10pt;
        color: #555;
        margin-bottom: 5mm;
    }
    .report-article h4 {
        font-size: 13pt;
        margin: 5mm 0 2mm;
        color: #0F2C5C;
    }
    .report-article p, .report-article ol, .report-article ul {
        font-size: 11pt;
        line-height: 1.8;
        margin: 0 0 4mm;
        padding-right: 6mm;
    }

    .print-image-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 4mm;
        margin: 4mm 0;
    }
    .print-image-grid img {
        width: 100%;
        max-height: 70mm;
        object-fit: cover;
        border: 1px solid #CCC;
    }

    /* ---------- Students register — الطابع الكلاسيكي المعتمد ---------- */
    .students-doc .print-header .meta {
        font-size: 10pt;
    }

    /* ترويسة كلاسيكية: جهة + اسم المدرسة + شعار، ثم صف بيانات أفقي */
    .classic-header {
        text-align: right;
        border-bottom: 2.5px solid #0F2C5C;
        padding-bottom: 3mm;
        margin-bottom: 4mm;
    }
    .classic-header .ch-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 6mm;
    }
    .classic-header .ch-authority {
        font-size: 9pt;
        color: #555;
    }
    .classic-header h1 {
        font-size: 17pt;
        color: #0F2C5C;
        margin: 1mm 0 0;
    }
    .classic-header .ch-logo {
        width: 20mm;
        height: 20mm;
        object-fit: contain;
        flex-shrink: 0;
    }
    .classic-header .ch-logo-empty {
        border: 1px dashed #BBB;
        border-radius: 2mm;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 7.5pt;
        color: #AAA;
    }
    .classic-header .ch-info {
        display: flex;
        flex-wrap: wrap;
        gap: 2mm 7mm;
        margin-top: 3mm;
        font-size: 10pt;
        font-weight: 700;
        color: #14181F;
    }

    .students-register {
        width: 100%;
        /* Safe to use collapse now — pagination is manual in JS
           (chunks → separate <table> per page), no row ever crosses pages. */
        border-collapse: collapse;
        font-size: 10pt;
        margin-bottom: 0;
        border: 1.5px solid #0F2C5C;
        /* Each chunked table is self-contained on its own page */
        page-break-inside: avoid !important;
        break-inside:      avoid !important;
    }
    .students-register th,
    .students-register td {
        border: 1px solid #C9CDD6;
        padding: 6pt 8pt;
        text-align: right;
        vertical-align: middle;
        height: 8mm;
        box-sizing: border-box;
    }
    .students-register thead th {
        background: #F1F5F9;
        color: #0F2C5C;
        font-weight: 700;
        border-color: #C9CDD6;
    }
    /* Leave a little empty space at the end of each page so the last row doesn't
       get flush against the margin (which can look cut on some printers). */
    .students-doc .print-legend {
        page-break-inside: avoid !important;
        break-inside:      avoid !important;
    }
    /* NOTE: border/padding rules moved above — using border-collapse:separate */
    .students-register .col-num {
        width: 10mm;
        text-align: center;
        font-weight: 700;
    }
    .students-register .col-name {
        min-width: 45mm;
        max-width: 70mm;
    }
    .students-register .col-notes {
        min-width: 40mm;
    }
    .students-register .col-hint {
        font-size: 8pt;
        font-weight: normal;
        color: #555;
    }
    .students-register .cell-att,
    .students-register .cell-eval {
        text-align: center;
        font-size: 11pt;
        font-weight: 700;
    }

    /* Range register: days as columns */
    .range-register {
        font-size: 8.5pt;
    }
    .range-register .col-date {
        width: 12mm;
        text-align: center;
        padding: 2mm 1mm;
    }
    .range-register .col-date .date-day {
        font-size: 7.5pt;
        font-weight: 400;
        color: #555;
    }
    .range-register .col-date .date-num {
        font-weight: 700;
    }
    .range-register .col-summary {
        width: 12mm;
        background: #F8FAFC;
    }

    /* Summary register (period aggregate) */
    .summary-register .col-num  { width: 10mm; }
    .summary-register .col-name { min-width: 45mm; }
    .summary-register .col-summary {
        width: 15mm;
        text-align: center;
        background: #F8FAFC;
        font-weight: 700;
    }
    .summary-register .cell-eval {
        text-align: center;
        font-size: 10pt;
    }

    .students-doc { direction: rtl; }


    /* عنوان اليوم في وضع «جدول مستقل لكل يوم» — بالطابع الكلاسيكي */
    .daily-day-title {
        font-size: 12pt;
        font-weight: 700;
        color: #0F2C5C;
        border-bottom: 1.5px solid #0F2C5C;
        padding: 0 0 1.5mm;
        margin: 0 0 3mm;
    }

    /* تذييل كلاسيكي: الرموز على اليمين وتوقيع المعلم على اليسار */
    .print-legend {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 6mm;
        font-size: 9pt;
        color: #333;
        padding: 3mm 4mm;
        background: #F8FAFC;
        border: 1px solid #CBD5E1;
        margin-top: 4mm;
    }
    .print-legend .pl-keys {
        display: flex;
        gap: 5mm;
        align-items: center;
    }
    .print-legend .pl-sign {
        color: #14181F;
        font-weight: 700;
        white-space: nowrap;
    }
    .print-legend strong { font-weight: 700; }
}

/* ==========================================================================
   Force colored backgrounds and borders to print (for the ID card and any
   themed element that relies on gold / royal-blue fills).
   ========================================================================== */
@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust:         exact !important;
        color-adjust:               exact !important;
    }
}

/* ==========================================================================
   Personal info — Government-style ID card (PRINT)
   Class names use the print-id-* prefix to avoid colliding with the
   on-screen pf-id-* styles.
   ========================================================================== */
@media print {
    .print-id-card {
        background: #FFFFFF;
        padding: 4mm;
        border: 1pt solid #C9A961;
        max-width: 170mm;
        margin: 10mm auto;
        page-break-inside: avoid;
    }

    .print-id-inner {
        border: 0.3pt solid #C9A961;
        padding: 12mm 14mm;
    }

    .print-id-header {
        text-align: center;
        padding-bottom: 5mm;
        border-bottom: 1pt solid #0F2C5C;
        margin-bottom: 6mm;
    }

    /* كحليٌّ لا ذهبيّ — كالشاشة سواءً بسواء. والذهبيُّ كان يخرج من
       الطابعة الأحادية رماديّاً باهتاً. */
    .print-id-country {
        font-size: 10pt;
        font-weight: 500;
        color: #0F2C5C;
        letter-spacing: 0;
        margin-bottom: 2mm;
    }

    .print-id-title {
        font-size: 16pt;
        font-weight: 700;
        color: #0F2C5C;
        margin: 0;
        letter-spacing: 0;
    }

    .print-id-subtitle {
        font-size: 8pt;
        color: #6B6B68;
        margin-top: 1mm;
    }

    .print-id-body {
        display: flex;
        gap: 12mm;
        padding: 4mm 0;
        align-items: flex-start;
    }

    .print-id-photo-wrap {
        flex-shrink: 0;
        text-align: center;
    }

    .print-id-photo {
        width: 28mm;
        height: 36mm;
        border: 0.3pt solid #C9A961;
        padding: 1mm;
        background: #F8F6F0;
        overflow: hidden;
    }

    .print-id-photo img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .print-id-photo-empty {
        width: 100%;
        height: 100%;
        background: #F8F6F0;
    }

    .print-id-photo-label {
        font-size: 8pt;
        color: #6B6B68;
        margin-top: 2mm;
        letter-spacing: 0;
    }

    .print-id-table {
        flex: 1;
        width: 100%;
        border-collapse: collapse;
    }

    .print-id-table tr {
        border-bottom: 0.3pt solid #CCCCCC;
    }

    .print-id-table tr:last-child {
        border-bottom: none;
    }

    .print-id-label {
        padding: 4mm 6mm;
        font-size: 10pt;
        color: #6B6B68;
        letter-spacing: 0;
        width: 35%;
        vertical-align: middle;
    }

    .print-id-value {
        padding: 4mm 6mm;
        font-size: 11pt;
        color: #0F2C5C;
        font-weight: 500;
        vertical-align: middle;
    }

    .print-id-value-empty {
        color: #C0C0C0;
    }

    .print-id-footer {
        margin-top: 6mm;
        padding-top: 5mm;
        border-top: 1pt solid #C9A961;
        display: flex;
        justify-content: space-between;
        font-size: 9pt;
        color: #6B6B68;
    }
}

/* ==========================================================================
   TOC — flag-tab numbers + gold page numbers
   ========================================================================== */
@media print {
    .toc-page {
        background: #FFFFFF;
        padding: 4mm;
        border: 1pt solid #000000;
        max-width: 170mm;
        min-height: 250mm;
        margin: 4mm auto;
        page-break-after: always;
    }

    .toc-page-inner {
        border: 0.5pt solid #000000;
        padding: 14mm 12mm;
        min-height: calc(250mm - 24mm);
    }

    .toc-header {
        text-align: center;
        padding-bottom: 5mm;
        border-bottom: 1pt solid #000000;
        margin-bottom: 10mm;
    }

    .toc-doc-title {
        font-size: 11pt;
        color: #555555;
        margin-bottom: 3mm;
    }

    .toc-main-title {
        font-size: 22pt;
        font-weight: 700;
        color: #000000;
        margin: 0;
    }

    .toc-list { display: block; }

    .toc-row {
        display: flex;
        align-items: stretch;
        margin-bottom: 3mm;
        min-height: 11mm;
    }

    .toc-num-tag {
        flex: 0 0 12mm;
        background: #0F2C5C;
        color: #FFFFFF;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 13pt;
        font-weight: 700;
        -webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 3mm 50%);
        clip-path:         polygon(0 0, 100% 0, 100% 100%, 0 100%, 3mm 50%);
    }

    .toc-title {
        flex: 1 1 auto;
        padding: 3mm 6mm;
        display: flex;
        align-items: center;
        font-size: 12pt;
        color: #000000;
        border-bottom: 0.5pt solid #DDDDDD;
    }

    .toc-page-num {
        flex: 0 0 14mm;
        padding: 3mm;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12pt;
        font-weight: 700;
        color: #C9A961;
        border-bottom: 0.5pt solid #DDDDDD;
    }
}

/* ==========================================================================
   Weekly schedule grid — auto-rendered from saved schedule rows
   ========================================================================== */
@media print {
    .weekly-schedule-title {
        font-size: 13pt;
        color: #0F2C5C;
        font-weight: 700;
        margin: 0 0 5mm;
        padding-top: 6mm;
        border-top: 0.5pt dashed #C9A961;
    }

    .weekly-schedule {
        width: 100%;
        border-collapse: collapse;
        font-size: 9pt;
        page-break-inside: avoid;
    }

    .weekly-schedule thead th {
        background: #0F2C5C;
        color: #FFFFFF;
        font-weight: 600;
        padding: 3mm 2mm;
        border: 0.5pt solid #0F2C5C;
        text-align: center;
    }

    .weekly-schedule tbody td {
        border: 0.5pt solid #C9A961;
        padding: 3mm 2mm;
        text-align: center;
        vertical-align: top;
        height: 18mm;
    }

    .weekly-period-col {
        background: #FAF8F2;
        width: 22mm;
    }

    .weekly-period-n {
        font-weight: 700;
        color: #0F2C5C;
        font-size: 9pt;
        margin-bottom: 1mm;
    }

    .weekly-period-time {
        font-size: 8pt;
        color: #666666;
    }

    .weekly-cell-grade {
        font-weight: 700;
        color: #0F2C5C;
        font-size: 9pt;
    }

    .weekly-cell-subject {
        color: #2C2C2A;
        font-size: 9pt;
        margin-top: 1mm;
    }

    .weekly-cell-topic {
        color: #888888;
        font-size: 7.5pt;
        margin-top: 1mm;
    }

    .weekly-cell-empty {
        background: #FAFAFA;
    }
    .weekly-cell-waiting {
        background: #FEF3C7;
        color: #78350F;
    }
}

/* ==========================================================================
   Mission / Vision / Goals — centered quotes
   ========================================================================== */
@media print {
    .mission-quote {
        text-align: center;
        margin-bottom: 14mm;
        page-break-inside: avoid;
    }

    .mission-quote-label {
        font-size: 13pt;
        color: #C9A961;
        font-weight: 700;
        margin-bottom: 5mm;
    }

    .mission-quote-mark {
        font-size: 36pt;
        color: #C9A961;
        line-height: 0.5;
        margin-bottom: 3mm;
    }

    .mission-quote-text {
        font-size: 12pt;
        line-height: 1.9;
        color: #000000;
        margin: 0;
        padding: 0 8mm;
    }
}

/* ==========================================================================
   Certificate cards — one full A4 page per certificate (gold-bordered)
   ========================================================================== */
@media print {
    .cert-card {
        background: #FFFFFF;
        padding: 4mm;
        border: 1pt solid #C9A961;
        max-width: 170mm;
        min-height: 250mm;
        margin: 4mm auto;
        page-break-before: always;
        page-break-after:  always;
        page-break-inside: avoid;
    }

    .cert-card-inner {
        border: 0.5pt solid #C9A961;
        padding: 12mm 12mm;
        min-height: calc(250mm - 24mm);
        display: flex;
        flex-direction: column;
    }

    .cert-card-header {
        text-align: center;
        padding-bottom: 4mm;
        border-bottom: 1pt solid #C9A961;
        margin-bottom: 8mm;
    }

    .cert-card-counter {
        font-size: 9pt;
        color: #888888;
        margin-bottom: 3mm;
    }

    .cert-card-title {
        font-size: 14pt;
        font-weight: 600;
        color: #0F2C5C;
        margin: 0;
        line-height: 1.4;
    }

    .cert-hero {
        flex: 1 1 auto;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #FAF8F2;
        border: 0.5pt solid #E8D9A8;
        padding: 6mm;
        margin-bottom: 6mm;
        min-height: 130mm;
    }

    .cert-hero-img {
        max-width: 100%;
        max-height: 160mm;
        object-fit: contain;
        border: 1pt solid #C9A961;
    }

    .cert-hero-empty {
        font-size: 11pt;
        color: #999999;
    }

    .cert-card-meta {
        width: 100%;
        border-collapse: collapse;
        font-size: 11pt;
    }

    .cert-card-meta tr {
        border-bottom: 0.5pt solid #E8D9A8;
    }

    .cert-card-meta tr:last-child {
        border-bottom: none;
    }

    .cert-card-meta-key {
        padding: 3mm 5mm;
        color: #666666;
        width: 35%;
    }

    .cert-card-meta-val {
        padding: 3mm 5mm;
        color: #0F2C5C;
        font-weight: 600;
    }
}

/* ==========================================================================
   Section dividers — full-page B/W introduction before each section
   ========================================================================== */
@media print {
    .section-divider {
        background: #FFFFFF;
        padding: 4mm;
        border: 1pt solid #000000;
        max-width: 170mm;
        min-height: 250mm;
        margin: 4mm auto;
        page-break-before: always;
        page-break-after:  always;
    }

    .section-divider-inner {
        border: 0.5pt solid #000000;
        padding: 12mm 14mm;
        min-height: calc(250mm - 24mm);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .section-divider-header {
        font-size: 11pt;
        color: #555555;
        margin-bottom: 60mm;
    }

    .section-divider-body {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .section-divider-tag {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5mm;
        margin-bottom: 10mm;
    }

    .section-divider-line {
        display: inline-block;
        width: 20mm;
        height: 0.5pt;
        background: #000000;
    }

    .section-divider-tag-text {
        font-size: 10pt;
        color: #1A1A1A;
    }

    .section-divider-title {
        font-size: 28pt;
        font-weight: 600;
        color: #000000;
        margin: 0 0 8mm;
        line-height: 1.3;
        max-width: 140mm;
    }

    .section-divider-bottom-line {
        width: 20mm;
        height: 1pt;
        background: #000000;
        margin: 8mm 0 6mm;
    }

    .section-divider-page-num {
        font-size: 10pt;
        color: #555555;
    }
}
