/**
 * Betformatics Anmeldelse Grid Styles
 * Card grid layout for [bf_anmeldelse_grid] shortcode
 *
 * Dependencies: betformatics-variables (loaded via PHP)
 */

/* ========================================================================
   GRID CONTAINER
   ======================================================================== */
.bf-anmeldelse-grid {
    display: grid;
    gap: 24px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Column variations */
.bf-anmeldelse-grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.bf-anmeldelse-grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.bf-anmeldelse-grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Tablet: 2 columns max */
@media (max-width: 992px) {
    .bf-anmeldelse-grid-cols-3,
    .bf-anmeldelse-grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* Mobile: 1 column */
@media (max-width: 576px) {
    .bf-anmeldelse-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
}

/* ========================================================================
   CARD (Link wrapper)
   ======================================================================== */
.bf-anmeldelse-card {
    display: flex;
    flex-direction: column;
    text-decoration: none !important;
    border: 1px solid var(--bf-border, #e5e7eb);
    border-radius: 16px;
    overflow: hidden;
    background: var(--bf-white, #fff);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bf-anmeldelse-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    text-decoration: none !important;
}

.bf-anmeldelse-card:focus {
    outline: 2px solid var(--bf-primary, #2563eb);
    outline-offset: 2px;
}

/* ========================================================================
   CARD INNER (Brand color background)
   ======================================================================== */
.bf-anmeldelse-card-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    padding: 24px 20px;
    background: #1a1a1a; /* Fallback color */
}

/* ========================================================================
   RATING (Below name)
   ======================================================================== */
.bf-anmeldelse-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px 8px;
    background: var(--bf-white, #fff);
}

.bf-anmeldelse-stars {
    display: flex;
    align-items: center;
    gap: 2px;
}

.bf-star {
    flex-shrink: 0;
}

.bf-star-full {
    fill: #fbbf24;
}

.bf-star-half {
    /* Half star uses gradient fill defined inline */
}

.bf-star-empty {
    fill: #d1d5db;
}

.bf-anmeldelse-rating-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--bf-gray-600, #4b5563);
}

/* ========================================================================
   LOGO (Centered)
   ======================================================================== */
.bf-anmeldelse-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 160px;
    height: 80px;
    aspect-ratio: 2 / 1; /* 160:80 - Prevents CLS during lazy load */
}

.bf-anmeldelse-logo img {
    max-width: 100%;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* ========================================================================
   NAME (Bottom section)
   ======================================================================== */
.bf-anmeldelse-name {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 16px 2px;
    background: var(--bf-white, #fff);
    font-size: 14px;
    font-weight: 600;
    color: var(--bf-gray-700, #374151);
    text-align: center;
    line-height: 1.4;
    border-top: 1px solid var(--bf-border, #e5e7eb);
}

/* ========================================================================
   RESPONSIVE ADJUSTMENTS
   ======================================================================== */
@media (max-width: 768px) {
    .bf-anmeldelse-card-inner {
        min-height: 160px;
        padding: 20px 16px;
    }

    .bf-anmeldelse-logo {
        max-width: 140px;
    }

    .bf-anmeldelse-logo img {
        max-height: 70px;
    }

    .bf-anmeldelse-name {
        font-size: 13px;
        padding: 12px 14px;
        min-height: 48px;
    }

    .bf-star {
        width: 12px !important;
        height: 12px !important;
    }

    .bf-anmeldelse-rating-value {
        font-size: 11px;
    }
}

@media (max-width: 400px) {
    .bf-anmeldelse-card-inner {
        min-height: 140px;
        padding: 18px 14px;
    }

    .bf-anmeldelse-logo {
        max-width: 120px;
    }

    .bf-anmeldelse-logo img {
        max-height: 60px;
    }
}
