/**
 * Wexoe News Grid Styles
 * Ny layout: 2 stora överst (1x2), 4 små nederst (1x1)
 */

.wexoe-news-grid {
    width: 100%;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Grid Container - Rätt struktur: 2 rader */
.wexoe-grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 250px); /* Endast 2 rader */
    gap: 20px;
    width: 100%;
}

/* Grid Items Base - Fyrkantiga utan rundade hörn */
.wexoe-grid-item {
    position: relative;
    border-radius: 0;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Första stora kortet (övre vänster, 2 kolumner bred) */
.wexoe-grid-item.grid-item-top-1 {
    grid-column: 1 / 3;
    grid-row: 1;
}

/* Andra stora kortet (övre höger, 2 kolumner bred) */
.wexoe-grid-item.grid-item-top-2 {
    grid-column: 3 / 5;
    grid-row: 1;
}

/* Små kvadratiska kort (nedre raden, 1x1 vardera) */
.wexoe-grid-item.grid-item-small-1 {
    grid-column: 1;
    grid-row: 2;
}

.wexoe-grid-item.grid-item-small-2 {
    grid-column: 2;
    grid-row: 2;
}

.wexoe-grid-item.grid-item-small-3 {
    grid-column: 3;
    grid-row: 2;
}

.wexoe-grid-item.grid-item-small-4 {
    grid-column: 4;
    grid-row: 2;
}

/* IDIOTSÄKER OVERLAY - Högsta specificitet och !important överallt */
.wexoe-news-grid .wexoe-grid-container .wexoe-grid-item .wexoe-grid-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: #0D1B30 !important;
    opacity: 0.75 !important;
    z-index: 2 !important;
    transition: opacity 0.3s ease !important;
    pointer-events: none !important;
    display: block !important;
    visibility: visible !important;
    background-image: none !important;
    background: #0D1B30 !important;
    filter: alpha(opacity=75) !important; /* För gamla IE */
}

/* HOVER EFFECT - Endast opacity ändras */
.wexoe-news-grid .wexoe-grid-container .wexoe-grid-item:hover .wexoe-grid-overlay {
    opacity: 0.85 !important;
    background-color: #0D1B30 !important;
    background: #0D1B30 !important;
}

/* Ingen skugga eller transform på hover */
.wexoe-grid-item:hover {
    transform: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* Behåll original skugga */
}

.wexoe-grid-item:hover .wexoe-grid-image {
    transform: none; /* Ingen zoom på bilden */
}

/* Focus state för accessibility */
.wexoe-grid-item:focus-within {
    outline: 3px solid #F58025;
    outline-offset: 2px;
}

/* Image Container */
.wexoe-grid-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
    transition: none; /* Ingen animation */
}

/* Content Area - För stora kort - mindre padding */
.wexoe-grid-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* Content för små kvadratiska kort - Endast centrerad rubrik */
.grid-item-small-1 .wexoe-grid-content,
.grid-item-small-2 .wexoe-grid-content,
.grid-item-small-3 .wexoe-grid-content,
.grid-item-small-4 .wexoe-grid-content {
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    bottom: auto;
    top: 0;
}

/* Meta Information - Olika för stora och små kort */
.wexoe-grid-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

/* Datum för stora kort */
.grid-item-top-1 .wexoe-grid-date,
.grid-item-top-2 .wexoe-grid-date {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7) !important;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Datum för små kort - mycket mindre och diskret */
.grid-item-small-1 .wexoe-grid-date,
.grid-item-small-2 .wexoe-grid-date,
.grid-item-small-3 .wexoe-grid-date,
.grid-item-small-4 .wexoe-grid-date {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6) !important;
    font-weight: 400;
    text-transform: lowercase;
    letter-spacing: 0.3px;
    background: rgba(13, 27, 48, 0.5);
    padding: 3px 8px;
    border-radius: 2px;
    z-index: 6;
}

/* Meta för små kort - dold förutom datum */
.grid-item-small-1 .wexoe-grid-meta,
.grid-item-small-2 .wexoe-grid-meta,
.grid-item-small-3 .wexoe-grid-meta,
.grid-item-small-4 .wexoe-grid-meta {
    margin: 0;
    position: static;
}

/* Title Styles - Mindre för att passa bättre */
.wexoe-grid-title {
    margin: 0 0 12px 0;
    font-size: 24px;
    line-height: 1.15;
    font-weight: 700;
}

/* Stora kort titlar */
.grid-item-top-1 .wexoe-grid-title,
.grid-item-top-2 .wexoe-grid-title {
    font-size: 24px;
    margin-bottom: 12px;
}

/* Små kort titlar - Mindre och centrerade */
.grid-item-small-1 .wexoe-grid-title,
.grid-item-small-2 .wexoe-grid-title,
.grid-item-small-3 .wexoe-grid-title,
.grid-item-small-4 .wexoe-grid-title {
    font-size: 16px;
    margin: 0;
    text-align: center;
    line-height: 1.2;
}

.wexoe-grid-title a {
    color: white !important;
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Excerpt - Mindre text */
.wexoe-grid-excerpt {
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9) !important;
    margin-bottom: 18px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Dölj excerpt för små kort */
.grid-item-small-1 .wexoe-grid-excerpt,
.grid-item-small-2 .wexoe-grid-excerpt,
.grid-item-small-3 .wexoe-grid-excerpt,
.grid-item-small-4 .wexoe-grid-excerpt {
    display: none;
}

/* Read More Link - Mindre knapp */
.wexoe-grid-readmore {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: #F58025 !important;
    color: white !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    border-radius: 0;
    transition: all 0.3s ease;
    align-self: flex-start;
    box-shadow: 0 2px 6px rgba(245, 128, 37, 0.2);
    border: none !important;
}

.wexoe-grid-readmore:hover {
    background: #E57020 !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(245, 128, 37, 0.3);
}

/* Dölj läs mer för små kort */
.grid-item-small-1 .wexoe-grid-readmore,
.grid-item-small-2 .wexoe-grid-readmore,
.grid-item-small-3 .wexoe-grid-readmore,
.grid-item-small-4 .wexoe-grid-readmore {
    display: none !important;
}

.wexoe-grid-readmore svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
    stroke: white !important;
}

/* Category badges - helt dolda */
.wexoe-grid-category,
.wexoe-featured-badge {
    display: none !important;
}

/* Empty State */
.wexoe-news-grid-empty {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 0;
    color: #6c757d;
    font-size: 16px;
}

/* Footer link */
.wexoe-grid-footer {
    margin-top: 30px;
    text-align: center;
}

.wexoe-grid-all-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #11325D;
    text-decoration: none;
    transition: all 0.2s ease;
}

.wexoe-grid-all-link:hover {
    gap: 12px;
    text-decoration: underline;
}

/* Responsive Design - Tablet */
@media (max-width: 768px) {
    .wexoe-grid-container {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(4, 200px);
        gap: 15px;
    }
    
    /* Första stora kortet - full bredd */
    .wexoe-grid-item.grid-item-top-1 {
        grid-column: 1 / 3;
        grid-row: 1 / 2;
    }
    
    /* Andra stora kortet - full bredd */
    .wexoe-grid-item.grid-item-top-2 {
        grid-column: 1 / 3;
        grid-row: 2 / 3;
    }
    
    /* Små kort - 2x2 grid */
    .wexoe-grid-item.grid-item-small-1 {
        grid-column: 1;
        grid-row: 3;
    }
    
    .wexoe-grid-item.grid-item-small-2 {
        grid-column: 2;
        grid-row: 3;
    }
    
    .wexoe-grid-item.grid-item-small-3 {
        grid-column: 1;
        grid-row: 4;
    }
    
    .wexoe-grid-item.grid-item-small-4 {
        grid-column: 2;
        grid-row: 4;
    }
}

/* Responsive Design - Mobile */
@media (max-width: 480px) {
    .wexoe-news-grid {
        padding: 0 15px;
        margin: 20px auto;
    }
    
    .wexoe-grid-container {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(6, 180px);
        gap: 12px;
    }
    
    /* Alla kort full bredd på mobil */
    .wexoe-grid-item.grid-item-top-1,
    .wexoe-grid-item.grid-item-top-2,
    .wexoe-grid-item.grid-item-small-1,
    .wexoe-grid-item.grid-item-small-2,
    .wexoe-grid-item.grid-item-small-3,
    .wexoe-grid-item.grid-item-small-4 {
        grid-column: 1;
        grid-row: auto;
    }
    
    /* Justera padding */
    .wexoe-grid-content {
        padding: 20px;
    }
    
    /* Mindre titlar på mobil */
    .wexoe-grid-title {
        font-size: 20px;
    }
}

/* EXTRA SÄKERHET - Override alla möjliga Enfold-konflikter */
body .wexoe-news-grid .wexoe-grid-container .wexoe-grid-item .wexoe-grid-overlay,
#top .wexoe-news-grid .wexoe-grid-container .wexoe-grid-item .wexoe-grid-overlay,
.html_header_top .wexoe-news-grid .wexoe-grid-container .wexoe-grid-item .wexoe-grid-overlay {
    background-color: #0D1B30 !important;
    opacity: 0.75 !important;
    background: #0D1B30 !important;
}

body .wexoe-news-grid .wexoe-grid-container .wexoe-grid-item:hover .wexoe-grid-overlay,
#top .wexoe-news-grid .wexoe-grid-container .wexoe-grid-item:hover .wexoe-grid-overlay,
.html_header_top .wexoe-news-grid .wexoe-grid-container .wexoe-grid-item:hover .wexoe-grid-overlay {
    opacity: 0.85 !important;
    background-color: #0D1B30 !important;
    background: #0D1B30 !important;
}