/*
 * Styles for full-height slideshow and responsive image/flexslider display
 * Added to extras.css to override main.css as needed.
 */

/*
 * Mobile Styles (up to 999px)
 * On smaller screens, only show the static image #img1.
 * Flexslider is hidden.
 */
#slider1 {
    /* Ensure no extra padding interferes with height on mobile */
    padding: 0;
    /* Set a height for the static image section on mobile */
    height: auto; /* Allow height to adapt to content */
    display: block;
    overflow: hidden; /* Important for containing images if they exceed bounds */
}

#slider1 #img1 {
    display: block; /* Ensure the static image is visible */
    width: 100%;
    height: auto; /* Allow image to scale proportionally */
    object-fit: cover; /* Cover the container, cropping if necessary */
    min-height: 250px; /* Optional: Ensure a minimum height for the mobile image */
    max-height: 50vh; /* Optional: Limit mobile image height to half viewport height */
}

#slider1 .flexslider {
    display: none; /* Keep flexslider hidden on mobile */
}

/*
 * Desktop Styles (1000px and up)
 * Show Flexslider, hide static image, calculate full height.
 */
@media only screen and (min-width: 1000px) {
    #slider1 {
        padding: 0; /* Remove padding from #slider1 for precise height control */
        /* Calculate height based on 100vh minus the initial combined header height */
        height: calc(100vh - var(--initial-header-height, 0px));
        position: relative; /* Essential for positioning children to fill height */
        overflow: hidden; /* Hide anything that goes outside its bounds */
        display: flex; /* Use flexbox to ensure children fill the space */
        align-items: stretch; /* CHANGE: use stretch to make flex items fill height */
        justify-content: center; /* Horizontally center content */
    }

    #slider1 #img1 {
        display: none; /* Hide static image on desktop */
    }

    #slider1 .flexslider {
        display: block; /* Show flexslider on desktop */
        width: 100%;
        height: 100% !important; /* This should now correctly force 100% height */
        margin: 0; /* Remove any default margins */
        /* Borders (6px top/bottom) will still apply, making flexslider 12px taller than its content.
           This is fine, as we want the *entire* flexslider to fill the space. */
    }

    /* Crucial: Ensure the 'slides' UL also fills the height */
    #slider1 .flexslider .slides {
        height: 100% !important; /* Force 'slides' to be 100% height */
        margin: 0 !important; /* Remove any default margins */
        padding: 0 !important; /* Remove any default paddings */
    }

    /* Ensure individual list items (the slides themselves) fill the height */
    #slider1 .flexslider .slides > li {
        height: 100% !important; /* Force 'li' slides to be 100% height */
        margin: 0 !important; /* Remove any default margins */
        padding: 0 !important; /* Remove any default paddings */
    }

    /* Ensure images inside FlexSlider slides fill the available space */
    #slider1 .flexslider .slides img {
        width: 100%;
        height: 100% !important; /* <--- ADDED !important HERE */
        object-fit: cover; /* This makes images cover the slide area, cropping if needed */
        /* If you prefer to show the full image, use 'contain' but it will have letterboxing */
    }

    /* Adjust flexslider controls/navigation if needed for full height */
    .flexslider .flex-control-nav {
        bottom: 20px; /* Adjust if needed for better visibility with full height */
    }
    .flexslider .flex-direction-nav a {
        top: 50%; /* Center arrows vertically */
        transform: translateY(-50%);
    }
}

/*
 * Accordion Styles
 * -------------------------------------------------------------------------- */

.accordion-container {
    width: 100%;
    max-width: 700px; /* Adjust as needed, or remove for full width */
    margin: 40px auto; /* Centre the accordion and give some space */
    border-top: 1px solid #ddd; /* Top border for the whole accordion */
}

.accordion-item {
    border-bottom: 1px solid #ddd; /* Separator line between items */
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #f9f9f9; /* Light background for the header */
    cursor: pointer;
    font-weight: 600;
    color: #333;
    font-size: 1.1em;
    user-select: none; /* Prevent text selection on double click */
    transition: background-color 0.3s ease; /* Smooth hover effect */
}

h2.faq {
    color: black;
}

.accordion-header:hover {
    background-color: #f0f0f0; /* Slightly darker on hover */
}

/* Style for when the accordion is active/open */
.accordion-header[aria-expanded="true"] {
    background-color: #e5e5e5; /* Different background for active header */
    color: #000; /* Darker text for active header */
}

.accordion-title {
    flex-grow: 1; /* Allow title to take available space */
    padding-right: 15px; /* Space between title and icon */
}

/* Accordion Icon Styling (Plus/Minus circle) */
.accordion-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 24px;
    height: 24px;
    border: 1px solid #888;
    border-radius: 50%; /* Make it a circle */
    position: relative;
    transition: transform 0.3s ease; /* Smooth rotation for the icon */
}

/* Plus icon (default state) */
.accordion-icon::before,
.accordion-icon::after {
    content: '';
    position: absolute;
    background-color: #888;
    transition: transform 0.3s ease;
}

.accordion-icon::before {
    width: 12px;
    height: 2px;
}

.accordion-icon::after {
    width: 2px;
    height: 12px;
}

/* Minus icon (when header is expanded) */
.accordion-header[aria-expanded="true"] .accordion-icon {
    border-color: #555; /* Darker border for active icon */
}

.accordion-header[aria-expanded="true"] .accordion-icon::before {
    background-color: #555;
    transform: rotate(0deg); /* Horizontal line remains */
}

.accordion-header[aria-expanded="true"] .accordion-icon::after {
    background-color: #555;
    transform: rotate(90deg); /* Vertical line rotates to disappear, creating minus */
    opacity: 0; /* Make the vertical bar disappear for a clean minus */
}


/* Accordion Content Styling */
.accordion-content {
    padding: 20px;
    background-color: #ffffff; /* White background for content */
    line-height: 1.6;
    color: #555;
    overflow: hidden; /* Important for slide animation */
    /* No height defined here, jQuery's slideToggle will manage it */
}

.accordion-content p {
    margin-bottom: 1em;
}

.accordion-content ul {
    list-style: disc; /* Or 'none' if you want custom styling */
    margin-left: 20px;
    padding-left: 0;
}

.accordion-content ul li {
    margin-bottom: 0.5em;
}

/*
 * Tabs/Content Switcher Styles
 * -------------------------------------------------------------------------- */

.content-switcher-container {
    display: flex; /* Use flexbox for side-by-side layout */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    margin: 40px auto; /* Centre and give space, similar to accordion */
    max-width: 960px; /* Max width for the entire component */
    border: 1px solid #eee; /* Light border around the whole component */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); /* Subtle shadow */
    background-color: #fff;
}

.content-switcher-navigation {
    flex: 0 0 250px; /* Fixed width for navigation on desktop */
    background-color: #f8f8f8; /* Light background for nav sidebar */
    padding: 20px 0;
    border-right: 1px solid #eee; /* Separator line from content */
}

.content-switcher-nav-item {
    padding: 15px 20px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    color: #666; /* Default text color when not active or hovered */
    border-left: 3px solid transparent; /* For active state highlight */
    transition: background-color 0.2s ease, color 0.2s ease, border-left-color 0.2s ease;
}

.content-switcher-nav-item:hover {
    background-color: #79D3F6; /* Correct background colour */
    color: #ffffff; /* <--- CHANGED THIS TO WHITE */
}

/* Active navigation item styling (for desktop, outside media query) */
.content-switcher-nav-item.active {
    background-color: #ffffff; /* White background when active */
    color: #333; /* Darker text */
    border-left-color: #79D3F6; /* Blue active indicator */
    font-weight: 700;
}

.content-switcher-panels {
    flex: 1; /* Take up remaining space */
    padding: 20px;
}

.content-switcher-panel {
    display: none; /* Hide all panels by default */
    line-height: 1.7;
    color: #444;
}

/* Show the active panel */
.content-switcher-panel.active {
    display: block; /* Show the active panel */
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .content-switcher-container {
        flex-direction: column; /* Stack navigation and panels vertically */
        max-width: 100%; /* Allow full width */
        margin-left: 15px;
        margin-right: 15px;
    }

    .content-switcher-navigation {
        flex: auto; /* Allow navigation to take full width */
        border-right: none; /* Remove vertical separator */
        border-bottom: 1px solid #eee; /* Add horizontal separator */
        padding: 10px 0; /* Adjust padding */
        display: flex; /* For horizontal scrolling if many items */
        overflow-x: auto; /* Allow horizontal scrolling for nav items */
        white-space: nowrap; /* Prevent nav items from wrapping */
    }

    .content-switcher-nav-item {
        flex-shrink: 0; /* Prevent items from shrinking */
        padding: 10px 15px; /* Adjust padding for mobile tabs */
        border-left: none; /* Remove left border */
        border-bottom: 3px solid transparent; /* Use bottom border for active highlight */
    }

    /* Active navigation item styling for mobile */
    .content-switcher-nav-item.active {
        background-color: #79D3F6; /* Added background for consistency with white text */
        color: #ffffff; /* Already correct here for white text */
        border-bottom-color: #79D3F6; /* Blue active indicator on bottom */
        border-left-color: transparent; /* Remove left border highlight */
    }

    .content-switcher-panels {
        padding: 15px; /* Adjust padding for mobile panels */
    }

}
