/* Button-only paragraphs share a horizontal row and wrap on small screens. */
.text-formatted p:has(> a.btn):not(:has(> :not(a.btn))) {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-inline-end: 0.75rem;
  vertical-align: top;
}

/* Opt-in rich text alignment, configured under Styling settings. */
.paragraph--type--bp-simple.bp-vertical-align-middle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  margin-top: 0 !important;
}
.paragraph--type--bp-simple.bp-vertical-align-middle > .container {
  width: 100%;
}

/* Reusable boxed rich-text lists, e.g. academy group schedules. */
.text-formatted ul.ev3-box-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  list-style: none;
  margin: 24px 0;
  padding: 0;
}
.text-formatted ul.ev3-box-list > li {
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(36, 41, 80, 0.1);
  border-radius: 8px;
  background: var(--gray-200, #e5e4ed);
  font-size: 16px;
  line-height: 1.5;
}
.text-formatted ul.ev3-box-list > li::before {
  content: none;
}
.text-formatted ul.ev3-box-list > li p {
  margin: 0;
}
.text-formatted ul.ev3-box-list > li p + p:has(em) {
  margin-top: 4px;
}
@media (max-width: 639px) {
  .text-formatted ul.ev3-box-list {
    grid-template-columns: 1fr;
  }
}

/* Evolution spacing and centred controls for regular BR Slick sliders. */
.paragraph--type--bp-slick.slick-items-padding .slick__slide {
  padding-left: 24px;
}
.paragraph--type--bp-slick[class*="paragraph--view-mode--br-slick-"] .slick {
  position: relative;
}
.paragraph--type--bp-slick[class*="paragraph--view-mode--br-slick-"] nav.slick__arrow {
  position: absolute;
  top: var(--ev3-slick-arrow-y, 50%) !important;
  bottom: auto;
  left: 0;
  right: 0;
  width: 100%;
  height: 0;
  margin: 0;
  transform: none;
  pointer-events: none;
}
.paragraph--type--bp-slick[class*="paragraph--view-mode--br-slick-"] nav.slick__arrow button {
  position: absolute;
  top: 0 !important;
  margin: 0;
  transform: translateY(-50%);
  pointer-events: auto;
}
.paragraph--type--bp-slick[class*="paragraph--view-mode--br-slick-"] nav.slick__arrow .slick-prev {
  left: 0;
  right: auto;
}
.paragraph--type--bp-slick[class*="paragraph--view-mode--br-slick-"] nav.slick__arrow .slick-next {
  left: auto;
  right: 0;
}

/* Single-item image carousels inside columns: controls overlay the image. */
:is(.paragraph--type--bp-columns, .paragraph--type--bp-columns-two-uneven, .paragraph--type--bp-columns-three-uneven) .paragraph--view-mode--br-slick-1-item .slick {
  position: relative;
}
:is(.paragraph--type--bp-columns, .paragraph--type--bp-columns-two-uneven, .paragraph--type--bp-columns-three-uneven) .paragraph--view-mode--br-slick-1-item .slick__slider {
  padding-bottom: 40px;
  margin-bottom: 0 !important;
}
:is(.paragraph--type--bp-columns, .paragraph--type--bp-columns-two-uneven, .paragraph--type--bp-columns-three-uneven) .paragraph--view-mode--br-slick-1-item .paragraph--type--bp-image {
  margin-top: 0 !important;
}
:is(.paragraph--type--bp-columns, .paragraph--type--bp-columns-two-uneven, .paragraph--type--bp-columns-three-uneven) .paragraph--view-mode--br-slick-1-item .slick-dots {
  position: absolute !important;
  top: auto !important;
  bottom: 0 !important;
  height: 24px;
  margin: 0;
}
:is(.paragraph--type--bp-columns, .paragraph--type--bp-columns-two-uneven, .paragraph--type--bp-columns-three-uneven) .paragraph--view-mode--br-slick-1-item nav.slick__arrow {
  position: absolute;
  top: var(--ev3-slick-arrow-y, calc((100% - 40px) / 2)) !important;
  left: 0;
  right: 0;
  height: 44px;
  margin: 0;
  transform: translateY(-50%);
  pointer-events: none;
}
:is(.paragraph--type--bp-columns, .paragraph--type--bp-columns-two-uneven, .paragraph--type--bp-columns-three-uneven) .paragraph--view-mode--br-slick-1-item nav.slick__arrow button {
  position: absolute;
  top: 0 !important;
  width: 44px;
  height: 44px;
  margin: 0;
  transform: none;
  opacity: 1;
  border: 0;
  border-radius: 50%;
  pointer-events: auto;
}
:is(.paragraph--type--bp-columns, .paragraph--type--bp-columns-two-uneven, .paragraph--type--bp-columns-three-uneven) .paragraph--view-mode--br-slick-1-item nav.slick__arrow .slick-prev {
  left: 16px !important;
  right: auto;
  background: var(--accent-4, #e2e5f7) !important;
}
:is(.paragraph--type--bp-columns, .paragraph--type--bp-columns-two-uneven, .paragraph--type--bp-columns-three-uneven) .paragraph--view-mode--br-slick-1-item nav.slick__arrow .slick-next {
  right: 16px !important;
  left: auto;
  background: var(--accent-3, #4c57b5) !important;
}

.paragraph--type--bp-simple.bp-vertical-align-middle .field--name-bp-text > :first-child {
  margin-top: 0;
}
.paragraph--type--bp-simple.bp-vertical-align-middle .field--name-bp-text > :last-child {
  margin-bottom: 0;
}
:is(.paragraph--type--bp-columns, .paragraph--type--bp-columns-two-uneven, .paragraph--type--bp-columns-three-uneven) .paragraph--view-mode--br-slick-1-item {
  margin-top: 0 !important;
}

/* Eyebrows match the small, tracked labels in the source design. */
.text-formatted p.subhead1 {
  color: var(--primary) !important;
  font-family: var(--font-family-body, var(--font-family-sans-serif, sans-serif));
  font-size: 0.75rem !important;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin: 0 0 1rem;
  padding: 0;
}
.bg-primary-dark .text-formatted p.subhead1 {
  color: var(--primary-dark-text, #fff) !important;
}

/* Reusable rich-text labels use each school's primary brand color. */
.text-formatted .ev3-text-label {
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.text-formatted p.ev3-text-label {
  margin: 0 0 4px;
}
.text-formatted p.ev3-text-label + p {
  margin-top: 0;
}

/* Academic card metadata and copy retain the source design's muted tones. */
.paragraph--type--bp-card p.ev3-card-meta {
  /* Not inherited: the text sits inside the card's link, which is link-colored. */
  color: var(--text, #000);
  opacity: 0.6;
  font-size: 0.875rem;
  font-weight: 300;
  line-height: 1.5;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.paragraph--type--bp-card p.ev3-card-description {
  /* Not inherited: the text sits inside the card's link, which is link-colored. */
  color: var(--text, #000);
  opacity: 0.75;
  font-size: 0.875rem;
  font-weight: 300;
  line-height: 1.625;
}
.paragraph--type--bp-card p.ev3-card-label {
  /* Not inherited: the text sits inside the card's link, which is link-colored. */
  color: var(--text, #000);
  opacity: 1;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.625;
}

/* Banner copy occupies full rows; button-only paragraphs share the next row.
 * Image banners otherwise inherit a grid with one row per paragraph. */
:is(.paragraph--type--bp-image-banner, .paragraph--type--bp-video) .text-formatted:has(> p > a.btn) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.75rem;
}
:is(.paragraph--type--bp-image-banner, .paragraph--type--bp-video) .text-formatted:has(> p > a.btn) > * {
  flex: 0 0 100%;
}
:is(.paragraph--type--bp-image-banner, .paragraph--type--bp-video) .text-formatted > p:has(> a.btn):not(:has(> :not(a.btn))) {
  flex: 0 1 auto;
  margin-inline-end: 0;
}

/* Card copy must contrast with dark sections, including muted paragraphs. */
.bg-primary-dark .paragraph--type--bp-card .card-text {
  color: var(--primary-dark-text, #fff);
}

/* Editable history tables display milestones vertically with a year column. */
.text-formatted table.ev3-history-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  background: transparent;
}
.text-formatted table.ev3-history-table :is(th, td) {
  border: 0;
  border-bottom: 1px solid var(--gray-300, #d8d8d8);
  padding: 32px 0;
  vertical-align: top;
  background: transparent;
}
.text-formatted table.ev3-history-table th {
  width: 23%;
  padding-right: 24px;
  color: var(--primary);
  font-family: var(--font-family-headings, var(--font-family-serif, serif));
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.4;
}
.text-formatted table.ev3-history-table td p:first-child {
  font-family: var(--font-family-headings, var(--font-family-serif, serif));
  font-size: 1.5rem;
  line-height: 1.4;
  margin-bottom: 12px;
}
.text-formatted table.ev3-history-table td p:first-child strong {
  font-weight: 400;
}
.text-formatted table.ev3-history-table td p:last-child {
  margin-bottom: 0;
}
@media (max-width: 575px) {
  .text-formatted table.ev3-history-table th {
    width: 25%;
    font-size: 1.5rem;
    padding-right: 16px;
  }
  .text-formatted table.ev3-history-table td p:first-child {
    font-size: 1.25rem;
  }
}

/* Academic stage cards: title size and the filled pill button
 * follow the source design (24px serif title, small uppercase white label). */
.paragraph--type--bp-card:has(p.ev3-card-description) h3 {
  font-size: 1.5rem !important;
  line-height: 1.3 !important;
}
.paragraph--type--bp-card:has(p.ev3-card-description) :is(.card-links-container .btn, .card-text a.btn) {
  padding: 0.625rem 1.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  /* The accent-1 text color is dark in some palettes; the design uses white. */
  color: #fff;
}

/* Card copy: same size as ev3-card-description, in gray. */
.paragraph--type--bp-card p.ev3-card-text-muted {
  color: var(--text, #000);
  opacity: 0.75;
  font-size: 0.875rem;
  font-weight: 300;
  line-height: 1.625;
}

/* The white button keeps a readable (brand) label color. */
.paragraph--type--bp-card:has(p.ev3-card-description) .card-text a.btn.btn-white {
  color: var(--primary-dark, #9c192f);
}
.paragraph--type--bp-card .card-text a.btn {
  display: inline-block;
  margin-top: 1rem;
}

/* Card list items take the card text color (not the card link's color). */
.paragraph--type--bp-card .card-text li {
  color: var(--text, #000);
}

/* Dark sections: light card text. The text sits inside the card's link, so
 * it would otherwise take the link color or the dark theme text color. */
.bg-primary-dark .paragraph--type--bp-card :is(h3, li, .subhead1),
.bg-primary-dark .paragraph--type--bp-card p,
.bg-primary-dark .paragraph--type--bp-card p:is(.ev3-card-meta, .ev3-card-label, .ev3-card-description, .ev3-card-text-muted) {
  color: var(--primary-dark-text, #fff);
}

/* Lists inside cards stay left aligned even in centered cards. */
.paragraph--type--bp-card :is(.card-text, .text-formatted) :is(ul, ol) {
  text-align: left;
}

/* Card lists match the card copy: same size and weight, markers outside. */
.paragraph--type--bp-card .card-text :is(ul, ol) {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  list-style-position: outside;
}
.paragraph--type--bp-card .card-text li {
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  font-weight: 300;
  line-height: 1.625;
  opacity: 0.75;
}

/* Heading underline (theme setting "Heading underline"): a short accent rule
   below the H2 of component introductions. CTA components are not affected. */
.ev3-heading-rule .component-intro h2::after {
  content: "";
  display: block;
  width: 5rem;
  height: 3px;
  margin: 1.25rem 0 1.5rem;
  background-color: var(--ev3-heading-rule-color, var(--accent-1));
}
.ev3-heading-rule .component-intro.text-center h2::after,
.ev3-heading-rule .text-align-center .component-intro h2::after {
  margin-left: auto;
  margin-right: auto;
}

/* Heading underline also applies to the H2 of rich text components (not
   inside accordions, cards or popups, and not when an explicit <hr> follows). */
.ev3-heading-rule .paragraph--type--bp-simple .text-formatted > h2:not(:has(+ hr))::after {
  content: "";
  display: block;
  width: 5rem;
  height: 3px;
  margin: 1.25rem 0 1.5rem;
  background-color: var(--ev3-heading-rule-color, var(--accent-1));
}
.ev3-heading-rule :is(.paragraph--type--bp-accordion, .paragraph--type--bp-card, .paragraph--type--bp-adv-modal, .paragraph--type--bp-slick) .text-formatted:not(.field--name-field-component-introduction) > h2::after {
  content: none;
}
.ev3-heading-rule .text-align-center .text-formatted > h2::after {
  margin-left: auto;
  margin-right: auto;
}

/* Dark backgrounds: the underline turns light. */
.ev3-heading-rule :is(.bg-primary, .bg-primary-dark, .bg-secondary-dark, .bg-accent-1) :is(.component-intro, .text-formatted) > h2::after {
  background-color: #fff !important;
}

/* The underline follows the heading alignment (higher specificity than the
   base rules above, which would otherwise keep it left). */
.ev3-heading-rule :is(.text-align-center, .text-center) :is(.component-intro, .text-formatted) > h2::after,
.ev3-heading-rule .paragraph--type--bp-simple:is(.text-align-center, .text-center) .text-formatted > h2:not(:has(+ hr))::after {
  margin-left: auto;
  margin-right: auto;
}
.ev3-heading-rule :is(.text-align-right, .text-right) :is(.component-intro, .text-formatted) > h2::after,
.ev3-heading-rule .paragraph--type--bp-simple:is(.text-align-right, .text-right) .text-formatted > h2:not(:has(+ hr))::after {
  margin-left: auto;
  margin-right: 0;
}

/* Heading underline color (theme setting "Heading underline color"). */
.ev3-heading-rule { --ev3-heading-rule-color: var(--accent-1); }
.ev3-heading-rule--primary { --ev3-heading-rule-color: var(--primary); }
.ev3-heading-rule--primary-dark { --ev3-heading-rule-color: var(--primary-dark); }
.ev3-heading-rule--secondary { --ev3-heading-rule-color: var(--secondary); }
.ev3-heading-rule--secondary-dark { --ev3-heading-rule-color: var(--secondary-dark); }
.ev3-heading-rule--accent-1 { --ev3-heading-rule-color: var(--accent-1); }
.ev3-heading-rule--accent-2 { --ev3-heading-rule-color: var(--accent-2); }
.ev3-heading-rule--accent-3 { --ev3-heading-rule-color: var(--accent-3); }
.ev3-heading-rule--accent-4 { --ev3-heading-rule-color: var(--accent-4); }

/* Fee tables in rich text (class set by the importer, for example the
   academies' costs): label left, value right and bold, thin row rules. */
table.ev3-fees-table {
  width: 100%;
  max-width: 36rem;
  margin: 0 0 1.25rem;
  border-collapse: collapse;
  font-size: 1rem;
}
table.ev3-fees-table td,
table.ev3-fees-table th {
  padding: 0.5rem 0;
  border: 0;
  text-align: left;
  vertical-align: baseline;
}
table.ev3-fees-table tr:has(> td) {
  border-bottom: 1px solid color-mix(in srgb, var(--text, #181d37) 10%, transparent);
}
table.ev3-fees-table td:first-child {
  padding-right: 1.5rem;
  opacity: 0.7;
}
table.ev3-fees-table td:last-child:not(:first-child) {
  text-align: right;
  font-weight: 600;
}
table.ev3-fees-table th {
  padding-top: 0.75rem;
  font-weight: 600;
}

/* Accordions without their own white box: the panel takes the page background
   (class set by the importer, for example on the academies pages). */
.ev3-accordion-flat :is(.card, .panel, .card-wrapper, .card-block, .panel-collapse) {
  background: transparent;
}
