/* ==========================================================================
   Testimonials Block - Fully Responsive Styles
   Handles all screen sizes with proper stacking and mobile optimization
   ========================================================================== */

/* CSS Variables for Responsive Sizing */
:root {
    --testimonials-max-width: 1400px;
    --testimonials-padding-x: 3rem;
    --testimonials-padding-y: 3rem;
    --testimonials-gap: 4rem;
    --testimonials-card-height: 520px;
    --testimonials-card-padding: 2.5rem;
    --testimonials-transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Main Block Container */
.testimonials-block {
    background: var(--testimonials-bg-color, #F5F5F5);
    color: var(--testimonials-text-color, #0A0F1C);
    padding: var(--testimonials-padding-y) 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    position: relative;
    width: 100%;
}

.testimonials-block.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* Container - Responsive Grid */
.testimonials-container {
    max-width: var(--testimonials-max-width);
    margin: 0 auto;
    padding: 0 var(--testimonials-padding-x);
    display: grid;
    grid-template-columns: 40% 55%;
    gap: var(--testimonials-gap);
    align-items: start;
    min-height: 600px;
    box-sizing: border-box;
}

/* ==========================================================================
   LEFT COLUMN: CONTENT
   ========================================================================== */

.testimonials-content {
    position: relative;
    z-index: 2;
    text-align: left;
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.8s ease 0.2s, transform 0.8s ease 0.2s;
}

.testimonials-block.in-view .testimonials-content {
    opacity: 1;
    transform: translateX(0);
}

/* Typography - Responsive */
.testimonials-heading {
    font-family: 'Neue Haas Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.testimonials-description {
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    line-height: 1.6;
    color: rgba(10, 15, 28, 0.8);
    max-width: 500px;
}

/* ==========================================================================
   RIGHT COLUMN: CARDS
   ========================================================================== */

.testimonials-cards {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
    perspective: 1200px;
    transform-style: preserve-3d;
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.8s ease 0.4s, transform 0.8s ease 0.4s;
}

.testimonials-block.in-view .testimonials-cards {
    opacity: 1;
    transform: translateX(0);
}

.testimonials-carousel {
    position: relative;
    width: 100%;
    max-width: 100%;
}

.testimonials-track {
    position: relative;
    width: 100%;
    height: var(--testimonials-card-height);
    transform-style: preserve-3d;
}

/* ==========================================================================
   TESTIMONIAL CARDS - Desktop Stacking
   ========================================================================== */

.testimonial-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: #42E0C8;
    border-radius: 20px;
    padding: var(--testimonials-card-padding);
    box-shadow: 
        0 25px 60px rgba(0, 0, 0, 0.15),
        0 12px 30px rgba(0, 0, 0, 0.1),
        0 6px 15px rgba(0, 0, 0, 0.08),
        0 3px 8px rgba(0, 0, 0, 0.05);
    transform: translateX(0) translateY(0) rotate(0deg);
    transition: var(--testimonials-transition);
    opacity: 0;
    pointer-events: none;
    z-index: 1;
    height: 480px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    user-select: none;
    touch-action: pan-y;
    transform-style: preserve-3d;
    perspective: 1000px;
    overflow: hidden;
    box-sizing: border-box;
}

/* Active Card State */
.testimonial-card.active {
    opacity: 1;
    pointer-events: all;
    z-index: 10;
    transform: translateX(0) translateY(0) rotate(0deg);
    cursor: grab;
}

.testimonial-card.active:hover {
    cursor: grab;
}

.testimonial-card.active:active,
.testimonial-card.dragging {
    cursor: grabbing !important;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
}

/* Stacked Cards Positions */
.testimonial-card.stack-1 {
    opacity: 0.85;
    transform: translateX(20px) translateY(20px) rotate(2deg) translateZ(-20px);
    z-index: 9;
    box-shadow: 
        0 15px 30px rgba(0, 0, 0, 0.08),
        0 6px 12px rgba(0, 0, 0, 0.04),
        0 3px 6px rgba(0, 0, 0, 0.02);
}

.testimonial-card.stack-2 {
    opacity: 0.7;
    transform: translateX(40px) translateY(40px) rotate(4deg) translateZ(-40px);
    z-index: 8;
    box-shadow: 
        0 10px 20px rgba(0, 0, 0, 0.06),
        0 4px 8px rgba(0, 0, 0, 0.03),
        0 2px 4px rgba(0, 0, 0, 0.01);
}

.testimonial-card.stack-3 {
    opacity: 0.55;
    transform: translateX(60px) translateY(60px) rotate(6deg) translateZ(-60px);
    z-index: 7;
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.04),
        0 3px 6px rgba(0, 0, 0, 0.02),
        0 1px 2px rgba(0, 0, 0, 0.01);
}

.testimonial-card.stack-4 {
    opacity: 0.4;
    transform: translateX(80px) translateY(80px) rotate(8deg) translateZ(-80px);
    z-index: 6;
    box-shadow: 
        0 5px 10px rgba(0, 0, 0, 0.03),
        0 2px 4px rgba(0, 0, 0, 0.01),
        0 1px 2px rgba(0, 0, 0, 0.005);
}

/* Card Content */
.testimonial-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 1rem;
    justify-content: flex-start;
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
    position: relative;
}

.testimonial-card.active:hover .testimonial-content {
    transform: translateZ(10px);
}

/* Logo Area */
.testimonial-logo {
    height: 80px;
    display: flex;
    align-items: center;
    text-align: left;
    flex-shrink: 0;
}

.company-logo {
    max-width: 160px;
    max-height: 60px;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: left center;
    filter: brightness(0) contrast(1);
    opacity: 0.8;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

.testimonial-card.active:hover .company-logo {
    filter: none;
    opacity: 1;
}

/* Content Area */
.testimonial-content-area {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    min-height: 180px;
    max-height: 200px;
    overflow: hidden;
    margin: 0.5rem 0;
}

/* Text Content */
.testimonial-text {
    font-family: 'Neue Haas Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.125rem;
    font-weight: 400;
    line-height: 1.5;
    margin: 0;
    width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.testimonial-text p {
    margin: 0 0 1rem 0;
}

.testimonial-text p:last-child {
    margin-bottom: 0;
}

/* Video Styles */
.testimonial-video {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.testimonial-video-player {
    width: 100%;
    height: auto;
    max-height: 280px;
    display: block;
    border-radius: 12px;
    object-fit: cover;
    background: #000;
}

/* Image Styles */
.testimonial-image {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.testimonial-featured-image {
    width: 100%;
    height: auto;
    max-height: 250px;
    object-fit: cover;
    border-radius: 12px;
}

/* Author Info */
.testimonial-author {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
    min-height: 50px;
    flex-shrink: 0;
}

.testimonial-author .author-name::after {
    content: "\2022";
    margin: 0 0.5rem;
    opacity: 0.5;
}

.author-name {
    font-family: 'Neue Haas Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
}

.author-company {
    font-family: 'Neue Haas Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.125rem;
    font-weight: 500;
    opacity: 0.85;
}

/* CTA Styles */
.testimonial-cta {
    margin-top: auto;
    padding-top: 0.5rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    text-align: right;
    flex-shrink: 0;
}

.testimonial-card.active .testimonial-cta {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.2s;
}

.testimonial-cta-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--cta-text-color, #0A0F1C);
    font-weight: 500;
    font-size: 1.25rem;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
    margin-left: auto;
}

.testimonial-cta-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 35px;
    border: 2px solid var(--cta-button-color, #0A0F1C);
    border-radius: 9999px;
    background: transparent;
    color: var(--cta-button-color, #0A0F1C);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.testimonial-cta-link:hover .testimonial-cta-button {
    background: var(--cta-button-color, #0A0F1C);
    color: white;
}

.testimonial-cta-button .arrow-icon {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--cta-button-color, #0A0F1C);
    transition: all 0.3s ease;
}

.testimonial-cta-link:hover .testimonial-cta-button .arrow-icon {
    color: white;
}

/* Navigation Dots */
.testimonials-nav {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 2rem;
}

.testimonial-dot {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    position: relative;
}

.testimonial-dot:hover {
    background: rgba(10, 15, 28, 0.1);
}

.testimonial-dot .dot {
    display: block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(10, 15, 28, 0.3);
    transition: all 0.3s ease;
}

.testimonial-dot.active .dot {
    background: #42E0C8;
    transform: scale(1.2);
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* Ultra-wide screens (2560px+) */
@media (min-width: 2560px) {
    :root {
        --testimonials-max-width: 1920px;
        --testimonials-gap: 6rem;
    }
}

/* Large Desktop (1920px - 2559px) */
@media (min-width: 1920px) and (max-width: 2559px) {
    :root {
        --testimonials-max-width: 1600px;
        --testimonials-gap: 5rem;
    }
}

/* Medium Desktop (1500px - 1919px) */
@media (min-width: 1500px) and (max-width: 1919px) {
    :root {
        --testimonials-gap: 4rem;
    }
}

/* Small Desktop (1200px - 1499px) */
@media (min-width: 1200px) and (max-width: 1499px) {
    :root {
        --testimonials-padding-x: 2.5rem;
        --testimonials-gap: 3rem;
    }
    
    .testimonials-container {
        grid-template-columns: 34% 60%;
    }
    
    .testimonial-card.stack-1 {
        transform: translateX(18px) translateY(18px) rotate(2deg) translateZ(-20px);
    }
    
    .testimonial-card.stack-2 {
        transform: translateX(36px) translateY(36px) rotate(4deg) translateZ(-40px);
    }
    
    .testimonial-card.stack-3 {
        transform: translateX(54px) translateY(54px) rotate(6deg) translateZ(-60px);
    }
    
    .testimonial-card.stack-4 {
        transform: translateX(72px) translateY(72px) rotate(8deg) translateZ(-80px);
    }
}

/* Laptop (1024px - 1199px) */
@media (min-width: 1024px) and (max-width: 1199px) {
    :root {
        --testimonials-padding-x: 2rem;
        --testimonials-gap: 3rem;
    }
    
    .testimonials-container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    

    
    .testimonials-description {
        max-width: none;
    }
    
    .testimonial-card.stack-1 {
        transform: translateX(15px) translateY(15px) rotate(1.5deg) translateZ(-15px);
    }
    
    .testimonial-card.stack-2 {
        transform: translateX(30px) translateY(30px) rotate(3deg) translateZ(-30px);
    }
    
    .testimonial-card.stack-3 {
        transform: translateX(45px) translateY(45px) rotate(4.5deg) translateZ(-45px);
    }
    
    .testimonial-card.stack-4 {
        transform: translateX(60px) translateY(60px) rotate(6deg) translateZ(-60px);
    }
}

/* Tablet (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    :root {
        --testimonials-padding-x: 2rem;
        --testimonials-padding-y: 2.5rem;
        --testimonials-card-height: 450px;
        --testimonials-card-padding: 2rem;
    }
    
    .testimonials-container {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        min-height: auto;
    }
    
    .testimonials-heading {
        font-size: 2.5rem;
    }
    
    .testimonials-description {
        max-width: none;
        font-size: 1.125rem;
    }
    
    .testimonials-cards {
        min-height: 450px;
    }
    
    .testimonial-card {
        height: 450px;
        padding: 2rem;
    }
    
    /* Smaller stack offsets for tablet */
    .testimonial-card.stack-1 {
        transform: translateX(12px) translateY(12px) rotate(1deg) translateZ(-10px);
    }
    
    .testimonial-card.stack-2 {
        transform: translateX(24px) translateY(24px) rotate(2deg) translateZ(-20px);
    }
    
    .testimonial-card.stack-3 {
        transform: translateX(36px) translateY(36px) rotate(3deg) translateZ(-30px);
    }
    
    .testimonial-card.stack-4 {
        transform: translateX(48px) translateY(48px) rotate(4deg) translateZ(-40px);
    }
    
    .company-logo {
        max-width: 140px;
        max-height: 50px;
    }
    
    .testimonial-text {
        font-size: 1rem;
    }
    
    .author-name {
        font-size: 1.125rem;
    }
    
    .author-company {
        font-size: 1rem;
    }
    
    .testimonial-cta-link {
        font-size: 1.125rem;
    }
    
    .testimonial-cta-button {
        width: 60px;
        height: 30px;
    }
}

/* Mobile Landscape (576px - 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    :root {
        --testimonials-padding-x: 1.5rem;
        --testimonials-padding-y: 2rem;
        --testimonials-card-padding: 1.75rem;
    }
    
    .testimonials-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        min-height: auto;
    }
    
    .testimonials-heading {
        font-size: 2rem;
    }
    
    .testimonials-description {
        font-size: 1rem;
        max-width: none;
    }
    
    /* Convert to horizontal scroll */
    .testimonials-cards {
        min-height: auto;
        perspective: none;
        transform-style: flat;
    }
    
    .testimonials-carousel {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        padding-bottom: 1rem;
    }
    
    .testimonials-track {
        display: flex;
        gap: 1.25rem;
        height: auto;
        transform-style: flat;
        padding-right: 1.5rem;
    }
    
    /* Reset card positioning for mobile */
    .testimonial-card,
    .testimonial-card.active,
    .testimonial-card.stack-1,
    .testimonial-card.stack-2,
    .testimonial-card.stack-3,
    .testimonial-card.stack-4 {
        position: relative !important;
        flex: 0 0 80%;
        max-width: 400px;
        height: auto;
        min-height: 420px;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: all !important;
        transform: none !important;
        scroll-snap-align: center;
        z-index: 1 !important;
        cursor: default !important;
    }
    
    .testimonial-content-area {
        max-height: none;
        min-height: 120px;
        overflow: visible;
    }
    
    .testimonial-text {
        -webkit-line-clamp: unset;
        display: block;
        overflow: visible;
        font-size: 1rem;
    }
    
    .testimonial-logo {
        height: 70px;
    }
    
    .company-logo {
        max-width: 130px;
        max-height: 50px;
    }
    
    .testimonial-author {
        min-height: auto;
    }
    
    .author-name {
        font-size: 1.125rem;
    }
    
    .author-company {
        font-size: 1rem;
    }
    
    .testimonial-cta {
        opacity: 1 !important;
        transform: none !important;
    }
    
    .testimonial-cta-link {
        font-size: 1rem;
        gap: 0.5rem;
    }
    
    .testimonial-cta-button {
        width: 50px;
        height: 25px;
    }
}

/* Mobile Portrait (max-width: 575px) */
@media (max-width: 575px) {
    :root {
        --testimonials-padding-x: 1rem;
        --testimonials-padding-y: 2rem;
        --testimonials-card-padding: 1.5rem;
    }
    
    .testimonials-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        min-height: auto;
    }
    
    .testimonials-heading {
        font-size: 1.75rem;
    }
    
    .testimonials-description {
        font-size: 1rem;
        max-width: none;
    }
    
    /* Convert to horizontal scroll */
    .testimonials-cards {
        min-height: auto;
        perspective: none;
        transform-style: flat;
    }
    
    .testimonials-carousel {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        padding-bottom: 1rem;
    }
    
    /* Hide scrollbar but keep functionality */
    .testimonials-carousel::-webkit-scrollbar {
        display: none;
    }
    
    .testimonials-carousel {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    
    .testimonials-track {
        display: flex;
        gap: 1rem;
        height: auto;
        transform-style: flat;
        padding-right: 1rem;
    }
    
    /* Reset all card states for mobile */
    .testimonial-card,
    .testimonial-card.active,
    .testimonial-card.stack-1,
    .testimonial-card.stack-2,
    .testimonial-card.stack-3,
    .testimonial-card.stack-4 {
        position: relative !important;
        flex: 0 0 90%;
        max-width: 350px;
        height: auto;
        min-height: auto;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: all !important;
        transform: none !important;
        scroll-snap-align: center;
        z-index: 1 !important;
        cursor: default !important;
        padding: 1.5rem;
    }
    
    /* Reset content constraints */
    .testimonial-content-area {
        max-height: none;
        min-height: auto;
        overflow: visible;
    }
    
    .testimonial-text {
        -webkit-line-clamp: unset;
        display: block;
        overflow: visible;
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .testimonial-logo {
        height: 60px;
        margin-bottom: 1rem;
    }
    
    .company-logo {
        max-width: 120px;
        max-height: 45px;
    }
    
    .testimonial-featured-image {
        max-height: 180px;
    }
    
    .testimonial-video-player {
        max-height: 180px;
    }
    
    .testimonial-author {
        min-height: auto;
        gap: 0.25rem;
    }
    
    .author-name {
        font-size: 1rem;
    }
    
    .author-company {
        font-size: 0.9rem;
    }
    
    /* Always show CTAs on mobile */
    .testimonial-cta {
        opacity: 1 !important;
        transform: none !important;
        margin-top: 1rem;
    }
    
    .testimonial-cta-link {
        font-size: 0.9rem;
        gap: 0.5rem;
    }
    
    .testimonial-cta-button {
        width: 45px;
        height: 24px;
        border-width: 1.5px;
    }
    
    .testimonial-cta-button .arrow-icon {
        font-size: 0.9rem;
    }
    
    .testimonials-nav {
        gap: 0.5rem;
        margin-top: 1.5rem;
    }
    
    .testimonial-dot {
        padding: 0.35rem;
    }
    
    .testimonial-dot .dot {
        width: 10px;
        height: 10px;
    }
}

/* Small Mobile (max-width: 400px) */
@media (max-width: 400px) {
    .testimonial-card {
        flex: 0 0 95%;
        max-width: 320px;
    }
    
    .testimonials-heading {
        font-size: 1.5rem;
    }
    
    .testimonials-description {
        font-size: 0.95rem;
    }
    
    .testimonial-text {
        font-size: 0.9rem;
    }
}

/* ==========================================================================
   ACCESSIBILITY & SPECIAL MODES
   ========================================================================== */

/* Focus States */
.testimonial-dot:focus {
    outline: 2px solid #42E0C8;
    outline-offset: 2px;
}

.testimonial-dot:focus:not(:focus-visible) {
    outline: none;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .testimonials-block,
    .testimonials-content,
    .testimonials-cards,
    .testimonial-card,
    .testimonial-dot,
    .testimonial-cta,
    .testimonial-content {
        transition: none !important;
        animation: none !important;
    }
    
    .testimonial-card {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .testimonial-card {
        border: 2px solid currentColor;
    }
    
    .testimonial-dot.active .dot {
        outline: 2px solid currentColor;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .testimonial-card {
        cursor: default !important;
    }
    
    .testimonial-card.active:hover {
        cursor: default !important;
    }
    
    .company-logo {
        filter: none;
        opacity: 1;
    }
    
    .testimonial-card.active:hover .testimonial-content {
        transform: none;
    }
}

/* Print Styles */
@media print {
    .testimonials-block {
        background: white !important;
        color: black !important;
    }
    
    .testimonial-card {
        page-break-inside: avoid;
        position: relative !important;
        transform: none !important;
        opacity: 1 !important;
        box-shadow: none !important;
        border: 1px solid #000;
        margin-bottom: 1rem;
    }
    
    .testimonials-nav {
        display: none;
    }
}

/* ACF Block Editor Styles */
.acf-block-preview .testimonials-block {
    padding: 1rem 0;
    opacity: 1;
    transform: none;
}

.acf-block-preview .testimonials-container {
    gap: 2rem;
}

.acf-block-preview .testimonials-content,
.acf-block-preview .testimonials-cards {
    opacity: 1;
    transform: none;
}

.acf-block-preview .testimonial-card {
    position: relative;
    opacity: 1;
    transform: none;
    margin-bottom: 1rem;
}

/* Ensure full visibility for image testimonials on tablet and desktop */
@media (min-width: 768px) {
    .testimonial-content-area[data-content-type="image"] .testimonial-featured-image {
        width: auto;
        max-width: 100%;
        height: auto;
        max-height: 200px;
        object-fit: contain;
        display: block;
    }
}