/**
 * Mining Minnesota FAQ Accordion
 *
 * Every value the Elementor style controls touch is a custom property set on
 * .mm-faq-accordion, so a control override is one declaration on the wrapper
 * rather than a duplicate of the rule it is overriding.
 */

.mm-faq-accordion {
  --mm-faq-navy: #000f32;
  --mm-faq-title-color: var(--mm-faq-navy);
  --mm-faq-content-color: var(--mm-faq-navy);
  --mm-faq-icon-color: #7d8594;
  --mm-faq-icon-size: 18px;
  --mm-faq-icon-thickness: 2px;
  --mm-faq-item-padding: 28px;
  --mm-faq-content-max-width: 75%;
  --mm-faq-block-spacing: 1.4em;
  --mm-faq-duration: 350ms;
}

/* The zig-zag sits in normal flow above each item, outside everything the
   toggle touches, so opening a panel cannot repaint or shift it. Its aspect
   ratio matches the artwork's 1200x16 viewBox, which keeps the step at 37% of
   the width and the stroke undistorted at any container size. */
.mm-faq-item::before {
  content: "";
  display: block;
  width: 100%;
  aspect-ratio: 1200 / 16;
  background: url("../images/navy-zag.svg") no-repeat center / 100% 100%;
}

.mm-faq-item__heading {
  margin: 0;
  padding: 0;
  font: inherit;
}

.mm-faq-item__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  margin: 0;
  padding: var(--mm-faq-item-padding) 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--mm-faq-title-color);
  text-align: left;
  /* The reset sets nowrap on buttons, which would stop long titles wrapping. */
  white-space: normal;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

/* Hello Elementor's reset.css paints button:hover and button:focus with a #c36
   background and white text at (0,1,1). This widget has no hover state, so the
   states are pinned back to the resting one at (0,2,0). */
.mm-faq-item__trigger:hover,
.mm-faq-item__trigger:focus,
.mm-faq-item__trigger:active {
  background: none;
  color: var(--mm-faq-title-color);
  text-decoration: none;
}

/* Keyboard focus still needs to be visible; only the reset's paint is dropped. */
.mm-faq-item__trigger:focus-visible {
  outline: 2px solid var(--mm-faq-navy);
  outline-offset: 4px;
}

.mm-faq-item__title {
  font-family: "adelphi-pe-variable", sans-serif;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--mm-faq-title-color);
  transition: color var(--mm-faq-duration) ease;
}

.mm-faq-item__icon {
  position: relative;
  flex: 0 0 auto;
  width: var(--mm-faq-icon-size);
  height: var(--mm-faq-icon-size);
  transition: transform var(--mm-faq-duration) ease;
}

/* Plus to X. Rotating the whole icon keeps both strokes, which is what the
   open state in the design shows -- not a minus. */
.mm-faq-item--open .mm-faq-item__icon {
  transform: rotate(45deg);
}

.mm-faq-item__icon-line {
  position: absolute;
  background: var(--mm-faq-icon-color);
}

.mm-faq-item__icon-line--h {
  top: 50%;
  left: 0;
  width: 100%;
  height: var(--mm-faq-icon-thickness);
  transform: translateY(-50%);
}

.mm-faq-item__icon-line--v {
  top: 0;
  left: 50%;
  width: var(--mm-faq-icon-thickness);
  height: 100%;
  transform: translateX(-50%);
}

/* 0fr to 1fr animates to the content's own height without measuring it in JS,
   so nothing has to be read back from the DOM on toggle. */
.mm-faq-item__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--mm-faq-duration) ease;
}

.mm-faq-item--open .mm-faq-item__panel {
  grid-template-rows: 1fr;
}

.mm-faq-item__panel-inner {
  overflow: hidden;
  min-height: 0;
}

.mm-faq-item__panel-content {
  max-width: var(--mm-faq-content-max-width);
  padding-bottom: var(--mm-faq-item-padding);
  color: var(--mm-faq-content-color);
  font-family: "acumin-pro", sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

.mm-faq-item__panel-content p {
  margin: 0 0 var(--mm-faq-block-spacing);
  color: inherit;
  font: inherit;
}

/* Questions are set in the body face at body size, bold -- the heading tag is
   there for document structure, not for the heading font. */
.mm-faq-item__panel-content :is(h2, h3, h4, h5, h6) {
  margin: var(--mm-faq-block-spacing) 0 0;
  color: inherit;
  font: inherit;
  font-weight: 700;
}

.mm-faq-item__panel-content :is(ul, ol) {
  margin: 0 0 var(--mm-faq-block-spacing);
  padding-left: 1.25em;
}

.mm-faq-item__panel-content li {
  margin: 0;
  color: inherit;
  font: inherit;
}

.mm-faq-item__panel-content > :first-child {
  margin-top: 0;
}

.mm-faq-item__panel-content > :last-child {
  margin-bottom: 0;
}

/* The reset's a:hover ties this on specificity, so the states are listed
   explicitly to win regardless of stylesheet order. */
.mm-faq-item__panel-content a,
.mm-faq-item__panel-content a:hover,
.mm-faq-item__panel-content a:focus,
.mm-faq-item__panel-content a:active {
  color: inherit;
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
  .mm-faq-item__panel,
  .mm-faq-item__icon {
    transition: none;
  }
}
