/*
 * 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
 * -------------------------------------------------------------------------- */

/* Section background that the accordion sits on */
.greyelement {
    background-color: #F7F7F1; /* CHANGED: To Off-White (ghost white) */
}

/* Accordion Container */
.accordion-container {
    width: 95%; /* Made the container much wider to fill the space */
    max-width: 900px;
    margin: 40px auto;
    border: 2px solid #B3B7A0; /* CHANGED: Border to a 2px Sage Green outline on all sides */
    background-color: #F7F7F1; /* Accordion background to Off-White */
    padding: 20px;
    border-radius: 8px; /* Kept the rounded corners */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); /* Kept a subtle shadow */
}

/* Main heading */
h2.faq {
    font-family: 'Caveat', cursive;
    color: #B3B7A0;                 /* Heading text to Sage Green */
    font-size: 2.5em;
    margin-bottom: 30px;
}

/* Accordion Item Styling */
.accordion-item {
    border-bottom: 1px solid #ddd; /* CHANGED: Border to a subtle light grey */
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #F7F7F1;
    cursor: pointer;
    font-weight: 600;
    color: #614051;             /* Text to Plum */
    font-size: 1.1em;
    user-select: none;
    transition: background-color 0.3s ease;
}

.accordion-title {
    flex-grow: 1;
    padding-right: 15px;
}

/* Style for when the accordion is active/open */
.accordion-header:hover {
    background-color: #E6E6E1; /* Hover background to a lighter Off-White */
}
.accordion-header[aria-expanded="true"] {
    background-color: #614051; /* Active background to Plum */
    color: #F7F7F1;             /* Active text to Off-White */
}

/* Accordion Icon Styling (Plus/Minus circle) */
.accordion-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 24px;
    height: 24px;
    border: 1px solid #614051; /* CHANGED: Border to Plum */
    border-radius: 50%;
    position: relative;
    transition: transform 0.3s ease;
}

/* Plus icon (default state) */
.accordion-icon::before,
.accordion-icon::after {
    content: '';
    position: absolute;
    background-color: #614051; /* CHANGED: Icon colour to Plum */
    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: #F7F7F1; /* CHANGED: Border to Off-White for contrast */
    transform: rotate(0deg); /* Reset rotation */
}

.accordion-header[aria-expanded="true"] .accordion-icon::before {
    background-color: #F7F7F1; /* CHANGED: Icon colour to Off-White */
    width: 12px;
    height: 2px;
    transform: rotate(0deg);
}

.accordion-header[aria-expanded="true"] .accordion-icon::after {
    /* REMOVED: This part is no longer needed to make the minus sign */
    content: none;
}

/* Accordion Content (The hidden answer) */
.accordion-content {
    padding: 20px;
    background-color: #F7F7F1; /* Background to Off-White */
    line-height: 1.6;
    color: #444444;             /* Text to Dark Grey */
    overflow: hidden;
}

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

.accordion-content ul {
    list-style: disc;
    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 */
    }

    /* 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 */
    }
}

/*
 * Quote Box Styles
 * -------------------------------------------------------------------------- */
.greenelement {
    background-color: #B3B7A0; /* CHANGED: Background to Sage Green */
    position: relative;
    padding-top: 20px;
    padding-bottom: 20px;
}

.quote-box {
    text-align: center;
    color: #614051;
    position: relative;
}

.quote-box .custom-quote {
    background-color: #B3B7A0; /* Keeps the Off-White background for the quote itself */

    border: 2px solid #f7f7f1; /* CHANGED: Light Green (Pale Sage Green) border */
    border-radius: 8px; /* CHANGED: Rounded corners */
    margin: 0 auto;
    padding: 20px;
    max-width: 900px;
}

.quote-box .custom-quote p {
    font-family: 'Caveat', cursive;
    font-size: 2.2em;
    line-height: 1.4;
    margin: 0;
}

.quote-box cite {
    display: block;
    font-style: normal;
    font-size: 1.2em;
    margin-top: 15px;
}

.quote-box .custom-quote::before,
.quote-box .custom-quote::after {
    content: none;
}
