/* ===========================
   Estils generals de pantalla
   =========================== */
   body {
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #000;
    background: white;
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

.examen-container {
    width: 100%;
    max-width: 19cm;   /* aproximació A4 */
    margin: 0 auto;
    padding: 1.5cm 1.5cm;
}

/* Títols */
.titol-examen {
    text-align: center;
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 10px;
}

.descripcio-examen {
    text-align: center;
    font-size: 16px;
    margin-bottom: 20px;
}

.bloc-title {
    font-size: 22px;
    font-weight: bold;
    margin-top: 30px;
    margin-bottom: 10px;
    border-bottom: 1px solid #000;
    padding-bottom: 3px;
}

/* Problemes */
.problema {
    margin-top: 25px;
    margin-bottom: 25px;
    page-break-inside: avoid; /* evita tallar problemes */
}

.problema-titol {
    font-size: 18px;
    margin-bottom: 5px;
}

.problema-enunciat {
    margin-bottom: 10px;
}

/* Apartats */
.apartat {
    display: block;
    margin-bottom: 10px;
}

.apartat-label {
    font-weight: bold;
    margin-right: 6px;
}

.apartat-text {
    display: inline-block;
}

.img-grafic {
    max-width: 100%;
    margin: 10px 0;
}

/* Salt de pàgina */
.page-break {
    page-break-before: always;
}

/* ===========================
   Estils per impressió
   =========================== */
@media print {

    /* Força full A4 amb marges reals */
    @page {
        size: A4 portrait;
        margin: 2.5cm 0.1cm 2.5cm 0.1cm;
    }

    body {
        margin: 0;
        padding: 0;
        width: 100%;
        background: white;
        color: black;
    }

    .examen-container {
        width: 100%;
        max-width: 100%;
        padding: 0; /* marges ja al @page */
    }

    /* Amaga elements de base.html */
    header, nav, footer, a, button {
        display: none !important;
    }

    /* Evita tallar problemes a mitja pàgina */
    .problema {
        page-break-inside: avoid;
    }
}
