.rdf-documents,
.rdf-documents * {
    box-sizing: border-box;
}

.rdf-documents {
    --rdf-primary: #064aa2;
    --rdf-dark: #082b67;
    --rdf-accent: #f2a900;
    --rdf-border: #e3e8f0;
    --rdf-muted: #657087;
    --rdf-surface: #ffffff;
    width: 100%;
    margin: 0 auto;
    color: var(--rdf-dark);
    font-family: inherit;
}

.rdf-section-header {
    max-width: 760px;
    margin: 0 0 38px;
}

.rdf-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--rdf-accent);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.rdf-eyebrow::before {
    width: 20px;
    height: 2px;
    content: "";
    background: currentColor;
}

.rdf-section-title {
    margin: 0 0 12px;
    color: var(--rdf-dark);
    font-size: clamp(2rem, 4vw, 3.15rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.rdf-section-description {
    margin: 0;
    color: var(--rdf-muted);
    font-size: 1.08rem;
    line-height: 1.65;
}

.rdf-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    align-items: start;
}

.rdf-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    padding: 24px 22px 18px;
    border: 1px solid rgba(8, 43, 103, 0.07);
    border-radius: 18px;
    background: var(--rdf-surface);
    box-shadow: 0 12px 35px rgba(8, 43, 103, 0.08);
}

.rdf-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    min-height: 92px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--rdf-border);
}

.rdf-card-icon {
    display: grid;
    width: 62px;
    height: 62px;
    flex: 0 0 62px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(145deg, #0b65c7, var(--rdf-primary));
    box-shadow: 0 8px 18px rgba(6, 74, 162, 0.2);
}

.rdf-card--lettere .rdf-card-icon {
    background: linear-gradient(145deg, #f9b91f, var(--rdf-accent));
    box-shadow: 0 8px 18px rgba(242, 169, 0, 0.2);
}

.rdf-card-icon svg {
    width: 30px;
    height: 30px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.rdf-card-title {
    margin: 2px 0 5px;
    color: var(--rdf-dark);
    font-size: 1.16rem;
    line-height: 1.25;
}

.rdf-card-description {
    margin: 0;
    color: var(--rdf-muted);
    font-size: 0.94rem;
    line-height: 1.48;
}

.rdf-document-list {
    min-width: 0;
}

.rdf-document-item {
    display: grid;
    grid-template-columns: 27px minmax(0, 1fr) 34px;
    gap: 11px;
    align-items: center;
    min-height: 64px;
    padding: 10px 0;
    border-bottom: 1px solid var(--rdf-border);
}

.rdf-document-item[hidden] {
    display: none;
}

.rdf-pdf-badge {
    display: inline-flex;
    width: 25px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    color: #fff;
    background: #ed4b55;
    font-size: 0.52rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.rdf-document-copy {
    min-width: 0;
}

.rdf-document-title {
    display: block;
    overflow: hidden;
    color: var(--rdf-dark);
    font-size: 0.94rem;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
    text-overflow: ellipsis;
}

.rdf-document-title:hover,
.rdf-document-title:focus-visible {
    color: var(--rdf-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.rdf-document-meta {
    display: block;
    margin-top: 3px;
    color: var(--rdf-muted);
    font-size: 0.78rem;
    line-height: 1.25;
}

.rdf-download-link {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    color: var(--rdf-primary);
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.rdf-card--lettere .rdf-download-link {
    color: var(--rdf-accent);
}

.rdf-download-link:hover,
.rdf-download-link:focus-visible {
    background: rgba(6, 74, 162, 0.09);
    transform: translateY(-1px);
}

.rdf-download-link svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.rdf-show-all {
    display: none;
    width: 100%;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 16px;
    padding: 8px 12px;
    border: 1px solid var(--rdf-primary);
    border-radius: 7px;
    color: var(--rdf-primary);
    background: transparent;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.rdf-documents.rdf-js-enabled .rdf-show-all {
    display: flex;
}

.rdf-card--lettere .rdf-show-all {
    border-color: var(--rdf-accent);
    color: #c98200;
}

.rdf-show-all:hover,
.rdf-show-all:focus-visible {
    color: #fff;
    background: var(--rdf-primary);
}

.rdf-card--lettere .rdf-show-all:hover,
.rdf-card--lettere .rdf-show-all:focus-visible {
    color: var(--rdf-dark);
    background: var(--rdf-accent);
}

.rdf-show-all svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    transition: transform 0.2s ease;
}

.rdf-show-all[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.rdf-empty-message {
    margin: 22px 0 8px;
    color: var(--rdf-muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.rdf-pdf-note {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-top: 25px;
    padding: 15px 20px;
    border-radius: 10px;
    color: var(--rdf-primary);
    background: #eef6ff;
    font-size: 0.91rem;
    line-height: 1.45;
}

.rdf-pdf-note svg {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.rdf-documents :focus-visible {
    outline: 3px solid #f2a900;
    outline: 3px solid color-mix(in srgb, var(--rdf-accent) 75%, white);
    outline-offset: 3px;
}

@media (max-width: 1024px) {
    .rdf-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rdf-card:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 680px) {
    .rdf-section-header {
        margin-bottom: 26px;
    }

    .rdf-card-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .rdf-card:last-child {
        grid-column: auto;
    }

    .rdf-card {
        padding: 20px 17px 16px;
        border-radius: 15px;
    }

    .rdf-card-header {
        min-height: 0;
    }

    .rdf-card-icon {
        width: 52px;
        height: 52px;
        flex-basis: 52px;
    }

    .rdf-card-icon svg {
        width: 26px;
        height: 26px;
    }

    .rdf-pdf-note {
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rdf-documents *,
    .rdf-documents *::before,
    .rdf-documents *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
