/* ── Archive: layout container ────────────────────────────────────────────────
   `main` is the single horizontal container so the hero title, search, and grid
   share one left edge. The gutter (16px below 1200px) and wide-size centring are
   supplied by the shared `.bmp-gutter` / `.bmp-wide` helpers (firebird-horizontal-spacing.css),
   applied in archive-bmpfaq.html. */

/* firebird-master's `body main { flex: 1 1 0% }` (sticky-footer layout) makes
   `main` a flex item whose auto width resolves via shrink-to-fit instead of
   stretching to the available cross-axis space — with content wide enough
   (the category grid's per-card article lists) that shrink-to-fit happens to
   reach the `.bmp-wide` cap, so it looks fine there, but shorter content
   (e.g. the set grid, whose cards are just a heading) shrinks well short of
   it. An explicit 100% width gives `main` a definite size instead of an
   auto/content-based one, so `.bmp-wide`'s max-width caps it consistently
   regardless of what's inside. */
.bmpfaq-archive-main {
  width: 100%;
}

/* Left-align children; cancel the constrained-layout auto-centring + width caps. */
.bmpfaq-search-row,
.bmpfaq-category-grid,
.bmpfaq-flat-list,
.bmpfaq-archive-main .bmpfaq-breadcrumbs,
.bmpfaq-archive-main .bmpfaq-global-search,
.bmpfaq-archive-main .bmpfaq-search-full-results {
  margin-inline: 0;
  max-width: none;
}

.bmpfaq-archive-main .bmpfaq-archive-main-content {
  max-width: none;
  .entry-content {
    margin-left: 0;
    padding-bottom: 1rem;
    font-size: var(--wp--preset--font-size--112);
  }
}

.bmpfaq-archive-main-content > .wp-block-post-content {
  max-width: var(--wp--style--global--content-size);
}

/* ── Archive: search widget ──────────────────────────────────────────────── */

/* Wraps the "All FAQ Sets" back-link and the search widget on one line, with
   the link to the left of the search box (see bmpfaq_render_global_search(),
   only added on a set's own archive page). */
.bmpfaq-search-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin: var(--wp--custom--unit--spacing--400, 2.5rem) 0
    var(--wp--custom--unit--spacing--320, 2rem);
}
.bmpfaq-search-scope-input {
  height: 40px;
  width: 40px;
}
@media (min-width: 1200px) {
  .bmpfaq-search-scope-input {
    height: 25px;
    width: 25px;
  }
}

/* Push the results list onto its own full-width line below the back-link +
   search box, instead of squeezing into the wrapping flex row alongside them. */
.bmpfaq-search-row > .bmpfaq-search-full-results {
  flex-basis: 100%;
}

.bmpfaq-search-back-link {
  display: none;
  flex-shrink: 0;
  white-space: nowrap;
  text-decoration: none;
  color: var(--wp--custom--block--globals--color--purple, #534be7);
  font-weight: var(
    --wp--custom--block--globals--typography--font-weight--500,
    500
  );
}

.bmpfaq-search-back-link:hover {
  text-decoration: underline;
}

.bmpfaq-search {
  flex: 1 1 auto;
  /* max-width: 40rem; */
  min-width: 0;
  position: relative;
}

/* The cross-set search on page-faq-search-results.html sits in the wide
   .bmp-column-content-wrapper next to the set-list sidebar, not the narrow
   archive-page/browse-page column — let it and its results fill that column
   instead of capping at the 40rem width used everywhere else, which left a
   large empty gap before the sidebar. */
.bmp-column-content-wrapper .bmpfaq-global-search {
  max-width: none;
}

/* The global-search form itself is a flex row so the "Search only <set>"
   scope checkbox (only rendered on a set's archive page) sits beside the
   input instead of stacking under it. */
.bmpfaq-global-search {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.375rem 0.75rem; /* tighter row gap keeps the label close to the input */
}

/* Visible label above the input; takes a full row of the wrapping form. */
.bmpfaq-search-label {
  flex-basis: 100%;
}

/* Input and button sit flush against each other as one control. */
.bmpfaq-search-input-wrap {
  display: flex;
  gap: 0;
  align-items: stretch;
  flex: 1 1 auto;
  min-width: 0;
}

@media (min-width: 1200px) {
  .bmpfaq-search-input-wrap {
    max-width: 49.125rem; /* 786px */
  }
}

.bmpfaq-search-scope {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 0.9rem;
  color: var(--wp--custom--block--globals--color--text--body, #292929);
  cursor: pointer;
}

.bmpfaq-search-scope input {
  cursor: pointer;
}

.bmpfaq-search-field {
  position: relative;
  flex: 1;
}

.bmpfaq-search-input {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem; /* right room for the clear button */
  font-size: inherit;
  font-family: inherit;
  border: 2px solid transparent;
  border-radius: var(--wp--custom--block--globals--corner-radius, 6px) 0 0
    var(--wp--custom--block--globals--corner-radius, 6px);
  box-sizing: border-box;
  background: var(--wp--custom--unit--color--purple--25, #f2f4f7);
  color: inherit;
}

/* Magnifying-glass icon inside the input, copied from firebird-master's
   .bmp-search-results-page search input (src/scss/components/search.scss),
   but shown at all widths rather than from 768px up. */
.bmpfaq-search-input {
  padding-left: 40px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none"><path d="M13 13L19 19M8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15Z" stroke="%23737373" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');
  background-repeat: no-repeat;
  background-position: 10px center;
  background-size: 20px 20px;
}

/* Mirrors firebird-master's search block button (src/scss/components/search.scss,
   with the black background from its .bmp-search-results-page variant). */
.bmpfaq-search-btn {
  flex-shrink: 0;
  padding: var(--wp--custom--unit--spacing--120, 12px)
    var(--wp--custom--unit--spacing--200, 20px);
  font-size: inherit;
  font-family: inherit;
  font-weight: inherit;
  background: var(--wp--custom--unit--color--gray--1000, #000);
  color: var(
    --wp--custom--block--mixins--site-header--search-button-color,
    #fff
  );
  border: 2px solid transparent;
  border-radius: 0 var(--wp--custom--block--globals--corner-radius, 6px)
    var(--wp--custom--block--globals--corner-radius, 6px) 0;
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
}

.bmpfaq-search-btn:hover,
.bmpfaq-search-btn:active {
  background: var(--wp--custom--block--globals--color--orange, #ffa477);
  color: black;
  border: 2px solid var(--wp--custom--block--globals--color--orange, #ffa477);
}

.bmpfaq-search-btn:focus,
.bmpfaq-search-btn:focus-visible {
  border: 2px solid var(--wp--custom--block--globals--color--orange, #ffa477);
  outline: none;
}

.bmpfaq-search-clear {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: var(--wp--custom--block--globals--color--text--subheading, #525252);
  padding: 0.25rem;
  border-radius: 50%;
}

.bmpfaq-search-clear:hover {
  color: var(--wp--custom--block--globals--color--text--heading, #292929);
}

.bmpfaq-search-clear:focus-visible {
  outline: 2px solid var(--wp--custom--block--globals--color--orange, #ffa477);
  outline-offset: 2px;
}

.bmpfaq-search-input:focus,
.bmpfaq-search-input:focus-visible {
  outline: none;
  border: 2px solid var(--wp--custom--block--globals--color--orange, #ffa477);
  box-shadow: none;
}

.bmpfaq-search-results {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  z-index: 100;
  background: #fff;
  border: 1px solid var(--wp--custom--block--globals--color--border, #ccc);
  border-radius: 0.25rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.bmpfaq-search-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.bmpfaq-search-item {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid
    var(--wp--custom--block--globals--color--border, #eee);
}

.bmpfaq-search-item:last-child {
  border-bottom: none;
}

.bmpfaq-search-title {
  display: block;
  font-weight: var(
    --wp--custom--block--globals--typography--font-weight--500,
    500
  );
  color: var(--wp--custom--block--globals--color--text--heading, #292929);
  text-decoration: none;
}

.bmpfaq-search-title:hover {
  text-decoration: underline;
  text-decoration-color: var(
    --wp--custom--block--globals--color--purple,
    #534be7
  );
}

.bmpfaq-search-item--category {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.bmpfaq-search-badge {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--wp--custom--block--globals--color--purple, #534be7);
  border: 1px solid var(--wp--custom--block--globals--color--purple, #534be7);
  border-radius: 0.2rem;
  padding: 0.1em 0.4em;
  line-height: 1.4;
}

.bmpfaq-search-empty {
  margin: 0;
  padding: 0.85rem 1rem;
  color: var(--wp--custom--block--globals--color--text--body, #292929);
}

/* ── Category archive: sidebar nav ──────────────────────────────────────── */

.bmpfaq-category-nav .bmp-section-navigation {
  margin: 1.25rem auto 0;
  border-left: 1px solid
    var(
      --wp--custom--block--mixins--button--border-color-style-outline,
      #534be7
    );
  border-radius: var(
    --wp--custom--block--bmp-section-navigation--corner-radius,
    0.5rem
  );
}
.page-template-page-faq-search-results
  .bmpfaq-category-nav
  .bmp-section-navigation {
  margin-top: 0;
}

.bmpfaq-category-nav .bmp-section-navigation ul {
  list-style: none;
  margin: 0;
  padding: 1rem 1rem 1.5rem 1.125rem;
}

.bmpfaq-category-nav .bmp-section-navigation li {
  margin: 0;
  padding: 0.32rem 0;
}

.bmpfaq-category-nav .bmp-section-navigation a {
  text-decoration: none;
  display: block;
  font-size: var(
    --wp--custom--block--globals--typography--font-size--112,
    1.125rem
  );
  color: var(--wp--custom--block--globals--color--text--heading, #292929);
  line-height: var(
    --wp--custom--block--globals--typography--line-height--140,
    1.4em
  );
  font-weight: var(
    --wp--custom--block--globals--typography--font-weight--500,
    500
  );
}

.bmpfaq-category-nav .bmp-section-navigation a:hover {
  text-decoration: underline;
  text-decoration-color: var(
    --wp--custom--block--globals--color--purple,
    #534be7
  );
}

.bmpfaq-category-nav .bmp-section-navigation .parent-page-h5 {
  padding-top: 0;
  display: inline-flex;
  align-items: baseline;
}

.bmpfaq-category-nav .bmp-section-navigation .parent-page-h5::before {
  content: "\AB ";
  font-size: 1.7rem;
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  margin-right: 0.5rem;
  flex-shrink: 0;
  color: var(--wp--custom--block--globals--color--purple, #534be7);
  font-family: var(
    --wp--preset--font-family--heading,
    "Bespoke Slab",
    Rockwell,
    "Rockwell Nova",
    "Roboto Slab",
    "DejaVu Serif",
    "Sitka Small",
    serif
  );
}

.bmpfaq-category-nav .bmp-section-navigation .parent-page-h5 a {
  color: var(--wp--custom--block--globals--color--purple, #534be7);
  font-family: var(
    --wp--preset--font-family--heading,
    "Bespoke Slab",
    Rockwell,
    "Rockwell Nova",
    "Roboto Slab",
    "DejaVu Serif",
    "Sitka Small",
    serif
  );
  font-weight: var(
    --wp--custom--block--globals--typography--font-weight--500,
    500
  );
  font-size: var(
    --wp--custom--block--globals--typography--font-size--125,
    1.25rem
  );
  line-height: var(
    --wp--custom--block--globals--typography--line-height--120,
    1.2em
  );
  display: inline-block;
}

.bmpfaq-category-nav .bmp-section-navigation .child-page {
  padding-left: 1.4rem;
}

.bmpfaq-category-nav .bmp-section-navigation .current-page {
  padding-left: 0;
  display: flex;
  align-items: flex-start;
}

.bmpfaq-category-nav .bmp-section-navigation .current-page::before {
  content: "";
  background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0.157801 8.13352C-0.0473555 8.51996 -0.0602931 9.45535 0.165195 9.87971C1.32036 12.0539 2.88214 14.8293 4.18886 17.2166C4.62135 18.0057 5.66377 18.2441 6.40862 17.7222C8.85387 16.0121 13.9421 12.4656 17.3337 10.2102C18.219 9.62148 18.2227 8.35383 17.3411 7.75973C14.138 5.60002 10.2641 2.79566 6.40308 0.254932C5.66008 -0.234432 4.64723 0.00392894 4.21658 0.771383C2.83408 3.23988 1.50703 5.58919 0.155954 8.13533L0.157801 8.13352Z' fill='%237F56D9'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  display: inline-block;
  width: 0.8rem;
  height: 0.8rem;
  margin: 0.3rem;
  flex-shrink: 0;
}

.bmpfaq-category-nav .bmp-section-navigation .current-page a {
  font-weight: var(
    --wp--custom--block--globals--typography--font-weight--700,
    700
  );
  color: #000;
}

/* Subcategories, listed under the category being viewed. Indented so their
   text lines up 1.4rem in from the parent's, whether or not the parent is the
   current page (a current parent has no padding — its marker takes the space). */
.bmpfaq-category-nav .bmp-section-navigation ul ul {
  padding: 0.32rem 0 0;
}

.bmpfaq-category-nav .bmp-section-navigation ul ul li:last-child {
  padding-bottom: 0;
}

.bmpfaq-category-nav .bmp-section-navigation ul ul a {
  font-size: var(--wp--custom--block--globals--typography--font-size--100, 1rem);
}

.bmpfaq-category-nav .bmp-section-navigation .current-page {
  flex-wrap: wrap;
}

.bmpfaq-category-nav .bmp-section-navigation .current-page > a {
  flex: 1;
}

.bmpfaq-category-nav .bmp-section-navigation .current-page > ul {
  flex-basis: 100%;
  padding-left: 1.4rem;
}

/* Only the current page's own link is bold, not its subcategories. */
.bmpfaq-category-nav .bmp-section-navigation .current-page li:not(.current-page) a {
  font-weight: var(
    --wp--custom--block--globals--typography--font-weight--500,
    500
  );
  color: var(--wp--custom--block--globals--color--text--heading, #292929);
}

/* ── Archive: category grid ──────────────────────────────────────────────── */

.bmpfaq-category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--wp--custom--unit--spacing--320, 2rem);
  margin: var(--wp--custom--unit--spacing--200, 1.25rem) 0;
  margin-top: var(--wp--custom--unit--spacing--400, 2.5rem);
  align-items: stretch;
}

/* Static visual grouping — not a link; only the heading and items are links. */
.bmpfaq-category-card {
  background: var(--wp--preset--color--gray-50, #fafafa);
  border: 1px solid
    var(--wp--custom--block--mixins--card--border-color, #e5e5e5);
  border-radius: var(--wp--custom--block--mixins--card--border-radius, 0.5rem);
  padding: var(--wp--custom--block--mixins--card--padding, 1.5rem);
}

.bmpfaq-card-heading {
  margin-top: 0 !important;
}

.bmpfaq-card-heading a {
  color: var(--wp--custom--block--mixins--card--color-heading, #292929);
  text-decoration: none;
}

.bmpfaq-card-heading a:hover,
.bmpfaq-card-heading a:active {
  text-decoration: underline;
  text-decoration-color: var(
    --wp--custom--block--globals--color--purple,
    #534be7
  );
}

.bmpfaq-card-description {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--wp--custom--block--globals--color--text--subheading, #525252);
}

.bmpfaq-card-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.bmpfaq-card-list li {
  padding: 0;
}

.bmpfaq-card-list a {
  display: block;
  color: var(--wp--custom--block--globals--color--purple, #534be7);
  text-decoration: none;
  line-height: var(
    --wp--custom--block--globals--typography--line-height--140,
    1.4em
  );
}

.bmpfaq-card-list a:hover {
  text-decoration: underline;
  text-decoration-color: var(
    --wp--custom--block--globals--color--purple,
    #534be7
  );
}

.bmpfaq-card-see-all {
  margin: 1rem 0 0;
}

.bmpfaq-card-see-all a {
  color: var(--wp--custom--block--globals--color--purple, #534be7);
  font-size: var(
    --wp--custom--block--globals--typography--font-size--112,
    1.125rem
  );
  font-weight: var(
    --wp--custom--block--globals--typography--font-weight--500,
    500
  );
  text-decoration: none;
}

.bmpfaq-card-see-all a:hover {
  text-decoration: underline;
  text-decoration-color: var(
    --wp--custom--block--globals--color--purple,
    #534be7
  );
}

/* "Other" card: articles 6+ expand in place (no page to link to). The summary
   looks like the "See all" link and disappears once open, so the list reads
   as one continuous list. */
.bmpfaq-card-more summary {
  display: block; /* block (not list-item) drops the disclosure triangle */
  cursor: pointer;
  list-style: none;
  color: var(--wp--custom--block--globals--color--purple, #534be7);
  font-size: var(
    --wp--custom--block--globals--typography--font-size--112,
    1.125rem
  );
  font-weight: var(
    --wp--custom--block--globals--typography--font-weight--500,
    500
  );
}

.bmpfaq-card-more summary::-webkit-details-marker {
  display: none;
}

.bmpfaq-card-more summary:hover {
  text-decoration: underline;
  text-decoration-color: var(
    --wp--custom--block--globals--color--purple,
    #534be7
  );
}

.bmpfaq-card-more[open] {
  margin-top: 0.75rem; /* same gap as between list items */
}

.bmpfaq-card-more[open] summary {
  display: none;
}

/* ── Archive: flat two-column list (no categories) ──────────────────────── */

.bmpfaq-flat-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 var(--wp--custom--unit--spacing--320, 2rem);
  list-style: none;
  margin: var(--wp--custom--unit--spacing--400, 2.5rem) 0;
}

.bmpfaq-flat-list li {
  padding: 0.65rem 0;
  border-bottom: 1px solid
    var(--wp--custom--block--globals--color--border, #eee);
}

.bmpfaq-flat-list a {
  color: var(--wp--custom--block--globals--color--text--heading, #292929);
  font-weight: var(
    --wp--custom--block--globals--typography--font-weight--500,
    500
  );
  text-decoration: none;
  display: block;
}

.bmpfaq-flat-list a:hover {
  text-decoration: underline;
  text-decoration-color: var(
    --wp--custom--block--globals--color--purple,
    #534be7
  );
}

/* ── Category archive: article list ─────────────────────────────────────── */

.bmpfaq-category-content {
  padding-bottom: 3rem;
}

.bmpfaq-category-title {
  margin-block-start: 0 !important;
}

/* Subcategory cards share the column with the sidebar nav, so cap at two across. */
@media (min-width: 601px) {
  .bmpfaq-category-content .bmpfaq-category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.bmpfaq-article-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.bmpfaq-article-list li {
  padding: 0;
}

.bmpfaq-article-list a {
  display: block;
  color: var(--wp--custom--block--globals--color--purple, #534be7);
  font-size: inherit;
  line-height: var(
    --wp--custom--block--globals--typography--line-height--140,
    1.4em
  );
  text-decoration: none;
}

.bmpfaq-article-list a:hover {
  text-decoration: underline;
  text-decoration-color: var(
    --wp--custom--block--globals--color--purple,
    #534be7
  );
}

/* ── Cross-set search page ────────────────────────────────────────────────── */

.bmpfaq-search-item-title-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.bmpfaq-search-item-title-row .bmpfaq-search-title {
  flex: 1;
}

.bmpfaq-search-votes {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--wp--custom--block--globals--color--text--subheading, #525252);
}

.bmpfaq-search-votes-icon {
  font-size: 0.9em;
}

.bmpfaq-search-crumb {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: var(--wp--custom--block--globals--color--text--subheading, #525252);
}

.bmpfaq-search-crumb a {
  color: inherit;
  text-decoration: none;
}

.bmpfaq-search-crumb a:hover {
  text-decoration: underline;
}

.bmpfaq-search-crumb-sep {
  margin: 0 0.15rem;
}

.bmpfaq-search-excerpt {
  margin: 0.4rem 0 0;
  color: var(--wp--custom--block--globals--color--text--body, #292929);
}

.bmpfaq-search-full-results {
  margin-top: 1.5rem;
}

.bmpfaq-search-full-results .bmpfaq-search-list {
  border-top: 1px solid var(--wp--custom--block--globals--color--border, #eee);
}

.bmpfaq-search-full-results .bmpfaq-search-item {
  padding: 1rem 0;
}

/* ── Responsive overrides ──────────── */

@media (max-width: 600px) {
  .bmpfaq-category-grid {
    grid-template-columns: 1fr;
  }

  .bmpfaq-flat-list {
    grid-template-columns: 1fr;
  }

  .bmpfaq-search-row {
    flex-direction: column;
    align-items: stretch;
  }

  .bmpfaq-search {
    max-width: 100%;
  }

  .bmpfaq-search-back-link {
    display: block;
  }
}

@media (min-width: 601px) and (max-width: 1199px) {
  .bmpfaq-category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
