/* RAWBURTZ BUILD 058 — ARTWORK DISCOVERY SURFACE */

html.rb058-discovery {
    --rb058-paper: #f2efe8;
    --rb058-ink: #050505;
    --rb058-red: #ff2b2b;
    --rb058-line: rgba(255,255,255,.16);
    --rb058-muted: rgba(255,255,255,.62);
}

html.rb058-discovery body {
    overflow-x: hidden;
}

.rb058-discovery-bar {
    width: min(100% - clamp(28px, 6vw, 96px), 1700px);
    margin: clamp(28px, 5vw, 64px) auto clamp(42px, 7vw, 94px);
    border-top: 1px solid var(--rb058-line);
    border-bottom: 1px solid var(--rb058-line);
}

.rb058-discovery-bar__inner {
    min-height: 84px;
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    gap: 24px;
    align-items: center;
    padding: 14px 0;
}

.rb058-discovery-kicker {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: var(--rb058-muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .16em;
    line-height: 1.2;
    text-transform: uppercase;
}

.rb058-discovery-kicker::before {
    content: '';
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 999px;
    background: var(--rb058-red);
    box-shadow: 0 0 0 5px rgba(255,43,43,.08);
}

.rb058-discovery-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.rb058-view-button,
.rb058-random-button {
    appearance: none;
    border: 1px solid rgba(255,255,255,.22);
    background: transparent;
    color: rgba(255,255,255,.74);
    min-height: 42px;
    padding: 0 16px;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .14em;
    text-transform: uppercase;
    transition: border-color .2s ease, background .2s ease, color .2s ease, transform .2s ease;
}

.rb058-view-button:hover,
.rb058-random-button:hover,
.rb058-view-button:focus-visible,
.rb058-random-button:focus-visible {
    color: #fff;
    border-color: rgba(255,255,255,.6);
    outline: none;
}

.rb058-view-button:focus-visible,
.rb058-random-button:focus-visible {
    box-shadow: 0 0 0 3px rgba(255,43,43,.35);
}

.rb058-view-button[aria-pressed='true'] {
    background: #fff;
    color: #000;
    border-color: #fff;
}

.rb058-random-button {
    border-color: rgba(255,43,43,.72);
    color: #fff;
}

.rb058-random-button:hover,
.rb058-random-button:focus-visible {
    background: var(--rb058-red);
    border-color: var(--rb058-red);
}

.rb058-random-button:disabled {
    opacity: .38;
    cursor: not-allowed;
}

/* JS applies this only to the common live artwork-card parent. */
.rb058-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: clamp(48px, 7vw, 120px) clamp(24px, 4vw, 68px) !important;
    align-items: start !important;
}

.rb058-card {
    position: relative;
    min-width: 0;
    overflow: visible !important;
    opacity: 1;
    transform: none;
}

.rb058-card--lead {
    grid-column: 1 / -1 !important;
}

.rb058-card-index {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 28px;
    padding: 0 9px;
    border: 1px solid rgba(0,0,0,.16);
    background: rgba(242,239,232,.92);
    color: #050505;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .14em;
    line-height: 1;
    pointer-events: none;
    backdrop-filter: blur(8px);
}

.rb058-card-cta {
    display: inline-flex;
    margin-top: 16px;
    color: rgba(255,255,255,.68);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .16em;
    line-height: 1.2;
    text-transform: uppercase;
    pointer-events: none;
}

.rb058-card:hover .rb058-card-cta,
.rb058-card:focus-within .rb058-card-cta {
    color: #fff;
}

.rb058-card img.rb058-art-image {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: none !important;
    object-fit: contain !important;
    background: var(--rb058-paper);
    transition: transform .45s cubic-bezier(.2,.7,.2,1), filter .3s ease;
}

.rb058-card--lead img.rb058-art-image {
    max-height: 82vh !important;
    object-fit: contain !important;
}

.rb058-card a:has(img.rb058-art-image) {
    display: block;
    overflow: hidden;
    background: var(--rb058-paper);
}

.rb058-card:hover img.rb058-art-image,
.rb058-card:focus-within img.rb058-art-image {
    transform: scale(1.008);
}

.rb058-card h2,
.rb058-card h3 {
    text-wrap: balance;
}

/* Give price/status information a secondary visual weight without hiding it. */
.rb058-card :is([class*='price'], [class*='meta'], [class*='status']) {
    position: relative;
}

html.rb058-discovery[data-rb058-view='focus'] .rb058-grid {
    grid-template-columns: 1fr !important;
    gap: clamp(72px, 11vw, 170px) !important;
}

html.rb058-discovery[data-rb058-view='focus'] .rb058-card,
html.rb058-discovery[data-rb058-view='focus'] .rb058-card--lead {
    grid-column: 1 !important;
    width: min(100%, 1240px);
    margin-inline: auto;
}

html.rb058-discovery[data-rb058-view='focus'] .rb058-card img.rb058-art-image {
    max-height: 88vh !important;
    object-fit: contain !important;
}

html.rb058-discovery[data-rb058-view='focus'] .rb058-card-cta {
    color: #fff;
}

@media (min-width: 1100px) {
    .rb058-card--lead {
        width: min(100%, 1500px);
        justify-self: center;
    }
}

@media (max-width: 840px) {
    .rb058-discovery-bar {
        width: min(100% - 28px, 1000px);
        margin-top: 26px;
        margin-bottom: 48px;
    }

    .rb058-discovery-bar__inner {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 18px 0;
    }

    .rb058-discovery-controls {
        justify-content: flex-start;
    }

    .rb058-grid {
        grid-template-columns: 1fr !important;
        gap: 68px !important;
    }

    .rb058-card,
    .rb058-card--lead {
        grid-column: 1 !important;
    }

    .rb058-view-button,
    .rb058-random-button {
        flex: 1 1 auto;
        padding-inline: 12px;
    }

    .rb058-card-index {
        top: 8px;
        left: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rb058-view-button,
    .rb058-random-button,
    .rb058-card img.rb058-art-image {
        transition: none !important;
    }
}

/* ========================================================================
   RAWBURTZ BUILD 058 R1 — CARD SURFACE + MEDIA FRAME CORRECTION
   Corrects a selector collision where the full artwork anchor inherited the
   paper background and where BUILD 058's image sizing fought the legacy
   aspect-ratio media frame.
   ======================================================================== */

/* The artwork anchor contains image + metadata. Keep the overall card dark. */
.rb058-card a:has(img.rb058-art-image) {
    background: transparent !important;
}

/* FIELD view: give every non-lead work a neutral square viewing stage.
   The complete image remains visible instead of being ecommerce-cropped. */
.rb058-card:not(.rb058-card--lead) > a > div:first-child {
    aspect-ratio: 1 / 1 !important;
    min-height: 0 !important;
    background: #111 !important;
}

.rb058-card:not(.rb058-card--lead) img.rb058-art-image {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    object-fit: contain !important;
    background: #111 !important;
}

/* The lead work is a wide viewing stage, not a stretched 4:5 shop card. */
.rb058-card--lead > a > div:first-child {
    aspect-ratio: 4 / 3 !important;
    min-height: 0 !important;
    max-height: min(76vh, 1050px) !important;
    background: #111 !important;
}

.rb058-card--lead img.rb058-art-image {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    object-fit: contain !important;
    background: #111 !important;
}

/* FOCUS view uses a wide gallery stage for every artwork. */
html.rb058-discovery[data-rb058-view='focus'] .rb058-card > a > div:first-child {
    aspect-ratio: 4 / 3 !important;
    min-height: 0 !important;
    max-height: min(82vh, 1100px) !important;
    background: #111 !important;
}

html.rb058-discovery[data-rb058-view='focus'] .rb058-card img.rb058-art-image {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    object-fit: contain !important;
    background: #111 !important;
}

/* Preserve original dark metadata treatment and readable hierarchy. */
.rb058-card > a > p,
.rb058-card > a > h2,
.rb058-card > a > h3 {
    background: transparent !important;
}

@media (max-width: 840px) {
    .rb058-card--lead > a > div:first-child,
    html.rb058-discovery[data-rb058-view='focus'] .rb058-card > a > div:first-child {
        aspect-ratio: 1 / 1 !important;
        max-height: none !important;
    }
}
