/*
Theme Name: Redbook Theme
Description: Redbook Child theme for Themify Ultra
Author: Themify
Template: themify-ultra
*/

/* write custom css below */

/* === Layout Wrapper === */
#spa-wrapper, .spa-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
  transition: all 0.3s ease;
}

/* === Sidebar === */
#spa-sidebar, .sidebar {
  width: 300px;
  background: #2C2A29 !important;
  position: fixed;
  left: 0;
  bottom: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: auto;
  white-space: nowrap;
  z-index: 1;
  transition: transform 0.3s ease, width 0.2s ease;
  transform: translateX(0);
  scrollbar-width: auto;
  -ms-overflow-style: auto;
}

#spa-sidebar::-webkit-scrollbar {
  display: none;
}

/* Sidebar collapsed */
#spa-wrapper.collapsed #spa-sidebar {
  transform: translateX(-100%);
}

/* Sidebar nav spacing only on desktop */
@media (min-width: 769px) {
  #spa-sidebar nav {
    margin-top: 100px;
  }
}
@media (max-width: 768px) {
  #spa-sidebar nav {
    margin-top: 0;
  }
}

/* === Sidebar Toggle Button === */
#sidebar-toggle {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10001;
  background: #e41c23;
  color: white;
  font-size: 16px;
  cursor: pointer;
  padding: 6px;
  border: none;
  border-radius: 0 5px 5px 0;
  height: 40px;
  width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.15);
  transition: left 0.3s ease;
  left: 340px;
}

#spa-wrapper.collapsed #sidebar-toggle {
  left: 0;
}

.toggle-icon {
  display: inline-block;
  transition: transform 0.3s ease;
}

#spa-wrapper.collapsed .toggle-icon {
  transform: rotate(180deg);
}

/* === Main Content === */
#spa-content {
  flex: 1;
  /* A flex item defaults to min-width: auto, so a wide table would stretch the page on phones. */
  min-width: 0;
  margin-left: 340px;
  transition: margin-left 0.3s ease;
}

#spa-wrapper.collapsed #spa-content {
  margin-left: 0;
}

/* === Menu Styling === */
.menu-item,
.menu-item-has-children,
.menu li,
.sub-menu li {
  list-style: none;
  margin-bottom: 6px;
}

.sub-menu {
  padding-left: 4px;
  margin-top: 0;
}

.menu-item-has-children .sub-menu {
  display: none;
  transition: all 0.3s ease;
}

.menu-item-has-children.open > .sub-menu {
  display: block;
}

.menu a,
.menu-item > a,
.sub-menu a {
  text-decoration: none;
  color: #ffffff !important;
  font-size: 14px;
}

.menu a:hover,
.menu-item-has-children > a.link-hover {
  text-decoration: underline;
}

.current-menu-item > a,
.current_page_item > a {
  text-decoration: underline;
}

.menu-item-has-children > a {
  position: relative;
  padding-right: 30px;
}

.menu-item-has-children > a:hover {
  text-decoration: none;
}

.menu-item-has-children > a::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: solid #ffffff;
  border-width: 5px 0 5px 6px;
  border-color: transparent transparent transparent #ffffff;
  transition: transform 0.3s ease;
}

.menu-item-has-children.open > a::after {
  transform: translateY(-50%) rotate(90deg);
}

.sub-menu a:hover {
  background-color: #444;
  color: #ffffff !important;
}

/* === WP Nav Bar Fix === */
body.no-navbar #main-navigation {
  display: none !important;
}

/* === Smooth Scroll === */
html {
  scroll-behavior: smooth;
}

/* === Mobile Tweaks === */
@media (max-width: 768px) {
  #spa-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    padding-top: 70px;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 9999;
    background: #2C2A29;
  }

  #spa-sidebar nav {
    margin-top: 0 !important; 
    padding-top: 0 !important;
  }

  #spa-sidebar::-webkit-scrollbar {
    display: block;
  }

  #spa-content {
    margin-left: 0;
  }

  #sidebar-toggle {
    left: 0;
  }
}


/* === Search Icon Fix === */
#headerwrap #searchform .tf_fa {
  position: relative;
  top: 10px;
  color: #2C2A29 !important;
  background-color: #D3BC8D !important;
}

#tf_icon_wrap #icon-search {
  color: #B34556 !important;
}

#searchform input[type="text"] {
  position: relative;
  top: 10px;
}

/* === Themify Fixes === */
#site-description {
  opacity: 1 !important;
  color: #ffffff !important;
}

#headerwrap {
  background-color: #2C2A29 !important;
}

#toggle-mobile-sidebar-button {
  display: none !important;
}

.spacing_for_file_blocks{
  margin-bottom: 25px !important;
  margin-left: 50px !important;
  margin-right: 50px !important;
}