/* listings.css — browse page, purple design system (loaded via pageCss) */

:root {
    --lp-purple: #6f35d4;
    --lp-purple-dark: #5b28b8;
    --lp-purple-pale: #efe5ff;
    --lp-ink: #241438;
    --lp-muted: #625276;
    --lp-border: #eadff8;
    --lp-card-shadow: 0 12px 28px rgba(80, 45, 130, 0.07);
    --cat-food-bg: #FFEDD5;      --cat-food-fg: #EA580C;
    --cat-academic-bg: #DCFCE7;  --cat-academic-fg: #16A34A;
    --cat-services-bg: #DBEAFE;  --cat-services-fg: #2563EB;
    --cat-lifestyle-bg: #FCE7F3; --cat-lifestyle-fg: #DB2777;
}

body.listings-page {
    background:
        radial-gradient(circle at top right, #eadcff 0, transparent 28rem),
        linear-gradient(180deg, #fff 0%, #fbf9ff 48%, #fff 100%);
    color: var(--lp-ink);
}
body.listings-page header {
    background: rgba(255, 255, 255, 0.94);
    border-bottom-color: var(--lp-border);
}
body.listings-page .site-name { color: #2d164c; }
body.listings-page header nav a { color: var(--lp-purple); }
body.listings-page main { max-width: 72rem; padding: 2rem 1rem 3rem; }

/* --- Hero --------------------------------------------------------- */

.listings-hero { margin-bottom: 1.5rem; }
.page-label {
    margin: 0 0 0.35rem;
    color: var(--lp-purple);
    font-size: 0.85rem;
    font-weight: 700;
}
.listings-hero h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3rem);
    color: var(--lp-ink);
    line-height: 1.15;
}
.page-subhead { margin: 0.5rem 0 0; color: var(--lp-muted); line-height: 1.6; }

/* --- Search bar --------------------------------------------------- */

.search-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: none;
    margin: 0 0 1rem;
    padding: 0.35rem 0.35rem 0.35rem 1rem;
    background: #fff;
    border: 1px solid var(--lp-border);
    border-radius: 999px;
    box-shadow: var(--lp-card-shadow);
}
.search-bar-icon { flex: none; width: 1.25rem; height: 1.25rem; color: var(--lp-muted); }
.search-bar-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-size: 1rem;
    color: var(--lp-ink);
    padding: 0.55rem 0;
}
.search-bar-submit {
    flex: none;
    border: none;
    border-radius: 999px;
    background: var(--lp-purple);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    min-height: 2.5rem;
    cursor: pointer;
}
.search-bar-submit:hover { background: var(--lp-purple-dark); }

/* --- Category pills ----------------------------------------------- */

.category-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.category-pill {
    display: inline-block;
    padding: 0.4rem 0.95rem;
    border: 1px solid var(--lp-border);
    border-radius: 999px;
    background: #fff;
    color: var(--lp-muted);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
}
.category-pill.cat-food,
.listing-card-badge.cat-food { background: var(--cat-food-bg); color: var(--cat-food-fg); }
.category-pill.cat-academic,
.listing-card-badge.cat-academic { background: var(--cat-academic-bg); color: var(--cat-academic-fg); }
.category-pill.cat-services,
.listing-card-badge.cat-services { background: var(--cat-services-bg); color: var(--cat-services-fg); }
.category-pill.cat-lifestyle,
.listing-card-badge.cat-lifestyle { background: var(--cat-lifestyle-bg); color: var(--cat-lifestyle-fg); }
.category-pill.cat-food,
.category-pill.cat-academic,
.category-pill.cat-services,
.category-pill.cat-lifestyle { border-color: transparent; }
.category-pill:hover { filter: brightness(0.97); }
.category-pill.is-active {
    background: var(--lp-purple);
    color: #fff;
    border-color: var(--lp-purple);
}

/* --- Publish CTA -------------------------------------------------- */

.listings-publish { margin: 0 0 1.5rem; }
.listings-publish .btn {
    border-radius: 999px;
    background: var(--lp-purple);
    border-color: var(--lp-purple);
}
.listings-publish .btn:hover {
    background: var(--lp-purple-dark);
    border-color: var(--lp-purple-dark);
}

/* --- Listings grid ------------------------------------------------ */

.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.listing-card {
    display: block;
    color: inherit;
    text-decoration: none;
    background: #fff;
    border: 1px solid var(--lp-border);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--lp-card-shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.listing-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(80, 45, 130, 0.12);
}
.listing-card-photo {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f4f0fb;
}
.listing-card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.listing-card-photo-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c7b8e6;
}
.listing-card-photo-empty svg { width: 38%; height: 38%; }
.listing-card-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    background: var(--lp-purple-pale);
    color: var(--lp-purple);
    font-size: 0.72rem;
    font-weight: 600;
}
.listing-card-body { padding: 1rem; }
.listing-card-title {
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
    line-height: 1.3;
    color: var(--lp-ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.listing-card-price { margin: 0 0 0.3rem; font-size: 1.2rem; font-weight: 700; color: var(--lp-ink); }
.listing-card-meta { margin: 0; font-size: 0.83rem; color: var(--lp-muted); }

/* --- Empty states ------------------------------------------------- */

.empty-state { max-width: 30rem; margin: 4rem auto; padding: 2rem; text-align: center; }
.empty-state-icon { width: 64px; height: 64px; margin-bottom: 1rem; }
.empty-state-title { margin: 0 0 0.5rem; font-size: 1.25rem; font-weight: 700; color: var(--lp-ink); }
.empty-state-text { margin: 0 0 1.25rem; color: var(--lp-muted); line-height: 1.6; }
.empty-state-cta {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    border-radius: 999px;
    background: var(--lp-purple);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}
.empty-state-cta:hover { background: var(--lp-purple-dark); }

/* --- Pagination --------------------------------------------------- */

.pagination { display: flex; justify-content: center; align-items: center; gap: 1rem; margin: 2rem auto; }
.pagination-link {
    padding: 0.5rem 1.1rem;
    border: 1px solid var(--lp-border);
    border-radius: 999px;
    color: var(--lp-ink);
    text-decoration: none;
    font-size: 0.9rem;
}
.pagination-link:hover { border-color: var(--lp-purple); color: var(--lp-purple); }
.pagination-current { color: var(--lp-purple); font-weight: 600; font-size: 0.9rem; }

/* --- Mobile ------------------------------------------------------- */

@media (max-width: 600px) {
    body.listings-page main { padding: 1.5rem 1rem 2.5rem; }
    .listings-hero h1 { font-size: 1.75rem; }
    .listings-grid { grid-template-columns: 1fr; }
    .search-bar { padding-left: 0.85rem; }
    .search-bar-input { padding: 0.5rem 0; }
    .search-bar-submit { padding: 0.55rem 1rem; }
    .empty-state { margin: 2.5rem auto; padding: 1.25rem; }
}
