.decanto-header {
    z-index: 10;
}

.single-vino .entry-content,
.single-cantina .entry-content {
    line-height: 1.6;
}

.single-vino .entry-content h3,
.single-cantina .entry-content h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.3em;
}

/* ====================================
   Badge Untold — ribbon style (condiviso)
   ==================================== */

/* ---- Ribbon Untold ---- */

/* Contenitore ribbon: archivio e ricerca */
.item-thumbnail.vino-thumbnail {
    position: relative;
    overflow: visible;
}

/* Wrapper immagine: z-index 1 → copre il fold */
.vino-thumbnail-img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Fold: z-index 0 — dietro al wrapper immagine */
.untold-fold {
    position: absolute;
    top: 27px;
    right: -9px;
    height: 20px;
    width: 20px;
    background: #161f38;
    transform: rotate(45deg);
    z-index: 0;
}

/* Archive / taxonomy: fold a 36px */
.archive-item .untold-fold {
    top: 36px;
}

/* Single cantina: wine-item */
.wine-item {
    position: relative;
}

/* Label: z-index 2 — sopra tutto */
.untold-badge {
    position: absolute;
    top: 20px;
    right: -14px;
    padding: 6px 14px 8px 14px;
    background: #242e50;
    color: #fff;
    font-family: 'HK Grotesk', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    z-index: 2;
    line-height: 1;
    pointer-events: none;
    box-shadow: 4px 4px 15px rgba(36, 46, 80, 0.2);
}


/* Single vino: img-container-wrap come contenitore del ribbon */
.img-container-wrap {
    position: relative;
}

.img-container-wrap .img-container {
    position: relative;
    z-index: 1;
}

.img-container-wrap .untold-badge {
    top: 105px;
    right: -14px;
    font-size: 14px;
    padding: 6px 18px 8px 18px;
}

.img-container-wrap .untold-fold {
    top: 123px;
}

.wine-svg-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.wine-svg-placeholder svg {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    width: auto;
}

/* Blog Posts Shortcode */
.decanto-blog-posts {
    margin: 40px 0;
}

.decanto-blog-posts-grid {
    display: grid;
    gap: 30px;
    margin-top: 30px;
}

.decanto-blog-posts[data-columns="1"] .decanto-blog-posts-grid {
    grid-template-columns: 1fr;
}

.decanto-blog-posts[data-columns="2"] .decanto-blog-posts-grid {
    grid-template-columns: repeat(2, 1fr);
}

.decanto-blog-posts[data-columns="3"] .decanto-blog-posts-grid {
    grid-template-columns: repeat(3, 1fr);
}

.decanto-blog-posts[data-columns="4"] .decanto-blog-posts-grid {
    grid-template-columns: repeat(4, 1fr);
}

.decanto-blog-post-item {
    background: #ffffff;
    border: 1px solid #242e50;
    border-radius: 0px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.decanto-blog-post-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(36, 46, 80, 0.15);
}

.decanto-blog-post-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    position: relative;
}

.decanto-blog-post-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.decanto-blog-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.decanto-blog-post-item:hover .decanto-blog-post-image img {
    transform: scale(1.05);
}

.decanto-blog-post-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.decanto-blog-post-category {
    margin-bottom: 12px;
}

.decanto-blog-post-category span {
    display: inline-block;
    background: #242e50;
    color: #ffffff;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Dinish', sans-serif;
}

.decanto-blog-post-title {
    margin: 0 0 12px 0;
    font-size: clamp(18px, 1.3vw, 24px);
    line-height: 1.3;
    font-family: 'Dinish', sans-serif;
    text-transform: uppercase;
    font-weight: 500;
}

.decanto-blog-post-title a {
    color: #242e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.decanto-blog-post-title a:hover {
    color: #D13A38;
}

.decanto-blog-post-meta {
    font-size: 13px;
    color: #666;
    margin-bottom: 15px;
    font-family: 'HK Grotesk', sans-serif;
}

.decanto-blog-post-author {
    font-weight: 600;
}

.decanto-blog-post-excerpt {
    margin-bottom: 20px;
    flex: 1;
}

.decanto-blog-post-excerpt p {
    margin: 0;
    color: #333;
    line-height: 1.6;
    font-size: 14px;
    font-family: 'HK Grotesk', sans-serif;
}

.decanto-blog-post-button {
    margin-top: auto;
}

.decanto-blog-read-more {
    display: inline-block;
    background: #D13A38;
    color: #ffffff;
    padding: 12px 24px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-family: 'Dinish', sans-serif;
}

.decanto-blog-read-more:hover {
    background: #242e50;
    transform: translateX(5px);
}

.decanto-blog-posts-error {
    padding: 20px;
    background: #f8f8f8;
    border: 1px solid #ddd;
    text-align: center;
    color: #666;
}

/* Responsive */
@media (max-width: 1024px) {
    .decanto-blog-posts[data-columns="4"] .decanto-blog-posts-grid,
    .decanto-blog-posts[data-columns="3"] .decanto-blog-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .decanto-blog-posts-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }

    .decanto-blog-post-image {
        height: 200px;
    }

    .decanto-blog-post-content {
        padding: 20px;
    }
}

.decanto-related-swiper {
    position: relative;
    padding: 0;
    overflow: hidden;
    width: 100%;
    margin: 20px 0;
}

.decanto-related-swiper .swiper-wrapper {
    display: flex;
}

.decanto-related-swiper .swiper-slide {
    flex-shrink: 0;
    height: auto;
}

.decanto-related-swiper .decanto-related-item {
    width: 100%;
    height: 100%;
    position: relative;
}

.decanto-related-swiper .decanto-related-item a {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* ====================================
   Related Sections Container
   ==================================== */

.decanto-related-container {
    width: 100%;
    margin: 0;
}

.decanto-related-container .decanto-related-title-container,
.decanto-related-container .decanto-related-swiper,
.decanto-related-container .decanto-carousel-footer {
    width: 85vw;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.decanto-related-container .crp_related {
    display: block;
    width: 100%;
    float: none;
}

/* ====================================
   Home-style Vino Cards in Related Sections
   ==================================== */

.decanto-related-swiper .home-vino-card {
    background: #fff;
    border: 1px solid #242e50;
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100%;
}

.decanto-related-swiper .vino-card-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: 100%;
    position: relative;
    z-index: 1;
    background: #fff;
}

.decanto-related-swiper .vino-card-thumbnail {
    width: 100%;
    aspect-ratio: 3 / 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #FCE2C2;
    overflow: hidden;
    padding: 20px;
    box-sizing: border-box;
}

.decanto-related-swiper .vino-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.decanto-related-swiper .vino-card-thumbnail .wine-svg-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.decanto-related-swiper .vino-card-thumbnail .wine-svg-placeholder svg {
    max-width: 100%;
    max-height: 100%;
}

.decanto-related-swiper .home-vino-card .untold-fold {
    top: 36px;
}

.decanto-related-swiper .vino-card-cavatappi {
    display: flex;
    gap: 3px;
    margin-top: 8px;
}

.decanto-related-swiper .cavatappi-info-text {
    font-family: 'HK Grotesk', sans-serif;
    font-size: 10px;
    font-weight: 600;
    color: #242e50;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
    text-align: center;
}

.decanto-related-swiper .vino-card-content {
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 80px;
}

.decanto-related-swiper .vino-card-content *,
.decanto-related-swiper .vino-card-link * {
    text-decoration: none !important;
    border-bottom: none !important;
}

.decanto-related-swiper .vino-card-cantina {
    font-family: 'Dinish', sans-serif;
    font-size: 11px;
    color: #242e50;
    text-transform: uppercase;
    margin: 0 0 4px 0;
}

.decanto-related-swiper .vino-card-title {
    font-family: 'Dinish', sans-serif;
    font-size: 14px;
    color: #242e50;
    margin: 0 0 6px 0;
    font-weight: 600;
    text-transform: uppercase;
    line-height: 1.3;
}

.decanto-related-swiper .vino-card-tipologia {
    font-family: 'HK Grotesk', sans-serif;
    font-size: 11px;
    color: #666;
    margin: auto 0 0 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.decanto-related-swiper .vino-color-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Navigation footer */
.decanto-carousel-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 12px;
}

.decanto-carousel-controls {
    display: flex;
    gap: 8px;
}

/* Navigation Arrows */
.decanto-carousel-next,
.decanto-carousel-prev {
    position: static;
    transform: none;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 2px solid #ffffff;
    border-radius: 50%;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    flex-shrink: 0;
    padding: 0;
    margin: 0;
    line-height: 1;
}

.decanto-carousel-prev:after {
    content: '‹';
    font-size: 26px;
    font-weight: 300;
    color: #ffffff;
    line-height: 1;
}

.decanto-carousel-next:after {
    content: '›';
    font-size: 26px;
    font-weight: 300;
    color: #ffffff;
    line-height: 1;
}

.decanto-carousel-next:hover,
.decanto-carousel-prev:hover {
    background: rgba(255, 255, 255, 0.15);
}

.decanto-carousel-next.swiper-button-disabled,
.decanto-carousel-prev.swiper-button-disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* ====================================
   Decanto Taxonomy Filters (Unified)
   Used by: regioni, denominazioni, zone vinicole
   ==================================== */

.decanto-filter-selection {
    display: flex;
    gap: 20px 10px;
}

/* Default desktop: wrap */
.desktop-layout-wrap > .decanto-filter-selection {
    flex-wrap: wrap;
}

/* Desktop swipe mode */
.desktop-layout-swipe > .decanto-filter-selection {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding-bottom: 5px;
    margin-bottom: -5px;
}

/* Nascondi scrollbar per desktop swipe */
.desktop-layout-swipe > .decanto-filter-selection::-webkit-scrollbar {
    display: none;
}

.desktop-layout-swipe > .decanto-filter-selection {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.desktop-layout-swipe .decanto-filter-single {
    flex-shrink: 0;
    scroll-snap-align: start;
}

.decanto-filter-single {
    display: inline-block;
}

.decanto-filter-wrapper decanto-filter-single a {
    display: inline-block;
    border: 1px solid #a3a3a3;
    padding: 3px 14px 6px 14px;
    border-radius: 20px;
    font-family: 'HK Grotesk', sans-serif;
    text-decoration: none;
    color: #000000;
    transition: all 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
}

.decanto-filter-single a:hover {
    background-color: #242e50;
    border-color: #242e50;
    color: #ffffff;
}

.decanto-filter-count {
    font-size: 12px;
    opacity: 0.7;
    margin-left: 4px;
}

/* ====================================
   Filter Popup
   ==================================== */

.decanto-filter-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.decanto-filter-popup-overlay.active {
    display: flex;
    opacity: 1;
}

.decanto-filter-popup {
    background: #ffffff;
    border-radius: 12px;
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.decanto-filter-popup-overlay.active .decanto-filter-popup {
    transform: scale(1);
}

.decanto-filter-popup-header {
    padding: 25px 30px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.decanto-filter-popup-header h3 {
    margin: 0;
    font-family: 'HK Grotesk', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: #242e50;
}

.decanto-filter-popup-close {
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    border-radius: 50%;
    transition: all 0.2s ease;
    padding: 0;
}

.decanto-filter-popup-close:hover {
    background: #f0f0f0;
    color: #242e50;
}

.decanto-filter-popup-content {
    padding: 30px;
    overflow-y: auto;
    flex-grow: 1;
}

/* Custom scrollbar for popup */
.decanto-filter-popup-content::-webkit-scrollbar {
    width: 8px;
}

.decanto-filter-popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.decanto-filter-popup-content::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 4px;
}

.decanto-filter-popup-content::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

.decanto-filter-selection-full {
    gap: 12px;
}

/* Il popup deve sempre avere flex-wrap, mai swipe */
.decanto-filter-popup-content .decanto-filter-selection {
    flex-wrap: wrap !important;
    overflow-x: visible !important;
}

/* ====================================
   Responsive
   ==================================== */

@media (max-width: 768px) {
    /* Mobile wrap mode */
    .mobile-layout-wrap > .decanto-filter-selection {
        flex-wrap: wrap;
        overflow-x: visible;
    }

    /* Mobile swipe mode - scroll horizontal senza scrollbar */
    .mobile-layout-swipe > .decanto-filter-selection {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        padding-bottom: 5px;
        margin-bottom: -5px;
    }

    /* Nascondi scrollbar su mobile swipe */
    .mobile-layout-swipe > .decanto-filter-selection::-webkit-scrollbar {
        display: none;
    }

    .mobile-layout-swipe > .decanto-filter-selection {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .mobile-layout-swipe .decanto-filter-single {
        flex-shrink: 0;
        scroll-snap-align: start;
    }

    /* Nel popup mantieni sempre wrap normale */
    .decanto-filter-popup-content .decanto-filter-selection {
        flex-wrap: wrap !important;
        overflow-x: visible !important;
        gap: 12px;
    }

    .decanto-filter-popup {
        width: 95%;
        max-height: 90vh;
        border-radius: 8px;
    }

    .decanto-filter-popup-header {
        padding: 20px;
    }

    .decanto-filter-popup-header h3 {
        font-size: 20px;
    }

    .decanto-filter-popup-content {
        padding: 20px;
    }

    .decanto-filter-single a {
        padding: 2px 12px 5px 12px;
    }

    .decanto-filter-popup-close {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .decanto-filter-popup-header {
        padding: 15px;
    }

    .decanto-filter-popup-header h3 {
        font-size: 18px;
    }

    .decanto-filter-popup-content {
        padding: 15px;
    }
}