/* =========================================================
   STORM — JUNIOR
   -----------------------------------------------------------
   Loads on top of base-web-style.css + storm-programs.css.

   Base does nearly all of it: .spi-section-padded/.spi-container
   for the shell, .spi-section-header(.is-center) for the titles,
   .spi-grid-3 + .ui-card.has-action for the three programs,
   .spi-card-athlete for the athletes (from athletes.json — the
   same card as Pro Staff and Senior), .spi-card-product
   (+ .program-person) for the colleges (from colleges.js),
   .spi-scroll.is-aligned for their carousels, and .btn.default
   for every CTA.

   What is left is the dark commitment band, which is Junior's
   alone, the program tile's artwork, the Colleges CTA pair and
   the college finder's layout.
   ========================================================= */

/* ---------------------------------------------------------
   1. COMMITMENT BAND (.junior-commitment)
   The one dark section on the page. It paints itself with the
   token that MEANS near-black and writes on it with the token
   that means white — it does not redefine either.

   The legacy page used #090D1B, a navy a shade cooler than
   --spi-black. Taking base's token instead keeps the page on
   the system and re-themes with everything else; the visible
   difference is a few points of blue.
--------------------------------------------------------- */
.junior-commitment {
  background: var(--spi-black);
  color: var(--spi-white);
}

/* --spi-text-muted is a dark muted, meant for light grounds, so
   .spi-body would be near-invisible here. The halves' 50/50 split is
   base's .spi-split > *.

   `p.` is load-bearing: the store wraps every CMS page in .std, and
   its `.std p { margin: 1em 0 }` outranks a bare class — the copy
   carried 16px above and below on the live site. */
p.junior-commitment-copy {
  color: rgba(255, 255, 255, 0.86);
  margin: 0;
  font-size: 16px;
}

/* Three stacked stills. The legacy markup set width="25%" on
   each and let them overlap; they read better as a simple
   staggered column that keeps its shape when the split stacks. */
.junior-commitment-art {
  display: flex;
  gap: var(--spi-gap-sm);
  align-items: center;
}

.junior-commitment-art img {
  width: calc((100% - (2 * var(--spi-gap-sm))) / 3);
  height: auto;
  border-radius: var(--spi-radius-sm);
}

/* The middle still sits proud of its neighbours — the only bit of
   the legacy stagger worth keeping. */
.junior-commitment-art img:nth-child(2) {
  transform: translateY(-16px);
}

@media (max-width: 768px) {
  .junior-commitment-art img:nth-child(2) {
    transform: none;
  }
}

/* ---------------------------------------------------------
   2. PROGRAM TILE (.junior-program)
   A base .ui-card.has-action. Base caps a centred card's image
   at 160px, which is right for a product cut-out and far too
   small for a 3:2 program tile that is the card's artwork.
--------------------------------------------------------- */
.junior-program img {
  max-width: 100%;
  border-radius: var(--spi-radius-sm);
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: var(--spi-gray-200);
}

.junior-program .spi-body {
  margin: 8px 0 20px;
}

/* ---------------------------------------------------------
   3. TWO CTAs IN A HEADER
   Colleges is the only section with a pair of buttons; they wrap
   rather than overflowing a narrow screen.
--------------------------------------------------------- */
.junior-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.junior-cta-row .btn {
  margin-top: 0;
}

/* ---------------------------------------------------------
   4. ATHLETE CARDS — now base's .spi-card-athlete
   Youth Staff and Trailblazers use the same card as Pro Staff
   and Senior, which fills its portrait box anchored to the top.
   Nothing left to declare.
--------------------------------------------------------- */

/* ---------------------------------------------------------
   5. COLLEGE FINDER (.junior-college-*)
   Search + three filters over the colleges carousel, as on the
   live page. The controls themselves are base: .spi-input for the
   field and the selects, a .spi-toggle pill for Clear, .spi-eyebrow
   for the labels. What is left is the bar's layout and the card's
   inside — a college card carries team links and a brand/division
   row, which an athlete card does not.
--------------------------------------------------------- */
.junior-college-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* 152px is the narrowest a filter can go and still show its longest
   option — "Women's teams", 91px of text — inside the 18px text inset
   and clear of the arrow. Any narrower and a chosen option is cut off. */
.junior-college-filter {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 152px;
  min-width: 0;
}

.junior-college-filter.is-search {
  flex: 2 1 260px;
}

/* Below 900px the five no longer fit on one line. Search takes its own
   row so the three filters and Clear share the next one, instead of
   one filter wrapping alone and stretching across the bar. */
@media (max-width: 900px) {
  .junior-college-filter.is-search {
    flex-basis: 100%;
  }
}

/* One height for the whole bar. Base gives .spi-input a 44px target
   only on phones and the pill is shorter still; side by side they
   would sit at three different heights. */
.junior-college-filters .spi-input,
.junior-college-clear button {
  min-height: 44px;
}

/* Base styles .spi-input for text fields; it does not draw a select's
   arrow, so the browser's own sat in the padding, flush against the
   pill's right edge. This one is two gradient strokes in the text
   colour token, inset 16px to match the 18px text inset on the left. */
.junior-college-filters select.spi-input {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 40px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--spi-black) 50%),
    linear-gradient(135deg, var(--spi-black) 50%, transparent 50%);
  background-position:
    calc(100% - 21px) 50%,
    calc(100% - 16px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

/* Between ~520px and ~670px the three filters fill a line at their
   152px minimum and Clear drops to the next; the auto margin keeps it
   at the bar's end, under the filters, rather than stranded at the
   start of an otherwise empty line. Sharing a line, it changes nothing. */
.junior-college-clear {
  flex: 0 0 auto;
  margin-left: auto;
}

/* `p.` beats the store's `.std p { margin: 1em 0 }`. */
p.junior-college-count {
  margin: 12px 0 0;
  min-height: 1.5em;
}

/* The card is a column so the brand/division row can sit on its
   foot and line up across the carousel. */
.junior-college {
  display: flex;
  flex-direction: column;
}

/* The column above outranks the [hidden] a filtered-out card gets. */
.junior-college[hidden] {
  display: none;
}

/* The card is not a link, so the lift-on-hover reads as a promise
   the whole card cannot keep. */
.junior-college.program-person:hover {
  transform: none;
}

/* Logos on the card's white, as on the live page. Half the files carry
   their own white square, which on the shared grey frame showed as a
   white box inside a grey one. */
.junior-college .spi-card-product-img {
  background: none;
}

.junior-college .spi-card-product-img img {
  padding: 12px;
}

.junior-college .spi-card-product-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

/* `font: inherit` is load-bearing on the live site: the store theme sets
   `a { font-size: 16px; font-weight: 400 }` on every link, which would
   override the card's name and the 13px team line. */
.junior-college h3 a,
.junior-college-teams a {
  font: inherit;
  color: inherit;
}

.junior-college h3 a {
  text-decoration: none;
}

p.junior-college-teams {
  margin: 0;
}

/* A 13px word is a ~18px target; the padding makes it a usable one
   without changing the line. */
.junior-college-teams a {
  display: inline-block;
  padding: 6px 2px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.junior-college-teams a:hover {
  color: var(--spi-black);
}

/* The store theme strips every focus outline (`:focus { outline: 0 }`),
   so a link with no ring of its own is invisible to a keyboard user.
   Base's ring, as on .spi-input and the athlete cards. */
.junior-college h3 a:focus-visible,
.junior-college-teams a:focus-visible {
  outline: 2px solid var(--spi-accent);
  outline-offset: 2px;
}

.junior-college-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 8px;
  margin-top: auto;
  padding-top: 12px;
}

/* The three brand marks are 110px squares; the width/height set in
   the script hold this 48x48 slot before the file arrives. */
.junior-college-brand {
  height: 48px;
  width: auto;
}
