/* ==========================================================================
   bayan-colleges.css — the "Our Colleges" grid.

   Deliberately minimal: a coloured icon disc, the college name, a corner
   fold. Nothing else. The card is a doorway, not a summary — descriptions
   and department lists belong on the college page, not in a grid the eye
   should be able to scan in one pass.

   Namespaced .bu-* so it cannot collide with the EduSpace template.
   ========================================================================== */

.bu-colleges {
  padding: 100px 0;
  background: var(--theme-bg-light, #f7f3ea);
}

.bu-colleges__head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 44px;
}
.bu-colleges__eyebrow {
  display: inline-block;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--theme-blue, #0066b3);
  margin-bottom: 10px;
}
.bu-colleges__title {
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.2;
  margin: 0;
  color: var(--theme-heading, #33200a);
}

.bu-colleges__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 22px;
}

/* ------------------------------------------------------------ the card --- */
.bu-college {
  --college: #0066b3;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 210px;
  padding: 30px 22px;
  background: #fff;
  border-radius: 14px;
  text-decoration: none;
  overflow: hidden;
  box-shadow: 0 3px 16px rgba(51, 32, 10, 0.07);
  transition:
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

/* The colour wash that rises from the bottom on hover. Transform-driven so
   it composites on the GPU rather than repainting the card. */
.bu-college::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--college);
  transform: translateY(101%);
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

/* The corner fold, drawn with a border trick so it needs no image. */
.bu-college::after {
  content: "";
  position: absolute;
  inset-block-end: 0;
  inset-inline-end: 0;
  width: 0;
  height: 0;
  border-block-end: 46px solid var(--college);
  border-inline-start: 46px solid transparent;
  transition: opacity 0.3s ease;
}

.bu-college:hover,
.bu-college:focus-visible {
  transform: translateY(-8px);
  box-shadow: 0 18px 40px rgba(51, 32, 10, 0.18);
}
.bu-college:hover::before,
.bu-college:focus-visible::before {
  transform: translateY(0);
}
/* The fold has nothing to sit against once the wash has filled the card. */
.bu-college:hover::after,
.bu-college:focus-visible::after {
  opacity: 0;
}
.bu-college:focus-visible {
  outline: 3px solid var(--college);
  outline-offset: 3px;
}

/* Content rides above the wash. */
.bu-college__icon,
.bu-college__name {
  position: relative;
  z-index: 1;
}

.bu-college__icon {
  width: 68px;
  height: 68px;
  flex: 0 0 68px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--college);
  color: #fff;
  font-size: 27px;
  transition:
    background 0.34s ease,
    color 0.34s ease,
    transform 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* Once the card is filled, invert the disc so it stays legible. */
.bu-college:hover .bu-college__icon,
.bu-college:focus-visible .bu-college__icon {
  background: #fff;
  color: var(--college);
  transform: scale(1.1) rotate(-6deg);
}

.bu-college__name {
  font-size: 17px;
  line-height: 1.4;
  font-weight: 700;
  text-align: center;
  margin: 0;
  color: var(--theme-heading, #33200a);
  transition: color 0.28s ease;
}
.bu-college:hover .bu-college__name,
.bu-college:focus-visible .bu-college__name {
  color: #fff;
}

/* Respect a reduced-motion preference: keep the colour change, drop the
   movement. */
@media (prefers-reduced-motion: reduce) {
  .bu-college,
  .bu-college::before,
  .bu-college__icon,
  .bu-college__name {
    transition-duration: 0.01ms;
  }
  .bu-college:hover,
  .bu-college:focus-visible {
    transform: none;
  }
  .bu-college:hover .bu-college__icon,
  .bu-college:focus-visible .bu-college__icon {
    transform: none;
  }
}

@media (max-width: 575px) {
  .bu-colleges { padding: 70px 0; }
  .bu-college { min-height: 180px; }
}

/* ==========================================================================
   Public language switcher.

   Compact by design: this is a three-item menu that sits over the hero, so
   it should read as a small control, not a panel. Rows are a fixed 38px,
   every row is start-aligned regardless of script, and the native name sits
   next to a muted two-letter code so the list scans in one glance.
   Namespaced .bu-lang so it cannot collide with the template.
   ========================================================================== */

.bu-lang {
  position: relative;
  margin-inline-end: 12px;
}

.bu-lang__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(6px);
  color: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}
.bu-lang__btn:hover,
.bu-lang__btn[aria-expanded="true"] {
  border-color: var(--theme-blue, #0066b3);
  background: #fff;
  color: var(--theme-blue, #0066b3);
}
.bu-lang__code { letter-spacing: 0.05em; }
.bu-lang__caret {
  font-size: 10px;
  opacity: 0.65;
  transition: transform 0.2s ease;
}
.bu-lang__btn[aria-expanded="true"] .bu-lang__caret { transform: rotate(180deg); }

/* Contrast is set explicitly rather than inherited.
   Over the hero the header's own colour is a dark brown that disappears
   against sky and pale stone, so the transparent variant-3 header gets white
   content on a dark scrim — legible over any photograph. Once the bar goes
   .sticky it is solid white, and the colours invert. */
.header-section-3 .bu-lang__btn {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(20, 14, 6, 0.34);
}
.header-section-3 .bu-lang__btn:hover,
.header-section-3 .bu-lang__btn[aria-expanded="true"] {
  background: #fff;
  color: var(--theme-blue, #0066b3);
  border-color: #fff;
}

.header-1 .bu-lang__btn,
.header-2 .bu-lang__btn,
.header-section-3 .sticky .bu-lang__btn,
.sticky .bu-lang__btn {
  border-color: rgba(51, 32, 10, 0.2);
  background: transparent;
  color: #33200a;
}
.header-section-3 .sticky .bu-lang__btn:hover,
.sticky .bu-lang__btn:hover,
.sticky .bu-lang__btn[aria-expanded="true"] {
  border-color: var(--theme-blue, #0066b3);
  color: var(--theme-blue, #0066b3);
  background: #fff;
}

.bu-lang__menu {
  position: absolute;
  inset-block-start: calc(100% + 8px);
  inset-inline-end: 0;
  width: 186px;
  margin: 0;
  padding: 5px;
  list-style: none;
  background: #fff;
  border: 1px solid rgba(51, 32, 10, 0.08);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(51, 32, 10, 0.14);
  z-index: 60;
  transform-origin: top right;
  animation: bu-lang-in 0.14s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes bu-lang-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bu-lang__menu { animation: none; }
}

.bu-lang__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: none;
  font-size: 14px;
  color: #33200a;
  cursor: pointer;
  /* Uniform alignment: never inherit the page direction here. */
  text-align: left;
  direction: ltr;
  transition: background 0.13s ease, color 0.13s ease;
}
.bu-lang__item:hover { background: #f5f1e8; }
.bu-lang__item[aria-selected="true"] {
  color: var(--theme-blue, #0066b3);
  font-weight: 600;
}

.bu-lang__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bu-lang__tag {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #a8a096;
  background: #f2ede3;
  border-radius: 4px;
  padding: 2px 5px;
  line-height: 1;
}
.bu-lang__item[aria-selected="true"] .bu-lang__tag {
  color: var(--theme-blue, #0066b3);
  background: rgba(0, 102, 179, 0.1);
}
.bu-lang__tick {
  font-size: 11px;
  color: var(--theme-blue, #0066b3);
}

@media (max-width: 767px) {
  .bu-lang { margin-inline-end: 6px; }
  .bu-lang__btn { padding: 6px 8px; }
  .bu-lang__code { display: none; }
  .bu-lang__menu { width: 172px; }
}
