/* Core Layout Container */
.toc-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 99999;
  
  {% if module.style_overrides.custom_font.font %}
    
  {% else %}
    font-family: ; 
  {% endif %}
}

/* Floating Circle Button Layout */
.toc-circle-btn {
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, opacity 0.2s ease;

  /* Background Palette selection */
  background-color: {% if module.style_overrides.button_background_color.color %}{% else %}{% endif %};
  
  /* Text and Icon colour synced exactly to button_text_color style override field */
  color: {% if module.style_overrides.button_text_color.color %}{% else %}{% endif %};
}

.toc-circle-btn:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

.toc-icon-svg {
  width: 24px;
  height: 24px;
}

/* Expanded Card Design */
.toc-card {
  width: 260px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  border: 1px solid #e2e8f0;
  overflow: hidden;
  transform: scale(1);
  transform-origin: bottom right;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Card Header Configuration (Locked to #435a6a) */
#toc-toggle-header {
  width: 100%;
  padding: 14px 16px;
  background-color: #f8fafc;
  border: none;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 600;
  font-size: 15px;
  color: #435a6a; /* Forced Heading Color */
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}
#toc-close-x {
  font-size: 20px;
  color: #435a6a; /* Forced X Close Icon Color */
  line-height: 1;
}

/* Links Layout */
.toc-content ul {
  list-style: none;
  padding: 8px 0;
  margin: 0;
}
.toc-link {
  display: block;
  padding: 10px 20px;
  color:  !important;
  text-decoration: none;
  font-size: 14px;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}

/* Hover State Style (#f6f8f9) */
.toc-link:hover {
  background-color: #f6f8f9;
}

/* Contextual Scrollspy Highlight Configuration */
.toc-link.active-section {
  font-weight: 600;
  color: #e40050 !important; /* Forced active text color */
  background-color: transparent !important; /* Forces background highlight to null/empty */
  border-left-color: #e40050; /* Matches active text indicator */
}

/* Toggling CSS States */
.toc-container.collapsed .toc-card {
  display: none;
}
.toc-container:not(.collapsed) .toc-circle-btn {
  display: none;
}

/* ♿ Screen Reader Only Utility Class (WCAG standard absolute layout override) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Ensure focus outline remains visible for keyboard-tab users */
.toc-circle-btn:focus-visible, 
#toc-toggle-header:focus-visible, 
.toc-link:focus-visible {
  outline: 3px solid #e40050;
  outline-offset: 2px;
}

.toc-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 99999;
  
  /* Smooth entry animation scaling and fading */
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  
  {% if module.style_overrides.custom_font.font %}
    
  {% else %}
    font-family: ; 
  {% endif %}
}

/* Hidden Initial State */
.toc-container.toc-hidden {
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none; /* Prevents invisible clicks/tabs */
}

/* Visible State once scrolled past placeholder module placement */
.toc-container.toc-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

