/* ========================================
   ARTICLES PAGE STYLING
   Premium Editorial Design with Consistent Layout
   ======================================== */

/* ========================================
   ARTICLES PAGE HERO SECTION - SPLIT LAYOUT
   ======================================== */

.articles-page-hero {
    position: relative;
    width: 100%;
    min-height: 500px;
    background: linear-gradient(135deg, #0a0e1a 0%, #0f1b2e 50%, #162d4d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 3;
}

.articles-page-hero .hero-wave-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.articles-page-hero .wave-svg {
    width: 200%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    will-change: transform;
}

.articles-page-hero .wave {
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    will-change: transform;
}

.articles-page-hero .wave-1 {
    animation: wave-motion-1 20s linear infinite;
}

.articles-page-hero .wave-2 {
    animation: wave-motion-2 25s linear infinite;
}

.articles-page-hero .wave-3 {
    animation: wave-motion-3 30s linear infinite;
}

/* Split layout - Title left, Featured article right */
.articles-hero-split {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 45% 55%;
    gap: var(--spacing-3xl);
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-3xl) var(--spacing-lg);
    width: 100%;
}

.articles-hero-left {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.articles-hero-title {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 800;
    color: #FFFFFF;
    margin: 0;
    letter-spacing: -1.5px;
    line-height: 1.1;
}

.articles-hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    line-height: 1.6;
}

/* Scroll Down Button */
.scroll-down-button {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    margin-top: var(--spacing-lg);
    background: linear-gradient(135deg, rgba(66, 213, 232, 0.2) 0%, rgba(66, 213, 232, 0.1) 100%);
    border: 2px solid #42D5E8;
    border-radius: 8px;
    color: #42D5E8;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    width: fit-content;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(66, 213, 232, 0.3);
    animation: glow-pulse 2s ease-in-out infinite;
}

.scroll-down-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(66, 213, 232, 0.2);
    transition: left 0.4s ease;
    z-index: -1;
}

.scroll-down-button:hover {
    background: linear-gradient(135deg, rgba(66, 213, 232, 0.3) 0%, rgba(66, 213, 232, 0.2) 100%);
    border-color: #42D5E8;
    box-shadow: 0 0 40px rgba(66, 213, 232, 0.5);
    transform: translateY(-2px);
}

.scroll-down-button:hover::before {
    left: 100%;
}

.scroll-down-button .scroll-icon {
    animation: bounce-down 1.5s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(66, 213, 232, 0.3), inset 0 0 10px rgba(66, 213, 232, 0.1);
    }
    50% {
        box-shadow: 0 0 30px rgba(66, 213, 232, 0.5), inset 0 0 15px rgba(66, 213, 232, 0.2);
    }
}

@keyframes bounce-down {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(4px);
    }
}

/* Articles Count Header - Moved to top */
.articles-count-header {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    margin: 0 0 var(--spacing-2xl) 0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Load More Button Container */
.articles-load-more-container {
    display: flex;
    justify-content: center;
    padding: var(--spacing-3xl) var(--spacing-lg) 0;
    width: 100%;
}

.articles-load-more-btn {
    padding: var(--spacing-md) var(--spacing-2xl);
    background: linear-gradient(135deg, rgba(66, 213, 232, 0.15) 0%, rgba(66, 213, 232, 0.08) 100%);
    border: 2px solid #42D5E8;
    border-radius: 8px;
    color: #42D5E8;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.articles-load-more-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(66, 213, 232, 0.2);
    transition: left 0.4s ease;
    z-index: -1;
}

.articles-load-more-btn:hover {
    background: linear-gradient(135deg, rgba(66, 213, 232, 0.25) 0%, rgba(66, 213, 232, 0.15) 100%);
    border-color: #42D5E8;
    box-shadow: 0 0 30px rgba(66, 213, 232, 0.3);
    transform: translateY(-2px);
}

.articles-load-more-btn:hover::before {
    left: 100%;
}

.articles-load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.articles-load-more-btn.loading {
    animation: pulse-loading 1.5s ease-in-out infinite;
}

@keyframes pulse-loading {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

.articles-hero-right {
    display: flex;
    align-items: stretch;
    justify-content: center;
}

/* ========================================
   FEATURED ARTICLE HERO COMPONENT
   ======================================== */

.featured-article-hero {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    transition: all var(--transition-smooth);
    width: 100%;
    max-width: 550px;
    padding: var(--spacing-lg);
    height: fit-content;
}

.featured-article-hero:hover {
    border-color: rgba(66, 213, 232, 0.3);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 8px 32px rgba(66, 213, 232, 0.1);
}

/* Fixed aspect ratio for consistent sizing - 16:9 with fixed dimensions */
.featured-article-hero-image {
    position: relative;
    width: 100%;
    height: 315px;
    max-width: 560px;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
}

.featured-article-hero-image-link {
    display: block;
    text-decoration: none;
    overflow: hidden;
    border-radius: 8px;
}

.featured-article-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform var(--transition-smooth);
}

.featured-article-hero:hover .featured-article-hero-image img {
    transform: scale(1.05);
}

/* Placeholder for missing images */
.featured-article-hero-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(40, 72, 115, 0.4) 0%, rgba(30, 50, 80, 0.4) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.2);
    font-size: 3rem;
}

.featured-article-hero-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.featured-article-hero-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.85rem;
    flex-wrap: wrap;
}

.featured-article-hero-category {
    display: inline-block;
    background: rgba(66, 213, 232, 0.15);
    color: #42D5E8;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    white-space: nowrap;
}

.featured-article-hero-date {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.featured-article-hero-title {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: 800;
    color: #FFFFFF;
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-article-hero-title a {
    color: #FFFFFF;
    text-decoration: none;
    transition: color var(--transition-base);
}

.featured-article-hero-title a:hover {
    color: #42D5E8;
}

.featured-article-hero-excerpt {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-article-hero-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.9rem;
    font-weight: 600;
    color: #FFFFFF;
    text-decoration: none;
    background-color: rgba(66, 213, 232, 0.1);
    border: 1px solid rgba(66, 213, 232, 0.3);
    border-radius: 6px;
    transition: all var(--transition-base);
    white-space: nowrap;
    width: fit-content;
    cursor: pointer;
}

.featured-article-hero-cta:hover {
    background-color: rgba(66, 213, 232, 0.15);
    border-color: rgba(66, 213, 232, 0.5);
    box-shadow: 0 4px 12px rgba(66, 213, 232, 0.15);
    gap: var(--spacing-md);
}

.featured-article-hero-cta svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ========================================
   ARTICLES FILTER SECTION
   ======================================== */

.articles-filter-section {
    position: relative;
    background: linear-gradient(135deg, #0a0e1a 0%, #0f1b2e 50%, #162d4d 100%);
    padding: var(--spacing-2xl) 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 2;
}

.articles-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    width: 100%;
}

.articles-controls {
    display: flex;
    gap: var(--spacing-lg);
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: var(--spacing-2xl);
    padding-bottom: var(--spacing-2xl);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.articles-search-group {
    flex: 1 1 60%;
    min-width: 400px;
}

.articles-search {
    position: relative;
    width: 100%;
}

.articles-search-input {
    width: 100%;
    height: 40px;
    padding: var(--spacing-sm) var(--spacing-md);
    padding-right: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(66, 213, 232, 0.2);
    border-radius: 6px;
    color: #FFFFFF;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.articles-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.articles-search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(66, 213, 232, 0.4);
}

.articles-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.articles-search-clear:hover {
    /* No hover effects */
}

.articles-search-clear svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.articles-filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    flex: 0 1 30%;
    min-width: 200px;
}

.articles-filter-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.articles-filter-select {
    height: 40px;
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(66, 213, 232, 0.2);
    border-radius: 6px;
    color: #FFFFFF;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-base);
    box-sizing: border-box;
}

.articles-filter-select:hover {
    border-color: rgba(66, 213, 232, 0.3);
}

.articles-filter-select:focus {
    outline: none;
    border-color: rgba(66, 213, 232, 0.5);
    box-shadow: 0 0 12px rgba(66, 213, 232, 0.1);
}

.articles-filter-select option {
    background: #0a0e1a;
    color: #FFFFFF;
}

.articles-reset-btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.articles-reset-btn:hover {
    border-color: rgba(255, 255, 255, 0.6);
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.05);
}

.articles-count {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

/* ========================================
   ARTICLES GRID SECTION - CONSISTENT SIZING
   ======================================== */

.articles-grid-section {
    position: relative;
    background: linear-gradient(135deg, #0a0e1a 0%, #0f1b2e 50%, #162d4d 100%);
    padding: var(--spacing-3xl) 0;
    z-index: 2;
    width: 100%;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: var(--spacing-xl);
    auto-rows: auto;
    width: 100%;
}

/* Wide grid layout specific to articles page */
.articles-grid-wide-container {
    max-width: 100% !important;
    padding: 0 var(--spacing-lg) !important;
}

.articles-grid-wide {
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)) !important;
}

/* Article Card - Consistent sizing */
.articles-grid .card {
    background: #FFFFFF !important;
    border: 1px solid rgba(66, 213, 232, 0.15) !important;
    transition: all var(--transition-smooth);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.articles-grid .card:hover {
    border-color: rgba(66, 213, 232, 0.4) !important;
    transform: translateY(-4px);
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(66, 213, 232, 0.15);
}

/* Fixed image size - 16:9 aspect ratio with fixed dimensions */
.articles-grid .card-image {
    width: 100%;
    height: 180px;
    max-width: 400px;
    overflow: hidden;
    background: #0f1e35;
    flex-shrink: 0;
}

.articles-grid .card-image-link {
    display: block;
    text-decoration: none;
    overflow: hidden;
}

.articles-grid .card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    transition: transform var(--transition-smooth);
}

.articles-grid .card:hover .card-image img {
    transform: scale(1.05);
}

/* Empty placeholder for missing images */
.articles-grid .card-image:has(+ .card-title) {
    background: linear-gradient(135deg, rgba(30, 50, 80, 0.5) 0%, rgba(20, 40, 70, 0.5) 100%);
}

/* Card content - Consistent spacing */
.articles-grid .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
}

/* Title truncation - max 2 lines */
.articles-grid .card-title {
    margin: 0;
    font-size: clamp(1rem, 3vw, 1.15rem);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.articles-grid .card-title a {
    transition: color var(--transition-base);
}

.articles-grid .card:hover .card-title a {
    color: #42D5E8;
}

/* Meta information */
.articles-grid .card-meta {
    font-size: 0.85rem;
    color: rgba(16, 28, 53, 0.6);
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    align-items: center;
    margin: 0;
}

/* Excerpt - Fixed lines with reduced gap from meta */
.articles-grid .card-excerpt {
    font-size: 0.9rem;
    color: rgba(16, 28, 53, 0.7);
    line-height: 1.5;
    margin: 0;
    margin-top: 0.25rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Footer - Always at bottom */
.articles-grid .card-footer {
    margin-top: auto;
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(66, 213, 232, 0.1);
}

.articles-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--spacing-4xl) var(--spacing-2xl);
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1200px) {
    .articles-hero-split {
        grid-template-columns: 1fr;
        gap: var(--spacing-2xl);
    }

    .articles-hero-right {
        justify-content: flex-start;
    }

    .featured-article-hero {
        max-width: 100%;
    }

    .articles-grid {
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    }
}

@media (max-width: 768px) {
    .articles-page-hero {
        min-height: auto;
    }

    .articles-hero-split {
        padding: var(--spacing-2xl) var(--spacing-lg);
        gap: var(--spacing-2xl);
    }

    .articles-hero-title {
        font-size: clamp(1.8rem, 6vw, 2.5rem);
    }

    .articles-hero-subtitle {
        font-size: clamp(0.9rem, 2vw, 1.1rem);
    }

    .scroll-down-button {
        padding: var(--spacing-md) var(--spacing-lg);
        font-size: 0.9rem;
    }

    .articles-controls {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-md);
    }

    .articles-search,
    .articles-filter-group,
    .articles-reset-btn {
        width: 100%;
    }

    .articles-filter-group {
        min-width: auto;
    }

    .articles-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .articles-filter-section {
        padding: var(--spacing-2xl) 0;
    }

    .articles-grid-section {
        padding: var(--spacing-2xl) 0;
    }
}

@media (max-width: 480px) {
    .articles-hero-split {
        padding: var(--spacing-lg);
    }

    .articles-hero-title {
        font-size: clamp(1.5rem, 5vw, 2rem);
    }

    .scroll-down-button {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.85rem;
        gap: var(--spacing-sm);
        width: 100%;
        justify-content: center;
    }

    .articles-section-title {
        font-size: clamp(1.5rem, 5vw, 2rem);
        margin-bottom: var(--spacing-2xl);
    }

    .featured-article-hero {
        padding: var(--spacing-md);
    }

    .featured-article-hero-title {
        font-size: clamp(1rem, 2vw, 1.3rem);
    }

    .articles-controls {
        gap: var(--spacing-sm);
    }

    .articles-filter-label {
        font-size: 0.85rem;
    }

    .articles-filter-select {
        font-size: 0.9rem;
        padding: var(--spacing-sm);
    }

    .articles-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .featured-article-hero,
    .featured-article-hero-image img,
    .articles-filter-select,
    .articles-reset-btn,
    .articles-grid .card {
        transition: none;
    }

    .articles-grid .card:hover .card-image img {
        transform: none;
    }
}
