/* Public header modernization — loaded after style.css */

:root {
  --header-brand: #da2127;
  --header-brand-hover: #b91c22;
  --header-muted: #64748b;
  --header-ink: #0f172a;
  --header-topbar-bg: #fafafa;
  --header-topbar-border: #e2e8f0;
  --header-surface: #ffffff;
  --header-shadow: 0 4px 20px rgba(15, 23, 42, 0.07);
  --header-control-h: 1.65rem;
  --header-radius-sm: 0.375rem;
  --header-radius-pill: 999px;
}

/* ----- Topbar (compact) ----- */
.header--modern .header-topbar {
  background-color: var(--header-topbar-bg);
  border-bottom: 1px solid var(--header-topbar-border);
  padding: 0.2rem 0;
}

.header--modern .header-topbar__inner {
  gap: 0.4rem 0.85rem;
  flex-wrap: wrap;
  min-height: var(--header-control-h);
}

.header--modern .header-topbar__actions {
  gap: 0.3rem;
  flex-wrap: nowrap;
  margin-left: auto;
}

.header--modern .site-slogan-wrap {
  min-width: 0;
  flex: 1 1 auto;
}

.header--modern .site-slogan {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.22em 0.38em;
  font-family: Rubik, system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(0.625rem, 1.35vw, 0.8125rem);
  letter-spacing: 0.06em;
  line-height: 1.15;
  text-transform: uppercase;
  color: var(--header-ink);
}

.header--modern .site-slogan__muted {
  color: var(--header-muted);
}

.header--modern .site-slogan__accent {
  color: var(--header-brand);
}

/* ----- Search form (modern) ----- */
.header--modern .header-topbar__search {
  position: relative;
  min-width: 10rem;
  max-width: 14.5rem;
  margin-right: 0 !important;
}

.header--modern .header-topbar__search .form-control {
  height: var(--header-control-h);
  border-radius: var(--header-radius-sm);
  border: 1px solid var(--header-topbar-border);
  background-color: var(--header-surface);
  padding: 0 1.85rem 0 0.55rem;
  font-size: 0.75rem;
  font-weight: 500;
  font-style: normal;
  color: var(--header-ink);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.header--modern .header-topbar__search .form-control::placeholder {
  color: #94a3b8;
  font-style: normal;
  font-weight: 400;
}

.header--modern .header-topbar__search .form-control:focus {
  border-color: var(--header-brand);
  background-color: #fff;
  box-shadow: 0 0 0 2px rgba(218, 33, 39, 0.1);
  outline: none;
}

.header--modern .header-topbar__search .header-topbar__search-btn {
  position: absolute;
  right: 0.15rem;
  left: auto;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: 0;
  border-radius: var(--header-radius-sm);
  background: transparent;
  color: var(--header-muted);
  font-size: 0.65rem;
  cursor: pointer;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.header--modern .header-topbar__search .header-topbar__search-btn:hover,
.header--modern .header-topbar__search .header-topbar__search-btn:focus {
  color: #fff;
  background-color: var(--header-brand);
  outline: none;
}

/* ----- Social icons ----- */
.header--modern .header-topbar .social-icons {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-right: 0 !important;
}

.header--modern .header-topbar .social-icons li {
  margin: 0 !important;
}

.header--modern .header-topbar .social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--header-control-h);
  height: var(--header-control-h);
  border-radius: var(--header-radius-sm);
  border: 1px solid transparent;
  color: var(--header-muted);
  font-size: 0.7rem;
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.header--modern .header-topbar .social-icons a:hover {
  color: var(--header-brand);
  background-color: rgba(218, 33, 39, 0.08);
  border-color: rgba(218, 33, 39, 0.15);
}

/* ----- Language dropdown (modern chip) ----- */
.header--modern .lang-dropdown .lang-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  height: var(--header-control-h) !important;
  min-height: 0;
  border: 1px solid var(--header-topbar-border);
  border-radius: var(--header-radius-sm);
  background: var(--header-surface);
  padding: 0 0.45rem !important;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--header-ink);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.header--modern .lang-dropdown .lang-dropdown-toggle:after {
  font-size: 0.55rem;
  margin-left: 0.1rem;
  color: var(--header-muted);
}

.header--modern .lang-dropdown .lang-dropdown-toggle:hover,
.header--modern .lang-dropdown .lang-dropdown-toggle:focus {
  border-color: rgba(218, 33, 39, 0.35);
  color: var(--header-brand);
  box-shadow: 0 0 0 2px rgba(218, 33, 39, 0.08);
}

.header--modern .lang-dropdown .lang-dropdown-toggle img {
  width: 14px;
  height: auto;
  margin-right: 0 !important;
}

.header--modern .lang-dropdown .dropdown-menu {
  min-width: 7.5rem !important;
  padding: 0.25rem !important;
  margin-top: 0.35rem;
  border: 1px solid var(--header-topbar-border);
  border-radius: var(--header-radius-sm);
  box-shadow: var(--header-shadow);
}

.header--modern .lang-dropdown .dropdown-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.5rem;
  border-radius: calc(var(--header-radius-sm) - 2px);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--header-ink);
}

.header--modern .lang-dropdown .dropdown-menu .dropdown-item img {
  width: 14px;
}

.header--modern .lang-dropdown .dropdown-menu .dropdown-item:hover,
.header--modern .lang-dropdown .dropdown-menu .dropdown-item:focus {
  background-color: rgba(218, 33, 39, 0.06);
  color: var(--header-brand);
}

/* ----- Navbar ----- */
.header--modern .sticky-navbar {
  background-color: #fff;
  transition: box-shadow 0.25s ease;
}

.header--modern .sticky-navbar.is-sticky {
  box-shadow: var(--header-shadow);
}

.header--modern .navbar > .container-fluid {
  gap: 0.5rem;
}

.header--modern .navbar-actions {
  display: flex !important;
  position: static !important;
  height: auto !important;
  margin-top: 0 !important;
  margin-right: 0 !important;
}

.header--modern .navbar-actions__buttons {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
}

/* ----- Navbar CTA buttons (modern) ----- */
.header--modern .navbar-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: auto !important;
  height: 2.125rem !important;
  padding: 0 0.85rem !important;
  border-radius: var(--header-radius-sm) !important;
  font-family: Rubik, system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  white-space: nowrap;
  overflow: visible;
  box-shadow: none;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.header--modern .navbar-actions .btn:before {
  display: none !important;
}

.header--modern .navbar-actions .btn span {
  display: inline;
}

.header--modern .navbar-actions .btn i {
  margin: 0 !important;
  font-size: 0.7rem;
  opacity: 0.9;
}

.header--modern .navbar-actions .btn__primary {
  background-color: var(--header-brand) !important;
  color: #fff !important;
  border: 1px solid var(--header-brand);
}

.header--modern .navbar-actions .btn__primary:hover,
.header--modern .navbar-actions .btn__primary:focus {
  background-color: var(--header-brand-hover) !important;
  border-color: var(--header-brand-hover);
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(218, 33, 39, 0.28);
  transform: translateY(-1px);
}

.header--modern .navbar-actions .btn__secondary {
  background-color: var(--header-surface) !important;
  color: var(--header-ink) !important;
  border: 1px solid #cbd5e1;
}

.header--modern .navbar-actions .btn__secondary:hover,
.header--modern .navbar-actions .btn__secondary:focus {
  background-color: var(--header-ink) !important;
  border-color: var(--header-ink);
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
  transform: translateY(-1px);
}

.header--modern .sticky-navbar.is-sticky .navbar-actions .btn {
  height: 2rem !important;
  padding: 0 0.75rem !important;
}

/* ----- Navbar menu (centered + modern) ----- */
@media (min-width: 992px) {
  .header--modern .navbar,
  .header--modern .navbar > .container-fluid {
    height: 76px;
    max-height: 76px;
  }

  .header--modern .sticky-navbar.is-sticky,
  .header--modern .sticky-navbar.is-sticky > .container-fluid {
    height: 64px !important;
    max-height: 64px !important;
  }

  .header--modern .navbar > .container-fluid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    column-gap: 1rem;
  }

  .header--modern .navbar .navbar-brand {
    grid-column: 1;
    justify-self: start;
    line-height: 1;
    padding-right: 1rem !important;
    margin-right: 0 !important;
    border-right: 0 !important;
  }

  .header--modern .navbar .navbar-brand .logo {
    max-height: 52px;
    width: auto;
  }

  .header--modern .sticky-navbar.is-sticky .navbar-brand .logo {
    max-height: 44px;
  }

  .header--modern .navbar .navbar-collapse {
    grid-column: 2;
    justify-self: center;
    display: flex !important;
    flex: none;
    width: auto;
    justify-content: center;
  }

  .header--modern .navbar-actions {
    grid-column: 3;
    justify-self: end;
    padding-left: 1rem !important;
    margin-left: 0 !important;
    border-left: 0 !important;
  }

  .header--modern .navbar .navbar-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    margin: 0 !important;
  }

  .header--modern .navbar .nav__item {
    margin-right: 0;
    border-bottom: 0;
  }

  .header--modern .navbar .nav__item .nav__item-link {
    display: inline-flex;
    align-items: center;
    min-height: 2.25rem;
    padding: 0.35rem 0.65rem;
    padding-right: 1.35rem;
    line-height: 1.2 !important;
    font-family: Rubik, system-ui, sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: none;
    color: var(--header-ink);
    border-radius: var(--header-radius-sm);
    transition: color 0.18s ease, background-color 0.18s ease;
  }

  .header--modern .navbar .nav__item .nav__item-link:before {
    display: none;
  }

  .header--modern .navbar .nav__item .nav__item-link:hover,
  .header--modern .navbar .nav__item .nav__item-link.active {
    color: var(--header-brand);
    background-color: rgba(218, 33, 39, 0.07);
  }

  .header--modern .navbar .nav__item.has-dropdown > .nav__item-link {
    padding-right: 1.5rem;
  }

  .header--modern .navbar button.dropdown-toggle:not(.lang-dropdown-toggle) {
    right: 0.35rem;
    width: 1rem;
    height: 1rem;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .header--modern .navbar .dropdown-toggle:after {
    font-size: 0.55rem;
    color: var(--header-muted);
    right: 0.15rem;
    transition: color 0.18s ease, transform 0.18s ease;
  }

  .header--modern .navbar .nav__item:hover .dropdown-toggle:after,
  .header--modern .navbar .nav__item.show .dropdown-toggle:after {
    color: var(--header-brand);
  }

  .header--modern .navbar .dropdown-menu {
    min-width: 12rem;
    margin-top: 0.35rem;
    padding: 0.35rem;
    border: 1px solid var(--header-topbar-border);
    border-radius: var(--header-radius-sm);
    box-shadow: var(--header-shadow);
  }

  .header--modern .navbar .dropdown-menu .nav__item {
    padding: 0;
    margin: 0;
  }

  .header--modern .navbar .dropdown-menu .nav__item .nav__item-link {
    position: relative;
    display: block;
    padding: 0.45rem 0.65rem;
    line-height: 1.35 !important;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--header-ink);
    border-bottom: 0;
    border-radius: calc(var(--header-radius-sm) - 2px);
    transition: color 0.18s ease, background-color 0.18s ease;
  }

  .header--modern .navbar .dropdown-menu .nav__item .nav__item-link:after {
    display: none;
  }

  .header--modern .navbar .dropdown-menu .nav__item .nav__item-link:hover {
    color: var(--header-brand);
    background-color: rgba(218, 33, 39, 0.06);
  }

  .header--modern .sticky-navbar.is-sticky .nav__item .nav__item-link {
    min-height: 2rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    line-height: 1.2 !important;
  }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
  .header--modern .navbar .nav__item .nav__item-link {
    font-size: 0.75rem;
    padding-left: 0.5rem;
    padding-right: 1.15rem;
  }

  .header--modern .navbar .nav__item.has-dropdown > .nav__item-link {
    padding-right: 1.35rem;
  }

  .header--modern .navbar > .container-fluid {
    column-gap: 0.65rem;
  }
}

/* Mobile menu polish */
@media (max-width: 991.98px) {
  .header--modern .navbar > .container-fluid {
    display: flex;
    align-items: center;
  }

  /* Hamburger is absolute right:15px — keep action CTAs clear of it */
  .header--modern .navbar-actions {
    margin-left: auto !important;
    margin-right: 2.75rem !important;
    margin-top: 0 !important;
  }

  .header--modern .navbar .navbar-collapse .navbar-nav {
    padding-top: 3.75rem;
  }

  .header--modern .navbar .nav__item {
    border-bottom: 1px solid var(--header-topbar-border);
  }

  .header--modern .navbar .nav__item .nav__item-link {
    font-family: Rubik, system-ui, sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: none;
    color: var(--header-ink);
    line-height: 2.75rem !important;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .header--modern .navbar .nav__item .nav__item-link:before {
    display: none;
  }

  .header--modern .navbar .nav__item .nav__item-link:hover,
  .header--modern .navbar .nav__item .nav__item-link.active {
    color: var(--header-brand);
    background-color: rgba(218, 33, 39, 0.05);
  }

  .header--modern .navbar .dropdown-menu {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    background-color: #f8fafc;
  }

  .header--modern .navbar .dropdown-menu .nav__item .nav__item-link {
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 2.5rem !important;
    padding-left: 1.75rem;
    border-bottom: 1px solid var(--header-topbar-border);
  }

  /* Close sits on the right edge of the 240px drawer, above menu items */
  .header--modern .navbar .close-mobile-menu {
    top: 0.75rem;
    left: 12.25rem; /* ~240px panel - button - inset */
    right: auto;
    border-color: var(--header-topbar-border);
    color: var(--header-ink);
    font-size: 0.85rem;
    background-color: #fff;
  }
}

/* Visually hidden helper if theme lacks Bootstrap .sr-only */
.header--modern .sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ----- Responsive ----- */
@media (max-width: 991.98px) {
  .header--modern .header-topbar__inner {
    align-items: center;
  }

  .header--modern .site-slogan {
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
  }

  .header--modern .header-topbar__search {
    min-width: 8.5rem;
    max-width: 10.5rem;
  }

  .header--modern .navbar-actions .btn {
    height: 2rem !important;
    padding: 0 0.65rem !important;
    font-size: 0.6875rem;
  }
}

@media (max-width: 767.98px) {
  .header--modern .header-topbar {
    padding: 0.15rem 0;
  }

  .header--modern .header-topbar__inner {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .header--modern .header-topbar__actions {
    margin-left: auto;
    width: auto;
    justify-content: flex-end;
    flex: 0 0 auto;
  }

  .header--modern .header-topbar__search {
    flex: 1 1 8rem;
    min-width: 0;
    max-width: none;
  }

  .header--modern .header-topbar .social-icons {
    display: none;
  }

  .header--modern .lang-dropdown .lang-dropdown-toggle span {
    display: none;
  }

  .header--modern .lang-dropdown .lang-dropdown-toggle {
    padding: 0 0.35rem !important;
  }

  .header--modern .site-slogan {
    font-size: 0.625rem;
    gap: 0.18em 0.3em;
    flex: 1 1 100%;
  }

  .header--modern .navbar-actions .btn span {
    display: none;
  }

  .header--modern .navbar-actions .btn {
    min-width: 2.125rem !important;
    width: 2.125rem;
    padding: 0 !important;
  }
}

@media (max-width: 575.98px) {
  .header--modern .site-slogan {
    max-width: 100%;
  }
}
