/* ── Filter Bar ─────────────────────────────────────────── */
.filter-bar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    position: sticky;
    top: 68px;
    z-index: 50;
    backdrop-filter: blur(8px);
}
.category-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    margin-bottom: 12px;
}
.category-pill {
    flex-shrink: 0;
    font-size: .82rem;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--ink-3);
    transition: all .15s;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
}
.category-pill.active,
.category-pill:hover {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

/* ── Search ─────────────────────────────────────────────── */
.search-wrap {
    position: relative;
    width: 100%;
}
.search-wrap svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ink-4);
    pointer-events: none;
}
.search-input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    font-size: .875rem;
    font-family: 'DM Sans', sans-serif;
    background: var(--surface-2);
    color: var(--ink);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.search-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(232,72,85,.1);
    background: var(--surface);
}

/* ── Stories Grid ───────────────────────────────────────── */
.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px,1fr));
    gap: 20px;
}
.story-card-wrap { text-decoration: none; }

/* ── Story Card ─────────────────────────────────────────── */
.story-card-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--surface-3);
}
.story-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.story-card-img:hover { transform: scale(1.06); }

.story-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fef2f2, #fff);
}

.story-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0,0,0,.55) 0%, transparent 55%);
}
.story-card-badge-wrap {
    position: absolute;
    bottom: 10px;
    left: 12px;
}
.story-card-badge {
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    background: var(--brand);
    color: #fff;
    padding: 3px 9px;
    border-radius: 4px;
}
.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,.18);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid rgba(255,255,255,.35);
    opacity: 0;
    transition: opacity .2s;
}
.card:hover .play-icon { opacity: 1; }

.story-card-body { padding: 16px; }
.story-card-title {
    font-size: .925rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.4;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.story-card-movie {
    font-size: .75rem;
    color: var(--brand);
    font-weight: 600;
    margin-bottom: 8px;
}
.story-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .72rem;
    color: var(--ink-4);
}
.story-card-views {
    display: flex;
    align-items: center;
    gap: 3px;
}

/* ── Results Label ──────────────────────────────────────── */
.results-label {
    margin-bottom: 16px;
    font-size: .875rem;
    color: var(--ink-3);
    display: none;
}

/* ── Empty State ────────────────────────────────────────── */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 0;
    color: var(--ink-4);
}
.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}
.empty-state-text { font-size: 1rem; }

/* ── Loader ─────────────────────────────────────────────── */
#loader {
    display: none;
    text-align: center;
    padding: 32px 0;
}
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
#end-message {
    display: none;
    text-align: center;
    padding: 32px 0;
    font-size: .875rem;
    color: var(--ink-4);
}

/* ── App Download Nudge ─────────────────────────────────── */
.download-nudge {
    margin-top: 60px;
    background: linear-gradient(135deg, var(--brand-light), #fff);
    border: 1.5px solid rgba(232,72,85,.2);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
}
.download-nudge-logo {
    height: 80px;
    width: 80px;
    object-fit: cover;
    border-radius: 12px;
    margin: 0 auto 14px;
    display: block;
}
.download-nudge-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 8px;
}
.download-nudge-subtitle {
    color: var(--ink-3);
    margin-bottom: 24px;
    font-size: .95rem;
}

/* ── Search highlight ───────────────────────────────────── */
.search-highlight {
    background: rgba(232,72,85,.15);
    color: var(--brand);
    padding: 0 2px;
    border-radius: 2px;
}
