/* ==========================================================================
   Mainland — Colleges & Schools page styles
   Applies to: node--colleges-and-schools--full.html.twig and its paragraphs
   ========================================================================== */

/* ------------------------------------------------------------------
   0. BREADCRUMB
   ------------------------------------------------------------------ */
body.is-mainland-page .node--type-colleges-and-schools nav[aria-label="breadcrumb"] .container-xxl {
  padding-top: 16px;
  padding-bottom: 16px;
}

body.is-mainland-page .node--type-colleges-and-schools nav[aria-label="breadcrumb"] .breadcrumb {
  margin-bottom: 0;
  padding: 0;
}

/* All breadcrumb items: black regular */
body.is-mainland-page .node--type-colleges-and-schools nav[aria-label="breadcrumb"] .breadcrumb-item,
body.is-mainland-page .node--type-colleges-and-schools nav[aria-label="breadcrumb"] .breadcrumb-item a {
  color: #000;
  font-weight: 400;
}

/* Last breadcrumb item (current page): black bold */
body.is-mainland-page .node--type-colleges-and-schools nav[aria-label="breadcrumb"] .breadcrumb-item:last-child {
  color: #000;
  font-weight: 700;
}

/* Replace SVG arrow separator with "/" */
body.is-mainland-page .node--type-colleges-and-schools nav[aria-label="breadcrumb"] .breadcrumb-item + .breadcrumb-item::before {
  background-image: none;
  content: '/';
  width: auto;
  height: auto;
  padding-right: 8px;
}

/* ------------------------------------------------------------------
   1. ABOUT SECTION
   ------------------------------------------------------------------ */
.ml-colleges-about {
  padding: 60px 0;
}

.ml-colleges-about__heading {
  display: none;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.4;
  word-break: break-word;
  background: linear-gradient(90deg, #DF7433 0%, #DA562B 31.87%, #CC103C 73.65%, #9F0D43 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.ml-colleges-about__body {
  color: #333;
  font-size: 1.25rem;
  line-height: 1.8;
}

@media (max-width: 767.98px) {
  .ml-colleges-about {
    padding: 40px 0;
  }
  .ml-colleges-about__heading {
    font-size: 1.5rem;
    margin-bottom: 24px;
  }
}

/* ------------------------------------------------------------------
   2. DEPARTMENT CARDS SECTION
   ------------------------------------------------------------------ */
.ml-colleges-dept {
  padding: 20px 0 80px 0;
  overflow: hidden;
}

.ml-colleges-dept__title {
  font-size: 36px;
  font-weight: 700;
  color: #000;
  margin-bottom: 40px;
}

/* Hide title when there is only one department slide */
.ml-colleges-dept:has(.swiper-wrapper > .swiper-slide:only-child) .ml-colleges-dept__title {
  display: none;
}

.ml-colleges-dept__swiper-wrap {
  position: relative;
}

.ml-colleges-dept__swiper {
  overflow: visible;
}

/* Equal-height slides */
.ml-colleges-dept__swiper .swiper-wrapper {
  align-items: stretch;
}

.ml-colleges-dept__swiper .swiper-slide {
  height: auto;
  display: flex;
  flex-direction: column;
}

.ml-colleges-dept__swiper .swiper-slide > * {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Controls row: pagination (left) | arrows (center) | spacer (right) */
.ml-colleges-dept__controls {
  display: flex;
  align-items: center;
  margin-top: 1.5rem;
}

.ml-colleges-dept__controls::after {
  content: '';
  flex: 1;
}

@media (max-width: 575.98px) {
  .ml-colleges-dept__controls {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }
  .ml-colleges-dept__controls::after {
    display: none;
  }
}

/* Pagination dots */
.ml-colleges-dept__pagination {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: static;
  width: auto;
}

@media (max-width: 575.98px) {
  .ml-colleges-dept__pagination {
    flex: none;
    justify-content: center;
    padding-bottom: 10px;
  }
}

.ml-colleges-dept__pagination .swiper-pagination-bullet {
  width: 10px;
  height: 10px;
  background: transparent;
  border: 1px solid #D64130;
  opacity: 1;
  transition: background 0.2s;
}

.ml-colleges-dept__pagination .swiper-pagination-bullet-active {
  background: #D64130;
}

/* Nav row */
.ml-colleges-dept__nav-row {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Arrows — static, circle style (replaces the absolute-positioned ones) */
.ml-colleges-dept__swiper-prev,
.ml-colleges-dept__swiper-next {
  position: static;
  top: auto;
  bottom: auto;
  margin-top: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #ccc;
  background: #fff;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s;
}

.ml-colleges-dept__swiper-prev::after,
.ml-colleges-dept__swiper-next::after {
  font-size: 0;
  background-image: none;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  content: '';
  width: 9px;
  height: 9px;
  border-top: 2px solid #000;
  border-right: 2px solid #000;
  margin: 0;
}

.ml-colleges-dept__swiper-prev::after {
  transform: rotate(-135deg) translate(-1px, 1px);
}

.ml-colleges-dept__swiper-next::after {
  transform: rotate(45deg) translate(-1px, 1px);
}

.ml-colleges-dept__swiper-prev:hover,
.ml-colleges-dept__swiper-next:hover {
  border-color: #888;
}

.ml-colleges-dept__swiper-prev.swiper-button-disabled,
.ml-colleges-dept__swiper-next.swiper-button-disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

/* Hide nav row when both arrows are disabled (all slides visible) */
.ml-colleges-dept__nav-row:has(.ml-colleges-dept__swiper-prev.swiper-button-disabled):has(.ml-colleges-dept__swiper-next.swiper-button-disabled) {
  display: none;
}

/* --- Department card --- */
.dept-card {
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: 0px 4px 8px 0px #00000026;
  position: relative;
  cursor: pointer;
  min-height: 300px;
  aspect-ratio: 402 / 487;

  @media (min-width: 992px) {
    min-height: 400px;
  }
}

/* Gradient bottom border via pseudo-element */
.dept-card::after {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, #DF7433 0%, #DA562B 50%, #CC103C 100%);
  flex-shrink: 0;
}

.dept-card__image {
  overflow: hidden;
  aspect-ratio: 410 / 310;
  line-height: 0;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 25px));
}

.dept-card__image .media--type-image {
  height: 100%;
}

.dept-card__image .field,
.dept-card__image .field__items,
.dept-card__image .field__item,
.dept-card__image figure {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

.dept-card__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.dept-card:hover .dept-card__image img {
  transform: scale(1.08);
}

.dept-card__body {
  padding: 16px 24px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.dept-card__title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #000;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.dept-card__text {
  font-size: 0.9rem;
  color: #3D3D3D;
  line-height: 1.6;
  flex: 1;
}

.dept-card__link {
  margin-top: auto;
  padding-top: 14px;
}

.dept-card__link a {
  color: #DA562B;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dept-card__link a::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

.dept-card__link a::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  background: url('../image/icon/alink-external-link-orange.svg') center center / contain no-repeat;
  flex-shrink: 0;
}

@media (max-width: 767.98px) {
  .ml-colleges-dept {
  }
  .ml-colleges-dept__swiper-wrap {
    padding: 0 20px;
  }
}

/* ------------------------------------------------------------------
   3. SPOTLIGHT SECTION
   ------------------------------------------------------------------ */
.ml-colleges-spotlight-section {
  /* Outer section wrapper if needed */
}

.ml-spotlight {
  position: relative;
  min-height: 440px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.ml-spotlight::before {
  content: '';
  position: absolute;
  left: 0;
  top: 100px;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #FFBCA2 15.42%, #ffd5a200 84.17%);

  z-index: 0;
}

@media (max-width: 991.98px) {
  .ml-colleges-progs__sidebar {
    position: sticky;
    top: 160px !important;
  }
}

.ml-spotlight__image-col {
  position: absolute;
  left: 0;
  top: 0;
  width: 56%;
  height: 100%;
  overflow: hidden;
}

.ml-spotlight__image-col .field,
.ml-spotlight__image-col .field__items,
.ml-spotlight__image-col .field__item,
.ml-spotlight__image-col figure {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

.ml-spotlight__image-col img {
  display: block;
  width: 1500px;
  height: 100%;
  margin-left: auto;
  object-fit: cover;
  object-position: center;
  clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%);
}

.ml-spotlight__container {
  position: relative;
  z-index: 2;
  width: 100%;
  padding-top: 250px;
  padding-bottom: 100px;
}

.ml-spotlight__card {
  background: rgba(255, 255, 255, 0.96);
  padding: 40px 36px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
  border-bottom: 5px solid;
  border-image: linear-gradient(to right, #DF7433, #DA562B, #CC103C) 1;
}

.ml-spotlight__text {
  font-size: 0.95rem;
  line-height: 1.85;
  color: #333;
  margin-bottom: 28px;
  max-height: 15rem;
  overflow-y: auto;
  padding-right: 0.7rem;
  scrollbar-width: thin;
  scrollbar-color: #aaa transparent;
}

.ml-spotlight__text::-webkit-scrollbar {
  width: 4px;
}

.ml-spotlight__text::-webkit-scrollbar-track {
  background: transparent;
}

.ml-spotlight__text::-webkit-scrollbar-thumb {
  background: #aaa;
  border-radius: 4px;
}

.ml-spotlight__text p {
  margin-bottom: 0.75em;
}

.ml-spotlight__cta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.ml-spotlight__btn {
  display: inline-flex;
  align-items: center;
  min-width: 150px;
  padding: 9px 30px;
  border-radius: 100px;
  font-size: 18px;
  font-weight: 400;
  line-height: normal;
  text-align: center;
  text-decoration: none;
  transition: color 0.2s ease;
}

.ml-spotlight__btn--hollow {
  border: 1px solid transparent;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(90deg, #DF7433 0%, #DA562B 31.87%, #CC103C 73.65%, #9F0D43 100%) border-box;
  color: #DA562B !important;
  transition: none;
}

.ml-spotlight__btn--hollow::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 12px;
  margin-left: 10px;
  background: url('../image/icon/apply-btn-after-arrow-orange.svg') center center / contain no-repeat;
  vertical-align: middle;
}

.ml-spotlight__btn--hollow:hover {
  background: #DA562B !important;
  border-color: #DA562B !important;
  color: #fff !important;
  text-decoration: none;
}

.ml-spotlight__btn--hollow:hover::after {
  background: url('../image/icon/apply-btn-after-arrow.svg') center center / contain no-repeat;
}

.ml-spotlight__btn--filled {
  background: linear-gradient(90deg, #DF7433 0%, #DA562B 31.87%, #CC103C 73.65%, #9F0D43 100%);
  color: #fff !important;
}

.ml-spotlight__btn--filled:hover {
  background: #9F0D43 !important;
  color: #fff !important;
  text-decoration: none;
}

.ml-spotlight__btn--filled::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 12px;
  margin-left: 10px;
  background: url('../image/icon/apply-btn-after-arrow.svg') center center / contain no-repeat;
  vertical-align: middle;
}

@media (max-width: 767.98px) {
  .ml-spotlight {
    min-height: auto;
    flex-direction: column;
    align-items: stretch;
  }

  .ml-spotlight__image-col {
    position: static;
    width: 100%;
    height: 360px;
  }

  .ml-spotlight__container {
    padding-top: 30px;
    padding-bottom: 30px;
    margin-top: -120px;
    max-width: 600px;
  }

  .ml-spotlight__card {
    padding: 28px 20px;
    box-shadow: none;
    border-top: 4px solid #DA562B;
  }
}

@media (max-width: 575.98px) {
  .ml-spotlight__image-col {
    width: 100%;
  }

  .ml-spotlight__container {
    padding-top: 30px;
    padding-bottom: 30px;
    margin-top: -150px;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .ml-spotlight__image-col {
    width: 70%;
  }
}

/* ------------------------------------------------------------------
   4. PROGRAMME INTRODUCTION SECTION
   ------------------------------------------------------------------ */
.ml-colleges-progs {
  padding: 80px 0;
  background: #fff;
  /* Prevent scroll-anchor from auto-adjusting the page scroll when programme
     cards are shown/hidden by the department filter. Any scroll correction is
     handled explicitly in custom_mainland_colleges.js. */
  overflow-anchor: none;
}

/* Sidebar */
.ml-colleges-progs__sidebar {
  padding-right: 20px;
  position: sticky;
  top: 180px;
  align-self: flex-start;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.ml-colleges-progs__sidebar-heading {
  font-size: 1.75rem !important;
  font-weight: 700;
  margin-bottom: 24px;
  background: linear-gradient(90deg, #DF7433 0%, #DA562B 31.87%, #CC103C 73.65%, #9F0D43 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.ml-dept-nav {
  margin: 0;
  padding: 0;
  list-style: none;
}


.ml-dept-nav__item {
  padding: 12px 0;
  cursor: pointer;
  font-family: "Microsoft JhengHei", sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  color: #000;
  transition: color 0.15s;
  display: flex;
  align-items: center;
}

/* Dim non-hovered, non-active items when nav is hovered */

.ml-dept-nav:hover .ml-dept-nav__item:not(:hover):not(.active) {
  opacity: 0.5;
}


/* Remove color change on hover, keep only dimming effect above */


.ml-dept-nav__item.active {
  color: #DA562B;
  font-weight: 700;
  position: relative;
}

/* Prefix orange arrow icon for active item */
.ml-dept-nav__item.active::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  background: url('../image/icon/apply-btn-after-arrow-orange.svg') center center / contain no-repeat;
  vertical-align: middle;
}


/* Remove .ml-dept-nav__arrow, now handled by ::before on active item */

/* Programme list */
.ml-colleges-progs__list {
  padding-left: 30px;
  border-left: 1px solid #eee;
  /* Prevent the browser using this container as a scroll-anchor target;
     avoids unwanted scroll jumps when cards are shown/hidden by the filter. */
  overflow-anchor: none;
}

.ml-prog-card {
  position: relative;
  background: #F9F9F9;
  overflow-anchor: none;
  border-right: 5px solid;
  border-bottom: 5px solid;
  border-image: linear-gradient(to bottom, #DF7433, #DA562B, #CC103C) 1;
  overflow: hidden;
  box-sizing: border-box;
  margin-bottom: 20px;
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
}

.ml-prog-card:hover {
  box-shadow: 0px 4px 8px 0px #00000026;
}

.ml-prog-card__link {
  display: flex;
  padding: 24px 28px;
  text-decoration: none;
  color: inherit;
  align-items: flex-start;
  gap: 16px;
}

.ml-prog-card__link:focus-visible {
  outline: 2px solid #DA562B;
  outline-offset: -2px;
}

.ml-prog-card__inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.ml-prog-card__body {
  flex: 1;
  min-width: 0;
}

.ml-prog-card__title {
  font-size: 28px;
  font-weight: 700;
  color: #DA562B;
  margin-bottom: 10px;
  line-height: 1.4;
}

.ml-prog-card__subtitle {
  font-size: 1.6rem;
  color: #DA562B;
  font-weight: 400;
  line-height: 1.5;
  margin: 0px 0 20px;
}

.ml-prog-card__desc {
  font-size: 1.1rem;
  color: #000;
  font-weight: bold;
  line-height: 1.7;
  white-space: pre-line;
}

.ml-prog-card__meta {
  font-size: 0.875rem;
  color: #000;
  margin: 4px 0 0;
  line-height: 1.5;
}

.ml-prog-card__meta-label {
  font-weight: 700;
  color: #000;
  margin-right: 4px;
}

.ml-prog-card__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 6px;
  background: url('../image/icon/alink-external-link-orange.svg') center / contain no-repeat;
}

@media (max-width: 991.98px) {
  .ml-colleges-progs {
    padding: 60px 0 60px;
  }
}

@media (max-width: 767.98px) {
  .ml-colleges-progs {
    padding: 40px 0 40px;
  }

  .ml-colleges-progs__sidebar {
    position: sticky;
    top: 75px !important;
    padding-top: 12px;
    z-index: 100;
    background: #fff;
    border-right: none;
    border-bottom: 1px solid #eee;
    padding-right: 0;
    margin-bottom: 28px;
    padding-bottom: 10px;
    max-height: none;
    overflow-y: visible;
  }

  .ml-colleges-progs__list {
    padding-left: 15px;
  }

  .ml-dept-nav__item {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-right: 20px;
    border-bottom: none;
    padding: 12px 0;
    font-size: 1rem;
  }

  .ml-dept-nav__item.active::before {
    margin-right: 4px;
  }
}
