/*
 Theme Name:   MLArt Child
 Theme URI:    DevAi.co.za
 Description:  GeneratePress child theme for the MLArt gallery
 Author:       John
 Author URI:   DevAi.co.za
 Template:     generatepress
 Version:      1.0.0
 Text Domain:  mlart-child
*/

.mlart-container {
    width: min(1400px, 92%);
    margin: 0 auto;
}

.mlart-products-archive,
.mlart-single-product {
    padding: 60px 0;
}

/* ---------- Archive ---------- */

.mlart-archive-header {
    margin-bottom: 30px;
}

.mlart-archive-title {
    margin: 0;
    font-size: clamp(2rem, 3vw, 3rem);
}

.mlart-product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 28px;
}

.mlart-product-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.05);
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.mlart-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.mlart-product-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.mlart-product-image-wrap {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f5f5f5;
}

.mlart-product-image,
.mlart-product-image-placeholder {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.mlart-product-content {
    padding: 18px 18px 20px;
}

.mlart-product-title {
    margin: 0 0 8px;
    font-size: 1.2rem;
    line-height: 1.3;
}

.mlart-product-price {
    margin: 0;
    font-size: 1rem;
    color: #555;
}

/* ---------- Sold badge (corner ribbon) ---------- */

.mlart-sold-badge {
    position: absolute;
    top: 14px;
    left: -46px;
    width: 170px;
    transform: rotate(-38deg);
    background: linear-gradient(135deg, #8b1e3f 0%, #c0334d 55%, #8b1e3f 100%);
    color: #fff;
    text-align: center;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 7px 0;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.25),
        inset 0 -1px 0 rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    pointer-events: none;
    z-index: 2;
}

.mlart-sold-badge::before,
.mlart-sold-badge::after {
    content: "";
    position: absolute;
    top: 100%;
    border: 5px solid transparent;
    border-top-color: #5a1228;
}

.mlart-sold-badge::before {
    left: 4px;
}

.mlart-sold-badge::after {
    right: 4px;
}

.mlart-sold-badge__text {
    position: relative;
    display: inline-block;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}

.mlart-sold-badge--lg {
    top: 22px;
    left: -58px;
    width: 220px;
    font-size: 1rem;
    padding: 11px 0;
    letter-spacing: 0.22em;
}

.mlart-sold-badge--updated {
    background: linear-gradient(135deg, #c2410c 0%, #f97316 55%, #c2410c 100%);
}

.mlart-sold-badge--updated::before,
.mlart-sold-badge--updated::after {
    border-top-color: #7c2d12;
}

.mlart-sold-badge--free {
    background: linear-gradient(135deg, #ca8a04 0%, #fde047 55%, #ca8a04 100%);
    color: #1a0a00;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.mlart-sold-badge--free::before,
.mlart-sold-badge--free::after {
    border-top-color: #78350f;
}

.mlart-pagination {
    margin-top: 56px;
    display: flex;
    justify-content: center;
}

.mlart-pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.mlart-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    background: #fff;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.mlart-pagination a.page-numbers:hover,
.mlart-pagination a.page-numbers:focus {
    background: #faf5fb;
    border-color: #c026d3;
    color: #a21caf;
}

.mlart-pagination .page-numbers.current {
    background: #a21caf;
    border-color: #a21caf;
    color: #fff;
}

.mlart-pagination .page-numbers.dots {
    border-color: transparent;
    background: transparent;
    color: #888;
}

.mlart-pagination .page-numbers.prev,
.mlart-pagination .page-numbers.next {
    padding: 0 16px;
}

/* ---------- Single ---------- */

.mlart-single-layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 48px;
    align-items: start;
}

.mlart-single-image {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    justify-self: center;
    max-width: 100%;
}

.mlart-single-product-image {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 600px;
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
}

.mlart-single-title {
    margin: 0 0 12px;
    font-size: clamp(2rem, 3vw, 3.25rem);
    line-height: 1.1;
}

.mlart-single-price {
    margin: 0 0 24px;
    font-size: 1.4rem;
    color: #444;
}

.mlart-single-meta {
    margin: 0 0 28px;
    padding: 18px 20px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    background: #fafafa;
    display: grid;
    gap: 8px;
}

.mlart-single-meta-row {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 14px;
    align-items: baseline;
    margin: 0;
}

.mlart-single-meta dt {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #888;
}

.mlart-single-meta dd {
    margin: 0;
    font-size: 1rem;
    color: #222;
}

.mlart-single-description {
    margin-bottom: 28px;
}

.mlart-single-status {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0;
    font-size: 1rem;
    color: #555;
    font-weight: 500;
}

.mlart-sold-pill {
    display: inline-block;
    padding: 8px 18px;
    background: linear-gradient(135deg, #8b1e3f 0%, #c0334d 55%, #8b1e3f 100%);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    border-radius: 999px;
    box-shadow:
        0 4px 12px rgba(139, 30, 63, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.mlart-single-status-text {
    font-style: italic;
    color: #6b6b6b;
}

/* ---------- Image lightbox (single pages) ---------- */

.mlart-single-image-trigger {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.mlart-single-image-trigger:focus-visible {
    outline: 3px solid #c9a5ad;
    outline-offset: 4px;
}

.mlart-image-lightbox {
    padding: 0;
    border: 0;
    background: transparent;
    max-width: 92vw;
    max-height: 92vh;
    overflow: visible;
}

.mlart-image-lightbox::backdrop {
    background: rgba(0, 0, 0, 0.85);
}

.mlart-image-lightbox img {
    display: block;
    max-width: 92vw;
    max-height: 92vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.mlart-image-lightbox__close {
    position: absolute;
    top: -18px;
    right: -18px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 0;
    background: #fff;
    color: #222;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.mlart-image-lightbox__close:hover {
    background: #f5f5f5;
}

/* ---------- WhatsApp button (shortcode) ---------- */

.mlart-whatsapp-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    background: #25d366;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

.mlart-whatsapp-button svg {
    width: 1.25em;
    height: 1.25em;
    flex-shrink: 0;
}

.mlart-whatsapp-button:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

/* ---------- Responsive ---------- */

@media (max-width: 1200px) {
    .mlart-product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .mlart-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mlart-single-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

@media (max-width: 640px) {
    .mlart-product-grid {
        grid-template-columns: 1fr;
    }

    .mlart-products-archive,
    .mlart-single-product {
        padding: 36px 0;
    }
}

/* ---------- Home page ---------- */

.mlart-class-grid {
    gap: 1.5rem;
    margin-top: 32px;
}

.mlart-class-grid figure.wp-block-image {
    margin: 0 0 0.75rem;
}

.mlart-class-grid figure.wp-block-image img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    height: auto;
    display: block;
}
