/* ========================================
   Header Styles – Floating Rounded Design
   ======================================== */

/* Base Header */
#opacity {
  position: absolute;
  width: 100%;
  opacity: 1;
  z-index: 1000;
}

.navbar {
  padding: 0rem;
}

.navbar a {
  color: #fff;
}

/* Sub-nav row is inside the nav — corners stay on the nav at all times */

/* ---- Full-width header with rounded bottom corners ---- */
.modern-header-float {
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  border-radius: 0 0 1.25rem 1.25rem !important;
  transition:
    background 0.35s ease,
    box-shadow 0.35s ease,
    backdrop-filter 0.35s ease;
}

/* Transparent state (home page, before scroll) — gradient so the video shows through */
.modern-header-transparent {
  background: linear-gradient(
    to bottom,
    rgba(11, 76, 140, 0.8) 0%,
    rgba(11, 76, 140, 0.45) 60%,
    rgba(11, 76, 140, 0) 100%
  ) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
}

/* Solid state (scrolled / inner pages) */
.modern-header-solid {
  background: var(--color-primary) !important;
  box-shadow: 0 6px 24px rgba(11, 76, 140, 0.3) !important;
}

/* Legacy gradient class kept for compat */
.custom {
  background: rgba(11, 76, 140, 0.55);
}

/* Logo Styles */
.logo {
  /* padding-right: 5%; */
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.logo img {
  /* max-width: 9.375rem !important; */
  float: right;
}

.navbar-brand {
  margin-left: 0 !important;
  /* padding-left: 0.625rem; */
}

/* Language Area Styles */
.langarea {
  display: none; /* hidden — lang button now lives inside header-row-2-controls */
}

.lang {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-family: "SourceSansPro", Arial;
  font-size: 0.875rem;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
}

#lang img {
  margin-right: 0.3125rem;
}

/* ---- Desktop Search pill ---- */
.search-control {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  border-radius: 1.5rem;
  overflow: hidden;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.search-control:focus-within {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
}

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

.search-input {
  background: transparent;
  width: 10rem;
  border: none;
  outline: none;
  height: 2rem;
  color: #fff;
  padding: 0 0.625rem;
  font-size: 0.8125rem;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 0 0.5rem;
  background: transparent;
  cursor: pointer;
  height: 2rem;
  flex-shrink: 0;
}

.search-btn img {
  width: 1.25rem;
  height: 1.25rem;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.search-btn:hover img {
  opacity: 1;
}

/* ---- Desktop Language pill ---- */
.lang-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 1.5rem;
  padding: 0.3rem 0.875rem;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.lang-pill img {
  width: 1.1rem;
  height: 1.1rem;
  opacity: 0.9;
  flex-shrink: 0;
}

.lang-pill:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

/* Row 2 flex wrapper — main nav + search + language on the same row */
.header-row-2 {
  display: flex;
  align-items: center;
  width: 100%;
  padding-bottom: 0.625rem;
}

/* Push controls (search + lang) to the opposite end of the main nav */
.header-row-2-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-right: auto; /* RTL: pushes to far left */
  flex-shrink: 0;
}

html[dir="ltr"] .header-row-2-controls {
  margin-right: 0;
  margin-left: auto; /* LTR: pushes to far right */
}

#First {
  padding-right: 1% !important;
  padding-top: 0.625rem;
  padding-bottom: 0;
}

#First .nav-link {
  color: #fff;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

#First .nav-item {
  position: relative;
}

#First .nav-item:after {
  content: "";
  display: block;
  margin: auto;
  height: 0.1875rem;
  width: 0;
  background: transparent;
  transition:
    width 0.2s ease,
    background-color 0.2s ease;
}

#First .nav-item:hover:after {
  width: 100%;
  background: var(--color-secondary);
}

/* Second Row Navigation */
#Second {
  padding-top: 0;
  padding-bottom: 0.625rem;
  padding-right: 1% !important;
}

#Second .nav-link {
  color: #fff;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

#Second .nav-item {
  position: relative;
}

#Second .nav-item:after {
  content: "";
  display: block;
  margin: auto;
  height: 0.1875rem;
  width: 0;
  background: transparent;
  transition:
    width 0.2s ease,
    background-color 0.2s ease;
}

#Second .nav-item:hover:after {
  width: 100%;
  background: var(--color-secondary);
}

/* Heading Classes - Matching original SiteAr.css */
#opacity .heading13,
#Second .nav-link {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #fff;
}

#opacity .heading15,
#First .nav-link {
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
}

/* Mobile Toggle */
.mobbar {
  display: none;
}

.navbar-toggler {
  border: none !important;
  background: transparent;
}

.navbar-toggler i {
  color: #fff;
}

/* ========================================
   Desktop Styles (75rem and up)
   ======================================== */
@media (min-width: 1200px) {
  .dropdown:hover .dropdown-menu {
    display: block;
    margin-top: 0;
    border-radius: 0;
  }

  .navbar-collapse {
    display: flex !important;
  }

  .mobbar {
    display: none !important;
  }
}

/* Large screens */
@media (min-width: 1800px) {
  .logo {
    padding-right: 10%;
  }
}

/* ========================================
   Mobile/Tablet Styles (below 75rem)
   ======================================== */
@media (max-width: 1199px) {
  .modern-header-float {
    border-radius: 0 0 1rem 1rem !important;
    flex-wrap: nowrap !important; /* no wrapping on mobile — no sub-nav row */
  }

  .modern-header-solid,
  .modern-header-transparent {
    background: var(--color-primary) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .logo {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .logo img {
    max-width: 3.75rem !important;
  }

  #opacity {
    opacity: 1;
    padding-top: 0;
  }

  .navbar {
    padding-bottom: 0;
    align-items: center;
    justify-content: space-between;
  }

  .mobbar {
    display: flex !important;
    align-items: center;
  }

  .navbar-dark .navbar-toggler {
    color: #fff !important;
  }

  /* Hide desktop collapse entirely on mobile — overlay handles navigation */
  .navbar-collapse,
  .navbar-collapse.show {
    display: none !important;
  }

  /* Hide sub-nav row on mobile */
  #sub-nav-row {
    display: none !important;
  }
}

@media (max-width: 991px) {
  .logo img {
    width: 3.125rem !important;
  }

  .logo {
    padding-top: 0.3125rem;
    padding-bottom: 0.3125rem;
  }
}

@media (max-width: 768px) {
  .logo img {
    width: 3.4375rem !important;
  }

  .logo {
    padding-top: 0.3125rem;
    padding-bottom: 0.3125rem;
  }

  #First {
    padding-top: 0.375rem;
  }

  #Second {
    padding-bottom: 0.375rem;
  }
}

@media (max-width: 576px) {
  .logo img {
    width: 3.125rem !important;
  }

  .logo {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
  }

  .modern-header-float {
    border-radius: 0 0 0.875rem 0.875rem !important;
  }

  .mobile-nav-overlay {
    top: 3.625rem;
    max-height: calc(100vh - 3.625rem);
    border-radius: 0 0 0.875rem 0.875rem;
  }
}

/* ========================================
   Mobile Nav Overlay
   ======================================== */
.mobile-nav-overlay {
  position: fixed;
  top: 4.125rem; /* matches mobile header height ~4.125rem */
  left: 0;
  right: 0;
  background: var(--color-primary);
  z-index: 998;
  overflow-y: auto;
  max-height: calc(100vh - 4.125rem);
  padding: 1.5rem 1.25rem;
  box-shadow: 0 8px 32px rgba(11, 76, 140, 0.35);
  border-radius: 0 0 1.25rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.mobile-search-input {
  flex: 1;
  min-width: 0;
  padding: 0.625rem 0.875rem;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.875rem;
}

.mobile-search-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

/* Pill wrapper that holds the input + icon button */
.mobile-search-form {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  border-radius: 1.5rem;
  overflow: hidden;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.mobile-search-form:focus-within {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
}

.mobile-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0 0.75rem;
  height: 100%;
  flex-shrink: 0;
}

.mobile-search-btn img {
  width: 1.25rem;
  height: 1.25rem;
  opacity: 0.85;
}

.mobile-nav-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-secondary);
  margin-bottom: 0.75rem;
}

.mobile-nav-link {
  display: block;
  padding: 0.625rem 0;
  color: #fff;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-link-small {
  display: block;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-lang-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-lang-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 1.5rem;
  padding: 0.5rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.mobile-lang-btn:hover,
.mobile-lang-btn:active {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.mobile-lang-btn img {
  width: 1.1rem;
  height: 1.1rem;
  opacity: 0.9;
}

/* ========================================
   Inner Page Header (Solid)
   ======================================== */
.inner-body #opacity {
  position: fixed !important;
}

/* Hide mobile overlay on desktop */
@media (min-width: 1200px) {
  .mobile-nav-overlay {
    display: none !important;
  }
}

/* ========================================
   LTR (Left-to-Right) Styles for English
   ======================================== */

/* When html has dir="ltr" */
html[dir="ltr"] .navbar {
  direction: ltr;
  flex-direction: row;
}

html[dir="ltr"] #opacity {
  direction: ltr;
}

/* Logo for LTR */
html[dir="ltr"] .logo {
  padding-left: 1.25rem;
  padding-right: 0;
  order: 1;
}

html[dir="ltr"] .logo img {
  float: left;
}

html[dir="ltr"] .navbar-brand {
  /* margin-right: 1rem !important; */
  padding-right: 0.625rem;
  /* margin-left: 1rem !important; */
  padding-left: 4.5rem;
}

/* Language Area for LTR */
html[dir="ltr"] .langarea {
  float: left;
  order: 2;
}

html[dir="ltr"] .lang {
  flex-direction: row;
}

html[dir="ltr"] .lang span {
  order: 1;
  margin-right: 0.5rem;
}

html[dir="ltr"] .lang img {
  order: 2;
  margin-left: 0;
  margin-right: 0;
}

/* Search for LTR */
html[dir="ltr"] .search ul {
  padding-left: 0;
  padding-right: 0;
  display: flex;
  flex-direction: row;
}

html[dir="ltr"] .search ul li:first-child {
  order: 1;
}

html[dir="ltr"] .search ul li:last-child {
  order: 2;
  margin-left: 0.4688rem;
  margin-right: 0;
}

/* Navigation for LTR */
html[dir="ltr"] #First {
  padding-left: 1% !important;
  padding-right: 0 !important;
  justify-content: flex-start !important;
}

html[dir="ltr"] #Second {
  padding-left: 1% !important;
  padding-right: 0 !important;
  justify-content: flex-start !important;
}

html[dir="ltr"] .navbar-collapse {
  align-items: flex-start;
  order: 3;
}

html[dir="ltr"] #First .nav-link,
html[dir="ltr"] #Second .nav-link {
  text-align: left;
}

html[dir="ltr"] .navbar-nav {
  flex-direction: row;
  justify-content: flex-start;
}

html[dir="ltr"] .navbar-nav .nav-item {
  text-align: left;
}

/* Mobile Toggle for LTR */
html[dir="ltr"] .mobbar {
  position: absolute;
  right: 5%;
  left: auto;
  order: 4;
}

/* Search input text alignment for LTR */
html[dir="ltr"] .search-input {
  text-align: left;
  direction: ltr;
}

/* Search container for LTR */
html[dir="ltr"] .search {
  order: 5;
}

/* Large screens LTR */
@media (min-width: 1800px) {
  html[dir="ltr"] .logo {
    padding-left: 5%;
    padding-right: 0;
  }
}

/* Mobile/Tablet Styles for LTR */
@media (max-width: 1199px) {
  html[dir="ltr"] .logo {
    padding-right: 1.25rem !important;
    padding-left: 1.25rem !important;
  }

  html[dir="ltr"] #First,
  html[dir="ltr"] #Second {
    padding-right: 5% !important;
    padding-left: 5% !important;
    text-align: left;
  }

  html[dir="ltr"] .mobbar {
    right: 5%;
    left: auto;
    top: 2rem;
    position: absolute;
  }

  html[dir="ltr"] .navbar {
    flex-direction: row;
  }

  html[dir="ltr"] .navbar-collapse {
    width: 100%;
  }

  html[dir="ltr"] .navbar-nav {
    flex-direction: column;
    align-items: flex-start;
  }

  html[dir="ltr"] .navbar-nav .nav-item {
    width: 100%;
    text-align: left;
  }
}

/* Mobile Nav Overlay for LTR */
html[dir="ltr"] .mobile-nav-overlay {
  direction: ltr;
  text-align: left;
}

html[dir="ltr"] .mobile-nav-title {
  text-align: left;
}

html[dir="ltr"] .mobile-nav-link,
html[dir="ltr"] .mobile-nav-link-small {
  text-align: left;
}

html[dir="ltr"] .mobile-lang-btn {
  flex-direction: row;
}

/* ========================================
   Sub-Nav Row (page-specific navigation, 3rd row inside header)
   ======================================== */

/* Allow nav to wrap so sub-nav row can sit on its own full-width line */
#opacity.modern-header-float {
  flex-wrap: wrap !important;
}

#sub-nav-row {
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.5rem 0 0.75rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  order: 10; /* always last */
}

.sub-nav-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 0.375rem 0;
  border-left: 3px solid rgba(255, 255, 255, 0.3);
  padding-left: 0.875rem;
}

html[dir="ltr"] .sub-nav-title {
  border-left: none;
  border-right: 3px solid rgba(255, 255, 255, 0.3);
  padding-left: 0;
  padding-right: 0.875rem;
}

.sub-nav-items {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: nowrap;
  overflow: visible;
  flex: 1;
}

.sub-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  background: transparent;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.2s ease,
    color 0.2s ease;
  white-space: nowrap;
  position: relative;
}

.sub-nav-btn:hover,
.sub-nav-btn:focus {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.sub-nav-btn--more {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.sub-nav-btn--more:hover {
  background: rgba(255, 255, 255, 0.2);
}

.sub-nav-dropdown {
  position: absolute;
  top: calc(100% + 0.375rem);
  min-width: 13.125rem;
  background: #fff;
  border-radius: 0.625rem;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  padding: 0.5rem;
  z-index: 1100;
}

.sub-nav-dropdown-item,
.sub-nav-dropdown a.sub-nav-dropdown-item,
#opacity .sub-nav-dropdown-item {
  display: block;
  padding: 0.5625rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-primary) !important;
  text-decoration: none;
  border-radius: 0.375rem;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    padding 0.15s ease;
  cursor: pointer;
}

.sub-nav-dropdown-item:hover,
#opacity .sub-nav-dropdown-item:hover {
  background: rgba(var(--color-primary-rgb), 0.08);
  color: var(--color-primary) !important;
  padding-right: 1.125rem;
}

html[dir="ltr"] .sub-nav-dropdown-item:hover {
  padding-right: 0.875rem;
  padding-left: 1.125rem;
}

.sub-nav-dropdown-empty {
  padding: 0.625rem 0.875rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  text-align: center;
}

/* Sub-nav row hidden on tablet/mobile (handled in mobile overlay) */
@media (max-width: 1199px) {
  #sub-nav-row {
    display: none !important;
  }
}
