/*
 * site-chrome.css — extracted inline <style> blocks from partials
 * (header.html navbar responsive, breadcrumbs, badge-toast).
 * Was previously inlined into every page (all 2300+ HTML files);
 * now one cached stylesheet loaded via head.html.
 */

/* ==== header.html: Responsive navbar ==== */
<style>
/* Responsive: reduce font/padding on medium screens */
@media (max-width: 1199px) and (min-width: 992px) {
  .navbar-nav > li > a {
    padding-left: 10px;
    padding-right: 10px;
    font-size: 13px;
  }
  .navbar-form .form-control {
    width: 140px;
  }
}

/* Dropdown menu styling */
.dropdown-menu {
  min-width: 220px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
  border: 1px solid rgba(0, 0, 0, 0.15);
}

/* 3-level submenu support (Bootstrap 3 workaround) */
.dropdown-submenu {
  position: relative;
}
.dropdown-submenu > .dropdown-menu {
  top: 0;
  left: 100%;
  margin-top: -1px;
  margin-left: -1px;
}
.dropdown-submenu:hover > .dropdown-menu,
.dropdown-submenu:focus-within > .dropdown-menu {
  display: block;
}
.dropdown-submenu > a::after {
  display: block;
  content: ' ';
  float: right;
  width: 0;
  height: 0;
  border-color: transparent;
  border-style: solid;
  border-width: 5px 0 5px 5px;
  border-left-color: #999;
  margin-top: 5px;
  margin-right: -10px;
}
.dropdown-submenu:hover > a::after {
  border-left-color: #333;
}
@media (max-width: 767px) {
  .dropdown-submenu > .dropdown-menu {
    position: static;
    left: auto;
    margin-top: 0;
    margin-left: 0;
  }
  .dropdown-submenu > a::after {
    display: none;
  }
}

/* Ensure navbar-collapse content stays on one line on desktop */
@media (min-width: 768px) {
  .navbar-collapse {
    display: flex !important;
    align-items: center;
    width: 100%;
  }

  .navbar-nav {
    flex: 1;
    display: flex;
    align-items: center;
  }

  .navbar-nav > li > a {
    white-space: nowrap;
  }

  .navbar-form {
    display: flex;
    align-items: center;
    margin: 0;
  }
}

.dropdown-menu > li > a {
  padding: 8px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.menu-icon {
  margin-right: 8px;
}

.dropdown-menu .label {
  font-size: 0.7rem;
  padding: 3px 8px;
}

/* Active state */
.navbar-nav > .active > a,
.navbar-nav > .active > a:hover,
.navbar-nav > .active > a:focus {
  background-color: var(--green-primary);
  color: #fff;
}

/* Search form */
.navbar-form {
  margin-left: 15px;
  padding: 0;
}

.navbar-form .form-control {
  width: 180px;
  transition: width 0.3s;
}

.navbar-form .form-control:focus {
  width: 250px;
}

/* Mobile adjustments */
@media (max-width: 767px) {
  .navbar-form {
    margin-top: 15px;
    margin-bottom: 15px;
    width: 100%;
  }

  .navbar-form .form-control {
    width: 100%;
  }

  .navbar-form .form-control:focus {
    width: 100%;
  }

  .dropdown-menu {
    position: static;
    float: none;
    width: auto;
    box-shadow: none;
    border: none;
  }

  .navbar-nav .open .dropdown-menu {
    background-color: #f8f9fa;
  }

  .navbar-nav .open .dropdown-menu > li > a {
    color: #333;
    padding-left: 30px;
  }
}

/* Logo responsive sizing */
.site-logo {
  height: 75px !important;
  width: auto;
  object-fit: contain;
  transition: height 0.3s ease;
}

@media (max-width: 992px) {
  .site-logo {
    height: 70px !important;
  }
}

@media (max-width: 768px) {
  .site-logo {
    height: 60px !important;
  }
}

@media (max-width: 576px) {
  .site-logo {
    height: 45px !important;
  }
  .site-title-label {
    display: none;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .dropdown-menu {
    background-color: #2c2c2c;
    border-color: #444;
  }

  .dropdown-menu > li > a {
    color: #e0e0e0;
  }

  .dropdown-menu > li > a:hover,
  .dropdown-menu > li > a:focus {
    background-color: #3c3c3c;
    color: #fff;
  }

  .navbar-nav .open .dropdown-menu {
    background-color: #2c2c2c;
  }

  .navbar-nav .open .dropdown-menu > li > a {
    color: #e0e0e0;
  }

  .navbar-form .form-control {
    background-color: #3c3c3c;
    border-color: #555;
    color: #e0e0e0;
  }

  .navbar-form .form-control:focus {
    background-color: #4c4c4c;
    border-color: #007bff;
    color: #fff;
  }

  .navbar-form .form-control::placeholder {
    color: #999;
  }
}

/* Search form styling */
.search-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  position: relative;
}

.search-form {
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
  max-width: 400px;
}

.search-input {
  flex: 1;
  padding: 8px 40px 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px 0 0 4px;
  font-size: 14px;
  background-color: #fff;
  color: #333;
  transition: all 0.3s;
}

.search-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-submit {
  padding: 8px 15px;
  background-color: var(--green-primary);
  color: #fff;
  border: 1px solid var(--green-primary);
  border-radius: 0 4px 4px 0;
  font-size: 14px;
  transition: all 0.3s;
}

.search-submit:hover {
  background-color: var(--green-dark);
  border-color: var(--green-dark);
}

.search-clear {
  position: absolute;
  right: 50px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 5px;
  font-size: 14px;
}

.search-clear:hover {
  color: #333;
}

.hidden {
  display: none !important;
}

/* Search results display */
#search-results {
  position: absolute;
  top: 100%;
  right: 0;
  width: 600px;
  max-height: 500px;
  overflow-y: auto;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  padding: 15px;
  margin-top: 5px;
}

.search-result-item {
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.search-result-link:hover {
  background-color: #f8f9fa;
  margin: -10px;
  padding: 10px;
}

.search-result-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--blue-primary);
  margin-bottom: 5px;
}

.search-result-excerpt {
  font-size: 14px;
  color: #666;
  line-height: 1.4;
}

.search-no-results,
.search-error {
  text-align: center;
  padding: 20px;
  color: #666;
  font-style: italic;
}

#search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: 999;
}

/* Search mobile adjustments */
@media (max-width: 768px) {
  #search-results {
    left: 0;
    right: 0;
    width: auto;
    max-height: 400px;
  }

  .search-form {
    max-width: 100%;
  }
}

/* ==== breadcrumbs.html ==== */
<style > .breadcrumb {
  background-color: transparent;
  padding: 8px 0;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: '›';
  color: #6c757d;
}

.breadcrumb-item a {
  color: #007bff;
  text-decoration: none;
}

.breadcrumb-item a:hover {
  color: #0056b3;
  text-decoration: underline;
}

.breadcrumb-item.active {
  color: #6c757d;
}

@media (prefers-color-scheme: dark) {
  .breadcrumb-item a {
    color: #66b0ff;
  }

  .breadcrumb-item a:hover {
    color: #3395ff;
  }

  .breadcrumb-item.active {
    color: #adb5bd;
  }
}

/* ==== badge-toast.html ==== */
<style > .badge-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
  pointer-events: none;
}

.badge-toast {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border-left: 4px solid #f1c40f;
  transform: translateX(120%);
  opacity: 0;
  transition:
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.3s ease;
  pointer-events: auto;
  cursor: pointer;
}

.badge-toast.visible {
  transform: translateX(0);
  opacity: 1;
}

.badge-toast.dismissing {
  transform: translateX(120%);
  opacity: 0;
  transition:
    transform 0.3s ease-in,
    opacity 0.3s ease;
}

.badge-toast-icon {
  font-size: 2rem;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(241, 196, 15, 0.15);
  border-radius: 50%;
}

.badge-toast-body {
  flex: 1;
  min-width: 0;
}

.badge-toast-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.badge-toast-xp {
  font-size: 0.8rem;
  color: #f1c40f;
  font-weight: 600;
}

.badge-toast-close {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
  padding: 4px;
  border: none;
  background: none;
  cursor: pointer;
  transition: color 0.2s;
}

.badge-toast-close:hover {
  color: rgba(255, 255, 255, 0.9);
}

/* Dark mode uses same dark gradient — already optimized for dark */

/* Mobile: full-width toast */
@media (max-width: 480px) {
  .badge-toast-container {
    left: 12px;
    right: 12px;
    max-width: none;
    bottom: 12px;
  }

  .badge-toast {
    padding: 12px 14px;
  }
}
