/*
 * Block: Recipe Loop
 * ------------------
 * Styles for the recipe CPT grid with taxonomy filter buttons.
 * Rem units throughout (1rem = 10px per theme convention).
 * No font-size declarations - inherits from theme typography.
 * Brand colours via CSS custom properties (--brand-1 through --brand-4).
 */


/* =========================================================================
   FILTER BAR
   ========================================================================= */

.recipe-loop-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 3rem;
	justify-content: space-between;
}


.recipe-loop-filter {
    background: transparent;
    border: 1px solid var(--brand-1);
    border-radius: 10rem; /* pill shape */
    color: var(--brand-1);
    cursor: pointer;
    padding: 0.6rem 1.6rem;
    transition: background 0.2s ease, color 0.2s ease;
}

.recipe-loop-filter:hover {
    background: var(--brand-1);
    color: #fff;
}

.recipe-loop-filter.active {
    background: var(--brand-1);
    color: #fff;
}


/* =========================================================================
   GRID
   ========================================================================= */

.recipe-loop-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 3rem;
}


/* =========================================================================
   CARD
   ========================================================================= */

.recipe-loop-card {
    /* Cards that are hidden by the JS filter are removed from flow entirely */
}

.recipe-loop-card.is-hidden {
    display: none;
}


/* --- Thumbnail ---------------------------------------------------------- */

.recipe-loop-card-thumb-link {
    display: block;
    overflow: hidden;
    border-radius: 0.8rem;
    margin-bottom: 1.4rem;
}

.recipe-loop-card-thumb {
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.recipe-loop-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.recipe-loop-card-thumb-link:hover img {
    transform: scale(1.04);
}

.recipe-loop-card-thumb-placeholder {
    width: 100%;
    height: 100%;
    background: #f0f0f0;
}


/* --- Body --------------------------------------------------------------- */

.recipe-loop-card-body {
    padding: 0;
}

.recipe-loop-card-title {
    margin: 0;
}

.recipe-loop-card-title a {
    color: var(--brand-1);
    text-decoration: none;
}

.recipe-loop-card-title a:hover {
    color: var(--brand-2);
}


/* =========================================================================
   EMPTY STATE
   ========================================================================= */

.recipe-loop-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 0;
    color: inherit;
    opacity: 0.6;
}

/* "No results" message shown by JS when a filter returns nothing */
.recipe-loop-no-results {
    display: none;
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 0;
    opacity: 0.6;
}

.recipe-loop-no-results.is-visible {
    display: block;
}


/* =========================================================================
   BREAKPOINTS
   ========================================================================= */

@media (max-width: 1024px) {
    .recipe-loop-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2.4rem;
    }
}

@media (max-width: 768px) {
    .recipe-loop-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

@media (max-width: 576px) {
    .recipe-loop-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .recipe-loop-filters {
        gap: 0.6rem;
    }
}