/* === link-list.css — row of numbered link items with a JS-driven "More"
   overflow dropdown for whatever doesn't fit the available width === */

.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 2px;
}

.link-list__item {
  flex: 1 1 0;
  min-width: 0;
  min-height: 84px;
}

.link-list__link {
  display: flex;
  align-items: center;
  gap: var(--sp5);
  height: 100%;
  width: 100%;
  box-sizing: border-box;
  padding: var(--sp5) var(--sp6);
  background: var(--clr-black-50);
  color: var(--clr-white);
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.link-list__item--light .link-list__link {
  background: var(--clr-white);
  color: var(--clr-gray-dark);
  /* Already showing the current section — clicking it again is a no-op
     at best, and disabling it here also sidesteps needing any touch-hover
     handling for a tile that can't be meaningfully interacted with. */
  pointer-events: none;
}

.link-list__link:hover,
.link-list__link:focus-visible,
.link-list__link:active {
  background: var(--clr-primary);
  color: var(--clr-white);
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

.link-list__link:focus-visible {
  outline: 2px solid var(--clr-white);
  outline-offset: -4px;
}

.link-list__number {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border-radius: var(--radius-50);
  background: var(--clr-primary);
  color: var(--clr-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--primary-ff);
  font-weight: var(--fw-light);
  font-size: var(--fs-30);
  line-height: 1;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.link-list__item--light .link-list__number {
  background: var(--clr-yellow-orange);
}

.link-list__link:hover .link-list__number,
.link-list__link:focus-visible .link-list__number,
.link-list__link:active .link-list__number {
  background: var(--clr-yellow-orange);
  transform: scale(1.08);
}

.link-list__label {
  flex: 1;
  min-width: 0;
  font-family: var(--primary-ff);
  font-weight: var(--fw-medium);
  font-size: var(--fs-14);
  line-height: 1.2857;
  text-transform: uppercase;
}

/* js-priority: added by js/link-list.js once initialized; without JS this class never applies and the
   plain wrap/stack breakpoints below are the fallback. */
.link-list.js-priority {
  flex-wrap: nowrap;
  width: 100%;
  justify-content: center;
}

/* Must stay `>` direct-child, not descendant — a descendant selector would also match items after JS
   relocates them into .link-list__more-menu, forcing them back to fixed 230px by specificity. */
.link-list.js-priority > .link-list__item:not(.link-list__more-item) {
  flex: 0 0 auto;
  width: 230px;
}

.link-list__more-item {
  flex: 0 0 auto;
  width: auto;
  height: auto;
  transition: flex-basis 0.2s ease, width 0.2s ease;
}

/* Set by js/link-list(-drupal).js when every item overflowed into the
   dropdown (typically a narrow phone) — otherwise the row would show just
   a small auto-width "More" button floating in otherwise-empty space. */
.link-list__more-item--full {
  flex: 1 1 100%;
  width: 100%;
}

.link-list__more-item--full .link-list__more {
  width: 100%;
}

.link-list__more-item--full .link-list__more-toggle {
  width: 100%;
  justify-content: center;
}

.link-list__more-item--full .link-list__more-toggle:hover,
.link-list__more-item--full .link-list__more-toggle:focus-visible {
  background: var(--clr-black-50);
}

.link-list__more {
  height: 100%;
}

.link-list__more-toggle {
  display: flex;
  align-items: center;
  gap: var(--sp2);
  width: auto;
  height: 84px;
  padding: var(--sp5) var(--sp6);
  background: var(--clr-black-50);
  color: var(--clr-white);
  border: none;
  border-radius: 0;
  font-family: var(--primary-ff);
  font-weight: var(--fw-medium);
  font-size: var(--fs-14);
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease, width 0.2s ease;
}

.link-list__more-toggle:hover,
.link-list__more-toggle:focus-visible {
  background: var(--clr-primary);
  transform: translateY(-3px);
}

.link-list__more-toggle:focus-visible {
  outline: 2px solid var(--clr-white);
  outline-offset: -4px;
}

.link-list__more-toggle svg {
  transition: transform 0.2s ease;
}

.link-list__more-toggle[aria-expanded="true"] {
  background: var(--clr-white);
  color: var(--clr-gray-dark);
}

.link-list__more-item--full .link-list__more-toggle[aria-expanded="true"] {
  background: var(--clr-primary);
  color: var(--clr-white);
}

.link-list__more-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* Must stay position:fixed (top/left set inline by JS via getBoundingClientRect, not CSS-anchored) —
   .hero-banner has overflow:hidden below 1201px, so a CSS-anchored absolute panel would get clipped there. */
.link-list__more-menu {
  list-style: none;
  margin: 0;
  padding: var(--sp2);
  position: fixed;
  z-index: 1000;
  min-width: 280px;
  max-width: min(320px, calc(100vw - (2 * var(--sp6))));
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--clr-white);
  border-radius: var(--radius-xxs);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
}

.link-list__more-menu[hidden] {
  display: none;
}

.link-list__more-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.link-list__more-menu .link-list__item {
  min-height: auto;
  height: auto;
  width: 100%;
  max-width: none;
}

.link-list__more-menu .link-list__item:not(:last-child) {
  border-bottom: 1px solid var(--border-default);
}

.link-list__more-menu .link-list__link {
  padding: var(--sp3) var(--sp4);
  border-radius: var(--radius-xxs);
  background: transparent;
  color: var(--clr-black);
  transition: background-color 0.15s ease, color 0.15s ease;
  transform: none;
  box-shadow: none;
}

.link-list__more-menu .link-list__link:hover,
.link-list__more-menu .link-list__link:focus-visible {
  background: var(--clr-primary);
  color: var(--clr-white);
  transform: none;
  box-shadow: none;
}

.link-list__more-menu .link-list__number {
  width: 36px;
  height: 36px;
  font-size: var(--fs-21);
  background: var(--clr-primary);
  color: var(--clr-white);
  transition: background-color 0.15s ease;
  transform: none;
}

.link-list__more-menu .link-list__link:hover .link-list__number,
.link-list__more-menu .link-list__link:focus-visible .link-list__number {
  background: var(--clr-yellow-orange);
  color: var(--clr-white);
  transform: none;
}

/* Must duplicate .link-list__item--light's main-row styling here: once JS relocates the item into the
   dropdown, the main-row rule (same specificity, earlier in file) no longer wins. */
.link-list__more-menu .link-list__item--light .link-list__link {
  background: var(--clr-white);
  color: var(--clr-gray-dark);
  /* Already showing the current section — clicking it again is a no-op
     at best, and disabling it here also sidesteps needing any touch-hover
     handling for a tile that can't be meaningfully interacted with. */
  pointer-events: none;
}

.link-list__more-menu .link-list__item--light .link-list__number {
  background: var(--clr-yellow-orange);
  color: var(--clr-white);
}

@media only screen and (max-width: 1279px) {
  .link-list:not(.js-priority) {
    flex-wrap: wrap;
  }

  .link-list:not(.js-priority) .link-list__item {
    flex: 1 1 calc(50% - 1px);
  }

  .link-list__number {
    width: 40px;
    height: 40px;
    font-size: var(--fs-24);
  }

  .link-list__label {
    font-size: var(--fs-13);
  }
}

@media only screen and (max-width: 767px) {
  .link-list:not(.js-priority) {
    flex-direction: column;
  }

  .link-list:not(.js-priority) .link-list__item {
    flex: 1 1 auto;
    width: 100%;
    height: auto;
  }

  .link-list__number {
    width: 32px;
    height: 32px;
    font-size: var(--fs-18);
  }

  .link-list__label {
    font-size: var(--fs-12);
  }
}