/* =========================================================
   Homepage (index.php). Uses the site fonts from the header
   (Raleway headings, Roboto body) so no extra font downloads.
   ========================================================= */
:root {
  --hm-navy: #002a5c;
  --hm-navy-2: #0b4a8f;
  --hm-deep: #001327;
  --hm-gold: #d4a017;
  --hm-gold-soft: #e4cd94;
  --hm-bg: #f6f7f9;
  --hm-ink: #1e2126;
  --hm-soft: #52585f;
  --hm-line: #e5e7eb;
}

.home { background: var(--hm-bg); }

/* ---------- Shared section heading ---------- */
.hm-head { text-align: center; margin-bottom: 36px; }
.hm-head .hm-kicker { display: inline-block; font-size: .78rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #8a6200; margin-bottom: 8px; }
.hm-head h2 { color: var(--hm-navy); font-size: clamp(1.6rem, 2.6vw, 2.1rem); font-weight: 700; margin: 0; }
.hm-head h2::after { content: ""; display: block; width: 52px; height: 3px; margin: 14px auto 0; background: var(--hm-gold); border-radius: 2px; }
.hm-head p { max-width: 640px; margin: 14px auto 0; color: var(--hm-soft); font-size: 1rem; line-height: 1.7; }
.hm-block { padding: 80px 0; }
.hm-block.is-white { background: #fff; }

/* ---------- Buttons ---------- */
.btn-ukm-gold,
.btn-ukm-outline,
.btn-ukm-navy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: .92rem;
  padding: 12px 26px;
  border-radius: 999px;
  text-decoration: none;
  transition: transform .18s ease, background-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.btn-ukm-gold { background: var(--hm-gold); color: var(--hm-deep); }
.btn-ukm-gold:hover { background: var(--hm-gold-soft); color: var(--hm-deep); transform: translateY(-2px); }
.btn-ukm-outline { border: 1.5px solid rgba(255, 255, 255, .75); color: #fff; }
.btn-ukm-outline:hover { background: rgba(255, 255, 255, .12); color: #fff; transform: translateY(-2px); }
.btn-ukm-navy { background: var(--hm-navy); color: #fff; }
.btn-ukm-navy:hover { background: var(--hm-deep); color: #fff; transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0, 20, 50, .2); }

/* ---------- Hero ---------- */
#hero.hero.section { position: relative; padding: 0; overflow: visible; background: transparent; }
#hero-carousel { min-height: 0; height: clamp(420px, 68vh, 680px); }
#hero-carousel .carousel-item img.slider-image {
  height: clamp(420px, 68vh, 680px);
  min-height: 0;
  width: 100%;
  object-fit: cover;
  object-position: center;
}
#hero-carousel .carousel-item::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(0, 19, 39, .35) 0%, rgba(0, 19, 39, 0) 50%);
}
#hero-carousel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to top, rgba(0, 19, 39, .45) 0%, rgba(0, 19, 39, 0) 30%);
}
#hero-carousel .carousel-control-prev,
#hero-carousel .carousel-control-next { width: 6%; z-index: 3; opacity: 0; transition: opacity .25s ease; }
#hero-carousel:hover .carousel-control-prev,
#hero-carousel:hover .carousel-control-next { opacity: 1; }
#hero-carousel .carousel-control-prev-icon,
#hero-carousel .carousel-control-next-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(0, 42, 92, .6);
  background-image: none;
}
#hero-carousel .carousel-control-prev-icon.bi::before,
#hero-carousel .carousel-control-next-icon.bi::before { font-size: 1.15rem; line-height: 1; }
#hero-carousel .carousel-indicators { z-index: 3; bottom: 62px; }
#hero-carousel .carousel-indicators [data-bs-target] { background-color: var(--hm-gold); opacity: .5; width: 9px; height: 9px; border-radius: 50%; margin: 0 5px; border: 0; }
#hero-carousel .carousel-indicators .active { opacity: 1; width: 24px; border-radius: 999px; }

.hero-copy {
  position: absolute;
  left: 5%;
  bottom: 96px;
  z-index: 2;
  max-width: min(560px, 90%);
  padding: 24px 28px 26px;
  background: rgba(0, 19, 39, .86);
  border-left: 3px solid var(--hm-gold);
  border-radius: 6px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .25);
  color: #fff;
  pointer-events: none;
  backdrop-filter: blur(2px);
}
.carousel-item .hero-copy { display: none; }
.carousel-item.active .hero-copy { display: block; animation: heroCopyIn .6s ease both; }
@keyframes heroCopyIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hero-copy .hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--hm-gold-soft); margin-bottom: 12px; }
.hero-copy .hero-eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--hm-gold); }
.hero-copy h1 { color: #fff; font-weight: 700; font-size: clamp(1.5rem, 2.6vw, 2.3rem); line-height: 1.22; margin-bottom: 18px; }
.hero-copy .hero-actions { pointer-events: auto; display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Quick facts: floating card over the bottom of the hero ---------- */
.quick-facts { position: relative; z-index: 4; background: transparent; margin-top: -48px; padding: 0 12px; }
.quick-facts .row { margin: 0; background: #fff; border-radius: 18px; box-shadow: 0 18px 44px rgba(0, 20, 50, .16); border: 1px solid var(--hm-line); overflow: hidden; position: relative; }
.quick-facts .row::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--hm-navy) 0%, var(--hm-navy-2) 60%, var(--hm-gold) 100%); }
.quick-facts .fact { display: grid; grid-template-columns: 54px auto; column-gap: 16px; align-items: center; justify-content: center; padding: 28px 18px 24px; height: 100%; text-align: left; position: relative; transition: background .25s ease; }
.quick-facts .col-lg-3 + .col-lg-3 .fact::before { content: ""; position: absolute; left: 0; top: 24px; bottom: 24px; width: 1px; background: var(--hm-line); }
.quick-facts .fact:hover { background: #f8fafc; }
.quick-facts .fact i { grid-row: span 2; width: 54px; height: 54px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--hm-navy) 0%, var(--hm-navy-2) 100%); color: var(--hm-gold); font-size: 1.4rem; box-shadow: 0 8px 18px rgba(0, 42, 92, .25); transition: transform .25s ease; }
.quick-facts .fact:hover i { transform: translateY(-3px) rotate(-4deg); }
.quick-facts .fact strong { align-self: end; display: block; font-family: var(--heading-font); font-size: 1.12rem; font-weight: 700; color: var(--hm-navy); line-height: 1.25; }
.quick-facts .fact span { align-self: start; display: block; font-size: .84rem; color: var(--hm-soft); margin-top: 3px; }

/* ---------- Welcome ---------- */
.hm-welcome { padding: 72px 0 80px; background: transparent; }
.hm-welcome-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.hm-welcome-media { position: relative; }
.hm-welcome-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 18px; box-shadow: 0 20px 40px rgba(0, 20, 50, .18); display: block; }
.hm-welcome-media::before { content: ""; position: absolute; left: -16px; bottom: -16px; width: 55%; height: 55%; border-radius: 18px; background: var(--hm-gold); opacity: .18; z-index: -1; }
.hm-welcome-text .hm-kicker { font-size: .78rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #8a6200; }
.hm-welcome-text h2 { color: var(--hm-navy); font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 700; line-height: 1.2; margin: 10px 0 18px; }
.hm-welcome-text p { color: #3a4048; font-size: 1.06rem; line-height: 1.9; margin: 0 0 26px; }

/* ---------- VC message ---------- */
.hm-vc-section { position: relative; overflow: hidden; padding: 90px 0; background: linear-gradient(135deg, var(--hm-deep) 0%, var(--hm-navy) 55%, var(--hm-navy-2) 100%); color: #fff; }
.hm-vc-section::before { content: ""; position: absolute; left: -160px; top: -160px; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(255, 255, 255, .04); }
.hm-vc-section::after { content: "\201C"; position: absolute; right: 4%; top: -40px; font-family: Georgia, serif; font-size: 340px; line-height: 1; color: rgba(212, 160, 23, .08); pointer-events: none; }
.hm-vc-section .container { position: relative; z-index: 1; }
.hm-vc { display: grid; grid-template-columns: 340px 1fr; gap: 64px; align-items: center; max-width: 1120px; margin: 0 auto; }

.hm-vc-photo { position: relative; margin: 0; }
.hm-vc-photo .hm-vc-frame { position: relative; outline: 1px solid rgba(212, 160, 23, .45); outline-offset: 10px; border-radius: 200px 200px 18px 18px; overflow: hidden; border: 4px solid var(--hm-gold); background: #0b2f5f; box-shadow: 0 24px 50px rgba(0, 0, 0, .35); }
.hm-vc-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; display: block; }
.hm-vc-photo figcaption { margin-top: 22px; text-align: center; }
.hm-vc-photo figcaption strong { display: block; color: #fff; font-size: 1.15rem; }
.hm-vc-photo figcaption span { display: inline-block; margin-top: 6px; font-size: .74rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--hm-deep); background: var(--hm-gold); border-radius: 999px; padding: 4px 12px; }

.hm-vc-letter .hm-kicker { display: inline-flex; align-items: center; gap: 10px; font-size: .78rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--hm-gold-soft); }
.hm-vc-letter .hm-kicker::before { content: ""; width: 30px; height: 2px; background: var(--hm-gold); }
.hm-vc-letter h2 { color: #fff; font-size: clamp(1.8rem, 3vw, 2.5rem); font-weight: 700; margin: 10px 0 26px; }
.hm-vc-letter .hm-vc-lead { color: #fff; font-size: 1.16rem; line-height: 1.85; margin: 0 0 18px; padding-left: 20px; border-left: 3px solid var(--hm-gold); }
.hm-vc-letter .hm-vc-more { color: rgba(255, 255, 255, .78); font-size: 1.02rem; line-height: 1.9; margin: 0; }
.hm-vc-sign { display: flex; align-items: center; gap: 16px; margin-top: 30px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .14); }
.hm-vc-sign .hm-vc-mark { flex: none; width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(212, 160, 23, .15); color: var(--hm-gold); font-size: 1.3rem; }
.hm-vc-sign strong { display: block; color: #fff; font-size: 1.05rem; }
.hm-vc-sign .vc-role { color: var(--hm-gold-soft); font-size: .9rem; }

/* ---------- Why UKM ---------- */
.hm-why { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.hm-why .feature { height: 100%; padding: 30px 26px; background: #fff; border: 1px solid var(--hm-line); border-radius: 16px; box-shadow: 0 4px 14px rgba(0, 20, 50, .05); transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; position: relative; overflow: hidden; }
.hm-why .feature::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--hm-gold); transform: scaleX(0); transform-origin: left; transition: transform .3s ease; }
.hm-why .feature:hover { transform: translateY(-5px); box-shadow: 0 16px 32px rgba(0, 20, 50, .12); }
.hm-why .feature:hover::after { transform: scaleX(1); }
.hm-why .icon-wrap { width: 54px; height: 54px; border-radius: 14px; background: var(--hm-navy); display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.hm-why .icon-wrap i { color: var(--hm-gold); font-size: 1.35rem; }
.hm-why h4 { color: var(--hm-navy); font-size: 1.1rem; font-weight: 700; margin-bottom: 10px; }
.hm-why p { color: var(--hm-soft); font-size: .95rem; line-height: 1.7; margin: 0; }

/* ---------- Faculties ---------- */
.hm-faculties { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.hm-faculty { position: relative; display: block; border-radius: 18px; overflow: hidden; aspect-ratio: 3 / 4; text-decoration: none; box-shadow: 0 10px 26px rgba(0, 20, 50, .14); background: var(--hm-navy); }
.hm-faculty img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.hm-faculty::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 19, 39, .92) 0%, rgba(0, 19, 39, .35) 50%, rgba(0, 19, 39, .05) 100%); }
.hm-faculty-body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 22px 22px 24px; color: #fff; }
.hm-faculty-body h3 { color: #fff; font-size: 1.12rem; font-weight: 700; line-height: 1.35; margin: 0 0 14px; }
.hm-faculty-body span { display: inline-flex; align-items: center; gap: 8px; color: var(--hm-gold-soft); font-size: .86rem; font-weight: 600; }
.hm-faculty-body span i { transition: transform .2s ease; }
.hm-faculty:hover img { transform: scale(1.07); }
.hm-faculty:hover .hm-faculty-body span i { transform: translateX(4px); }
.hm-faculty::before { content: ""; position: absolute; left: 22px; right: 22px; bottom: 0; height: 3px; z-index: 2; background: var(--hm-gold); }

/* ---------- Admissions banner ---------- */
.admissions-banner { position: relative; overflow: hidden; padding: 48px 0; background: linear-gradient(120deg, var(--hm-navy) 0%, var(--hm-navy-2) 100%); }
.admissions-banner::before { content: ""; position: absolute; right: -120px; top: -140px; width: 360px; height: 360px; border-radius: 50%; border: 50px solid rgba(255, 255, 255, .05); }
.admissions-banner .container { position: relative; z-index: 1; }
.admissions-banner .row { align-items: center; }
.admissions-banner h4 { color: #fff; font-weight: 700; margin: 0 0 6px; font-size: clamp(1.3rem, 2.4vw, 1.7rem); }
.admissions-banner p { margin: 0; color: rgba(255, 255, 255, .78); font-size: 1rem; }
.admissions-banner .btn-ukm-navy { background: var(--hm-gold); color: var(--hm-deep); }
.admissions-banner .btn-ukm-navy:hover { background: var(--hm-gold-soft); color: var(--hm-deep); }

/* ---------- Happening at UKM ---------- */
.happening-section { background: #fff; padding: 80px 0 86px; }
.happening-section .events { width: 100%; padding: 0; text-align: center; }
.happening-section .events > h2 { color: var(--hm-navy); font-size: clamp(1.6rem, 2.6vw, 2.1rem); font-weight: 700; margin: 0 0 36px; text-transform: none; }
.happening-section .events > h2::before { content: "News & Events"; display: block; font-size: .78rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #8a6200; margin-bottom: 8px; }
.happening-section .events > h2::after { content: ""; display: block; width: 52px; height: 3px; margin: 14px auto 0; background: var(--hm-gold); border-radius: 2px; }
.happening-section .mySwiper { padding: 6px 4px 14px; }
.happening-section .events .card { border: 1px solid var(--hm-line); border-radius: 16px; box-shadow: 0 4px 14px rgba(0, 20, 50, .06); transition: transform .25s ease, box-shadow .25s ease; }
.happening-section .events .card:hover { transform: translateY(-4px); box-shadow: 0 16px 30px rgba(0, 20, 50, .12); }
.happening-section .events .card img { height: 210px; border-bottom: 3px solid var(--hm-gold); }
.happening-section .events .card h3 { color: var(--hm-navy); font-size: 1.02rem; font-weight: 700; line-height: 1.45; padding: 18px 18px 8px; margin: 0; }
.happening-section .events .date,
.happening-section .events .location { display: flex; align-items: center; gap: 8px; padding: 0 18px; margin: 0 0 6px; font-size: .86rem; color: var(--hm-soft); }
.happening-section .events .date::before { content: "\F1F6"; font-family: "bootstrap-icons"; color: var(--hm-gold); }
.happening-section .events .location::before { content: "\F3E8"; font-family: "bootstrap-icons"; color: var(--hm-gold); }
.happening-section .events .btn { margin: 12px 18px 18px; padding: 8px 18px; border: 1.5px solid var(--hm-navy); border-radius: 999px; color: var(--hm-navy); font-size: .86rem; font-weight: 600; background: transparent; }
.happening-section .events .btn:hover { background: var(--hm-navy); color: #fff; }
.happening-section .viewall { margin-top: 28px; }
.happening-section .viewall a { display: inline-flex; padding: 12px 30px; border-radius: 999px; background: var(--hm-navy); color: #fff; font-weight: 600; text-decoration: none; transition: background .2s ease; }
.happening-section .viewall a:hover { background: var(--hm-deep); }
.happening-section br { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1199px) {
  .hm-why, .hm-faculties { grid-template-columns: repeat(2, 1fr); }
  .hm-faculty { aspect-ratio: 16 / 11; }
}
@media (max-width: 991px) {
  .hm-welcome-grid { grid-template-columns: 1fr; gap: 36px; }
  .hm-vc { grid-template-columns: 1fr; gap: 44px; }
  .hm-vc-photo { max-width: 300px; width: 100%; margin: 0 auto; }
  .hm-vc-letter { text-align: left; }
}
@media (max-width: 991px) {
  .quick-facts .col-6:nth-child(2n) .fact::before { display: block; }
  .quick-facts .col-6:nth-child(odd) .fact::before { display: none; }
  .quick-facts .col-6:nth-child(-n+2) .fact { border-bottom: 1px solid var(--hm-line); }
}
@media (max-width: 768px) {
  .quick-facts { margin-top: 0; padding: 18px 12px 0; background: var(--hm-bg); }
  .quick-facts .fact { grid-template-columns: 1fr; justify-items: center; text-align: center; row-gap: 10px; padding: 22px 10px 20px; }
  .quick-facts .fact i { grid-row: auto; width: 48px; height: 48px; font-size: 1.25rem; }
  .quick-facts .fact strong { align-self: auto; font-size: 1rem; }
  .quick-facts .fact span { align-self: auto; font-size: .78rem; margin-top: -6px; }
  /* Posters show in full on phones, with the copy panel underneath */
  #hero-carousel { display: flow-root; height: auto; }
  #hero-carousel .carousel-item { position: relative; inset: auto; }
  #hero-carousel .carousel-item img.slider-image { position: static; height: auto; }
  #hero-carousel .carousel-item::before,
  #hero-carousel::after,
  #hero-carousel .carousel-control-prev,
  #hero-carousel .carousel-control-next { display: none; }
  #hero-carousel .carousel-item .hero-copy { position: static; max-width: none; border-left: 0; border-top: 3px solid var(--hm-gold); border-radius: 0; box-shadow: none; background: var(--hm-deep); padding: 20px 20px 58px; backdrop-filter: none; }
  #hero-carousel .carousel-indicators { bottom: 14px; margin-bottom: 0; }
  .hm-block, .hm-welcome, .happening-section { padding: 56px 0; }
  .hm-vc-section { padding: 60px 0; }
  .hm-vc-section::after { font-size: 200px; }
  .hm-vc-photo { max-width: 240px; }
  .hm-vc-letter .hm-vc-lead { font-size: 1.05rem; padding-left: 14px; }
  .admissions-banner .text-lg-end { text-align: left !important; margin-top: 18px; }
}
@media (max-width: 575px) {
  .hm-why { grid-template-columns: 1fr; gap: 14px; }
  .hm-faculties { grid-template-columns: 1fr; gap: 14px; }
  .hm-faculty { aspect-ratio: 16 / 10; }
  .hero-copy h1 { font-size: clamp(1.25rem, 5.6vw, 1.55rem); margin-bottom: 14px; }
  .btn-ukm-gold, .btn-ukm-outline { padding: 10px 18px; font-size: .85rem; }
  .hm-welcome-media::before { left: -8px; bottom: -8px; }
}
@media (prefers-reduced-motion: reduce) {
  .hm-why .feature, .hm-faculty img, .btn-ukm-gold, .btn-ukm-outline, .btn-ukm-navy, .carousel-item.active .hero-copy { transition: none !important; animation: none !important; }
}
