/* Pressmare: elenco categorie. Isolato dal resto della home. */
body.pm-page-home .pm-categories-page {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    padding: 32px 24px 56px;
}

body.pm-page-home .pm-categories-heading {
    margin-bottom: 28px;
}

body.pm-page-home .pm-categories-layout {
    display: grid;
    grid-template-columns: minmax(0, 680px) minmax(0, 300px);
    align-items: start;
    gap: 52px;
    min-width: 0;
}

body.pm-page-home .pm-categories-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: start;
    gap: 16px;
    min-width: 0;
}

body.pm-page-home .pm-category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    overflow: hidden;
    padding: 14px 12px 18px;
    border: 1px solid #DDE3EA;
    border-radius: 8px;
    box-sizing: border-box;
    background: #fff;
    color: #28215A;
    text-align: center;
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

body.pm-page-home .pm-category-card:hover {
    border-color: #3496E3;
    box-shadow: 0 4px 16px rgb(40 33 90 / 9%);
    text-decoration: none;
}

body.pm-page-home .pm-category-card-media {
    display: flex;
    width: 100%;
    min-width: 0;
    height: 142px;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    border-radius: 6px;
    background: #F4F7FA;
}

body.pm-page-home .pm-category-card-image {
    display: block;
    width: calc(100% - 24px);
    max-width: 180px;
    height: 122px;
    object-fit: contain;
}

body.pm-page-home .pm-category-card-name {
    display: block;
    min-width: 0;
    font: 700 19px/1.2 'Barlow Semi Condensed', 'Arial Narrow', sans-serif;
    overflow-wrap: anywhere;
}

body.pm-page-home .pm-categories-empty {
    grid-column: 1 / -1;
    color: #4F5B66;
}

/* Stili del nuovo aside, riutilizzato dal singolo articolo. */
body.pm-page-home .pm-categories-page .pm-article-sidebar {
    display: flex;
    flex-direction: column;
    gap: 28px;
    width: 100%;
    min-width: 0;
}

body.pm-page-home .pm-categories-page .pm-article-sidebar-ad {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

body.pm-page-home .pm-categories-page .pm-article-sidebar-ad img,
body.pm-page-home .pm-categories-page .pm-article-sidebar-ad video {
    display: block;
    width: 100%;
    max-width: 300px;
    height: auto;
}

body.pm-page-home .pm-categories-page .pm-article-sidebar-panel {
    padding: 16px 18px;
    border-radius: 8px;
    background: #F4F7FA;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

body.pm-page-home .pm-categories-page .pm-article-sidebar-heading-rule {
    padding-bottom: 8px;
    border-bottom: 3px solid #3496E3;
}

body.pm-page-home .pm-categories-page .pm-article-sidebar-title {
    margin: 0;
    font: 700 20px 'Barlow Semi Condensed', 'Arial Narrow', sans-serif;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #28215A;
}

body.pm-page-home .pm-categories-page .pm-article-latest-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 0;
    border-bottom: 1px solid #DDE3EA;
}

body.pm-page-home .pm-categories-page .pm-article-latest-link:last-child {
    border-bottom: 0;
}

body.pm-page-home .pm-categories-page .pm-time-primary {
    font-size: 13px;
    font-weight: 700;
    color: #1F6FB2;
}

body.pm-page-home .pm-categories-page .pm-article-latest-title {
    font: 600 18px/1.18 'Barlow Semi Condensed', 'Arial Narrow', sans-serif;
    color: #1F1F24;
}

@media (max-width: 1199px) {
    /* In home-responsive.css il rullo ha order: 5.
       La griglia deve seguirlo anche quando la superficie usa Flexbox. */
    body.pm-page-home .pm-site-surface > .pm-categories-page {
        order: 6;
    }
    body.pm-page-home .pm-categories-page {
        padding: 28px 24px 48px;
    }
    body.pm-page-home .pm-categories-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 36px;
    }
    body.pm-page-home .pm-categories-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
    body.pm-page-home .pm-categories-page .pm-article-sidebar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
    body.pm-page-home .pm-categories-page .pm-article-sidebar-panel {
        grid-column: 1 / -1;
        grid-row: 1;
    }
}

@media (max-width: 767px) {
    body.pm-page-home .pm-categories-page {
        padding: 24px 16px 40px;
    }
    body.pm-page-home .pm-categories-heading {
        margin-bottom: 20px;
    }
    body.pm-page-home .pm-categories-grid {
        gap: 12px;
    }
    body.pm-page-home .pm-category-card {
        padding: 10px 8px 14px;
    }
    body.pm-page-home .pm-category-card-media {
        height: 112px;
        margin-bottom: 10px;
    }
    body.pm-page-home .pm-category-card-image {
        max-width: 140px;
        height: 98px;
    }
    body.pm-page-home .pm-category-card-name {
        font-size: 17px;
    }
    /* Come sul singolo articolo, la sidebar non compare su smartphone. */
    body.pm-page-home .pm-categories-page .pm-article-sidebar {
        display: none;
    }
}

@media (max-width: 359px) {
    body.pm-page-home .pm-categories-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    body.pm-page-home .pm-category-card { transition: none; }
}

/* Banner tra gli articoli delle pagine categoria.
   La lista e' larga 680px su desktop: le creativita' 728x90 devono
   adattarsi senza cambiare i banner a tutta larghezza o quelli dell'aside. */
body.pm-page-home .pm-category-posts-page .pm-category-posts-main,
body.pm-page-home .pm-category-posts-page #new_posts_list {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

body.pm-page-home .pm-category-posts-page #new_posts_list .pm-ad-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin: 28px 0;
    padding: 12px 12px 16px;
}

body.pm-page-home .pm-category-posts-page #new_posts_list .pm-ad-panel > a,
body.pm-page-home .pm-category-posts-page #new_posts_list .pm-ad-picture {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

body.pm-page-home .pm-category-posts-page #new_posts_list .pm-ad-panel img,
body.pm-page-home .pm-category-posts-page #new_posts_list .pm-ad-panel video {
    display: block;
    max-width: 100%;
    height: auto;
}

body.pm-page-home .pm-category-posts-page #new_posts_list .pm-ad-panel .pm-ad-leaderboard-image {
    width: 100%;
    max-width: 728px;
    height: auto;
    object-fit: contain;
}

body.pm-page-home .pm-category-posts-page #new_posts_list .pm-ad-panel iframe {
    max-width: 100%;
}

/* Fix banner video: un video con larghezza intrinseca (es. 728px)
   deve contrarsi entro la colonna editoriale da 680px. */
body.pm-page-home .pm-category-posts-page #new_posts_list .pm-ad-panel {
    overflow: hidden;
}
body.pm-page-home .pm-category-posts-page #new_posts_list .pm-ad-panel > a {
    flex: 0 1 auto;
    min-width: 0;
    width: 100%;
}
body.pm-page-home .pm-category-posts-page #new_posts_list .pm-ad-panel video {
    display: block;
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}
