/* ---------- 幹部與社團、證明書 ---------- */

.portal-activity-docs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.portal-cadre-class + .portal-cadre-class {
    margin-top: 16px;
}

.portal-cert {
    max-width: 210mm;
    margin: 0 auto;
    padding: 16mm 14mm;
    background: #fff;
    color: #000;
    border: 1px solid var(--mud-palette-divider);
    border-radius: 8px;
    font-size: 11pt;
    line-height: 1.6;
}

.portal-cert-title {
    margin: 0 0 12px;
    text-align: center;
    font-size: 18pt;
    font-weight: 700;
    letter-spacing: 0.1em;
    line-height: 1.5;
}

.portal-cert-h2 {
    margin: 14px 0 6px;
    font-size: 12pt;
    font-weight: 700;
}

.portal-cert-who,
.portal-cert-table {
    width: 100%;
    border-collapse: collapse;
    margin: 6px 0 10px;
}

.portal-cert-who th,
.portal-cert-who td,
.portal-cert-table th,
.portal-cert-table td {
    padding: 4px 6px;
    border: 1px solid #000;
    text-align: left;
    vertical-align: top;
}

.portal-cert-who th,
.portal-cert-table thead th {
    width: 1%;
    white-space: nowrap;
    background: #f2f2f2;
    font-weight: 600;
}

.portal-cert-table thead th {
    width: auto;
    text-align: center;
}

.portal-cert-nowrap {
    white-space: nowrap;
}

.portal-cert-label {
    margin-right: 0.5em;
    font-weight: 600;
}

.portal-cert-lead,
.portal-cert-line {
    margin: 8px 0;
}

.portal-cert-end {
    margin: 16px 0 0;
    font-size: 12pt;
    letter-spacing: 0.3em;
}

.portal-cert-foot {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 28px;
}

@page cert {
    size: A4 portrait;
    margin: 12mm;
}

@media print {
    .portal-cert {
        page: cert;
        max-width: none;
        padding: 0;
        border: 0;
        border-radius: 0;
    }

    .portal-cert-table thead {
        display: table-header-group;
    }

    .portal-cert-table tr {
        break-inside: avoid;
    }

    .portal-cadre-class {
        break-after: page;
        box-shadow: none !important;
        border: 0 !important;
    }

    .portal-cadre-class:last-of-type {
        break-after: auto;
    }
}
