/*
 * Site Overrides
 * 
 * Single source of truth for typography and component styles.
 * Loaded LAST in base.html to override the legacy CSS.
 * Scoped to #main-content so header/nav/footer keep their own styles.
 */

/* Force light mode — prevent browser dark mode from affecting form controls */
:root,
[data-bs-theme="light"] {
  color-scheme: light !important;
}

body {
  background-color: #fbfbfc !important;
}

#main-content {
  background-color: transparent !important;
}

#main-content > .container-sr,
#main-content > .home-content + .container-sr {
  background-color: #fbfbfc;
}

/* Override dark form background (layout.css sets form { background-color: rgba(33,37,41,1) }) */
#main-content form {
  background-color: transparent !important;
  border: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

/* ============================================
   TYPOGRAPHY (main content only)
   ============================================ */

/* Body text */
#main-content,
#main-content p,
#main-content ul li,
#main-content ol li {
  font-family: Yantramanav, sans-serif !important;
  font-size: 19px !important;
  font-weight: 500 !important;
  color: #231f20 !important;
  line-height: 135% !important;
}

/* Links in content */
#main-content a {
  color: #498bca !important;
  text-decoration: none !important;
}

#main-content a:hover,
#main-content a:focus {
  color: #0c4269 !important;
}

/* Headings in content */
#main-content h1:not(.banner-title):not(.tool-banner h1),
#main-content h2,
#main-content h3,
#main-content h4,
#main-content h5,
#main-content h6 {
  font-family: Yantramanav, sans-serif !important;
  color: #0c4269 !important;
  font-weight: 900 !important;
  line-height: 105% !important;
}

#main-content h1:not(.banner-title) { font-size: 36px !important; }
#main-content h2 { font-size: 28px !important; }
#main-content h3 { font-size: 24px !important; }
#main-content h4 { font-size: 20px !important; }
#main-content h5 { font-size: 18px !important; }
#main-content h6 { font-size: 16px !important; }

/* Heading links inherit heading color */
#main-content h1 a,
#main-content h2 a,
#main-content h3 a,
#main-content h4 a,
#main-content h5 a,
#main-content h6 a {
  color: #0c4269 !important;
}

#main-content h1 a:hover,
#main-content h2 a:hover,
#main-content h3 a:hover,
#main-content h4 a:hover,
#main-content h5 a:hover,
#main-content h6 a:hover {
  color: #498bca !important;
}

/* ============================================
   BUTTONS (site-wide)
   ============================================ */

#main-content .button,
#main-content a.button {
  background: #498bca !important;
  border: 1px solid #498bca !important;
  border-radius: 24px !important;
  font-family: Yantramanav, sans-serif !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  height: 48px !important;
  padding: 12px 24px !important;
  color: #fff !important;
  text-decoration: none !important;
}

#main-content .button:hover,
#main-content .button:focus,
#main-content a.button:hover,
#main-content a.button:focus {
  background: #0c4269 !important;
  border: 1px solid #0c4269 !important;
  color: #fff !important;
}

/* ============================================
   FORMS (Bootstrap form-control overrides)
   Force light appearance regardless of browser dark mode.
   Scoped to #main-content only to avoid breaking header/nav.
   ============================================ */

#main-content .form-control,
#main-content .form-select,
#main-content input[type="text"],
#main-content input[type="email"],
#main-content input[type="password"],
#main-content input[type="tel"],
#main-content input[type="number"],
#main-content input[type="date"],
#main-content input[type="time"],
#main-content input[type="search"],
#main-content input[type="url"],
#main-content select,
#main-content textarea {
  background-color: #fff !important;
  color: #231f20 !important;
  border: 1px solid #d7d9e3 !important;
  border-radius: 4px !important;
  padding: 0.5rem 0.75rem !important;
  font-family: Yantramanav, sans-serif !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
}

#main-content .form-control:focus,
#main-content .form-select:focus,
#main-content input:focus,
#main-content select:focus,
#main-content textarea:focus {
  background-color: #fff !important;
  color: #231f20 !important;
  border-color: #498bca !important;
  box-shadow: 0 0 0 0.2rem rgba(73, 139, 202, 0.25) !important;
  outline: none !important;
}

#main-content .form-label,
#main-content label {
  font-family: Yantramanav, sans-serif !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #231f20 !important;
}

#main-content fieldset legend {
  font-family: Yantramanav, sans-serif !important;
  font-size: 22px !important;
  font-weight: 900 !important;
  color: #0c4269 !important;
  border-bottom: 2px solid #d7d9e3;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

#main-content .form-text {
  font-size: 14px !important;
  color: #6c757d !important;
}

#main-content .invalid-feedback {
  color: #dc3545 !important;
  font-size: 14px !important;
}

#main-content .alert {
  font-size: 16px !important;
}

/* Bootstrap buttons in forms */
#main-content .btn-primary {
  background-color: #498bca !important;
  border-color: #498bca !important;
  color: #fff !important;
  font-family: Yantramanav, sans-serif !important;
  font-weight: 700 !important;
  border-radius: 24px !important;
  padding: 0.5rem 1.5rem !important;
}

#main-content .btn-primary:hover,
#main-content .btn-primary:focus {
  background-color: #0c4269 !important;
  border-color: #0c4269 !important;
  color: #fff !important;
}

#main-content .btn-outline-secondary {
  background-color: #fff !important;
  color: #231f20 !important;
  border-color: #d7d9e3 !important;
  font-family: Yantramanav, sans-serif !important;
  font-weight: 700 !important;
  border-radius: 24px !important;
  padding: 0.5rem 1.5rem !important;
}

#main-content .btn-outline-secondary:hover,
#main-content .btn-outline-secondary:focus {
  background-color: #f8f9fa !important;
  border-color: #231f20 !important;
}

/* ============================================
   BANNER / HERO (homepage specific)
   ============================================ */

.banner-title {
  font-family: Josefin Sans, sans-serif !important;
  font-size: 58px !important;
  font-weight: 700 !important;
  color: #0c4269 !important;
  line-height: 110% !important;
}

.banner-tag {
  font-family: Yantramanav, sans-serif !important;
  font-size: 18px !important;
  font-weight: 500 !important;
  color: #231f20 !important;
}

@media (max-width: 768px) {
  .banner-title {
    font-size: 40px !important;
  }
}

@media (max-width: 480px) {
  .banner-title {
    font-size: 32px !important;
  }
}

/* ============================================
   USER MENU DROPDOWN (header)
   ============================================ */

.user-menu-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.user-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: 24px;
  background: #498bca;
  color: #ffffff;
  text-decoration: none;
  font-family: Yantramanav, sans-serif;
  font-size: 18px;
  font-weight: 700;
  height: 48px;
  cursor: pointer;
  transition: all 0.2s;
}

.user-menu-toggle:hover {
  background: #0c4269;
  border: 1px solid #0c4269;
  color: #fff;
}

.user-menu-toggle:hover .user-avatar {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.user-menu-toggle:hover .user-name {
  color: #fff;
}

.user-menu-toggle:hover .user-chevron {
  color: rgba(255, 255, 255, 0.7);
}

.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.user-name {
  color: #ffffff !important;
}

.user-chevron {
  transition: transform 0.2s;
  color: rgba(255, 255, 255, 0.7);
}

.user-menu-wrapper.open .user-chevron {
  transform: rotate(180deg);
}

.user-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 12px;
  padding: 8px 0;
  min-width: 220px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 1000;
}

.user-menu-wrapper.open .user-dropdown {
  display: block;
}

.user-dropdown-header {
  padding: 12px 16px;
}

.user-dropdown-name {
  display: block;
  font-family: Yantramanav, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #0c4269;
}

.user-dropdown-email {
  display: block;
  font-family: Yantramanav, sans-serif;
  font-size: 13px;
  color: #6c757d;
  margin-top: 2px;
}

.user-dropdown-divider {
  height: 1px;
  background: #e8eaed;
  margin: 4px 0;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: #0c4269 !important;
  text-decoration: none !important;
  font-family: Yantramanav, sans-serif;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s;
}

.user-dropdown-item:hover {
  background: #f0f4f8;
  color: #0c4269 !important;
}

.user-dropdown-item i {
  width: 16px;
  text-align: center;
  color: #0c4269;
  font-size: 14px;
}

.user-dropdown-item:hover i {
  color: #0c4269;
}

.user-dropdown-item--logout {
  color: #dc3545 !important;
}

.user-dropdown-item--logout i {
  color: #dc3545;
}

.user-dropdown-item--logout:hover {
  background: #fdf0f0;
  color: #dc3545 !important;
}

.user-login-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: 24px;
  background: #498bca;
  color: #ffffff !important;
  text-decoration: none !important;
  font-family: Yantramanav, sans-serif;
  font-size: 18px;
  font-weight: 700;
  height: 48px;
  transition: all 0.2s;
}

.user-login-link:hover {
  background: #0c4269;
  border: 1px solid #0c4269;
  color: #fff !important;
}

.user-login-link i {
  font-size: 18px;
}

/* ===== Form Card (dark background matching original forms) ===== */

.form-card {
  background-color: #212529;
  padding: 40px;
  border-radius: 0;
  max-width: 600px;
}

.form-card .form-card__title {
  background-color: #0C4269;
  color: #fff;
  font-family: 'Yantramanav', sans-serif;
  font-size: 24px;
  font-weight: 700;
  padding: 20px 40px;
  margin: -40px -40px 30px -40px;
}

.form-card label {
  color: #fff;
  font-weight: 500;
}

.form-card .form-control {
  background-color: #fff;
  border: none;
  border-radius: 0;
  padding: 10px;
  font-size: 16px;
  color: #231f20;
}

.form-card .form-control::placeholder {
  color: #d7d9e3;
}

.form-card .form-control:focus {
  box-shadow: 0 0 0 2px #498bca;
  outline: none;
}

.form-card .button,
.form-card button[type="submit"] {
  background-color: #0C4269;
  border: 1px solid #0C4269;
  color: #fff;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 0;
  font-size: 16px;
  cursor: pointer;
}

.form-card .button:hover,
.form-card button[type="submit"]:hover {
  background-color: #415239;
  border-color: #415239;
}

.form-card .text-muted {
  color: #aaa !important;
}

.form-card .invalid-feedback {
  color: #ff6b6b;
}

/* ===== Page Banner (light blue with decorative icon + border) ===== */

.page-banner {
  background-color: #e5f2f9 !important;
  padding: 80px 20px 60px;
  position: relative;
  text-align: center;
}

.page-banner__border {
  display: block;
  width: 100%;
  height: 40px;
  object-fit: cover;
  margin-top: 40px;
}

.page-banner:before {
  background: url("../images/theme/banner-image.21e1b5596396.svg") no-repeat;
  background-size: 100%;
  content: "";
  height: 119px;
  left: 30px;
  position: absolute;
  top: 30px;
  width: 119px;
}

.page-banner:after {
  display: none;
}

@media (max-width: 1200px) {
  .page-banner:before {
    height: 85px;
    left: 20px;
    top: 20px;
    width: 85px;
  }
}

@media (max-width: 768px) {
  .page-banner {
    padding: 60px 20px 140px;
  }
  .page-banner:before {
    height: 60px;
    left: 15px;
    top: 15px;
    width: 60px;
  }
}

@media (max-width: 480px) {
  .page-banner:before {
    display: none;
  }
}


/* ===== Tool Cards (toolkit listing page) ===== */
.tool-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 15px;
}

.tool-count {
  font-family: Yantramanav, sans-serif;
  font-size: 16px;
  color: #6c757d;
}

.tool-search {
  max-width: 300px;
  width: 100%;
}

.tool-search .form-control {
  border: 1px solid #d7d9e3 !important;
  border-radius: 24px !important;
  padding: 10px 20px !important;
  font-family: Yantramanav, sans-serif !important;
  font-size: 16px !important;
}

#main-content #tool-search-input {
  border-radius: 24px !important;
  padding: 10px 20px !important;
  border: 2px solid #498bca !important;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.tool-card {
  background: #f0f7fc;
  border: 1px solid #e8eaed;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(12, 66, 105, 0.08);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: box-shadow 0.2s, transform 0.2s;
}

.tool-card:hover {
  box-shadow: 0 6px 20px rgba(12, 66, 105, 0.15);
  transform: translateY(-2px);
  background: #e5f2f9;
}

.tool-card__title {
  font-family: Yantramanav, sans-serif !important;
  font-size: 22px !important;
  font-weight: 700 !important;
  color: #0c4269 !important;
  margin-bottom: 12px;
}

.tool-card__title a {
  color: #0c4269 !important;
  text-decoration: none !important;
}

.tool-card__title a:hover {
  color: #498bca !important;
}

.tool-card__desc {
  font-family: Yantramanav, sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: #231f20;
  line-height: 1.5;
  margin-bottom: 16px;
}

.tool-card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid #e8eaed;
}

.tool-card__download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #FFF3E0;
  color: #FAA21B !important;
  text-decoration: none !important;
  font-size: 16px;
  transition: background 0.2s, color 0.2s;
}

.tool-card__download:hover,
.tool-card__download:focus {
  background: #FAA21B;
  color: #fff !important;
}

#main-content .tool-card__download:hover,
#main-content .tool-card__download:focus {
  color: #fff !important;
}

.tool-card__link {
  font-family: Yantramanav, sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #498bca !important;
  text-decoration: none !important;
}

.tool-card__link:hover {
  color: #0c4269 !important;
}

.tool-card__link i {
  margin-left: 4px;
  font-size: 12px;
}

@media (max-width: 600px) {
  .tool-grid {
    grid-template-columns: 1fr;
  }
}







/* ===== Tool Sub-Page Banner links ===== */
#main-content .tool-controls a {
  color: #fff !important;
}

#main-content .tool-controls a:hover,
#main-content .tool-controls a:focus {
  color: #a8d4f0 !important;
}


/* ===== Tool action bar spacing ===== */
.tool-controls .action-btns a {
  margin-left: 20px;
}


/* ===== Global button hover consistency ===== */
.header__button.button:hover,
.header__button.button:focus,
a.button:hover,
a.button:focus {
  background: #0c4269 !important;
  border-color: #0c4269 !important;
  color: #fff !important;
}

/* ===== Compact banner (sub-views: calendar, map, split) ===== */
/* Same banner structure as main pages, just shorter */
.home-content .span12 .row-number-1.banner-compact {
  padding: 60px 20px 80px !important;
}

.home-content .span12 .row-number-1.banner-compact:before {
  display: none !important;
}

@media (max-width: 768px) {
  .home-content .span12 .row-number-1.banner-compact {
    padding: 50px 20px 60px !important;
  }
  .home-content .span12 .row-number-1.banner-compact:before {
    height: 35px !important;
    width: 35px !important;
  }
}
