/* ========================================
   GRIDNEWS FEATURED GRID - COMPLETE CSS
   ======================================== */

/* Main container */
.gridnews-featured-grid {
    margin: 0 0 20px 0;
}

/* Slider wrapper */
.gfg-slider {
    position: relative;
    overflow: visible;
    /* Changed from hidden to allow arrows to show */
    border: solid 1px rgba(240, 240, 240, 1.0);
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 4px 20px rgba(11, 27, 45, 0.05);
    border-radius: 4px;
}

.gfg-slider-inner {
    position: relative;
    min-height: 470px;
    display: flex;
    width: 100%;
    overflow: hidden;
    /* Clip slides here instead */
}

/* Slides */
.gfg-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-width: 100%;
    flex-shrink: 0;
    transition: opacity 0.6s ease, visibility 0.6s ease, transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow;
    pointer-events: none;
}

/* Fade mode styles */
.gfg-slide {
    opacity: 0;
    visibility: hidden;
}

.gfg-slide-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Container wrapper */
.gridnews-featured-grid .container-wrapper {
    margin: 0 auto;
}

@media (max-width: 768px) {
    .gridnews-featured-grid .container-wrapper {
        padding: 0;
    }

    .gridnews-featured-grid {
        margin: 0;
    }
}

/* Grid row */
.gridnews-featured-grid .grid-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    flex-direction: row;
    /* explicit LTR flow */
}

.gridnews-featured-grid .grid-big {
    flex: 1 1 58%;
}

.gridnews-featured-grid .grid-small {
    flex: 1 1 40%;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* Grid items */
.gridnews-featured-grid .grid-item {
    position: relative;
    overflow: hidden;
    border-radius: 2px;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    will-change: transform, box-shadow;
}

.gridnews-featured-grid .big-thumb {
    height: 470px;
}

.gridnews-featured-grid .grid-small .grid-item {
    flex: 1 1 calc(50% - 12px);
    height: 233px;
}

/* Thumb link */
.gridnews-featured-grid .thumb-link {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* Images */
.gridnews-featured-grid .grid-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1);
    transition: transform 0.8s ease;
    will-change: transform;
}

.gridnews-featured-grid .grid-item:hover .grid-img {
    transform: scale(1.08);
}

/* Overlay */
.gridnews-featured-grid .thumb-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 20%, rgba(0, 0, 0, 0.6) 100%);
    z-index: 1;
}

.gridnews-featured-grid .thumb-overlay::after {
    content: '';
    position: absolute;
    z-index: 1;
    left: 0;
    right: 0;
    bottom: 0;
    height: 65%;
    transition: opacity 0.2s;
    background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.75));
    backface-visibility: hidden;
}

/* Content area */
.thumb-content {
    padding: 20px 20px 15px;
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 3;
    width: 100%;
    pointer-events: none;
    backface-visibility: hidden;
}

/* Post meta */
.gridnews-featured-grid .post-meta {
    color: #fff;
    font-size: 14px;
    opacity: 0.9;
}

/* Post title */
.gridnews-featured-grid .post-title {
    z-index: 2;
    color: #fff;
    margin: 0 0 5px 0;
}

.gridnews-featured-grid .big-thumb .post-title {
    font-size: 28px;
    line-height: 1.4;
    font-weight: 600;
}

.gridnews-featured-grid .grid-small .post-title {
    font-size: 20px;
    line-height: 1.4;
    font-weight: 600;
}

.gridnews-featured-grid .post-title a {
    color: #fff;
    text-decoration: none;
}

/* Big excerpt - always visible */
.big-excerpt {
    color: #eee;
    font-size: 14px;
    line-height: 1.5;
    max-height: 100px;
    margin-top: 5px;
}

/* Small excerpt - shows on hover */
.gridnews-featured-grid .excerpt {
    color: #ffffff;
    font-size: 14px;
    line-height: 18px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.4s ease, max-height 0.4s ease;
}

.gridnews-featured-grid .grid-item:hover .excerpt {
    opacity: 1;
    max-height: 80px;
}

/* Category badge */
.post-cat {
    position: absolute;
    top: 20px;
    left: 20px;
    display: inline-block;
    padding: 1px 11px !important;
    line-height: 2em;
    font-size: 13px !important;
    text-transform: uppercase !important;
    color: #fff !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    z-index: 3;
    overflow: hidden;
}

.post-cat:hover {
    opacity: 0.9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.post-cat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.15);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.post-cat:hover::before {
    opacity: 1;
}

/* ========== SLIDER CONTROLS ========== */

/* Arrows */
.gfg-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
    opacity: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.gfg-slider:hover .gfg-arrow {
    opacity: 1;
}

.gfg-prev {
    inset-inline-start: 20px;
}

.gfg-next {
    inset-inline-end: 20px;
}

.gfg-arrow:hover {
    background: rgba(0, 0, 0, 0.85);
    /*transform: translateY(-50%) scale(1.1);*/
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.gfg-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.gfg-prev::before {
    content: '❮';
}

.gfg-next::before {
    content: '❯';
}

/* Dots */
.gfg-dots {
    text-align: center;
    margin-top: 16px;
    padding-bottom: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.gfg-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: rgba(200, 200, 200, 0.6);
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.gfg-dot:hover {
    background: rgba(180, 180, 180, 0.8);
    transform: scale(1.15);
}

.gfg-dot-active {
    background: #45278e;
    transform: scale(1.3);
    box-shadow: 0 4px 10px rgba(69, 39, 142, 0.3);
}

/* ========== RESPONSIVE ========== */

/* Mobile + Tablet keep 1 big + 2x2 small, with correct height */
@media (max-width: 1024px) {

    .gfg-slider {
        padding: 0;
        border-radius: 0;
        box-shadow: none;
        border: none;
        overflow: hidden;
        /* Restore overflow hidden on mobile */
    }

    .gridnews-featured-grid .grid-row {
        flex-direction: column;
        gap: 4px;
    }

    /* Big item */
    .gridnews-featured-grid .grid-big {
        flex: 0 0 auto;
        width: 100%;
    }

    .gridnews-featured-grid .big-thumb {
        height: 230px;
    }

    .gridnews-featured-grid .big-thumb .post-title {
        font-size: 16px;
    }

    .big-excerpt {
        display: none;
    }

    /* Small items 2x2 */
    .gridnews-featured-grid .grid-small {
        flex: 0 0 auto;
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px;
    }

    .gridnews-featured-grid .grid-small .grid-item {
        flex: initial;
        height: 150px;
    }

    .gridnews-featured-grid .grid-small .post-title {
        font-size: 13px;
        line-height: 1.4;
    }

    .thumb-content {
        padding: 10px 8px;
    }

    /* Arrows / dots - back inside on mobile */
    .gfg-arrow {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }

    .gfg-prev {
        left: 10px;
        right: auto;
    }

    .gfg-next {
        right: 10px;
        left: auto;
    }

    .gfg-dot {
        width: 8px;
        height: 8px;
    }

    .gfg-slider-inner {
        min-height: 538px;
    }
}

/* Very small phones */
@media (max-width: 480px) {
    .gridnews-featured-grid .big-thumb {
        height: 210px;
    }

    .gridnews-featured-grid .grid-small .grid-item {
        height: 140px;
    }

    .gfg-slider-inner {
        min-height: 498px;
    }
}