/* ========== News Section (Smooth Hover Effects) ========== */
.news {
    width: 100%;
    padding: clamp(1rem, 8vw, 2rem) 0;
}

.news__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: clamp(2rem, 4vw, 3rem);
    flex-wrap: wrap;
}

.news__header-content {
    flex: 1;
    min-width: 280px;
}

.section-title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.section-subtitle {
    font-size: clamp(1rem, 2vw, 1.125rem);
    color: #64748b;
    font-weight: 400;
}

/* ========== News Slider Wrapper ========== */
.news__slider-wrapper {
    position: relative;
    width: 100%;
}

/* ========== Controls (Bottom Right) ========== */
.news__controls {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    gap: 0.75rem;
    z-index: 10;
    padding: 0rem 0rem 2rem 0rem; /* Відступ від країв плашки */
}


.news__control-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border: 2px solid rgba(226, 232, 240, 0.8);
    border-radius: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.news__control-btn:hover:not(:disabled) {
    background: #3B82F6;
    border-color: #3B82F6;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(59, 130, 246, 0.4);
}

.news__control-btn:active:not(:disabled) {
    transform: translateY(0);
}

.news__control-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.7);
}

.news__control-btn svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.news__control-btn:hover:not(:disabled) svg {
    transform: scale(1.1);
}

/* ========== Dots Navigation ========== */
.news__dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.news__dot {
    width: 10px;
    height: 10px;
    background: #cbd5e1;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.news__dot:hover {
    background: #94a3b8;
    transform: scale(1.2);
}

.news__dot.news__dot--active {
    width: 32px;
    background: #3B82F6;
    border-radius: 5px;
}

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

/* Large Desktop (1536px+) */
@media (min-width: 1536px) {
    .news__controls {
        bottom: 2.5rem;
        right: 2.5rem;
        gap: 1rem;
    }

    .news__control-btn {
        width: 56px;
        height: 56px;
        border-radius: 14px;
    }

    .news__control-btn svg {
        width: 24px;
        height: 24px;
    }
}

/* Desktop (1280px - 1535px) */
@media (min-width: 1280px) and (max-width: 1535px) {
    .news__controls {
        bottom: 2rem;
        right: 2rem;
    }

    .news__control-btn {
        width: 52px;
        height: 52px;
    }
}

/* Tablet (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .news__controls {
        bottom: 1.5rem;
        right: 1.5rem;
        gap: 0.5rem;
    }

    .news__control-btn {
        width: 44px;
        height: 44px;
    }
}

/* Mobile (max-width: 767px) */
@media (max-width: 767px) {
    .news__controls {
        display: none;
    }

    .news__dots {
        margin-top: 1.5rem;
        gap: 0.375rem;
    }

    .news__dot {
        width: 8px;
        height: 8px;
    }

    .news__dot.news__dot--active {
        width: 24px;
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .news__dots {
        margin-top: 1.25rem;
    }
}



/* Slider Wrapper */
.news__slider-wrapper {
    position: relative;
    width: 100%;
}

/* Slider */
.news__slider:not(.loading) {
    display: flex;
    overflow: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.news__slider:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* Loading State */
.news__loading {
    width: 100%;
    min-height: clamp(400px, 50vh, 600px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: #f8fafc;
    color: #64748b;
    border-radius: 24px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: #3B82F6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* News Slide */
.news__slide {
    position: relative;
    flex: 0 0 100%;
    width: 100%;
    height: clamp(450px, 60vh, 700px);
    scroll-snap-align: start;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}

/* Background Image */
.news__slide-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    filter: brightness(1);
}


/* Gradient Overlay */
.news__slide-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(15, 23, 42, 0.98) 0%,
        rgba(15, 23, 42, 0.85) 35%,
        rgba(15, 23, 42, 0.5) 60%,
        rgba(15, 23, 42, 0.2) 80%,
        transparent 100%
    );
    transition: background 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Content Container */
.news__slide-content {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 100%;
    padding: clamp(1rem, 5vw, 1.8rem);
    display: flex;
    flex-direction: column;
    gap: clamp(0.75rem, 1.5vw, 1.25rem);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.news__slide:hover .news__slide-content {
    transform: translateY(-4px);
}

/* Category Tag */
.news__slide-tag {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.625rem 1.25rem;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 10px;
    backdrop-filter: blur(12px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
}

.news__slide:hover .news__slide-tag {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.news__slide-tag--primary {
    background: rgba(59, 130, 246, 0.95);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.news__slide:hover .news__slide-tag--primary {
    background: rgba(59, 130, 246, 1);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.6);
}

.news__slide-tag--accent {
    background: rgba(245, 158, 11, 0.95);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.news__slide:hover .news__slide-tag--accent {
    background: rgba(245, 158, 11, 1);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.6);
}

.news__slide-tag--neutral {
    background: rgba(100, 116, 139, 0.95);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.4);
}

.news__slide:hover .news__slide-tag--neutral {
    background: rgba(100, 116, 139, 1);
    box-shadow: 0 8px 24px rgba(100, 116, 139, 0.6);
}

/* Date */
.news__slide-date {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.news__slide:hover .news__slide-date {
    color: rgba(255, 255, 255, 1);
    transform: translateX(4px);
}

.news__slide-date svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: currentColor;
    opacity: 0.9;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.news__slide:hover .news__slide-date svg {
    opacity: 1;
    transform: rotate(5deg) scale(1.1);
}

/* Title */
.news__slide-title {
    font-size: clamp(1.5rem, 3.5vw, 2.75rem);
    font-weight: 900;
    color: #ffffff;
    line-height: 1.2;
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    letter-spacing: -0.02em;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    hyphens: auto;
    margin: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.news__slide:hover .news__slide-title {
    color: #ffffff;
    text-shadow: 0 6px 24px rgba(0, 0, 0, 0.8);
    letter-spacing: -0.03em;
}

/* Excerpt */
.news__slide-excerpt {
    font-size: clamp(0.9375rem, 1.8vw, 1.125rem);
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    word-break: break-word;
    margin: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.news__slide:hover .news__slide-excerpt {
    color: rgba(255, 255, 255, 1);
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.7);
}

/* Read More Link */
.news__slide-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: rgba(59, 130, 246, 0.95);
    color: #ffffff;
    font-size: clamp(0.9375rem, 1.5vw, 1rem);
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none;
    width: fit-content;
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
    margin-top: clamp(0.5rem, 1vw, 1rem);
    position: relative;
    overflow: hidden;
}

/* Shine effect */
.news__slide-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.news__slide-link:hover {
    background: rgba(37, 99, 235, 1);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 32px rgba(59, 130, 246, 0.6);
}

.news__slide-link:hover::before {
    left: 100%;
}

.news__slide-link:active {
    transform: translateY(-2px) scale(0.98);
}

.news__slide-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.news__slide-link:hover svg {
    transform: translateX(6px);
}

/* Dots Navigation */
.news__dots {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: clamp(1.5rem, 3vw, 2rem);
}

.news__dot {
    width: 12px;
    height: 12px;
    background: #cbd5e1;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    position: relative;
}

.news__dot::after {
    content: '';
    position: absolute;
    inset: -4px;
    border: 2px solid transparent;
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.news__dot:hover {
    background: #94a3b8;
    transform: scale(1.3);
}

.news__dot:hover::after {
    border-color: #94a3b8;
}

.news__dot--active {
    width: 32px;
    border-radius: 6px;
    background: #3B82F6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.news__dot--active::after {
    border-radius: 10px;
}

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

/* Large Desktop (1920px+) */
@media (min-width: 1920px) {
    .news__slide {
        height: clamp(550px, 65vh, 800px);
    }

    .news__slide-content {
        padding: 2.5rem;
    }
}

/* Desktop (1280px - 1920px) */
@media (min-width: 1280px) and (max-width: 1919px) {
    .news__slide {
        height: clamp(500px, 60vh, 700px);
    }

    .news__slide-title {
        font-size: 2.5rem;
    }

    .news__slide-excerpt {
        font-size: 1.0625rem;
    }
}

/* Tablet (768px - 1279px) */
@media (min-width: 768px) and (max-width: 1279px) {
    .news__slide {
        height: clamp(450px, 55vh, 600px);
    }

    .news__slide-content {
        padding: 2.5rem;
    }

    .news__slide-title {
        font-size: 2rem;
        -webkit-line-clamp: 2;
    }

    .news__slide-excerpt {
        -webkit-line-clamp: 2;
        font-size: 1rem;
    }
}

/* Mobile (max-width: 767px) */
@media (max-width: 767px) {
    .news__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }

    .news__controls {
        align-self: flex-end;
    }

    .news__control-btn {
        width: 46px;
        height: 46px;
    }

    .news__slider {
        border-radius: 20px;
    }

    .news__slide {
        height: 500px;
    }

    .news__slide-content {
        padding: 2rem 1.5rem;
    }

    .news__slide-title {
        font-size: 1.5rem;
        -webkit-line-clamp: 2;
    }

    .news__slide-excerpt {
        -webkit-line-clamp: 2;
        font-size: 0.9375rem;
    }

    .news__slide-link {
        padding: 0.875rem 1.5rem;
        font-size: 0.9375rem;
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .news {
        padding: 3rem 0;
    }

    .news__slide {
        height: 480px;
    }

    .news__slide-content {
        padding: 1.75rem 1.25rem;
        gap: 0.875rem;
    }

    .news__slide-tag {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }

    .news__slide-date {
        font-size: 0.8125rem;
    }

    .news__slide-date svg {
        width: 16px;
        height: 16px;
    }

    .news__slide-title {
        font-size: 1.375rem;
        -webkit-line-clamp: 4;
    }

    .news__slide-excerpt {
        display: none;
    }

    .news__slide-link {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
        margin-top: 0.5rem;
    }

    .news__dot {
        width: 10px;
        height: 10px;
    }

    .news__dot--active {
        width: 24px;
    }
}

/* Extra Small Mobile (max-width: 360px) */
@media (max-width: 360px) {
    .news__slide {
        height: 450px;
    }

    .news__slide-content {
        padding: 1.5rem 1rem;
    }

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

    .news__slide-link {
        width: 100%;
        justify-content: center;
    }
}

/* ========== Loading Animation ========== */

/* Shimmer animation */
@keyframes loading-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Loading state for slider */
.news__slider.loading {
    pointer-events: none;
}

/* Loading skeleton card */
.news-card.loading {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    overflow: hidden;
    pointer-events: none;
    cursor: default;
}

.news-card.loading:hover {
    transform: none;
    box-shadow: none;
    border-color: #e2e8f0;
}

/* Skeleton image */
.news-card.loading .news-card__image {
    width: 100%;
    height: 240px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
}

/* Skeleton content */
.news-card.loading .news-card__content {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Skeleton category */
.news-card.loading .news-card__category {
    width: 30%;
    height: 1.25rem;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
    border-radius: 6px;
}

/* Skeleton title */
.news-card.loading .news-card__title {
    width: 85%;
    height: 1.5rem;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

/* Skeleton excerpt lines */
.news-card.loading .news-card__excerpt-line {
    width: 100%;
    height: 0.875rem;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.news-card.loading .news-card__excerpt-line.short {
    width: 75%;
}

/* Skeleton meta */
.news-card.loading .news-card__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.news-card.loading .news-card__date {
    width: 25%;
    height: 0.875rem;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
    border-radius: 4px;
}

.news-card.loading .news-card__readmore {
    width: 30%;
    height: 2rem;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
    border-radius: 8px;
}

/* Hide controls during loading */
.news__slider.loading ~ .news__dots {
    opacity: 0.3;
    pointer-events: none;
}

/* Responsive skeleton adjustments */
@media (max-width: 767px) {
    .news-card.loading .news-card__image {
        height: 200px;
    }

    .news-card.loading .news-card__content {
        padding: 1.5rem;
    }

    .news-card.loading .news-card__title {
        height: 1.25rem;
    }
}

@media (max-width: 480px) {
    .news-card.loading .news-card__image {
        height: 180px;
    }

    .news-card.loading .news-card__content {
        padding: 1.25rem;
    }
}

/* Fade in animation when content loads */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.news-card:not(.loading) {
    animation: fadeIn 0.5s ease-in-out;
}
