/* =====================================================================
   Bulletins de notes imprimables (templates/bulletin/imprimer.html.twig)

   ⚠️ Une feuille A4 par bulletin. À l'écran, les feuilles se suivent sur un
   fond gris ; à l'impression, seules elles restent, une par page.
   ===================================================================== */

@page {
    size: A4;
    margin: 14mm 14mm 12mm;
}

.bulletin-outils {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 16px;
    background: var(--c-encre);
    color: #fff;
    font-size: 14px;
}

.bulletin-outils__retour {
    color: #fff;
}

.bulletin-outils__imprimer {
    font: inherit;
    font-weight: 700;
    padding: 7px 16px;
    border: 0;
    border-radius: 8px;
    background: #fff;
    color: var(--c-encre);
    cursor: pointer;
}

.bulletin-vide {
    max-width: 210mm;
    margin: 24px auto;
    padding: 0 16px;
}

.bulletin {
    box-sizing: border-box;
    width: 100%;
    max-width: 210mm;
    min-height: 297mm;
    margin: 18px auto;
    padding: 14mm;
    background: #fff;
    color: #111;
    font-size: 12.5px;
    line-height: 1.35;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .18);
}

.bulletin__entete {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.bulletin__etat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2px;
    font-size: 11.5px;
}

.bulletin__trait {
    width: 60px;
    border-top: 1px solid #111;
    margin: 4px 0;
}

.bulletin__etablissement {
    margin-top: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

.bulletin__annee {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 11.5px;
    white-space: nowrap;
}

.bulletin__annee strong {
    font-size: 14px;
}

.bulletin__titre {
    margin: 18px 0 12px;
    text-align: center;
    font-family: var(--police-titre);
    font-size: 20px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.bulletin__titre span {
    display: block;
    font-size: 13px;
    letter-spacing: .02em;
    text-transform: none;
}

.bulletin table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
}

.bulletin th,
.bulletin td {
    border: 1px solid #555;
    padding: 5px 7px;
    text-align: left;
    vertical-align: top;
}

.bulletin__identite th,
.bulletin__resultats th {
    width: 22%;
    background: #f1f1f1;
    font-weight: 600;
}

.bulletin__notes thead th,
.bulletin__notes tfoot th {
    background: #f1f1f1;
}

.bulletin__nombre {
    width: 14%;
    text-align: right !important;
    font-variant-numeric: tabular-nums;
}

.bulletin__moyenne {
    font-size: 15px;
    font-weight: 800;
}

.bulletin__note {
    font-style: italic;
    font-size: 11.5px;
}

.bulletin__pied {
    margin-top: 16px;
    font-size: 10.5px;
    color: #555;
    text-align: right;
}

@media screen {
    body:has(.bulletin) {
        background: #e6e8eb;
    }
}

@media print {
    .bulletin-outils {
        display: none;
    }

    body {
        background: #fff;
    }

    .bulletin {
        max-width: none;
        min-height: 0;
        margin: 0;
        padding: 0;
        box-shadow: none;
        break-after: page;
    }

    .bulletin:last-of-type {
        break-after: auto;
    }

    .bulletin table,
    .bulletin tr {
        break-inside: avoid;
    }
}

/* Accès depuis l'écran des notes. */
.bulletins-acces {
    margin: 0 0 14px;
}

.bulletin-lien {
    white-space: nowrap;
}
