/**
 * Brand Module Styles
 * Standalone CSS for the Brand/Client Logos section
 * Only loaded when brand module is present on page
 * 
 * @module brand
 * @version 2.0.0
 */

/* ============================================
   BRAND SECTION CONTAINER
   ============================================ */

.brands-section {
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    position: relative;
    overflow: hidden;
    padding: 4rem 0;
}

.brands-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.08), transparent);
}

/* Section Header */
.brands-section .section-header {
    margin-bottom: 3rem;
}

.brands-section .section-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 0.5rem;
}

.brands-section .section-subtitle {
    font-size: 1rem;
    color: #64748b;
    font-weight: 400;
}

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

.brand-card {
    padding: 0.25rem;
    /* Minimal padding around the card */
    border-radius: 16px;
    position: relative;
    height: 100%;
}

/* ============================================
   BRAND LOGO WRAPPER
   Squared blocks with centered logos
   ============================================ */

.brand-logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    /* Force square shape */
    padding: 0.5rem;
    /* Reduced from 1rem to make logo bigger */
    background: #ffffff;
    border-radius: 16px;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.03),
        0 2px 4px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Backdrop layer for pulse animation */
.brand-logo-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--brand-pulse-color, rgba(220, 38, 38, 0.05));
    opacity: 0;
    transition: opacity 0.5s ease-out;
    border-radius: inherit;
    z-index: 0;
}

/* Glow ring for pulse effect */
.brand-logo-wrapper::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 18px;
    border: 2px solid transparent;
    transition: border-color 0.5s ease;
    z-index: 0;
    pointer-events: none;
}

/* Hover State */
.brand-logo-wrapper:hover {
    transform: translateY(-4px);
    box-shadow:
        0 12px 24px rgba(0, 0, 0, 0.06),
        0 4px 8px rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

/* ============================================
   ACTIVE PULSE STATE
   ============================================ */

.brand-card.is-pulsing .brand-logo-wrapper {
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.08),
        0 4px 16px var(--brand-pulse-shadow, rgba(220, 38, 38, 0.12));
    border-color: var(--brand-pulse-border, rgba(220, 38, 38, 0.25));
    transform: scale(1.03);
}

.brand-card.is-pulsing .brand-logo-wrapper::before {
    opacity: 1;
}

.brand-card.is-pulsing .brand-logo-wrapper::after {
    border-color: var(--brand-pulse-ring, rgba(220, 38, 38, 0.15));
}

.brand-card.is-pulsing .brand-logo {
    transform: scale(1.05);
    /* Reduced scale slightly to prevent overflow */
    filter: saturate(1.1) brightness(1.02);
}

/* ============================================
   BRAND LOGO - RESPONSIVE SIZING
   ============================================ */

.brand-logo {
    width: auto;
    height: auto;
    max-width: 95%;
    /* INCREASED: Fill almost the entire square */
    max-height: 95%;
    /* INCREASED: Fill almost the entire square */
    object-fit: contain;
    filter: saturate(0.95);
    /* Slightly muted by default */
    transition: transform 0.5s ease, filter 0.5s ease;
    position: relative;
    z-index: 1;
}

/* ============================================
   YEARS BADGE
   ============================================ */

.brand-years {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    /* Slightly bigger */
    font-weight: 700;
    color: var(--color-primary-normal-bg, #059669);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */

/* Mobile Specific Adjustments */
@media (max-width: 767.98px) {
    .brands-section {
        padding: 2rem 0;
    }

    /* Tighter columns on mobile */
    .brands-section .row {
        margin-left: -6px;
        margin-right: -6px;
    }

    .brands-section .col-6 {
        padding-left: 6px;
        padding-right: 6px;
        margin-bottom: 1rem !important;
    }

    .brand-card {
        padding: 0;
        /* No padding on card wrapper for mobile */
    }

    .brand-logo-wrapper {
        padding: 0.25rem;
        /* Minimal padding inside the box */
        border-radius: 12px;
    }

    .brand-logo {
        max-width: 90%;
        max-height: 90%;
    }

    .brand-years {
        font-size: 0.75rem;
        margin-top: 0.25rem;
    }
}

/* Small Mobile */
@media (max-width: 575.98px) {
    .brand-logo-wrapper {
        padding: 0.5rem;
    }
}

/* ============================================
   REDUCED MOTION PREFERENCE
   ============================================ */

@media (prefers-reduced-motion: reduce) {

    .brand-logo-wrapper,
    .brand-logo-wrapper::before,
    .brand-logo-wrapper::after,
    .brand-logo,
    .brand-years {
        transition: none !important;
    }

    .brand-card.is-pulsing .brand-logo-wrapper {
        transform: none;
    }

    .brand-card.is-pulsing .brand-logo {
        transform: none;
    }
}