/* =========================================
   TS Accordion Elementor Widget Styles
   ========================================= */

.ts-accordion-widget-wrapper {
    /* Container needs to be full height if desired, but Elementor sections handle that.
       We will provide a min-height. */
    width: 100%;
    min-height: 400px;
    --ts-widget-height: 100dvh;
    height: calc(var(--ts-widget-height) - var(--ts-margin-top, 0px) - var(--ts-margin-bottom, 0px));
    overflow: hidden;
}

.ts-accordion-container {
    display: flex;
    flex-direction: column;
    /* Mobile stacks vertically */
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

/* Tablets & Desktop: Horizontal split-panels */
@media (min-width: 768px) {
    .ts-accordion-container {
        flex-direction: row;
    }
}

/* =========================================
   Accordion Panels
   ========================================= */
.ts-panel {
    flex: 1;
    /* Default closed size */
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: flex 0.7s cubic-bezier(0.25, 1, 0.3, 1), flex-grow 0.7s cubic-bezier(0.25, 1, 0.3, 1);
    will-change: flex-grow;
    backface-visibility: hidden;
    transform: translateZ(0);
    /* Force hardware accel */
}

/* Active State Expands */
.ts-panel.active {
    flex: 6;
    /* Expands significantly */
    cursor: default;
}

.ts-panel-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
    transform: scale(1);
    transition: transform 3s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform;
}

.ts-panel:not(.active):hover .ts-panel-bg {
    transform: scale(1.05);
}

.ts-panel.active .ts-panel-bg {
    transform: scale(1.05);
}

/* Overlay style hook. Background properties injected by Elementor */
.ts-panel-overlay {
    position: absolute;
    inset: 0;
    background-color: #091325;
    /* Default Normal Background (var(--brand-navy)) */
    opacity: 0.75;
    z-index: 2;
    transition: all 0.7s ease;
}

.ts-panel.active .ts-panel-overlay {
    background-image: linear-gradient(to top, rgba(9, 19, 37, 1) 0%, rgba(9, 19, 37, 0.4) 60%, rgba(9, 19, 37, 0.1) 100%);
    opacity: 1;
}

/* =========================================
   Panel Header (always visible strip)
   ========================================= */
.ts-panel-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    z-index: 10;
    transition: all 0.7s cubic-bezier(0.25, 1, 0.3, 1);
}

.ts-panel-title {
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--ts-font-color, #f5f5f5);
    white-space: nowrap;
    margin: 0;
    display: flex;
    align-items: center;
}

.ts-panel-indicator {
    font-size: 1.5rem;
    color: var(--ts-icon-color, #c19b5c);
    transition: all 0.7s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ts-panel-indicator i,
.ts-panel-indicator svg {
    transition: transform 0.4s ease;
    transform: rotate(0deg);
    /* Mobile points Down */
}

/* Space icon from text if icon is next to title (Mobile) */
.ts-panel-title {
    margin-right: 0;
}

/* When Active, hide/move header */
.ts-panel.active .ts-panel-header {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

/* On Desktop logic */
@media (min-width: 768px) {
    .ts-panel-header {
        flex-direction: column;
        justify-content: center;
        width: 100%;
        height: 100%;
        gap: 3rem;
        /* Proper spacing without overlap */
    }

    .ts-panel-title {
        writing-mode: vertical-rl;
        /* Changes document flow to vertical */
        transform: rotate(180deg);
        /* Flips it to read bottom-to-top */
        margin-bottom: 0;
        white-space: nowrap;
    }

    .ts-panel-indicator i,
    .ts-panel-indicator svg {
        transform: rotate(-90deg);
        /* Desktop points Right automatically */
    }
}

/* =========================================
   Panel Content (Appears when active)
   ========================================= */
.ts-panel-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 2rem;
    z-index: 5;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* Align bottom */
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.25, 1, 0.3, 1);
    /* By default Elementor might override things, so we ensure visibility is contained */
    overflow: hidden;
    /* Hide scrollbars during transition */
}

/* Hide scrollbar for a cleaner look */
.ts-panel-content::-webkit-scrollbar {
    width: 0px;
}

/* Delay content reveal until panel is slightly expanded */
.ts-panel.active .ts-panel-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0.3s;
    overflow-y: auto;
    /* Reveal scrollbar only when active */
}

.ts-content-inner {
    /*width: 600px;*/
    width: 100%;
    max-width: 95vw;
    /* 85*/
    /* Fixed static width prevents reflows! */
    height: auto;
    overflow: auto;
}

/* Tablet Desktop layout */
@media (min-width: 768px) {
    .ts-panel-content {
        justify-content: flex-end;
    }

    .ts-content-inner {
        /*width: 650px;*/
        width: 100%;
        max-width: 100%;
    }
}