/**
 * Homepage-only minimal layout/components (replaces full Bootstrap 5 CSS on index.php).
 * Scope: grid, flex, spacing, type, buttons, badges, cards, alerts, dropdowns, navbar helpers.
 * Does not load on other pages — keep in sync with homepage templates only.
 */

/* Reboot: match Bootstrap’s border-box model so .row / .col widths don’t overflow and wrap. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bs-blue: #0d6efd;
  --bs-indigo: #6610f2;
  --bs-primary-rgb: 13, 110, 253;
  --bs-secondary-rgb: 108, 117, 125;
  --bs-success-rgb: 25, 135, 84;
  --bs-info-rgb: 13, 202, 240;
  --bs-warning-rgb: 255, 193, 7;
  --bs-danger-rgb: 220, 53, 69;
  --bs-light-rgb: 248, 249, 250;
  --bs-dark-rgb: 33, 37, 41;
}

/* ---- Grid (mobile-first; matches BS5 breakpoints) ---- */
.container {
  width: 100%;
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 12px;
  padding-right: 12px;
}
.row {
  --bs-gutter-x: 1.5rem;
  --bs-gutter-y: 0;
  display: flex;
  flex-wrap: wrap;
  margin-top: calc(-1 * var(--bs-gutter-y));
  margin-right: calc(-0.5 * var(--bs-gutter-x));
  margin-left: calc(-0.5 * var(--bs-gutter-x));
}
.row > * {
  flex-shrink: 0;
  max-width: 100%;
  padding-right: calc(var(--bs-gutter-x) * 0.5);
  padding-left: calc(var(--bs-gutter-x) * 0.5);
  margin-top: var(--bs-gutter-y);
}
.row.g-2 { --bs-gutter-x: 0.5rem; --bs-gutter-y: 0.5rem; }
.row.g-3 { --bs-gutter-x: 1rem; --bs-gutter-y: 1rem; }
.row.g-4 { --bs-gutter-x: 1.5rem; --bs-gutter-y: 1.5rem; }

.col-6 { flex: 0 0 auto; width: 50%; }
.col-12 { flex: 0 0 auto; width: 100%; }

@media (min-width: 576px) {
  .col-sm-6 { flex: 0 0 auto; width: 50%; }
}
@media (min-width: 768px) {
  .col-md-3 { flex: 0 0 auto; width: 25%; }
  .col-md-4 { flex: 0 0 auto; width: 33.33333333%; }
  .col-md-6 { flex: 0 0 auto; width: 50%; }
  .col-md-8 { flex: 0 0 auto; width: 66.66666667%; }
}
@media (min-width: 992px) {
  .col-lg-2 { flex: 0 0 auto; width: 16.66666667%; }
  .col-lg-3 { flex: 0 0 auto; width: 25%; }
  .col-lg-4 { flex: 0 0 auto; width: 33.33333333%; }
  .col-lg-5 { flex: 0 0 auto; width: 41.66666667%; }
  .col-lg-6 { flex: 0 0 auto; width: 50%; }
  .col-lg-7 { flex: 0 0 auto; width: 58.33333333%; }
}

/* ---- Flex & display ---- */
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
@media (min-width: 992px) {
  .flex-lg-row { flex-direction: row !important; }
  .align-items-lg-center { align-items: center !important; }
}
.align-items-start { align-items: flex-start !important; }
.align-items-center { align-items: center !important; }
.align-items-stretch { align-items: stretch !important; }
.align-items-top { align-items: flex-start !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-end { justify-content: flex-end !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }

.d-none { display: none !important; }
@media (min-width: 768px) {
  .d-md-inline { display: inline !important; }
}

/* ---- Spacing (common homepage utilities) ---- */
.m-0 { margin: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }
.me-3 { margin-inline-end: 1rem !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.my-4 { margin-top: 1.5rem !important; margin-bottom: 1.5rem !important; }

.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.px-4 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.py-1 { padding-top: 0.25rem !important; padding-bottom: 0.25rem !important; }
.py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
.pt-5 { padding-top: 3rem !important; }
.pb-5 { padding-bottom: 3rem !important; }

/* ---- Typography ---- */
.small { font-size: 0.875em !important; }
.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.text-center { text-align: center !important; }
.text-end { text-align: end !important; }
.text-muted { color: #6c757d !important; }
.text-primary { color: #0d6efd !important; }
.text-success { color: #198754 !important; }
.text-info { color: #0dcaf0 !important; }
.text-warning { color: #ffc107 !important; }
.text-dark { color: #212529 !important; }
@media (min-width: 768px) {
  .text-md-start { text-align: start !important; }
  .text-md-end { text-align: end !important; }
}

.h2 { font-size: calc(1.325rem + 0.9vw); margin-top: 0; }
.h3 { font-size: calc(1.3rem + 0.6vw); margin-top: 0; }
.h5 { font-size: 1.25rem; margin-top: 0; }
.display-5 { font-size: calc(1.425rem + 2.1vw); font-weight: 300; line-height: 1.2; }
.lead { font-size: 1.25rem; font-weight: 300; }

/* ---- Images & misc ---- */
.img-fluid { max-width: 100%; height: auto; }
.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }
.overflow-hidden { overflow: hidden !important; }
.text-decoration-none { text-decoration: none !important; }
.border { border: 1px solid #dee2e6 !important; }
.border-0 { border: 0 !important; }
.rounded { border-radius: 0.375rem !important; }
.rounded-4 { border-radius: 0.5rem !important; }
.rounded-pill { border-radius: 50rem !important; }
.rounded-circle { border-radius: 50% !important; }
.shadow-sm { box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important; }

/* ---- Backgrounds ---- */
.bg-light { background-color: #f8f9fa !important; }
.bg-white { background-color: #fff !important; }
.bg-primary { background-color: #0d6efd !important; }
.bg-secondary { background-color: #6c757d !important; }
.bg-success { background-color: #198754 !important; }
.bg-info { background-color: #0dcaf0 !important; }
.bg-warning { background-color: #ffc107 !important; }

.bg-opacity-10 {
  --bs-bg-opacity: 0.1;
}
.bg-primary.bg-opacity-10 {
  background-color: rgba(var(--bs-primary-rgb), var(--bs-bg-opacity)) !important;
}
.bg-success.bg-opacity-10 {
  background-color: rgba(var(--bs-success-rgb), var(--bs-bg-opacity)) !important;
}
.bg-info.bg-opacity-10 {
  background-color: rgba(var(--bs-info-rgb), var(--bs-bg-opacity)) !important;
}
.bg-warning.bg-opacity-10 {
  background-color: rgba(var(--bs-warning-rgb), var(--bs-bg-opacity)) !important;
}

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  border-radius: 0.375rem;
  border: 1px solid transparent;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}
.btn-lg {
  padding: 0.5rem 1rem;
  font-size: 1.25rem;
  border-radius: 0.5rem;
}
.btn-primary {
  color: #fff;
  background-color: #0d6efd;
  border-color: #0d6efd;
}
.btn-primary:hover {
  color: #fff;
  background-color: #0b5ed7;
  border-color: #0a58ca;
}
.btn-success {
  color: #fff;
  background-color: #198754;
  border-color: #198754;
}
.btn-success:hover {
  color: #fff;
  background-color: #157347;
  border-color: #146c43;
}
.btn-outline-dark {
  color: #212529;
  border-color: #212529;
  background: transparent;
}
.btn-outline-dark:hover {
  color: #fff;
  background-color: #212529;
}
.btn-outline-primary {
  color: #0d6efd;
  border-color: #0d6efd;
  background: transparent;
}
.btn-outline-primary:hover {
  color: #fff;
  background-color: #0d6efd;
}
.btn-outline-secondary {
  color: #6c757d;
  border-color: #6c757d;
  background: transparent;
}
.btn-outline-secondary:hover {
  color: #fff;
  background-color: #6c757d;
}
.btn-dark {
  color: #fff;
  background-color: #212529;
  border-color: #212529;
}

/* ---- Badges ---- */
.badge {
  display: inline-block;
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.375rem;
}

/* ---- Cards ---- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.125);
  border-radius: 0.375rem;
}
.card-body {
  flex: 1 1 auto;
  padding: 1rem;
}

/* ---- Alerts ---- */
.alert {
  position: relative;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: 0.375rem;
}
.alert-warning {
  color: #664d03;
  background-color: #fff3cd;
  border-color: #ffecb5;
}

/* ---- Navbar (Bootstrap 5–compatible — required when full bootstrap.min.css is skipped) ---- */
.navbar {
  --bs-navbar-padding-x: 0;
  --bs-navbar-padding-y: 0.5rem;
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: var(--bs-navbar-padding-y) var(--bs-navbar-padding-x);
}
.navbar > .container,
.navbar > .container-fluid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}
.navbar-nav {
  display: flex;
  flex-direction: column;
  padding-left: 0;
  margin-bottom: 0;
  list-style: none;
}
.nav-item {
  list-style: none;
}
.collapse:not(.show) {
  display: none;
}
.navbar-toggler {
  padding: 0.25rem 0.75rem;
  font-size: 1.25rem;
  line-height: 1;
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: 0.375rem;
}
@media (min-width: 992px) {
  .navbar-expand-lg .navbar-toggler {
    display: none;
  }
  .navbar-expand-lg .navbar-collapse {
    display: flex !important;
    flex-basis: auto;
    flex-grow: 1;
    align-items: center;
  }
  .navbar-expand-lg .navbar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 0.15rem;
  }
  .navbar-expand-lg .navbar-collapse.justify-content-center {
    justify-content: center;
  }
}

/* ---- Navbar collapse / order (complements critical CSS) ---- */
.sticky-top {
  position: sticky;
  top: 0;
  z-index: 1020;
}
.order-2 { order: 2 !important; }
.order-3 { order: 3 !important; }
@media (min-width: 768px) {
  .order-md-2 { order: 2 !important; }
  .order-md-3 { order: 3 !important; }
}

/* ---- Dropdowns (Bootstrap JS toggles .show) ---- */
.dropdown { position: relative; }
.dropdown-toggle::after {
  display: inline-block;
  margin-left: 0.255em;
  vertical-align: 0.255em;
  content: "";
  border-top: 0.3em solid;
  border-right: 0.3em solid transparent;
  border-bottom: 0;
  border-left: 0.3em solid transparent;
}
.dropdown-menu {
  position: absolute;
  z-index: 1000;
  display: none;
  min-width: 12rem;
  padding: 0.5rem 0;
  margin: 0.125rem 0 0;
  font-size: 1rem;
  color: #212529;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 0.375rem;
  list-style: none;
  top: 100%;
  left: 0;
}
.dropdown-menu.show {
  display: block;
}
.dropdown-item {
  display: block;
  width: 100%;
  padding: 0.25rem 1rem;
  clear: both;
  font-weight: 400;
  color: #212529;
  text-decoration: none;
  white-space: nowrap;
  background-color: transparent;
  border: 0;
  text-align: inherit;
}
.dropdown-item:hover,
.dropdown-item:focus {
  color: #1e2125;
  background-color: #e9ecef;
}
.dropdown-divider {
  height: 0;
  margin: 0.5rem 0;
  overflow: hidden;
  border-top: 1px solid rgba(0, 0, 0, 0.15);
}
.dropdown-menu li { list-style: none; }

/* Desktop: center nav items; dropdown menus align under toggle */
@media (min-width: 992px) {
  .navbar-expand-lg .navbar-nav .nav-item.dropdown {
    position: relative;
  }
}

/* ---- Section spacing used on homepage ---- */
.py-5 {
  padding-top: 3rem !important;
  padding-bottom: 3rem !important;
}
.pt-5 {
  padding-top: 3rem !important;
}
.pb-5 {
  padding-bottom: 3rem !important;
}

/* Subtle gradient for recognition banner (BS .bg-gradient companion) */
.bg-gradient {
  background-image: linear-gradient(135deg, rgba(13, 110, 253, 0.08) 0%, rgba(255, 255, 255, 0.95) 100%);
}
