/**
 * News Section Styles
 * The Heart of Gold
 */

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

.home-news-section {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    padding: var(--space-3xl) var(--space-xl);
    padding-bottom: var(--space-4xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
}

/* Top fade for smooth transition from hero - subtle */
.home-news-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(
        to bottom,
        var(--color-purple-deep) 0%,
        rgba(20, 2, 59, 0.4) 50%,
        transparent 100%
    );
    z-index: 1;
    pointer-events: none;
}

/* Bottom fade for smooth transition to overview - subtle */
.home-news-section .news-bottom-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 180px;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(20, 2, 59, 0.3) 50%,
        var(--color-purple-dark) 100%
    );
    pointer-events: none;
    z-index: 3;
}

/* Pattern Overlay */
.news-pattern-overlay {
    position: absolute;
    inset: 0;
    background-image: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 60px,
            rgba(255, 128, 174, 0.025) 60px,
            rgba(255, 97, 155, 0.025) 120px
        );
    animation: patternDrift 25s linear infinite;
    z-index: 0;
    pointer-events: none;
}

/* Background base */
.news-bg-base {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(129, 60, 232, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(196, 30, 92, 0.12) 0%, transparent 50%),
        linear-gradient(180deg, var(--color-purple-deep) 0%, var(--color-purple-dark) 100%);
    z-index: 0;
}

@keyframes patternDrift {
    0% { transform: translateX(0) translateY(0); }
    100% { transform: translateX(120px) translateY(120px); }
}

/* Floating Text Background */
.news-bg-text {
    position: absolute;
    font-family: var(--font-pixel);
    font-size: clamp(3rem, 12vw, 10rem);
    color: rgba(255, 255, 255, 0.015);
    text-transform: uppercase;
    letter-spacing: 0.3em;
    white-space: nowrap;
    user-select: none;
    pointer-events: none;
    z-index: 0;
}

.news-bg-text-1 {
    top: 8%;
    left: -5%;
    animation: bgTextFloat1 35s ease-in-out infinite;
}

.news-bg-text-2 {
    top: 45%;
    right: -15%;
    animation: bgTextFloat2 40s ease-in-out infinite;
}

.news-bg-text-3 {
    bottom: 12%;
    left: 10%;
    animation: bgTextFloat3 30s ease-in-out infinite;
}

@keyframes bgTextFloat1 {
    0%, 100% { transform: translateX(0); opacity: 0.015; }
    50% { transform: translateX(-8%); opacity: 0.025; }
}

@keyframes bgTextFloat2 {
    0%, 100% { transform: translateX(0); opacity: 0.01; }
    50% { transform: translateX(10%); opacity: 0.02; }
}

@keyframes bgTextFloat3 {
    0%, 100% { transform: translateX(0) rotate(-1deg); opacity: 0.012; }
    50% { transform: translateX(-5%) rotate(1deg); opacity: 0.02; }
}

/* Gradient Overlay - Removed, using pseudo-elements now */

/* ==================== */
/* News Content */
/* ==================== */

.news-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: var(--container-2xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.news-section-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

/* ==================== */
/* News Header */
/* ==================== */

.news-header {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    align-items: flex-start;
}

@media (min-width: 768px) {
    .news-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: var(--space-2xl);
    }
}

/* Title Badge */
.news-title-badge {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md) var(--space-2xl);
    min-width: 260px;
}

.title-badge-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    image-rendering: pixelated;
    filter: 
        drop-shadow(0 0 15px rgba(255, 179, 217, 0.25))
        drop-shadow(0 4px 12px rgba(196, 30, 92, 0.35));
    opacity: 0.9;
}

.title-badge-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
}

.title-slash {
    font-family: var(--font-pixel);
    font-size: var(--fs-xs);
    color: rgba(255, 200, 230, 0.5);
}

.title-text {
    font-family: var(--font-pixel);
    font-size: clamp(0.65rem, 1.8vw, 0.9rem);
    color: var(--color-white);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    text-shadow: 
        0 0 8px rgba(255, 179, 217, 0.4),
        0 1px 3px rgba(0, 0, 0, 0.4);
    white-space: nowrap;
}

/* ==================== */
/* Category Bar - Skewed */
/* ==================== */

.news-category-bar {
    position: relative;
    transform: skewX(-8deg);
    background: rgba(15, 15, 25, 0.95);
    border-radius: 50px;
    padding: 6px;
    border: 2px solid rgba(255, 255, 255, 0.08);
    box-shadow: 
        0 4px 25px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.category-bar-inner {
    display: flex;
    gap: 4px;
    transform: skewX(8deg);
}

.category-tab {
    position: relative;
    font-family: var(--font-pixel);
    font-size: var(--fs-sm);
    color: var(--color-text-secondary);
    padding: var(--space-sm) var(--space-lg);
    background: transparent;
    border: none;
    border-radius: 40px;
    transition: 
        color var(--transition-normal),
        background var(--transition-normal);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
    transform-origin: center;
    will-change: transform;
}

.category-tab::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
    border-radius: inherit;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.category-tab:hover {
    color: var(--color-text-primary);
}

.category-tab:hover::before {
    opacity: 1;
}

.category-tab.active {
    color: var(--color-purple-dark);
    background: var(--color-white);
    font-weight: 700;
    box-shadow: 
        0 2px 10px rgba(255, 255, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.category-tab.active::before {
    opacity: 0;
}

.tab-text {
    position: relative;
    z-index: 1;
}

/* ==================== */
/* Carousel Area */
/* ==================== */

.news-carousel-area {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.carousel-gallery {
    position: relative;
    width: 100%;
    height: 520px;
    overflow: visible;
}

.carousel-cards {
    position: absolute;
    width: 360px;
    height: 450px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); 
    transform-style: preserve-3d;
}

/* ==================== */
/* News Panel - Fixed Shimmer */
/* ==================== */

.news-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 360px;
    height: 450px;
    transform: skewX(-5deg);
    cursor: pointer;
    will-change: transform, opacity;
    transform-style: preserve-3d;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.news-panel.featured {
    width: 380px;
}

/* Panel Background - Contains the shimmer */
.panel-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.panel-bar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
    opacity: 0.95;
    transform: skewX(5deg) scale(1.1);
}

/* Panel Shimmer - Now contained properly */
.panel-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        100deg,
        transparent 0%,
        rgba(255, 255, 255, 0) 25%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0) 75%,
        transparent 100%
    );
    transform: translateX(-100%) skewX(5deg);
    opacity: 0;
    z-index: 10;
    pointer-events: none;
}

/* Panel Content */
.panel-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: var(--space-lg);
    transform: skewX(5deg);
}

.panel-image {
    position: relative;
    flex: 0 0 55%;
    background: linear-gradient(
        135deg, 
        rgba(26, 10, 46, 0.85) 0%, 
        rgba(45, 21, 72, 0.65) 100%
    );
    overflow: hidden;
    margin-bottom: var(--space-md);
    clip-path: polygon(30% 0%, 100% 0%, 100% 100%, 5% 100%);
    border-radius: var(--radius-md);
}

.panel-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    will-change: transform;
}

.panel-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 50%,
        rgba(20, 2, 59, 0.6) 100%
    );
    pointer-events: none;
}

.panel-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(
        circle at 30% 30%, 
        rgba(196, 30, 92, 0.2) 0%, 
        transparent 60%
    );
}

.placeholder-icon {
    font-size: 3.5rem;
    color: var(--color-pink-main);
    opacity: 0.35;
}

.placeholder-icon::before {
    content: '\2605';
    display: block;
    animation: iconPulse 2.5s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.35; }
    50% { transform: scale(1.15) rotate(10deg); opacity: 0.5; }
}

/* Panel Info */
.panel-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    padding: var(--space-xs);
}

.panel-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.panel-category-tag {
    font-family: var(--font-pixel-alt);
    font-size: 0.55rem;
    color: var(--color-pink-accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 10px;
    background: rgba(196, 30, 92, 0.2);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(196, 30, 92, 0.35);
}

.panel-date {
    font-family: var(--font-pixel-alt);
    font-size: var(--fs-xs);
    color: var(--color-pink-light);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.panel-title {
    font-family: var(--font-pixel);
    font-size: var(--fs-md);
    color: var(--color-text-primary);
    line-height: 1.35;
    margin: 0;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
}

.panel-description {
    font-family: var(--font-pixel-alt);
    font-size: var(--fs-xs);
    color: var(--color-text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Cat Marco */
.panel-cat-marco {
    position: absolute;
    bottom: -30px;
    right: -40px;
    width: 140px;
    height: 140px;
    z-index: 5;
    opacity: 0;
    transform: scale(0.5) translateY(30px) skewX(5deg);
    pointer-events: none;
    will-change: transform, opacity;
}

.cat-marco-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 18px rgba(196, 30, 92, 0.8));
}

/* ==================== */
/* Carousel Actions */
/* ==================== */

.carousel-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xl);
}

.carousel-nav {
    width: 65px;
    height: 65px;
    background: rgba(0, 0, 0, 0.35);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 
        transform var(--transition-bounce),
        background var(--transition-normal),
        border-color var(--transition-normal);
    flex-shrink: 0;
}

.carousel-nav:hover {
    transform: scale(1.12);
    background: rgba(196, 30, 92, 0.25);
    border-color: rgba(196, 30, 92, 0.5);
}

.carousel-nav:active {
    transform: scale(0.95);
}

.nav-arrow-img {
    width: 65%;
    height: 65%;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 10px rgba(196, 30, 92, 0.7));
    transition: filter var(--transition-normal);
}

.carousel-nav:hover .nav-arrow-img {
    filter: drop-shadow(0 0 18px rgba(196, 30, 92, 1));
}

.nav-arrow-next {
    transform: scaleX(-1);
}

/* Indicators */
.carousel-indicators {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-sm);
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.25);
    transition: 
        background var(--transition-normal),
        border-color var(--transition-normal),
        transform var(--transition-bounce),
        box-shadow var(--transition-normal);
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.3);
}

.carousel-dot.active {
    background: var(--color-pink-main);
    border-color: var(--color-pink-light);
    box-shadow: 0 0 15px rgba(196, 30, 92, 0.7);
    transform: scale(1.2);
}

/* ==================== */
/* Speed Decoration */
/* ==================== */

.news-speed-decoration {
    position: absolute;
    bottom: var(--space-2xl);
    right: var(--space-2xl);
    z-index: 3;
    pointer-events: none;
}

.speed-icon {
    width: clamp(70px, 12vw, 130px);
    height: auto;
    image-rendering: pixelated;
    filter: 
        drop-shadow(0 0 18px rgba(196, 30, 92, 0.6))
        drop-shadow(0 0 35px rgba(255, 179, 217, 0.25));
    opacity: 0.8;
}

/* ==================== */
/* Responsive - Tablet */
/* ==================== */

@media (max-width: 1024px) {
    .news-header {
        flex-direction: column;
        align-items: center;
        gap: var(--space-lg);
    }
    
    .news-category-bar {
        transform: skewX(-5deg);
    }
    
    .category-bar-inner {
        transform: skewX(5deg);
    }
    
    .category-tab {
        padding: var(--space-xs) var(--space-md);
        font-size: 0.7rem;
    }
}

/* ==================== */
/* Responsive - Mobile */
/* ==================== */

@media (max-width: 768px) {
    .home-news-section {
        padding: var(--space-2xl) var(--space-md);
        padding-bottom: var(--space-3xl);
    }
    
    /* Category Bar - Mobile Optimized */
    .news-category-bar {
        transform: none;
        border-radius: var(--radius-lg);
        padding: 4px;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .news-category-bar::-webkit-scrollbar {
        display: none;
    }
    
    .category-bar-inner {
        transform: none;
        display: flex;
        gap: 3px;
        min-width: max-content;
        padding: 0 var(--space-xs);
    }
    
    .category-tab {
        font-size: 0.6rem;
        padding: var(--space-xs) var(--space-sm);
        border-radius: var(--radius-md);
        flex-shrink: 0;
        min-width: fit-content;
    }
    
    /* Carousel - Mobile Optimized */
    .carousel-gallery {
        height: 380px;
    }
    
    .carousel-cards {
        width: 280px;
        height: 360px;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    .news-panel {
        width: 280px;
        height: 360px;
        transform: skewX(-3deg);
    }
    
    .panel-content {
        transform: skewX(3deg);
        padding: var(--space-md);
    }
    
    .panel-title {
        font-size: var(--fs-sm);
    }
    
    .panel-description {
        -webkit-line-clamp: 2;
    }
    
    /* Carousel Actions - Mobile */
    .carousel-actions {
        gap: var(--space-md);
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .carousel-nav {
        width: 50px;
        height: 50px;
    }
    
    /* Indicators - Mobile */
    .carousel-indicators {
        gap: var(--space-xs);
        flex-wrap: wrap;
        justify-content: center;
        max-width: 200px;
    }
    
    .carousel-dot {
        width: 8px;
        height: 8px;
        border-width: 1.5px;
    }
    
    .news-speed-decoration {
        display: none;
    }
    
    /* Section height and fades - Mobile */
    .home-news-section {
        min-height: 120vh;
        min-height: 120dvh;
        padding-top: var(--space-3xl);
        padding-bottom: var(--space-4xl);
    }
    
    .home-news-section::before {
        height: 200px;
    }
    
    .home-news-section .news-bottom-fade {
        height: 250px;
    }
}

/* ==================== */
/* Responsive - Small Mobile */
/* ==================== */

@media (max-width: 480px) {
    .home-news-section {
        padding: var(--space-xl) var(--space-sm);
        padding-top: var(--space-2xl);
        padding-bottom: var(--space-3xl);
        min-height: 130vh;
        min-height: 130dvh;
    }
    
    .home-news-section::before {
        height: 180px;
    }
    
    .home-news-section .news-bottom-fade {
        height: 220px;
    }
    
    .news-title-badge {
        min-width: 200px;
        padding: var(--space-sm) var(--space-lg);
    }
    
    .title-text {
        font-size: 0.6rem;
    }
    
    /* Category Bar - Small Mobile */
    .news-category-bar {
        padding: 3px;
    }
    
    .category-tab {
        font-size: 0.55rem;
        padding: 6px 10px;
    }
    
    /* Carousel - Small Mobile */
    .carousel-gallery {
        height: 340px;
    }
    
    .carousel-cards {
        width: 250px;
        height: 320px;
    }
    
    .news-panel {
        width: 250px;
        height: 320px;
    }
    
    .panel-image {
        flex: 0 0 50%;
    }
    
    .panel-category-tag {
        font-size: 0.5rem;
        padding: 2px 8px;
    }
    
    .panel-date {
        font-size: 0.55rem;
    }
    
    .panel-title {
        font-size: 0.75rem;
    }
    
    .panel-description {
        font-size: 0.6rem;
        -webkit-line-clamp: 2;
    }
    
    /* Carousel Nav - Small Mobile */
    .carousel-nav {
        width: 42px;
        height: 42px;
    }
    
    .carousel-indicators {
        max-width: 180px;
        gap: 4px;
    }
    
    .carousel-dot {
        width: 6px;
        height: 6px;
        border-width: 1px;
    }
}

/* ==================== */
/* Reduced Motion */
/* ==================== */

@media (prefers-reduced-motion: reduce) {
    .news-pattern-overlay {
        animation: none;
    }
    
    .news-bg-text {
        animation: none;
    }
    
    .panel-shimmer {
        display: none;
    }
    
    .carousel-dot,
    .carousel-nav,
    .category-tab {
        transition: none;
    }
}
