/* --- Base Grid Setup --- */
.nova-mag-grid {
    display: grid;
    gap: 30px;
}

/* --- Standard Grid Mode --- */
.nova-layout-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* --- METRO (MAGAZINE) MODE --- */
/* 3 Column Layout */
.nova-layout-metro {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(250px, auto);
}

/* Metro Item 1: Tall on the Left */
.nova-layout-metro .nova-item-1 {
    grid-column: span 1;
    grid-row: span 2;
}

/* Metro Item 2: Wide Top Right */
.nova-layout-metro .nova-item-2 {
    grid-column: span 2;
    grid-row: span 1;
}

/* Metro Item 3: Standard */
.nova-layout-metro .nova-item-3 {
    grid-column: span 1;
    grid-row: span 1;
}

/* Metro Item 4: Wide Bottom Right */
.nova-layout-metro .nova-item-4 {
    grid-column: span 2;
    grid-row: span 1;
}

/* --- Card Styling --- */
.nova-mag-card {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    height: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    background: #111; /* Fallback */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.nova-mag-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

/* Image Handling */
.nova-mag-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.nova-mag-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nova-mag-card:hover .nova-mag-image img {
    transform: scale(1.1);
}

/* Overlay */
.nova-mag-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.85) 100%);
    z-index: 2;
    pointer-events: none;
}

/* Content */
.nova-mag-content {
    position: relative;
    z-index: 3;
    padding: 25px;
    color: #fff;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
}

/* Categories */
.nova-mag-cat {
    background: rgba(255,255,255,0.25);
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 12px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: #fff;
    text-decoration: none;
}

.nova-mag-cat:hover {
    background: rgba(255,255,255,0.4);
}

/* Typography */
.nova-mag-title {
    color: #fff;
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    line-height: 1.3;
    font-weight: 700;
}

.nova-mag-title a {
    color: #fff;
    text-decoration: none;
    background-image: linear-gradient(to right, #fff 0%, #fff 100%);
    background-size: 0% 2px;
    background-repeat: no-repeat;
    background-position: left bottom;
    transition: background-size 0.3s ease;
}

.nova-mag-title a:hover {
    background-size: 100% 2px;
}

.nova-mag-intro {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.85);
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

/* Button */
.nova-mag-btn {
    display: inline-block;
    border: 1px solid rgba(255,255,255,0.5);
    padding: 8px 22px;
    border-radius: 30px;
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    background: transparent;
}

.nova-mag-btn:hover {
    background: #fff;
    color: #111;
    border-color: #fff;
}

/* --- Filters --- */
.nova-mag-filter {
    margin-bottom: 40px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.nova-filter-btn {
    background: #f0f2f5;
    border: none;
    padding: 10px 24px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-size: 0.9rem;
}

.nova-filter-btn:hover,
.nova-filter-btn.active {
    background: #111;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .nova-layout-metro {
        grid-template-columns: repeat(2, 1fr);
    }
    .nova-layout-metro .nova-item-1 { grid-column: span 2; grid-row: span 1; }
    .nova-layout-metro .nova-item-2 { grid-column: span 1; grid-row: span 1; }
    .nova-layout-metro .nova-item-3 { grid-column: span 1; grid-row: span 1; }
    .nova-layout-metro .nova-item-4 { grid-column: span 2; grid-row: span 1; }
}

@media (max-width: 767px) {
    .nova-mag-grid {
        gap: 20px;
    }
    .nova-layout-metro {
        grid-template-columns: 1fr;
    }
    .nova-layout-metro .nova-item-1,
    .nova-layout-metro .nova-item-2,
    .nova-layout-metro .nova-item-3,
    .nova-layout-metro .nova-item-4 {
        grid-column: span 1;
        grid-row: auto;
    }
    .nova-mag-title {
        font-size: 1.3rem;
    }
}