.dph-accordion {
  background-color: var(--dph-white);
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
  box-sizing: border-box;
}

.accordion-item {
  /* The top border acts as the divider */
  border-top: 1px solid var(--dph-accordion-border-color);
}
.accordion-item:first-child {
  border-top: none;
}

.accordion-button {
  /* Reset button styles */
  background: none;
  border: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  position: relative; /* Required for the ::after pseudo-element */

  /* Layout and spacing */
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0.55rem 1rem;

  /* Typography and Transitions */
  font-size: 0.9rem; /* 18px */
  font-weight: 600;
  color: var(--dph-text-color-dark);
  transition: color 0.3s ease;
}

/* NEW: Expanding line effect */
.accordion-button::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--dph-accordion-coloring);
  transition: width 0.3s ease;
}

.accordion-button:hover::after {
  width: 100%;
}

.accordion-button:hover {
  color: var(--dph-accordion-coloring);
}

.accordion-button:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--dph-accordion-coloring);
  border-radius: 0.25rem;
}

.accordion-button .icon {
  color: var(--dph-accordion-coloring);
  font-size: 1.25rem;
  margin-left: 1rem;
}

.accordion-content {
  position: relative; /* For pseudo-elements */
  overflow: hidden;
  max-height: 0;
  margin: 0;
  transition: max-height 0.5s ease, margin-bottom 0.5s ease, padding 0.5s ease;
  padding: 0 1rem 0 1.25rem;
  border-left: 4px solid transparent;
  color: var(--dph-text-color-light);
  font-size: 1rem;
  line-height: 1.5;
}

/* Top border line for content */
.accordion-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0.25rem;
  right: 0;
  height: 1px;
  background-color: var(--dph-accordion-coloring);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s ease;
}

/* Bottom border line for content */
.accordion-content::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0.25rem;
  right: 0;
  height: 1px;
  background-color: var(--dph-accordion-coloring);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s ease;
}

/* Styles for when the panel is expanded */
.accordion-content.show {
  max-height: 10000px;
  margin-bottom: 1rem; /* Space between open content and next heading */
  padding: 1rem 1rem 1rem 1.25rem;
  border-left-color: var(--dph-accordion-coloring);
}

/* Animate borders when shown */
.accordion-content.show::before,
.accordion-content.show::after {
  transform: scaleX(1);
}

/* Responsive styles */
@media (max-width: 768px) {
  .accordion-button {
    font-size: 1rem; /* 16px */
    padding: 0.75rem;
  }
}
