/* =========================================================
   Upgraded Legacy / UXC Accordion
   Keeps new semantic markup but restores old visual style

   Progressive enhancement:
   - Default state keeps accordion content visible.
   - JavaScript adds .accordion-js-enabled only when the browser
     supports the enhanced accordion behavior.
   - Older browsers, failed JS, or disabled JS will see all panels open.
   ========================================================= */

.accordion--legacy {
  width: 100%;
  margin: 20px 0;
  border-top: 0;
}

/* 
   Legacy item container
*/
.accordion--legacy .accordion-item {
  border: 1px solid #ddd;
  border-radius: 3px;
  background: #fff;
  padding: 0;
  margin: 0 0 6px 0;
}

.accordion--legacy .accordion-item:last-child {
  margin-bottom: 0;
}

/* 
   Legacy heading/button area
*/
.accordion--legacy .accordion-item summary {
  list-style: none;
  display: block;
  cursor: pointer;
  padding: 10px 42px 10px 15px;
  position: relative;
  background: #f5f5f5;
  border-radius: 3px;
}

.accordion--legacy .accordion-item summary::-webkit-details-marker {
  display: none;
}

/* 
   Legacy title text
*/
.accordion--legacy .accordion-title {
  display: block;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 400;
  padding: 0;
  color: #333;
}

/* 
   Match old link-like title appearance when open
*/
.accordion--legacy .accordion-item[open] .accordion-title {
  text-decoration: underline;
}

/* 
   Legacy right-side plus/minus icon
*/
.accordion--legacy .accordion-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: #ddd;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1;
}

/*
   The icon uses Font Awesome content values to match the existing site style.
*/
.accordion--legacy .accordion-icon i {
  font-style: normal;
}

.accordion--legacy .accordion-icon i::before {
  content: "\f067";
  font-family: "Font Awesome 6 Pro";
  font-weight: 900;
}

.accordion--legacy .accordion-item[open] .accordion-icon i::before {
  content: "\f068";
}

/* =========================================================
   Fallback panel behavior

   This is the critical IE 11 / no-JS fallback.
   Do not hide the panel by default.

   If JavaScript does not run, fails, or decides not to enhance
   the accordion, all panel content remains visible.
   ========================================================= */

.accordion--legacy .accordion-panel {
  height: auto;
  overflow: visible;
  box-sizing: border-box;
  padding: 0;
  margin-top: 0;
}

/* =========================================================
   Enhanced panel behavior

   JavaScript should add .accordion-js-enabled to the html element
   only after it confirms that <details> is supported.
   ========================================================= */

.accordion-js-enabled .accordion--legacy .accordion-panel {
  height: 0;
  overflow: hidden;
  transition: height 300ms ease;
}

/*
   Open enhanced panels should be visible.
   JavaScript may temporarily set pixel heights inline during animation.
*/
.accordion-js-enabled .accordion--legacy .accordion-item[open] .accordion-panel {
  height: auto;
}

/*
   Legacy visual spacing belongs here, inside the animated shell.
*/
.accordion--legacy .accordion-panel-inner {
  padding: 15px;
}

/*
   Remove unexpected top and bottom spacing inside the animated area.
*/
.accordion--legacy .accordion-panel-inner > :first-child {
  margin-top: 0;
}

.accordion--legacy .accordion-panel-inner > :last-child {
  margin-bottom: 0;
}

/*
   Match old panel paragraph spacing.
*/
.accordion--legacy .accordion-panel-inner p {
  margin: 0 0 10px 0;
}

/*
   Optional focus style.
*/
/*
.accordion--legacy .accordion-item summary:focus,
.accordion--legacy .accordion-item summary:focus-visible {
  outline: 2px solid #0069aa;
  outline-offset: 2px;
}
*/

/*
   Respect reduced motion only when enhanced behavior is active.
*/
@media (prefers-reduced-motion: reduce) {
  .accordion-js-enabled .accordion--legacy .accordion-panel {
    transition: none;
  }
}