/*************************************************/
/*************************************************/
/*
 *
 *              A4 CANDIDATES PRINT
 *
 *              794 × 1123 CSS px
 *              210 × 297 mm
 *
 *              3 × 5 CANDIDATES
 *
 */
/*************************************************/
/*************************************************/


/*
 * =================================================
 * GLOBAL
 * =================================================
 */

*
{
    box-sizing: border-box;
}


html,
body
{
    margin: 0;
    padding: 0;

    width: 100%;
    min-height: 100%;

    font-family:
        "Segoe UI",
        Arial,
        sans-serif;

    color: var(--text-color, #333);

    background: #ffffff;

    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}


body
{
    overflow-x: auto;
}


/*
 * =================================================
 * A4 PAGE
 *
 * 794 × 1123 CSS px
 *
 * 210 × 297 mm
 * =================================================
 */

.print-page
{
    width: 794px;
    height: 1123px;

    min-width: 794px;
    max-width: 794px;

    min-height: 1123px;
    max-height: 1123px;

    margin: 0 auto;

    padding: 20px;

    background: #ffffff;

    overflow: hidden;
}


/*
 * =================================================
 * PRINT AREA
 *
 * 794 - 40 = 754 px
 * =================================================
 */

#candidate-print-area
{
    width: 754px;

    margin: 0;
    padding: 0;

    background: #ffffff;
}


/*
 * =================================================
 * PRINT HEADER
 *
 * Small and clean.
 *
 * Designed to leave maximum space
 * for the 15 candidates.
 * =================================================
 */

.print-header
{
    position: relative;

    width: 754px;
    height: 72px;

    margin: 0 0 8px 0;

    padding:
        7px
        14px;

    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 12px;

    overflow: hidden;

    border-radius: 18px;

    background:
        linear-gradient(
            135deg,
            #ffffff 0%,
            #f5faf3 55%,
            #e1f0dc 100%
        );

    border:
        1px solid
        rgba(0,0,0,.07);

    box-shadow:
        0 8px 20px
        rgba(0,0,0,.10);
}


/*
 * =================================================
 * HEADER DECORATION
 * =================================================
 */

.print-header::after
{
    content: "";

    position: absolute;

    width: 125px;
    height: 125px;

    right: -55px;
    top: -70px;

    border-radius: 50%;

    /*
     * html2canvas compatible.
     * Do NOT use color-mix().
     */
    background: rgba(76, 159, 56, 0.10);

    pointer-events: none;
}


.print-header::before
{
    content: "";

    position: absolute;

    width: 75px;
    height: 75px;

    right: 75px;
    bottom: -52px;

    border-radius: 50%;

    border:
        1px solid
        rgba(0,0,0,.06);

    pointer-events: none;
}


/*
 * =================================================
 * HEADER LOGO
 * =================================================
 */

.header-logo
{
    position: relative;

    z-index: 2;

    flex:
        0 0 auto;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    padding:
        4px
        8px;

    max-width: 38%;

    background: #ffffff;

    border-radius: 10px;

    box-shadow:
        0 4px 12px
        rgba(0,0,0,.08);
}


.header-logo img
{
    display: block;

    width: auto;
    height: auto;

    max-width: 125px;
    max-height: 55px;

    object-fit: contain;

    margin: 0;
    padding: 0;

    border: 0;
}


/*
 * =================================================
 * HEADER TITLE
 * =================================================
 */

.header-title
{
    position: relative;

    z-index: 2;

    flex: 1;

    min-width: 0;

    text-align: right;

    font-family:
        "Arial",
        "Segoe UI",
        sans-serif;
}


.header-title h1
{
    margin: 0;

    font-family:
        "Arial",
        "Segoe UI",
        sans-serif;

    font-size: 28px;

    line-height: 1.05;

    font-weight: 800;

    letter-spacing: 0;

    color:
        var(--title-color, #12345b);
}


.header-title p
{
    margin:
        4px
        0
        0;

    font-family:
        "Arial",
        "Segoe UI",
        sans-serif;

    font-size: 12px;

    line-height: 1.2;

    font-weight: 600;

    color:
        var(--text-secondary, #555);
}

.header-web
{
    display: block;

    margin-top: 5px;

    font-family:
        "Arial",
        "Segoe UI",
        sans-serif;

    font-size: 10px;

    line-height: 1.2;

    font-weight: 700;

    color:
        var(--main-color, #4c9f38);
}

.header-social-separator
{
    margin:
        0
        5px;

    color:
        #999;
}

/*
 * =================================================
 * CANDIDATE GRID
 *
 * EXACTLY 3 × 5
 *
 * Width:
 * 754 px
 *
 * Gap:
 * 8 px
 *
 * Card width:
 * (754 - 16) / 3
 * = 246 px
 *
 * Rows:
 * 5 × 194
 *
 * Gaps:
 * 4 × 8 = 32
 *
 * Total:
 * 1002 px
 *
 * Header:
 * 72 + 8 = 80
 *
 * Footer:
 * ~20
 *
 * Total:
 * ~1102 px
 *
 * Fits inside 1123 px.
 * =================================================
 */

.candidate-grid
{
    display: grid;

    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );

    grid-template-rows:
        repeat(
            5,
            194px
        );

    column-gap: 8px;

    row-gap: 8px;

    width: 754px;

    margin: 0;
    padding: 0;
}


/*
 * =================================================
 * CANDIDATE CARD
 *
 * Same visual concept as .member-card
 * from candidates.css.
 * =================================================
 */

.candidate
{
    position: relative;

    width: 100%;
    height: 194px;

    min-width: 0;
    min-height: 194px;

    max-height: 194px;

    overflow: hidden;

    display: flex;

    flex-direction: column;

    background:
        var(--card-bg, #ffffff);

    border-radius: 18px;

    border:
        1px solid
        rgba(0,0,0,.07);

    box-shadow:
        0 10px 24px
        rgba(0,0,0,.14);

    break-inside: avoid;

    page-break-inside: avoid;
}


/*
 * =================================================
 * PHOTO AREA
 *
 * Same visual idea as:
 *
 * .photo-wrapper
 *
 * from candidates.css.
 * =================================================
 */

.candidate-top
{
    position: relative;

    width: 100%;

    height: 106px;

    min-height: 106px;
    max-height: 106px;

    flex:
        0 0 106px;

    display: flex;

    align-items: center;
    justify-content: center;

    overflow: hidden;

    background:
        var(--page-bg, #f3f3f3);
}


/*
 * =================================================
 * PHOTO BACKGROUND DECORATION
 * =================================================
 */

.candidate-top::before
{
    content: "";

    position: absolute;

    width: 145px;
    height: 145px;

    left: 50%;
    top: -92px;

    transform:
        translateX(-50%);

    border-radius: 50%;

    /*
     * html2canvas compatible.
     * Replaces color-mix(... 12%, transparent).
     */
    border:
        1px solid
        rgba(76, 159, 56, 0.12);

    pointer-events: none;
}


.candidate-top::after
{
    content: "";

    position: absolute;

    width: 75px;
    height: 75px;

    right: -35px;
    bottom: -40px;

    border-radius: 50%;

    /*
     * html2canvas compatible.
     * Replaces color-mix(... 7%, transparent).
     */
    background: rgba(76, 159, 56, 0.07);

    pointer-events: none;
}


/*
 * =================================================
 * CANDIDATE PHOTO
 *
 * EXACT FRAME
 *
 * 92 × 92 px
 *
 * IMPORTANT:
 *
 * The frame is ALWAYS identical.
 * =================================================
 */

.candidate-photo
{
    position: relative;

    z-index: 3;

    width: 92px;
    height: 92px;

    min-width: 92px;
    min-height: 92px;

    max-width: 92px;
    max-height: 92px;

    flex:
        0 0 92px;

    overflow: hidden;

    border-radius: 50%;

    background: #ffffff;

    border:
        5px solid
        #ffffff;

    box-shadow:
        0 8px 20px
        rgba(0,0,0,.22);
}


/*
 * =================================================
 * PHOTO IMAGE
 *
 * FORCE SAME SIZE
 *
 * object-fit: fill
 *
 * This deliberately does NOT preserve
 * the source aspect ratio.
 *
 * Portrait and landscape photos are
 * stretched into exactly the same
 * circular frame.
 * =================================================
 */

.candidate-photo img,
.candidate-photo-image
{
    display: block;

    width: 100% !important;
    height: 100% !important;

    min-width: 100% !important;
    min-height: 100% !important;

    max-width: none !important;
    max-height: none !important;

    object-fit: fill !important;

    object-position:
        50% 50% !important;

    margin: 0 !important;
    padding: 0 !important;

    border: 0 !important;

    border-radius: 50%;

    vertical-align: middle;
}


/*
 * =================================================
 * EMPTY PHOTO
 * =================================================
 */

.candidate-photo-empty
{
    width: 100%;
    height: 100%;

    min-width: 100%;
    min-height: 100%;

    display: flex;

    align-items: center;
    justify-content: center;

    font-size: 25px;

    line-height: 1;

    font-weight: 800;

    color:
        var(--main-color, #4c9f38);

    background:
        linear-gradient(
            135deg,
            #e8f4e4,
            #f7faf7
        );
}


/*
 * =================================================
 * CANDIDATE NUMBER
 *
 * Similar to .member-number
 * from candidates.css.
 * =================================================
 */

.candidate-number
{
    position: absolute;

    z-index: 10;

    left: 8px;
    top: 8px;

    width: 34px;
    height: 34px;

    display: flex;

    align-items: center;
    justify-content: center;

    background:
        linear-gradient(
            135deg,
            var(--main-color, #4c9f38),
            var(--main-color-dark, #87c442)
        );

    color: #ffffff;

    border-radius: 50%;

    border:
        3px solid
        #ffffff;

    font-size: 14px;

    line-height: 1;

    font-weight: 800;

    box-shadow:
        0 5px 12px
        rgba(0,0,0,.22);
}


/*
 * =================================================
 * CANDIDATE BODY
 *
 * Same visual language as .card-body
 * =================================================
 */

.candidate-body
{
    flex:
        1 1 auto;

    min-height: 0;

    padding:
        7px
        12px
        6px;

    display: flex;

    flex-direction: column;

    justify-content: center;

    text-align: center;

    overflow: hidden;
}


/*
 * =================================================
 * NAME
 * =================================================
 */
.candidate-name
{
    margin: 0;

    font-family:
        "Arial",
        "Segoe UI",
        sans-serif;

    font-size: 16px;

    line-height: 1.15;

    font-weight: 700;

    color:
        var(--title-color, #12345b);

    overflow-wrap: break-word;
}

/*
 * =================================================
 * YEAR
 * =================================================
 */

.candidate-year
{
    display: inline;

    margin-left: 3px;

    font-size: 9px;

    line-height: 1.1;

    font-weight: 500;

    color:
        var(--text-secondary, #666);
}


/*
 * =================================================
 * ROLE
 *
 * Same as .member-role
 * =================================================
 */

.candidate-role
{
    margin-top: 4px;

    font-family:
        "Arial",
        "Segoe UI",
        sans-serif;

    font-size: 11px;

    line-height: 1.2;

    font-weight: 600;

    color:
        var(--main-color, #4c9f38);

    overflow-wrap: break-word;
}


/*
 * =================================================
 * DETAILS
 * =================================================
 */
.candidate-detail
{
    display: flex;

    align-items: baseline;

    justify-content: center;

    gap: 4px;

    font-size: 9px;

    line-height: 1.25;
}

.candidate-detail-label
{
    font-size: 9px;

    font-weight: 600;

    color:
        var(--text-secondary, #555);
}

.candidate-detail-value
{
    font-size: 9px;

    font-weight: 600;

    color:
        var(--text-color, #333);

    overflow-wrap: anywhere;
}

/*
 * =================================================
 * FOOTER
 * =================================================
 */

.print-footer
{
    width: 754px;

    height: 20px;

    margin-top: 6px;

    padding-top: 5px;

    display: flex;

    justify-content: space-between;

    align-items: center;

    border-top:
        1px solid
        rgba(0,0,0,.08);

    font-size: 8px;

    line-height: 1;

    color:
        var(--text-secondary, #666);
}


/*
 * =================================================
 * EXPORT BUTTON
 * =================================================
 */
.print-actions
{
    width: 794px;

    height: 60px;

    margin:
        0
        auto
        15px;

    display: flex;

    justify-content: flex-end;
    align-items: center;

    gap: 8px;

    border-bottom:
        1px solid
        rgba(0,0,0,.10);
}


/*************************************************/
/* SPACE BETWEEN BUTTON AND A4 PAGE */
/*************************************************/

.print-actions::after
{
    content: "";

    position: absolute;
}


/*************************************************/
/* BUTTON */
/*************************************************/

.print-action
{
    border: 0;

    border-radius: 12px;

    padding:
        9px
        16px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    font-family:
        "Segoe UI",
        Arial,
        sans-serif;

    font-size: 14px;

    font-weight: 600;

    cursor: pointer;

    background:
        linear-gradient(
            135deg,
            #5b9e45,
            #3f7d33
        );

    color: #ffffff;

    box-shadow:
        0 7px 18px
        rgba(63,125,51,.22);

    transition:
        transform .15s ease,
        box-shadow .15s ease,
        opacity .15s ease;
}


.print-action:hover
{
    transform:
        translateY(-1px);

    box-shadow:
        0 10px 22px
        rgba(63,125,51,.26);
}


.print-action:active
{
    transform:
        translateY(0);
}


.print-action:disabled
{
    opacity: .6;

    cursor: wait;
}


/*
 * =================================================
 * PRINT
 * =================================================
 */

@page
{
    size: A4 portrait;

    margin: 0;
}


@media print
{
    html,
    body
    {
        width: 210mm;
        height: 297mm;

        margin: 0;
        padding: 0;

        background: #ffffff;
    }


    .print-actions
    {
        display: none !important;
    }


    .print-page
    {
        width: 794px;
        height: 1123px;

        min-width: 794px;
        max-width: 794px;

        min-height: 1123px;
        max-height: 1123px;

        margin: 0;

        padding: 20px;

        overflow: hidden;
    }


    #candidate-print-area
    {
        width: 754px;
    }


    .print-header
    {
        box-shadow: none;
    }


    .candidate
    {
        box-shadow: none;

        break-inside: avoid;

        page-break-inside: avoid;
    }


    /*
     * EXACT PHOTO FRAME
     */

    .candidate-photo
    {
        width: 92px !important;
        height: 92px !important;

        min-width: 92px !important;
        min-height: 92px !important;

        max-width: 92px !important;
        max-height: 92px !important;

        flex:
            0 0 92px !important;
    }


    /*
     * FORCE SAME PHOTO SIZE
     */

    .candidate-photo img,
    .candidate-photo-image
    {
        width: 100% !important;
        height: 100% !important;

        min-width: 100% !important;
        min-height: 100% !important;

        max-width: none !important;
        max-height: none !important;

        object-fit: fill !important;

        object-position:
            50% 50% !important;
    }


    .print-footer
    {
        break-inside: avoid;

        page-break-inside: avoid;
    }
}