/* =============================================================
   FRAG GRID — Front-end Styles
   Plugin: Frag Grid v2.0 | fancyreef.com
   ============================================================= */

/* ── Wrapper ─────────────────────────────────────────────── */
.frg-wrapper {
    width: 100%;
    overflow-x: auto;
    font-family: inherit;
    font-size: 0.9rem;
    margin: 1.5rem 0;
}

/* ── Grid rows ───────────────────────────────────────────── */
/*  grid-template-columns is set inline per-row by PHP        */
/*  so column count adjusts automatically to visible columns  */
.frg-grid {
    display: grid;
    gap: 0;
    min-width: 480px;
}

/* ── Header row ──────────────────────────────────────────── */
.frg-header-row {
    background: #1a2535;
    color: #e0e8f0;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 6px 6px 0 0;
}

/* ── Data rows ───────────────────────────────────────────── */
.frg-data-row {
    border-bottom: 1px solid #e8edf2;
    transition: background 0.15s;
}

.frg-data-row:nth-child(even) {
    background: #f7f9fb;
}

.frg-data-row:hover {
    background: #edf4ff;
}

.frg-data-row:last-child {
    border-bottom: none;
    border-radius: 0 0 6px 6px;
}

/* ── Cells ───────────────────────────────────────────────── */
.frg-col {
    padding: 0.6rem 0.75rem;
    display: flex;
    align-items: center;
    word-break: break-word;
    min-width: 0; /* prevent grid blowout */
}

.frg-header-row .frg-col {
    padding: 0.75rem;
}

/* ── Thumbnail ───────────────────────────────────────────── */
.frg-col-thumb {
    justify-content: center;
}

.frg-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.frg-no-thumb {
    color: #bbb;
}

.frg-acf-img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 3px;
}

/* ── Post title ──────────────────────────────────────────── */
.frg-col-title {
    flex-direction: column;
    align-items: flex-start;
}

.frg-title-link {
    color: #1a2535;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.3;
}

.frg-title-link:hover {
    color: #0073aa;
    text-decoration: underline;
}

.frg-top-cat-badge {
    display: inline-block;
    margin-top: 4px;
    font-size: 0.7rem;
    background: #d0e8ff;
    color: #0055a5;
    border-radius: 3px;
    padding: 1px 6px;
    font-weight: 600;
}

/* ── Excerpt ─────────────────────────────────────────────── */
.frg-col-excerpt {
    color: #444;
    line-height: 1.5;
}

/* ── Categories ──────────────────────────────────────────── */
.frg-col-cats {
    flex-wrap: wrap;
    gap: 4px;
}

.frg-cat-link {
    display: inline-block;
    background: #f0f4f8;
    border: 1px solid #d0d9e3;
    border-radius: 3px;
    padding: 1px 6px;
    font-size: 0.75rem;
    color: #334;
    text-decoration: none;
    white-space: nowrap;
}

.frg-cat-link:hover {
    background: #dce8f8;
    border-color: #7ab;
    color: #0055a5;
}

/* ── Yes / No badges (frag_available, true_false) ────────── */
.frg-badge {
    display: inline-block;
    border-radius: 3px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.frg-badge--yes {
    background: #d4f4e2;
    color: #1a6e3c;
}

.frg-badge--no {
    background: #fde8e8;
    color: #8b1a1a;
}

/* ── Price ───────────────────────────────────────────────── */
.frg-price {
    font-weight: 600;
    color: #1a6e3c;
}

/* ── Empty / placeholder states ──────────────────────────── */
.frg-empty {
    color: #bbb;
}

.frg-no-posts {
    color: #666;
    font-style: italic;
    padding: 1rem 0;
}



/* =============================================================
   MOBILE STACKED LAYOUT
   ============================================================= */

@media ( max-width: 640px ) {

    /* Hide the desktop header row */
    .frg-header-row {
        display: none;
    }

    /* Each post row becomes a stacked card */
    .frg-data-row {
        display: flex; !important; 
        flex-direction: column;
        border: 1px solid #dde4ed;
        border-radius: 8px;
        margin-bottom: 12px;
        padding: 12px;
        box-shadow: 0 1px 4px rgba(0,0,0,.06);
        background: #fff !important;
    }

    /* All cells stack full-width */
    .frg-col {
        width: 100%;
        padding: 4px 0;
        border-bottom: none;
    }

    /* Thumbnail sits at the top, left-aligned */
    .frg-col-thumb {
        justify-content: flex-start; !important; 
        margin-bottom: 6px;
    }

    .frg-thumb {
        width: 72px;
        height: 72px;
        border-radius: 6px;
    }

    /* Title is the most prominent element */
    .frg-col-title {
        font-size: 1rem;
        margin-bottom: 4px;
    }

    /* De-emphasise the excerpt slightly */
    .frg-col-excerpt {
        font-size: 0.82rem;
        color: #555;
        margin-bottom: 2px;
    }

    /* Categories wrap naturally */
    .frg-col-cats {
        flex-wrap: wrap;
        margin-bottom: 2px;
    }

    /* ACF fields sit at the bottom of the card */
    .frg-col-acf {
        font-size: 0.85rem;
    }

}
