/**
 * TBI Public Responsive Foundation
 *
 * Global public-theme responsive guardrails for timothyburks.com.
 * Keep this file framework-friendly: it should enhance Bootstrap/public theme behavior
 * without replacing the core theme.
 */

:root {
  --tbi-mobile-gutter: 1rem;
  --tbi-card-radius: 1rem;
  --tbi-soft-border: rgba(15, 23, 42, 0.10);
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

img,
svg,
video,
canvas,
iframe {
  max-width: 100%;
}

img,
video {
  height: auto;
}

table {
  max-width: 100%;
}

.container,
.container-fluid {
  min-width: 0;
}

.card,
.dropdown-menu,
.table-responsive,
.row,
[class*="col-"] {
  min-width: 0;
}

.card {
  border-radius: var(--tbi-card-radius);
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-responsive > table {
  white-space: nowrap;
}

.nextgen-nav-group .dropdown-menu,
.nextgen-nav-item .dropdown-menu {
  max-height: 75vh;
  overflow-y: auto;
}

.nextgen-nav-home .nav-link.active,
.nextgen-nav-group .nav-link.active,
.nextgen-nav-item .nav-link.active,
.dropdown-item.active {
  font-weight: 700;
}

@media (max-width: 991.98px) {
  .navbar-collapse {
    max-height: calc(100vh - 5rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .navbar-nav {
    gap: 0.15rem;
  }

  .navbar-nav .dropdown-menu {
    border: 1px solid var(--tbi-soft-border);
    box-shadow: none;
    margin: 0.35rem 0 0.6rem 0;
    padding: 0.5rem;
  }

  .navbar-nav .dropdown-item {
    border-radius: 0.5rem;
    padding: 0.65rem 0.85rem;
  }

  section.py-5 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }

  h1,
  .h1 {
    font-size: clamp(1.75rem, 8vw, 2.35rem);
    line-height: 1.08;
  }

  h2,
  .h2 {
    font-size: clamp(1.45rem, 6vw, 1.9rem);
  }

  .lead {
    font-size: 1.05rem;
  }

  .card-body,
  .card-header {
    padding: 1rem;
  }

  .d-flex.gap-2,
  .d-flex.gap-3 {
    flex-wrap: wrap;
  }

  form.d-flex {
    width: 100%;
  }

  form.d-flex > .form-control,
  form.d-flex > .form-select,
  form.d-flex > .btn {
    flex: 1 1 100%;
    width: 100%;
  }
}

@media (max-width: 767.98px) {
  .container,
  .container-fluid {
    padding-left: var(--tbi-mobile-gutter);
    padding-right: var(--tbi-mobile-gutter);
  }

  .btn,
  .form-control,
  .form-select {
    min-height: 44px;
  }

  .table {
    font-size: 0.875rem;
  }

  .table th,
  .table td {
    padding: 0.55rem 0.65rem;
  }

  .card.shadow-sm {
    box-shadow: 0 0.5rem 1.5rem rgba(15, 23, 42, 0.08) !important;
  }
}

@media (max-width: 575.98px) {
  .row.g-3,
  .row.g-4 {
    --bs-gutter-x: 0.85rem;
    --bs-gutter-y: 0.85rem;
  }

  .table-responsive {
    margin-left: calc(var(--tbi-mobile-gutter) * -1);
    margin-right: calc(var(--tbi-mobile-gutter) * -1);
    padding-left: var(--tbi-mobile-gutter);
    padding-right: var(--tbi-mobile-gutter);
  }

  .dropdown-menu {
    min-width: 100%;
  }
}

/* NextGen Tracker public workbook polish */
.nextgen-page .card {
  overflow: hidden;
}

.nextgen-page .form-label {
  font-weight: 600;
}

.nextgen-page textarea.form-control {
  min-height: 6rem;
}

.nextgen-page .table thead th {
  vertical-align: middle;
}

@media (max-width: 767.98px) {
  .nextgen-page .d-flex.justify-content-between {
    align-items: stretch !important;
  }

  .nextgen-page .d-flex.justify-content-between > div,
  .nextgen-page .d-flex.justify-content-between > form {
    width: 100%;
  }

  .nextgen-page .table-responsive {
    border-top: 1px solid var(--tbi-soft-border);
    border-bottom: 1px solid var(--tbi-soft-border);
  }
}
