/* TradersLab Page Styles - Complete Stylesheet */

/* ========================================
   MAIN CONTENT LAYOUT
   ======================================== */

/* Main content offset for sidebar */
.main-content {
    margin-left: auto;
    margin-right: auto;
    min-height: 100vh;
    padding-top: 0;
    padding-left: 280px;
    padding-right: 280px;
    max-width: calc(1200px + 280px + 280px);
    padding-bottom: 104px;
    color: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* Medium Article стили наследуются из CaseStudiesContent.css */

/* Desktop Navigation (768px+) */
@media (min-width: 768px) {
    .main-content {
        padding-left: 280px;
        padding-right: 280px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Mobile Navigation (до 767px) */
@media (max-width: 767px) {
    .main-content {
        padding-top: 80px;
        padding-left: 16px;
        padding-right: 16px;
        margin-left: 0;
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .main-content {
        margin-left: auto;
        margin-right: auto;
        padding-left: 0;
        padding-top: 80px;
        max-width: none;
    }
}

@media (max-width: 1200px) {
    .article-sidebar-nav {
        display: none;
    }
    
    .main-content {
        padding-right: 0;
        max-width: calc(1200px + 280px);
    }
}

/* ========================================
   HERO VIDEO — YouTube превью + модалка (как на traderslab.ai)
   ======================================== */

.hero-image-section {
    width: 100%;
    height: auto;
    margin: 0 0 24px 0;
    padding: 0;
    box-sizing: border-box;
    border-radius: 16px;
    overflow: hidden;
}

/* В сетке на главной: блок заполняет ячейку, радиус как у остальных карточек (16px) */
.project-grid-item .hero-video-block--grid {
    position: absolute !important;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    padding-bottom: 0 !important;
    border-radius: 16px !important;
}

/* Обёртка с явной высотой «16:9 минус 56px». !important перебивает CaseStudiesContent.css */
.hero-image-section.hero-video-block {
    border-radius: 40px !important;
    overflow: hidden;
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: calc(56.25% - 56px); /* 56.25% = 9/16 для 16:9 */
}

@media (min-width: 1441px) {
    .hero-image-section.hero-video-block {
        border-radius: 56px !important;
    }
}

/* Сетка на главной: радиус 16px перебивает 40px/56px (выше специфичность) */
.project-grid-item .hero-image-section.hero-video-block.hero-video-block--grid {
    border-radius: 16px !important;
}

/* Плеер: без своего border-radius — обрезка только от контейнера выше */
.hero-video-player {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: pointer;
    background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
    transition: box-shadow 0.3s ease;
}

.hero-video-player:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Обводка: без border-radius, обрезается контейнером */
.hero-video-player-lines {
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
    z-index: 2;
}

.hero-video-player:hover .hero-video-player-lines {
    opacity: 1;
    border-color: rgba(10, 114, 194, 0.5);
    box-shadow: 0 0 0 1px rgba(10, 114, 194, 0.2), 0 0 24px rgba(10, 114, 194, 0.15);
}

.hero-video-preview-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    pointer-events: none;
    transform: scale(1.04);
    transform-origin: center center;
}

.hero-video-player-mask {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.2) 100%);
    pointer-events: none;
    z-index: 1;
}

.hero-video-play-button {
    display: none; /* убрана по запросу, клик по превью открывает модалку */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background 0.2s ease;
    color: #111;
}

.hero-video-player:hover .hero-video-play-button {
    display: none;
}

.hero-play-icon {
    margin-left: 4px; /* визуальный центр иконки play */
}

/* Модалка видео */
.hero-video-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.25s ease, opacity 0.25s ease;
}

.hero-video-modal[aria-hidden="false"] {
    visibility: visible;
    opacity: 1;
}

.hero-video-modal[hidden] {
    display: none !important;
}

.hero-video-modal:not([hidden]) {
    display: flex;
}

.hero-video-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
}

.hero-video-modal-content {
    position: relative;
    width: 100%;
    max-width: 900px;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    z-index: 1;
    transform: scale(0.96);
    transition: transform 0.3s ease;
}

.hero-video-modal[aria-hidden="false"] .hero-video-modal-content {
    transform: scale(1);
}

.hero-video-modal-content iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.hero-video-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.hero-video-modal-close:hover {
    background: rgba(0, 0, 0, 0.85);
    transform: scale(1.08);
}

@media (max-width: 767px) {
    .hero-image-section.hero-video-block {
        border-radius: 16px !important;
    }
    /* Сетка на главной: всегда 16px как у остальных карточек */
    .project-grid-item .hero-video-block--grid {
        border-radius: 16px !important;
    }
    .hero-video-play-button {
        width: 56px;
        height: 56px;
    }
    .hero-video-modal {
        padding: 16px;
    }
    .hero-video-modal-content {
        border-radius: 16px;
    }
    .hero-video-modal-close {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
}

/* YouTube embed: 16:9, скругление, тёмная тема */
.traderslab-youtube-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-top: 16px;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
}

.traderslab-youtube-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ========================================
   ARTICLE HEADER
   ======================================== */

/* Article header and title styles moved to ../CSS/CaseStudiesContent.css */

.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.author-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.author-name {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: #1A1A1A;
}

.publish-date {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    color: #8e8c8c;
}

/* ========================================
   ARTICLE CONTENT
   ======================================== */

.article-content {
    line-height: 1.6;
    text-align: left;
}

/* Типографика наследуется из Typography.css */

/* Typography and content styles moved to ../CSS/CaseStudiesContent.css */

/* ========================================
   SCROLL ANIMATIONS
   ======================================== */

/* Fade-in animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Animate content on scroll */
.article-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.article-section.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.article-section p,
.article-section h2,
.article-section h3,
.article-section ul,
.article-section .image-gallery,
.article-section .hero-image,
.article-section .gallery-item {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.article-section.fade-in p,
.article-section.fade-in h2,
.article-section.fade-in h3,
.article-section.fade-in ul,
.article-section.fade-in .image-gallery,
.article-section.fade-in .hero-image,
.article-section.fade-in .gallery-item {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation delays for list items */
.article-section.fade-in ul li:nth-child(1) {
    transition-delay: 0.1s;
}

.article-section.fade-in ul li:nth-child(2) {
    transition-delay: 0.2s;
}

.article-section.fade-in ul li:nth-child(3) {
    transition-delay: 0.3s;
}

.article-section.fade-in ul li:nth-child(4) {
    transition-delay: 0.4s;
}

.article-section.fade-in ul li:nth-child(5) {
    transition-delay: 0.5s;
}

.article-section.fade-in ul li:nth-child(6) {
    transition-delay: 0.6s;
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */

@media (max-width: 1024px) {
    .hero-video {
        height: auto;
    }
}

@media (max-width: 767px) {
    .hero-video {
        height: auto;
    }
    
    /* Стили для .article-title удалены - используются из Typography.css */
}
