/**
 * Custom Elements Styles
 * Styles for custom menu items and search elements
 */

#main-nav {
    position: relative;
}

/* Custom menu item search input */
.menu-item.custom-menu-item {
	display: flex;
	align-items: center;
}

.menu-item.custom-menu-item .input {
	display: flex;
	align-items: center;
}

.menu-item.custom-menu-item .input.pill {
    border-radius: 5px;
    padding: 5px 10px;
    border: 1px solid #ccc;
    background-color: #fff;
    width: 100%;
    max-width: 100%;
    margin: 1rem 0;
    transition: border-left-color, border-top-color, border-right-color 0.3s ease;
    z-index: 6;
}


.menu-item.custom-menu-item .input.pill input[type=submit] {
    color: #ccc !important;
}

.menu-item.custom-menu-item .input.pill:focus-within {
    border-color: #555;
}


.menu-item.custom-menu-item .input.pill.dropdown-active:focus-within {
    border-radius: 5px 5px 0 0;
    border-bottom-color: transparent;
}


.menu-item.custom-menu-item .input.pill:focus-within input[type=submit] {
    color: #555 !important;
}

#live-search-header-input {
	/* Customize your search input */
    font-size: 1rem;
    width: 100%;
	padding: 8px 12px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#live-search-header-input::placeholder {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#live-search-header-input:focus::placeholder {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#live-search-header-item {
    display: flex;
    flex-direction: column;
}

#live-search-header-submit {
	/* Customize your submit button */
	background: transparent;
	border: none;
	cursor: pointer;
    font-family: 'FontAwesome', serif;
	padding: 8px 12px;
}

/* Search wrap custom styles */
#search-wrap {
	/* Add your styles here */
}

#search-wrap .input {
	/* Add your styles here */
}

#live-search-header-submit {
    padding: 0.5rem !important;
    margin: 0 !important;
}

#live-search-header-input,
#live-search-header-input:hover,
#live-search-header-input:focus,
#live-search-header-input:active,
#live-search-header-submit:hover,
#live-search-header-submit:focus,
#live-search-header-submit:active {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

#live-search-header-results {
    position: relative;
    width: 100%;
}

#live-search-header-results > ul {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    top: -40px !important;
    padding-top: 30px !important;
    padding-bottom: 10px !important;
    border-color: #ccc;
    display: flex !important;
    flex-direction: column;
    transition: all 0.3s ease-in-out;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
    border-top: none !important;
    overflow: hidden;
}

#live-search-header-item:focus-within #live-search-header-results > ul {
    border-color: #555;
}

#live-search-header-results > ul > li > a {
    padding: 1rem 0.5rem !important;
    width: 100% !important;
    text-transform: none !important;
}


#live-search-header-results > ul > li:last-child {
    border-color: transparent !important;
}

#live-search-header-results > ul > .no-results {
    padding: 1rem 0.5rem !important;
}

@media screen and (min-width: 1025px) {
    #live-search-header-item {
        position: absolute;
        left: 0;
        bottom: 0;
        transform: translate(calc(-100% - 25px), calc(50% - 2px));
    }
    .menu-item.custom-menu-item .input.pill {
        width: 35svw;
        max-width: 500px;
    }
}
@media (min-width: 1024px) {
    body.page-template-template-home #header {
        overflow: visible !important;
    }
}

/* ===================================
   Article Sidebar Custom Styles
   =================================== */

/* The theme's parent styles already handle left positioning with body.sidebar-left class */
/* Just add custom styling for our article sidebar */

.article-sidebar {
    position: sticky;
    top: 40px;
    max-height: calc(100vh - 80px);
    overflow-y: auto !important;
    overflow-x: hidden !important;
    /* Smooth scrolling within sidebar */
    scroll-behavior: smooth;
    /* Hide scrollbar for all browsers */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    /* Add padding for better spacing */
    /* Ensure the sidebar can actually scroll */
    display: block;
    height: auto;
    /* Position context for scroll shadow pseudo-elements */
    isolation: isolate;
    border-radius: 4px;
}

.article-sidebar > *:first-child {
    margin-top: 20px;
}
.article-sidebar > *:last-child {
    margin-bottom: 20px;
}

/* Ensure sidebar content can trigger overflow */
.article-sidebar > * {
    flex-shrink: 0;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.article-sidebar::-webkit-scrollbar {
    display: none;
}

/* Scroll shadow indicators - use sticky positioning to stay in place */
.article-sidebar::before,
.article-sidebar::after {
    content: '';
    position: sticky;
    display: block;
    left: 0;
    right: 0;
    width: 100%;
    height: 30px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 100;
}

/* Top shadow */
.article-sidebar::before {
    top: 0;
    margin-top: -20px;
    margin-bottom: -30px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0) 100%);
}

/* Bottom shadow */
.article-sidebar::after {
    bottom: 0;
    margin-top: -30px;
    margin-bottom: -40px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0) 100%);
}

/* Show shadows when scrollable */
.article-sidebar.can-scroll-up {
    box-shadow: 0 -1px 0 0 #e0e0e0;
    border-radius: 4px 4px 0 0;
}
.article-sidebar.can-scroll-up::before {
    opacity: 0.5;
}

.article-sidebar.can-scroll-down {
    box-shadow: 0 1px 0 0 #e0e0e0;
    border-radius: 0 0 4px 4px;
}
.article-sidebar.can-scroll-down::after {
    opacity: 0.5;
}

.article-sidebar .widget {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 4px;
}

.article-sidebar .widget-title {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2em;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

/* Style for categories widget */
.article-sidebar .article-categories-widget {
    background: #fff;
    border: 1px solid #e0e0e0;
}

.article-sidebar .article-categories-widget .widget-title {
    background: #f5f5f5;
    padding: 15px 20px;
    margin: -20px -20px 15px -20px;
    border-bottom: 2px solid #e0e0e0;
}

.article-sidebar .article-categories {
    list-style: none;
    padding: 0;
    margin: 0;
}

.article-sidebar .article-categories li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.article-sidebar .article-categories li:last-child {
    border-bottom: none;
}

.article-sidebar .article-categories li a {
    color: #0066cc;
    text-decoration: none;
    font-weight: 500;
}

.article-sidebar .article-categories li a .fa,
.article-sidebar .article-categories li a [class^="fa-"],
.article-sidebar .article-categories li a i {
    margin-right: 6px;
}

.article-sidebar .article-categories li a:hover {
    color: #004499;
    text-decoration: underline;
}

/* Style for Table of Contents widget */
.article-sidebar .toc-widget {
    background: #fff;
    border: 1px solid #e0e0e0;
}

.article-sidebar .toc-widget .widget-title {
    background: #f5f5f5;
    padding: 15px 20px;
    margin: -20px -20px 15px -20px;
    border-bottom: 1px solid #e0e0e0;
}

.article-sidebar .toc-content {
    padding: 0;
}

.article-sidebar .toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.article-sidebar .toc-list li {
    margin: 0;
}

.article-sidebar .toc-link {
    display: block;
    padding: 8px 15px;
    color: #333;
    text-decoration: none;
    border-left: 3px solid #fff !important;
    font-weight: 500;
}

.article-sidebar .toc-link:hover {
    color: #333;
    background-color: #f5f5f5;
    border-left-color: #00f595 !important;
    text-decoration: none;
}

.article-sidebar .toc-link.active {
    color: #333;
    background-color: #f5f5f5;
    border-left-color: #00f595 !important;
    font-weight: 600;
}

/* Indent different heading levels */
.article-sidebar .toc-level-1 .toc-link {
    padding-left: 15px;
    font-weight: 600;
}

.article-sidebar .toc-level-2 .toc-link {
    padding-left: 25px;
}

.article-sidebar .toc-level-3 .toc-link {
    padding-left: 35px;
    font-size: 0.95em;
}

.article-sidebar .toc-level-4 .toc-link {
    padding-left: 45px;
    font-size: 0.95em;
}

.article-sidebar .toc-level-5 .toc-link {
    padding-left: 55px;
    font-size: 0.9em;
}

.article-sidebar .toc-level-6 .toc-link {
    padding-left: 65px;
    font-size: 0.9em;
}

/* Style for related articles in sidebar */
.article-sidebar .related-articles-widget {
    background: #fff;
    border: 1px solid #e0e0e0;
}

.article-sidebar .related-articles-widget .widget-title {
    background: #f5f5f5;
    padding: 15px 20px;
    margin: -20px -20px 15px -20px;
    border-bottom: 2px solid #e0e0e0;
}

.article-sidebar .related-posts {
    padding: 0;
}

.article-sidebar .related-posts article {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.article-sidebar .related-posts article:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.article-sidebar .related-posts-content ul li a i {
    margin-right: 6px;
}

/* Style for default message when no widgets are added */
.article-sidebar .widget p {
    margin: 0;
    color: #666;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .article-sidebar {
        margin-top: 30px;
        /* Disable sticky on mobile */
        position: static;
        max-height: none;
        overflow-y: visible;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    /* Adjust sticky offset for tablets */
    .article-sidebar {
        top: 15px;
        max-height: calc(100vh - 30px);
    }
}

/* ===================================
   Article Tags at Top
   =================================== */

/* Position tags within entry-header */
.single-article .entry-header {
    display: grid;
    grid-template-areas:
        "breadcrumbs tags"
        "title title"
        "meta meta";
}

.single-article .entry-header .breadcrumbs {
    grid-area: breadcrumbs;
}

.single-article .entry-header .page-title {
    grid-area: title;
}

.single-article .entry-header .article-tags-top {
    grid-area: tags;
}

.single-article .entry-header .entry-meta {
    grid-area: meta;
}

.single-article .entry-header > *:not(.article-tags-top) {
    flex: 1;
    min-width: 0;
}

.article-tags-top {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: flex-start;
    justify-content: flex-end;
    margin-left: auto;
}

.article-tag-pill {
    display: inline-block;
    padding: 6px 14px;
    background: #f0f0f0;
    color: #555;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.85em;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.article-tag-pill .fa-tag {
    margin-right: 5px;
    font-size: 0.9em;
}

/* Stack tags below on mobile */
@media (max-width: 768px) {
    .single-article .entry-header {
        flex-direction: column;
    }

    .article-tags-top {
        margin-left: 0;
        order: 2;
    }
}

.home-block {
    border-bottom-color: transparent !important;
}

.k-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 1024px) {
    .k-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .k-grid {
        grid-template-columns: 1fr;
    }
}

#knowledgebase .category-card {
    -webkit-box-shadow: 0 0 10px 5px rgba(0, 0, 0, 0.075);
    box-shadow: 0 0 15px 5px rgba(0, 0, 0, 0.075);
    padding: 2rem;
    border-radius: 0.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}


#knowledgebase .category-card ul {
    margin-bottom: 1rem;
}

#knowledgebase .category-card ul li:hover,
    #knowledgebase .category-card ul li:hover i {
    color: #2ee693;
}


#knowledgebase .category-card .category-card-title {
    font-weight: 900;
    position: relative;
}


#knowledgebase .category-card .category-card-title i {
    position: absolute;
    right: 0;
    top: 0;
    font-size: 2rem;
    opacity: 0.8;
    color: #2ee693;
}

#knowledgebase .category-card .category-card-view-all {
    font-weight: 600;
    color: #2ee693;
}

/* ===================================
   Category Icon SVG Styling
   =================================== */

/* Base styling for SVG icons */
.category-icon-svg {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: middle;
    margin-right: 0.5em;
}

/* Position SVG icons in category card titles like Font Awesome icons */
#knowledgebase .category-card .category-card-title .category-icon-svg {
    position: absolute;
    right: 0;
    top: 0;
    width: 2rem;
    height: 2rem;
    opacity: 0.8;
}

/* Ensure SVG elements inherit color and apply fill */
.category-icon-svg path,
.category-icon-svg circle,
.category-icon-svg rect,
.category-icon-svg polygon,
.category-icon-svg polyline,
.category-icon-svg line,
.category-icon-svg ellipse {
    fill: currentColor;
}

/* For SVGs that use stroke instead of fill */
.category-icon-svg path[stroke],
.category-icon-svg circle[stroke],
.category-icon-svg rect[stroke],
.category-icon-svg polygon[stroke],
.category-icon-svg polyline[stroke],
.category-icon-svg line[stroke],
.category-icon-svg ellipse[stroke] {
    stroke: currentColor;
}

