/* Reusable UI primitives:
   .component card, accordion variant, highlighted panel,
   muted callout, section heading, pagination. */

.component {
  background-color: var(--white);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
  padding: 1rem;
  margin: 1rem 0 0 0;
  overflow-wrap: anywhere;
}

.component:last-of-type {
  margin-bottom: 2rem;
}

.component .component {
  background-color: var(--background-colour)
}

.component:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.component--accordion {
  overflow: hidden;
  padding: 0 1rem;
}

.component--accordion a:hover {
  text-decoration: underline;
}

.component--accordion summary {
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: bold;
}

.component--accordion .accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease;
}

.component--accordion[open] .accordion-body {
  max-height: 800px;
  overflow: auto;
}

.component--accordion > summary::after {
  content: "▾";
  font-size: 2rem;
  transition: transform 0.3s ease;
  transform: rotate(30deg);
}

.component--accordion[open] > summary::after {
  transform: rotate(120deg);
}

/* iOS Safari details/summary fixes */
details.component--accordion > summary { list-style: none; }
details.component--accordion > summary::-webkit-details-marker { display: none; }

/* Highlighted panel (selected recipe / pinned summary) */
.panel-highlight {
  background-color: var(--light-grey);
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  border: 2px solid var(--primary-colour);
}
.panel-highlight--thin {
  background-color: var(--light-grey);
  padding: 0.5rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  border: 1px solid var(--primary-colour);
}

/* Muted callout block (quoted terms, preformatted snippets) */
.muted-block {
  padding: 0.5rem;
  background-color: var(--light-grey);
  border-radius: 4px;
  font-size: 0.9em;
}

/* Section heading used by filter accordion / admin sections */
.section-heading {
  color: var(--primary-colour);
  margin: 1.5rem 0 0.5rem 0;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--light-grey);
}
.section-heading--inactive {
  color: var(--secondary-colour);
  opacity: 0.7;
}

/* Kaminari pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 2rem 0;
  background: none;
}
.pagination-gap {
  padding: 0.75rem 1.5rem;
  color: var(--medium-grey);
}

/* MFA setup QR code */
.qr-code {
  display: block;
  width: 200px;
  max-width: 100%;
  height: auto;
}
