/* ============================================================
   No Coffee – Elasticsearch Search Results
   ============================================================
   Salient's custom.php already handles:
   - #search-outer positioning, transform animations, display:block
   - .nectar-ajax-search-results container, max-height, transitions
   - #search-box and #close button transitions
   - Scrollbar styling

   This file styles only the ES search result items.
   ============================================================ */

/* ── Design tokens ─────────────────────────────────────────── */
.nectar-ajax-search-results {
    --nc-cream:      #faf7f3;
    --nc-ink:        #1a1208;
    --nc-ink-muted:  #7a6f65;
    --nc-green:      #39db84;
    --nc-border:     rgba(26, 18, 8, 0.09);
    --nc-shadow-sm:  0 1px 3px rgba(26, 18, 8, 0.06),
                     0 0 0 1px var(--nc-border);
    --nc-shadow-md:  0 6px 24px rgba(26, 18, 8, 0.10),
                     0 0 0 1px rgba(26, 18, 8, 0.07);
    --nc-ease:       cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── Grid wrapper ───────────────────────────────────────────── */
.nectar-ajax-search-results .nectar-search-results {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 4px 2px 2px;
    width: 100%;
}

/* ── Card ───────────────────────────────────────────────────── */
.nectar-ajax-search-results .search-post-item {
    background: var(--nc-cream);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--nc-shadow-sm);
    transition:
        box-shadow 0.35s var(--nc-ease),
        transform  0.35s var(--nc-ease);

    /* Staggered fade-up entry */
    animation: nc-card-in 0.5s var(--nc-ease) both;
}

.nectar-ajax-search-results .search-post-item:nth-child(1) { animation-delay: 0.04s; }
.nectar-ajax-search-results .search-post-item:nth-child(2) { animation-delay: 0.09s; }
.nectar-ajax-search-results .search-post-item:nth-child(3) { animation-delay: 0.14s; }
.nectar-ajax-search-results .search-post-item:nth-child(4) { animation-delay: 0.19s; }
.nectar-ajax-search-results .search-post-item:nth-child(5) { animation-delay: 0.24s; }
.nectar-ajax-search-results .search-post-item:nth-child(6) { animation-delay: 0.29s; }

@keyframes nc-card-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nectar-ajax-search-results .search-post-item:hover {
    box-shadow: var(--nc-shadow-md);
    transform: translateY(-2px);
}

.nectar-ajax-search-results .search-post-item a {
    color: inherit;
    text-decoration: none;
    display: block;
}

/* ── Image ──────────────────────────────────────────────────── */
.nectar-ajax-search-results .post-featured-img {
    width: 100%;
    padding-bottom: 90%;        /* slightly portrait — more editorial than square */
    background-size: 105%;
    background-position: center;
    background-color: rgba(26, 18, 8, 0.05);
    display: block;
    position: relative;
    transition: background-size 0.6s var(--nc-ease);
}

/* Brand-green underline slides in from left on hover */
.nectar-ajax-search-results .post-featured-img::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 0;
    background: var(--nc-green);
    transition: width 0.4s var(--nc-ease);
}

.nectar-ajax-search-results .search-post-item:hover .post-featured-img {
    background-size: 113%;
}

.nectar-ajax-search-results .search-post-item:hover .post-featured-img::after {
    width: 100%;
}

/* ── Text block ─────────────────────────────────────────────── */
.nectar-ajax-search-results .header {
    padding: 12px 14px 15px;
    line-height: 1.3;
}

/* Category label */
.nectar-ajax-search-results .meta-category {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'Fira Sans', sans-serif;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--nc-green);
    margin-bottom: 6px;
}

/* Small dot before category */
.nectar-ajax-search-results .meta-category::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--nc-green);
    flex-shrink: 0;
    opacity: 0.75;
}

/* Product title */
.nectar-ajax-search-results .search-post-item h5.title {
    font-family: 'Fira Sans', sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.32;
    letter-spacing: -0.01em;
    margin: 0;
    color: var(--nc-ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.nectar-ajax-search-results .search-post-item:hover h5.title {
    color: #000;
}

/* ── Desktop — 5 columns ────────────────────────────────────── */
@media only screen and (min-width: 1000px) {
    .nectar-ajax-search-results .search-post-item {
        width: calc(20% - 8px);
    }

    /* Hide 6th+ results on desktop */
    .nectar-ajax-search-results .nectar-search-results > .search-post-item:nth-child(n+6) {
        display: none;
    }
}

/* ── Tablet — 3 columns ─────────────────────────────────────── */
@media only screen and (max-width: 999px) and (min-width: 691px) {
    .nectar-ajax-search-results .search-post-item {
        width: calc(33.333% - 7px);
    }
}

/* ── Mobile — 2 columns ─────────────────────────────────────── */
@media only screen and (max-width: 690px) {
    .nectar-ajax-search-results .nectar-search-results {
        gap: 8px;
        padding: 6px;
    }

    .nectar-ajax-search-results .search-post-item {
        width: calc(50% - 4px);
    }

    .nectar-ajax-search-results .search-post-item h5.title {
        font-size: 12.5px;
    }
}
