/**
 * NovaCore Latest Uploads
 *
 * Dedicated presentation styles for the homepage Latest Uploads section.
 * All selectors are scoped to .nc-latest so existing global card styles
 * remain untouched.
 *
 * @package NovaCore
 * @since 1.0.0
 */

/* ========================================================================== 
   Section
   ========================================================================== */

.nc-latest {
    position: relative;
    padding: 72px 0;
}

.nc-latest .nc-container {
    position: relative;
}

/* ========================================================================== 
   Grid
   ========================================================================== */

.nc-latest .nc-post-grid {
    display: grid;
    grid-template-columns: repeat(
        var(--nc-latest-columns, 4),
        minmax(0, 1fr)
    );
    gap: 20px;
    margin: 0;
}

/* ========================================================================== 
   Latest Upload Card
   ========================================================================== */

.nc-latest .nc-post-grid > .nc-card {
    --nc-latest-radius: 20px;

    position: relative;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;

    background: var(--nc-card-background, #ffffff);
    border: 1px solid var(--nc-card-border, #e8edf5);
    border-radius: var(--nc-latest-radius);
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.055);
    isolation: isolate;

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        border-color 0.25s ease;
}

.nc-latest .nc-post-grid > .nc-card:hover {
    transform: translateY(-5px);
    border-color: rgba(37, 99, 235, 0.28);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.11);
}

/* ========================================================================== 
   Image
   ========================================================================== */

.nc-latest .nc-card__image {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f1f5f9;
}

.nc-latest .nc-card__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.nc-latest .nc-post-grid > .nc-card:hover .nc-card__image img {
    transform: scale(1.035);
}

.nc-latest .nc-card__image::after {
    position: absolute;
    inset: 0;
    content: "";
    pointer-events: none;
    background: linear-gradient(
        180deg,
        rgba(15, 23, 42, 0.02) 0%,
        rgba(15, 23, 42, 0) 55%,
        rgba(15, 23, 42, 0.08) 100%
    );
}

.nc-latest .nc-card__placeholder {
    min-height: 100%;
    padding: 24px;
    background:
        radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.10), transparent 42%),
        #f8fafc;
    color: var(--nc-muted, #64748b);
}

/* ========================================================================== 
   Card Content
   ========================================================================== */

.nc-latest .nc-card__body,
.nc-latest .nc-card__content {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 12px;
    padding: 18px 18px 16px;
}

/* ========================================================================== 
   Badge / Category
   ========================================================================== */

.nc-latest .nc-card__badge {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 6px 10px;
    background: #eef4ff;
    border: 1px solid rgba(37, 99, 235, 0.08);
    border-radius: 999px;
    color: var(--nc-primary, #2563eb);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========================================================================== 
   Title
   ========================================================================== */

.nc-latest .nc-card__title {
    margin: 0;
    color: var(--nc-text, #0f172a);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.42;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    transition: color 0.2s ease;
}

.nc-latest .nc-post-grid > .nc-card:hover .nc-card__title {
    color: var(--nc-primary, #2563eb);
}

.nc-latest .nc-card__title a {
    color: inherit;
    text-decoration: none;
}

/* ========================================================================== 
   Description
   ========================================================================== */

.nc-latest .nc-card__description {
    margin: 0;
    color: var(--nc-text-light, #64748b);
    font-size: 0.86rem;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

/* ========================================================================== 
   Metadata
   ========================================================================== */

.nc-latest .nc-card__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px 12px;
    margin-top: auto;
    padding-top: 2px;
    color: var(--nc-muted, #64748b);
    font-size: 0.76rem;
    line-height: 1.4;
}

.nc-latest .nc-card__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.nc-latest .nc-card__meta-item svg,
.nc-latest .nc-card__meta-item .dashicons {
    width: 15px;
    height: 15px;
    color: var(--nc-primary, #2563eb);
    font-size: 15px;
    line-height: 15px;
}

.nc-latest .nc-card__meta-separator {
    color: #cbd5e1;
}

/* ========================================================================== 
   Footer / Action
   ========================================================================== */

.nc-latest .nc-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 4px;
    padding-top: 13px;
    border-top: 1px solid #eef2f7;
}

.nc-latest .nc-card__footer a {
    text-decoration: none;
}

.nc-latest .nc-card__footer .nc-button,
.nc-latest .nc-card__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 36px;
    padding: 8px 13px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--nc-primary, #2563eb);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    transition:
        background-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.nc-latest .nc-card__footer .nc-button:hover,
.nc-latest .nc-card__action:hover {
    background: #1d4ed8;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 7px 18px rgba(37, 99, 235, 0.20);
}

.nc-latest .nc-card__action-icon {
    display: inline-flex;
    transition: transform 0.2s ease;
}

.nc-latest .nc-card__action:hover .nc-card__action-icon {
    transform: translateX(3px);
}

/* ========================================================================== 
   Verification / Status
   ========================================================================== */

.nc-latest .nc-card__verified {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #15803d;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.2;
}

.nc-latest .nc-card__verified-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #dcfce7;
    color: #15803d;
    font-size: 10px;
}

/* ========================================================================== 
   Empty State
   ========================================================================== */

.nc-latest .nc-post-grid:empty {
    display: block;
}

.nc-latest .nc-post-grid__empty {
    padding: 42px 24px;
    background: var(--nc-card-background, #ffffff);
    border: 1px dashed #dbe3ee;
    border-radius: 18px;
    color: var(--nc-muted, #64748b);
    text-align: center;
}

/* ========================================================================== 
   Accessibility
   ========================================================================== */

.nc-latest .nc-post-grid > .nc-card:focus-within {
    outline: 3px solid rgba(37, 99, 235, 0.18);
    outline-offset: 3px;
}

/* ========================================================================== 
   Responsive
   ========================================================================== */

@media (max-width: 1100px) {
    .nc-latest .nc-post-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 18px;
    }
}

@media (max-width: 1024px) {

    .nc-latest .nc-post-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 820px) {
    .nc-latest {
        padding: 60px 0;
    }

    .nc-latest .nc-post-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }
}


@media (max-width: 640px) {

    .nc-latest .nc-post-grid {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 560px) {
    .nc-latest {
        padding: 48px 0;
    }

    .nc-latest .nc-post-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .nc-latest .nc-post-grid > .nc-card {
        border-radius: 18px;
    }

    .nc-latest .nc-card__body,
    .nc-latest .nc-card__content {
        padding: 16px;
    }

    .nc-latest .nc-card__title {
        font-size: 1rem;
    }
}

/* ========================================================================== 
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .nc-latest .nc-post-grid > .nc-card,
    .nc-latest .nc-card__image img,
    .nc-latest .nc-card__title,
    .nc-latest .nc-card__footer .nc-button,
    .nc-latest .nc-card__action,
    .nc-latest .nc-card__action-icon {
        transition: none;
    }
}
