/* =====================================
   SIDEBAR INTERACTION SYSTEM
   ===================================== */

/* Hover μόνο για non-active items */

#sidebar-1 .sidebar-item:not(.active-chapter):hover a.sidebar-link {
  text-decoration: underline !important;
  text-underline-offset: 0.12em;
}

/* Active chapter */

#sidebar-1 .sidebar-item.active-chapter a.sidebar-link {
  color: #8b0000 !important;
  pointer-events: none;
  cursor: default;
}

/* Active ornament */

#sidebar-1 .sidebar-item.active-chapter span {
  color: #8b0000 !important;
}

/* =====================================
   DESKTOP STICKY TAB
   ===================================== */

@media (min-width: 992px) {
  .sidebar-handle {
    position: fixed;
    right: -95px;
    bottom: 19%;
    z-index: 1030;
    width: 230px;
    white-space: nowrap;
    text-align: center;
    transform: rotate(-90deg);
    transform-origin: center;
    padding: 6px 16px;
    line-height: 1.2;
  }
}

/* =====================================
   CLOSE BUTTON
   ===================================== */

#sidebar-1 .btn-close {
  background: none !important;
  opacity: 1;
  width: auto;
  height: auto;
}

#sidebar-1 .btn-close::before {
  content: "×";
  color: #8b0000;
  font-size: 42px;
  font-weight: 900;
  line-height: 1;
  position: relative;
  top: 2px;
}

/* =====================================
   MOBILE / TABLET IMAGE SIDEBAR TRIGGER
   ===================================== */

@media (max-width: 991.98px) {
  #mobile-image-trigger-wrap {
    position: relative;
    overflow: visible;
  }
}

@media (max-width: 991.98px) {
  #mobile-image-trigger-wrap #mobile-sidebar-trigger-start {
    position: absolute;
    top: 50%;
    left: 0;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transform: translate(-50%, -50%) rotate(-90deg);
    transform-origin: center;
    background-color: #f8f0e5;
    border: 2px solid #8b0000;
    border-radius: 6px;
    color: #5d493c !important;
    text-decoration: none !important;
    transition: background-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  }
}

@media (max-width: 991.98px) {
  #mobile-image-trigger-wrap #mobile-sidebar-trigger-start:hover, #mobile-image-trigger-wrap #mobile-sidebar-trigger-start:active {
    background-color: #efe5d7;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  }
}

/* XS */

@media (max-width: 575.98px) {
  #mobile-image-trigger-wrap #mobile-sidebar-trigger-start {
    font-size: 16px;
    line-height: 1;
    padding: 6px 14px;
  }
}

@media (max-width: 575.98px) {
  #mobile-image-trigger-wrap #mobile-sidebar-trigger-start:hover, #mobile-image-trigger-wrap #mobile-sidebar-trigger-start:active {
    transform: translate(-50%, -50%) rotate(-90deg) scale(1.02);
  }
}

/* SM */

@media (min-width: 576px) and (max-width: 767.98px) {
  #mobile-image-trigger-wrap #mobile-sidebar-trigger-start {
    font-size: 18px;
    line-height: 1;
    padding: 8px 16px;
  }
}

@media (min-width: 576px) and (max-width: 767.98px) {
  #mobile-image-trigger-wrap #mobile-sidebar-trigger-start:hover, #mobile-image-trigger-wrap #mobile-sidebar-trigger-start:active {
    transform: translate(-50%, -50%) rotate(-90deg) scale(1.025);
  }
}

/* MD */

@media (min-width: 768px) and (max-width: 991.98px) {
  #mobile-image-trigger-wrap #mobile-sidebar-trigger-start {
    font-size: 21px;
    line-height: 1;
    padding: 10px 20px;
    border-width: 2px;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  #mobile-image-trigger-wrap #mobile-sidebar-trigger-start:hover, #mobile-image-trigger-wrap #mobile-sidebar-trigger-start:active {
    transform: translate(-50%, -50%) rotate(-90deg) scale(1.03);
  }
}

/* =====================================
   MOBILE SIDEBAR WIDTH
   ===================================== */

@media (max-width: 991.98px) {
  #sidebar-1.offcanvas, #sidebar-2.offcanvas, #sidebar-3.offcanvas {
    --bs-offcanvas-width: 93vw !important;
    width: 93vw !important;
    max-width: 93vw !important;
  }
}

