/* Keep ’Em Coming Back — Deploy 5.3 Academy layout and action contrast repair.
   Targeted correction for the Bar mastery feature and the Bar/Kitchen tool bridge actions. */

:root{
  --al53-navy:#10233f;
  --al53-navy-deep:#09172a;
  --al53-rust:#8e2b27;
  --al53-paper:#fffdf9;
  --al53-gold:#f0c96e;
  --al53-cream:#f6ede2;
}

/* Tool-to-book actions: explicit semantic colors prevent legacy variables from
   producing dark red text on a dark navy surface. */
.section-tools-panel .chapter-work-actions a,
.section-tools-panel .chapter-work-actions a:visited{
  background:var(--al53-navy)!important;
  color:#fff!important;
  border:1px solid var(--al53-navy)!important;
  box-shadow:none!important;
}
.section-tools-panel .chapter-work-actions a + a,
.section-tools-panel .chapter-work-actions a + a:visited{
  background:#fff!important;
  color:var(--al53-navy)!important;
  border-color:var(--al53-navy)!important;
}
.section-tools-panel .chapter-work-actions a:hover,
.section-tools-panel .chapter-work-actions a:focus-visible{
  background:var(--al53-rust)!important;
  color:#fff!important;
  border-color:var(--al53-rust)!important;
}
.section-tools-panel .chapter-work-actions a + a:hover,
.section-tools-panel .chapter-work-actions a + a:focus-visible{
  background:#f7efe6!important;
  color:#6f211f!important;
  border-color:var(--al53-rust)!important;
}

/* Academy feature: contain every grid track inside the viewport and make the
   medium-width layout intentionally stack before browser zoom or text scaling
   can push the coverage cards off-screen. */
.bar-academy-feature{
  overflow:hidden!important;
  color:#fff!important;
}
.bar-academy-feature .spx-wrap{
  width:min(1180px,calc(100% - 2rem))!important;
  max-width:calc(100% - 2rem)!important;
  margin-inline:auto!important;
  padding-inline:0!important;
  box-sizing:border-box!important;
}
.bar-academy-feature-head,
.bar-academy-feature-head > *,
.bar-academy-feature-stats,
.bar-academy-feature-stats > div,
.bar-academy-feature-grid,
.bar-academy-feature-grid > a{
  min-width:0!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}
.bar-academy-feature-head{
  grid-template-columns:minmax(0,1.35fr) minmax(320px,.65fr)!important;
  gap:clamp(1.5rem,3vw,3rem)!important;
}
.bar-academy-feature h2,
.bar-academy-feature p{max-width:100%!important}
.bar-academy-feature .spx-kicker{color:var(--al53-gold)!important}
.bar-academy-feature h2{color:#fff!important}
.bar-academy-feature p{color:var(--al53-cream)!important}
.bar-academy-feature-stats{
  width:100%!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
}
.bar-academy-feature-stats > div{
  overflow:hidden!important;
}
.bar-academy-feature-stats strong{
  color:var(--al53-gold)!important;
  overflow-wrap:anywhere!important;
}
.bar-academy-feature-stats span{color:#fff!important}
.bar-academy-feature .spx-button:not(.secondary){
  background:var(--al53-rust)!important;
  color:#fff!important;
  border-color:var(--al53-rust)!important;
}
.bar-academy-feature .spx-button.secondary{
  background:#fff!important;
  color:var(--al53-navy)!important;
  border-color:#fff!important;
}
.bar-academy-feature .spx-button:hover,
.bar-academy-feature .spx-button:focus-visible{
  background:var(--al53-gold)!important;
  color:var(--al53-navy-deep)!important;
  border-color:var(--al53-gold)!important;
}

@media(max-width:1320px){
  .bar-academy-feature-head{
    grid-template-columns:minmax(0,1fr)!important;
    gap:1.75rem!important;
    align-items:start!important;
  }
  .bar-academy-feature-head > div:first-child{max-width:900px!important}
  .bar-academy-feature-stats{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    align-items:stretch!important;
  }
  .bar-academy-feature-stats > div{min-height:104px!important}
}

@media(max-width:980px){
  .bar-academy-feature-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}

@media(max-width:820px){
  .bar-academy-feature-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}

@media(max-width:620px){
  .bar-academy-feature .spx-wrap{
    width:calc(100% - 1.25rem)!important;
    max-width:calc(100% - 1.25rem)!important;
  }
  .bar-academy-feature-grid{grid-template-columns:minmax(0,1fr)!important}
  .bar-academy-feature .spx-actions{display:grid!important;grid-template-columns:1fr!important}
  .bar-academy-feature .spx-actions a{width:100%!important;min-width:0!important}
}

@media(max-width:360px){
  .bar-academy-feature-stats{grid-template-columns:minmax(0,1fr)!important}
}

@media(prefers-reduced-motion:reduce){
  .section-tools-panel .chapter-work-actions a,
  .bar-academy-feature a{transition:none!important;transform:none!important}
}
