/* Accessibility and responsive fixes for header */

/* Base visual: ensure readable contrast on light background */
#ja-headerwrap, #ja-header { background: #ffffff !important; color: #111111 !important; }

/* New navbar look aligned with karpol.lt brand */
.navbar.navbar-expand-lg {
  background: #f7f9fb; /* subtle light background */
  border-bottom: 1px solid #e6eaf0;
  padding: 16px 12px;
}
.navbar .navbar-brand {
  display: flex; align-items: center; gap: 10px; margin-right: 12px;
}
.navbar .navbar-brand .kp-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.navbar .navbar-brand .kp-brand-title { font-weight: 700; color: #1f2937; font-size: 16px; }
.navbar .navbar-brand .kp-brand-sub { font-weight: 700; color: #880424; font-size: 13px; }
.navbar .navbar-brand .kp-logo { height: 40px; width: auto; }
.navbar .navbar-brand .kp-logo img { height: 40px; width: auto; }

#ja-header a, #ja-header a span,
#ja-header .logo-text span,
#ja-header .logo-text2 span {
  color: #111111 !important;
}

/* Provide comfortable spacing and containment */
#ja-header {
  padding: 10px 12px !important;
}

/* Prevent text from overflowing the header area */
#ja-header .logo-text span,
#ja-header .logo-text2 span {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

/* Responsive layout: stack header content gracefully on narrow screens */
@media (max-width: 1024px) {
  #ja-header .logo-text span,
  #ja-header .logo-text2 span {
    white-space: normal;
    word-break: break-word;
  }
}

@media (max-width: 768px) {
  #ja-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }
  #ja-header .logo, 
  #ja-header .ja-headermask { display: none !important; }

  .navbar .navbar-brand .kp-logo img { height: 32px; }
  .navbar .navbar-brand .kp-brand-sub { display: none; }
}

/* Fixed header + shrink on scroll */
.navbar.kp-fixed { position: fixed; top: 0; left: 0; right: 0; z-index: 1200; }
.navbar.kp-shrink { padding: 8px 12px; }
.navbar.kp-shrink .navbar-brand .kp-logo img { height: 24px; }
.navbar.kp-shrink .navbar-brand .kp-brand-sub { display: none; }
.navbar.kp-shrink .navbar-brand .kp-brand-title { font-size: 16px; }

/* In shrink mode show only first line from each user-info column */
.navbar.kp-shrink #user-info.header-user .hu-col .ui-line:not(:first-child) { display: none; }


/* Buttons/links inside header should be clearly visible */
#ja-header a.button, #ja-header .btn, #ja-header .button {
  background: #0f62fe; /* IBM blue-esque accessible color */
  color: #ffffff !important;
  border-radius: 4px;
  padding: 4px 10px;
}

/* User info block moved from absolute white text to readable */
#user-info.header-user {
  color: #111111 !important;
  background: transparent !important;
  padding: 2px 4px !important;
  font-size: 13px;
  line-height: 1.25;
  text-align: right;
}
#user-info.header-user .header-user-grid {
  display: flex; gap: 16px; align-items: center; flex-direction: row-reverse; /* right-most column is first */
}
#user-info.header-user .hu-col { display: flex; flex-direction: column; gap: 2px; }
#user-info.header-user .ui-line { white-space: nowrap; }
#user-info.header-user .ui-label { font-weight: 700; color: #111; margin-right: 6px; }
#user-info.header-user .ui-value { font-weight: 600; }
#user-info.header-user .value-ok { color: #22863a; }
#user-info.header-user .value-warn { color: #b26a00; } /* orange-ish */
#user-info.header-user select { max-width: 220px; }

/* Hide legacy user-info block that appears below header in index.tpl */
body > #user-info { display: none !important; }

@media (max-width: 1024px) {
  #user-info.header-user { text-align: left; margin: 6px 12px; }
  #user-info.header-user .header-user-grid { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* Ensure print styles do not break layout visibility in screen */
@media print {
  #ja-headerwrap, #ja-header { background: #ffffff !important; color: #000 !important; }
}

/* -------- Footer: fixed, slim, modern -------- */
body { margin: 0; }
body { padding-bottom: 48px; } /* reserve space for fixed footer */

#ja-footerwrap.fixed-footer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1100;
  background: #f7f9fb !important; /* override any gradients */
  border-top: 1px solid #e6eaf0; box-shadow: none !important;
}
#ja-footerwrap.fixed-footer #ja-footer {
  padding: 4px 8px; min-height: 36px; display: flex; align-items: center; justify-content: center;
}
#ja-footerwrap .copyright { color: #6b7280; font-size: 12px; }
#ja-footerwrap .copyright .sep { margin: 0 8px; opacity: .6; }
#ja-footerwrap .copyright a { color: #0066CC; }

/* remove any unwanted spacing from older templates */
#ja-footerwrap br { display: none !important; }
