/* Listing cards and the homepage filter row, in the mem0 design language.

   Lives here rather than in main.css because existing template-asset URLs
   pin stale at the origin (see docs); a fresh filename serves fresh bytes.
   Superblog only auto-links its fixed list of names, so partials/nav.html
   links this by hand, guarded on assetsUrl. The pcard-* names are fresh for
   the same reason: the stale main.css still carries the old .card rules.

   Flat selectors only — the upload pipeline has dropped nested (&) rules. */

/* ── Header ─────────────────────────────────────────────────────
   Bigger and tighter than the stale main.css hero, centred, with the
   caption on one quiet line under it. */
.hero { padding: 4.5rem var(--pad) 3.5rem; }
.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    line-height: 1.05;
    letter-spacing: -0.045em;
    max-width: 20ch;
}
.hero p {
    max-width: 52ch;
    font-size: 1.0625rem;
    line-height: 1.5;
}

/* ── Filter row ─────────────────────────────────────────────────
   Categories left, search right. */
.m-bar {
    max-width: var(--wide);
    margin: 0 auto;
    padding: 0 var(--pad) 2.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

/* Plain text, no border and no background — only the active one is filled.
   That restraint is what keeps the row light. */
.cats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}
.cats a {
    padding: 0.4375rem 0;
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--ink-soft);
    text-decoration: none;
    transition: color 0.15s ease;
}
.cats a:hover { color: var(--ink); }
.cats a[aria-current] {
    background: var(--ink);
    color: #ffffff;
    padding: 0.4375rem 0.75rem;
    border-radius: 0.375rem;
}

.m-search { position: relative; flex: none; width: 16rem; }
.m-search svg {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: var(--ink-faint);
    pointer-events: none;
}
.m-search input {
    width: 100%;
    height: 2.5rem;
    padding: 0 0.875rem 0 2.375rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--ink);
    outline: none;
    transition: border-color 0.2s ease;
}
.m-search input::placeholder { color: var(--ink-faint); }
.m-search input:focus { border-color: rgba(38, 34, 40, 0.28); }

/* ── The grid ───────────────────────────────────────────────────
   Two across, wide gutters. The cards carry no fill, so the space between
   them is doing the separating and has to be generous. */
.posts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 3rem;
    row-gap: 3.5rem;
    padding-bottom: 5rem;
}

.pcard a {
    display: block;
    text-decoration: none;
    color: inherit;
}
.pcard-shot {
    display: block;
    overflow: hidden;
    border-radius: 0.25rem;
    background: var(--paper-soft);
}
.pcard-image {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.pcard a:hover .pcard-image { transform: scale(1.03); }
.pcard-image-empty {
    display: block;
    aspect-ratio: 16 / 9;
    background: var(--paper-soft);
}

.pcard h2 {
    margin: 1.375rem 0 0;
    font-size: 1.3125rem;
    font-weight: 500;
    line-height: 1.34;
    letter-spacing: -0.024em;
}
.pcard a:hover h2 { color: var(--ink-soft); }

.pcard-meta {
    margin-top: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.875rem;
    color: var(--ink-faint);
}
.pcard-meta .sep { opacity: 0.6; }

.posts-empty {
    max-width: var(--wide);
    margin: 0 auto;
    padding: 0 var(--pad) 6rem;
    font-size: 0.9375rem;
    color: var(--ink-soft);
}

@media (max-width: 767px) {
    .hero { padding: 3rem var(--pad) 2.25rem; }
    .posts {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 2.75rem;
    }
    .m-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 1.125rem;
    }
    .m-search { width: 100%; }
    /* The row scrolls sideways rather than wrapping to three lines. */
    .cats {
        gap: 1.125rem;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .cats::-webkit-scrollbar { display: none; }
    .cats a { white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
    .pcard-image { transition: none; }
    .pcard a:hover .pcard-image { transform: none; }
}
