/**
 * Services Section - Tresmares Capital Exact Implementation
 * Scroll-based content switching with centered titles
 */

/* ===== SECTION CONTAINER ===== */
.component--contentscrollcenter {
    background-color: #0a0a0a;
    padding: 0;
    position: relative;
}

.component--contentscrollcenter .container.--full {
    height: calc(6 * 100vh); /* 6 services */
    width: 100%;
}

/* ===== STICKY WRAPPER ===== */
.component--contentscrollcenter .sticky {
    height: 100vh;
    position: sticky;
    top: 0;
    width: 100%;
}

/* ===== CONTENT SLIDES ===== */
.component--contentscrollcenter .content {
    height: 100%;
    left: 0;
    opacity: 0;
    position: absolute;
    top: 0;
    width: 100%;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.component--contentscrollcenter .content.--active {
    opacity: 1;
    pointer-events: auto;
}

/* ===== BACKGROUND IMAGE ===== */
.component--contentscrollcenter .image.--cover {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.component--contentscrollcenter .image.--cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1);
    transition: transform 1.6s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.6s ease;
}

.component--contentscrollcenter .content.--active .image.--cover img {
    transform: scale(1.05);
}

/* ===== INFO LAYER ===== */
.component--contentscrollcenter .info {
    position: relative;
    z-index: 1;
    height: 100%;
    width: 100%;
}

/* ===== CENTERED TITLE ===== */
.floating.--center {
    left: 50%;
    position: absolute;
    text-align: center;
    top: 42%;
    transform: translateX(-50%) translateY(-50%);
    margin-top: -2rem;
    color: #FFFFFF;
    text-shadow: 0 2px 40px rgba(0, 0, 0, 0.8);
    font-family: var(--font-display);
    font-weight: 300;
    line-height: 0.95;
    letter-spacing: -0.02em;
    width: 80vw;
}

.component--contentscrollcenter .content .info .title .line--1 {
    text-align: left !important;
    white-space: nowrap;
    font-size: clamp(2.5rem, 6vw, 7rem);
}

.component--contentscrollcenter .content .info .title .line--2 {
    text-align: right !important;
    white-space: nowrap;
    font-size: clamp(2.5rem, 6vw, 7rem);
}

/* ===== TEXT BLOCK (LEFT BOTTOM) ===== */
.component--contentscrollcenter .content .info .text-block-left {
    top: 62vh;
    left: 5vw;
    position: absolute;
    max-width: 35vw;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    padding: 2rem 2.5rem;
    border-radius: 4px;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(0, 0, 0, 0.06);
}

.component--contentscrollcenter .text-block-left .wysiwyg p {
    font-size: clamp(0.875rem, 0.95vw, 0.9375rem);
    line-height: 1.7;
    color: #111111;
    margin: 0;
    margin-bottom: 0.75rem;
}

.component--contentscrollcenter .text-block-left .wysiwyg p:last-child {
    margin-bottom: 0;
}

.component--contentscrollcenter .text-block-left .actions {
    margin-top: 1.25rem;
}

.component--contentscrollcenter .link --small .underline {
    font-size: clamp(0.875rem, 0.9vw, 0.9375rem);
    font-weight: 600;
    color: #3B82F6;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    padding-bottom: 2px;
    transition: border-color 0.3s ease;
    cursor: pointer;
}

.component--contentscrollcenter .link:hover .underline {
    border-bottom-color: #3B82F6;
}

/* ===== DETAILS / CODE BLOCK (RIGHT BOTTOM) ===== */
.component--contentscrollcenter .content .info .details {
    bottom: 4vw;
    display: flex;
    flex-direction: column;
    position: absolute;
    right: 3vw;
    width: auto;
    max-width: 380px;
}

.component--contentscrollcenter .details .code-block {
    background: #1e1e1e;
    border-radius: 10px;
    padding: 1.5rem 2rem;
    width: 360px;
    max-width: calc(100vw - 10vw - 20px);
    font-family: 'Courier New', monospace;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.component--contentscrollcenter .details .code-lang {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #999;
    margin-bottom: 0.6rem;
    font-family: sans-serif;
    font-weight: 600;
}

.component--contentscrollcenter .details .code-content {
    background: transparent !important;
    padding: 0 !important;
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.7;
    white-space: pre;
    overflow-x: auto;
    max-width: 100%;
}

.component--contentscrollcenter .details .code-content code {
    font-family: 'Courier New', monospace;
    font-size: inherit;
}

/* Scrollbar стиль */
.component--contentscrollcenter .details .code-content::-webkit-scrollbar {
    height: 3px;
}

.component--contentscrollcenter .details .code-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== NAVIGATION ANCHORS (LEFT CENTER) ===== */
.component--contentscrollcenter .anchors {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    left: 5vw;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    list-style: none;
    margin: 0;
    padding: 0;
    z-index: 10;
}

.component--contentscrollcenter .anchors li {
    cursor: pointer;
    font-size: 0.8rem;
    line-height: 1.2;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.55);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.component--contentscrollcenter .anchors li .wysiwyg {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    line-height: inherit;
}

.component--contentscrollcenter .anchors li:hover {
    color: rgba(255, 255, 255, 0.8);
}

.component--contentscrollcenter .anchors li.--active {
    color: #FFFFFF;
    font-weight: 700;
}

/* ===== TYPEWRITER CURSOR ===== */
.typewriter-cursor {
    animation: blink 0.7s infinite;
    font-weight: 100;
    margin-left: 0.1em;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ===== ANIMATIONS ===== */
.component--contentscrollcenter .content .title .line {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.component--contentscrollcenter .content.--active .title .line--1 {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0ms;
}

.component--contentscrollcenter .content.--active .title .line--2 {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 100ms;
}

.component--contentscrollcenter .content .text-block-left {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.component--contentscrollcenter .content.--active .text-block-left {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 200ms;
}

.component--contentscrollcenter .content .details .group {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.component--contentscrollcenter .content.--active .details .group:nth-child(1) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 350ms;
}

.component--contentscrollcenter .content.--active .details .group:nth-child(2) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 430ms;
}

.component--contentscrollcenter .content.--active .details .group:nth-child(3) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 510ms;
}

.component--contentscrollcenter .content.--active .details .group:nth-child(4) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 590ms;
}

/* Fast fade out on deactivation */
.component--contentscrollcenter .content:not(.--active) .title .line,
.component--contentscrollcenter .content:not(.--active) .text-block-left,
.component--contentscrollcenter .content:not(.--active) .details .group {
    opacity: 0;
    transition-duration: 0.2s;
    transition-delay: 0ms;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .component--contentscrollcenter .content .info .text-block-left {
        max-width: 40vw;
    }

    .component--contentscrollcenter .content .info .details {
        width: 20vw;
    }
}

@media (max-width: 768px) {
    /* СЕКЦІЯ ПОСЛУГ */

    /* Заголовок — вище */
    .component--contentscrollcenter .content .info .title {
        left: 50% !important;
        top: 25% !important;
        transform: translateX(-50%) translateY(-50%) !important;
        width: 90vw !important;
        text-align: center !important;
    }

    .component--contentscrollcenter .content .info .title .line--1 {
        text-align: center !important;
        font-size: clamp(2.2rem, 9vw, 3rem) !important;
        white-space: normal !important;
    }

    .component--contentscrollcenter .content .info .title .line--2 {
        text-align: center !important;
        font-size: clamp(2.2rem, 9vw, 3rem) !important;
        white-space: normal !important;
    }

    /* Текстовий блок — під заголовком по центру */
    .component--contentscrollcenter .content .info .text-block-left {
        top: 48% !important;
        bottom: auto !important;
        left: 1rem !important;
        right: 1rem !important;
        background: rgba(255,255,255,0.88) !important;
        backdrop-filter: blur(8px) !important;
        padding: 0.8rem 1rem !important;
        border-radius: 4px !important;
        max-width: none !important;
        width: auto !important;
    }

    .component--contentscrollcenter .content .info .text-block-left p {
        font-size: 0.68rem !important;
        line-height: 1.45 !important;
        -webkit-line-clamp: unset !important;
        display: block !important;
        overflow: visible !important;
        margin: 0 0 0.4rem !important;
    }

    .component--contentscrollcenter .content .info .text-block-left .actions,
    .component--contentscrollcenter .content .info .text-block-left .link {
        display: none !important;
    }

    /* Код-блок — показуй внизу на мобільному */
    .component--contentscrollcenter .content .info .details {
        display: block !important;
        position: absolute !important;
        bottom: 4rem !important;
        left: 1rem !important;
        right: 1rem !important;
        width: auto !important;
    }

    .details .code-block {
        width: 100% !important;
        padding: 0.8rem 1rem !important;
        border-radius: 4px !important;
    }

    .details .code-content {
        font-size: 0.55rem !important;
        line-height: 1.4 !important;
        max-height: 70px !important;
        overflow: hidden !important;
    }

    .details .code-lang {
        font-size: 0.55rem !important;
        margin-bottom: 0.4rem !important;
    }

    /* Навігація — самий низ */
    .component--contentscrollcenter .anchors {
        left: 0 !important;
        top: auto !important;
        bottom: 0 !important;
        width: 100% !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        padding: 0.4rem 0.5rem !important;
        gap: 0.2rem 0.8rem !important;
        background: rgba(0,0,0,0.6) !important;
        backdrop-filter: blur(8px) !important;
        transform: none !important;
        justify-content: center !important;
    }

    .component--contentscrollcenter .anchors li {
        font-size: 0.55rem !important;
        letter-spacing: 0.02em !important;
        padding: 0 !important;
    }

    /* PRICING секція */
    #pricing h2 {
        font-size: clamp(2.5rem, 8vw, 4rem) !important;
    }

    /* CONTACT секція */
    #contact > div:first-of-type {
        padding: 0 5vw !important;
        max-width: 100% !important;
    }

    #contact h2 {
        font-size: clamp(2.5rem, 8vw, 4rem) !important;
    }

    /* Контактні лінки — вертикально */
    #contact a[href^="mailto"],
    #contact a[href^="https://t.me"],
    #contact a[href^="tel"] {
        font-size: 0.9rem !important;
    }

    /* Footer */
    footer {
        flex-direction: column !important;
        text-align: center !important;
        gap: 1rem !important;
    }
}

@media (max-width: 480px) {
    .component--contentscrollcenter .content .info .title .line--1,
    .component--contentscrollcenter .content .info .title .line--2 {
        font-size: clamp(1.8rem, 7vw, 2.5rem);
    }

    .component--contentscrollcenter .content .info .text-block-left p {
        -webkit-line-clamp: 2;
    }
}
