/* ==========================================================
   NITCON – common styles (header, nav, social rail, footer)
   Colour codes kept from nitcon.org
   ========================================================== */
:root {
  --nit-blue: #01428d;        /* primary brand blue (nav, headings) */
  --nit-blue-dark: #00336e;
  --nit-blue-600: #005baa;
  --nit-blue-50: #eef4fb;
  --nit-accent: #0a85d1;
  --nit-red: #dc3545;
  --nit-green: #198754;
  --nit-ink: #212529;
  --nit-muted: #5b6573;
  --nit-line: #dde4ee;
  --nit-bg: #f6f8fb;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(1, 66, 141, .06), 0 2px 8px rgba(1, 66, 141, .06);
  --shadow-md: 0 6px 24px rgba(1, 66, 141, .10);
  --fs-scale: 1;
}

html { font-size: calc(16px * var(--fs-scale)); scroll-behavior: smooth; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--nit-ink);
  background: #fff;
  overflow-x: hidden;
}
a { color: var(--nit-blue); }
:focus-visible { outline: 3px solid #ffbf47; outline-offset: 2px; }

/* Site fonts (self-hosted copies of the fonts nitcon.org uses) */
@font-face { font-family: "Cerebri Sans Pro"; src: url(../fonts/cerebrisanspro-regular.ttf) format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Cerebri Sans Pro"; src: url(../fonts/CerebriSansPro-Medium.otf) format("opentype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Cerebri Sans Pro"; src: url(../fonts/cerebrisanspro-semibold.otf) format("opentype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Cerebri Sans Pro"; src: url(../fonts/cerebrisanspro-bold.otf) format("opentype"); font-weight: 700; font-display: swap; }

/* ---------- Top utility bar (48px, as nitcon.org) ---------- */
.top-header {
  display: flex; justify-content: space-between; align-items: center;
  height: 3rem; padding: 0 2rem;
  background: url(../img/top-header-bg.svg) no-repeat left top / cover, #fff;
}
.top-links { display: flex; flex-wrap: wrap; align-items: center; margin: 0; padding: 0; list-style: none; }
.top-links li { display: flex; align-items: center; }
.top-links li:not(:last-child)::after { content: "|"; color: #fff; margin: 0 .55rem 0 .3rem; font-family: "Cerebri Sans Pro", sans-serif; font-weight: 600; }
.top-links a { color: #fff; text-decoration: none; font-family: "Cerebri Sans Pro", "Inter", sans-serif; font-weight: 600; font-size: 1rem; line-height: 1.2; }
.top-links a:hover { text-decoration: underline; }
.top-links a.foundation { background: rgba(13,110,253,.18); padding: .4rem; border-radius: .2rem; }
.top-tools { display: flex; align-items: center; gap: .5rem; }
.font-tools { color: var(--nit-blue); font-weight: 500; font-size: .8rem; white-space: nowrap; }
.font-tools button { background: none; border: 0; padding: 0 .05rem; color: var(--nit-blue); font-weight: 500; font-size: .8rem; }
.font-tools button:hover { text-decoration: underline; }
.btn-lang { background: var(--nit-blue); color: #fff; border: 0; border-radius: 4px; padding: 6px 12px; font-size: .8rem; line-height: 1; }
.btn-lang:hover, .btn-lang:focus, .btn-lang.show { background: var(--nit-blue-dark); color: #fff; }
.top-tools .dropdown-menu { font-size: .8rem; min-width: 6rem; }

/* ---------- Brand row (logo 288px, badges 112px wide, no gaps) ---------- */
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 2rem; }
.brand-logo img { width: 288px; height: auto; display: block; }
.brand-badges { display: flex; align-items: center; }
.brand-badges img { width: 112px; height: auto; display: block; }
.brand-badges img:last-child { width: 94px; }
.nav-toggle {
  border: 0; background: transparent; color: #fff; font-size: 1rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: .55rem; padding: .7rem .2rem; width: 100%;
}
.nav-toggle i { font-size: 1.15rem; }
.nav-toggle[aria-expanded="true"] i::before { content: "\f00d"; } /* bars -> x */

/* ---------- Main nav (56px bar, 14.4px items) ---------- */
.main-nav { background: var(--nit-blue); padding: 13px 2rem; }
.main-nav .nav-link {
  color: #fff; font-weight: 400; font-size: .9rem; line-height: 1.2;
  padding: .4rem !important; margin: 0 .3rem; border-radius: .3rem;
  transition: background-color .15s, color .15s;
}
.main-nav .nav-link:hover, .main-nav .nav-link:focus-visible,
.main-nav .nav-item.has-sub:hover > .nav-link, .main-nav .nav-item.has-sub.open > .nav-link,
.main-nav .nav-link.active {
  background: #fff; color: #000;
}
.main-nav .dropdown-toggle::after { vertical-align: .2em; }
/* submenu (Bootstrap look as on nitcon.org) */
.main-nav .dropdown-menu {
  font-size: .8rem; padding: .5rem 0; margin: 0; min-width: 10rem;
  border: 1px solid rgba(0,0,0,.15); border-radius: 4px; box-shadow: 0 6px 18px rgba(0,0,0,.08);
}
.main-nav .dropdown-item { font-size: .8rem; padding: .25rem 1rem; color: #212529; white-space: nowrap; }
.main-nav .dropdown-item:hover, .main-nav .dropdown-item:focus { background: #e9ecef; color: #1e2125; }
.main-nav .dropdown-item.active { background: var(--nit-blue); color: #fff; }
.main-nav span.dropdown-item { cursor: default; }
.main-nav span.dropdown-item:hover { background: transparent; }
@media (min-width: 1200px) {
  .main-nav .has-sub { position: relative; }
  .main-nav .has-sub > .dropdown-menu { display: block; visibility: hidden; opacity: 0; position: absolute; top: calc(100% + 13px); left: 0; transform: translateY(6px); transition: opacity .15s, transform .15s, visibility .15s; }
  /* invisible bridge so the pointer can travel from the item to the submenu */
  .main-nav .has-sub > .dropdown-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -15px; height: 15px; }
  .main-nav .has-sub:hover > .dropdown-menu, .main-nav .has-sub:focus-within > .dropdown-menu, .main-nav .has-sub.open > .dropdown-menu { visibility: visible; opacity: 1; transform: none; }
}

/* ---------- Left social rail (pill opens with the name on hover, as nitcon.org) ---------- */
.social-rail {
  position: fixed; left: 10px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 10px; z-index: 1030;
}
.social-rail a {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: flex-start;
  overflow: hidden; white-space: nowrap; background: #fff; color: var(--brand);
  border: 1.5px solid var(--brand); border-radius: 999px; text-decoration: none;
  transition: all .35s ease;
}
.social-rail .rail-icon {
  order: 1; width: 35px; height: 35px; min-width: 35px; display: flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 50%; color: var(--brand); font-size: 1rem; transition: all .35s ease;
}
.social-rail .rail-text {
  order: 2; max-width: 0; overflow: hidden; opacity: 0; color: #fff; font-size: 13px; font-weight: 500; transition: all .35s ease;
}
.social-rail a:hover, .social-rail a:focus-visible { width: 140px; background: var(--brand); box-shadow: 0 8px 20px rgba(0,0,0,.18); }
.social-rail a:hover .rail-icon, .social-rail a:focus-visible .rail-icon { order: 3; margin-left: auto; margin-right: 2px; }
.social-rail a:hover .rail-text, .social-rail a:focus-visible .rail-text { max-width: 90px; opacity: 1; padding-left: 10px; }

/* ---------- Footer ---------- */
.site-footer {
  background: url(../img/footer-bg.png) center / cover no-repeat, #f1f2f4;
  padding: 3.5rem 0 1.25rem;
  border-radius: 0 0 22px 22px;
  margin-top: 4rem;
}
.site-footer .container-xl { padding-left: 5.5rem; padding-right: 2rem; }
.site-footer h4 { color: var(--nit-blue); font-weight: 700; font-size: 1.45rem; margin-bottom: .8rem; }
.site-footer .about-text { text-align: justify; font-weight: 500; line-height: 1.75; color: #1d232b; }
.f-links { list-style: none; padding: 0; margin: 0; }
.f-links li { margin-bottom: .55rem; }
.f-links a { color: #1d232b; text-decoration: none; font-weight: 600; }
.f-links a:hover { color: var(--nit-blue); text-decoration: underline; }
.map-wrap { border-radius: 8px; overflow: hidden; box-shadow: var(--shadow-sm); }
.map-wrap iframe { width: 100%; height: 210px; border: 0; display: block; }
.site-footer hr { border-color: #bfc5cd; opacity: 1; margin: 2.5rem 0 1rem; }
.f-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; font-weight: 600; }
.f-bottom p { margin: 0; }

.to-top {
  position: fixed; right: 18px; bottom: 18px; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: var(--nit-blue); color: #fff; box-shadow: var(--shadow-md);
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 1030;
}
.to-top.show { opacity: 1; pointer-events: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 1399.98px) {
  .main-nav { padding-left: 1rem; padding-right: 1rem; }
  .main-nav .nav-link { margin: 0 .1rem; }
}
@media (max-width: 1199.98px) {
  .top-header { background: var(--nit-blue); }
  .font-tools, .font-tools button { color: #fff; }
  .btn-lang { background: #fff; color: var(--nit-blue); }
  .btn-lang:hover, .btn-lang:focus, .btn-lang.show { background: #e9eef6; color: var(--nit-blue); }
  .brand-badges img { width: 86px; } .brand-badges img:last-child { width: 72px; }
  .main-nav { padding: 0 1rem; }
  .main-nav .navbar-collapse { padding: .5rem 0 1rem; }
  .main-nav .nav-link { margin: .1rem 0; padding: .55rem .6rem !important; font-size: .95rem; }
  .main-nav .dropdown-menu { position: static; box-shadow: none; border: 0; background: rgba(255,255,255,.08); margin: .1rem 0 .4rem .6rem; }
  .main-nav .dropdown-item { color: #fff; white-space: normal; font-size: .9rem; padding: .45rem .8rem; }
  .main-nav .dropdown-item:hover, .main-nav .dropdown-item:focus { background: rgba(255,255,255,.12); color: #fff; }
  .main-nav span.dropdown-item { opacity: .65; }
  .main-nav .has-sub.open > .dropdown-menu { display: block; }
  .main-nav .has-sub.open > .dropdown-toggle::after { transform: rotate(180deg); }
}
@media (max-width: 991.98px) {
  .brand-badges { display: none; }
  .top-header { height: auto; padding: .4rem 1rem; flex-wrap: wrap; gap: .4rem; }
  .brand-row { padding: .6rem 1rem; }
  .brand-logo img { width: 220px; }
  .site-footer .container-xl { padding-left: 1rem; padding-right: 1rem; }
  .site-footer { padding-bottom: 5rem; }
}
@media (max-width: 768px) {
  .social-rail { left: 8px; gap: 8px; }
  .social-rail a { width: 34px; height: 34px; }
  .social-rail .rail-icon { width: 32px; height: 32px; min-width: 32px; font-size: .85rem; }
  .social-rail a:hover, .social-rail a:focus-visible { width: 120px; }
}
@media (max-width: 575.98px) {
  .top-links a { font-size: .85rem; }
  .top-links li:first-child { display: none; }
  .social-rail { top: auto; bottom: 15px; left: 50%; transform: translateX(-50%); flex-direction: row; }
  .social-rail a, .social-rail a:hover, .social-rail a:focus-visible { width: 36px; height: 36px; }
  .social-rail .rail-icon { width: 33px; height: 33px; min-width: 33px; }
  .social-rail .rail-text { display: none; }
}
/* tablet: keep the folded menu clear of the fixed social icons on the left */
@media (min-width: 576px) and (max-width: 1199.98px) {
  .main-nav { padding-left: 4rem; }
}
