/* Programmazione Didattica — layout specifico (single template) */

.prog-document { max-width: 940px; }

.prog-header {
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 3px solid var(--doccdc-r4, #43a047);
}
.prog-title {
    font-size: 2rem;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}
.prog-subtitle {
    margin: 0;
    color: #6b6157;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.prog-info { margin: 20px 0 30px; }
.prog-info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}
.prog-info-table th,
.prog-info-table td {
    border: 1px solid #b8a888;
    padding: 10px 14px;
    text-align: left;
    vertical-align: top;
}
.prog-info-table .prog-th {
    width: 16%;
    background: #f4ead8;
    color: #6b2c1a;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.prog-info-table .prog-td {
    background: #fffdf7;
    width: 34%;
    text-align: justify;
}

/* Modulo */
.prog-moduli { margin: 30px 0; }
.prog-modulo {
    margin-bottom: 30px;
    page-break-inside: avoid;
    break-inside: avoid;
}
.prog-modulo-title {
    font-size: 1.15rem;
    font-weight: 800;
    background: #43a047;
    color: #fff;
    padding: 10px 16px;
    margin: 0;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border-radius: 4px 4px 0 0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
.prog-modulo-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    table-layout: fixed;
}
.prog-modulo-table thead th {
    background: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #a4c8a6;
    padding: 8px 10px;
    font-weight: 700;
    text-align: left;
    font-size: 0.82rem;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
.prog-modulo-table tbody td {
    border: 1px solid #a4c8a6;
    padding: 10px 12px;
    vertical-align: top;
    background: #fff;
    text-align: justify;
    hyphens: auto;
}
.prog-modulo-table tbody td p { margin: 0 0 6px; }
.prog-modulo-table tbody td p:last-child { margin-bottom: 0; }

/* Obiettivi minimi */
.prog-obiettivi { margin: 30px 0; page-break-inside: avoid; break-inside: avoid; }
.prog-obiettivi-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #6b2c1a;
    background: #f4ead8;
    padding: 8px 14px;
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-left: 4px solid #d97706;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
.prog-obiettivi-body {
    padding: 4px 4px 4px 14px;
    text-align: justify;
    hyphens: auto;
}

/* Footer / firma */
.prog-footer {
    margin-top: 50px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 30px;
    flex-wrap: wrap;
    page-break-inside: avoid;
    break-inside: avoid;
}
.prog-luogo-data {
    font-style: italic;
    margin: 0;
    color: #555;
}
.prog-firma-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}
.prog-firma-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 600;
}
.prog-firma-img { max-height: 80px; width: auto; }

/* Print tweaks */
@media print {
    .prog-info-table th,
    .prog-info-table td,
    .prog-modulo-table thead th,
    .prog-modulo-table tbody td {
        border-color: #666 !important;
    }
    .prog-info-table .prog-th { background: #f4ead8 !important; color: #6b2c1a !important; }
    .prog-modulo-title { background: #2e7d32 !important; color: #fff !important; }
    .prog-modulo-table thead th { background: #e8f5e9 !important; color: #1b5e20 !important; }
    .prog-obiettivi-title { background: #f4ead8 !important; color: #6b2c1a !important; }
}

@media (max-width: 720px) {
    .prog-info-table { display: block; }
    .prog-info-table tbody, .prog-info-table tr, .prog-info-table th, .prog-info-table td { display: block; width: 100% !important; }
    .prog-info-table .prog-th { border-bottom: none; }
    .prog-modulo-table { display: block; overflow-x: auto; }
    .prog-modulo-table thead th { min-width: 130px; }
}
