/* ==========================================================================
   MKW Artists — Frontend Styles
   Developed by SiteMeUp | https://sitemeup.co.za
   ========================================================================== */

/* --------------------------------------------------------------------------
   Artist Profile Block
   -------------------------------------------------------------------------- */

.mkw-artist-block {
    display: flex;
    align-items: flex-start;
    gap: 40px;
    margin: 0 0 48px;
    padding: 0;
}

.mkw-artist-image {
    flex: 0 0 340px;
    max-width: 340px;
}

.mkw-artist-image img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

.mkw-artist-content {
    flex: 1;
    min-width: 0;
}

.mkw-artist-content.mkw-no-image {
    flex: 1 1 100%;
}

.mkw-artist-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 16px;
    line-height: 1.2;
}

.mkw-artist-intro p {
    margin: 0 0 12px;
    line-height: 1.7;
    color: inherit;
}

/* --------------------------------------------------------------------------
   Read More / Full Bio Expand
   -------------------------------------------------------------------------- */

.mkw-artist-full-bio {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.45s ease, opacity 0.35s ease;
}

.mkw-artist-full-bio.mkw-expanded {
    max-height: 2000px; /* generous ceiling; animates from 0 */
    opacity: 1;
}

.mkw-read-more-toggle {
    background: none;
    border: none;
    border-bottom: 1px solid currentColor;
    padding: 0;
    margin: 8px 0 20px;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    color: inherit;
    line-height: 1.4;
    transition: opacity 0.2s;
}

.mkw-read-more-toggle:hover {
    opacity: 0.65;
}

/* --------------------------------------------------------------------------
   Artist Links (Back / Enquire)
   -------------------------------------------------------------------------- */

.mkw-artist-links {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.mkw-link {
    font-size: 14px;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid currentColor;
    padding-bottom: 1px;
    transition: opacity 0.2s;
}

.mkw-link:hover {
    opacity: 0.65;
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   Filter Bar
   -------------------------------------------------------------------------- */

.mkw-filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 28px;
    flex-wrap: wrap;
}

.mkw-filter-btn {
    background: transparent;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 8px 18px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    color: inherit;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    line-height: 1;
}

.mkw-filter-btn:hover,
.mkw-filter-btn.mkw-filter-active {
    background: #111;
    border-color: #111;
    color: #fff;
}

.mkw-filter-loading {
    font-size: 0.85rem;
    color: #888;
    margin-left: 8px;
}

/* --------------------------------------------------------------------------
   Product wrapper — prevents flash on AJAX reload
   -------------------------------------------------------------------------- */

#mkw-products-wrap {
    min-height: 100px;
    transition: opacity 0.2s;
}

#mkw-products-wrap.mkw-loading {
    opacity: 0.4;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   Genre Filter Bar
   -------------------------------------------------------------------------- */

.mkw-genre-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 28px;
    flex-wrap: wrap;
}

.mkw-genre-filter-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
}

.mkw-genre-filter-right {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.mkw-genre-select {
    font-family: inherit;
    font-size: 14px;
    color: inherit;
    background: transparent;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 8px 36px 8px 14px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23333' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    min-width: 200px;
    transition: border-color 0.2s;
    line-height: 1;
}

.mkw-genre-select:focus {
    outline: none;
    border-color: #111;
}

/* View All reset button — hidden until a genre is active */
.mkw-genre-reset {
    background: #111;
    border: 1px solid #111;
    border-radius: 3px;
    padding: 8px 18px;
    font-size: 14px;
    font-family: inherit;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.mkw-genre-reset:hover {
    background: #333;
    border-color: #333;
}

.mkw-genre-loading {
    font-size: 14px;
    color: #888;
}

/* --------------------------------------------------------------------------
   Genre results wrapper
   -------------------------------------------------------------------------- */

#mkw-genre-results-wrap {
    min-height: 0;
    transition: opacity 0.2s;
}

#mkw-genre-results-wrap.mkw-loading {
    opacity: 0.4;
    pointer-events: none;
}

#mkw-genre-results-wrap:empty {
    display: none;
}

.mkw-genre-no-results {
    padding: 20px;
    background: #f8f8f8;
    border-left: 4px solid #ccc;
    margin: 0 0 28px;
    font-size: 14px;
}

/* --------------------------------------------------------------------------
   Artist Search Trigger (magnifying glass icon)
   -------------------------------------------------------------------------- */

.mkw-artist-search-trigger {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: opacity 0.2s;
    line-height: 1;
}

.mkw-artist-search-trigger:hover {
    opacity: 0.6;
}

/* --------------------------------------------------------------------------
   Artist Search Modal
   -------------------------------------------------------------------------- */

.mkw-search-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
}

.mkw-search-modal[hidden] {
    display: none;
}

.mkw-search-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.mkw-search-modal-inner {
    position: relative;
    background: #fff;
    border-radius: 4px;
    width: 100%;
    max-width: 520px;
    margin: 0 20px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.mkw-search-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #eee;
}

.mkw-search-modal-label {
    font-size: 14px;
    font-weight: 600;
    color: #111;
    letter-spacing: 0.02em;
}

.mkw-search-modal-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    transition: color 0.15s;
    line-height: 1;
}

.mkw-search-modal-close:hover {
    color: #111;
}

.mkw-search-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-bottom: 1px solid #eee;
}

.mkw-search-icon-inline {
    color: #aaa;
    flex-shrink: 0;
}

.mkw-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    font-family: inherit;
    color: #111;
    background: transparent;
    padding: 0;
    line-height: 1.5;
}

.mkw-search-input::placeholder {
    color: #aaa;
}

/* clear button on search input */
.mkw-search-input::-webkit-search-cancel-button {
    cursor: pointer;
}

.mkw-search-results {
    max-height: 320px;
    overflow-y: auto;
    padding: 8px 0;
}

.mkw-search-hint,
.mkw-search-no-results {
    font-size: 13px;
    color: #999;
    padding: 12px 20px;
    margin: 0;
}

.mkw-search-result-item {
    display: block;
    width: 100%;
    padding: 11px 20px;
    font-size: 14px;
    font-family: inherit;
    color: #111;
    text-decoration: none;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f4f4f4;
}

.mkw-search-result-item:last-child {
    border-bottom: none;
}

.mkw-search-result-item:hover,
.mkw-search-result-item:focus {
    background: #f7f7f7;
    color: #111;
    text-decoration: none;
    outline: none;
}

.mkw-search-result-item mark {
    background: none;
    font-weight: 700;
    color: inherit;
}

/* --------------------------------------------------------------------------
   Artist parent category — subcategory card thumbnail aspect ratio override.
   Scoped to .mkw-artist-category (parent category pages only) AND to
   li.product-category items specifically — subcategory cards, not products.
   li.product items (actual artwork) are explicitly excluded so their
   thumbnails remain completely unaffected.
   -------------------------------------------------------------------------- */

.mkw-artist-category ul.products li.product-category a img {
    width: 100%;
    height: auto;
    aspect-ratio: 5 / 3;
    object-fit: cover;
    object-position: center;
    display: block;
}

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

@media ( max-width: 768px ) {
    .mkw-artist-block {
        flex-direction: column;
        gap: 24px;
    }

    .mkw-artist-image {
        flex: 0 0 auto;
        max-width: 100%;
        width: 100%;
    }

    .mkw-artist-title {
        font-size: 1.5rem;
    }

    /* Genre filter bar — stack on very small screens */
    .mkw-genre-filter-bar {
        flex-wrap: wrap;
    }

    .mkw-genre-filter-left {
        flex: 1 1 auto;
    }

    /* Genre results — force single column on mobile.
       WooCommerce outputs columns-2/columns-3 classes; override all of them. */
    #mkw-genre-results-wrap ul.products,
    #mkw-genre-results-wrap ul.products.columns-2,
    #mkw-genre-results-wrap ul.products.columns-3,
    #mkw-genre-results-wrap ul.products.columns-4 {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: none !important;
    }

    #mkw-genre-results-wrap ul.products li.product,
    #mkw-genre-results-wrap ul.products li.product-category {
        width: 100% !important;
        float: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}
