/* ============================================================
   Rankbeta — Testimonial Carousel Widget
   Dark-luxury theme: #0d0d0d bg · #C9A052 gold · warm white text
   Layout: [LEFT 55% quote + author] | [RIGHT 45% arch + person]
   ============================================================ */

/* ── Widget wrapper resets ── */
.rb-tc-section,
.elementor-widget-rankbeta_tc,
.elementor-widget-rankbeta_tc .elementor-widget-container {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* ── Section ── */
.rb-tc-section {
    position: relative;
    width: 100%;
    background-color: #0d0d0d;   /* default — Elementor Group_Control_Background overrides */
    overflow: hidden;
}

/* ── Inner flex row ── */
.rb-tc-inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    padding: 80px 80px 60px 80px;
    gap: 0;
}

/* ============================================================
   LEFT PANEL
   ============================================================ */
.rb-tc-left {
    flex: 0 0 55%;
    max-width: 55%;
    display: flex;
    flex-direction: column;
    padding-right: 48px;
    box-sizing: border-box;
}

/* ── Large decorative opening quote ── */
.rb-tc-quote-mark {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 80px;
    line-height: 0.7;
    color: #C9A052;
    user-select: none;
    margin-bottom: 20px;
    display: block;
}

/* ── Items container: cross-fade stack ── */
.rb-tc-items {
    position: relative;
    min-height: 220px;   /* JS sets to tallest item */
}

/* All testimonial items stacked, invisible by default */
.rb-tc-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.7s ease, transform 0.7s ease;  /* JS overrides speed */
    pointer-events: none;
}
.rb-tc-item.rb-tc-item--active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ── Quote text ── */
.rb-tc-quote {
    margin: 0 0 32px 0;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 19px;
    line-height: 1.85;
    color: #f0ead8;
    font-style: italic;
}

/* ── Author block ── */
.rb-tc-author {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Person name — small caps */
.rb-tc-name {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 2.8px;
    text-transform: uppercase;
    color: #C9A052;
}

/* Person role */
.rb-tc-role {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    font-size: 12px;
    letter-spacing: 0.5px;
    color: rgba(240,234,216,0.55);
}

/* ── Gold divider line above name ── */
.rb-tc-author::before {
    content: '';
    display: block;
    width: 36px;
    height: 1px;
    background: rgba(201,160,82,0.5);
    margin-bottom: 4px;
}

/* ── Dots ── */
.rb-tc-dots {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 40px;
}
.rb-tc-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: rgba(201,160,82,0.3);
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: background-color 0.3s ease, transform 0.3s ease;
}
.rb-tc-dot.rb-tc-dot--active {
    background-color: #C9A052;
    transform: scale(1.45);
}

/* ============================================================
   RIGHT PANEL — arch + person
   ============================================================ */
.rb-tc-right {
    flex: 1;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    /* padding-top set by Elementor (person overflow above arch) */
    padding-top: 60px;
    box-sizing: border-box;
    min-height: 460px;
    align-self: stretch;
}

/* ── Arch shape ──
   Top: fully rounded (semicircle). Bottom: flat (0 radius by default).
   Width/height/colors all controlled by Elementor style tab.
── */
.rb-tc-arch {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    height: 420px;
    /* Top radius = half the width = true semicircle arch top */
    border-radius: 140px 140px 0 0;
    background-color: #f2ead8;   /* Elementor Group_Control_Background overrides */
    z-index: 1;
    --rb-arch-br-bottom: 0px;
    border-width: 0;
    border-style: solid;
    border-color: transparent;
}

/* ── Person images: positioned on top of arch ── */
.rb-tc-persons {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    width: 280px;   /* matches arch width */
    /* top is set by Elementor (overflow above arch) */
    top: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

/* Individual person crossfade */
.rb-tc-person {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    opacity: 0;
    transition: opacity 0.7s ease, transform 0.7s ease;  /* JS overrides speed */
    pointer-events: none;
    text-align: center;
    width: 100%;
}
.rb-tc-person.rb-tc-person--active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* Person photo */
.rb-tc-person-img {
    display: block;
    width: auto;
    max-width: 100%;
    height: 460px;   /* Elementor override */
    object-fit: contain;
    object-position: bottom center;
    filter: drop-shadow(0 16px 40px rgba(0,0,0,0.45));
}

/* Placeholder when no image is uploaded */
.rb-tc-person-placeholder {
    width: 200px;
    height: 400px;
    border-radius: 100px 100px 0 0;
    background: rgba(201,160,82,0.12);
    border: 1px dashed rgba(201,160,82,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}
.rb-tc-person-placeholder::after {
    content: 'Add photo';
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    color: rgba(201,160,82,0.4);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ============================================================
   VINEYARD — gold line-art, bottom of section
   ============================================================ */
.rb-tc-vineyard {
    position: relative;
    z-index: 1;
    width: 100%;
    line-height: 0;
    color: #C9A052;
    opacity: 0.35;
    margin-top: -20px;
}
.rb-tc-vineyard svg {
    width: 100%;
    height: auto;
    display: block;
}

/* ============================================================
   ENTRANCE ANIMATION (desktop only)
   ============================================================ */
.rb-tc-left {
    opacity: 0;
    transform: translateX(-24px);
    transition: opacity 0.9s cubic-bezier(0.22,1,0.36,1),
                transform 0.9s cubic-bezier(0.22,1,0.36,1);
}
.rb-tc-arch {
    opacity: 0;
    transform: translateX(-50%) translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.22,1,0.36,1) 0.15s,
                transform 0.8s cubic-bezier(0.22,1,0.36,1) 0.15s;
}

.rb-tc-section.rb-tc-entered .rb-tc-left {
    opacity: 1;
    transform: translateX(0);
}
.rb-tc-section.rb-tc-entered .rb-tc-arch {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .rb-tc-inner        { padding: 60px 40px 50px 50px; }
    .rb-tc-left         { flex: 0 0 52%; max-width: 52%; }
    .rb-tc-arch         { width: 240px; height: 360px; border-radius: 120px 120px 0 0; }
    .rb-tc-persons      { width: 240px; }
    .rb-tc-person-img   { height: 380px; }
    .rb-tc-quote        { font-size: 17px; }
}

@media (max-width: 767px) {
    /* Stack: person visual top, quote below */
    .rb-tc-inner {
        flex-direction: column-reverse;
        padding: 0 24px 48px;
        min-height: unset;
        align-items: center;
    }
    .rb-tc-left {
        flex: none;
        max-width: 100%;
        width: 100%;
        padding-right: 0;
        padding-top: 36px;
        /* Center all quote text on mobile */
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        /* override entrance animation for mobile */
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    /*
     * CRITICAL WIDTH FIX:
     * .rb-tc-left uses align-items:center (column flex). Children whose size
     * depends on content width (including .rb-tc-items whose children are all
     * position:absolute) collapse to ~0 px — making the quote text wrap
     * one word per line. Explicit width:100% forces the container to the full
     * panel width so position:absolute items resolve their own width correctly.
     */
    .rb-tc-items        { width: 100%; align-self: stretch; }

    .rb-tc-quote-mark   { text-align: center; }
    .rb-tc-quote        { font-size: 16px; line-height: 1.7; text-align: center; }
    /* Author block: center the divider line and text */
    .rb-tc-author::before { margin-left: auto; margin-right: auto; }
    .rb-tc-name,
    .rb-tc-role         { text-align: center; display: block; }
    /* Dots: centered */
    .rb-tc-dots         { justify-content: center; margin-top: 28px; }
    .rb-tc-right {
        width: 100%;
        min-height: 360px;
        flex-shrink: 0;
        padding-top: 40px;
    }
    .rb-tc-arch {
        width: 220px;
        height: 320px;
        border-radius: 110px 110px 0 0;
        opacity: 1 !important;
        transform: translateX(-50%) !important;
        transition: none !important;
    }
    .rb-tc-persons      { width: 220px; }
    .rb-tc-person-img   { height: 340px; }
    /* Mobile: simpler crossfade only */
    .rb-tc-item,
    .rb-tc-person {
        transform: none !important;
        transition: opacity 0.5s ease !important;
    }
}
