/* =========================================================
   ARCHIVIO MODULISTICA E NORMATIVA
========================================================= */

.secal-library-hero {
    padding: 54px 0 48px;
    background:
        radial-gradient(circle at 82% 20%, rgba(0,166,180,.12), transparent 28%),
        linear-gradient(135deg, #f5f9fd, #fff);
    border-bottom: 1px solid #e1e9f2;
}

.secal-library-hero__content {
    max-width: 820px;
    margin-top: 38px;
}

.secal-library-hero__label {
    display: inline-flex;
    margin-bottom: 14px;
    padding: 7px 12px;
    border-radius: 999px;
    background: #eaf4ff;
    color: var(--secal-primary);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.secal-library-hero h1 {
    margin: 0 0 18px;
    color: #15324b;
    font-size: clamp(42px, 5vw, 68px);
    line-height: 1.02;
    font-weight: 850;
    letter-spacing: -.04em;
}

.secal-library-hero p {
    max-width: 760px;
    margin: 0;
    color: #5d7183;
    font-size: 19px;
    line-height: 1.65;
}

.secal-library {
    padding: 72px 0 90px;
    background: #f7f9fc;
}

.secal-library__tabs {
    display: flex;
    gap: 14px;
    margin-bottom: 34px;
    padding: 8px;
    border: 1px solid #dbe6f0;
    border-radius: 16px;
    background: #eaf0f6;
}

.secal-library__tab {
    flex: 1;
    min-height: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 22px;
    border: 2px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: #37546c;
    font-size: 16px;
    font-weight: 800;
    transition:
        background-color .2s ease,
        border-color .2s ease,
        color .2s ease,
        transform .2s ease;
}

.secal-library__tab:hover {
    border-color: #99bde3;
    background: rgba(255,255,255,.7);
    color: #0058b0;
}

.secal-library__tab.is-active {
    border-color: #0058b0;
    background: #0058b0;
    color: #fff;
    box-shadow: 0 10px 24px rgba(0,88,176,.2);
}

.secal-library__tab.is-active:hover {
    color: #fff;
    transform: translateY(-1px);
}

.secal-library__tab .material-symbols-outlined {
    font-size: 24px;
}

.secal-library__count {
    min-width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    border-radius: 999px;
    background: #d5e2ee;
    color: #294960;
    font-size: 12px;
    font-weight: 900;
}

.secal-library__tab.is-active .secal-library__count {
    background: rgba(255,255,255,.22);
    color: #fff;
}

/* =========================================================
   FILTRI
========================================================= */

.secal-library__filters {
    display: grid;
    grid-template-columns:
        minmax(0, 2fr)
        minmax(240px, 1fr)
        auto;
    align-items: end;
    gap: 18px;
    margin-bottom: 22px;
    padding: 24px;
    border: 1px solid #dbe6f0;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 16px 42px rgba(21, 50, 75, .07);
}

.secal-library__field {
    min-width: 0;
}

.secal-library__field label {
    display: block;
    margin-bottom: 9px;
    color: #15324b;
    font-size: 14px;
    font-weight: 800;
}

.secal-library__search {
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 16px;
    border: 2px solid #cbd9e6;
    border-radius: 11px;
    background: #fff;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.secal-library__search:focus-within {
    border-color: #0058b0;
    box-shadow: 0 0 0 4px rgba(0, 88, 176, .1);
}

.secal-library__search .material-symbols-outlined {
    color: #0058b0;
}

.secal-library__search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #15324b;
    font-size: 16px;
}

.secal-library__field select {
    width: 100%;
    min-height: 54px;
    padding: 0 14px;
    border: 2px solid #cbd9e6;
    border-radius: 11px;
    background: #fff;
    color: #15324b;
    font-size: 16px;
}

.secal-library__field select:focus {
    border-color: #0058b0;
    outline: 0;
    box-shadow: 0 0 0 4px rgba(0, 88, 176, .1);
}

/* Pulsanti affiancati, non a tutta larghezza */
.secal-library__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 0 2px;
    white-space: nowrap;
}

.secal-library__search-button,
.secal-library__reset-button {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    transition: .2s ease;
}

.secal-library__search-button {
    border: 2px solid #0058b0;
    background: #0058b0;
    color: #fff;
}

.secal-library__search-button:hover {
    border-color: #00478e;
    background: #00478e;
    color: #fff;
    transform: translateY(-2px);
}

.secal-library__reset-button {
    border: 2px solid #b8c9d8;
    background: #fff;
    color: #37546c;
}

.secal-library__reset-button:hover {
    border-color: #0058b0;
    color: #0058b0;
    transform: translateY(-2px);
}

.secal-library__search-button .material-symbols-outlined,
.secal-library__reset-button .material-symbols-outlined {
    font-size: 20px;
}


.secal-library__summary {
    margin: 0 0 24px;
    padding: 0 3px;
    color: #5d7183;
    font-size: 15px;
}

.secal-library__summary strong {
    color: #15324b;
    font-size: 18px;
}

/* =========================================================
   GRIGLIA RISULTATI
========================================================= */

.secal-library__grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 18px;
}

.secal-library-item {
    min-width: 0;
    height: 100%;
}

.secal-library-item[hidden] {
    display: none !important;
}

.secal-library-item .secal-resource-card {
    height: 100%;
}

@media (max-width: 767px) {
    .secal-library__tabs {
        display: grid;
        grid-template-columns: 1fr;
    }

    .secal-library__tab {
        width: 100%;
    }

    .secal-library__filters {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .secal-library__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .secal-library__search-button,
    .secal-library__reset-button {
        width: 100%;
        padding-left: 10px;
        padding-right: 10px;
    }
}

@media (max-width: 420px) {
    .secal-library__actions {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 991px) {
    .secal-library__filters {
        grid-template-columns: minmax(0, 1fr) minmax(220px, .8fr);
    }

    .secal-library__actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}

@media (max-width: 767px) {
    .secal-library-hero {
        padding: 36px 0 32px;
    }

    .secal-library {
        padding: 48px 0 64px;
    }

    .secal-library__tabs {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .secal-library__tab {
        width: 100%;
        min-height: 54px;
        padding: 8px 10px;
        font-size: 14px;
    }

    .secal-library__filters {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .secal-library__actions {
        grid-column: auto;
        justify-content: flex-start;
    }

    .secal-library__grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .secal-library__tabs {
        grid-template-columns: 1fr;
    }

    .secal-library__actions {
        flex-wrap: wrap;
    }
}