/* CV Product Page — additional styles */

/* Before/After viewer */
.before-after {
    padding: 0 0 80px;
}

.ba-viewer {
    position: relative;
    max-width: 560px;
    margin: 0 auto;
    cursor: pointer;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.ba-img {
    display: block;
    width: 100%;
    height: auto;
    transition: opacity 1.2s ease;
}

.ba-before {
    position: relative;
    z-index: 1;
}

.ba-after {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    opacity: 0;
}

/* Auto-crossfade animation */
.ba-viewer:not(.manual) .ba-after {
    animation: crossfade 8s ease-in-out infinite;
}

@keyframes crossfade {
    0%, 35% { opacity: 0; }
    45%, 85% { opacity: 1; }
    95%, 100% { opacity: 0; }
}

/* Manual toggle override */
.ba-viewer.show-after .ba-after {
    opacity: 1;
}
.ba-viewer.show-after .ba-before {
    opacity: 0;
}

/* Labels */
.ba-label {
    position: absolute;
    top: 16px;
    z-index: 10;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 6px;
    letter-spacing: 0.5px;
    transition: opacity 1.2s ease;
}

.ba-label-before {
    left: 16px;
    background: var(--text);
    color: white;
}

.ba-label-after {
    right: 16px;
    background: var(--primary);
    color: white;
    opacity: 0;
}

/* Show/hide labels with crossfade */
.ba-viewer:not(.manual) .ba-label-after {
    animation: crossfade 8s ease-in-out infinite;
}
.ba-viewer:not(.manual) .ba-label-before {
    animation: crossfade-reverse 8s ease-in-out infinite;
}

@keyframes crossfade-reverse {
    0%, 35% { opacity: 1; }
    45%, 85% { opacity: 0; }
    95%, 100% { opacity: 1; }
}

.ba-viewer.show-after .ba-label-before { opacity: 0; }
.ba-viewer.show-after .ba-label-after { opacity: 1; }

/* Hint text */
.ba-hint {
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

/* Closing statement — bigger, bolder */
.story-block p {
    font-size: 22px;
    font-weight: 600;
    color: var(--primary-dark);
    line-height: 1.4;
}

/* Mobile */
@media (max-width: 640px) {
    .before-after { padding: 0 0 48px; }
    .ba-viewer { max-width: 100%; }
    .ba-label { font-size: 11px; padding: 3px 8px; }
    .story-block p { font-size: 18px; }
}
