/**
 * New Content Showcase Component - Theme Integration
 * Special styling for recently published content with highlight effects
 *
 * Migrated from plugin for unified styling architecture.
 */

/* Site-wide color system integration */
.qm-new-content-showcase {
    --columns-mobile: 1;
    --columns-tablet: 2;
    --columns-desktop: 2;
    --gap-size: var(--qm-gap-default);
    --border-radius: var(--qm-border-radius-lg);
    --bg-color: var(--qm-bg-muted);
    --text-color: var(--qm-text-primary);
    --accent-color: var(--qm-accent-warning);
    --phase-color: var(--qm-accent-primary);
    --shadow-light: var(--qm-shadow);
    --shadow-hover: var(--qm-hover-shadow);
    --transition: var(--qm-transition);
    
    margin: 2rem 0;
    position: relative;
}

/* Title - Simplified to match Timeline Posts */
.qm-new-content-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 2rem 0;
    text-align: center;
    color: var(--text-color);
}

/* Grid Layout */
.qm-new-content-grid {
    display: grid;
    gap: var(--gap-size);
    grid-template-columns: repeat(var(--columns-mobile), 1fr);
}

@media (min-width: 768px) {
    .qm-new-content-grid {
        grid-template-columns: repeat(var(--columns-tablet), 1fr);
    }
}

@media (min-width: 1024px) {
    .qm-new-content-grid {
        grid-template-columns: repeat(var(--columns-desktop), 1fr);
    }
}

/* Featured Layout - Hero style for first item */
.qm-layout-featured .qm-new-content-grid {
    grid-template-areas: 
        "featured featured"
        "item1 item2"
        "item3 item4";
    grid-template-columns: 1fr 1fr;
}

.qm-layout-featured .qm-new-content-item:first-child {
    grid-area: featured;
    font-size: 1.1em;
}

.qm-layout-featured .qm-new-content-item:nth-child(2) { grid-area: item1; }
.qm-layout-featured .qm-new-content-item:nth-child(3) { grid-area: item2; }
.qm-layout-featured .qm-new-content-item:nth-child(4) { grid-area: item3; }
.qm-layout-featured .qm-new-content-item:nth-child(5) { grid-area: item4; }

/* List Layout - Identical to timeline-posts list layout */
.qm-layout-list .qm-new-content-grid {
    display: block;
}

.qm-layout-list .qm-new-content-item {
    margin-bottom: var(--gap-size);
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    flex-direction: row;
}

.qm-layout-list .qm-content-image {
    flex: 0 0 180px;
    aspect-ratio: 16/9;
    width: 180px;
}

.qm-layout-list .qm-content-body {
    flex: 1;
    padding: 1rem 1.5rem 1rem 0;
}

.qm-layout-list .qm-content-title {
    margin-top: 0;
    font-size: 1.25rem;
}

/* Individual Content Items - Clean white cards */
.qm-new-content-item {
    background: #ffffff;
    border-radius: var(--border-radius);
    overflow: visible;
    position: relative;
    transition: var(--transition);
    box-shadow: var(--shadow-light);
    border: 1px solid rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.qm-new-content-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* New Content Highlighting - colored borders instead of background gradients */

/* Remove global background gradient from New Content Showcase items */
.qm-new-content-item.qm-post-new::before,
.qm-new-content-item.qm-phase-new::before {
    display: none !important;
}

/* New Post Items get border matching badge color */
.qm-new-content-item.qm-post-new {
    border: 3px solid var(--qm-new-post-primary, #1565C0) !important;
}

/* New Phase Items get border matching badge color */
.qm-new-content-item.qm-phase-new {
    border: 3px solid var(--qm-new-phase-primary, #2E7D32) !important;
}

/* Priority: phase wins over post - use proper border color */
.qm-new-content-item.qm-phase-new.qm-post-new {
    border: 3px solid var(--qm-new-phase-primary, #2E7D32) !important;
}

/* Ensure content stays above overlay */
.qm-new-content-item .qm-content-body,
.qm-new-content-item .qm-content-image {
    position: relative;
    z-index: 2;
}

/* Removed hysterical pulse-glow keyframes - using subtle styling instead */

/* Content Highlight Badge - positioned top right */
.qm-content-highlight {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    pointer-events: none;
}

/* DEPRECATED: .qm-new-badge-large - Now using unified .qm-badge system */
/* This section kept for backward compatibility only */
.qm-new-badge-large {
    display: inline-block;
    background: var(--qm-new-phase-badge, #F4A261);
    color: white;
    padding: 4px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(244, 162, 97, 0.25);
    /* Will be removed in future version - use .qm-badge .qm-badge--large instead */
}

.qm-new-content-item.qm-post-new:not(.qm-phase-new) .qm-new-badge-large {
    background: var(--qm-new-post-badge, #2A9D8F);
    box-shadow: 0 2px 8px rgba(42, 157, 143, 0.25);
}

/* Featured Image - platter for space saving */
.qm-content-image {
    position: relative;
    aspect-ratio: 3/1;
    overflow: hidden;
    background: #f5f5f5;
    z-index: 2;
}

.qm-new-content-showcase .qm-content-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    transition: var(--transition);
    /* Stronger specificity + important to override any conflicts */
}

.qm-content-item:hover .qm-content-image img {
    transform: scale(1.05);
}

/* Content Body */
.qm-content-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

/* Phase Badge - as overlay on image bottom */
.qm-content-phase {
    position: absolute;
    bottom: 8px;
    left: 8px;
    font-size: 0.65rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.25rem 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 0.25rem;
    backdrop-filter: blur(2px);
    z-index: 3;
}

/* Title - smaller for horizontal layout */
.qm-content-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    flex: 1;
}

/* Reduce spacing above title */
.qm-content-body .qm-content-title:first-child {
    margin-top: -0.5rem;
}

.qm-content-phase + .qm-content-title {
    margin-top: 0.5rem;
}

.qm-content-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.qm-content-title a:hover {
    color: var(--qm-title-hover, var(--qm-accent-color, #007cba));
}

/* Meta Information - horizontal layout with title */
.qm-content-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: nowrap;
    font-size: 0.8rem;
    color: var(--qm-text-muted, #666);
}

/* Title + Meta horizontal container */
.qm-title-meta-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.qm-content-date,
.qm-content-author {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Excerpt */
.qm-content-excerpt {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 1.25rem;
    flex: 1;
}

/* Characters */
.qm-content-characters {
    font-size: 0.8rem;
    color: var(--qm-text-muted, #666);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Read More Link - Clean styling matching timeline-posts */
.qm-content-actions {
    margin-top: auto;
}

.qm-read-more-new {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--qm-link-color, #007cba);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.qm-read-more-new:hover {
    color: var(--qm-link-hover, #005177);
    transform: translateX(4px);
}

/* Highlight Styles - DISABLED: All highlight styles removed for clean white cards */
/* Age badges are still shown via .qm-badge system */

/* Auto Refresh Indicator */
.qm-auto-refresh-indicator {
    text-align: center;
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.03);
    border-radius: var(--border-radius);
    color: var(--qm-text-muted, #666);
}

/* Empty State */
.qm-new-content-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--qm-text-muted, #666);
    font-style: italic;
    font-size: 1.1rem;
}

.qm-new-content-empty p {
    margin: 0;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.03);
    border-radius: var(--border-radius);
    border: 2px dashed rgba(0, 0, 0, 0.1);
}

/* Entrance Animations */
.qm-animate-entrance .qm-new-content-item {
    opacity: 0;
    transform: translateY(30px);
    animation: qm-slide-in-up 0.8s ease-out forwards;
}

@keyframes qm-slide-in-up {
    to {
        opacity: 1;
        transform: translateY(-4px);
    }
}

.qm-animate-entrance .qm-new-content-item:nth-child(1) { animation-delay: 0ms; }
.qm-animate-entrance .qm-new-content-item:nth-child(2) { animation-delay: 150ms; }
.qm-animate-entrance .qm-new-content-item:nth-child(3) { animation-delay: 300ms; }
.qm-animate-entrance .qm-new-content-item:nth-child(4) { animation-delay: 450ms; }
.qm-animate-entrance .qm-new-content-item:nth-child(5) { animation-delay: 600ms; }
.qm-animate-entrance .qm-new-content-item:nth-child(6) { animation-delay: 750ms; }

/* Responsive Design */
@media (max-width: 767px) {
    .qm-new-content-showcase {
        padding: 0 10px;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .qm-new-content-title {
        font-size: 1.5rem;
    }
    
    .qm-layout-featured .qm-new-content-grid {
        grid-template-areas: 
            "featured"
            "item1"
            "item2"
            "item3"
            "item4";
        grid-template-columns: 1fr;
    }
    
    .qm-content-body {
        padding: 1.25rem;
    }
    
    .qm-content-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .qm-new-badge-large {
        font-size: 0.65rem;
        padding: 6px 12px;
    }
    
    /* List layout responsive */
    .qm-layout-list .qm-new-content-item {
        flex-direction: column;
    }
    
    .qm-layout-list .qm-content-image {
        flex: none;
        width: 100%;
        aspect-ratio: 16/9;
    }
    
    .qm-layout-list .qm-content-body {
        padding: 1.25rem;
    }
}

/* Spacing Variations */
.qm-spacing-compact {
    --gap-size: 15px;
}

.qm-spacing-wide {
    --gap-size: 30px;
}

.qm-spacing-extra-wide {
    --gap-size: 40px;
}

/* Dark Mode Support - DISABLED */
/*
@media (prefers-color-scheme: dark) {
    .qm-new-content-item {
        background: #2a2a2a;
        border-color: #444;
        color: #fff;
    }
    
    .qm-content-meta {
        color: #ccc;
    }
    
    .qm-content-excerpt {
        color: #ddd;
    }
}
*/

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .qm-new-content-item,
    .qm-content-image img,
    .qm-read-more-new {
        transition: none;
    }
    
    .qm-new-content-item:hover {
        transform: none;
    }
    
    .qm-very-new {
        animation: none;
    }
    
    .qm-animate-entrance .qm-new-content-item {
        opacity: 1;
        transform: none;
        animation: none;
    }
}

/* Print Styles */
@media print {
    .qm-content-highlight,
    .qm-auto-refresh-indicator {
        display: none !important;
    }
    
    .qm-new-content-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Unified Badge System V2.0 - CSS Variables Fix - Cache bust: 1725901202 */
