/* ==========================================================
   MaRadha Skewed Accordion Widget - Stylesheet
   ========================================================== */

/* Outer Wrapper (prevents horizontal overflow on page) */
.maradha-skewed-accordion-wrap {
    width: 100%;
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
}

/* Accordion Flex Container (wider than wrap to clip outer skewed corners) */
.maradha-skewed-accordion {
    display: flex;
    flex-direction: row;
    width: calc(100% + 160px);
    margin-left: -80px;
    margin-right: -80px;
    height: 500px; /* Overwritten dynamically by Elementor */
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
    background-color: #000;
}

/* Individual Skewed Slide */
.maradha-skewed-slide {
    position: relative;
    flex: 1 1 0%;
    height: 100%;
    transform: skewX(-10deg); /* Adjust dynamic skew angle in PHP */
    overflow: hidden;
    border-right: 2px solid #ffffff;
    box-sizing: border-box;
    z-index: 1;
    transition: flex 0.65s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.3s ease;
}

/* Last slide has no separator border */
.maradha-skewed-slide:last-child {
    border-right: none;
}

/* Hover expansion */
.maradha-skewed-slide:hover {
    flex-grow: 3.5;
    z-index: 3;
}

/* Slide Inner container (unskewed back to normal coordinates) */
.maradha-skewed-slide-inner {
    position: absolute;
    top: 0;
    bottom: 0;
    left: -150px; /* Offset spacing to cover skewed triangle spaces */
    right: -150px;
    transform: skewX(10deg); /* Counteracts parent skew angle */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* Darkening Overlay for Text Contrast */
.maradha-skewed-slide-inner::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(24, 23, 22, 0.4);
    z-index: 1;
    transition: background-color 0.4s ease;
}

/* Darken overlay when panel is hovered */
.maradha-skewed-slide:hover .maradha-skewed-slide-inner::before {
    background-color: rgba(24, 23, 22, 0.65);
}

/* Content Container (sits above background overlay) */
.maradha-skewed-slide-content {
    position: relative;
    z-index: 2;
    color: #ffffff;
    width: calc(100% - 300px); /* Keeps text inside the visual width of the skewed panel when collapsed */
    max-width: 500px;
    padding: 0 15px; /* Compact padding when collapsed */
    box-sizing: border-box;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: width 0.6s cubic-bezier(0.25, 1, 0.5, 1), padding 0.6s cubic-bezier(0.25, 1, 0.5, 1), transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Expand content layout when panel is hovered */
.maradha-skewed-slide:hover .maradha-skewed-slide-content {
    width: 100%;
    padding: 0 40px;
}

/* Squished state (another panel is hovered, squeezing this one) */
.maradha-skewed-accordion:hover .maradha-skewed-slide:not(:hover) .maradha-skewed-slide-content {
    padding: 0 10px;
}

/* Title Styling */
.maradha-skewed-slide-content h2.slide-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.2rem;
    font-weight: 300;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Subtitle / Subheading Styling (always visible) */
.maradha-skewed-slide-content .slide-subtitle {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #c5a880;
    margin-top: 8px;
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Slide details wrapper (desc + button) - hidden by default, expands on hover */
.maradha-skewed-slide-content .slide-details {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(20px);
    transition: max-height 0.6s ease, opacity 0.5s ease, transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Hover reveal */
.maradha-skewed-slide:hover .maradha-skewed-slide-content .slide-details {
    max-height: 300px;
    opacity: 1;
    transform: translateY(0);
    margin-top: 20px;
}

/* Description text inside slide details */
.maradha-skewed-slide-content .slide-desc {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 20px 0;
}

/* Action button inside slide details */
.maradha-skewed-slide-content .btn-gold {
    display: inline-block;
    padding: 12px 28px;
    background-color: #c5a880;
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-decoration: none;
    border: 1px solid #c5a880;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.maradha-skewed-slide-content .btn-gold:hover {
    background-color: transparent;
    color: #c5a880;
    border-color: #c5a880;
}

/* ==========================================================
   Responsive Adaptations - Tablet & Mobile Viewports
   ========================================================== */

@media (max-width: 991px) {
    /* Stack slides vertically */
    .maradha-skewed-accordion {
        flex-direction: column;
        height: auto !important; /* Force stack sizing */
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    /* Unskew slides and stack them */
    .maradha-skewed-slide {
        transform: none !important;
        flex: 1 1 auto;
        height: 280px; /* Fixed height per stacked panel to accommodate all text/button */
        border-right: none;
        border-bottom: 2px solid #ffffff;
    }

    .maradha-skewed-slide:last-child {
        border-bottom: none;
    }

    /* Disable hover size transitions on mobile/tablets */
    .maradha-skewed-slide:hover {
        height: 280px !important;
        flex-grow: 1 !important;
    }

    /* Unskew inner wrapper */
    .maradha-skewed-slide-inner {
        transform: none !important;
        left: 0;
        right: 0;
        padding: 30px;
    }

    /* Slide content adapts to static stacked columns */
    .maradha-skewed-slide-content {
        width: 100% !important;
        max-width: 100%;
        padding: 0 20px !important;
    }

    /* Make details (description and button) always visible on tablet/mobile */
    .maradha-skewed-slide-content .slide-details {
        max-height: none !important;
        opacity: 1 !important;
        transform: none !important;
        overflow: visible !important;
        margin-top: 15px !important;
    }

    .maradha-skewed-slide-content h2.slide-title {
        font-size: 1.8rem;
    }
}
