/* ===== Teaching Section Styles ===== */
/* Elegant split-screen design with premium touches */

#teaching {
    position: relative;
    padding: 0;
    overflow: hidden;
    /* Light lavender for noticeable contrast */
    background: #f3f0f8;
}

.teaching-wrapper {
    position: relative; /* For absolute positioning of video */
}

/* Add subtle texture overlay for sophistication */
#teaching::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 35px,
            rgba(255, 255, 255, 0.03) 35px,
            rgba(255, 255, 255, 0.03) 70px
        );
    pointer-events: none;
    z-index: 1;
}

/* Main wrapper for split layout */
.teaching-wrapper {
    display: flex;
    position: relative;
    z-index: 2;
    width: 100%;
    align-items: flex-start;
}

/* Video container - stops scrolling when it fills viewport */
.teaching-video-container {
    flex: 0 0 50%;
    width: 50%;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    background: #1a1a1a;
}

/* Video styling */
.teaching-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Add elegant frame effect to video */
.teaching-video-container::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
    z-index: 1;
    box-shadow: 
        inset 0 0 50px rgba(0, 0, 0, 0.3),
        inset 0 0 100px rgba(0, 0, 0, 0.1);
}

/* Content container - right side */
.teaching-content {
    flex: 0 0 50%;
    width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 5rem;
    position: relative;
    box-sizing: border-box;
    min-height: 100vh;
}

/* Title styling - Match standard section titles */
.teaching-title {
    font-family: var(--font-primary);
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--color-text);
    margin-bottom: var(--spacing-md);
    text-align: center;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.teaching-title.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Standard section title underline */
.teaching-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    background-color: var(--color-accent);
    margin: var(--spacing-xs) auto;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
}

.teaching-title.visible::after {
    transform: scaleX(1);
}

/* Left align title for larger viewports (2-column layout) */
@media (min-width: 773px) {
    .teaching-title {
        text-align: left;
    }
    
    .teaching-title::after {
        margin: var(--spacing-xs) 0;
        transform-origin: left;
    }
}

/* Text content styling */
.teaching-text {
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    line-height: 1.8;
    color: #4a4158;
    max-width: 600px;
}

.teaching-text p {
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.teaching-text p.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger paragraph animations */
.teaching-text p:nth-child(1) { transition-delay: 0.1s; }
.teaching-text p:nth-child(2) { transition-delay: 0.2s; }
.teaching-text p:nth-child(3) { transition-delay: 0.3s; }
.teaching-text p:nth-child(4) { transition-delay: 0.4s; }


/* Remove first-letter styling in teaching section */
.teaching-text .biography-text:first-of-type::first-letter {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    float: none;
    line-height: inherit;
    margin: 0;
}

/* Section headings within teaching text */
.teaching-section-heading {
    font-family: var(--font-primary, 'Cormorant Garamond', serif);
    font-size: 1.875rem;
    font-weight: 400;
    font-style: italic;
    color: #2a1f36;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.3;
    opacity: 1;
    transform: translateY(0);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.teaching-section-heading.visible {
    opacity: 1;
    transform: translateY(0);
}

/* First heading doesn't need top margin */
.teaching-section-heading:first-child {
    margin-top: 0;
}

/* Add decorative element */
.teaching-content::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 2rem;
    transform: translateY(-50%);
    width: 150px;
    height: 150px;
    background: radial-gradient(circle at center, 
        rgba(139, 108, 197, 0.08) 0%, 
        transparent 70%
    );
    border-radius: 50%;
    filter: blur(40px);
    pointer-events: none;
}

/* Tablet responsive (768px - 1024px) */
@media (max-width: 1024px) {
    .teaching-content {
        padding: 3rem;
    }
    
    .teaching-title {
        font-size: 2.2rem;
    }
    
    .teaching-text {
        font-size: 1rem;
    }
    
    .teaching-section-heading {
        font-size: 1.625rem;
    }
}

/* Mobile responsive (below 772px) */
@media (max-width: 772px) {
    .teaching-wrapper {
        flex-direction: column;
        min-height: auto;
    }
    
    /* Content moves to bottom on mobile */
    .teaching-content {
        order: 2;
        padding: 2rem 1.5rem 3rem;
        width: 100%;
        flex: none;
        min-height: auto;
        /* Reset any transforms or positioning */
        margin-left: 0 !important;
        transform: none !important;
    }
    
    /* Video moves to top on mobile */
    .teaching-video-container {
        position: relative !important; /* Remove sticky on mobile */
        width: 100% !important;
        height: 50vh;
        order: 1;
        flex: none;
        /* Reset any transforms or positioning */
        top: auto !important;
        bottom: auto !important;
        left: auto !important;
        z-index: auto !important;
    }
    
    .teaching-title {
        font-size: 1.8rem;
        margin-bottom: var(--spacing-md);
    }
    
    .teaching-text {
        font-size: 0.975rem;
        max-width: none;
    }
    
    .teaching-section-heading {
        font-size: 1.5rem;
        margin-top: 2rem;
        margin-bottom: 1.25rem;
    }
    
    .teaching-content::before {
        display: none;
    }
}

/* Small mobile (below 480px) */
@media (max-width: 480px) {
    .teaching-video-container {
        height: 40vh;
    }
    
    .teaching-content {
        padding: 1.5rem 1rem 2.5rem;
    }
    
    .teaching-title {
        font-size: 1.8rem;
    }
    
    .teaching-text {
        font-size: 0.9375rem;
        line-height: 1.7;
    }
    
    .teaching-section-heading {
        font-size: 1.375rem;
    }
}

/* Video is always visible */
.teaching-video {
    opacity: 1;
    background: #000;
}


/* Parallax effect for desktop */
@media (min-width: 769px) {
    .teaching-content {
        transform: translateY(0);
        transition: transform 0.1s ease-out;
        will-change: transform;
    }
    
    .teaching-video {
        transform: scale(1.1);
        transition: transform 0.1s ease-out;
        will-change: transform;
    }
}

/* Performance optimization */
@media (prefers-reduced-motion: reduce) {
    .teaching-title,
    .teaching-title::after,
    .teaching-text p,
    .teaching-video,
    .teaching-content {
        transition: none !important;
        animation: none !important;
    }
}

/* Edge browser video fix */
@supports (-ms-ime-align: auto) {
    .teaching-video {
        height: 100vh;
    }
}

/* Safari video fix */
@supports (-webkit-appearance: none) and (stroke-color: transparent) {
    .teaching-video-container {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}