/**
 * BW Advanced Tabordion - Frontend Styles
 */

/* Main container */
.bw-advanced-tabordion {
    margin-bottom: 40px;
    /* Removed font-family to inherit from theme */
}

/* Tabordion container */
.bw-tabordion-container {
    display: flex;
    flex-wrap: wrap;
    /* No border or background as requested */
    overflow: hidden;
}

/* Tabs menu (left side) */
.bw-tabordion-menu {
    width: 25%; /* Default, will be overridden by inline styles */
    /* No background color as requested */
    /* max-height: 388px;  Fixed height as requested */
    overflow-y: auto; /* Add vertical scrollbar when needed */
}

/* Customize the scrollbar for better aesthetics */
.bw-tabordion-menu::-webkit-scrollbar {
    width: 5px;
}

.bw-tabordion-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.bw-tabordion-menu::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.bw-tabordion-menu::-webkit-scrollbar-thumb:hover {
    background: #ff7760;
}

.bw-tabordion-tabs {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Tab item */
.bw-tabordion-tab {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #DDD; /* Underline for menu items */
    position: relative;
}

.bw-tabordion-tab:last-child {
    border-bottom: 1px solid #DDD; /* Keep the border for the last item too */
}

.bw-tabordion-tab a,
.bw-tabordion-tab span {
    display: block;
    padding: 12px 15px;
    color: #77736c; /* Idle color as requested */
    text-decoration: none;
    font-size: 15px;
    font-weight: 400;
    transition: all 0.3s ease;
}

.bw-tabordion-tab a:hover {
    color: #ff7760; /* Active color on hover */
}

.bw-tabordion-tab.active a {
    color: #ff7760; /* Active color as requested */
    font-weight: 600;
}

/* Parent tab styling */
.bw-tabordion-tab.parent-tab a,
.bw-tabordion-tab.parent-tab span {
    font-weight: 600;
}

/* Child tab styling - no indentation but smaller font */
.bw-tabordion-tab.child-tab {
    /* No left padding/indentation as requested */
    border-bottom: none; /* No border for child tabs */
}

.bw-tabordion-tab.child-tab a,
.bw-tabordion-tab.child-tab span {
    font-size: 10px; /* Smaller font as requested */
    padding: 10px 15px;
}

/* Placeholder tab styling */
.bw-tabordion-tab.placeholder-tab a.external-link::after {
    content: "↗";
    margin-left: 5px;
    font-size: 80%;
}

/* PDF link icon */
.bw-tabordion-tab.placeholder-tab a[href$=".pdf"]::after {
    content: "↓";
    margin-left: 5px;
    font-size: 80%;
}

/* Internal link styling */
.bw-tabordion-tab.placeholder-tab a.internal-link::after {
    content: "→";
    margin-left: 5px;
    font-size: 80%;
}

/* Content area (right side) */
.bw-tabordion-content-wrapper {
    width: 75%; /* Default, will be overridden by inline styles */
    background-color: transparent;
}

/* Ensure innerblocks container doesn't restrict width */
.bw-tabordion-innerblocks {
    width: 100%;
}

.bw-tabordion-content-wrapper {
    width: 75%; /* Default, will be overridden by inline styles */
    background-color: transparent;
    position: relative; /* Added for smooth height transitions */
    min-height: 300px; /* Minimum height to reduce layout shifts */
    transition: height 0.3s ease-in-out;
    overflow: hidden; /* Hide overflow during transitions */
}

.bw-tabordion-content {
    display: none; /* Hide by default */
    padding: 25px 0 25px 20px; /* Added left padding as requested */
    opacity: 0;
    transition: opacity 0.3s ease;
    width: 100%;
}

.bw-tabordion-content.active {
    display: block;
    opacity: 1;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.bw-tabordion-content > *:first-child {
    margin-top: 0;
}

.bw-tabordion-content > *:last-child {
    margin-bottom: 0;
}

/* Structured tab content layout */
.tab-structured-layout {
    display: flex;
    width: 100%;
}

/* Background image column (60%) */
.tab-bg-column {
    flex: 6;
    overflow: hidden;
    padding: 0;
}

.tab-background-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Text content column (40%) */
.tab-text-column {
    flex: 4;
    padding: 30px 0 30px 30px;
}

/* Subtitle with optional icon */
.tab-subtitle {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: nowrap; /* Prevent wrapping */
}

.tab-icon {
    width: 40px;
    height: 40px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Prevent icon from shrinking */
}

.tab-icon-image {
    width: 40px;
    height: 40px;
    object-fit: contain;
    display: block; /* Ensure it's displayed properly */
    max-width: 100%;
}

p.subtitle-text {
    font-size: 12px;
    color: #ff7760;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 2px;
    margin: 0;
}

/* Heading */
.tab-heading {
    margin-top: 0;
    margin-bottom: 15px;
}

/* Paragraph */
.tab-paragraph {
    color: #838485;
    font-size: 13px;
    margin-bottom: 20px;
}

.tab-paragraph p {
    margin-top: 0;
}

/* Styling for links within paragraph */
.tab-paragraph a {
    color: #ff7760;
    text-decoration: none;
    font-weight: 500;
}

.tab-paragraph a:hover {
    text-decoration: underline;
}

/* Custom arrow link styling */
.tab-paragraph a.bw_link_arrow {
    color: #ff7760;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    font-size: 12px;
    padding-right: 20px;
    position: relative;
    transition: all 0.3s ease;
    display: inline-block;
}

.tab-paragraph a.bw_link_arrow:hover {
    text-decoration: none;
    opacity: 0.8;
}

.tab-paragraph a.bw_link_arrow:after {
    content: "→";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: #ff7760;
    font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .tab-structured-layout {
        flex-direction: column;
    }
    
    .tab-bg-column {
        min-height: 250px;
    }
    
    .tab-text-column {
        padding: 25px 0 0 0;
    }
}

/* Responsive styles */
@media (max-width: 768px) {
    .bw-tabordion-container {
        flex-direction: column;
    }
    
    .bw-tabordion-menu,
    .bw-tabordion-content-wrapper {
        width: 100% !important;
    }
    
    .bw-tabordion-menu {
        margin-bottom: 20px;
        max-height: 300px; /* Smaller max height on mobile */
    }
}