.gdw-documents-wrapper,
.gdw-documents-wrapper * {
    box-sizing: border-box;
}

.gdw-documents-wrapper {
    width: 100%;
}

/* =========================================================
   PANNELLO FILTRI
   ========================================================= */

.gdw-filter-dashboard {
    display: grid;
    grid-template-columns:
        minmax(230px, 0.9fr)
        minmax(300px, 1.25fr)
        minmax(270px, 1fr);
    gap: 20px;
    margin: 0 0 42px;
}

.gdw-filter-box {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 400px;
    padding: 24px;
    background-color: #ffffff;
    border: 1px solid #e5e5e5;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.055);
}

.gdw-filter-box__header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 13px;
    min-height: 62px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #eeeeee;
}

.gdw-filter-box__number {
    display: inline-flex;
    flex: 0 0 38px;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    background-color: #c71837;
    border-radius: 50%;
}

.gdw-filter-box__title {
    margin: 0 0 3px;
    color: #252525;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.gdw-filter-box__description {
    margin: 0;
    color: #777777;
    font-size: 13px;
    line-height: 1.4;
}

/* =========================================================
   COLONNA A: LETTERE
   ========================================================= */

.gdw-letter-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

.gdw-letter-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    min-width: 0;
    padding: 0;
    color: #c71837;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    background-color: #ffffff;
    border: 1px solid #d9d9d9;
    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

a.gdw-letter-button:hover,
a.gdw-letter-button:focus,
.gdw-letter-button.is-active {
    color: #ffffff;
    text-decoration: none;
    background-color: #c71837;
    border-color: #c71837;
}

a.gdw-letter-button:hover,
a.gdw-letter-button:focus {
    transform: translateY(-1px);
}

.gdw-letter-button.is-disabled {
    color: #b8b8b8;
    background-color: #f4f4f4;
    border-color: #ececec;
    cursor: not-allowed;
}

.gdw-letter-button--all {
    grid-column: 1 / -1;
    aspect-ratio: auto;
    min-height: 42px;
}

/* =========================================================
   COLONNA B: AUTORI SCROLLABILI
   ========================================================= */

.gdw-filter-box--authors {
    min-height: 0;
}

.gdw-author-list {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    padding-right: 8px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #c71837 #eeeeee;
}

.gdw-author-list:focus {
    outline: 2px solid rgba(199, 24, 55, 0.25);
    outline-offset: 3px;
}

.gdw-author-list::-webkit-scrollbar {
    width: 8px;
}

.gdw-author-list::-webkit-scrollbar-track {
    background-color: #eeeeee;
}

.gdw-author-list::-webkit-scrollbar-thumb {
    background-color: #c71837;
    border: 2px solid #eeeeee;
}

.gdw-author-list::-webkit-scrollbar-thumb:hover {
    background-color: #a9132e;
}

.gdw-author-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    padding: 10px 12px;
    color: #333333;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
    border-bottom: 1px solid #eeeeee;
    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        padding-left 0.2s ease;
}

.gdw-author-link:first-child {
    border-top: 1px solid #eeeeee;
}

.gdw-author-link:hover,
.gdw-author-link:focus {
    padding-left: 17px;
    color: #c71837;
    text-decoration: none;
    background-color: #fafafa;
}

.gdw-author-link.is-active {
    padding-left: 17px;
    color: #ffffff;
    background-color: #c71837;
    border-color: #c71837;
}

.gdw-author-link.is-active:hover,
.gdw-author-link.is-active:focus {
    color: #ffffff;
    background-color: #aa122e;
}

.gdw-author-link__name {
    min-width: 0;
    overflow-wrap: anywhere;
}

.gdw-author-link__arrow {
    flex: 0 0 auto;
    font-size: 22px;
    font-weight: 400;
    line-height: 1;
}

.gdw-author-list__empty {
    padding: 30px 15px;
    color: #777777;
    font-size: 15px;
    text-align: center;
    background-color: #f7f7f7;
}

/* =========================================================
   COLONNA C: RICERCA AJAX
   ========================================================= */

.gdw-live-search {
    width: 100%;
}

.gdw-live-search__field {
    position: relative;
    width: 100%;
}

.gdw-live-search__input {
    width: 100%;
    height: 50px;
    padding: 0 82px 0 16px;
    color: #333333;
    font-family: inherit;
    font-size: 15px;
    background-color: #ffffff;
    border: 1px solid #d9d9d9;
    border-radius: 0;
    outline: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.gdw-live-search__input::placeholder {
    color: #929292;
}

.gdw-live-search__input:focus {
    border-color: #c71837;
    box-shadow: 0 0 0 3px rgba(199, 24, 55, 0.1);
}

.gdw-live-search__input::-webkit-search-cancel-button {
    display: none;
}

.gdw-live-search__clear {
    position: absolute;
    top: 50%;
    right: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    color: #777777;
    font-family: Arial, sans-serif;
    font-size: 24px;
    font-weight: 400;
    line-height: 1;
    background: transparent;
    border: 0;
    cursor: pointer;
    transform: translateY(-50%);
}

.gdw-live-search__clear:hover,
.gdw-live-search__clear:focus {
    color: #c71837;
}

.gdw-live-search__spinner {
    position: absolute;
    top: 50%;
    right: 48px;
    width: 17px;
    height: 17px;
    border: 2px solid #dddddd;
    border-top-color: #c71837;
    border-radius: 50%;
    transform: translateY(-50%);
    animation: gdw-spin 0.75s linear infinite;
}

.gdw-live-search__clear[hidden],
.gdw-live-search__spinner[hidden] {
    display: none !important;
}

.gdw-live-search__status {
    min-height: 21px;
    margin: 8px 0 0;
    color: #666666;
    font-size: 13px;
    line-height: 1.4;
}

.gdw-search-help {
    margin-top: 18px;
    padding: 17px;
    color: #666666;
    font-size: 13px;
    line-height: 1.55;
    background-color: #f7f7f7;
    border-left: 3px solid #c71837;
}

.gdw-search-help strong {
    color: #333333;
}

.gdw-search-help p {
    margin: 5px 0 0;
}

.gdw-search-help__example {
    font-style: italic;
}

.gdw-reset-filters {
    display: inline-block;
    margin-top: auto;
    padding-top: 16px;
    color: #c71837;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: underline;
}

.gdw-reset-filters:hover,
.gdw-reset-filters:focus {
    color: #99132a;
}

/* =========================================================
   RISULTATI E CARD
   ========================================================= */

.gdw-results-area {
    width: 100%;
    transition: opacity 0.2s ease;
}

.gdw-results-area.is-loading {
    opacity: 0.45;
    pointer-events: none;
}

.gdw-active-filter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin: 0 0 32px;
    padding: 14px 18px;
    color: #555555;
    font-size: 15px;
    text-align: center;
    background-color: #f7f7f7;
    border: 1px solid #e6e6e6;
}

.gdw-active-filter strong {
    color: #c71837;
    font-size: 17px;
}

.gdw-results-count {
    color: #777777;
    font-size: 13px;
}

.gdw-grid {
    display: grid;
    grid-template-columns: repeat(var(--gdw-columns, 3), minmax(0, 1fr));
    gap: 32px;
    width: 100%;
}

.gdw-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e8e8e8;
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.gdw-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.gdw-card__image {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f3f3f3;
}

.gdw-card__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.gdw-card:hover .gdw-card__image img {
    transform: scale(1.03);
}

.gdw-card__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #f4f4f4;
}

.gdw-card__placeholder .dashicons {
    width: auto;
    height: auto;
    font-size: 70px;
    color: #b7b7b7;
}

.gdw-card__content {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    text-align: center;
}

.gdw-card__title {
    margin: 0 0 22px;
    color: #c71837;
    font-size: 23px;
    font-weight: 700;
    line-height: 1.25;
    text-transform: uppercase;
}

.gdw-card__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    margin-top: auto;
    padding: 11px 24px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    background: #c71837;
    border: 2px solid #c71837;
    transition:
        color 0.2s ease,
        background-color 0.2s ease;
}

.gdw-card__button:hover,
.gdw-card__button:focus {
    color: #c71837;
    background: transparent;
    text-decoration: none;
}

.gdw-empty {
    padding: 30px;
    text-align: center;
    background-color: #f7f7f7;
    border: 1px solid #e5e5e5;
}

.gdw-empty p {
    margin: 8px 0 0;
}

@keyframes gdw-spin {
    from {
        transform: translateY(-50%) rotate(0deg);
    }

    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media screen and (max-width: 1100px) {
    .gdw-filter-dashboard {
        grid-template-columns:
            minmax(230px, 0.9fr)
            minmax(300px, 1.1fr);
    }

    .gdw-filter-box--search {
        grid-column: 1 / -1;
        height: auto;
        min-height: 280px;
    }

    .gdw-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px;
    }
}

@media screen and (max-width: 767px) {
    .gdw-filter-dashboard {
        grid-template-columns: minmax(0, 1fr);
        gap: 15px;
    }

    .gdw-filter-box,
    .gdw-filter-box--search {
        grid-column: auto;
        height: auto;
        min-height: auto;
        padding: 20px;
    }

    .gdw-filter-box--authors {
        height: 390px;
    }

    .gdw-letter-grid {
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }

    .gdw-author-list {
        min-height: 260px;
    }

    .gdw-active-filter {
        flex-direction: column;
        gap: 4px;
    }

    .gdw-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }
}

@media screen and (max-width: 420px) {
    .gdw-letter-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .gdw-filter-box__title {
        font-size: 18px;
    }

    .gdw-card__title {
        font-size: 20px;
    }
}