/* Article card components - Card layouts, metadata, and interactions */
/* Requires: badges.css for topic-tag, shared-animations.css for transitions */

/* T021: Responsive article grid layout */
.articles-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.articles-grid[data-layout="triple"] {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

@media (max-width: 640px) {
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .articles-grid[data-layout="triple"] {
        grid-template-columns: 1fr;
    }
}

/* T015: Article card base styles with elevation */
/* WP03 T008: Enhanced with Y2K/Frutiger Aero glassmorphism */
/* Inspired by Windows Vista/7 Aero glass aesthetic */
.article-card {
    position: relative;
    border-radius: 1.5rem;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    cursor: pointer;

    /* Multi-layer Frutiger Aero glass background */
    /* NOTE: backdrop-filter removed for battery/CPU optimization - was causing device heating */
    background:
        /* Top glossy highlight - light source simulation */
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.12) 0%,
            rgba(255, 255, 255, 0.05) 20%,
            transparent 40%
        ),
        /* Theme color tint layer */
        linear-gradient(
            180deg,
            rgba(var(--primary-rgb), 0.08) 0%,
            rgba(var(--primary-rgb), 0.03) 50%,
            rgba(var(--primary-rgb), 0.06) 100%
        ),
        /* Solid dark base - increased opacity to compensate for removed blur */
        rgba(15, 23, 42, 0.94);

    /* Theme-colored border with glow */
    border: 1px solid rgba(var(--primary-rgb), 0.2);

    /* Layered shadows for depth + theme glow */
    box-shadow:
        /* Outer theme glow */
        0 4px 30px rgba(var(--primary-rgb), 0.15),
        0 8px 50px rgba(var(--primary-rgb), 0.08),
        /* Inner top highlight (glossy edge) */
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        /* Inner bottom shadow (3D depth) */
        inset 0 -1px 0 rgba(0, 0, 0, 0.15);

    /* Smooth Frutiger Aero transitions */
    transition:
        transform 0.4s cubic-bezier(0.075, 0.82, 0.165, 1),
        box-shadow 0.3s ease,
        border-color 0.3s ease,
        background 0.3s ease;
}

/* Glossy highlight sweep - visible on hover */
.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.08) 50%,
        transparent 100%
    );
    transform: skewX(-20deg);
    transition: left 0.6s cubic-bezier(0.075, 0.82, 0.165, 1);
    pointer-events: none;
    z-index: 1;
}

/* Theme-colored glow orb */
.article-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 60%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        rgba(var(--primary-rgb), 0.2) 0%,
        rgba(var(--primary-rgb), 0.08) 40%,
        transparent 70%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 0;
}

/* Hover state - enhanced Aero glass effect */
.article-card:hover {
    transform: translateY(-8px);
    border-color: rgba(var(--primary-rgb), 0.4);

    /* Enhanced glow on hover */
    box-shadow:
        /* Stronger outer theme glow */
        0 8px 40px rgba(var(--primary-rgb), 0.3),
        0 16px 70px rgba(var(--primary-rgb), 0.15),
        /* Bright inner highlight */
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

/* Shimmer sweep on hover */
.article-card:hover::before {
    left: 120%;
}

/* Glow orb visible on hover */
.article-card:hover::after {
    opacity: 1;
}

/* ============================================
   READ INDICATOR - Left Border/Ribbon Style
   Clear visual indicator for viewed articles
   ============================================ */

/* Read state base - left border ribbon effect */
.article-card.read {
    /* Theme-colored left border ribbon */
    border-left: 4px solid var(--primary);

    /* Subtle opacity reduction to show "already read" */
    opacity: 0.75;
}

/* Hide hover effects on read cards to avoid visual conflicts */
.article-card.read::before,
.article-card.read::after {
    display: none !important;
}

/* Hover on read cards - restore full opacity briefly */
.article-card.read:hover {
    opacity: 0.9;
    transform: translateY(-8px);
}

/* Dark mode read indicator adjustments */
[data-theme="dark"] .article-card.read {
    border-left-color: var(--primary);
    opacity: 0.7;
}

[data-theme="dark"] .article-card.read:hover {
    opacity: 0.9;
}

/* Light mode read indicator adjustments */
[data-theme="light"] .article-card.read {
    border-left-color: var(--primary);
    opacity: 0.65;
}

[data-theme="light"] .article-card.read:hover {
    opacity: 0.9;
}



/* ============================================
   DARK MODE - Full Frutiger Aero glass effect
   ============================================ */
[data-theme="dark"] .article-card {
    background:
        /* Glossy top highlight */
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.1) 0%,
            rgba(255, 255, 255, 0.03) 15%,
            transparent 35%
        ),
        /* Theme color tint */
        linear-gradient(
            180deg,
            rgba(var(--primary-rgb), 0.1) 0%,
            rgba(var(--primary-rgb), 0.04) 50%,
            rgba(var(--primary-rgb), 0.08) 100%
        ),
        /* Deep dark glass */
        rgba(10, 15, 30, 0.85);

    border-color: rgba(var(--primary-rgb), 0.25);

    box-shadow:
        0 4px 35px rgba(var(--primary-rgb), 0.2),
        0 10px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .article-card:hover {
    border-color: rgba(var(--primary-rgb), 0.5);
    box-shadow:
        0 10px 50px rgba(var(--primary-rgb), 0.35),
        0 20px 80px rgba(var(--primary-rgb), 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

/* ============================================
   LIGHT MODE - Clean glass with subtle tint
   ============================================ */
[data-theme="light"] .article-card {
    /* NOTE: backdrop-filter removed for battery/CPU optimization */
    background:
        /* Soft top highlight */
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.95) 0%,
            rgba(255, 255, 255, 0.85) 30%,
            rgba(255, 255, 255, 0.75) 100%
        ),
        /* Very subtle theme tint */
        linear-gradient(
            180deg,
            rgba(var(--primary-rgb), 0.03) 0%,
            transparent 50%,
            rgba(var(--primary-rgb), 0.02) 100%
        ),
        /* Solid white base for crisp appearance without blur */
        rgba(255, 255, 255, 0.98);

    border-color: rgba(var(--primary-rgb), 0.15);

    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.06),
        0 8px 40px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .article-card:hover {
    border-color: rgba(var(--primary-rgb), 0.3);
    box-shadow:
        0 8px 30px rgba(var(--primary-rgb), 0.12),
        0 16px 50px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset 0 -1px 0 rgba(0, 0, 0, 0.02);
}

/* Light mode shimmer is more subtle */
[data-theme="light"] .article-card::before {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(var(--primary-rgb), 0.06) 50%,
        transparent 100%
    );
}

/* Light mode glow orb - softer */
[data-theme="light"] .article-card::after {
    background: radial-gradient(
        ellipse at center,
        rgba(var(--primary-rgb), 0.1) 0%,
        rgba(var(--primary-rgb), 0.04) 40%,
        transparent 70%
    );
}

/* Article content layout */
.article-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    z-index: 2;
}

.article-content:focus-visible {
    outline: 2px solid rgba(var(--primary-rgb), 0.5);
    outline-offset: 6px;
    border-radius: 1rem;
}

.article-meta-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Frutiger Aero glossy pill chip */
.article-source-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-primary);
    text-transform: capitalize;
    position: relative;

    /* Glossy pill background */
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.15) 0%,
            rgba(255, 255, 255, 0.05) 50%,
            transparent 100%
        ),
        rgba(var(--primary-rgb), 0.12);

    border: 1px solid rgba(var(--primary-rgb), 0.25);

    box-shadow:
        0 2px 8px rgba(var(--primary-rgb), 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);

    transition: all 0.25s ease;
}

.article-source-chip:hover {
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.2) 0%,
            rgba(255, 255, 255, 0.08) 50%,
            transparent 100%
        ),
        rgba(var(--primary-rgb), 0.18);
    border-color: rgba(var(--primary-rgb), 0.4);
    box-shadow:
        0 4px 12px rgba(var(--primary-rgb), 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Glowing status dot */
/* NOTE: Animation changed from infinite to hover-only for battery/CPU optimization */
.article-source-chip::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.6);
    /* Animation only runs on hover - prevents dozens of simultaneous animations */
    animation: none;
    transition: box-shadow 0.3s ease;
}

/* Only animate the dot when hovering the chip or card */
.article-source-chip:hover::before,
.article-card:hover .article-source-chip::before {
    animation: chipPulse 2s ease-in-out infinite;
}

@keyframes chipPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.6); }
    50% { box-shadow: 0 0 12px rgba(var(--primary-rgb), 0.9); }
}

/* Light mode chip */
[data-theme="light"] .article-source-chip {
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.8) 0%,
            rgba(255, 255, 255, 0.5) 100%
        ),
        rgba(var(--primary-rgb), 0.08);
    border-color: rgba(var(--primary-rgb), 0.2);
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .article-source-chip::before {
    box-shadow: 0 0 6px rgba(var(--primary-rgb), 0.4);
}

.article-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.article-card h2 {
    font-size: var(--text-2xl);
    font-weight: var(--font-semibold);
    line-height: var(--leading-tight);
    letter-spacing: -0.01em;
    color: var(--color-text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color var(--duration-fast) var(--ease-in-out-smooth);
}

.article-card:hover h2 {
    color: var(--color-primary-600);
}

/* Summary wrapper - hidden by default, revealed on expand */
.article-summary-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    overflow: hidden; /* Clip content during collapse */
    transition: grid-template-rows 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Collapsed state - ensure content is fully hidden */
.article-summary-wrapper .article-summary-inner {
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s 300ms, opacity 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Expanded state reveals summary */
.article-card.details-expanded .article-summary-wrapper {
    grid-template-rows: 1fr;
}

.article-card.details-expanded .article-summary-wrapper .article-summary-inner {
    visibility: visible;
    opacity: 1;
    transition: visibility 0s, opacity 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Frutiger Aero inner glass panel */
.article-summary-inner {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    position: relative;
    overflow: hidden;
    min-height: 0; /* Required for CSS Grid 0fr collapse to fully hide element */

    /* Inner glass effect */
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.06) 0%,
            transparent 50%
        ),
        rgba(var(--primary-rgb), 0.04);

    border: 1px solid rgba(var(--primary-rgb), 0.12);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .article-summary-inner {
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.05) 0%,
            transparent 40%
        ),
        rgba(var(--primary-rgb), 0.06);
    border-color: rgba(var(--primary-rgb), 0.15);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .article-summary-inner {
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.6) 0%,
            rgba(255, 255, 255, 0.3) 100%
        ),
        rgba(var(--primary-rgb), 0.03);
    border-color: rgba(var(--primary-rgb), 0.1);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(0, 0, 0, 0.02);
}

.article-summary {
    margin: 0;
    color: var(--color-text-secondary);
}

.article-translation-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.article-translation-inline .translation-badge {
    background: rgba(var(--primary-rgb), 0.12);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    color: var(--color-primary-700);
}

/* Topics and tags */
.article-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

/* Article metadata section - Aero glass separator */
.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    margin-top: 0.5rem;
    gap: 1rem;
    position: relative;
    z-index: 5;
    pointer-events: auto;
    isolation: isolate;

    /* Glass separator line */
    border-top: 1px solid rgba(var(--primary-rgb), 0.12);
}

[data-theme="dark"] .article-footer {
    border-top-color: rgba(var(--primary-rgb), 0.15);
}

[data-theme="light"] .article-footer {
    border-top-color: rgba(var(--primary-rgb), 0.1);
}

.article-footer-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

/* WP04 T016: Details panel with CSS Grid accordion animation */
.details-panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.details-panel > .panel-content {
    overflow: hidden;
    min-height: 0; /* Required for CSS Grid 0fr collapse */
}

/* Expanded state - CSS Grid animation */
.article-card.details-expanded .details-panel {
    grid-template-rows: 1fr;
}

/* Details content panel - Frutiger Aero inner glass */
.details-content {
    margin-top: 1rem;
    padding: 1.25rem;
    border-radius: 1.25rem;

    /* Recessed glass panel effect */
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.04) 0%,
            transparent 30%
        ),
        rgba(var(--primary-rgb), 0.03);

    border: 1px solid rgba(var(--primary-rgb), 0.1);

    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .details-content {
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.03) 0%,
            transparent 25%
        ),
        rgba(var(--primary-rgb), 0.05);
    border-color: rgba(var(--primary-rgb), 0.15);
    box-shadow:
        inset 0 2px 6px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .details-content {
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.5) 0%,
            rgba(255, 255, 255, 0.2) 100%
        ),
        rgba(var(--primary-rgb), 0.02);
    border-color: rgba(var(--primary-rgb), 0.08);
    box-shadow:
        inset 0 1px 3px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* Toggle button - Frutiger Aero glossy pill button */
.details-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    color: var(--color-text-primary);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    position: relative;
    overflow: hidden;

    /* Glossy pill background */
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.12) 0%,
            rgba(255, 255, 255, 0.04) 50%,
            transparent 100%
        ),
        rgba(var(--primary-rgb), 0.1);

    border: 1px solid rgba(var(--primary-rgb), 0.2);

    box-shadow:
        0 2px 8px rgba(var(--primary-rgb), 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);

    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.details-toggle:hover {
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.18) 0%,
            rgba(255, 255, 255, 0.06) 50%,
            transparent 100%
        ),
        rgba(var(--primary-rgb), 0.18);
    border-color: rgba(var(--primary-rgb), 0.35);
    box-shadow:
        0 4px 12px rgba(var(--primary-rgb), 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.details-toggle:active {
    transform: translateY(0);
    box-shadow:
        0 1px 4px rgba(var(--primary-rgb), 0.15),
        inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Light mode toggle */
[data-theme="light"] .details-toggle {
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.8) 0%,
            rgba(255, 255, 255, 0.4) 100%
        ),
        rgba(var(--primary-rgb), 0.06);
    border-color: rgba(var(--primary-rgb), 0.15);
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .details-toggle:hover {
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.9) 0%,
            rgba(255, 255, 255, 0.5) 100%
        ),
        rgba(var(--primary-rgb), 0.1);
    border-color: rgba(var(--primary-rgb), 0.25);
    box-shadow:
        0 4px 10px rgba(var(--primary-rgb), 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 1);
}

/* WP04 T016: Toggle icon rotation */
.details-toggle .toggle-icon {
    transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Only rotate the top toggle icon - bottom toggle already shows correct direction */
.article-card.details-expanded .details-toggle:not(.bottom-toggle) .toggle-icon {
    transform: rotate(180deg);
}

/* Reduced motion support - Accessibility */
@media (prefers-reduced-motion: reduce) {
    .article-card {
        transition: none;
    }
    .article-card::before {
        animation: none;
        transition: none;
    }
    .article-card::after {
        transition: none;
        animation: none;
    }
    .article-source-chip::before {
        animation: none;
    }
    .details-panel {
        transition: none;
    }
    .details-toggle {
        transition: none;
    }
    .details-toggle .toggle-icon {
        transition: none;
    }
}

/* WP05 T022: Metadata accordion sections styling */
.metadata-accordions {
    margin-top: 1.5rem;
    border: 1px solid var(--color-border-subtle);
    border-radius: 0.5rem;
    overflow: hidden;
}

/* Metadata content sections */
.details-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem;
    background-color: var(--color-bg-elevated);
    border-radius: 0.375rem;
}

.detail-icon {
    color: var(--color-primary-600);
    margin-top: 0.125rem;
    flex-shrink: 0;
}

[data-theme="dark"] .detail-item {
    background-color: var(--overlay-subtle);
}

/* Impact Analysis section */
.impact-analysis p {
    line-height: 1.6;
    color: var(--color-text-secondary);
    margin: 0;
}

/* Actionable Insights section */
.actionable-insights .insights-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.insight-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: rgba(var(--primary-rgb), 0.05);
    border-left: 3px solid var(--color-primary-500);
    border-radius: 0.25rem;
}

.insight-icon {
    color: var(--color-primary-600);
    margin-top: 0.125rem;
    flex-shrink: 0;
}

[data-theme="dark"] .insight-item {
    background-color: rgba(var(--primary-rgb), 0.1);
}

/* Additional Context section */
.additional-context p {
    line-height: 1.6;
    color: var(--color-text-secondary);
    margin: 0;
}

/* No metadata fallback */
.no-metadata {
    padding: 2rem;
    text-align: center;
    color: var(--color-text-tertiary);
    font-style: italic;
}

/* Enhanced Accordion Styling within Article Cards */
.metadata-accordions .accordion-section {
    border-bottom: 1px solid var(--color-border-subtle);
    background-color: transparent;
}

.metadata-accordions .accordion-section:last-child {
    border-bottom: none;
}

.metadata-accordions .accordion-header {
    background-color: rgba(var(--primary-rgb), 0.02);
    border-left: 3px solid transparent;
    transition: all var(--duration-fast) ease;
}

.metadata-accordions .accordion-header:hover {
    background-color: rgba(var(--primary-rgb), 0.05);
    padding-left: 1.25rem; /* Slight slide effect */
}

.metadata-accordions .accordion-section.expanded .accordion-header {
    background-color: rgba(var(--primary-rgb), 0.08);
    border-left-color: var(--color-primary-500);
    color: var(--color-primary-700);
    font-weight: 600;
}

[data-theme="dark"] .metadata-accordions .accordion-header {
    background-color: rgba(255, 255, 255, 0.02);
}

[data-theme="dark"] .metadata-accordions .accordion-header:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .metadata-accordions .accordion-section.expanded .accordion-header {
    background-color: rgba(var(--primary-rgb), 0.15);
    color: var(--color-primary-300);
}

/* Reddit Metadata Styling */
.reddit-metadata-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    padding: 0.5rem 0;
}

.reddit-stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: var(--color-bg-elevated);
    border-radius: 0.5rem;
    border: 1px solid var(--color-border-subtle);
    transition: transform var(--duration-fast) var(--ease-out-back);
}

.reddit-stat-item:hover {
    transform: translateY(-2px);
    border-color: var(--color-primary-300);
}

.reddit-stat-item .stat-icon {
    font-size: 1.25rem;
    color: var(--color-primary-500);
    width: 24px;
    text-align: center;
}

.reddit-stat-item .stat-content {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.reddit-stat-item .stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-tertiary);
    font-weight: 600;
}

.reddit-stat-item .stat-value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dark mode adjustments for Reddit stats */
[data-theme="dark"] .reddit-stat-item {
    background-color: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .reddit-stat-item:hover {
    border-color: var(--color-primary-700);
    background-color: rgba(255, 255, 255, 0.05);
}

/* WP07 T033: Mobile Responsive Optimizations */
@media (max-width: 768px) {
    /* Single column layout */
    .articles-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    .article-card {
        padding: 1rem;
        min-height: auto;
    }

    /* Larger touch targets (≥44x44px for accessibility) */
    .details-toggle,
    .save-button,
    .share-button {
        min-width: 44px;
        min-height: 44px;
        padding: 0.75rem;
    }

    /* Smaller badge sizes for mobile */
    .quality-score,
    .novelty-score {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    /* Stack badges vertically if needed */
    .article-badges {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Adjust title for mobile (3 lines instead of 2) */
    .article-card h2 {
        font-size: 1.125rem;
        -webkit-line-clamp: 3;
    }

    /* Adjust metadata for mobile */
    .article-footer {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .article-footer-left {
        flex-wrap: wrap;
    }

    /* Accordion adjustments */
    .accordion-header {
        padding: 0.75rem;
        font-size: 0.9375rem;
    }

    .accordion-inner {
        padding: 0 0.75rem;
    }

    /* Details panel adjustments */
    .details-content {
        padding: 0.75rem;
    }

    .metadata-accordions {
        margin-top: 1rem;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .article-card {
        padding: 0.75rem;
        border-radius: 0.75rem;
    }

    .article-card h2 {
        font-size: 1rem;
    }

    .details-content {
        padding: 0.5rem;
    }

    /* Make sure touch targets remain adequate */
    .details-toggle {
        padding: 0.875rem 1rem;
    }

    /* Smaller spacing for very small screens */
    .article-badges {
        gap: 0.375rem;
    }

    .article-footer {
        gap: 0.5rem;
        padding-top: 0.75rem;
    }
}
