/* Shop selling layer: hero facts, section headings in the grid, calmer filters,
   and the painting-page blocks generated by scripts/sync-shop-selling.cjs. */

/* ---------- Shop page: opening facts ---------- */
body.shop-page .shop-hero-facts {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem 0;
    margin: 1.5rem 0 0;
    padding: 0;
    list-style: none;
    font-family: var(--hui-font-body, Jost, system-ui, sans-serif);
    font-size: 12.5px;
    letter-spacing: .08em;
    text-transform: uppercase;
    line-height: 1.5;
    color: #DCB870;
}
body.shop-page .shop-hero-facts li { display: inline-flex; align-items: center; }
body.shop-page .shop-hero-facts li + li::before {
    content: "";
    width: 4px;
    height: 4px;
    margin: 0 .85rem;
    border-radius: 50%;
    background: rgba(220, 184, 112, .6);
}
body.shop-page .shop-gallery-hero-actions { margin-top: 1.9rem; }

/* ---------- Shop page: section headings inside the grid ---------- */
body.shop-page .shop-all-grid > .shop-grid-heading {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .35rem 1.4rem;
    padding: 0 0 1.05rem;
    border-bottom: 1px solid rgba(38, 23, 31, .16);
    margin-bottom: calc(-1 * clamp(1.2rem, 2.4vw, 2.8rem));
}
body.shop-page .shop-all-grid > .shop-grid-heading ~ .shop-grid-heading {
    margin-top: clamp(1.2rem, 3vw, 3rem);
}
body.shop-page .shop-grid-heading-title {
    margin: 0;
    font-family: var(--hui-font-heading, "Playfair Display", Georgia, serif);
    font-weight: 500;
    font-size: clamp(1.75rem, 2.6vw, 2.45rem);
    line-height: 1.1;
    letter-spacing: 0;
    color: #26171F;
}
body.shop-page .shop-grid-heading-note {
    margin: 0;
    font-family: var(--hui-font-body, Jost, system-ui, sans-serif);
    font-size: 13.5px;
    line-height: 1.55;
    color: #5d5a55;
}

/* ---------- Shop page: filters stay out of the way ---------- */
@media (min-width: 901px) {
    body.shop-page .shop-filter-panel {
        position: static;
        display: grid;
        grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
        gap: .7rem 2.4rem;
        align-items: start;
        margin-bottom: 2.6rem;
    }
    body.shop-page .shop-filter-panel .shop-clear-filters { grid-column: 1 / -1; justify-self: start; }
}
body.shop-page .shop-filter-panel .shop-filter-label,
body.shop-page .shop-filter-panel button { font-size: 12px; }

@media (max-width: 640px) {
    body.shop-page .shop-hero-facts {
        display: grid;
        grid-template-columns: 1fr;
        gap: .5rem;
        font-size: 12px;
    }
    body.shop-page .shop-hero-facts li + li::before { content: none; }
    body.shop-page .shop-hero-facts li::before,
    body.shop-page .shop-hero-facts li + li::before {
        content: "";
        flex: none;
        width: 14px;
        height: 1px;
        margin: 0 .7rem 0 0;
        border-radius: 0;
        background: rgba(220, 184, 112, .7);
    }
    body.shop-page .shop-all-grid > .shop-grid-heading { scroll-margin-top: 150px; }
}

/* ====================================================================
   Painting page
   ==================================================================== */
@view-transition { navigation: auto; }
::view-transition-group(painting-main) { animation-duration: .62s; animation-timing-function: cubic-bezier(.2, .7, .2, 1); }
::view-transition-old(painting-main), ::view-transition-new(painting-main) { height: 100%; object-fit: contain; }
body.pp-page #painting-main-image { view-transition-name: painting-main; }

/* --- One frame for every photograph ---
   The whole painting sits on a mat, as an object. Details and the room view fill the
   same frame edge to edge, so nothing jumps and a close-up never looks like a framed thing. */
body.shop-viewing-page.pp-page:not(.shop-page) .shop-modal-image-wrap {
    position: relative;
    display: grid;
    grid-template-columns: 100%;
    grid-template-rows: 100%;
    place-items: center;
    aspect-ratio: 3 / 4;
    width: 100%;
    padding: clamp(12px, 3.2vw, 52px);
    overflow: hidden;
    background: linear-gradient(180deg, #F4EFE5 0%, #EFE8DB 100%);
    transition: padding .5s cubic-bezier(.2, .7, .2, 1);
}
body.shop-viewing-page.pp-page:not(.shop-page) .shop-modal-image {
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: none;   /* the shop is shadow-free (owner's request, 23 Nov 2026) */
    transition: opacity .5s ease;
}
body.pp-page .shop-modal-image.is-swapping { opacity: 0; transition: none; }
body.shop-viewing-page.pp-page:not(.shop-page) .shop-modal-image-wrap:is(.is-detail, .is-room) { padding: 0; }
body.shop-viewing-page.pp-page:not(.shop-page) .shop-modal-image-wrap:is(.is-detail, .is-room) .shop-modal-image {
    /* brand.css pins width in a layer; min- sizes still stretch the photo to the frame. */
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    box-shadow: none;
}
body.shop-viewing-page.pp-page .shop-modal-image-wrap[data-view]:not([data-view=""])::after {
    content: attr(data-view);
    position: absolute;
    left: 12px;
    bottom: 12px;
    padding: .38rem .7rem;
    background: rgba(28, 24, 20, .72);
    color: #FBF9F4;
    font-family: var(--hui-font-body, Jost, system-ui, sans-serif);
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
    line-height: 1.3;
}

body.pp-page .painting-thumbs { gap: 12px; margin-top: 16px; }
body.pp-page .painting-thumb {
    position: relative;
    border: 0;
    padding: 0 0 8px;
    opacity: .62;
    transition: opacity .3s ease;
}
body.pp-page .painting-thumb::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: #8a6d2f;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform .45s cubic-bezier(.2, .7, .2, 1);
}
body.pp-page .painting-thumb:hover, body.pp-page .painting-thumb:focus-visible { opacity: 1; }
body.pp-page .painting-thumb.is-active { opacity: 1; border-color: transparent; }
body.pp-page .painting-thumb.is-active::after { transform: scaleX(1); }
body.pp-page .painting-thumb img { width: 64px; height: 80px; }

/* --- Words --- */
body.shop-viewing-page.pp-page .shop-modal-title {
    font-size: clamp(2.15rem, 3.5vw, 3.35rem);
    line-height: 1.04;
    letter-spacing: -.012em;
    margin: .55rem 0 .7rem;
    text-wrap: balance;
}
body.shop-viewing-page .pp-origin {
    margin: .5rem 0 0;
    font-family: var(--hui-font-heading, "Playfair Display", Georgia, serif);
    font-style: italic;
    font-size: 1.08rem;
    line-height: 1.4;
    color: #67565E;
}
body.shop-viewing-page.pp-page .shop-modal-price {
    margin: 1.5rem 0 1.15rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(38, 23, 31, .14);
    font-family: var(--hui-font-heading, "Playfair Display", Georgia, serif);
    font-size: 1.7rem;
    font-weight: 400;
    line-height: 1.1;
}
body.shop-viewing-page.pp-page .shop-modal-purchase {
    min-height: 58px;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-size: 12.5px;
    transition: background-color .35s ease, letter-spacing .45s cubic-bezier(.2, .7, .2, 1);
}
body.shop-viewing-page.pp-page .shop-modal-purchase:hover,
body.shop-viewing-page.pp-page .shop-modal-purchase:focus-visible { letter-spacing: .16em; }

/* The ledger below says all of this once, in plain words. */
body.shop-viewing-page.pp-on .shop-modal-cost-note,
body.shop-viewing-page.pp-on .shop-acquisition-trust,
body.shop-viewing-page.pp-on .shop-modal-presentation-block,
body.shop-viewing-page.pp-on .shop-modal-assurance { display: none; }

body.shop-viewing-page .pp-selling { display: grid; gap: 1.5rem; margin: 1.1rem 0 0; }
body.shop-viewing-page .pp-assure {
    margin: 0;
    text-align: center;
    font-size: 12.5px;
    line-height: 1.5;
    color: #67565E;
}
body.shop-viewing-page .pp-ledger {
    margin: .4rem 0 0;
    border-top: 1px solid rgba(38, 23, 31, .14);
    font-family: var(--hui-font-body, Jost, system-ui, sans-serif);
}
body.shop-viewing-page .pp-ledger > div {
    display: grid;
    grid-template-columns: 6.6rem minmax(0, 1fr);
    gap: 1rem;
    padding: .82rem 0;
    border-bottom: 1px solid rgba(38, 23, 31, .14);
}
body.shop-viewing-page .pp-ledger dt {
    margin: 0;
    font-size: 11.5px;
    letter-spacing: .14em;
    text-transform: uppercase;
    line-height: 1.75;
    color: #67565E;
}
body.shop-viewing-page .pp-ledger dd {
    margin: 0;
    color: #26171F;
    font-size: 14.5px;
    line-height: 1.55;
}
body.shop-viewing-page .pp-ledger a,
body.shop-viewing-page .pp-ledger a span {
    color: #26171F;
    text-decoration: underline;
    text-decoration-color: rgba(138, 109, 47, .75);
    text-underline-offset: 3px;
    transition: text-decoration-color .3s ease;
}
body.shop-viewing-page .pp-ledger a:hover,
body.shop-viewing-page .pp-ledger a:focus-visible { text-decoration-color: #26171F; }

body.shop-viewing-page .pp-room { margin: .4rem 0 0; }
body.shop-viewing-page .pp-room img { display: block; width: 100%; max-width: 460px; height: auto; }
body.shop-viewing-page .pp-room figcaption {
    margin-top: .6rem;
    max-width: 460px;
    font-size: 12.5px;
    line-height: 1.5;
    color: #67565E;
}
body.shop-viewing-page.pp-page .shop-modal-description { font-size: 15.5px; line-height: 1.75; max-width: 36em; }

/* --- Laptop: the painting stays in view while the details scroll --- */
@media (min-width: 960px) {
    body.shop-viewing-page.pp-page:not(.shop-page) .shop-modal-dialog {
        grid-template-columns: minmax(0, 1.18fr) minmax(360px, .82fr);
        gap: 32px clamp(40px, 5.5vw, 88px);
    }
    body.shop-viewing-page.pp-page:not(.shop-page) .shop-viewer-visual {
        position: sticky;
        top: calc(var(--header-height, 64px) + 20px);
    }
    /* A 4:5 frame that always fits the screen height. */
    body.shop-viewing-page.pp-page:not(.shop-page) .shop-modal-image-wrap {
        aspect-ratio: 4 / 5;
        width: min(100%, calc(min(80vh, 900px) * .8));
        margin-inline: auto;
    }
    body.shop-viewing-page.pp-page:not(.shop-page) .painting-thumbs { justify-content: center; }
}

/* --- Arrival, with the house motion (brand.css): the details rise one step apart; the painting
   and its thumbnails fade in where they hang and never move. --- */
@media (prefers-reduced-motion: no-preference) {
    html.pp-motion body.pp-page .shop-modal-image-wrap { animation: huiFadeIn 1s var(--hui-motion-ease) both; }
    html.pp-motion body.pp-page .shop-modal-info > * { animation: huiRise var(--hui-motion-slow) var(--hui-motion-ease) calc(.1s + 3 * var(--hui-motion-step)) both; }
    html.pp-motion body.pp-page .shop-modal-info > :nth-child(1) { animation-delay: .1s; }
    html.pp-motion body.pp-page .shop-modal-info > :nth-child(2) { animation-delay: calc(.1s + var(--hui-motion-step)); }
    html.pp-motion body.pp-page .shop-modal-info > :nth-child(3) { animation-delay: calc(.1s + 2 * var(--hui-motion-step)); }
    html.pp-motion body.pp-page .painting-thumb { animation: huiFadeIn var(--hui-motion-slow) var(--hui-motion-ease) .25s both; }
}
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* --- Phone buy bar: price and button always within reach --- */
body.shop-viewing-page .pp-buybar { display: none; }
@media (max-width: 760px) {
    body.shop-viewing-page .pp-buybar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 80;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: .7rem 16px calc(.7rem + env(safe-area-inset-bottom, 0px));
        background: #FBF9F4;
        border-top: 1px solid rgba(38, 23, 31, .16);
        box-shadow: 0 -6px 22px rgba(38, 23, 31, .08);
    }
    body.shop-viewing-page .pp-buybar-price {
        margin: 0;
        min-width: 0;
        font-family: var(--hui-font-heading, "Playfair Display", Georgia, serif);
        font-size: 1.4rem;
        line-height: 1.1;
        color: #26171F;
    }
    body.shop-viewing-page .pp-buybar-title {
        display: block;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        font-family: var(--hui-font-body, Jost, system-ui, sans-serif);
        font-size: 11.5px;
        letter-spacing: .04em;
        color: #67565E;
    }
    body.shop-viewing-page .pp-buybar-action {
        flex: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 46px;
        padding: 0 1.7rem;
        border-radius: 999px;
        background: #66023C;
        text-decoration: none;
        font-size: 14px;
        font-weight: 500;
        letter-spacing: .02em;
    }
    body.shop-viewing-page .pp-buybar-action span { color: #FBF9F4; }
    body.shop-viewing-page.pp-on { padding-bottom: 76px; }
    body.shop-viewing-page .pp-ledger > div { grid-template-columns: 5.6rem minmax(0, 1fr); gap: .8rem; }
}

/* Paintings in the listing carry no shadow (owner's request, 23 Nov 2026). */
body.shop-page .shop-gallery-card .shop-card-image-wrap {
  filter: none;
}

/* Holding a finger on a painting (iPhone and iPad) selected the picture, which Safari draws as a
   dark grey veil that stays after the finger lifts, and opened the long-press menu. A painting is
   for looking at and tapping, so it cannot be selected or long-pressed into a menu. */
body.shop-page .shop-gallery-card .shop-card-trigger,
body.shop-page .shop-gallery-card .shop-card-image,
body.shop-viewing-page .shop-modal-image,
body.shop-viewing-page .painting-thumb img {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
