﻿/* kc-v2 v1.5.7 -- accordion & FAQ */
/* Full class contract and conventions: see README.md and kc-v2-base.css. */

/* ---------------------------------------------------------------------------
 * Accordion & FAQ
 *
 * Behavior lives in kc-v2.js (registerBehavior "accordion"). CSS reacts to
 * aria-expanded for the chevron rotation; panel visibility itself is the
 * native `hidden` attribute, toggled by JS alongside the ARIA attribute --
 * see kc-v2.js for why both, not just one.
 * ------------------------------------------------------------------------- */

.kc-v2-accordion {
  border: 1px solid var(--kc-v2-ink-200);
  border-radius: var(--kc-v2-radius-lg);
  overflow: hidden; /* also means a focus ring on the full-width header would
                        be clipped by an outside offset -- see the negative
                        outline-offset below */
}
.kc-v2-accordion__item + .kc-v2-accordion__item {
  border-top: 1px solid var(--kc-v2-ink-100);
}
/* Font properties are declared even though the visible text lives in the nested
   .kc-v2-accordion__header button: this element is an <h3>, and site.css styles
   `h1, h2, h3, h4, h5, h6` directly, so its size/weight/family landed here and
   changed the heading box's metrics (KENT-59 Phase 0 spike). */
.kc-v2-accordion__heading {
  margin: 0;
  font-family: var(--kc-v2-font-family);
  font-size: 15.5px;
  font-weight: 700;
  line-height: normal;
}
.kc-v2-accordion__header {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--kc-v2-space-3);
  width: 100%;
  margin: 0; /* site.css's bare `button { margin-right: 8px; }` -- same leak as .kc-v2-btn */
  padding: 20px var(--kc-v2-space-4);
  border: none;
  background-color: var(--kc-v2-white);
  color: var(--kc-v2-ink-900);
  font-family: var(--kc-v2-font-family);
  font-size: 15.5px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.kc-v2-accordion__header:hover {
  background-color: var(--kc-v2-ink-50);
}
.kc-v2-accordion__header:focus-visible {
  outline: var(--kc-v2-focus-ring-width) solid var(--kc-v2-focus-ring-color);
  outline-offset: -2px; /* inset -- an outside ring would be clipped by the
                            accordion's own overflow:hidden on a full-width row */
}
.kc-v2-accordion__header svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--kc-v2-ink-500);
  transition: transform 150ms;
}
.kc-v2-accordion__header[aria-expanded="true"] svg {
  transform: rotate(180deg);
  stroke: var(--kc-v2-blue);
}

.kc-v2-accordion__panel {
  padding: 0 var(--kc-v2-space-4) 20px;
  background-color: #F6F9FC; /* a one-off open-panel tint, not reused elsewhere */
  color: var(--kc-v2-ink-500);
  font-family: var(--kc-v2-font-family);
  font-size: 14px;
  line-height: 1.5;
}

@media (forced-colors: active) {
  .kc-v2-accordion,
  .kc-v2-accordion__item + .kc-v2-accordion__item {
    border-color: CanvasText;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kc-v2-accordion__header svg {
    transition-duration: 0.01ms;
  }
}

/* Accordion panels print expanded regardless of their on-screen state --
   otherwise collapsed FAQ answers silently vanish from a printed page. This
   deliberately does not touch aria-expanded (a print stylesheet has no
   business rewriting document semantics), only what's visible. No
   !important needed: an author stylesheet's `display` declaration already
   overrides the UA stylesheet's `[hidden] { display: none }` regardless of
   specificity, because origin (author beats user-agent) is resolved before
   specificity in the cascade -- the same reason any reset stylesheet can
   override browser defaults at all. */
@media print {
  .kc-v2-accordion__panel {
    display: block;
  }
}
