/**
 * SQO Display Grid Styles
 * Stilar för grid-läge (brands och venues)
 * 
 * @package SQO_Modular_Plugin
 * @subpackage Modules/Venues
 */

/* ====================================
   Grid Container
   ==================================== */
.sqo-grid-container {
    display: grid;
    grid-template-columns: repeat(var(--columns, 6), 1fr);
    column-gap: var(--column-gap, 20px);
    row-gap: var(--row-gap, 20px);
    margin: 20px 0;
}

/* ====================================
   Grid Items - Bas
   ==================================== */
.sqo-grid-item {
    position: relative;
}

.sqo-display-item {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    position: relative;
}

.sqo-display-item img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

/* ====================================
   Brand Items - Kvadratiska logotyper
   ==================================== */
.sqo-display-brands .sqo-brand-item {
    background: #000;
    border-radius: 8px;
    padding: 20px;
    aspect-ratio: 1 / 1;
    width: 100%;
}

.sqo-display-brands .sqo-brand-item a {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.sqo-display-brands .sqo-brand-item img {
    max-width: 90%;
    max-height: 90%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* ====================================
   Venue Items - Logo Only (kvadratisk)
   ==================================== */
.sqo-venue-logo-only {
    background: #000;
    border-radius: 8px;
    padding: 20px;
    aspect-ratio: 1 / 1;
    width: 100%;
}

.sqo-venue-logo-only a {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.sqo-venue-logo-only img {
    max-width: 90%;
    max-height: 90%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* ====================================
   Venue Items - Card Layout
   ==================================== */
.sqo-venue-card {
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    height: 100%;
    will-change: transform; /* Förbättrar rendering-prestanda */
    backface-visibility: hidden; /* Förhindrar rendering-flicker */
    -webkit-font-smoothing: antialiased; /* Jämnare rendering i Webkit */
}

.sqo-venue-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

/* Stäng av shadow när sqo-no-shadow klass finns */
.sqo-no-shadow .sqo-venue-card {
    box-shadow: none;
}

.sqo-no-shadow .sqo-venue-card:hover {
    box-shadow: none;
    transform: none;
}

.sqo-venue-card .sqo-venue-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sqo-venue-card .sqo-venue-image {
    width: 100%;
    flex: 1; /* Gör att bilden tar upp all tillgänglig plats */
    overflow: hidden;
    position: relative;
    min-height: 300px; /* Minimum höjd */
}

.sqo-venue-card .sqo-venue-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Täcker hela området */
    transition: transform 0.3s ease;
}

.sqo-venue-card:hover .sqo-venue-image img {
    transform: scale(1.05);
}

/* Footer med horisontell layout */
.sqo-venue-card .sqo-venue-content {
    background: #000;
    color: #fff;
    padding: 15px 20px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    min-height: 70px; /* Default - kan överskrivas av Elementor */
    flex-shrink: 0; /* Förhindrar att footern krymper */
}

.sqo-venue-card .sqo-venue-title {
    font-size: 16px;
    margin: 0;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
    flex: 1;
}

.sqo-venue-card .sqo-venue-brand-logo {
    max-width: 60px;  /* Default - kan överskrivas av Elementor */
    max-height: 35px; /* Default - kan överskrivas av Elementor */
    flex-shrink: 0;
    display: flex; /* Säkerställer att containern följer innehållet */
    align-items: center;
    justify-content: center;
}

.sqo-venue-card .sqo-venue-brand-logo img {
    width: 100%; /* Fyller containerns bredd */
    height: 100%; /* Fyller containerns höjd */
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block; /* Tar bort inline-spacing */
    backface-visibility: hidden; /* Förhindrar rendering-flicker */
    -webkit-font-smoothing: antialiased;
    transform: translateZ(0); /* GPU-acceleration för smooth rendering */
}

/* ====================================
   Featured Venues Section
   ==================================== */
.sqo-featured-venues {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 50px;
}

.sqo-featured-venue-card {
    position: relative;
    background: transparent;
}

.sqo-featured-link {
    text-decoration: none;
    display: block;
    position: relative;
}

/* Bilden - 20px mindre på höger och botten */
.sqo-featured-image {

    aspect-ratio: 3 / 4;
    overflow: hidden;
    position: relative;
    margin-bottom: -20px;
}

.sqo-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    padding-right: 20px;
    padding-bottom: 20px;
}

/* Logo box - Längst ned och längst till höger i KORTET (inte bilden) */
.sqo-featured-logo {
    position: absolute;
    bottom: 0;
    right: 0;
    background: #000;
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.sqo-featured-logo img {
    max-width: 70%;
    max-height: 70%;
    width: auto;
    height: auto;
    object-fit: contain;
    padding-right: 0px;
    padding-bottom: 0px;
}

/* Hover-effekt: Visa venue-namn över bilden */
.sqo-featured-venue-card::after {
    content: attr(data-title);
    position: absolute;
    top: 0;
    left: 0;
    right: 20px; /* Undvik logon */
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent 50%);
    color: #fff;
    padding: 0 20px 20px;
    font-size: 18px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    display: flex;
    align-items: flex-end;
}

.sqo-featured-venue-card:hover::after {
    opacity: 1;
}

/* När featured_grid används i grid-container */
.sqo-grid-container .sqo-featured-venue-card {
    grid-column: span 1; /* Tar upp en kolumn i gridet */
}



/* ====================================
   Hover Effects
   ==================================== */
.sqo-display-wrapper.sqo-hover-scale .sqo-display-item:hover {
    transform: scale(1.05);
}

.sqo-display-wrapper.sqo-hover-opacity .sqo-display-item {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.sqo-display-wrapper.sqo-hover-opacity .sqo-display-item:hover {
    opacity: 0.8;
}

/* ====================================
   Responsive - Tablet
   ==================================== */
@media (max-width: 1024px) {
    .sqo-grid-container {
        grid-template-columns: repeat(var(--columns-tablet, 4), 1fr);
    }
    
    .sqo-featured-venues {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .sqo-featured-image {
        width: calc(100% - 15px);
    }
    
    .sqo-featured-logo {
        width: 80px;
        height: 80px;
    }
    
    .sqo-featured-venue-card::after {
        right: 35px;
        font-size: 16px;
        padding: 0 15px 15px;
    }
}

/* ====================================
   Responsive - Mobile
   ==================================== */
@media (max-width: 767px) {
    .sqo-grid-container {
        grid-template-columns: repeat(var(--columns-mobile, 2), 1fr);
    }
    
    .sqo-featured-venues {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .sqo-featured-venue-card {
        margin-bottom: 20px;
    }
    
    .sqo-featured-venue-card:last-child {
        margin-bottom: 0;
    }
    
    .sqo-featured-image {
        width: 100%;
    }
    
    .sqo-featured-image img {
        padding-right: 0;
    }
    
    .sqo-featured-logo {
        width: 100px;
        height: 100px;
    }
    
    .sqo-featured-venue-card::after {
        right: 0;
        font-size: 14px;
        padding: 0 10px 10px;
    }
    
    .sqo-venue-card .sqo-venue-content {
        flex-direction: column;
        text-align: center;
        padding: 12px;
        min-height: auto;
        gap: 10px;
    }
    
    .sqo-venue-card .sqo-venue-title {
        text-align: center;
        font-size: 14px;
    }
    
    .sqo-venue-card .sqo-venue-brand-logo {
        max-width: 50px;
        max-height: 30px;
    }
}