/* ===== JMPO-inspired palette (light, friendly, teal accent) ===== */
:root {
    --bg: #ffffff;
    --text: #263238;
    /* deep gray-blue */
    --muted: #607d8b;
    /* slate */
    --border: #e7eaee;
    /* soft gray border */
    --card: #ffffff;
    /* white cards */
    --stripe: #fafbfc;
    /* zebra row */
    --accent: #15959b;
    /* teal accent */
    --accent-2: #20a8ae;
    /* hover/stronger teal */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .06);
    --shadow-md: 0 6px 18px rgba(17, 24, 39, .08);
    --radius: 8px;
    --surface: #ffffff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    /* Soft, premium shadow */
}

/* ===== Base ===== */
* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main#app-root {
    max-width: 1100px;
    margin: 28px auto 64px;
    padding: 0 18px;
}

/* ===== Layout ===== */
.gallery {
    max-width: 1100px;
    margin: 24px auto 64px;
    padding: 0 18px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    /* two columns */
    gap: 32px 56px;
    /* row, column gaps */
}

.card {
    display: grid;
    grid-template-columns: 140px 1fr;
    /* thumb | content */
    column-gap: 18px;
    align-items: stretch;
    padding: 8px;
    border-radius: 10px;
    box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
    min-height: fit-content;
}

/* ===== Thumbnail ===== */
.card .imgwrap {
    display: block;
    width: 140px;
    height: 110px;
    border: 3px solid #111;
    /* bold border like your sketch */
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.card .thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
}

/* Optional zoom overlay if you already toggle .zoomed via JS */
.card .thumb.zoomed {
    position: fixed;
    z-index: 10001;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    height: min(88vh, 1100px);
    max-width: 92vw;
    border: 1px solid #e3e7ed;
    border-radius: 10px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
    cursor: zoom-out;
}

body:has(.thumb.zoomed)::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .6);
    z-index: 10000;
}

/* ===== Text stack ===== */
.meta {
    line-height: 1.35;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
}

.meta .top {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-weight: 600;
}

.meta .title {
    font-size: 1.05rem;
    color: #263238;
    flex: 1 1 auto;
}

.meta .price {
    font-size: 1.0rem;
    color: #263238;
    white-space: nowrap;
}

.meta .desc {
    margin-top: 4px;
    color: #607d8b;
    /* slate */
    font-size: 0.96rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.meta .hold {
    display: inline-block;
    margin-top: auto;
    font-weight: 700;
    color: #15959b;
    /* teal accent */
    text-decoration: none;
}

.meta .hold:hover {
    color: #20a8ae;
    text-decoration: underline;
}

/* ===== Unavailable styling (if you show sold/pending) ===== */
.card.is-sold .thumb {
    opacity: .5;
    filter: grayscale(60%);
}

.card.is-sold .meta .title {
    text-decoration: line-through;
    color: #90a4ae;
}

.card.is-sold .meta .hold {
    display: none;
}

/* ===== Responsive ===== */
@media (max-width: 820px) {
    .gallery {
        grid-template-columns: 1fr;
        gap: 28px 0;
    }
}

#loginPage {
    max-width: 400px;
    margin: 100px auto;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    text-align: center;
}

#btn-login {
    appearance: none;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #15959b;
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    transition: background-color .2s ease, border-color .2s ease;
}

/* Thumbnail wrapper (optional polish) */
.imgwrap {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 12px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
}

.imgwrap .thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Lightbox overlay (toggled via .visible class) */
.lightbox {
    position: fixed;
    inset: 0;
    display: flex;
    /* we'll “hide” it with visibility/opacity */
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;

    /* hidden by default */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 150ms ease, visibility 0s linear 150ms;
}

/* When visible class is added, show it */
.lightbox.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 150ms ease;
}

/* Lock page scroll while open (modern browsers) */
html:has(.lightbox.visible) {
    overflow: hidden;
}

/* Frame + image sizing */
.lightbox .frame {
    max-width: 96vw;
    max-height: 96vh;
}

.lightbox .frame img {
    display: block;
    max-width: 100%;
    max-height: 96vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

/* Optional close button (if you add one) */
.lightbox .close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    text-decoration: none;
    font-size: 2rem;
    line-height: 1;
    color: #fff;
    opacity: 0.9;
}

.lightbox .close:hover {
    opacity: 1;
}

/* ===== Links & accents (teal) ===== */
a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-2);
    text-decoration: underline;
}

/* ===== Login UI ===== */
.login-container {
    padding: 2.5rem;
    max-width: 400px;
    margin: 4rem auto;
    text-align: center;
    font-family: system-ui, -apple-system, sans-serif;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.login-heading {
    margin: 0 0 1.5rem 0;
    color: #333;
    font-size: 1.75rem;
}

.login-error {
    background: #fee;
    color: #c00;
    padding: 1rem;
    border-radius: 4px;
    margin: 0 0 1.5rem 0;
    border: 1px solid #fcc;
}

.login-button {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    cursor: pointer;
    background: #635dff;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background 0.2s;
    width: 100%;
}

.login-button:hover {
    background: #5348e0;
}