/* Accordion SpellBlock Styles */
/* Modular CSS for accordion components */

/* Base Accordion Container */
.sb-accordion {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 90%;
  margin: auto;
  margin-bottom: 1.5rem;
  background-color: var(--surface-color);
  border: 1px solid color-mix(in srgb, var(--neutral-color) 15%, transparent);
  border-radius: 0.375rem;
  transition: all 0.5s ease-in-out;
  box-shadow: 0 0.125rem 0.25rem color-mix(in srgb, var(--text-color) 7.5%, transparent);
  overflow: hidden;
}

.sb-accordion:hover {
  box-shadow: 0 0.25rem 0.5rem color-mix(in srgb, var(--text-color) 10%, transparent);
}

/* Accordion Toggle Button */
.sb-accordion-toggle {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-color);
  text-align: left;
  background-color: var(--surface-color);
  border: none;
  border-bottom: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.3s ease-in-out;
}

.sb-accordion-toggle:hover {
  background-color: color-mix(in srgb, var(--surface-color) 90%, var(--text-color));
}

.sb-accordion-toggle[aria-expanded="true"] {
  background-color: color-mix(in srgb, var(--surface-color) 70%, var(--text-color));
  border-bottom: 1px solid color-mix(in srgb, var(--surface-color) 15%, transparent);
}

/* Accordion Title */
.sb-accordion-title {
  font-weight: 500;
}

/* Accordion Icon */
.sb-accordion-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.sb-accordion-icon .sb-icon-plus {
  display: block;
}

.sb-accordion-icon .sb-icon-minus {
  display: none;
}

.sb-accordion-toggle[aria-expanded="true"] .sb-icon-plus {
  display: none;
}

.sb-accordion-toggle[aria-expanded="true"] .sb-icon-minus {
  display: block;
}

/* Accordion Content */
.sb-accordion-content {
  max-height: 0;
  overflow: scroll;
  transition: max-height 0.7s ease-in-out;
}

.sb-accordion-toggle[aria-expanded="true"] + .sb-accordion-content {
  max-height: 30rem;
}

@media (max-width: 768px) {
  .sb-accordion-toggle[aria-expanded="true"] + .sb-accordion-content {
    max-height: 24rem;
  }
}

/* Accordion Body */
.sb-accordion-body {
  padding: 1rem;
}

/* Accordion Link Styling - Ensures readability across all themes */
.sb-accordion a {
  color: var(--accordion-link-color, var(--primary-color, #60a5fa));
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  font-weight: 500;
  transition: color 0.2s ease-in-out, text-decoration-color 0.2s ease-in-out;
}

.sb-accordion a:hover {
  color: var(--accordion-link-hover-color, var(--accent-color, #fbbf24));
  text-decoration-thickness: 2px;
}

.sb-accordion a:visited {
  color: var(--accordion-link-visited-color, var(--emphasis-color, #a78bfa));
}

.sb-accordion a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: 2px;
}
