/* Article Page CSS - Apple-inspired Minimal Design */

/* Article Hero Section */
.article-hero {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.2) 100%), url("../images/background.png");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
}
.article-hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 113, 227, 0.1) 0%, rgba(0, 0, 0, 0.3) 100%);
    opacity: 0.8;
}

.article-hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 80px 24px;
}

.article-hero-title {
    font-size: clamp(36px, 6vw, 56px);
    font-weight: 700;
    margin-bottom: 24px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.article-hero-subtitle {
    font-size: 20px;
    margin-bottom: 40px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: -0.01em;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Featured Articles Section */
.featured-articles {
    padding: 100px 0;
    background: #ffffff;
    /* Optimize for better performance */
    contain: layout style;
    transform: translateZ(0);
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
    gap: 32px;
    margin-top: 48px;
    /* Performance optimization */
    contain: layout style;
    transform: translateZ(0);
}

.featured-article {
    background: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    transform: translateZ(0);
    will-change: transform;
    contain: layout style paint;
}

.featured-article:hover {
    transform: translateY(-8px) translateZ(0);
    box-shadow: 0 20px 64px rgba(0, 0, 0, 0.12);
}

.article-image {
    position: relative;
    height: 280px;
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0) scale(1);
    contain: layout style paint;
}

.featured-article:hover .article-image img {
    transform: translateZ(0) scale(1.05);
}

.article-category {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 113, 227, 0.9);
    backdrop-filter: blur(8px);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.article-content {
    padding: 32px;
}

.article-content h3 {
    font-size: 24px;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 16px;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.article-content p {
    font-size: 17px;
    color: #424245;
    line-height: 1.6;
    margin-bottom: 20px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    color: #6e6e73;
    font-size: 15px;
}

.read-time::before {
    content: "•";
    margin-right: 16px;
}

.article-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #0071e3;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
}

.article-link:hover {
    color: #0077ed;
    transform: translateX(4px);
}

.article-link::after {
    content: "→";
    transition: transform 0.3s ease;
}

.article-link:hover::after {
    transform: translateX(4px);
}

/* Article Categories Section */
.article-categories {
    padding: 100px 0;
    background: #fafafa;
    /* Optimize for better performance */
    contain: layout style;
    transform: translateZ(0);
}

/* Category Tabs */
.category-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 64px;
    flex-wrap: wrap;
}

.category-tab {
    padding: 12px 24px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #ffffff;
    color: #424245;
    border-radius: 24px;
    font-weight: 500;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.category-tab::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 113, 227, 0.1), transparent);
    transition: left 0.5s ease;
}

.category-tab:hover::before {
    left: 100%;
}

.category-tab:hover {
    border-color: rgba(0, 113, 227, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 113, 227, 0.15);
}

.category-tab.active {
    background: #0071e3;
    color: #ffffff;
    border-color: #0071e3;
    box-shadow: 0 4px 16px rgba(0, 113, 227, 0.3);
}

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 32px;
    margin-top: 32px;
    /* Performance optimization */
    contain: layout style;
    transform: translateZ(0);
}

.article-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
    opacity: 1;
    transform: translateY(0) translateZ(0);
    will-change: transform;
    contain: layout style paint;
}

.article-card.hidden {
    opacity: 0;
    transform: translateY(20px) translateZ(0);
    pointer-events: none;
}

.article-card:hover {
    transform: translateY(-6px) translateZ(0);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0) scale(1);
    contain: layout style paint;
}

.article-card:hover .card-image img {
    transform: translateZ(0) scale(1.08);
}

.card-category {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(29, 29, 31, 0.85);
    backdrop-filter: blur(8px);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 16px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.card-content {
    padding: 24px;
}

.card-content h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 12px;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.card-content p {
    font-size: 16px;
    color: #424245;
    line-height: 1.6;
    margin-bottom: 16px;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #6e6e73;
    font-size: 14px;
    font-weight: 500;
}

.card-meta .read-time::before {
    content: "•";
    margin-right: 12px;
}

/* Newsletter Signup */
.newsletter-signup {
    padding: 100px 0;
    background: linear-gradient(135deg, #0071e3 0%, #0056b3 100%);
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

.newsletter-signup::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="newsletter-pattern" width="50" height="50" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23newsletter-pattern)"/></svg>');
    opacity: 0.3;
}

.newsletter-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.newsletter-content h2 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.newsletter-content p {
    font-size: 18px;
    margin-bottom: 32px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
}

.newsletter-form {
    display: flex;
    gap: 16px;
    max-width: 480px;
    margin: 0 auto;
}

.newsletter-form input {
    flex: 1;
    padding: 16px 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    color: #ffffff;
    transition: all 0.3s ease;
}

.newsletter-form input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.newsletter-form input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.newsletter-form button {
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    background: #ffffff;
    color: #0071e3;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    white-space: nowrap;
}

.newsletter-form button:hover {
    background: #f5f5f7;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Navigation active state for article page */
.nav-list a.active {
    color: #0071e3;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .featured-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .articles-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 24px;
    }

    .category-tabs {
        gap: 8px;
    }

    .category-tab {
        padding: 10px 20px;
        font-size: 15px;
    }
}

@media (max-width: 768px) {
    .article-hero {
        min-height: 50vh;
    }

    .article-hero-content {
        padding: 60px 20px;
    }

    .featured-articles,
    .article-categories,
    .newsletter-signup {
        padding: 80px 0;
    }

    .featured-grid,
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .featured-article,
    .article-card {
        margin: 0 16px;
    }

    .article-image,
    .card-image {
        height: 180px;
    }

    .article-content {
        padding: 24px;
    }

    .card-content {
        padding: 20px;
    }

    .newsletter-form {
        flex-direction: column;
        gap: 12px;
    }

    .newsletter-form button {
        padding: 14px 24px;
    }

    .category-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        padding: 0 24px 16px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .category-tabs::-webkit-scrollbar {
        display: none;
    }

    .category-tab {
        flex-shrink: 0;
        padding: 8px 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .article-hero-content {
        padding: 40px 16px;
    }

    .article-hero-title {
        font-size: clamp(28px, 8vw, 40px);
    }

    .article-hero-subtitle {
        font-size: 18px;
    }

    .featured-articles,
    .article-categories,
    .newsletter-signup {
        padding: 60px 0;
    }

    .section-title {
        font-size: 32px;
        margin-bottom: 40px;
    }

    .featured-article,
    .article-card {
        margin: 0 12px;
    }

    .article-content,
    .card-content {
        padding: 20px;
    }

    .article-content h3 {
        font-size: 20px;
    }

    .card-content h3 {
        font-size: 18px;
    }

    .newsletter-content h2 {
        font-size: 28px;
    }

    .newsletter-content p {
        font-size: 16px;
    }
}

/* Animation keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Utility classes for animations */
.fade-in-up {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.fade-in-up.delayed {
    animation-delay: 0.2s;
}

/* Smooth transitions for filtering */
.articles-grid .article-card {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}

/* Loading state for articles */
.articles-grid.loading .article-card {
    opacity: 0.6;
    pointer-events: none;
}
