/* ==========================================================================
   CV Blog Suite — dizajn blokova na pojedinačnom postu
   Brend tokeni: #ED4296 (akcent), #000 (ink), #F5F6F8 (bg), Roboto
   ========================================================================== */

/* ------------------------------------------------------------------
 * Tipografija: obrana od element-selektora teme
 * (tema: h1,h2,h3,h4 { font-family:"Nunito Sans", serif } i p { font-size:19px !important })
 * ------------------------------------------------------------------ */
.cvbs-products-wrap h2,
.cvbs-products-wrap h3,
.cvbs-related-wrap h2,
.cvbs-related-wrap h3,
.cvbs-products-wrap p,
.cvbs-related-wrap p,
.cvbs-products-wrap span,
.cvbs-related-wrap span,
.cvbs-products-wrap a,
.cvbs-related-wrap a,
#archive.blog-page .cvbs-item,
#archive.blog-page .cvbs-item span {
    font-family: "Roboto", sans-serif;
}

.cvbs-block-title {
    font-family: "Roboto", sans-serif;
    font-size: 24px !important;
    font-size: clamp(22px, 3.2vw, 30px) !important;
    font-weight: 700;
    color: #000;
    margin: 0 0 6px;
    text-transform: none;
    position: relative;
    padding-bottom: 14px;
}

.cvbs-block-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 52px;
    height: 3px;
    background: #ED4296;
}

/* ---------- Povezani proizvodi ---------- */
.cvbs-products-wrap {
    margin: 46px 0 8px;
    padding-top: 30px;
    border-top: 1px solid #e6e4de;
}

.cvbs-products {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 22px;
}

/* Kartica dolazi iz teme (wc_get_template_part('content','product')).
   Ovdje samo uklanjamo arhivski "padding-bottom" koji nije namijenjen ovoj mreži. */
.cvbs-products .product-box {
    padding-bottom: 0 !important;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
    transition: transform .22s, box-shadow .22s;
    box-shadow: 0 1px 2px rgba(16, 16, 20, .04), 0 8px 22px -14px rgba(16, 16, 20, .22);
}

.cvbs-products a {
    text-decoration: none;
    display: block;
    height: 100%;
}

.cvbs-products a:hover .product-box {
    transform: translateY(-3px);
    box-shadow: 0 2px 4px rgba(16, 16, 20, .05), 0 18px 36px -18px rgba(237, 66, 150, .38);
}

.cvbs-more {
    text-align: center;
    margin: 26px 0 6px;
}

.cvbs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 13px 26px;
    border-radius: 999px;
    background: #ED4296;
    color: #fff !important;
    font-family: "Roboto", sans-serif;
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: .02em;
    text-decoration: none !important;
    border: 1.5px solid #ED4296;
    transition: background .2s, transform .2s;
}

.cvbs-btn:hover {
    background: #d62f83;
    border-color: #d62f83;
    color: #fff !important;
    transform: translateY(-1px);
}

/* ---------- Povezani članci (postojeći blog-blok dizajn) ---------- */
.cvbs-related-wrap {
    margin: 46px 0 10px;
    padding-top: 30px;
    border-top: 1px solid #e6e4de;
}

.cvbs-swiper {
    padding-top: 18px;
    padding-bottom: 46px;
}

.cvbs-swiper .swiper-slide {
    width: auto;
    height: auto;
}

.cvbs-swiper .swiper-slide a {
    display: flex;
    flex-direction: column;
    color: #ED4296;
    text-transform: uppercase;
    text-decoration: none;
    width: 200px;
    max-width: 62vw;
}

.cvbs-swiper .swiper-slide img {
    height: 200px;
    width: 200px;
    max-width: 100%;
    object-fit: cover;
    border-radius: 12px;
    background: #F5F6F8;
    transition: transform .25s;
}

.cvbs-swiper .swiper-slide a:hover img {
    transform: scale(1.03);
}

.cvbs-related-wrap .name {
    font-family: "Roboto", sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #000 !important;
    margin-top: 10px;
    line-height: 1.35;
}

.cvbs-related-wrap .blog-content {
    font-size: 15px;
    text-transform: none;
    color: #5f5f6b;
    margin-top: 6px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cvbs-related-wrap .gotopage {
    margin-top: 4px;
    padding-bottom: 0;
}

/* ---------- Arhiva bloga: LISTA (vijest ispod vijesti) ---------- */
/* Tema definira grid za #archive.blog-page — ovdje ga namjerno vraćamo u običnu listu.
   VAŽNO: tema ima i `#archive a { display:flex; flex-direction: column }` pa smjer
   moramo postaviti eksplicitno na row (inače slika ide iznad teksta, a ne lijevo). */
#archive.blog-page {
    display: block;
    grid-template-columns: none;
    grid-gap: 0;
}

#archive.blog-page .cvbs-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 24px;
    padding: 24px 0;
    border-bottom: 1px solid #e6e4de;
    text-decoration: none;
    min-height: 0;
    height: auto !important;
}

#archive.blog-page .cvbs-item:first-child {
    padding-top: 0;
}

#archive.blog-page .cvbs-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

#archive.blog-page .cvbs-item .img-container {
    flex: 0 0 300px;
    width: 300px;
    height: 188px;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 16, 20, .05), 0 10px 26px -18px rgba(16, 16, 20, .35);
}

#archive.blog-page .cvbs-item .img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}

#archive.blog-page .cvbs-item:hover .img-container img {
    transform: scale(1.04);
}

#archive.blog-page .cvbs-item-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Prepisujemo temin crni "name" blok (#archive .name) — u listi je naslov običan tekst. */
#archive.blog-page .cvbs-item .name {
    color: #000 !important;
    background: none;
    min-height: 0;
    padding: 0;
    display: block;
    font-family: "Roboto", sans-serif;
    font-size: 20px;
    line-height: 1.3;
    font-weight: 700;
    text-transform: none;
    margin: 0 0 10px;
}

#archive.blog-page .cvbs-item-excerpt {
    font-size: 15px;
    line-height: 1.6;
    color: #5f5f6b;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#archive.blog-page .cvbs-item-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
}

#archive.blog-page .cvbs-item-date {
    color: #9a98a4;
}

#archive.blog-page .cvbs-item-cat {
    color: #ED4296;
}

#archive.blog-page .cvbs-item:hover .name {
    color: #ED4296 !important;
}

@media (max-width: 767px) {
    #archive.blog-page .cvbs-item {
        gap: 14px;
        padding: 16px 0;
    }

    #archive.blog-page .cvbs-item .img-container {
        flex: 0 0 118px;
        width: 118px;
        height: 118px;
        aspect-ratio: 1 / 1;
        border-radius: 10px;
    }

    #archive.blog-page .cvbs-item .name {
        font-size: 16px;
        margin-bottom: 6px;
    }

    #archive.blog-page .cvbs-item-excerpt {
        font-size: 13.5px;
        -webkit-line-clamp: 2;
    }

    #archive.blog-page .cvbs-item-meta {
        margin-top: 8px;
        font-size: 10.5px;
        gap: 10px;
    }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .cvbs-products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .cvbs-products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .cvbs-products-wrap,
    .cvbs-related-wrap {
        margin-top: 34px;
        padding-top: 24px;
    }

    .cvbs-swiper .swiper-slide a {
        width: 168px;
    }

    .cvbs-swiper .swiper-slide img {
        height: 168px;
        width: 168px;
    }

    .cvbs-swiper {
        padding-bottom: 40px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .cvbs-products .product-box,
    .cvbs-btn,
    .cvbs-swiper .swiper-slide img {
        transition: none !important;
    }

    .cvbs-products a:hover .product-box,
    .cvbs-btn:hover {
        transform: none;
    }
}
