/* ============================================================
   CSJMSS — components.css
   Reusable blocks: header, nav, mega-menu, footer, buttons,
   hero, notice-strip, inst-grid, stats, sections, cards.
   ============================================================ */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 12px 22px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: .95rem; cursor: pointer;
  border: none; text-decoration: none; transition: transform .15s, box-shadow .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--gold); color: var(--navy-deep); box-shadow: var(--shadow-sm); }
.btn-primary:hover { box-shadow: var(--shadow); }
.btn-ghost { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.45); }
.btn-outline { background: transparent; color: var(--navy); border: 2px solid var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; }

/* ---------- Site header / nav ---------- */
.site-header { position: sticky; top: 0; z-index: 1000; background: var(--navy-deep); box-shadow: var(--shadow); }
.nav-bar { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand .logo-mark {
  width: 38px; height: 38px; border-radius: 8px; background: var(--gold);
  display: grid; place-items: center; color: var(--navy-deep); font-weight: 800; font-size: 1.1rem;
}
.brand .brand-name { font-weight: 800; letter-spacing: .3px; font-size: 1.05rem; line-height: 1.05; }
.brand .brand-sub { font-size: .65rem; opacity: .75; letter-spacing: 1px; text-transform: uppercase; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links > li > a {
  color: #cfe0f7; padding: 10px 14px; border-radius: 6px; font-size: .92rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
}
.nav-links > li > a:hover, .nav-links > li:hover > a { background: rgba(255,255,255,.10); color: #fff; text-decoration: none; }
.nav-links .has-mega > a::after { content: "▾"; font-size: .7rem; }

/* ---------- Mega menu ---------- */
.mega {
  position: absolute; top: 64px; left: 0; right: 0;
  background: #fff; box-shadow: var(--shadow-lg);
  padding: 22px; display: none;
}
.has-mega:hover .mega, .has-mega:focus-within .mega { display: block; }
.mega-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: var(--container); margin: 0 auto; }
.mega-card {
  display: flex; gap: 12px; padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  transition: border-color .15s, transform .15s; color: var(--text); text-decoration: none;
}
.mega-card:hover { text-decoration: none; border-color: var(--blue-bright); transform: translateY(-2px); }
.mega-card .mi { width: 40px; height: 40px; border-radius: 8px; background: var(--bg-tint); color: var(--navy); display: grid; place-items: center; font-size: 1.2rem; flex-shrink: 0; }
.mega-card .mt { font-weight: 700; color: var(--navy); font-size: .92rem; }
.mega-card .ms { font-size: .78rem; color: var(--text-muted); }

/* ---------- Mobile nav toggle ---------- */
.nav-toggle { display: none; background: none; border: none; color: #fff; font-size: 1.6rem; cursor: pointer; }

/* ---------- Hero ---------- */
.hero { background: var(--grad-hero); color: #fff; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px; background: radial-gradient(circle, rgba(255,255,255,.16), transparent 60%); border-radius: 50%; }
.hero-inner { position: relative; z-index: 1; padding: 80px 0; max-width: 720px; }
.hero .badge { display: inline-block; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3); padding: 6px 14px; border-radius: 20px; font-size: .8rem; margin-bottom: 16px; }
.hero h1 { color: #fff; }
.hero p { color: rgba(255,255,255,.9); font-size: 1.1rem; margin: 14px 0 26px; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 560px) { .hero-inner { padding: 56px 0; } }

/* ---------- Notice strip ---------- */
.notice-strip { background: #fff7e6; border-top: 3px solid var(--gold); border-bottom: 1px solid #f0e2b8; overflow: hidden; }
.notice-track { display: flex; gap: 36px; padding: 12px 0; white-space: nowrap; }
.notice-item { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; color: #7a5a10; font-weight: 600; }
.notice-item .dot { width: 7px; height: 7px; background: var(--gold); border-radius: 50%; flex-shrink: 0; }

/* ---------- Section primitives ---------- */
.section { padding: 70px 0; }
.section--alt { background: var(--bg-alt); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 40px; }
.section-head .label { font-size: .78rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--blue-bright); font-weight: 700; }
.section-head p { margin-top: 10px; }

/* ---------- Institution grid ---------- */
.inst-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.inst-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 20px; text-align: center; transition: transform .18s, box-shadow .18s, border-color .18s;
  text-decoration: none; color: inherit;
}
.inst-card:hover { text-decoration: none; transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--blue-bright); }
.inst-card .ic { width: 56px; height: 56px; border-radius: 14px; background: var(--grad-navy); color: #fff; display: grid; place-items: center; font-size: 1.6rem; margin: 0 auto 14px; }
.inst-card .nm { font-weight: 700; color: var(--navy); font-size: 1rem; line-height: 1.25; }
.inst-card .ct { font-size: .82rem; color: var(--text-muted); margin-top: 6px; }

/* ---------- Stats band ---------- */
.stats-band { background: var(--grad-navy); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding: 50px 0; }
.stat { text-align: center; color: #fff; }
.stat .num { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; }
.stat .lbl { font-size: .9rem; opacity: .85; }

/* ---------- Generic cards ---------- */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { background: var(--grad-hero); color: #fff; padding: 50px 0; position: relative; overflow: hidden; }
.page-hero::after { content: ""; position: absolute; right: -80px; top: -80px; width: 280px; height: 280px; background: radial-gradient(circle, rgba(255,255,255,.14), transparent 60%); border-radius: 50%; }
.page-hero h1 { color: #fff; position: relative; z-index: 1; }
.page-hero p { color: rgba(255,255,255,.9); margin-top: 8px; position: relative; z-index: 1; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-deep); color: #a9bcdd; padding: 50px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 30px; }
.footer-grid h4 { color: #fff; margin-bottom: 14px; font-size: 1rem; }
.footer-grid a { color: #a9bcdd; }
.footer-grid a:hover { color: #fff; }
.footer-grid li { margin-bottom: 8px; font-size: .9rem; }
.footer-contact li { display: flex; gap: 8px; margin-bottom: 10px; font-size: .9rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 30px; padding-top: 18px; font-size: .82rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ---------- Responsive nav ---------- */
@media (max-width: 940px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 64px; left: 0; right: 0; background: var(--navy-deep);
    flex-direction: column; align-items: stretch; gap: 0; padding: 10px; max-height: 0; overflow: hidden; transition: max-height .3s;
  }
  .nav-links.open { max-height: 80vh; overflow-y: auto; }
  .nav-links > li > a { display: block; }
  .mega { position: static; box-shadow: none; padding: 0; }
  .mega-grid { grid-template-columns: 1fr; }
  .has-mega:hover .mega { display: none; }
  .has-mega.open .mega { display: block; }
}

/* ---------- Responsive grids ---------- */
@media (max-width: 940px) { .inst-grid { grid-template-columns: repeat(2, 1fr); } .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) {
  .inst-grid, .stats-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-ctas { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
}
