/*
 ASEMANEEHA - PHASE 322
 Responsive desktop header.
 Public navigation only.
*/

@media screen and (min-width: 1024px) {

  /* Header: organization on the right, menu on the left */
  body div.relative.flex.flex-row.w-full.bg-darkblue-100:has(> div.grid):has(> button) {
    direction: rtl !important;
    display: flex !important;
    flex-direction: row-reverse !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
    padding: 10px 24px !important;
    min-height: 102px !important;
    overflow: visible !important;
  }

  /* Organization title on the right */
  body div.relative.flex.flex-row.w-full.bg-darkblue-100:has(> div.grid):has(> button)
  > div.flex.flex-1 {
    order: -1 !important;
    flex: 1 1 310px !important;
    min-width: 260px !important;
    max-width: 430px !important;
    direction: rtl !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    text-align: right !important;
    gap: 3px !important;
  }

  body div.relative.flex.flex-row.w-full.bg-darkblue-100:has(> div.grid):has(> button)
  > div.flex.flex-1 > span {
    font-family: "Vazir-Bold", Tahoma, sans-serif !important;
    font-size: clamp(12px, 1.05vw, 16px) !important;
    line-height: 1.7 !important;
    text-align: right !important;
    white-space: normal !important;
  }

  /* Horizontal navigation */
  body div.relative.flex.flex-row.w-full.bg-darkblue-100:has(> div.grid):has(> button)
  > div.grid {
    direction: rtl !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 3px !important;
    padding: 8px !important;
    border-radius: 14px !important;
    background: #07566a !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: thin;
  }

  /* Menu entries */
  body div.relative.flex.flex-row.w-full.bg-darkblue-100:has(> div.grid):has(> button)
  > div.grid > a {
    display: flex !important;
    flex: 0 0 82px !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 82px !important;
    min-width: 82px !important;
    min-height: 76px !important;
    gap: 5px !important;
    padding: 5px 2px !important;
    border-radius: 9px !important;
    color: white !important;
    text-decoration: none !important;
  }

  body div.relative.flex.flex-row.w-full.bg-darkblue-100:has(> div.grid):has(> button)
  > div.grid > a:hover {
    background: rgba(255,255,255,.12) !important;
  }

  body div.relative.flex.flex-row.w-full.bg-darkblue-100:has(> div.grid):has(> button)
  > div.grid > a > div:last-child {
    font-family: "Vazir-Bold", Tahoma, sans-serif !important;
    font-size: 11px !important;
    line-height: 1.6 !important;
    text-align: center !important;
    white-space: nowrap !important;
  }

  /* Hide hamburger when horizontal menu is available */
  body div.relative.flex.flex-row.w-full.bg-darkblue-100:has(> div.grid):has(> button)
  > button {
    display: none !important;
  }
}

/* Smaller desktop: use expandable menu */
@media screen and (min-width: 1024px) and (max-width: 1279px) {

  body div.relative.flex.flex-row.w-full.bg-darkblue-100:has(> div.grid):has(> button)
  > button {
    display: inline-flex !important;
    order: 1 !important;
    flex: 0 0 44px !important;
    width: 44px !important;
    height: 44px !important;
    align-items: center !important;
    justify-content: center !important;
  }

  body div.relative.flex.flex-row.w-full.bg-darkblue-100:has(> div.grid):has(> button)
  > div.grid {
    position: absolute !important;
    top: 100% !important;
    right: 12px !important;
    left: 12px !important;
    width: auto !important;
    max-width: none !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
    padding: 12px !important;
    background: #07566a !important;
    z-index: 999 !important;
    max-height: 70vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  body div.relative.flex.flex-row.w-full.bg-darkblue-100:has(> div.grid):has(> button)
  > div.grid > a {
    flex-direction: row !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: 56px !important;
    justify-content: flex-start !important;
    padding: 8px !important;
  }

  body div.relative.flex.flex-row.w-full.bg-darkblue-100:has(> div.grid):has(> button)
  > div.grid > a > div:last-child {
    white-space: normal !important;
    text-align: right !important;
  }
}