/* Стили для главной страницы */

/* Верхняя сетка */
.top-grid {
    display: grid;
    grid-template-columns: 1.618fr 1fr;
    gap: 3rem;
    margin-bottom: 5rem;
}

/* Featured статьи */
.featured-articles {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    height: 750px;
    overflow-y: auto;
}

/* Кастомный скролл для featured-articles */
.featured-articles::-webkit-scrollbar {
    width: 8px;
}

.featured-articles::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.featured-articles::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.featured-articles::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.featured-article-link {
    text-decoration: none;
    display: block;
    margin-bottom: 2rem;
}

.featured-article-link:last-child {
    margin-bottom: 0;
}

.featured-article {
    background: white;
    border-radius: 20px;
    padding: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
    display: flex;
    gap: 0;
    align-items: stretch;
    transition: all 0.3s ease;
    overflow: hidden;
    min-height: 240px;
}

.featured-article-pinned {
    border: 3px solid transparent;
    background:
        linear-gradient(white, white) padding-box,
        linear-gradient(135deg, #667eea, #764ba2, #f093fb, #667eea) border-box;
    background-size: 200% 200%;
    animation: rainbow-border 4s linear infinite;
}

@keyframes rainbow-border {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.featured-article-link:hover .featured-article {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.featured-article-link:hover .featured-article-pinned {
    box-shadow: 0 8px 32px rgba(118, 75, 162, 0.4);
}


.featured-article-image {
    flex-shrink: 0;
    width: 240px;
    overflow: hidden;
    background: #f5f5f5;
}

.featured-article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-article-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2rem;
}

.article-labels {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.featured-article-content .article-label {
    display: inline-block;
    background: var(--accent-blue);
    padding: 0.35rem 0.75rem;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: white;
}

.pinned-label {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%) !important;
    animation: rainbow-glow 3s ease-in-out infinite;
}

@keyframes rainbow-glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(240, 147, 251, 0.8);
    }
}

.featured-article-content h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    line-height: 1.3;
    font-weight: 600;
}

.featured-article-content p {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.featured-article-content .read-more {
    color: var(--accent-blue);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s ease;
    align-self: flex-start;
}

.featured-article-link:hover .read-more {
    gap: 0.8rem;
}

/* Правая колонка */
.side-column {
    display: flex;
    flex-direction: column;
}

/* Пульсар/Новости (красный) */
.pulsar-section {
    background: linear-gradient(135deg, var(--accent-red) 0%, #ff6b81 100%);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 6px 28px rgba(231, 76, 60, 0.25);
    position: relative;
    overflow: hidden;
    height: 750px;
    display: flex;
    flex-direction: column;
}

.pulsar-section::before {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    top: -30px;
    right: 20px;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.15;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.25;
    }
}

.pulsar-section h3 {
    color: white;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

/* Переключатель табов */
.pulsar-tabs {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.pulsar-tab {
    flex: 1;
    padding: 0.8rem 1.2rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.pulsar-tab.active {
    background: white;
    color: var(--accent-red);
}

.pulsar-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.3);
}

/* Контент табов */
.pulsar-content {
    position: relative;
    z-index: 1;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Кастомный скролл для pulsar-content */
.pulsar-content::-webkit-scrollbar {
    width: 6px;
}

.pulsar-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.pulsar-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.pulsar-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Новости (аккордеон) */
.news-item {
    padding: 1.2rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.news-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.news-item summary {
    cursor: pointer;
    list-style: none;
    transition: all 0.3s ease;
    padding: 0;
    position: relative;
}

/* Убираем стандартные маркеры для всех браузеров */
.news-item summary::-webkit-details-marker {
    display: none;
}

.news-item summary::marker {
    display: none;
}

.news-item summary::-moz-list-bullet {
    list-style-type: none;
}

.news-item summary:hover {
    background: rgba(255, 255, 255, 0.08);
    padding-left: 1rem;
    padding-right: 1rem;
    margin-left: -1rem;
    margin-right: -1rem;
    border-radius: 8px;
}

.news-date {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.news-item summary p {
    color: white;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

/* Раскрытый контент новости */
.news-expanded {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 1rem;
    padding-right: 0.5rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-expanded p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

/* Кастомный скролл */
.news-expanded::-webkit-scrollbar {
    width: 4px;
}

.news-expanded::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.news-expanded::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.news-expanded::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Сторис */
.stories-container {
    position: relative;
}

.story-slide {
    display: none;
    position: relative;
}

.story-slide.active {
    display: block;
}

.story-image {
    width: 100%;
    aspect-ratio: 4/5;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    overflow: hidden;
    margin-bottom: 1rem;
}

.story-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.story-caption {
    color: white;
    font-size: 0.9rem;
    text-align: center;
    line-height: 1.4;
}

/* Навигация сторис */
.stories-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    gap: 1rem;
}

.story-arrow {
    background: rgba(255, 255, 255, 0.25);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.story-arrow:hover {
    background: rgba(255, 255, 255, 0.4);
}

.story-dots {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex: 1;
}

.story-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.story-dot.active {
    background: white;
    width: 24px;
    border-radius: 4px;
}

/* Сетка из 4 статей */
.articles-grid-section {
    margin-bottom: 5rem;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
}

.articles-grid .featured-article {
    height: 320px;
}

/* Галерея (желтый) */
.gallery-section {
    background: linear-gradient(135deg, var(--accent-yellow) 0%, #ffd93d 100%);
    border-radius: 24px;
    padding: 4rem;
    box-shadow: 0 6px 28px rgba(247, 220, 111, 0.3);
    position: relative;
    overflow: hidden;
    margin-bottom: 5rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.gallery-section::before {
    content: '';
    position: absolute;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    bottom: -40px;
    right: -30px;
}

.gallery-section h3 {
    color: var(--primary-color);
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.gallery-item {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.6);
}

.gallery-item:hover {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Секция остальных статей - зона отдыха */
.articles-section {
    margin-top: 5rem;
    margin-bottom: 8rem;
}

.articles-section h2 {
    color: var(--primary-color);
    margin-bottom: 4rem;
    text-align: center;
    font-size: 2rem;
    font-weight: 300;
}

.articles-list {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.article-link {
    background: var(--white);
    border-radius: 20px;
    padding: 3rem 4rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
}

.article-link:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
    transform: translateX(8px);
}

.article-link h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 1.4;
    margin: 0;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .top-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .featured-articles {
        height: auto;
        overflow-y: visible;
    }

    .pulsar-section {
        height: auto;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

    .articles-grid .featured-article {
        height: auto;
    }

    .articles-list {
        padding: 0 2rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .featured-articles {
        padding: 0;
    }

    .pulsar-section {
        padding: 2rem 1.5rem;
    }

    .gallery-section {
        padding: 2rem;
    }

    .featured-article-link {
        margin-bottom: 1.5rem;
    }

    .featured-article {
        flex-direction: column;
        min-height: auto;
    }

    .featured-article-image {
        width: 100%;
        height: 240px;
    }

    .featured-article-content {
        padding: 1.2rem;
    }

    .featured-article-content h2 {
        font-size: 1.3rem;
    }

    .featured-article-content p {
        font-size: 0.9rem;
    }

    .articles-section {
        padding: 3rem 0.5rem;
    }

    .articles-list {
        padding: 0 0.5rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr 1fr;
    }

    .article-link {
        padding: 2rem 1.5rem;
    }
}
