/* Timeweb Page Styles - Only Used Classes */

/* 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; /* Height of mobile header */
        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 Image Styles */
.hero-image-section {
    width: 100%;
    height: auto;
    margin: 0 0 24px 0;
    padding: 0;
    box-sizing: border-box;
    border-radius: 16px;
    overflow: hidden;
}

.hero-image {
    width: 100%;
    max-width: 100%;
    height: auto !important;
    min-height: auto !important;
    object-fit: cover;
    object-position: left center;
    border-radius: 0 !important;
    border: none;
}

/* Article Header Styles */
/* 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 Styles */
/* Типографика наследуется из Typography.css */

.article-section {
    text-align: left;
    position: relative;
}

/* Разделители между темами */
.divider-1,
.divider-2,
.divider-3,
.divider-4,
.divider-5,
.divider-6,
.divider-7,
.divider-8,
.divider-9,
.divider-10,
.divider-11 {
    width: 100%;
    height: 1px;
    background: rgba(0, 0, 0, 0.05);
    margin: 48px 0;
}

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

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

/* Image Gallery Styles */
.image-gallery {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 32px 0;
}

.image-item {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.case-image {
    width: 100%;
    height: auto;
    border-radius: 0;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease;
    display: block;
}

.case-image:hover {
    transform: scale(1.02);
}

/* Video Styles */
.video-wrapper {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #E5E8EB;
}

.case-video {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
    transition: transform 0.2s ease;
    border-radius: 0;
    border: none;
}

.case-video:hover {
    transform: scale(1.02);
}

/* Video crop - обрезка на 4px со всех сторон в секции #implementation */
#implementation .video-wrapper {
    overflow: hidden !important;
    position: relative;
}

#implementation .video-wrapper .case-video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    transform: scale(1.18) !important;
    transform-origin: center center !important;
    display: block;
    position: relative;
}

.image-caption {
    font-family: 'Inter', sans-serif !important;
    font-size: 14px !important;
    line-height: 17px !important;
    letter-spacing: 0.2px !important;
    color: #a0a0a0 !important;
    font-style: normal !important;
    text-align: center !important;
    margin: 0 !important;
    padding: 0 !important;
    font-weight: 400 !important;
    font-style: normal !important;
}

/* Results Table Styles - Inherited from CSS/CaseStudiesContent.css */

/* Final CTA Section Styles */
.article-section:has(.final-cta) {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 48px;
    gap: 48px;
    background: #FFFFFF;
    border-radius: 32px;
}

/* Стили типографики для .article-section:has(.final-cta) удалены - используются из Typography.css */
.article-section:has(.final-cta) h2 {
    margin: 0 0 15px 0 !important;
    margin: 0;
    align-self: stretch;
}

.article-section:has(.final-cta) p {
    margin: 0;
    align-self: stretch;
}

.final-cta {
    text-align: left;
    margin: 0;
    width: 100%;
}

/* CTA Button Styles (matching 3Commas) */
/* CTA Button Styles - стили перенесены в CaseStudiesContent.css для унификации */
    font-weight: 700;
    letter-spacing: 0.015em;
    font-size: 16px;
    line-height: 1.3;
    color: #ffffff;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    margin: auto;
    padding: 0;
    width: 90%;
    max-width: 800px;
    top: 50%;
    transform: translateY(-50%);
    /* Радиус на контейнере, он обрезает изображение */
    border-radius: 16px;
    overflow: hidden;
}

.modal-content img {
    width: 100%;
    height: auto;
    border-radius: 0 !important;
}

.modal-image {
    width: 100%;
    height: auto;
    border-radius: 0 !important;
}

.close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    cursor: pointer;
    z-index: 1001;
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    transition: all 0.3s ease;
    padding: 0;
}

/* Показываем крестик только когда модальное окно открыто */
.modal[style*="display: block"] .close,
.modal.show .close {
    display: flex !important;
}

.close svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.close:hover {
    opacity: 0.7;
}

/* Tablet Responsive */
@media (max-width: 1024px) {
    .hero-image {
        height: auto;
    }
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .hero-image {
        height: auto;
    }
    
    /* Article title mobile styles moved to ../CSS/CaseStudiesContent.css */
    
    /* H2 стили наследуются из Typography.css */
    
    .article-section p {
        font-size: 16px;
    }
    
    .lead-paragraph {
        font-size: 20px !important;
        line-height: 30px !important;
    }
    
    .image-gallery {
        gap: 12px;
        margin: 24px 0;
    }
    
    .results-table-container {
        margin: 24px 0;
        border-radius: 8px;
    }
    
    .results-table th,
    .results-table td {
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .results-table th {
        font-size: 12px;
    }
    
    .image-caption {
        font-size: 11px !important;
        padding: 0 8px !important;
        color: #a0a0a0 !important;
        font-style: italic !important;
    }
}

/* Desktop: Single column for image gallery */
@media (min-width: 768px) {
    .image-gallery {
        display: flex;
        flex-direction: column;
        gap: 32px;
        margin: 40px 0;
    }
    
    .image-item {
        margin: 0;
        display: flex;
        flex-direction: column;
    }
}

/* ========================================
   SCROLL ANIMATIONS FOR CONTENT
   ======================================== */

/* 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;
}

/* ========================================
   MEDIA RADIUS — 16px (Timeweb)
   Контейнеры скругляем, медиа — без скругления
   ======================================== */
.hero-image-section,
.article-image,
.video-wrapper,
.media-frame {
    border-radius: 16px !important;
    overflow: hidden !important;
}

.hero-image,
.hero-video,
.case-image,
.case-video,
.featured-image,
.video-wrapper video,
.video-wrapper iframe,
.article-image img:not(.featured-image),
.media-frame img,
.media-frame video,
.media-frame iframe {
    border-radius: 0 !important;
}