/* =========================================
   ITEM DETAIL — CHARACTER-INSPIRED LAYOUT
========================================= */

.item-detail-page {
    overflow: visible;
}

.item-title-header {
    position: relative;
    z-index: 2;
    margin-bottom: 30px;
    padding: 8px 4px 22px;
    border-bottom: 2px solid rgba(198,156,74,.48);
}

.item-title-header .item-type {
    display: block;
    margin-bottom: 11px;
    font-family: var(--title-font);
    font-size: clamp(16px,1.65vw,20px);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 2.4px;
    text-transform: uppercase;
    color: #8b5d1f;
}

.item-title-header h1 {
    margin: 0;
    font-family: var(--title-font);
    font-size: clamp(56px,7.5vw,90px);
    line-height: .96;
    overflow-wrap: anywhere;
    color: #56351a;
    text-shadow: 0 2px 10px rgba(198,156,74,.12);
}

.item-visual-row {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(230px,290px) minmax(0,1fr);
    gap: clamp(28px,4.5vw,48px);
    align-items: stretch;
}

/* =========================================
   COMPACT ARTWORK CARD
========================================= */

.item-artwork-card {
    position: relative;
    align-self: stretch;
    width: 100%;
    height: 100%;
    max-width: 290px;
    min-height: 0;
    overflow: hidden;
    appearance: none;
    padding: 7px;
    cursor: zoom-in;
    background: linear-gradient(145deg,#d9ad4d,#8a591d);
    border: 2px solid rgba(244,212,124,.72);
    border-radius: 13px;
    color: inherit;
    box-shadow: 0 12px 28px rgba(55,34,14,.26);
    transition: transform .3s ease,border-color .3s ease,box-shadow .3s ease;
}

.item-artwork-card:hover:not(:disabled) {
    transform: translateY(-5px);
    border-color: #f4d47c;
    box-shadow: 0 18px 36px rgba(55,34,14,.34),0 0 20px rgba(244,212,124,.22);
}

.item-artwork-card:focus-visible {
    outline: 3px solid #fff0ad;
    outline-offset: 4px;
}

.item-artwork-card:disabled {
    cursor: default;
}

.item-artwork-image,
.item-artwork-placeholder {
    width: 100%;
    height: 100%;
    min-height: 100%;
    border-radius: 7px;
}

.item-artwork-image {
    position: relative;
    z-index: 2;
    display: block;
    object-fit: cover;
    object-position: center;
    background: #101827;
    transition: transform .45s ease,filter .45s ease;
}

.item-artwork-card:hover:not(:disabled) .item-artwork-image {
    transform: scale(1.025);
    filter: brightness(1.035);
}

.item-artwork-placeholder {
    position: absolute;
    inset: 7px;
    z-index: 1;
    width: calc(100% - 14px);
    height: calc(100% - 14px);
    min-height: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 11px;
    padding: 20px;
    text-align: center;
    background: radial-gradient(circle at 50% 35%,rgba(244,212,124,.18),transparent 42%),linear-gradient(145deg,#182438,#101827);
    color: #ead38d;
}

.item-artwork-placeholder > span {
    font-size: 27px;
    text-shadow: 0 0 14px rgba(244,212,124,.4);
}

.item-artwork-placeholder small {
    font-family: var(--title-font);
    font-size: 12px;
    line-height: 1.5;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.item-artwork-card.is-missing .item-artwork-zoom {
    display: none;
}

.item-artwork-zoom {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 4;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(244,212,124,.65);
    border-radius: 50%;
    background: rgba(16,24,39,.8);
    color: #fff0ad;
    font-size: 18px;
    pointer-events: none;
}

/* =========================================
   FACT PANEL
========================================= */

.item-fact-panel {
    padding: clamp(22px,3vw,30px);
    background: rgba(255,250,229,.75);
    border: 1px solid rgba(111,76,36,.24);
    border-radius: 11px;
    box-shadow: 0 9px 22px rgba(70,45,20,.10);
}

.item-fact-panel h2 {
    position: relative;
    margin: 0 0 20px;
    padding-bottom: 10px;
    font-family: var(--title-font);
    font-size: clamp(25px,3vw,32px);
    color: #65401c;
    border-bottom: 1px solid rgba(139,93,31,.22);
}

.item-fact-panel h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 72px;
    height: 2px;
    background: linear-gradient(90deg,#b8862c,#f4d47c,transparent);
}

.item-meta-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 13px;
}

.item-meta-card {
    position: relative;
    overflow: hidden;
    min-height: 104px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 18px 16px;
    text-align: center;
    background: linear-gradient(145deg,#101827,#182438);
    border: 1px solid rgba(244,212,124,.62);
    border-radius: 10px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.02),0 8px 18px rgba(0,0,0,.20);
    transition: transform .25s ease,border-color .25s ease,box-shadow .25s ease;
}

.item-meta-card:hover {
    transform: translateY(-3px);
    border-color: #f4d47c;
    box-shadow: 0 12px 25px rgba(0,0,0,.25),0 0 14px rgba(244,212,124,.14);
}

.item-meta-card strong {
    display: block;
    margin-bottom: 7px;
    font-family: var(--title-font);
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #e5c46e;
}

.item-meta-card span {
    display: block;
    overflow-wrap: anywhere;
    font-family: var(--title-font);
    font-size: clamp(18px,2vw,22px);
    line-height: 1.2;
    color: #fff0ad;
    text-shadow: 0 0 8px rgba(244,212,124,.18);
}

/* =========================================
   FULL-WIDTH ATLAS PROSE
========================================= */

.item-description-section {
    position: relative;
    z-index: 2;
    margin-top: 30px;
    padding: clamp(25px,3.7vw,38px);
    background: rgba(255,250,229,.88);
    border: 1px solid rgba(198,156,74,.38);
    border-radius: 11px;
    box-shadow: 0 10px 24px rgba(70,45,20,.10);
}

.item-description-section p {
    margin: 0;
    font-family: Georgia,serif;
    font-size: clamp(18px,1.8vw,20px);
    line-height: 1.82;
    color: #493a2d;
}

.item-description-section p + p {
    margin-top: 20px;
}

/* =========================================
   ITEM ARTWORK LIGHTBOX
   Listeners live on removable route DOM only.
========================================= */

.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.image-lightbox.is-open {
    display: flex;
}

.image-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5,10,18,.92);
    backdrop-filter: blur(5px);
}

.image-lightbox-dialog {
    position: relative;
    z-index: 2;
    max-width: min(900px,92vw);
    max-height: 90vh;
    padding: 12px;
    background: linear-gradient(145deg,#d9ad4d,#80531c);
    border: 2px solid #f4d47c;
    border-radius: 14px;
    box-shadow: 0 30px 80px rgba(0,0,0,.65),0 0 28px rgba(244,212,124,.18);
}

.image-lightbox-image {
    display: block;
    max-width: 100%;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 8px;
    background: #101827;
}

.image-lightbox-caption {
    margin: 10px 8px 2px;
    text-align: center;
    font-family: var(--title-font);
    font-size: 18px;
    color: #fff0ad;
}

.image-lightbox-close {
    position: absolute;
    top: -16px;
    right: -16px;
    z-index: 3;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 2px solid #f4d47c;
    border-radius: 50%;
    background: #101827;
    color: #fff0ad;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0,0,0,.35);
}

body.lightbox-open {
    overflow: hidden;
}

/* =========================================
   RESPONSIVE
========================================= */

@media(max-width:800px) {
    .item-visual-row {
        grid-template-columns: minmax(190px,240px) minmax(0,1fr);
        gap: 24px;
    }

    .item-artwork-card {
        align-self: start;
        height: auto;
        max-width: 240px;
    }

    .item-artwork-image {
        height: auto;
        min-height: 0;
        aspect-ratio: 4 / 5;
    }

    .item-meta-grid {
        grid-template-columns: 1fr;
    }

    .item-meta-card {
        min-height: 82px;
    }
}

@media(max-width:620px) {
    .item-title-header {
        text-align: center;
        margin-bottom: 24px;
    }

    .item-title-header .item-type {
        font-size: clamp(15px,4.5vw,18px);
        letter-spacing: 1.8px;
    }

    .item-title-header h1 {
        font-size: clamp(44px,14vw,64px);
    }

    .item-visual-row {
        grid-template-columns: 1fr;
    }

    .item-artwork-card {
        width: min(230px,76vw);
        margin-inline: auto;
    }

    .item-meta-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }

    .item-meta-card {
        min-height: 92px;
        padding: 15px 11px;
    }

    .item-meta-card span {
        font-size: 17px;
    }

    .item-description-section {
        padding: 23px 18px;
    }

    .image-lightbox {
        padding: 18px;
    }

    .image-lightbox-close {
        top: -11px;
        right: -11px;
    }
}

@media(max-width:420px) {
    .item-meta-grid {
        grid-template-columns: 1fr;
    }
}

@media(prefers-reduced-motion:reduce) {
    .item-artwork-card,
    .item-artwork-image,
    .item-meta-card {
        transition: none;
    }
}