/*
 * FAQ module (block grid component) styles.
 *
 * Consumes the design tokens from tokens.css. Do not hard-code colours,
 * fonts or spacing here; reference the custom properties so the site
 * stays themeable.
 */

.faq-module {
  width: 100%;
  /* Anchor CTAs (e.g. Genvejskort "Faq" card) scroll this element's top
     edge flush to the viewport top, which then hides under the fixed
     header/pill and operational-message bar. Reserve that space so the
     FAQ module lands fully visible below both, matching afdelingskort.css. */
  scroll-margin-top: calc(var(--padis-header-height, 5rem) + var(--padis-operational-height, 0px) + var(--padis-space-md));
}

.faq-module--normal {
  max-width: 900px;
  margin: 0 auto;
}

.faq-module--wide {
  max-width: 1400px;
  margin: 0 auto;
}

.faq-module--full {
  width: 100vw;
  max-width: 100vw;

  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.faq-module__title {
  margin-bottom: 2rem;
}

.faq-items--two-columns {
  column-count: 2;
  column-gap: 2rem;
}

.faq-items--two-columns .faq-item {
  break-inside: avoid;
  display: inline-block;
  width: 100%;
}

.faq-item {
  margin-bottom: 1rem;
}

.faq-question {
  width: 100%;

  background: var(--padis-color-primary);
  color: var(--padis-color-on-primary);

  padding: 1.25rem 1.75rem;

  cursor: pointer;

  font-weight: 600;
  font-size: 1.125rem;

  border: none;
  border-radius: calc(var(--padis-radius) * 2);

  text-align: left;

  display: flex;
  align-items: center;
  gap: 1rem;

  box-shadow: var(--padis-shadow);

  transition:
    background-color .2s ease,
    transform .2s ease,
    box-shadow .2s ease,
    border-radius .2s ease;
}

.faq-question:hover {
  background: var(--padis-color-primary-dark);

  transform: translateY(-2px);

  box-shadow: var(--padis-shadow-hover);
}

.faq-question:focus-visible {
  outline: 3px solid var(--padis-color-primary-dark);
  outline-offset: 2px;
}

/*
 * v1.2 category pills/panels (Categorized variant, 2+ categories). Reuses
 * the same tokens as the rest of this file - no new hard-coded colours -
 * and keeps the faq-* naming convention rather than borrowing
 * Dokumentliste's padis-dokumentliste__ prefix.
 */
.faq-categories {
  margin-bottom: 2rem;
}

.faq-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--padis-space-sm, .5rem);

  margin-bottom: 1.5rem;
}

.faq-pill {
  font: inherit;
  cursor: pointer;

  padding: .5rem 1.25rem;

  background: var(--padis-color-surface-alt);
  color: var(--padis-color-text, inherit);

  border: 1px solid var(--padis-color-border);
  border-radius: 999px;

  transition:
    background-color .2s ease,
    color .2s ease;
}

.faq-pill:hover {
  background: var(--padis-color-primary);
  color: var(--padis-color-on-primary);
}

.faq-pill.is-active {
  background: var(--padis-color-primary);
  color: var(--padis-color-on-primary);

  box-shadow: var(--padis-shadow);
}

.faq-pill:focus-visible {
  outline: 3px solid var(--padis-color-primary-dark);
  outline-offset: 2px;
}

.faq-panel {
  display: none;
}

.faq-panel.is-active {
  display: block;
}

.faq-icon {
  min-width: var(--padis-space-md);

  font-size: 1.5rem;
  line-height: 1;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  transition: transform .3s ease;
}

.faq-item.open .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;

  opacity: 0;

  transition:
    max-height .35s ease,
    opacity .35s ease;
}

.faq-answer-inner {
  background: var(--padis-color-surface-alt);

  border: 1px solid var(--padis-color-border);
  border-top: none;

  padding: 1rem 1.5rem;

  border-bottom-left-radius: calc(var(--padis-radius) * 2);
  border-bottom-right-radius: calc(var(--padis-radius) * 2);
}

.faq-item.open .faq-question {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.faq-item.open .faq-answer {
  opacity: 1;
}

@media (max-width: 768px) {
  .faq-items--two-columns {
    column-count: 1;
  }
}
