/**
 * News Section - Modern Magazine Design
 * Editorial-style cards with dynamic content
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

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

.news-section {
    padding: 6rem 0;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 1) 0%,
        rgba(240, 249, 255, 0.3) 50%,
        rgba(255, 255, 255, 1) 100%
    );
    position: relative;
    overflow: hidden;
}

/* Section Header */
.news-section .section-header {
    text-align: center;
    margin-bottom: 4rem;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

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

.news-section .section-label {
    display: inline-block;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #0EA5E9;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(6, 186, 199, 0.08) 100%);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(14, 165, 233, 0.2);
}

.news-section .section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    color: #0F172A;
    margin: 0;
    letter-spacing: -0.02em;
}

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

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s backwards;
}

/* ========================================
   News Card
   ======================================== */

.news-card {
    position: relative;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.06),
        0 0 0 1px rgba(14, 165, 233, 0.04);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    user-select: none;
    animation: cardReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) backwards;
    display: flex;
    flex-direction: column;
}

/* Staggered card animations */
.news-card:nth-child(1) { animation-delay: 0.1s; }
.news-card:nth-child(2) { animation-delay: 0.2s; }
.news-card:nth-child(3) { animation-delay: 0.3s; }

@keyframes cardReveal {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Gradient border on hover */
.news-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 2px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.4), rgba(6, 186, 199, 0.4));
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.news-card:hover::before {
    opacity: 1;
}

.news-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow:
        0 20px 40px rgba(14, 165, 233, 0.15),
        0 0 0 1px rgba(14, 165, 233, 0.1);
    background: rgba(255, 255, 255, 0.95);
}

.news-card:active {
    transform: translateY(-8px) scale(1.01);
    transition-duration: 0.1s;
}

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

.news-image {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-card:hover .news-image img {
    transform: scale(1.1);
}

/* Image placeholder when no image */
.news-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(6, 186, 199, 0.08) 100%);
    position: relative;
}

.news-image-placeholder::before {
    content: '📰';
    font-size: 64px;
    opacity: 0.3;
}

/* Category Badge */
.news-category-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: #0EA5E9;
    border: 1px solid rgba(14, 165, 233, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

/* Date Badge */
.news-date {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.6875rem;
    font-weight: 600;
    color: white;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.375rem 0.75rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    z-index: 2;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    width: fit-content;
    max-width: none;
}

.news-date svg {
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    display: block;
}

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

.news-content {
    padding: 1.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.8125rem;
    color: #64748B;
    font-weight: 500;
}

.news-meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.news-meta-separator {
    color: #CBD5E1;
}

.news-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.375rem;
    font-weight: 700;
    color: #0F172A;
    margin: 0 0 0.75rem;
    letter-spacing: -0.02em;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-excerpt {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #64748B;
    margin: 0 0 1.5rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #0EA5E9;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    align-self: flex-start;
}

.news-link svg {
    transition: transform 0.3s ease;
}

.news-card:hover .news-link {
    transform: translateX(4px);
}

.news-card:hover .news-link svg {
    transform: translateX(4px);
}

/* ========================================
   Loading & Error States
   ======================================== */

.news-loading,
.news-error,
.news-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
}

.news-loading p,
.news-error p,
.news-empty p {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.125rem;
    color: #64748B;
    margin: 0;
}

.news-error p {
    color: #EF4444;
}

/* Loading spinner */
.news-loading::before {
    content: '';
    display: inline-block;
    width: 40px;
    height: 40px;
    margin-bottom: 1rem;
    border: 4px solid rgba(14, 165, 233, 0.1);
    border-top-color: #0EA5E9;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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

.news-section .section-cta {
    text-align: center;
    margin-top: 4rem;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.5s backwards;
}

.news-section .btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    color: #0EA5E9;
    background: white;
    border: 2px solid rgba(14, 165, 233, 0.2);
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.news-section .btn-outline:hover {
    background: #F0F9FF;
    border-color: #0EA5E9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

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

@media (max-width: 1200px) {
    .news-grid {
        gap: 1.75rem;
    }
}

@media (max-width: 1024px) {
    .news-section {
        padding: 5rem 0;
    }

    .news-section .section-title {
        font-size: 2.5rem;
    }

    .news-grid {
        gap: 1.5rem;
    }
}

@media (max-width: 900px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Hide third news item on tablets */
    .news-card:nth-child(3) {
        display: none;
    }
}

@media (max-width: 768px) {
    .news-section {
        padding: 4rem 0;
    }

    .news-section .section-header {
        margin-bottom: 3rem;
    }

    .news-section .section-title {
        font-size: 2rem;
    }

    .news-image {
        height: 200px;
    }

    .news-card:hover {
        transform: translateY(-6px) scale(1.01);
    }
}

@media (max-width: 600px) {
    .news-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    /* Show only 2 news items on mobile */
    .news-card:nth-child(3) {
        display: none;
    }

    .news-card:nth-child(n+3) {
        display: none;
    }
}

@media (max-width: 480px) {
    .news-section .section-title {
        font-size: 1.75rem;
    }

    .news-content {
        padding: 1.5rem;
    }

    .news-title {
        font-size: 1.25rem;
    }

    .news-excerpt {
        font-size: 0.875rem;
    }
}

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

@media (prefers-reduced-motion: reduce) {
    .news-card,
    .news-section .section-header,
    .news-section .section-cta,
    .news-image img {
        animation: none;
        transition: none;
    }
}
