/* ============================================================
   Category Grid – category-grid.css
   Matches the teal ocean aesthetic from the reference design
   ============================================================ */

/* Grid layout – uses CSS custom property set by PHP */
.cg-grid {
    display: grid;
    grid-template-columns: repeat(var(--cg-columns, 3), 1fr);
    gap: 16px;
    margin: 0;
    padding: 0;
}

/* Each category card is an <a> tag */
.cg-card {
    display: block;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    border-radius: 2px;

    /* Subtle lift on hover */
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cg-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

/* Image wrapper – square-ish aspect ratio */
.cg-image-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 80%; /* controls height; adjust between 75%–100% to taste */
    overflow: hidden;
    background: #c8e8e8; /* fallback teal if image is missing */
}

.cg-image-wrap img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

/* Zoom image on card hover */
.cg-card:hover .cg-image-wrap img {
    transform: scale(1.04);
}

/* Label bar – sits at the bottom of the card */
.cg-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #3aafa9; /* teal – change to match your brand */
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cg-label span {
    color: #ffffff;
    font-family: inherit;          /* picks up your theme font */
    font-size: clamp(0.7rem, 1.5vw, 0.9rem);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.2;
}

/* Empty message */
.cg-empty {
    color: #666;
    font-style: italic;
}

/* ─── Responsive breakpoints ─────────────────────── */

/* Tablet: max 2 columns */
@media ( max-width: 900px ) {
    .cg-grid {
        grid-template-columns: repeat(
            min(var(--cg-columns, 3), 2),
            1fr
        );
    }
}

/* Mobile: single column */
@media ( max-width: 540px ) {
    .cg-grid {
        grid-template-columns: 1fr 1fr; /* 2-up on phones looks better than 1 */
        gap: 10px;
    }

    .cg-label {
        padding: 8px 10px;
    }
}

@media ( max-width: 360px ) {
    .cg-grid {
        grid-template-columns: 1fr;
    }
}
