/* Editorial listing style (JamesEdition-inspired): wide image cards, serif prices, hairline rules.
   Shared by the public site and the admin listing list so both read as one product.
   Loaded AFTER bootstrap; every rule here is namespaced .je-* so nothing existing is overridden. */

:root {
    --je-ink: #14110f;
    --je-muted: #7d7770;
    --je-hairline: #e4e0d9;
    --je-paper: #fbfaf8;
    --je-brass: #8a7250;
    --je-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
}

.je-page {
    background: var(--je-paper);
}

.je-eyebrow {
    font-family: 'Poppins', sans-serif;
    font-size: .68rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--je-muted);
    font-weight: 500;
}

.je-heading {
    font-family: var(--je-serif);
    font-weight: 500;
    letter-spacing: -.01em;
    color: var(--je-ink);
}

/* ---- the card ---- */
.je-grid {
    display: grid;
    /* Three across on a wide screen (the view-all page is a wall of listings, not a two-up editorial
       spread). minmax(0, 1fr) everywhere so a card can shrink below its image's min-content width. */
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.5rem 1.75rem;
}

@media (max-width: 1199.98px) {
    .je-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
    .je-grid { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
}

.je-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: transparent;
}

.je-card-media {
    /* An <a> is inline by default, and an inline box ignores aspect-ratio: the picture area would
       collapse to 0px and the photo would vanish behind it. It must be a block. */
    display: block;
    position: relative;
    overflow: hidden;
    background: #ece8e2;
    aspect-ratio: 16 / 10;
}

.je-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .6s cubic-bezier(.2,.6,.2,1);
}

/* Every photo sits in the same box; Alpine shows one at a time. */
.je-card-img {
    position: absolute;
    inset: 0;
}

.je-card:hover .je-card-media img {
    transform: scale(1.035);
}

/* photo arrows: quiet, only on the image, never a link */
.je-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.92);
    color: var(--je-ink);
    font-size: 1rem;
    line-height: 1;
    box-shadow: 0 2px 10px rgba(0,0,0,.18);
    opacity: 0;
    transition: opacity .2s ease, background .2s ease;
    cursor: pointer;
}

.je-nav--prev { left: .6rem; }
.je-nav--next { right: .6rem; }

.je-card:hover .je-nav,
.je-card-media:focus-within .je-nav { opacity: 1; }

.je-nav:hover { background: #fff; }

/* Phones have no hover: keep the arrows visible, and make them big enough to hit. */
@media (hover: none) {
    .je-nav { opacity: 1; width: 40px; height: 40px; }
}

.je-card-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b8b0a5;
    font-size: 2rem;
}

/* Shown only when the photo files are missing or fail to load (onerror adds .je-media--failed). */
.je-media-fallback {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    color: #b8b0a5;
    font-size: 1.6rem;
    background: #ece8e2;
}

.je-media-fallback span {
    font-size: .7rem;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.je-media--failed .je-media-fallback {
    display: flex;
}

.je-media-failed .je-nav,
.je-media--failed .je-nav,
.je-media--failed .je-photo-count {
    display: none !important;
}

/* badges: top-left, tiny, letterspaced, not pill-shaped */
.je-badge {
    position: absolute;
    top: 0;
    left: 0;
    padding: .4rem .75rem;
    font-family: 'Poppins', sans-serif;
    font-size: .62rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    background: #fff;
    color: var(--je-ink);
}

.je-badge--alert { background: var(--je-ink); color: #fff; }
.je-badge--brass { background: var(--je-brass); color: #fff; }

.je-photo-count {
    position: absolute;
    right: .6rem;
    bottom: .6rem;
    padding: .15rem .5rem;
    font-size: .7rem;
    color: #fff;
    background: rgba(20,17,15,.55);
    backdrop-filter: blur(2px);
}

.je-card-body {
    padding-top: .9rem;
    border-bottom: 1px solid var(--je-hairline);
    padding-bottom: 1.1rem;
}

.je-price {
    font-family: var(--je-serif);
    font-size: 1.55rem;
    line-height: 1.1;
    color: var(--je-ink);
    letter-spacing: .01em;
}

.je-price del {
    font-size: .95rem;
    color: var(--je-muted);
    margin-left: .4rem;
}

.je-specs {
    margin-top: .35rem;
    font-size: .82rem;
    color: var(--je-muted);
}

.je-specs span + span::before {
    content: "·";
    margin: 0 .45rem;
    color: #c9c2b7;
}

.je-place {
    margin-top: .3rem;
    font-size: .9rem;
    color: var(--je-ink);
}

.je-title {
    margin-top: .15rem;
    font-size: .82rem;
    color: var(--je-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- the search filter bar: labels above the fields, two columns on a phone ---- */
.je-filter {
    background: #fff;
    border: 1px solid var(--je-hairline);
    padding: 1.1rem 1.15rem;
}

.je-filter-label {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-size: .62rem;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--je-muted);
    font-weight: 600;
    margin-bottom: .3rem;
}

.je-filter .form-control,
.je-filter .form-select {
    border-radius: 0;
    border-color: #ddd8d0;
    font-size: .875rem;
    padding: .5rem .65rem;
}

.je-filter .form-control:focus,
.je-filter .form-select:focus {
    border-color: var(--je-ink);
    box-shadow: 0 0 0 1px var(--je-ink);
}

.je-filter .btn {
    border-radius: 0;
    font-size: .78rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    font-weight: 600;
    padding: .55rem 1.4rem;
}

.je-filter-reset {
    font-size: .78rem;
    color: var(--je-muted);
    text-decoration: underline;
}

.je-filter-reset:hover { color: var(--je-ink); }

/* ---- admin: same language, but a work table that keeps every column ---- */
.je-admin-table {
    font-size: .875rem;
}

.je-admin-table thead th {
    font-family: 'Poppins', sans-serif;
    font-size: .64rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--je-muted);
    background: transparent;
    border-bottom: 1px solid var(--je-hairline);
    border-top: none;
    white-space: nowrap;
}

.je-admin-table tbody td {
    border-color: var(--je-hairline);
    vertical-align: middle;
    padding-top: .85rem;
    padding-bottom: .85rem;
}

.je-admin-table tbody tr:hover {
    background: #f6f4f0;
}

.je-thumb {
    width: 84px;
    height: 56px;
    object-fit: cover;
    display: block;
    background: #ece8e2;
}

.je-thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b8b0a5;
    font-size: .9rem;
}

.je-admin-table .je-price {
    font-size: 1.05rem;
}

.je-admin-table .btn {
    border-radius: 0;
    font-size: .72rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}
