/**
 * Blog index + slider (caricato via blog_css.xml — Magefan_Blog)
 */
.blog-page.blog-page-list,
.blog-index-v2 {
    --blog-accent: #c30016;
    --blog-text: #222529;
    --blog-muted: #777;
    --blog-card-gap: 24px;
}

.blog-page.blog-page-list .page-title-wrapper,
.blog-index-v2 .page-title-wrapper {
    text-align: center;
    margin: 0 0 32px;
    padding-bottom: 2rem;
}

.blog-page.blog-page-list .page-title-wrapper .page-title,
.blog-index-v2 .page-title-wrapper .page-title {
    margin: 0;
    font-size: 44px !important;
    line-height: 1.15 !important;
    font-weight: 700;
    color: #c30016 !important;
}

/* Porto .columns è flex: senza min-width:0 il main si allarga al contenuto (es. 1320px) */
.blog-page.blog-page-list .columns,
.blog-index-v2 .columns,
.blog-page.blog-page-search .columns {
    min-width: 0;
    max-width: 100%;
    width: 100%;
}

.blog-page.blog-page-list .column.main,
.blog-index-v2 .column.main,
.blog-page.blog-page-search .column.main {
    min-width: 0;
    width: 100%;
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
}

/* ——— Slider hero (non dipende da blog-index-v2) ——— */
.blog-featured-section {
    margin-bottom: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* Slider center mode: centrale ~metà larghezza, peek ai lati (mockup) */
.blog-featured-section .blog-featured-carousel.owl-carousel {
    --blog-slider-peek-opacity: 0.5;
    max-width: 1320px;
    margin-inline: auto;
}

.blog-featured-section .blog-featured-carousel .owl-stage-outer {
    overflow: hidden;
}

.blog-page.blog-page-list .page-main,
.blog-index-v2 .page-main,
.blog-page.blog-page-list .column.main,
.blog-index-v2 .column.main {
    overflow-x: clip;
}

.blog-featured-section .blog-featured-carousel .owl-item {
    transition: opacity 0.35s ease;
}

.blog-featured-section .blog-featured-carousel .owl-item:not(.center) {
    opacity: var(--blog-slider-peek-opacity);
}

.blog-featured-section .blog-featured-carousel .owl-item.center {
    opacity: 1;
}

.blog-featured-section .blog-featured-slide__frame {
    border-radius: 6px;
}

/* ——— Zona sotto slider: divisore + ricerca + griglia ——— */
.blog-index-below {
    margin-top: 0;
    padding-top: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
    box-sizing: border-box;
}

.blog-index__divider {
    display: block;
    height: 0;
    margin: 32px 0 40px;
    padding: 0;
    border: 0;
    border-top: 1px solid #e0e0e0;
}

.blog-index-below .blog-search-main {
    max-width: 640px;
    margin: 0 auto 48px;
}

.blog-index-below .blog-search-main__form {
    position: relative;
    display: flex;
    align-items: center;
}

.blog-index-below .blog-search-main__icon {
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--blog-muted, #777);
    pointer-events: none;
    display: flex;
    line-height: 0;
}

.blog-index-below .blog-search-main__input {
    width: 100%;
    height: 52px;
    padding: 0 24px 0 54px;
    border: 0;
    border-radius: 999px;
    background: #f0f0f0;
    font-size: 16px;
    color: var(--blog-text, #222529);
    box-shadow: none;
}

.blog-index-below .blog-search-main__input:focus {
    outline: 2px solid rgba(195, 0, 22, 0.3);
    outline-offset: 0;
}

.blog-index-below .blog-search-main__input::placeholder {
    color: var(--blog-muted, #777);
}

.blog-featured-section .blog-featured-slide {
    margin: 0;
    padding: 0;
    border: 0;
}

.blog-featured-section .blog-featured-slide__link {
    display: block;
    text-decoration: none;
    color: #fff;
}

.blog-featured-section .blog-featured-slide__frame {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 4px;
    background: #e5e5e5;
}

.blog-featured-section .blog-featured-slide__img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    vertical-align: top;
    transition: transform 0.45s ease;
}

.blog-featured-section .blog-featured-slide__img--placeholder {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 180px;
    background: #e5e5e5;
}

.blog-featured-section .blog-featured-slide__link:hover .blog-featured-slide__img {
    transform: scale(1.03);
}

.blog-featured-section .blog-featured-slide__shade {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(180deg,
            rgba(0, 0, 0, 0) 35%,
            rgba(0, 0, 0, 0.35) 65%,
            rgba(0, 0, 0, 0.78) 100%);
}

.blog-featured-section .blog-featured-slide__caption {
    position: absolute;
    z-index: 2;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 20px 22px 22px;
    text-align: left;
}

.blog-featured-section .blog-featured-slide__date {
    display: block;
    margin: 0 0 8px;
    font-size: 13px;
    line-height: 1.3;
    font-weight: 400;
    color: #fff !important;
    opacity: 0.95;
}

.blog-featured-section h2.blog-featured-slide__title {
    display: block;
    margin: 0 !important;
    padding: 0 !important;
    border: 0;
    font-size: clamp(16px, 1.35vw, 22px);
    line-height: 1.25 !important;
    font-weight: 700 !important;
    color: #fff !important;
    text-transform: none;
    letter-spacing: normal;
}

.blog-featured-section .blog-featured-carousel.owl-carousel .owl-dots {
    display: none !important;
}

.blog-featured-section .blog-featured-controls {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    margin-top: 28px;
    min-height: 44px;
}

.blog-featured-section .blog-search-controls {
    grid-column: 1;
    justify-self: start;
    position: relative;
}

.blog-featured-section .blog-search-controls__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--blog-text, #222529);
    cursor: pointer;
}

.blog-featured-section .blog-search-controls__toggle:hover,
.blog-featured-section .blog-search-controls.is-open .blog-search-controls__toggle {
    color: var(--blog-accent, #c30016);
}

.blog-featured-section .blog-search-controls__panel {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    z-index: 20;
    min-width: min(320px, calc(100vw - 48px));
}

.blog-featured-section .blog-search-controls__panel[hidden] {
    display: none !important;
}

.blog-featured-section .blog-search-controls__form {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.blog-featured-section .blog-search-controls__input {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
}

.blog-featured-section .blog-search-controls__submit {
    height: 40px;
    padding: 0 16px;
    border: 0;
    border-radius: 4px;
    background: var(--blog-accent, #c30016);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.blog-featured-section .blog-featured-controls__dots {
    grid-column: 2;
    justify-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.blog-featured-section .blog-featured-controls__dots .owl-dot {
    display: inline-flex;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.blog-featured-section .blog-featured-controls__dots .owl-dot span {
    display: block;
    width: 48px;
    height: 4px;
    margin: 0;
    border-radius: 2px;
    background: #c4c4c4;
    transition: background 0.2s ease;
}

.blog-featured-section .blog-featured-controls__dots .owl-dot.active span,
.blog-featured-section .blog-featured-controls__dots .owl-dot:hover span {
    background: var(--blog-accent, #c30016);
}

/* ——— Griglia articoli (teaser: foto, data, titolo) ——— */
.blog-page.blog-page-list .blog-index-below .blog-post-grid-wrapper,
.blog-index-v2 .blog-index-below .blog-post-grid-wrapper {
    margin-bottom: 48px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.blog-page.blog-page-list .blog-index-below .blog-post-grid,
.blog-index-v2 .blog-index-below .blog-post-grid {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--blog-card-gap, 24px);
    float: none !important;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.blog-page.blog-page-list .blog-index-below .blog-post-grid>li,
.blog-index-v2 .blog-index-below .blog-post-grid>li {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.blog-page.blog-page-list .blog-index-below .blog-post-grid::before,
.blog-page.blog-page-list .blog-index-below .blog-post-grid::after,
.blog-index-v2 .blog-index-below .blog-post-grid::before,
.blog-index-v2 .blog-index-below .blog-post-grid::after {
    display: none !important;
    content: none !important;
}

.blog-page.blog-page-list .blog-index-below .blog-post-card,
.blog-index-v2 .blog-index-below .blog-post-card {
    margin: 0 !important;
    margin-left: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    clear: none !important;
    float: none !important;
    width: auto !important;
    list-style: none !important;
}

/* Reset stili legacy Magefan / blog-m sui teaser */
.blog-page.blog-page-list .blog-index-below .blog-post-card .post-header,
.blog-page.blog-page-list .blog-index-below .blog-post-card .post-content,
.blog-page.blog-page-list .blog-index-below .blog-post-card .post-footer,
.blog-page.blog-page-list .blog-index-below .blog-post-card .post-date,
.blog-page.blog-page-list .blog-index-below .blog-post-card .post-banner,
.blog-page.blog-page-list .blog-index-below .blog-post-card .post-read-more,
.blog-index-v2 .blog-index-below .blog-post-card .post-header,
.blog-index-v2 .blog-index-below .blog-post-card .post-content,
.blog-index-v2 .blog-index-below .blog-post-card .post-footer,
.blog-index-v2 .blog-index-below .blog-post-card .post-date,
.blog-index-v2 .blog-index-below .blog-post-card .post-banner,
.blog-index-v2 .blog-index-below .blog-post-card .post-read-more {
    display: none !important;
}

.blog-page.blog-page-list .blog-post-card__link,
.blog-index-v2 .blog-post-card__link {
    display: block;
    min-width: 0;
    max-width: 100%;
    text-decoration: none;
    color: var(--blog-text, #222529);
}

.blog-page.blog-page-list .blog-post-card__link:hover .blog-post-card__title,
.blog-index-v2 .blog-post-card__link:hover .blog-post-card__title {
    color: var(--blog-accent, #c30016);
}

.blog-page.blog-page-list .blog-post-card__media,
.blog-index-v2 .blog-post-card__media {
    margin-bottom: 12px;
    border-radius: 4px;
    overflow: hidden;
    min-width: 0;
    max-width: 100%;
}

.blog-page.blog-page-list .blog-post-card__img,
.blog-index-v2 .blog-post-card__img {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

/* Fallback se Magefan renderizza ancora .post-holder nel listato */
.blog-page.blog-page-list .blog-index-below .post-holder,
.blog-index-v2 .blog-index-below .post-holder {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    float: none !important;
    clear: both !important;
    box-sizing: border-box;
}

.blog-page.blog-page-list .blog-index-below .post-holder .post-date,
.blog-index-v2 .blog-index-below .post-holder .post-date {
    margin-left: 0 !important;
    float: none !important;
}

.blog-page.blog-page-list .blog-index-below .post-ftimg-hld,
.blog-index-v2 .blog-index-below .post-ftimg-hld {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 12px !important;
}

.blog-page.blog-page-list .blog-index-below .post-ftimg-hld img,
.blog-index-v2 .blog-index-below .post-ftimg-hld img,
.blog-page.blog-page-list .blog-index-below .post-description img,
.blog-index-v2 .blog-index-below .post-description img {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
}

.blog-page.blog-page-list .blog-post-card__img--placeholder,
.blog-index-v2 .blog-post-card__img--placeholder {
    display: block;
    aspect-ratio: 1 / 1;
    background: #e8e8e8;
}

.blog-page.blog-page-list .blog-post-card__date,
.blog-index-v2 .blog-post-card__date {
    display: block;
    font-size: 13px;
    line-height: 1.3;
    color: var(--blog-muted, #777);
    margin-bottom: 8px;
}

.blog-page.blog-page-list .blog-post-card__title,
.blog-index-v2 .blog-post-card__title {
    margin: 0;
    font-size: 16px;
    line-height: 1.35;
    font-weight: 700;
    color: var(--blog-text, #222529);
}

/* Nasconde layout list-modern / list classico se finisce nel DOM */
.blog-page.blog-page-list .blog-index-below .post-list.modern,
.blog-page.blog-page-list .blog-index-below .post-list-wrapper .post-list:not(.blog-post-grid) {
    display: none !important;
}

/* Paginazione blog — centrata (override Porto .toolbar .pages { position:absolute }) */
.blog-page.blog-page-list .toolbar-blog-posts,
.blog-index-v2 .toolbar-blog-posts,
.blog-page.blog-page-list .blog-index-below .toolbar-blog-posts,
.blog-index-v2 .blog-index-below .toolbar-blog-posts {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0 auto 48px;
    padding: 0;
    text-align: center;
    float: none;
}

.blog-page.blog-page-list .toolbar-blog-posts .pages,
.blog-index-v2 .toolbar-blog-posts .pages,
.blog-page.blog-page-list .blog-index-below .toolbar-blog-posts .pages,
.blog-index-v2 .blog-index-below .toolbar-blog-posts .pages {
    position: static !important;
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto;
    padding: 0;
    text-align: center;
    z-index: auto;
    left: auto;
    right: auto;
    box-sizing: border-box;
}

.blog-page.blog-page-list .toolbar-blog-posts .pages .items,
.blog-index-v2 .toolbar-blog-posts .pages .items,
.blog-page.blog-page-list .blog-index-below .toolbar-blog-posts .pages .items,
.blog-index-v2 .blog-index-below .toolbar-blog-posts .pages .items {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.blog-page.blog-page-list .toolbar-blog-posts .pages .item,
.blog-index-v2 .toolbar-blog-posts .pages .item,
.blog-page.blog-page-list .blog-index-below .toolbar-blog-posts .pages .item,
.blog-index-v2 .blog-index-below .toolbar-blog-posts .pages .item {
    margin: 0 !important;
    float: none;
}

.blog-page.blog-page-list .toolbar-blog-posts .pages a,
.blog-page.blog-page-list .toolbar-blog-posts .pages strong,
.blog-page.blog-page-list .toolbar-blog-posts .pages .action,
.blog-index-v2 .toolbar-blog-posts .pages a,
.blog-index-v2 .toolbar-blog-posts .pages strong,
.blog-index-v2 .toolbar-blog-posts .pages .action,
.blog-page.blog-page-list .blog-index-below .toolbar-blog-posts .pages a,
.blog-page.blog-page-list .blog-index-below .toolbar-blog-posts .pages strong,
.blog-page.blog-page-list .blog-index-below .toolbar-blog-posts .pages .action,
.blog-index-v2 .blog-index-below .toolbar-blog-posts .pages a,
.blog-index-v2 .blog-index-below .toolbar-blog-posts .pages strong,
.blog-index-v2 .blog-index-below .toolbar-blog-posts .pages .action {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 40px;
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;
    border: 1px solid #d4d4d4;
    border-radius: 2px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    color: var(--blog-text, #222529) !important;
    background: #fff !important;
}

.blog-page.blog-page-list .toolbar-blog-posts .pages .item.current strong,
.blog-page.blog-page-list .toolbar-blog-posts .pages .item.current a,
.blog-page.blog-page-list .toolbar-blog-posts .pages strong.page,
.blog-index-v2 .toolbar-blog-posts .pages .item.current strong,
.blog-index-v2 .toolbar-blog-posts .pages .item.current a,
.blog-index-v2 .toolbar-blog-posts .pages strong.page,
.blog-page.blog-page-list .blog-index-below .toolbar-blog-posts .pages .item.current strong,
.blog-index-v2 .blog-index-below .toolbar-blog-posts .pages .item.current strong {
    background: #555 !important;
    border-color: #555 !important;
    color: #fff !important;
}

.blog-page.blog-page-list .toolbar-blog-posts .pages a:hover,
.blog-index-v2 .toolbar-blog-posts .pages a:hover,
.blog-page.blog-page-list .blog-index-below .toolbar-blog-posts .pages a:hover,
.blog-index-v2 .blog-index-below .toolbar-blog-posts .pages a:hover {
    border-color: var(--blog-accent, #c30016);
    color: var(--blog-accent, #c30016) !important;
}

@media (max-width: 1199px) {

    .blog-page.blog-page-list .blog-index-below .blog-post-grid,
    .blog-index-v2 .blog-index-below .blog-post-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 991px) {

    .blog-page.blog-page-list .blog-index-below .blog-post-grid,
    .blog-index-v2 .blog-index-below .blog-post-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .blog-featured-section h2.blog-featured-slide__title {
        font-size: 17px !important;
    }

    .blog-featured-section .blog-featured-slide__caption {
        padding: 16px;
    }
}

@media (max-width: 575px) {

    .blog-page.blog-page-list .column.main,
    .blog-index-v2 .column.main,
    .blog-page.blog-page-search .column.main {
        max-width: 100%;
        padding-left: 16px;
        padding-right: 16px;
    }

    .blog-page.blog-page-list .blog-index-below .blog-post-grid,
    .blog-index-v2 .blog-index-below .blog-post-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }

    .blog-page.blog-page-list .blog-index-below .toolbar-blog-posts,
    .blog-index-v2 .blog-index-below .toolbar-blog-posts {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .blog-featured-section .blog-featured-controls__dots .owl-dot span {
        width: 32px;
    }

    .blog-index__divider {
        margin: 24px 0 32px;
    }

    .blog-page.blog-page-list .page-title-wrapper .page-title,
    .blog-index-v2 .page-title-wrapper .page-title {
        font-size: 32px !important;
    }

    .blog-index-below .blog-search-main {
        margin-bottom: 32px;
    }
}

/* Single post — teaser come archivio blog */
.blog-page.blog-post-view .blog-article-related {
    --blog-accent: #c30016;
    --blog-text: #222529;
    --blog-muted: #777;
}

.blog-page.blog-post-view .blog-article-related__title {
    color: var(--blog-text) !important;
}

.blog-page.blog-post-view .blog-article-related .blog-post-card {
    margin: 0 !important;
    margin-left: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    float: none !important;
    width: 100% !important;
}

.blog-page.blog-post-view .blog-article-related a.blog-post-card__link,
.blog-page.blog-post-view .blog-article-related .blog-post-card__link {
    display: block;
    text-decoration: none !important;
    color: var(--blog-text) !important;
}

.blog-page.blog-post-view .blog-article-related a.blog-post-card__link:hover,
.blog-page.blog-post-view .blog-article-related a.blog-post-card__link:focus,
.blog-page.blog-post-view .blog-article-related a.blog-post-card__link:visited {
    color: var(--blog-text) !important;
    text-decoration: none !important;
}

.blog-page.blog-post-view .blog-article-related .blog-post-card__link:hover .blog-post-card__title,
.blog-page.blog-post-view .blog-article-related .blog-post-card__link:focus .blog-post-card__title {
    color: var(--blog-accent) !important;
}

.blog-page.blog-post-view .blog-article-related .blog-post-card__media {
    margin-bottom: 12px;
}

.blog-page.blog-post-view .blog-article-related .blog-post-card__img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.blog-page.blog-post-view .blog-article-related .blog-post-card__date {
    display: block;
    font-size: 13px;
    line-height: 1.3;
    color: var(--blog-muted) !important;
    margin-bottom: 8px;
}

.blog-page.blog-post-view .blog-article-related .blog-post-card__title {
    display: block;
    margin: 0;
    font-size: 16px;
    line-height: 1.35;
    font-weight: 700;
    color: var(--blog-text) !important;
}