/* Custom styles for About Us page */

.vision-mission-section {
    padding: 3rem 0;
}

.vm-grid {
    display: flex;
    gap: 1.5rem;
    align-items: stretch;
}

.vm-card,
.vm-image {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 250px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.vm-card {
    flex: 1;
    /* Wider content box */
}

.vm-image {
    flex: 0 0 30%;
    /* Narrower image box */
}

.vm-card {
    color: white;
    padding: 2rem;
    border-radius: 0.5rem;
}

.vm-card.mission {
    background-color: #a92028;
    /* Dark Red */
}

.vm-card.vision {
    background-color: #913f00 !important;
    /* Orange — darkened from #f57c00 (2.71:1) to #b85000 (5.02:1, AA), then to #913f00
       (7.20:1) for WCAG AAA with white text; same hue.
       !important blocks the accessibility overlay from re-injecting the old #f57c00. */
}

/* Children of .vision (h2, p, li, ol) get inline background injected by the
   UserWay overlay copying the parent's computed bg. Force them transparent
   so the parent's locked #913f00 shows through, and lock white text at 7.20:1. */
.vm-card.vision h2,
.vm-card.vision p,
.vm-card.vision li,
.vm-card.vision ol,
.vm-card.vision ul {
    background-color: transparent !important;
    background: transparent !important;
    color: #ffffff !important;
    opacity: 1 !important;
}

.vm-card.values {
    background-color: #00838f;
    /* Teal */
}

.vm-card h2 {
    font-size: 1.75rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.vm-card p {
    font-size: 14px !important;
    font-family: 'Sakal Marathi', 'SakalBharati', 'Noto Sans Devanagari', 'Mangal', 'Baloo 2', Arial, sans-serif !important;
    line-height: 1.6;
    color: #ffff;
    padding: 0!important;
    margin-bottom: 0!important;
}

/* Remove default bullets for ul, but allow numbering for ol */
.vm-card ul {
    list-style: none;
    padding-left: 1.5rem;
    /* space for checkmark */
}

/* Make li position relative */
.vm-card ul li {
    position: relative;
    margin-bottom: 0.8rem;
    /* Increased spacing */
    color: #fff;
}

/* Add ✔ before ul li */
.vm-card ul li::before {
    content: "✔" !important;
    position: absolute;
    left: -1.2rem;
    top: 0;
    color: #fff;
    font-weight: bold;
    font-size: 1.1rem;
}

/* Numbered list styling for ol */
.vm-card ol {
    list-style-type: decimal;
    padding-left: 1.5rem;
}

.vm-card ol li {
    font-size: 1rem;
    /* 16px – ideal for readability */
    line-height: 1.7;
    font-family: 'Sakal Marathi', 'SakalBharati',
        'Noto Sans Devanagari', 'Mangal',
        'Baloo 2', Arial, sans-serif;
}

/* Number marker size */
.vm-card ol li::marker {
    font-size: 1.1rem;
    font-weight: bold;
}


/* Nested lists styling */
.vm-card ol ol,
.vm-card ol ul {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.vm-card ol ol {
    list-style-type: decimal;
}

.vm-card ol ul {
    list-style-type: disc !important;
    padding-left: 1.5rem;
}

.vm-card ol ul li {
    list-style-type: disc !important;
}

.vm-card ol ul li::before {
    content: none !important;
    /* Remove checkmark for nested ul */
}

.vm-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffff;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    /* Added shadow for premium look */
}

.vm-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* This block always meant to stack the panels on a phone, but `grid-template-columns`
       only applies to a grid container and .vm-grid is display:flex - so the rule did
       nothing and the two panels stayed side by side. Measured at 425px: the container's
       2rem padding plus the image's fixed 30% left the red card about 175px wide, which
       broke "Short-Term Goals (upto 2 October 2029)" onto one word per line.
       flex-direction is the flex equivalent of what was intended here. */
    .vm-grid {
        flex-direction: column;
    }

    .vm-card,
    .vm-image {
        flex: 1 1 auto;      /* release .vm-image's fixed 30% basis once stacked */
        width: 100%;
        min-height: 0;       /* the 250px floor is for side-by-side panels */
        margin-bottom: 1.5rem;
    }

    /* The two blocks alternate on purpose so the panels zig-zag on a wide screen: the first
       is text | image, the second image | text. Stacked, that DOM order reads

           TEXT (short-term goals) -> IMAGE (दृष्टी) -> IMAGE (ध्येय) -> TEXT (medium-term)

       and the two pictures end up against each other with their captions separated from
       them - measured at 375px, the दृष्टी image at y2189 and the ध्येय image at y2554 with
       no text between. Putting the image first in every block restores the pairing:

           IMAGE -> TEXT -> IMAGE -> TEXT

       `order` is used rather than moving the markup so the desktop zig-zag is untouched -
       it only applies while the grid is a column. */
    .vm-grid > .vm-image {
        order: -1;
    }

    /* 2rem each side is a third of a 375px screen spent on padding. */
    .vm-section-container {
        padding: 1rem;
        max-width: 100%;
    }

    .vm-card {
        padding: 1.25rem;
    }
}

/* Printing Vision & Mission (About Us -> दृष्टी आणि ध्येय, Ctrl+P).
   Print is ~700px wide, so the stacked layout above applies and each picture became a 587px
   square in a 687px white box. When that box started near the foot of a sheet, the picture
   (which cannot be split) jumped to the next sheet but its flex box did not grow with it:
   the first sheet got an empty white frame and the next sheet printed the binoculars ON TOP
   of the medium-term text (Chrome, 29-Oct-2026).
   - break-inside: avoid moves the whole box - caption and picture together - to the next
     sheet, so the picture is never separated from its frame;
   - side by side (picture 30% | text), as on a desktop, instead of the phone stack. The
     stack depends on `order: -1` to put each picture above its text, and Chrome breaks
     pages in SOURCE order, not visual order - so the stacked block could not be split and
     jumped whole to the next sheet, leaving the sheet before it blank. Side by side needs
     no reordering, keeps each picture beside its own text, and uses less paper. */
@media print {
    /* The pair (picture + its text) is kept on ONE sheet. Without this Chrome could leave the
       picture at the foot of a sheet and start its text on the next one - seen in English,
       where the text is shorter than Marathi and the block began lower down the sheet.
       Side by side, a pair is ~500-600px, comfortably less than an A4 sheet. */
    html body .vm-grid {
        flex-direction: row !important;
        align-items: flex-start !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    html body .vm-grid > .vm-image {
        order: 0 !important;
        flex: 0 0 30% !important;
        width: 30% !important;
        margin-bottom: 0 !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
        padding: 1rem !important;
        box-shadow: none !important;
    }

    /* The four About Us cards (History / Vision / Milestones / Digitisation). Each carries
       Bootstrap's h-100 - "as tall as my column" - which is right on screen, where the
       columns sit side by side. In print they stack, and the 4th card did not fit on the
       first sheet: moved whole to the next one, it kept a height measured from what was left
       on the first, so it printed as a thin strip with its laptop icon hanging out below.
       Its own content sets its height on paper instead. */
    html body .about-card.h-100 {
        height: auto !important;
        min-height: 0 !important;
    }

    html body .vm-grid > .vm-card {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        width: auto !important;
        margin-bottom: 0 !important;
    }

    html body .vm-image img {
        width: 100% !important;
        height: auto !important;
    }

    html body .vm-card {
        padding: 1.25rem !important;
    }
}