/*
Theme Name: Springfontein Kadence Child
Theme URI: https://www.springfontein.co.za
Description: Child theme of Kadence for Springfontein Wine Estate — the product slider (CSS scroll-snap, no JS library) and the Justlefthand wordmark font. Everything else is handled by Kadence's own Customizer/Color Palette and Kadence Blocks.
Author: Springfontein
Template: kadence
Version: 3.2.1.2
*/

/* ==========================================================================
   1. Justlefthand wordmark font
   Apply the .mm-wordmark class (via the block editor's Additional CSS
   Class field) to brand-name headings only — ULUMBAZA, WORTELGAT,
   SPRINGFONTEIN, etc. Not a global heading override.
   ========================================================================== */

@font-face {
    font-family: "justlefthand";
    src: url("./assets/fonts/justlefthand-webfont.woff2") format("woff2"),
        url("./assets/fonts/justlefthand-webfont.woff") format("woff"),
        url("./assets/fonts/justlefthand.ttf") format("truetype");
    font-weight: 400;
    font-display: swap;
    font-style: normal;
}

.mm-wordmark {
    font-family: "justlefthand", cursive !important;
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   2. Kadence Advanced Gallery — zoom effect + fixed height
   Previously lived in Kadence's "Additional CSS" (Customizer), which is
   stored per-theme and can get orphaned if the theme is reinstalled/
   replaced — moved here so it's part of the theme itself. Apply via the
   gallery block's Additional CSS Class(es) field:
     zoom-effekt          — soft hover zoom
     fixed-height h-250   — constant height (250px), swap h-250 for
                             h-300/h-350 as needed; add more h-XXX pairs
                             below following the same pattern if you need
                             a size not listed
   ========================================================================== */

.zoom-effekt .kb-gal-image-radius img {
    transition: transform 0.4s ease;
}

.zoom-effekt .kadence-blocks-gallery-item:hover .kb-gal-image-radius img {
    transform: scale(1.03);
}

.fixed-height .kb-gallery-image-contain.kadence-blocks-gallery-intrinsic {
    padding-top: 0 !important;
}

.fixed-height .kb-gallery-image-contain.kadence-blocks-gallery-intrinsic img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100% !important;
    object-fit: cover !important;
}

.h-250 .kb-gallery-image-contain.kadence-blocks-gallery-intrinsic { height: 250px !important; }
.h-300 .kb-gallery-image-contain.kadence-blocks-gallery-intrinsic { height: 300px !important; }
.h-350 .kb-gallery-image-contain.kadence-blocks-gallery-intrinsic { height: 350px !important; }

@media (max-width: 768px) {
    .h-250 .kb-gallery-image-contain.kadence-blocks-gallery-intrinsic { height: 350px !important; }
    .h-300 .kb-gallery-image-contain.kadence-blocks-gallery-intrinsic { height: 400px !important; }
    .h-350 .kb-gallery-image-contain.kadence-blocks-gallery-intrinsic { height: 400px !important; }
}

/* ==========================================================================
   3. Product slider — CSS scroll-snap (no JS carousel library)
   Arrow buttons are backed by a small scrollBy() handler in
   springfontein-sliders.js — no external dependency, nothing to
   version-pin. Native touch swipe works automatically on mobile.
   ========================================================================== */

.product-scroll-wrap {
    position: relative;
    margin: 20px 0;
}

.product-scroll-container {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 14px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 10px 4px 30px;
    cursor: grab;
}

.product-scroll-container.is-dragging {
    cursor: grabbing;
    scroll-snap-type: none; /* let it settle freely while actively dragging */
    user-select: none;
}

.product-scroll-container img {
    -webkit-user-drag: none;
    user-drag: none;
}

.product-scroll-container::-webkit-scrollbar {
    display: none;
}

.product-scroll-container,
.product-scroll-container .product-slider-card {
    box-sizing: border-box;
}

.product-scroll-container .product-slider-card {
    scroll-snap-align: start;
    flex: 0 0 calc((100% - 28px) / 3); /* fallback if no cols-N class present */
    margin: 0;
}

.product-scroll-container.cols-2 .product-slider-card { flex: 0 0 calc((100% - 14px) / 2); }
.product-scroll-container.cols-3 .product-slider-card { flex: 0 0 calc((100% - 28px) / 3); }
.product-scroll-container.cols-4 .product-slider-card { flex: 0 0 calc((100% - 42px) / 4); }
.product-scroll-container.cols-5 .product-slider-card { flex: 0 0 calc((100% - 56px) / 5); }
.product-scroll-container.cols-6 .product-slider-card { flex: 0 0 calc((100% - 70px) / 6); }
.product-scroll-container.cols-7 .product-slider-card { flex: 0 0 calc((100% - 84px) / 7); }
.product-scroll-container.cols-8 .product-slider-card { flex: 0 0 calc((100% - 98px) / 8); }

.scroll-arrow {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: none;
    position: absolute;
    top: 50%;
    margin-top: -15px;
    cursor: pointer;
    transition: opacity 200ms ease, color 200ms ease;
    z-index: 2;
    color: var(--global-palette3, #333);
}

.scroll-arrow:hover {
    color: var(--global-palette1, #6E2A3A);
}

.scroll-arrow svg {
    width: 20px;
    height: 20px;
}

.scroll-arrow.prev-arrow {
    left: -50px;
}

.scroll-arrow.next-arrow {
    right: -50px;
}

.scroll-arrow.next-arrow svg {
    transform: rotate(180deg);
}

/* Product image + hover swap to the product's second gallery image,
   matching Kadence's native WooCommerce product-grid hover behavior. */
.product-slider-image {
    position: relative;
    overflow: hidden;
}
 
.product-slider-image-main {
    display: block;
    width: 100%;
}
 
.product-slider-image-second {
    position: absolute !important;
    top: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    opacity: 0 !important;
    transition: opacity 300ms ease !important;
}
 
.product-slider-card:hover .product-slider-image-second {
    opacity: 1 !important;
}
 


.product-slider-card {
    position: relative;
    background: var(--global-palette9, #fff);
    text-align: center;
    padding: 20px;
    transition: box-shadow 200ms ease;
}

.product-slider-card:hover {
    box-shadow: 0 12px 24px rgba(23, 26, 31, 0.08);
}

.product-slider-title {
    z-index: 1;
    position: relative;
    font-weight: 600;
    font-size: 1.15rem;
    margin-bottom: 0;
}

.product-btn a {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity ease-in-out 200ms;
}

.product-slider-card:hover .product-btn a {
    opacity: 1;
}

.product-slider-card.view-all {
    box-shadow: none !important;
    border: none;
    background: none;
    display: flex;
    align-items: center;
    justify-content: center;
}


@media only screen and (max-width: 1080px) {
    .product-scroll-container.cols-6 .product-slider-card,
    .product-scroll-container.cols-7 .product-slider-card,
    .product-scroll-container.cols-8 .product-slider-card {
        flex: 0 0 calc((100% - 42px) / 4); /* cap only very high counts at 4 per view on tablets */
    }

    .scroll-arrow.prev-arrow { left: -30px; }
    .scroll-arrow.next-arrow { right: -30px; }
}

@media only screen and (max-width: 768px) {
    .product-scroll-container .product-slider-card {
        flex: 0 0 85% !important; /* near-full-width single card, peek of next one, regardless of cols-N */
    }

    .scroll-arrow {
        display: none; /* rely on native touch swipe on mobile */
    }
}