/**
 * Block style variants for core/details (accordion).
 *
 * Brand-wide default (no class) mirrors Apply Now's .apply-accordion:
 * 1px-bordered box, Museo Sans 20/700 #313132 title, SVG +/- icon.
 * BOV pages opt into the hairline + CSS-toggle look via the
 * is-style-vmi-accordion variant.
 */

/* ------------------------------------------------------------------
 * Default (no .is-style-* class) — brand-wide accordion. Scoped to
 * .entry-content so it doesn't catch unrelated <details> elsewhere.
 * Mirrors sass/pages/apply-now/_accordion.sass.
 * ------------------------------------------------------------------ */
:is(.entry-content, .editor-styles-wrapper) .wp-block-details:where(:not([class*="is-style-"])) {
  border: 1px solid #BCBCBC;
  padding: 24px 32px;
  background-color: transparent;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-details:where(:not([class*="is-style-"])) + .wp-block-details:where(:not([class*="is-style-"])) {
  margin-top: -1px;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-details:where(:not([class*="is-style-"])) > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  gap: 16px;
  cursor: pointer;
  list-style: none;
  font-family: "museo-sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  color: #313132;
  -webkit-font-smoothing: antialiased;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-details:where(:not([class*="is-style-"])) > summary {
  list-style-type: none;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-details:where(:not([class*="is-style-"])) > summary::-webkit-details-marker,
:is(.entry-content, .editor-styles-wrapper) .wp-block-details:where(:not([class*="is-style-"])) > summary::marker {
  display: none;
  content: "";
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-details:where(:not([class*="is-style-"])) > summary::after {
  content: "";
  flex: 0 0 auto;
  width: 15px;
  height: 20px;
  background-image: url('../img/apply/accordion-collapsed.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.3s ease;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-details:where(:not([class*="is-style-"]))[open] > summary::after {
  background-image: url('../img/apply/accordion-expanded.svg');
  height: 21px;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-details:where(:not([class*="is-style-"])) > *:not(summary) {
  padding-top: 32px;
  font-family: "museo-sans", "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.7;
  color: #313132;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-details:where(:not([class*="is-style-"])) > *:not(summary) p {
  margin: 0 0 16px;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-details:where(:not([class*="is-style-"])) > *:not(summary) p:last-child {
  margin-bottom: 0;
}

/* ------------------------------------------------------------------
 * is-style-vmi-accordion — BOV accordion (hairline rule + CSS toggle).
 * Picker label: "BOV accordion (hairline + CSS toggle)".
 * ------------------------------------------------------------------ */
.wp-block-details.is-style-vmi-accordion {
  border-top: 1px solid #BCBCBC;
  padding: 0;
  margin: 0;
}

/* When the accordion immediately follows a section heading, restore
   the 48px breathing room (matching staging) — the generic
   margin: 0 above otherwise beats the BOV section's
   heading-+-sibling spacing by being declared later in cascade. */
.bov-communications-previous__inner > .wp-block-heading + .wp-block-details.is-style-vmi-accordion,
.bov-about-docs__inner > .wp-block-heading + .wp-block-details.is-style-vmi-accordion {
  margin-top: 48px;
}

.wp-block-details.is-style-vmi-accordion + .wp-block-details.is-style-vmi-accordion {
  /* sibling accordions share the rule between them — no double border */
  border-top: 1px solid #BCBCBC;
}

.wp-block-details.is-style-vmi-accordion:last-of-type {
  border-bottom: 1px solid #BCBCBC;
}

.wp-block-details.is-style-vmi-accordion > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0;
  cursor: pointer;
  list-style: none;
  font-family: "museo-sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  color: #4F5872;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.wp-block-details.is-style-vmi-accordion > summary::-webkit-details-marker {
  display: none;
}

.wp-block-details.is-style-vmi-accordion > summary::after {
  content: "";
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  background-image:
    linear-gradient(#4F5872, #4F5872),
    linear-gradient(#4F5872, #4F5872);
  background-size: 16px 2px, 2px 16px;
  background-position: center center, center center;
  background-repeat: no-repeat;
  transition: transform 0.2s ease;
}

.wp-block-details.is-style-vmi-accordion[open] > summary::after {
  background-size: 16px 2px, 2px 0;
}

.wp-block-details.is-style-vmi-accordion > summary:focus-visible {
  outline: 2px solid #ae122a;
  outline-offset: 2px;
}

.wp-block-details.is-style-vmi-accordion > *:not(summary) {
  padding: 0 0 24px;
  font-family: "museo-sans", "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.7;
  color: #313132;
}

/* Lists inside the accordion body keep their conventional bullet
   indent. The rule above zeros padding on every direct child of
   <details> (because wp:html bodies have flat <p>/<ul> sequences),
   so re-supply padding-left for ULs/OLs. */
.wp-block-details.is-style-vmi-accordion > ul,
.wp-block-details.is-style-vmi-accordion > ol {
  padding-left: 24px;
  list-style-position: outside;
}

.wp-block-details.is-style-vmi-accordion > *:not(summary) p {
  margin: 0 0 16px;
}

.wp-block-details.is-style-vmi-accordion > *:not(summary) p:last-child {
  margin-bottom: 0;
}

/* Inside a Recent Meetings white-card panel the accordion summary
   should match the AY year-title rhythm (Trajan 24 / 400 #4F5872)
   instead of the default Museo 18/700 BOV accordion summary. The
   panel itself supplies the card chrome, so the accordion's own
   top rule is also unwanted here. */
.bov-meetings-recent__panel .wp-block-details.is-style-vmi-accordion {
  border-top: 0;
  border-bottom: 0;
}

.bov-meetings-recent__panel .wp-block-details.is-style-vmi-accordion > summary {
  padding: 0;
  font-family: "Trajan Pro", serif;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.2;
  color: #4F5872;
  letter-spacing: 0;
}
