/* =========================================================
   RISORSE – ARCHIVIO
   ========================================================= */

.resources-page {
    padding: 25px 0 80px;
    background-color: #ffffff;
}

.resources-page__inner {
    width: min(1186px, calc(100% - 48px));
    margin: 0 auto;
}

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

.resources-filters {
    margin-bottom: 48px;
}

.resources-filters__title {
    margin: 0 0 26px;
    color: #002b49;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
}

.resources-filters__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.resources-filter {
    min-height: 42px;
    padding: 9px 18px;
    border: 1px solid #013347;
    border-radius: 2px;
    background-color: #ffffff;
    color: #013347;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.resources-filter:hover,
.resources-filter:focus-visible,
.resources-filter.is-active {
    background-color: #013347;
    color: #ffffff;
}

.resources-filter:focus-visible {
    outline: 2px solid #003b5c;
    outline-offset: 3px;
}

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

.resources-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px 24px;
}

/* =========================================================
   CARD
   ========================================================= */

.resource-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border-radius: 6px;
    background-color: #ffffff;
 box-shadow: 0 3px 12px 0 rgba(0, 0, 0, 0.08);

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        opacity 0.2s ease;
}

.resource-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 26px rgb(0 43 73 / 15%);
}

.resource-card[hidden] {
    display: none;
}

/* Immagine */

.resource-card__image {
    position: relative;
    width: 100%;
    aspect-ratio: 380 / 169;
    overflow: hidden;
    background-color: #e6eef5;
}

.resource-card__thumbnail {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.resource-card:hover .resource-card__thumbnail {
    transform: scale(1.025);
}

/* Corpo */

.resource-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 14px 16px 20px;
}

/* Badge */

.resource-card__badge {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    min-height: 21px;
    margin-bottom: 10px;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
}
.resource-card__badge--blu {
    background-color: #e5eff6;
    color: #2980BA;
}

.resource-card__badge--verde {
    background-color: #e6f2ec;
    color: #396;
}

.resource-card__badge--arancione {
    background-color: #feeeea;
    color: #FE7451;
}

.resource-card__badge--viola {
    background-color: #f1eafa;
    color: #7451a6;
}

.resource-card__badge--grigio {
    background-color: #eeeeee;
    color: #626262;
}

/* Testi */

.resource-card__title {
    margin: 0 0 12px;
    color: #0A2745;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.32;
}

.resource-card__excerpt {
    margin-bottom: 22px;
    color: #666;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.55;
}

.resource-card__excerpt p {
    margin: 0;
}

/* Footer card */

.resource-card__footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-top: auto;
    padding-top: 20px;
}

.resource-card__date {
    color: #808080;
    font-size: 12px;
    line-height: 1.3;
}

/* CTA */

.resource-card__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 76px;
    min-height: 36px;
    padding: 8px 16px;
    border: 1.5px solid #0A2745;
    border-radius: 0;
    background-color: #ffffff;
    color: #002b49;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.resource-card__cta:hover,
.resource-card__cta:focus-visible {
    background-color: #002b49;
    color: #ffffff;
}

.resource-card__cta:focus-visible {
    outline: 2px solid #002b49;
    outline-offset: 3px;
}

/* Stato vuoto */

.resources-empty {
    grid-column: 1 / -1;
    margin: 0;
    color: #002b49;
    font-size: 18px;
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1024px) {

    .resources-page__inner {
        width: min(100% - 40px, 900px);
    }

    .resources-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 680px) {

    .resources-page {
        padding: 38px 0 64px;
    }

    .resources-page__inner {
        width: calc(100% - 32px);
    }

    .resources-filters {
        margin-bottom: 32px;
    }

    .resources-filters__title {
        margin-bottom: 20px;
        font-size: 23px;
    }

    .resources-filters__buttons {
        gap: 9px;
    }

    .resources-filter {
        min-height: 38px;
        padding: 8px 13px;
        font-size: 12px;
    }

    .resources-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .resource-card__image {
        aspect-ratio: 343 / 170;
    }

    .resource-card__body {
        padding: 14px 16px 16px;
    }

    .resource-card__title {
        font-size: 16px;
    }

    .resource-card__excerpt {
        margin-bottom: 18px;
        font-size: 13px;
    }

    .resource-card__footer {
        gap: 14px;
        padding-top: 14px;
    }
}

/* Telefoni molto stretti */

@media (max-width: 390px) {

    .resource-card__footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .resource-card__cta {
        align-self: flex-end;
    }
}
/* =========================================================
   POPUP PAPER
   ========================================================= */

body.resource-modal-open {
    overflow: hidden;
}

.resource-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-y: auto;
}

.resource-modal.is-open {
    display: flex;
}

.resource-modal__overlay {
    position: absolute;
    inset: 0;
    background-color: rgb(223 235 242 / 86%);
    backdrop-filter: blur(2px);
}

.resource-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 440px);
    max-height: calc(100dvh - 48px);
    margin: auto 0;
    padding: 42px 28px 15px;
    overflow-y: auto;
    border-radius: 8px;
    background-color: #ffffff;
    box-shadow: 0 16px 40px rgb(0 43 73 / 20%);
}

.resource-modal__close {
    position: absolute;
    top: 9px;
    right: 18px;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #707070;
    font-size: 35px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
}

.resource-modal__step {
    display: none;
}

.resource-modal__step.is-active {
    display: block;
}

.resource-modal__title{
    margin: 0;
    color: #0A2745;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.resource-modal__success-title {
    margin: 0;
    color: #0A2745;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

.resource-modal__intro {
    margin: 5px 0 24px;
    color: #737373;
    font-size: 14px;
    line-height: 1.45;
}

/* Contact Form 7 */

.resource-modal__form .wpcf7-form {
    margin: 0;
}

.resource-modal__form .wpcf7-form p {
    margin: 0 0 5px;
}

.resource-modal__form label {
    display: block;
    color: #0A2745;
    font-size: 13px;
    line-height: 1.4;
}

.resource-modal__form input[type="text"],
.resource-modal__form input[type="email"] {
    display: block;
    width: 100%;
    height: 42px;
    margin-top: 4px;
    padding: 8px 10px;
    border: 1px solid #b8b8b8;
    border-radius: 3px;
    background-color: #ffffff;
    color: #002b49;
    font: inherit;
    font-size: 16px;
}
.contact-form input,
.contact-form textarea,
.contact-form select {
    font-size: 16px;
}

.resource-modal__form input[type="text"]:focus,
.resource-modal__form input[type="email"]:focus {
    border-color: #003b5c;
    outline: none;
    box-shadow: 0 0 0 1px #003b5c;
}

.resource-modal__form .wpcf7-acceptance label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    line-height: 1.45;
}

.resource-modal__form .wpcf7-acceptance input {
    flex: 0 0 auto;
    margin: 2px 0 0;
}

.resource-modal__form input[type="submit"] {
    width: 100%;
    min-height: 48px;
    margin-top: 20px;
    border: 1px solid #013347;
    border-radius: 3px;
    background-color: #013347;
    color: #ffffff;
    font: inherit;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
    border-radius: 6px;
    line-height: 18px
}

.resource-modal__form input[type="submit"]:hover {
    background-color: #ffffff;
    color: #013347;
}

.resource-modal__form .wpcf7-spinner {
    display: none;
}

.resource-modal__form .wpcf7-response-output {
    margin: 14px 0 0;
    padding: 8px 10px;
    font-size: 12px;
}

.resource-modal__form .wpcf7-not-valid-tip {
    margin-top: 4px;
    font-size: 11px;
}

/* Schermata grazie */

.resource-modal__step--success {
    padding: 12px 0 8px;
    text-align: center;
}

.resource-modal__success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin: 0 auto 24px;
    border-radius: 50%;
    background-color: #FF6D52;
}
.resource-modal__success-icon svg {
    width: 28px;
    height: auto;
}

.resource-modal__success-text {
    margin: 14px 0 30px;
    color: #707070;
    font-size: 14px;
    line-height: 1.5;
}

.resource-modal__download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 250px;
    min-height: 48px;
    padding: 12px 24px;
    border: 1px solid #013347;
    border-radius: 6px;
    background-color: #013347;
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-decoration: none;
    margin-bottom: 25px;
}

.resource-modal__download:hover {
    background-color: #ffffff;
    color: #003b5c;
}

@media (max-width: 680px) {

    .resource-modal {
        padding: 20px;
    }

    .resource-modal__dialog {
        max-height: calc(100dvh - 40px);
        padding: 40px 22px 26px;
    }

    .resource-modal__title,
    .resource-modal__success-title {
        font-size: 24px;
    }

    .resource-modal__download {
        width: 100%;
        min-width: 0;
    }
}
/* =========================================================
   MOSTRA ALTRI
   ========================================================= */

.resources-load-more {
    display: flex;
    justify-content: center;
    margin-top: 48px;
}

.resources-load-more[hidden] {
    display: none;
}

.resources-load-more__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
    min-height: 48px;
    padding: 12px 28px;
    border: 1px solid #002b49;
    border-radius: 0;
    background-color: transparent;
    color: #002b49;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition:
        background-color 0.25s ease,
        color 0.25s ease;
}

.resources-load-more__button:hover,
.resources-load-more__button:focus-visible {
    background-color: #002b49;
    color: #ffffff;
}

@media (max-width: 680px) {
    .resources-load-more {
        margin-top: 36px;
    }

    .resources-load-more__button {
        width: 100%;
    }
}
@media (max-height: 800px) {

    .resource-modal {
        align-items: flex-start;
        padding: 16px;
    }

    .resource-modal__dialog {
        max-height: calc(100dvh - 32px);
        margin: 0;
        padding: 32px 38px 28px;
    }

    .resource-modal__intro {
        margin-bottom: 16px;
    }

    .resource-modal__form .wpcf7-form p {
        margin-bottom: 3px;
    }

    .resource-modal__form input[type="text"],
    .resource-modal__form input[type="email"] {
        height: 38px;
    }

    .resource-modal__form input[type="submit"] {
        min-height: 44px;
        margin-top: 12px;
    }
}