/*
Theme Name: Astra Child
Author: 
Description: Your description goes here
Version: 1.0
Template: astra

This is the child theme for Astra theme, generated with Generate Child Theme plugin by catchthemes.

(optional values you can add: Theme URI, Author URI, License, License URI, Tags, Text Domain)
*/


/* --- Accordion Style --- */

/* Main accordion container styling */
.wp-block-accordion {
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    padding: 10px;
    margin-bottom: 2em;
}

/* Individual accordion items */
.wp-block-accordion-item {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 10px;
    background-color: #ffffff;
    overflow: hidden;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Reset margin for the last item */
.wp-block-accordion-item:last-child {
    margin-bottom: 0;
}

/* Hover effect for the whole item */
.wp-block-accordion-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-color: #0073aa; /* Change color to match your theme */
}

/* The clickable header/button */
.wp-block-accordion-heading__toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1em;
    color: #333;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Hover effect for the button */
.wp-block-accordion-heading__toggle:hover {
    background-color: #f0f7fb; 
    color: #0073aa;
}

/* The plus/minus icon */
.wp-block-accordion-heading__toggle-icon {
    font-size: 1.5em;
    font-weight: 400;
    transition: transform 0.3s ease;
}

/* Styling when the accordion item is OPEN */
.wp-block-accordion-item.is-open {
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.wp-block-accordion-item.is-open .wp-block-accordion-heading__toggle {
    background-color: #f0f7fb;
    border-bottom: 1px solid #e0e0e0;
}

/* Rotate the icon when open (+ becomes an x) */
.wp-block-accordion-item.is-open .wp-block-accordion-heading__toggle-icon {
    transform: rotate(45deg);
}

/* The content panel */
.wp-block-accordion-panel {
    padding: 20px;
    background-color: #ffffff;
    color: #444;
    animation: accordionFadeIn 0.4s ease-in-out;
}

/* Simple fade-in animation for the content */
@keyframes accordionFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}




/* --- Table of contents --- */
/* Base styling and smooth animations for the transition */
#ez-toc-container {
    background-color: #f9f9f9 !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    padding: 20px;
    box-sizing: border-box;
    width: 100%;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 999; /* Ensure it stays above other content */
}

/* Base styling for the navigation list container */
#ez-toc-container nav {
    transition: opacity 0.3s ease, max-height 0.5s ease;
    max-height: 2000px; 
    opacity: 1;
    overflow: hidden;
}

/* Header styling */
#ez-toc-container .ez-toc-title-container {
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

/* Title text */
#ez-toc-container p.ez-toc-title {
    font-size: 1.2em !important;
    font-weight: 600;
    color: #333;
    margin: 0;
}

/* Reset list styles */
#ez-toc-container ul.ez-toc-list {
    list-style: none !important;
    padding-left: 0 !important;
    margin: 0 !important;
}

/* Indent sub-lists */
#ez-toc-container ul.ez-toc-list ul {
    padding-left: 15px !important;
    margin-top: 5px;
}

/* Link styling */
#ez-toc-container a.ez-toc-link {
    color: #555;
    text-decoration: none;
    display: block;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 0.95em;
}

/* Link hover effect */
#ez-toc-container a.ez-toc-link:hover {
    background-color: #f0f7fb;
    color: #0073aa;
    padding-left: 15px; 
}

/* =========================================================
   STICKY & COLLAPSED STATE (Desktop only)
   Triggered by the 'is-stuck-right' class from JS
   ========================================================= */
@media (min-width: 1024px) {
    #ez-toc-container.is-stuck-right {
        position: fixed !important;
        top: 30px !important;
        right: 0 !important; /* Snap to the right edge of the screen */
        width: 350px !important;
        padding: 20px !important;
        border-radius: 8px 0 0 8px !important;
        box-shadow: -4px 4px 15px rgba(0,0,0,0.1);
    }

    /* Hide the list content when collapsed */
    #ez-toc-container.is-stuck-right nav {
        max-height: 70vh !important; /* Allow internal scrolling if very long */
        opacity: 1 !important;
        overflow-y: auto;
        margin-top: 15px !important;
    }

    /* Hide the title text, keep only the toggle icon */
    #ez-toc-container.is-stuck-right .ez-toc-title {
        display: block !important;
    }

    /* Center the icon in the shrunken box */
    #ez-toc-container.is-stuck-right .ez-toc-title-container {
        border-bottom: 2px solid #0073aa;
        padding-bottom: 10px;
        margin-bottom: 15px;
        justify-content: space-between;
    }
}