/* ===== Custom variables for article list (fallbacks) ===== */

:root {
    --accent: #3b82f6;
    --hover-glow: rgba(59, 130, 246, 0.4);
    --card-bg: var(--neutral-bg, #1e1e2a);
    --card-border: var(--border-color, #2c2c2c);
    --tag-bg: var(--gray-state-2, #3f3f3f);
    --tag-text: var(--text-color, #d9d9d9)
}


/* ========== ARTICLE CARD FONTS ========== */

/* Headers */
#title,
#articleNumber {
    font-family: 'Outfit', 'Segoe UI', 'Helvetica Neue', system-ui, sans-serif;
}

/* Body */
#description,
#author,
#date,
.tag {
    font-family: 'Plus Jakarta Sans', 'Inter', 'Roboto', system-ui, sans-serif;
}


/* ========== ARTICLE LIST (FLATTENED) STYLE ========== */

.body-flex {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 10rem;
    margin-bottom: 10rem;
    gap: 5rem;
}

/* Overlay for Gradient bar on top of article */
.body-flex .article-container::before {
    content: '';
    position: absolute;
    z-index: 1;
    top: 0;
    left: 0;
    width: 100%;
    height: 6.25px;

    background: linear-gradient(90deg, #ef4444, #eab308, #3b82f6, #10b981);
    border-radius: 1.5rem 1.5rem 0 0;
    opacity: 0.85;
    transition: opacity 0.3s ease;
}

/* Article BORDER & BORDER SHADOWS hover effect */
.body-flex .article-container:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--hover-glow), 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* Overlay for hover Gradient on article */
.body-flex .article-container::after {
    content: '';
    position: absolute;
    inset: 0;

    background: radial-gradient(circle at 0% 0%, rgba(59, 130, 246, 0.08), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* Article Gradient animation on hover */
.body-flex .article-container:hover::before {
    background: linear-gradient(90deg, #ef4444, #eab308, #3b82f6, #10b981, #3b82f6, #eab308, #ef4444);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    opacity: 1;
}

@keyframes shimmer {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

.body-flex .article-container:hover::after {
    opacity: 1;
}


/* Article container */
.body-flex .article-container {
    position: relative;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;

    width: 70vw;
    height: auto;

    overflow: hidden;
    cursor: pointer;
    padding: 1.2rem 1rem;
    margin: 0;
    gap: 1rem;

    border-width: 6px;
    border-radius: 1.5rem;

    background: var(--card-bg);
    border-color: var(--card-border);

    box-shadow: 0px 0px 18px 2px rgba(74, 80, 110, 0.3);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}


/* Header-body-footer container */
.body-flex .article-container .header-body-footer-container {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: column;
    flex-wrap: wrap;
    height: auto;
    align-items: flex-start;
    justify-content: space-between;
    align-self: stretch;

    padding-left: 0.5rem;
    padding-top: 0.5rem;
    gap: 0.5rem;
}


/* Article header container */
.body-flex .article-container .header-body-footer-container .article-header-container {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    height: auto;
    align-items: flex-start;
    gap: 0.6rem;
}


/* Metadata container (id + tags) */
.body-flex .article-container .header-body-footer-container .article-header-container .article-metadata-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    height: auto;
    gap: 1.5rem;
    margin-bottom: 0.3rem;
}

/* Article number */
.body-flex .article-container .header-body-footer-container .article-header-container .article-metadata-container #articleNumber {
    font-size: 1.15rem;
    letter-spacing: 0.075em;
    text-transform: uppercase;
    font-weight: 500;

}

/* Tag container */
.body-flex .article-container .header-body-footer-container .article-header-container .article-metadata-container .tag-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Individual tag */
.body-flex .article-container .header-body-footer-container .article-header-container .article-metadata-container .tag-container .tag {
    font-size: 1rem;
    font-weight: 500;
    padding: 0.25rem 0.75rem;

    border-radius: 9999px;
    background: var(--tag-bg);
    color: var(--tag-text);
    transition: transform 0.1s ease, box-shadow 0.2s ease;
}

/* Tag hover animation */
.body-flex .article-container .tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Article title */
.body-flex .article-container .header-body-footer-container .article-header-container #title {
    font-size: 2.4rem;
    letter-spacing: -0.015em;
    font-weight: 600;
    line-height: 1.2;
}

/* Article title color shift on hover */
.body-flex .article-container:hover #title {
    color: var(--accent);
    transition: color 0.2s ease;
}

/* Article body container */
.body-flex .article-container .header-body-footer-container .article-body-container {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    justify-content: space-between;

    width: auto;
    height: auto;
    gap: 0.5rem;
}

/* Horizontal rule inside body */
.body-flex .article-container .header-body-footer-container .article-body-container .article-rules {
    margin: 0.5rem 0 0.25rem 0;
    border: 0;
    height: 2.75px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.3;
}

/* Description text */
.body-flex .article-container .header-body-footer-container .article-body-container #description {
    font-size: 1.25rem;
    letter-spacing: 0.0175em;
    line-height: 1.45;
    font-weight: 400;
}

/* Article footer container */
.body-flex .article-container .header-body-footer-container .article-footer-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    height: auto;
    width: auto;

    gap: 5rem;
    padding-left: 0.5rem;
}

/* Author */
.body-flex .article-container .header-body-footer-container .article-footer-container #author {
    font-size: 1rem;
    font-weight: 400;
}

#author:empty {
    display: none;
}

/* Date */
.body-flex .article-container .header-body-footer-container .article-footer-container #date {
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.05em;
}

/* Article image */
.body-flex .article-container .article-image {
    flex-shrink: 0;
    aspect-ratio: 8/5.5;
    width: 18.5rem;
    height: auto;
    margin-right: 0.5rem;

    border-color: #c5c5d4;
    border-width: 3px;
    border-radius: 1rem;
    transition: box-shadow 0.2s ease;
}

/* Article Image scaling on hover */
.body-flex .article-container:hover .article-image {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

.dark .article-image {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* ===== Mobile Layout ===== */

@media (max-width: 640px) {

    .body-flex .article-container {
        flex-direction: column;
        align-items: stretch;
        width: 92vw;
        padding: 1rem;
        padding-top: 1.5rem;
    }

    .body-flex .article-container .header-body-footer-container {
        display: contents;
    }

    .body-flex .article-container .article-header-container {
        order: 1;
    }

    .body-flex .article-container .article-body-container {
        order: 2;
    }

    .body-flex .article-container .header-body-footer-container .article-header-container #title {
        font-size: 1.8rem;
    }

    .body-flex .article-container .header-body-footer-container .article-header-container .article-metadata-container #articleNumber {
        font-size: 1rem;
    }

    .body-flex .article-container .header-body-footer-container .article-header-container .article-metadata-container .tag-container .tag {
        font-size: 0.85rem;
        padding: 0.25rem 0.60rem;
    }


    .body-flex .article-container .header-body-footer-container .article-body-container #description {
        font-size: 1rem;
    }

    .body-flex .article-container .header-body-footer-container .article-footer-container #date,
    .body-flex .article-container .header-body-footer-container .article-footer-container #author {
        font-size: 0.85rem;
    }

    .body-flex .article-container .header-body-footer-container .article-body-container .article-rules {
        display: none;
    }

    .body-flex .article-container .article-image {
        order: 3;
        object-fit: cover;
        align-self: center;
        margin: 0.75rem 0;
        border-radius: 1rem;

        width: 15rem;
        height: auto;
    }

    .body-flex .article-container .header-body-footer-container .article-footer-container {
        order: 4;
        gap: 2rem;
        margin-top: 0.5rem;
        width: 100%;
    }

}