/**
 * [BLOCK STYLE: TESTIMONIALS]
 * LOCATION: logic/blocks/testimonialblock/style.css
 */

/* =========================================
   1. SLIDER STYLES (Keep existing)
   ========================================= */
.block-stories {
    background-color: var(--c-navy-800, #0f172a); 
    padding: 6rem 0;
    color: #fff;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}
.block-stories__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1;
}
.block-stories--has-bg .block-stories__overlay { opacity: 1; }

.block-stories__container {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    padding: 0 1.5rem;
    z-index: 2;
}


.stories-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.story-slide { flex: 0 0 100%; scroll-snap-align: center; display: flex; gap: 2rem; padding: 1rem; }
.story-content { flex: 1; }
.story-visual { flex: 1; }
.story-img-wrapper { width: 100%; aspect-ratio: 4/5; background-color: #333; }
.story-nav { position: absolute; top: 50%; } /* etc... */


/* =========================================
   2. BUBBLES MODE: INLINE READ MORE
   ========================================= */

.c-block-bubbles {
    background-color: var(--color-mystic); 
    
    /* THE OVERLAP FIX: */
    /* 1. Pull the beige background UP by 100px */
    margin-top: -100px; 
    
    /* 2. Sit in the middle layer (Behind Image 30, Above Green Wrapper) */
    position: relative;
    z-index: 20; 
    
    /* Push the actual floating bubbles down so they don't hide behind the image */
    padding-top: 150px; 
    padding-bottom: 8rem;
    overflow: hidden; 
}

.c-bubble-cloud {
    width: 100%;
    height: 150px; 
    max-width: 900px; 
    margin: 0 auto;
    position: relative;
}
/* =========================================
   STATIC BACKGROUND DECORATIONS
   ========================================= */
.c-bubble-bg-decor {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 100%; max-width: 950px;
    height: 450px;
    z-index: 0; /* Ensures it sits BEHIND the interactive bubbles */
    pointer-events: none; /* Prevents users from clicking them */
}

/* Ensure the interactive cloud sits on top of the decor */
.c-bubble-cloud {
    z-index: 10;
}

/* Base shape for all decorative bubbles */
.c-decor-shape {
    position: absolute;
    opacity: 0.95; /* Very slight transparency to blend */
}
.c-decor-shape::after {
    content: ''; position: absolute;
}

/* 1. Far Left (Dark Teal pointing down-left) */
.c-decor-shape--teal-dark {
    background: var(--color-tiber, #003238);
    width: 280px; height: 140px;
    top: 60px; left: -20px;
    border-radius: 40px 40px 40px 0;
}
.c-decor-shape--teal-dark::after {
    bottom: -30px; left: 0;
    border-width: 30px 30px 0 0;
    border-style: solid;
    border-color: var(--color-tiber, #003238) transparent transparent transparent;
}

/* 2. Mid Left (Light Teal circle behind orange) */
.c-decor-shape--teal-light {
    background: var(--color-blue-bayoux, #2E5D6F);
    width: 180px; height: 180px;
    border-radius: 50%;
    top: 10px; left: 240px;
}

/* 3. Center (Massive Orange pointing down-center) */
.c-decor-shape--orange {
    background: var(--color-tahiti-gold, #F0821A);
    width: 360px; height: 170px;
    top: 90px; left: 180px;
    border-radius: 30px;
}
.c-decor-shape--orange::after {
    bottom: -40px; left: 50%; transform: translateX(-50%);
    border-width: 40px 20px 0 20px;
    border-style: solid;
    border-color: var(--color-tahiti-gold, #F0821A) transparent transparent transparent;
}

/* 4. Mid Right (Massive Red circle pointing down-left) */
.c-decor-shape--red {
    background: var(--color-red-orange, #E63024);
    width: 220px; height: 200px;
    border-radius: 50%;
    top: 70px; right: 100px;
}
.c-decor-shape--red::after {
    bottom: -15px; left: 30px;
    border-width: 35px 0 0 30px;
    border-style: solid;
    border-color: var(--color-red-orange, #E63024) transparent transparent transparent;
    transform: rotate(-15deg);
}

/* 5. Far Right (Dark Teal pointing down-right) */
.c-decor-shape--teal-right {
    background: var(--color-tiber, #003238);
    width: 220px; height: 140px;
    top: 40px; right: -40px;
    border-radius: 30px 30px 0 30px;
}
.c-decor-shape--teal-right::after {
    bottom: -30px; right: 0;
    border-width: 30px 0 0 30px;
    border-style: solid;
    border-color: var(--color-tiber, #003238) transparent transparent transparent;
}

/* Hide background shapes on mobile to keep the screen clean */
@media (max-width: 768px) {
    .c-bubble-bg-decor { display: none; }
}
/* --- CARD WRAPPER --- */
.c-bubble-card {
    position: absolute; 
    transition: none !important; /* JS handles all movement and scaling */
    will-change: transform, z-index; 
    cursor: pointer;
    user-select: none; 
    top: 0; left: 0; 
}

/* --- SMOOTH SNAP ANIMATION --- */
/* Applied via JS when a bubble is tapped and needs to slide into view */
.c-bubble-card.is-snapping {
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1) !important; 
}

.c-bubble-card:hover { z-index: 100 !important; }
.c-bubble-card.is-active { z-index: 200 !important; }

/* --- BUBBLE BOX --- */
.c-bubble-box {
    padding: 1.5rem;
    border-radius: 1rem;
    color: white;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    
    /* DYNAMIC SHADOWS: Bound to a CSS variable updated by JS */
    box-shadow: 0 calc(5px + (var(--z-depth, 0) * 20px)) calc(10px + (var(--z-depth, 0) * 30px)) rgba(0,0,0, calc(0.1 + (var(--z-depth, 0) * 0.15)));
    
    transform: translateZ(0); 
}

.c-bubble-text {
    font-family: var(--font-body);
    font-size: 0.95rem; /* The master size */
    line-height: 1.5;
    margin: 0;
    display: block;
}

/* INLINE READ MORE (SEAMLESS FIX) */
.c-bubble-readmore {
    display: inline;
    font-weight: 700; /* Bold to indicate it's clickable */
    color: white;
    cursor: pointer;
    white-space: nowrap;
    
    /* HIDDEN STATE */
    opacity: 0;
    font-size: 0; /* Takes up no space */
    margin-left: 0;
    
    /* Smooth reveal that stays on the baseline */
    transition: opacity 0.3s ease, font-size 0.3s ease;
}

/* REVEALED STATE (Hover or Active) */
.c-bubble-card.is-active .c-bubble-readmore,
.c-bubble-card:hover .c-bubble-readmore {
    opacity: 1;
    
    /* 1em = Exactly the same size as the surrounding text */
    font-size: 1em; 
    
    /* Add a tiny space before the dots so it doesn't touch the last word */
    margin-left: 0.2rem; 
}

.c-bubble-readmore:hover {
    text-decoration: underline;
}
/* --- AUTHOR --- */
.c-bubble-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    
    /* REMOVED THE BORDER */
    border-top: none; 
    padding-top: 0;
    
    margin-top: 0.5rem;
}

.c-bubble-avatar {
    width: 35px; height: 35px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.8);
    object-fit: cover;
}

.c-bubble-name { 
    font-size: 0.8rem; 
    font-weight: 700; 
    color: rgba(255,255,255,0.95); 
}


/* --- COLORS & TAILS (Standard) --- */
.c-bubble-tail { position: absolute; width: 0; height: 0; border-style: solid; }

.c-bubble-color--orange .c-bubble-box { background-color: var(--color-tahiti-gold); }
.c-bubble-color--orange .c-bubble-tail { bottom: -14px; left: 50%; border-width: 15px 15px 0 15px; border-color: var(--color-tahiti-gold) transparent transparent transparent; }

.c-bubble-color--teal .c-bubble-box { background-color: var(--color-tiber); }
.c-bubble-color--teal .c-bubble-tail { bottom: -14px; left: 20%; border-width: 15px 15px 0 0; border-color: var(--color-tiber) transparent transparent transparent; }

.c-bubble-color--red .c-bubble-box { background-color: var(--color-red-orange, #E63024); }
.c-bubble-color--red .c-bubble-tail { bottom: -14px; right: 20%; border-width: 15px 0 0 15px; border-color: var(--color-red-orange, #E63024) transparent transparent transparent; }

.c-bubble-color--blue .c-bubble-box { background-color: var(--color-blue-bayoux, #2E5D6F); }
.c-bubble-color--blue .c-bubble-tail { bottom: -14px; left: 30%; border-width: 15px 15px 0 0; border-color: var(--color-blue-bayoux, #2E5D6F) transparent transparent transparent; }

/* =========================================
   INLINE-EDIT FILLER BUBBLES
   ========================================= */

.c-bubble-card--filler {
    opacity: 0.6; /* Slightly transparent */
    transition: opacity 0.3s ease !important; 
}
.c-bubble-card--filler.is-active {
    opacity: 1; /* Fully solid when frozen/typing */
}

/* 1. INLINE INPUTS */
.c-inline-quote {
    width: 100%;
    background: transparent;
    border: none;
    color: white;
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.4;
    resize: none;
    outline: none;
    /* Hide scrollbar */
    -ms-overflow-style: none; scrollbar-width: none;
    
    /* Lock interaction initially */
    pointer-events: none; 
}
.c-inline-quote::-webkit-scrollbar { display: none; }
.c-inline-quote::placeholder { color: rgba(255,255,255,0.7); }

.c-inline-name {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.95);
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 700;
    width: 120px;
    outline: none;
    pointer-events: none; /* Locked initially */
}
.c-inline-name::placeholder { color: rgba(255,255,255,0.7); }

/* When Frozen (Active), unlock inputs and show subtle background */
.c-bubble-card.is-active .c-inline-quote,
.c-bubble-card.is-active .c-inline-name {
    pointer-events: auto;
    background: rgba(0,0,0,0.15); /* Subtle dark bg so they know to type */
    border-radius: 4px;
    padding: 4px;
    margin-left: -4px;
}
.c-bubble-card.is-active .c-inline-quote:focus,
.c-bubble-card.is-active .c-inline-name:focus {
    background: rgba(0,0,0,0.3);
}

/* 2. AVATAR PICKER */
.c-inline-avatar-area {
    position: relative;
    display: flex;
    align-items: center;
}

.c-inline-avatar-btn {
    width: 35px; height: 35px;
    border-radius: 50%;
    border: 1px dashed rgba(255,255,255,0.8);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    text-align: center;
    pointer-events: none; /* Locked initially */
}
.c-bubble-card.is-active .c-inline-avatar-btn { pointer-events: auto; }
.c-bubble-card.is-active .c-inline-avatar-preview { cursor: pointer; pointer-events: auto; }

.c-inline-avatar-btn .tiny-text {
    font-size: 0.5rem; line-height: 1; color: rgba(255,255,255,0.8);
}

.c-inline-avatar-picker {
    position: absolute;
    bottom: 110%; left: 0;
    background: white;
    padding: 5px;
    border-radius: 25px;
    display: flex; gap: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 100;
}
.c-inline-avatar-picker img {
    width: 30px; height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
}
.c-inline-avatar-picker img:hover { border-color: var(--color-tahiti-gold); }

/* 3. CIRCULAR SEND BUTTON (CHAT-APP OVERHANG) */
.c-inline-submit {
    display: none; 
    position: absolute;
    
    /* THE 50/50 STRADDLE: Button is 38px, so pulling it -15px pushes it perfectly off the edge */
    bottom: -15px; 
    right: -15px;  
    
    width: 38px; 
    height: 38px;
    border-radius: 50%;
    border: none;
    
    background: white;
    color: var(--color-tiber, #003238); /* High contrast dark arrow */
    
    /* Beautiful shadow that casts onto the background behind the bubble */
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
    
    cursor: pointer;
    pointer-events: auto;
    z-index: 20;
    
    /* Smooth hover transitions */
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

/* When the bubble is active, display the button and trigger the POP animation */
.c-bubble-card.is-active .c-inline-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* The Spring Animation */
    animation: springPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* THE SPRING ANIMATION KEYFRAMES */
@keyframes springPop {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(15px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Pixel-perfect arrow sizing */
.c-inline-submit .submit-icon {
    width: 18px;
    height: 18px;
    transform: translateX(1px); /* Optical alignment nudge */
    transition: transform 0.2s ease; /* For hover effect */
}

/* Hover State: Turn Brand Orange and float slightly higher */
.c-inline-submit:hover {
    background: var(--color-tahiti-gold, #D97706);
    color: white;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

/* Tiny interaction: Arrow shoots forward slightly when hovered! */
.c-inline-submit:hover .submit-icon {
    transform: translateX(3px); 
}
/* =========================================
   MOBILE ADJUSTMENTS (ACTIVE PHYSICS)
   ========================================= */
@media (max-width: 900px) {
    .c-bubble-card--filler {
        display: none !important;
    }
    .c-block-bubbles {
        padding-top: 100px; /* Give room for mobile header */
        padding-bottom: 2rem;
    }
    
    .c-bubble-cloud {
        /* Give the cloud a strict height on mobile so they have room to bounce */
        height: 70vh; 
        min-height: 500px; 
        padding: 0;
    }
    
    .c-bubble-card {
        /* CRITICAL: Prevent bubbles from being wider than the phone screen.
           If PHP generates a 380px wide bubble on a 320px screen, it gets stuck.
           This forces it to shrink, and JS will recalculate the size perfectly!
        */
        max-width: 85vw !important; 
    }
    
    .c-bubble-text {
        font-size: 0.9rem; /* Slightly smaller text for mobile bubbles */
    }
}
/* =========================================
   INLINE AUTH BUTTON (TOP-LEFT OVERHANG)
   ========================================= */
.c-inline-auth-btn {
    display: none; 
    position: absolute;
    
    /* Mirrors the Send button's 50/50 overhang, but in the top left! */
    top: -15px; 
    left: -15px;  
    
    width: 38px; 
    height: 38px;
    border-radius: 50%;
    border: none;
    
    background: white;
    color: var(--color-tiber, #003238); 
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
    
    cursor: pointer;
    pointer-events: auto;
    z-index: 20;
    
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

/* Show and animate when the filler bubble is clicked */
.c-bubble-card.is-active .c-inline-auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Reuses the exact same bouncy animation as the Send button */
    animation: springPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.c-inline-auth-btn svg {
    width: 18px;
    height: 18px;
    transform: translateX(1px); /* Optical center */
}

/* Default Hover (Login): Turn Brand Orange */
.c-inline-auth-btn:hover {
    background: var(--color-tahiti-gold, #D97706);
    color: white;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

/* If the user is logged in, the button turns RED on hover to warn them they are exiting */
.c-inline-auth-btn[title="Logout"]:hover {
    background: #E63024;
}

/* Mobile Adjustment */
@media (max-width: 900px) {
    .c-bubble-auth-controls {
        top: -2rem;
        left: 1rem;
    }
}
/* =========================================
   3. MODAL (BOOK MODE) INTEGRATION
   ========================================= */

/* The Overlay */
.block-modal {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 99999;
    display: none; /* Toggled via JS */
    align-items: center; justify-content: center;
    padding: 1.5rem;
    backdrop-filter: blur(5px);
}

/* The Card */
.block-modal__card {
    background: white;
    width: 100%; max-width: 450px;
    border-radius: 1rem;
    overflow: hidden;
    position: relative;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Close Button */
.block-modal__close {
    position: absolute; top: 1rem; right: 1rem;
    background: rgba(0,0,0,0.1); border: none;
    width: 30px; height: 30px; border-radius: 50%;
    font-size: 1.5rem; line-height: 1; cursor: pointer;
    z-index: 10; color: #333;
    transition: background 0.2s;
}
.block-modal__close:hover { background: rgba(0,0,0,0.2); }

/* Book Visual (Top) */
.book-visual {
    height: 250px; width: 100%;
    background-color: var(--color-tiber);
}
.book-image {
    width: 100%; height: 100%;
    object-fit: cover;
}

/* Book Content (Bottom) */
.book-content {
    padding: 2rem;
    text-align: center;
}

.book-title {
    font-family: var(--font-headline);
    font-size: 1.5rem;
    color: var(--color-tiber);
    margin: 0;
    text-transform: uppercase;
}

.book-role {
    display: block;
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.book-slide p {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: #334155;
    margin: 0;
}