/*
Sidebar table of contents styles
*/

/*
Use this color
*/

/*
--- DESKTOP STYLES (md and up) ---
NOTE: Using bootstrap default, when window width < 768 is collapses into a button.
So the rules below only apply when the sidebar is actually visible on the side.
The width of side is determined by bootstrap col-{size}-{num} class types
*/
@media (min-width: 768px) {
  .toc-sidebar {
    position: sticky;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100; /* Behind the navbar if you have a top fixed navbar */
    padding: 0 0 0; /* Height of top navbar if applicable */
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);

    overflow-x: hidden;
    overflow-y: auto; /* SCROLLS SEPARATELY */
  }
  
  .toc-sidebar-sticky {
    position: relative;
    top: 0;
    height: calc(100vh - 48px);
    padding-top: .5rem;
    overflow-x: hidden;
    overflow-y: auto; /* SCROLLS SEPARATELY */
  }
}

/*
Shift over contents of main body to make room for sidebar.
The value here should match the width of the sidebar (varies based on media query)


@media (min-width: 992px) {
    .page-template-toc-sidebar {
      margin-left: 16.66%;
    }
}

@media (min-width: 768px) and (max-width: 992px) {
    .page-template-toc-sidebar {
      margin-left: 25%;
    }
}
*/
    
/* --- WORDPRESS MENU CLEANUP --- */
/* Makes WP menu output look like Bootstrap Nav */
.toc-sidebar .nav-item, 
.toc-sidebar .menu-item { 
    width: 100%; 
}

.toc-title {
    color: white;
    background-color: #32006e;
    padding: 1em;
}

/* Icon Default State (Collapsed) */
.toc-sidebar .toggle-btn .toc-icon {
    font-size: 1.2rem;
    display: inline-block !important; /* CRITICAL: Rotation fails without this */
    transform: rotate(90deg);         /* Rotates the ▸ to point Down */
    transition: transform 0.2s ease;  /* Smooth animation */
    transform-origin: center center;  /* Ensures it spins in place */
}

/* Collapsed State (Closed) */
/* Bootstrap ADDS the 'collapsed' class when closed. */
.toc-sidebar .toggle-btn.collapsed .toc-icon {
    transform: rotate(0deg); /* Resets rotation so it points Right */
}

.toc-link-button-container {
    display: flex;
    font-size: 0.9rem;
}

.toc-sidebar .nav-link, 
.toc-sidebar .menu-item a {
    color: #333;
    padding-left: 10px;
    text-decoration: none;
}

.toc-sidebar .nav-link:hover, 
.toc-sidebar .menu-item a:hover {
    color: #007bff;
    background-color: #f8f9fa;
}

.toc-sidebar .current-menu-item a {
    color: #007bff;
    font-weight: bold;
}

/* --- Pagination table of contents sidebar template (Prev/Next) --- */
.toc-pagination {
    display: flex;
    justify-content: space-between; /* Pushes buttons to far left and right */
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid #eee;
    gap: 20px;
}

.toc-prev, .toc-next {
    flex: 1; /* Both take equal width */
    max-width: 45%;
}

.toc-next {
    text-align: right; /* Align text to the right for the Next button */
}

/* Label Styling (Previous / Next text) */
.toc-pagination span {
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

/* Link Styling */
.toc-pagination a {
    display: block;
    font-size: 1.1rem;
    font-weight: bold;
    color: #0073aa; /* Match your brand color */
    text-decoration: none;
    transition: color 0.2s ease;
    line-height: 1.3;
}

.toc-pagination a:hover {
    color: #005177;
    text-decoration: underline;
}

/* Mobile responsive tweak */
@media (max-width: 768px) {
    .toc-page-container {
        flex-direction: column;
    }
    .toc-sidebar {
        border-right: none;
        border-bottom: 1px solid #ddd;
        padding-bottom: 20px;
    }
}