/* ============================================================
   Artpilot Gallery — Shared Styles
   Bruges af artist-gallery-template.php og
   artist-gallery-sale-template.php
============================================================ */


/* ==========================================================
   DELTE STYLES
   Fælles for begge templates
========================================================== */

/* --- Kort (mosaic) --- */
.artwork-card,
.sale-card {
    break-inside: avoid;
    width: 100%;
    cursor: pointer;
    margin-bottom: 80px;
    font-family: var(--e-global-typography-42d6704-font-family), Sans-serif;
    font-size: var(--e-global-typography-42d6704-font-size);
    line-height: var(--e-global-typography-42d6704-line-height);
    color: var(--e-global-color-text);
    position: relative;
}
.artwork-card img,
.sale-card img {
    width: 100%;
    display: block;
    margin-bottom: 15px;
    aspect-ratio: auto 2/3;
    background: #f5f5f5;
    opacity: 0;
    transition: opacity 1.5s ease;
}
.artwork-card img.loaded,
.sale-card img.loaded {
    opacity: 1;
}
.artwork-card > div,
.sale-card > div {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}
.artwork-card > p,
.sale-card > p {
    margin: 0;
}

.artwork-arrow {
    position: absolute;
    right: 0;
    bottom: 0;
}

/* --- Detalje layout --- */
.artwork-detail-layout,
.sale-detail-layout {
    display: flex;
    gap: 60px;
    align-items: flex-start;
    flex-wrap: wrap;
    position: relative;
    margin-bottom: 80px;
}

.sale-detail-back,
.artwork-detail-back {
    margin-bottom: 70px;
}

.artwork-detail-image,
.sale-detail-image {
    flex: 1 1 400px;
}
.artwork-detail-image img,
.sale-detail-image img {
    width: 100%;
    object-fit: contain;
    background: #f5f5f5;
    display: block;
}
.artwork-detail-info,
.sale-detail-info {
    flex: 1 1 400px;
    padding-top: 20px;
}
.artwork-detail-info-row,
.sale-detail-info-row {
    font-family: var(--e-global-typography-text-font-family), Sans-serif;
    font-size: var(--e-global-typography-text-font-size);
    font-weight: var(--e-global-typography-text-font-weight);
    font-style: var(--e-global-typography-text-font-style);
    line-height: var(--e-global-typography-text-line-height);
    word-spacing: var(--e-global-typography-text-word-spacing);
    color: var(--e-global-color-text);
    padding: 20px 0;
    border-bottom: 1px solid var(--e-global-color-05f0af0);
    display: flex;
    gap: 30px;
}
.artwork-detail-info-row > div:first-child,
.sale-detail-info-row > div:first-child {
    width: 150px;
    flex-shrink: 0;
}
.artwork-detail-info-row > div:last-child,
.sale-detail-info-row > div:last-child {
    width: calc(100% - 180px);
}

/* --- Billede-handlinger (del, download, lightbox) --- */
.artwork-image-share,
.sale-image-share {
    position: relative;
}

.sale-detail-button,
.artwork-detail-button {
    display: flex;
    margin-top: 50px;
}

.sale-detail-button a,
.artwork-detail-button a {
    margin-left: auto;
}


.artwork-detail-image-actions,
.sale-detail-image-actions {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    gap: 10px;
}

.artwork-action-btn,
.sale-action-btn {
    border: 1px solid var(--e-global-color-05f0af0);
    width: 40px;
    height: 40px;
    font-size: 20px;
    line-height: 40px;
    text-align: center;
    background: none;
    cursor: pointer;
    color: var(--e-global-color-text);
}
.artwork-action-btn:hover,
.sale-action-btn:hover {
    opacity: 0.7;
}
.artwork-share-panel,
.sale-share-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    z-index: 200;
    min-width: 160px;
    list-style: none;
    padding: 6px 0;
    margin: 0;
}
.artwork-share-panel.open,
.sale-share-panel.open {
    display: block;
}
.artwork-share-panel li a,
.sale-share-panel li a {
    display: block;
    padding: 9px 16px;
    font-size: 0.9em;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
}
.artwork-share-panel li a:hover,
.sale-share-panel li a:hover {
    background: #f5f5f5;
}

/* --- Lightbox --- */
#artwork-lightbox,
#sale-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
#artwork-lightbox.open,
#sale-lightbox.open {
    display: flex;
}
#artwork-lightbox-img,
#sale-lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    display: block;
}
#artwork-lightbox-close,
#sale-lightbox-close {
    position: fixed;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5em;
    cursor: pointer;
    line-height: 1;
    z-index: 10000;
}


/* ==========================================================
   KUNSTNER-GALLERI (artist-gallery-template.php)
========================================================== */

.gallery-wrapper {
    padding: 0;
    margin: 0 auto;
}
.artist-gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 0 -15px;
    width: calc(100% + 30px);
}
.artist-card {
    margin: 25px;
    cursor: pointer;
    text-align: center;
    flex: 0 1 calc(33.33% - 50px);
    box-sizing: border-box;
    max-width: calc(33.33% - 50px);
}
.artist-card img {
    width: 100%;
    height: 500px!important;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 1.5s ease;
}
.artist-card img.loaded {
    opacity: 1;
}
.artist-card-name {
    font-family: var(--e-global-typography-de4ab51-font-family), Sans-serif;
    font-size: var(--e-global-typography-de4ab51-font-size);
    font-weight: var(--e-global-typography-de4ab51-font-weight);
    color: var(--e-global-color-primary);
    margin-top: 10px;
}
#artist-gallery-container h1,
#artist-gallery-container h2,
.sale-gallery-wrapper h1,
h2.sale-related-title {
    font-family: var(--e-global-typography-ca4417a-font-family), Sans-serif;
    font-size: var(--e-global-typography-ca4417a-font-size)!important;
    font-weight: var(--e-global-typography-ca4417a-font-weight) !important;
    line-height: var(--e-global-typography-ca4417a-line-height)!important;
    letter-spacing: var(--e-global-typography-ca4417a-letter-spacing);
    text-align: center;
    color: var(--e-global-color-primary);
    margin: 0 0 60px;
}

#headline-sub {
    margin-top: -40px;
    text-align: center;
    margin-bottom: 60px;
}

#artist-gallery-container h2 {
    margin-top: 170px;
    position: relative;
}

h2.sale-related-title {
    text-align:left;
}

/* --- Kunstner-side top --- */

#artist-page-container h1 {
    margin: 0;
}

#artist-page-container, #artist-list {
    margin-bottom: 100px;
}


.artist-page-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row;
    margin: 0 0 70px 0;
}
.artist-page-top .artist-page-title {
    margin: 0;
}
.more-artworks {
    background-color: var(--e-global-color-primary);
    font-family: var(--e-global-typography-text-font-family), Sans-serif;
    font-size: var(--e-global-typography-text-font-size);
    font-weight: var(--e-global-typography-text-font-weight);
    font-style: var(--e-global-typography-text-font-style);
    line-height: var(--e-global-typography-text-line-height);
    word-spacing: var(--e-global-typography-text-word-spacing);
    fill: #ffffff;
    color: #ffffff;
    border: 2px solid var(--e-global-color-primary);
    border-radius: 0;
    padding: 14px 45px 13px 45px;
    text-transform: uppercase;
}
.more-artworks svg {
    margin-left: 10px;
}

/* --- Mosaic grid --- */
#selected-artworks.active,
#more-artworks.active {
    columns: 3;
    column-gap: 50px;
}

/* --- Tabs --- */
.tabs {
    display: flex;
    gap: 40px;
    padding-bottom: 0;
    border-bottom: 1px solid #e8e8e8;
    margin-bottom: 80px;
    position: relative;
}
.tab-link {
    padding: 10px 15px 35px;
    cursor: pointer;
    border: none;
    background-color: transparent;
    text-decoration: none !important;
    color: #000;
    font-family: var(--e-global-typography-text-font-family), Sans-serif;
    font-size: var(--e-global-typography-text-font-size);
    font-weight: var(--e-global-typography-text-font-weight);
    font-style: var(--e-global-typography-text-font-style);
    line-height: var(--e-global-typography-text-line-height);
    word-spacing: var(--e-global-typography-text-word-spacing);
    position: relative;
}
.tab-link:first-child {
    padding-left: 0;
}
.tab-link.active {
    border-bottom: none;
    background-color: transparent;
}

/* ---- Tabs wrapper skal være relative ---- */
.tabs {
    position: relative;
    display: flex; /* eller hvad du allerede har */
}


/* ---- Den animerede dot ---- */
.tab-indicator {
    width: 24px;
    height: 24px;
    background-color: var(--e-global-color-primary);
    border-radius: 50%;
    position: absolute;
    bottom: -12px;
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none; /* Klik går igennem til tabs */
}

/* Ingen animation ved første load */
.tab-indicator.no-transition {
    transition: none !important;
}


.tab-content {
    display: none;
    padding: 0;
    border: none;
}
.tab-content.active {
    display: block;
}

/* --- Artist statement & CV --- */
.artworkSale {
    display: none;
    margin: 90px 0 80px;
    position: relative;
    justify-content: center;
}
#selected-artworks.active ~ .artworkSale {
    display: flex;
}
.artist-statement-container {
    display: flex;
    gap: 80px;
}
.artist-statement-container > div {
    flex: 1;
}
.artist-statement-container > div > * {
    color: var(--e-global-color-primary);
}
.artist-statement-container h3,
#cv > h3:first-child,
#downloads > h3:first-child {
    margin-top: 0;
    font-family: var(--e-global-typography-68b08c5-font-family), Sans-serif!important;
    font-size: var(--e-global-typography-68b08c5-font-size)!important;
    font-weight: var(--e-global-typography-68b08c5-font-weight)!important;
    line-height: var(--e-global-typography-68b08c5-line-height);
    color: var(--e-global-color-primary)!important;
}
#cv > *,
#downloads a {
    color: var(--e-global-color-primary);
}

.artist-statement-container img {
    min-height: 300px;
    object-fit: cover;
}



/* ==========================================================
   SALG (artist-gallery-sale-template.php)
========================================================== */

.sale-gallery-wrapper {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* --- Søgeformular --- */
.sale-search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    align-items: flex-end;
    margin-bottom: 80px;
}
.sale-filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1 1 180px;
}
.sale-filter-group > label {
    font-size: 0.8em;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.sale-search-form select {
    width: 100%;
    padding: 9px 12px;
    font-size: 0.95em;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23666'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}
.sale-search-form select:focus {
    outline: none;
    border-color: #999;
}
.sale-search-submit {
    align-self: flex-end;
    flex: 0 0 20%;
}
.sale-search-submit:hover {
    background: #333;
}

.select2-container--default .select2-selection--single,
.sale-multiselect-trigger {
    border-color: var(--e-global-color-05f0af0)!important;
    height: 56px!important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered,
.sale-multiselect-trigger{
    font-family: var(--e-global-typography-text-font-family), Sans-serif!important;
    font-size: var(--e-global-typography-text-font-size)!important;
    font-weight: var(--e-global-typography-text-font-weight)!important;
    font-style: var(--e-global-typography-text-font-style)!important;
    line-height: var(--e-global-typography-text-line-height)!important;
    word-spacing: var(--e-global-typography-text-word-spacing)!important;
    color: var(--e-global-color-text)!important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 56px!important;
    padding: 0 30px;
}


.select2-container--default .select2-selection--single .select2-selection__arrow b,
.sale-multiselect-trigger-arrow {
    font-family: 'ElegantIcons';
    speak: none;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    border: none!important;
    left: -8px!important;
    top: 9px!important;
    margin: 0!important;
    font-size: 20px!important;
    padding-left: 0;
    padding-right: 10px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    right: 8px!important;
}

.sale-multiselect-trigger-arrow {
    position: absolute;
    left: auto!important;
    top: 18px!important;
    right: 9px!important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b:after,
.sale-multiselect-trigger-arrow:after {
    content: "\33";
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    top: 8px!important;
}
    

/* --- Custom multi-select dropdown --- */
.sale-multiselect {
    position: relative;
}
.sale-multiselect-trigger {
    width: 100%;
    padding: 9px 32px 9px 12px;
    border: 1px solid  var(--e-global-color-05f0af0)!important;
    background: #fff;
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
    background-repeat: no-repeat;
    background-position: right 10px center;
}
    
.sale-multiselect-trigger:focus {
    outline: none;
    border-color: #999;
}
.sale-multiselect-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
    z-index: 100;
    max-height: 260px;
    overflow-y: auto;
}
.sale-multiselect-panel.open {
    display: block;
}
.sale-multiselect-panel label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 0.9em;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    color: #333;
}
.sale-multiselect-panel label:hover {
    background: #f5f5f5;
}
.sale-multiselect-panel input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

/* --- Mosaic grid --- */
.sale-grid {
    columns: 3;
    column-gap: 50px;
}
.sale-load-more {
    display: block;
    margin: 80px auto 0;
    padding: 10px 30px;
    background: #000;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 0.95em;
}
.sale-load-more:hover {
    background: #333;
}
.sale-load-more[hidden] {
    display: none;
}
#sale-status {
    text-align: center;
    margin-top: 20px;
    color: #888;
    font-size: 0.9em;
}

/* --- Detalje-side --- */
.sale-detail {
    margin: 0 auto 180px;
}

.artwork-detaill {
    margin-bottom: 90px;
}

.sale-detail-layout:after,
#artist-list > h2:before {
    content: '';
    display: block;
    border-bottom: 1px solid var(--e-global-color-05f0af0);
    width: 300%;
    position: absolute;
    left: -100%;
    bottom: -80px;
}

#artist-list > h2:before {
    bottom: auto;
    top: -75px;
}


/* --- Relaterede kunstværker --- */
.sale-related-artworks {
    margin-top: 80px;
}
.sale-related-title {
    margin: 0 0 40px 0;
}
.sale-related-grid {
    columns: 3;
    column-gap: 50px;
    margin-bottom: 100px;
}





@media (max-width: 1024px) {
    
    .artist-gallery {
        margin: 0 -10px;
        width: calc(100% + 20px);
    }
    .artist-card {
        margin: 10px;
        flex: 0 1 calc(50% - 20px);
        max-width: calc(50% - 20px);
    }

}


@media (max-width: 960px) {
    

    #selected-artworks.active, #more-artworks.active, #sale-grid, .sale-related-grid {
        columns: 2;
        column-gap: 30px;
    }
}





@media (max-width: 768px) {
    
    .artist-gallery {
        margin: 0;
        width: 100%;
    }
    .artist-card {
        margin: 0;
        flex: 0 1 100%;
        max-width: 100%;
    }
    
    .artist-page-top {
        flex-direction: column;
        gap: 30px;
    }
    
    #selected-artworks.active, #more-artworks.active, #sale-grid, .sale-related-grid {
        columns: 1;
    }
    
    .sale-search-form > * {
        flex: 0 0 50%; /* Voks ikke, skrump ikke, vær altid 50% */
        max-width: 50%; /* Sikkerhed i ældre browsere */
    }
}
    
    
@media (max-width: 480px) {
    
    .sale-search-form > * {
        flex: 0 0 100%; /* Voks ikke, skrump ikke, vær altid 50% */
        max-width: 100%; /* Sikkerhed i ældre browsere */
    }
    
    .artwork-card > div, .sale-card > div {
        display: block;
    }
    
    .artwork-card > div > div, .sale-card > div > div {
        display: inline-block;
    }
    
    .art-spacer {
        margin: 0 4px;
    }
    
    
    .tabs, .exhibition_arc .nav.nav-tabs {
        flex-direction: column;
        border-left: 1px solid #e8e8e8;
        border-bottom: none;
        margin-bottom: 10px;
        padding-left: 20px;
        margin-left: 13px;
    }
    
     .tab-indicator {
        top: 0;
        left: -13px;
        transition: top 0.3s ease;  /* animér top i stedet for left */
    }
    
    .tab-link,
    .tab-link:first-child,
    .exhibition_arc .wrap-content ul.nav-tabs li a,
    .exhibition_arc .wrap-content ul.nav-tabs li a.active {
        padding: 10px 15px 10px!important;
    }
    
    .tabs, .exhibition_arc .nav.nav-tabs {
        gap: 20px;
        margin-bottom: 40px;
    }
    
    .artist-statement-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .artwork-detail-info-row > div:first-child, .sale-detail-info-row > div:first-child {
        width: 120px;
    }
    
    .artwork-detail-info-row > div:last-child, .sale-detail-info-row > div:last-child {
        width: calc(100% - 150px);
    }

}






