/**
 * NewsWIZ Elementor Widgets Styles
 */

/* ========================================
   NEWS POST GRID WIDGET STYLES
======================================== */

/* Post Grid Styles */
.newswiz-post-grid-wrapper {
    width: 100%;
}

.newswiz-post-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 190px;
    gap: 8px;
}

/* Post Item - Image with Overlay Design */
.newswiz-post-item {
    position: relative;
    overflow: hidden;
    border-radius: 0;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #000;
}

.newswiz-post-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

/* Image Container */
.newswiz-post-image {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.newswiz-post-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.newswiz-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, opacity 0.3s ease;
}

.newswiz-post-item:hover .newswiz-post-image img {
    transform: scale(1.05);
    opacity: 0.9;
}

/* Dark Overlay for Text Readability */
.newswiz-post-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 40%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

/* Content Overlay on Image */
.newswiz-post-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    z-index: 2;
    color: #fff;
}

/* Category Badge - Top Left */
.newswiz-post-category {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 3;
    margin: 0;
}

.newswiz-post-category a {
    display: inline-block;
    padding: 5px 12px;
    background: rgba(185, 28, 28, 0.95);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 0;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.newswiz-post-category a:hover {
    background: rgba(185, 28, 28, 1);
}

/* Site Logo/Badge - Top Right */
.newswiz-logo-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    z-index: 3;
    border: 2px solid rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-style: solid;
}

.newswiz-logo-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 5px;
}

/* Title on Image */
.newswiz-post-title {
    margin: 0;
    font-size: 15px;
    line-height: 1.35;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.newswiz-post-title a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
}

.newswiz-post-title a:hover {
    color: #fcd34d;
}

/* Excerpt - Hidden by default in this design */
.newswiz-post-excerpt {
    display: none;
}

/* Meta Info */
.newswiz-post-meta {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 6px;
    font-weight: 400;
}

.newswiz-post-date {
    display: inline-block;
}

/* EXACT MAGAZINE LAYOUT FROM SCREENSHOT */

/* Post 1 - Large Hero (Left side, 2x2) */
.newswiz-post-grid .newswiz-post-item:nth-child(1) {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
}

.newswiz-post-grid .newswiz-post-item:nth-child(1) .newswiz-post-title {
    font-size: 24px;
    line-height: 1.3;
}

.newswiz-post-grid .newswiz-post-item:nth-child(1) .newswiz-post-content {
    padding: 25px;
}

/* Post 2 - Top Right (2 columns, 1 row) */
.newswiz-post-grid .newswiz-post-item:nth-child(2) {
    grid-column: 3 / 5;
    grid-row: 1 / 2;
}

.newswiz-post-grid .newswiz-post-item:nth-child(2) .newswiz-post-title {
    font-size: 16px;
}

/* Post 3 - Middle Right (2 columns, 1 row) */
.newswiz-post-grid .newswiz-post-item:nth-child(3) {
    grid-column: 3 / 5;
    grid-row: 2 / 3;
}

.newswiz-post-grid .newswiz-post-item:nth-child(3) .newswiz-post-title {
    font-size: 16px;
}

/* Post 4 - Bottom Left (1 column, 1 row) */
.newswiz-post-grid .newswiz-post-item:nth-child(4) {
    grid-column: 1 / 2;
    grid-row: 3 / 4;
}

/* Post 5 - Bottom Center (1 column, 1 row) */
.newswiz-post-grid .newswiz-post-item:nth-child(5) {
    grid-column: 2 / 3;
    grid-row: 3 / 4;
}

/* Post 6 - Bottom Right (2 columns, 1 row) */
.newswiz-post-grid .newswiz-post-item:nth-child(6) {
    grid-column: 3 / 5;
    grid-row: 3 / 4;
}

.newswiz-post-grid .newswiz-post-item:nth-child(6) .newswiz-post-title {
    font-size: 16px;
}

/* Responsive Design - Tablet */
@media (max-width: 1024px) {
    .newswiz-post-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 180px;
        gap: 8px;
    }

    .newswiz-post-grid .newswiz-post-item:nth-child(1) {
        grid-column: 1 / 2;
        grid-row: 1 / 3;
    }

    .newswiz-post-grid .newswiz-post-item:nth-child(1) .newswiz-post-title {
        font-size: 20px;
    }

    .newswiz-post-grid .newswiz-post-item:nth-child(2) {
        grid-column: 2 / 3;
        grid-row: 1 / 2;
    }

    .newswiz-post-grid .newswiz-post-item:nth-child(3) {
        grid-column: 2 / 3;
        grid-row: 2 / 3;
    }

    .newswiz-post-grid .newswiz-post-item:nth-child(4) {
        grid-column: 1 / 2;
        grid-row: 3 / 4;
    }

    .newswiz-post-grid .newswiz-post-item:nth-child(5) {
        grid-column: 2 / 3;
        grid-row: 3 / 4;
    }

    .newswiz-post-grid .newswiz-post-item:nth-child(6) {
        grid-column: 1 / 3;
        grid-row: 4 / 5;
    }

    .newswiz-post-title {
        font-size: 14px;
    }
}

/* Responsive Design - Mobile */
@media (max-width: 768px) {
    .newswiz-post-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 220px;
        gap: 8px;
    }

    .newswiz-post-grid .newswiz-post-item:nth-child(1),
    .newswiz-post-grid .newswiz-post-item:nth-child(2),
    .newswiz-post-grid .newswiz-post-item:nth-child(3),
    .newswiz-post-grid .newswiz-post-item:nth-child(4),
    .newswiz-post-grid .newswiz-post-item:nth-child(5),
    .newswiz-post-grid .newswiz-post-item:nth-child(6) {
        grid-column: 1 / 2;
        grid-row: auto;
    }

    .newswiz-post-grid .newswiz-post-item:nth-child(1) .newswiz-post-title {
        font-size: 18px;
    }

    .newswiz-post-title {
        font-size: 14px;
    }

    .newswiz-post-content {
        padding: 12px;
    }

    .newswiz-post-grid .newswiz-post-item:nth-child(1) .newswiz-post-content {
        padding: 15px;
    }
}

/* Loading State */
.newswiz-post-grid-wrapper.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Empty State */
.newswiz-post-grid-wrapper>p {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

/* ========================================
   NEWSWIZ IMAGE GALLERY – FINAL VERSION
======================================== */

.newswiz-gallery-wrapper {
    width: 100%;
}

/* GRID */
.newswiz-gallery-grid {
    display: grid;
    grid-template-columns: 2.2fr 1fr 1fr 1fr;
    grid-auto-rows: 140px;
    gap: 6px;
}

/* ITEM */
.newswiz-gallery-item {
    position: relative;
    overflow: hidden;
    background: #000;
}

.newswiz-gallery-item a {
    display: block;
    width: 100%;
    height: 100%;
}

/* IMAGE */
.newswiz-gallery-image,
.newswiz-gallery-image img {
    width: 100%;
    height: 100%;
}

.newswiz-gallery-image img {
    object-fit: cover;
    transition: transform 0.6s ease;
}

.newswiz-gallery-item:hover img {
    transform: scale(1.06);
}

/* ICON (TOP RIGHT) */
.newswiz-gallery-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    background: rgba(255,255,255,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    border-radius: 2px;
}

.newswiz-gallery-icon svg {
    width: 16px;
    height: 16px;
}

/* CATEGORY (TOP LEFT) */
.newswiz-gallery-category {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 3;
}

.newswiz-gallery-category a {
    background: #b91c1c;
    color: #fff;
    font-size: 10px;
    padding: 4px 10px;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
}

/* GRADIENT + TITLE */
.newswiz-gallery-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 14px;
    background: linear-gradient(
        to top,
        rgba(0,0,0,0.9),
        rgba(0,0,0,0.5),
        transparent
    );
    z-index: 2;
}

.newswiz-gallery-title {
    margin: 0;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 600;
    color: #fff;
}

/* ===============================
   DESKTOP LAYOUT
================================ */

/* FEATURED (LEFT BIG) */
.newswiz-gallery-item:nth-child(1) {
    grid-column: 1 / 2;
    grid-row: 1 / 4;
}

.newswiz-gallery-item:nth-child(1) .newswiz-gallery-title {
    font-size: 20px;
    font-weight: 700;
}

/* RIGHT SIDE – 3 ITEMS */
.newswiz-gallery-item:nth-child(2) {
    grid-column: 2 / 5;
    grid-row: 1 / 2;
}

.newswiz-gallery-item:nth-child(3) {
    grid-column: 2 / 5;
    grid-row: 2 / 3;
}

.newswiz-gallery-item:nth-child(4) {
    grid-column: 2 / 5;
    grid-row: 3 / 4;
}

.newswiz-gallery-item:nth-child(2) .newswiz-gallery-title,
.newswiz-gallery-item:nth-child(3) .newswiz-gallery-title,
.newswiz-gallery-item:nth-child(4) .newswiz-gallery-title {
    font-size: 15px;
}

/* BOTTOM – 4 EQUAL ITEMS */
.newswiz-gallery-item:nth-child(5) {
    grid-column: 1 / 2;
    grid-row: 4 / 5;
}

.newswiz-gallery-item:nth-child(6) {
    grid-column: 2 / 3;
    grid-row: 4 / 5;
}

.newswiz-gallery-item:nth-child(7) {
    grid-column: 3 / 4;
    grid-row: 4 / 5;
}

.newswiz-gallery-item:nth-child(8) {
    grid-column: 4 / 5;
    grid-row: 4 / 5;
}

/* ===============================
   TABLET
================================ */
@media (max-width: 1024px) {
    .newswiz-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 180px;
    }

    .newswiz-gallery-item:nth-child(1) {
        grid-column: 1 / 3;
        grid-row: 1 / 3;
    }

    .newswiz-gallery-item:nth-child(2),
    .newswiz-gallery-item:nth-child(3),
    .newswiz-gallery-item:nth-child(4),
    .newswiz-gallery-item:nth-child(5),
    .newswiz-gallery-item:nth-child(6),
    .newswiz-gallery-item:nth-child(7),
    .newswiz-gallery-item:nth-child(8) {
        grid-column: auto;
        grid-row: auto;
    }
}

/* ===============================
   MOBILE
================================ */
@media (max-width: 768px) {
    .newswiz-gallery-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 240px;
    }

    .newswiz-gallery-item:nth-child(1) .newswiz-gallery-title {
        font-size: 17px;
    }

    .newswiz-gallery-title {
        font-size: 13px;
    }
}