/**
 * Gallery detail page — Collection-aligned typography, larger art, muted CTA
 * body.gallery-detail-locked uses Collection layout from gallery-variants-v2.js
 */

.gallery-item-page {
    background: #fafafa;
    padding-top: 12px;
    font-family: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
}

.gallery-item-page .gallery-item-inner {
    max-width: 1320px;
}

.gallery-item-page .breadcrumb {
    background: transparent;
    padding: 0.35rem 0;
    font-size: 13px;
}

.gallery-item-page .gallery-item-image img {
    border-radius: 0 !important;
    box-shadow: none !important;
    border: 1px solid #e5e5e5;
    width: 100%;
    max-height: min(85vh, 920px);
    object-fit: contain;
    background: #fff;
}

.gallery-item-page .gallery-item-details {
    border-radius: 0;
    border: 1px solid #e5e5e5;
    background: #fff;
    padding: 28px 30px;
}

.gallery-item-page .artwork-description p {
    line-height: 1.75;
    font-size: 16px;
    color: #333;
}

.gallery-item-page .gallery-item-details h1.h2 {
    font-size: clamp(1.35rem, 2.2vw, 1.75rem);
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #1a1a1a;
    text-transform: none;
}

.gallery-item-page .price-section h4 {
    color: #1a1a1a !important;
    font-weight: 600;
    font-size: 1.35rem;
}

.gallery-item-page .price-section .badge {
    border-radius: 0;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 600;
}

/* Unified metadata */
.artwork-meta-list {
    margin: 0;
    padding: 0;
    border-top: 1px solid #e8e8e8;
    padding-top: 18px;
}

.artwork-meta-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px 20px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    font-size: 15px;
    line-height: 1.5;
    color: #1a1a1a;
}

.artwork-meta-row:last-child {
    border-bottom: none;
}

.artwork-meta-row dt {
    margin: 0;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6b6b6b;
    align-self: start;
    padding-top: 3px;
}

.artwork-meta-row dd {
    margin: 0;
    color: #1a1a1a;
}

.artwork-meta-row .meta-value {
    display: inline;
    font-weight: 400;
}

.gallery-enquire-muted {
    background: #2c2c2c !important;
    border: 1px solid #2c2c2c !important;
    color: #fff !important;
    border-radius: 0 !important;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 12px;
    padding: 14px 18px;
}

.gallery-enquire-muted:hover {
    background: #1a1a1a !important;
    border-color: #1a1a1a !important;
    color: #fff !important;
}

.gallery-item-page .like-btn {
    border-radius: 0 !important;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 12px;
}

/* Share row */
.gallery-item-share-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 16px;
}

.gallery-item-share-row .share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    border: 1px solid #d0d0d0;
    color: #1a1a1a;
    background: #fff;
    border-radius: 0;
    cursor: pointer;
    font-family: inherit;
    line-height: 1;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.gallery-item-share-row .share-btn:hover,
.gallery-item-share-row .share-btn:focus-visible {
    border-color: #1a1a1a;
    color: #1a1a1a;
    text-decoration: none;
    background: #fafafa;
    outline: none;
}

.gallery-item-share-row .share-btn .fa {
    font-size: 14px;
    width: 14px;
    text-align: center;
}

.gallery-item-share-row .share-x-glyph {
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
}

.gallery-item-share-row .share-native {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

.gallery-item-share-row .share-native:hover,
.gallery-item-share-row .share-native:focus-visible {
    background: #000;
    border-color: #000;
    color: #fff;
}

.gallery-item-share-row .share-popup[data-share="facebook"]:hover {
    border-color: #1877f2;
    color: #1877f2;
}

.gallery-item-share-row .share-popup[data-share="x"]:hover {
    border-color: #000;
    color: #000;
}

.gallery-item-share-row .share-popup[data-share="whatsapp"]:hover {
    border-color: #25d366;
    color: #25d366;
}

.gallery-item-share-row .share-instagram:hover {
    border-color: #c13584;
    color: #c13584;
}

.gallery-item-share-row .share-copy:hover {
    border-color: #1a1a1a;
}

/* Compact icon-only share row — always single line, fits any viewport */
.gallery-item-share-row--icons {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    max-width: 100%;
}

.gallery-item-share-row--icons .share-btn--icon {
    flex: 1 1 0;
    width: auto;
    height: 44px;
    min-width: 0;
    max-width: 56px;
    padding: 0;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    gap: 0;
    text-transform: none;
    letter-spacing: 0;
    aspect-ratio: 1 / 1;
}

.gallery-item-share-row--icons .share-btn--icon .fa {
    font-size: 17px;
    width: auto;
    margin: 0;
}

.gallery-item-share-row--icons .share-btn--icon .share-x-glyph {
    font-size: 16px;
    line-height: 1;
}

@media (max-width: 767px) {
    .gallery-item-share-row--icons {
        gap: 6px;
    }
    .gallery-item-share-row--icons .share-btn--icon {
        height: 42px;
        max-width: 52px;
    }
}

@media (max-width: 400px) {
    .gallery-item-share-row--icons {
        gap: 4px;
    }
    .gallery-item-share-row--icons .share-btn--icon {
        height: 38px;
        max-width: 46px;
    }
    .gallery-item-share-row--icons .share-btn--icon .fa,
    .gallery-item-share-row--icons .share-btn--icon .share-x-glyph {
        font-size: 15px;
    }
}

/* Hover / focus tooltips (data-share-tip) — minimal, no browser title flash */
.gallery-item-share-row--icons .share-btn--icon[data-share-tip] {
    position: relative;
}

.gallery-item-share-row--icons .share-btn--icon[data-share-tip]::after {
    content: attr(data-share-tip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 7px 12px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.03em;
    line-height: 1.3;
    white-space: nowrap;
    color: #fafafa;
    background: rgba(26, 26, 26, 0.94);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 30;
}

.gallery-item-share-row--icons .share-btn--icon[data-share-tip]:hover::after,
.gallery-item-share-row--icons .share-btn--icon[data-share-tip]:focus-visible::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

@media (hover: none) {
    .gallery-item-share-row--icons .share-btn--icon[data-share-tip]:hover::after {
        opacity: 0;
        visibility: hidden;
    }
}

/* Related */
.related-artworks-section {
    margin-top: 3.5rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e5e5;
}

.related-artworks-section h2 {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #1a1a1a;
    margin-bottom: 1.5rem;
}

.related-artwork-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border: 1px solid #e5e5e5;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.related-artwork-card:hover {
    text-decoration: none;
    color: inherit;
    border-color: #bdbdbd;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.related-artwork-card img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
    border-bottom: 1px solid #e5e5e5;
}

.related-artwork-card .related-body {
    padding: 16px 18px 18px;
}

.related-artwork-card .related-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px;
    line-height: 1.35;
}

.related-artwork-card .related-price {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

/* ---------- Tablet & phone polish (≤ 767px) ---------- */
@media (max-width: 767px) {
    .gallery-item-page {
        padding-top: 4px;
    }

    /* Compact breadcrumb row */
    .gallery-item-page > .container.my-4 {
        margin-top: 0.6rem !important;
        margin-bottom: 0.6rem !important;
    }

    .gallery-item-page .breadcrumb {
        font-size: 11px;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: #6b6e76;
        padding: 0;
        margin: 0;
        flex-wrap: wrap;
    }

    .gallery-item-page .breadcrumb-item + .breadcrumb-item::before {
        padding: 0 6px;
        color: #b9bcc4;
    }

    /* Image: tighter border, more vertical room */
    .gallery-item-page .gallery-item-image img {
        max-height: 70vh;
        border: 1px solid #e9e9eb;
    }

    /* Spacing between image col and details col stacks */
    .gallery-item-page .gallery-item-inner > .row > .col-lg-8.col-md-7 {
        margin-bottom: 18px !important;
    }

    /* Details card: tight, readable */
    .gallery-item-page .gallery-item-details {
        padding: 18px 18px 22px;
        border-color: #ececee;
    }

    .gallery-item-page .gallery-item-details h1.h2 {
        font-size: 1.25rem;
        line-height: 1.3;
        margin-bottom: 10px;
    }

    .gallery-item-page .artwork-description p {
        font-size: 14.5px;
        line-height: 1.7;
    }

    /* Price row: bigger price, neat badge alignment */
    .gallery-item-page .price-section {
        display: flex;
        align-items: center;
        gap: 12px;
        flex-wrap: wrap;
        margin-bottom: 14px !important;
    }

    .gallery-item-page .price-section h4 {
        margin: 0;
        font-size: 1.4rem;
    }

    .gallery-item-page .price-section .badge {
        padding: 5px 9px;
        font-size: 10px;
    }

    /* Meta list: single column, rhythm-locked */
    .artwork-meta-list {
        padding-top: 14px;
    }

    .artwork-meta-row {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 8px 0;
        font-size: 14px;
    }

    .artwork-meta-row dt {
        font-size: 10px;
        letter-spacing: 0.12em;
        padding-top: 0;
    }

    /* CTA + Like: full-width, generous tap target, consistent rhythm */
    .gallery-item-page .action-buttons {
        margin-top: 18px !important;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .gallery-item-page .action-buttons .enquiry-btn,
    .gallery-item-page .action-buttons .like-view-section {
        margin: 0 !important;
    }

    .gallery-item-page .action-buttons .btn,
    .gallery-item-page .action-buttons .gallery-enquire-muted,
    .gallery-item-page .action-buttons .likeBtn {
        width: 100%;
        min-height: 48px;
        padding: 13px 16px !important;
        font-size: 12px;
        letter-spacing: 0.1em;
    }

    .gallery-item-page .view-count {
        font-size: 11px;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: #8a8d95;
    }

    /* Share: icon row on mobile */
    .gallery-item-share-row {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 14px;
        justify-content: center;
    }

    .gallery-item-share-row .share-btn:not(.share-btn--icon) {
        justify-content: center;
        padding: 11px 10px;
        font-size: 11px;
    }

    .gallery-item-share-row--icons {
        display: flex;
        flex-wrap: nowrap;
        justify-content: space-between;
        gap: 6px;
    }

    .gallery-item-share-row--icons .share-btn--icon {
        flex: 1 1 0;
    }

    /* Related: 2-col compact grid, smaller image height */
    .related-artworks-section {
        margin-top: 2.4rem;
        padding-top: 1.4rem;
    }

    .related-artworks-section h2 {
        font-size: 11px;
        margin-bottom: 1rem;
    }

    .related-artworks-section > .row {
        margin-left: -6px;
        margin-right: -6px;
    }

    .related-artworks-section > .row > [class^="col-"] {
        padding-left: 6px;
        padding-right: 6px;
        margin-bottom: 14px !important;
    }

    .related-artwork-card img {
        height: 170px;
    }

    .related-artwork-card .related-body {
        padding: 10px 12px 12px;
    }

    .related-artwork-card .related-title {
        font-size: 13px;
        margin-bottom: 4px;
    }

    .related-artwork-card .related-price {
        font-size: 13px;
    }
}

/* ---------- Phone-only refinements (≤ 480px) ---------- */
@media (max-width: 480px) {
    .gallery-item-page .gallery-item-image img {
        max-height: 62vh;
    }

    .gallery-item-page .gallery-item-details {
        padding: 16px 16px 20px;
    }

    .related-artwork-card img {
        height: 150px;
    }
}
