/* ==========================================================================
   Square Product Listing — Frontend Styles
   Matches UAGB post carousel responsive behavior from homepage
   ========================================================================== */

/* Carousel container
   Matches .uagb-slick-carousel padding behavior */
.spl-display-carousel {
    padding: 0 30px;
    margin-bottom: 30px;
}

/* Slide spacing — matches UAGB 20px columnGap (10px per side) */
.spl-product-slide {
    padding: 0 10px;
}

/* Slide images */
.spl-product-slide .archive-thumbnail-wrapper img {
    margin-right: 0;
}

/* Square 1/1 images, centered cover fill — matches editor preview */
.wp-block-spl-square-products .archive-thumbnail-wrapper {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    display: block;
}

.wp-block-spl-square-products .archive-thumbnail-wrapper a {
    display: block;
    width: 100%;
    height: 100%;
}

.wp-block-spl-square-products .archive-thumbnail-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Card typography — mirrors Featured Antiques (UAGB) carousel cards.
   Image gets a 10px gap below it, then title stacked above price, both left-aligned. */
.wp-block-spl-square-products .item .archive-thumbnail-wrapper {
    margin-bottom: 10px;
}

/* Override theme's .item .post-content row flex — stack title above price */
.wp-block-spl-square-products .item .post-content {
    display: block;
}

.wp-block-spl-square-products .item-information h3 {
    font-size: 15px;
    line-height: 1.4;
    font-weight: 400;
    margin: 0;
    padding: 0;
}

.wp-block-spl-square-products .price-wrapper {
    margin-top: 4px;
    padding: 0;
}

/* Theme rules to override:
   - body .price-wrapper { font-size: 1.2em }  → match title size
   - .item .price { text-align: right }        → align with title
   - .item .post-content .price { padding-left: 10px } → no inset */
.wp-block-spl-square-products .item .price {
    font-size: 15px;
    text-align: left;
    padding: 0;
    color: var(--ast-global-color-1, #9B732C);
}

/* Links — no underline, inherit color */
.wp-block-spl-square-products .item a {
    text-decoration: none;
    color: inherit;
}

.wp-block-spl-square-products .item a:hover,
.wp-block-spl-square-products .item a:focus {
    color: var(--ast-global-color-1, #9B732C);
}


/* Arrows — matches Featured Antiques (UAGB) carousel:
   cream SVG chevron, 2px border, square corners, transparent bg */
/* Arrows — bare cream SVG chevron, no border (matches Featured Antiques,
   which is borderless because Astra's `a, button { border-style: none !important }`
   strips the UAGB-configured border). */
.spl-display-carousel .slick-arrow {
    width: 50px;
    height: 50px;
    min-height: 50px;
    min-width: 50px;
    padding: 7px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spl-display-carousel .slick-arrow svg {
    width: 30px;
    height: 30px;
    fill: var(--ast-global-color-4, #FAF8EB);
}

/* Suppress slick's default glyph — we render our own SVG */
.spl-display-carousel .slick-prev::before,
.spl-display-carousel .slick-next::before {
    content: none;
}

.spl-display-carousel .slick-arrow:hover svg,
.spl-display-carousel .slick-arrow:focus svg {
    fill: var(--ast-global-color-1, #9B732C);
}

.spl-display-carousel .slick-arrow.slick-disabled {
    opacity: 0.35;
    cursor: default;
}

/* Arrow positioning — outside, matches Featured Antiques carousel */
.spl-display-carousel .slick-prev {
    left: -30px;
}

.spl-display-carousel .slick-next {
    right: -30px;
}

/* Full-width mode: match Featured Antiques' columns-block inset (57px each side)
   so slide widths and arrow positions align with the rest of the homepage. */
.wp-block-spl-square-products.alignfull.spl-display-carousel {
    padding-left: 87px;
    padding-right: 87px;
}

.wp-block-spl-square-products.alignfull.spl-display-carousel .slick-prev {
    left: 27px;
}

.wp-block-spl-square-products.alignfull.spl-display-carousel .slick-next {
    right: 27px;
}

/* Dot colors — matches theme body .slick-dots */
.spl-display-carousel .slick-dots li button::before {
    color: var(--brand-cream, #FAF8EB);
    opacity: 1;
}

.spl-display-carousel .slick-dots li.slick-active button::before {
    color: var(--ast-global-color-1, #9B732C);
}

/* Dot margin — matches UAGB dotsMarginTop */
.spl-display-carousel .slick-dots {
    bottom: -30px;
}

.spl-display-carousel.slick-dotted {
    margin-bottom: 50px;
}

/* Grid display — inherits .item-row-wrapper styles from theme.
   Only override needed: contain within block width (no full-bleed) */
.spl-display-grid .item-row-wrapper {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
    width: 100%;
}

/* Grid column classes */
.spl-columns-1 .row { grid-template-columns: repeat(1, 1fr); }
.spl-columns-2 .row { grid-template-columns: repeat(2, 1fr); }
.spl-columns-3 .row { grid-template-columns: repeat(3, 1fr); }
.spl-columns-4 .row { grid-template-columns: repeat(4, 1fr); }
.spl-columns-5 .row { grid-template-columns: repeat(5, 1fr); }
.spl-columns-6 .row { grid-template-columns: repeat(6, 1fr); }

/* ==========================================================================
   Responsive — matches theme breakpoints
   ========================================================================== */

/* Tablet: 922px — matches theme's first breakpoint */
@media only screen and (max-width: 922px) {
    .spl-display-grid .item-row-wrapper .row {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Small tablet / large phone: 767px — matches UAGB mobile breakpoint */
@media only screen and (max-width: 767px) {
    .spl-display-carousel {
        padding: 0;
    }

    .spl-display-carousel .slick-prev {
        left: 10px;
        z-index: 1;
    }

    .spl-display-carousel .slick-next {
        right: 10px;
        z-index: 1;
    }

    .spl-display-grid .item-row-wrapper .row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile: 600px — matches theme's mobile breakpoint
   Converts carousel to CSS grid (same as theme's slick override) */
@media only screen and (max-width: 600px) {
    /* Carousel: disable slick, show as grid */
    .spl-display-carousel .slick-track {
        width: auto !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 10px;
    }

    .spl-display-carousel .slick-track::before,
    .spl-display-carousel .slick-track::after {
        display: none !important;
    }

    .spl-display-carousel .slick-dots {
        display: none !important;
    }

    .spl-display-carousel.slick-dotted {
        margin-bottom: 0;
    }

    .spl-display-carousel .slick-arrow {
        display: none !important;
    }

    .spl-product-slide {
        padding: 0;
    }

    /* Grid: single column */
    .spl-display-grid .item-row-wrapper .row {
        grid-template-columns: repeat(1, 1fr);
        padding: 0 15px;
    }
}

/* ==========================================================================
   Admin-only frontend error notice
   ========================================================================== */

.spl-frontend-notice {
    border: 1px dashed #9B732C;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 3px;
    background: rgba(155, 115, 44, 0.05);
}

.spl-frontend-notice p {
    margin: 0;
    color: #9B732C;
    font-size: 14px;
}

.spl-frontend-notice a {
    color: #9B732C;
    text-decoration: underline;
}
