/* Direction B Header: White Brand Bar + Roasted Coffee Nav Ribbon */
.header-navigation {
  position: relative;
  z-index: 50;
  box-shadow: var(--shadow-xs);

  .header-brand-bar {
    background: var(--header-bg, #ffffff) url("../../images/sidebar-bg.png") repeat;
    border-bottom: 2px solid var(--gold-color);
    position: relative;
    z-index: 20;

    @media (min-width: 992px) {
      border-bottom: none;
    }
  }

  .header-bismillah {
    pointer-events: none;
    text-align: center;
    padding: 5px 0 0;

    @media (min-width: 992px) {
      padding: 7px 0 0;
    }

    .bismillah {
      width: 92px;
      height: 19px;
      margin: 0 auto;
      background: url("../../images/bismillah.png") no-repeat center;
      background-size: contain;
      text-indent: -9999px;
      overflow: hidden;
      display: block;

      @media (min-width: 992px) {
        width: 108px;
        height: 22px;
      }
    }
  }

  .header-brand-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 4px 0 10px;

    @media (min-width: 992px) {
      gap: 20px;
      padding: 2px 0 12px;
    }
  }

  .header-logo-container {
    flex-shrink: 0;

    .block {
      margin-bottom: 0;
    }

    .site-name {
      display: none !important;
    }

    .site-logo {
      display: block;
      text-decoration: none;

      img {
        width: 68px;
        height: auto;
        display: block;
        transition: transform 0.2s ease;

        @media (min-width: 992px) {
          width: 124px;
        }

        &:hover {
          transform: scale(1.03);
        }
      }
    }
  }

  /* Mobile Menu Toggler (White with Gold Border & Coffee Bars) */
  .navbar-toggler {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    border: 1.5px solid var(--gold-color);
    border-radius: var(--border-radius-sm);
    color: var(--primary);
    width: 38px;
    height: 38px;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
    transition:
      background-color 0.2s ease,
      border-color 0.2s ease;

    &:hover {
      background-color: var(--parchment-color);
      border-color: var(--primary);
    }

    @media (min-width: 992px) {
      display: none;
    }
  }

  .navbar-toggler-icon {
    display: inline-block;
    width: 20px;
    height: 2px;
    background-color: var(--primary);
    position: relative;
    border-radius: 1px;

    &::before,
    &::after {
      content: "";
      position: absolute;
      width: 20px;
      height: 2px;
      background-color: var(--primary);
      left: 0;
      border-radius: 1px;
    }

    &::before {
      top: -6px;
    }

    &::after {
      bottom: -6px;
    }
  }

  /* Qiyaam Shareef & Today's Date:
     Inline beside the logo separated by hairline gold divider on both mobile and desktop */
  .header-meta-inline {
    flex: 1 1 auto;
    min-width: 0;
    padding: 2px 0 2px 10px;
    border-left: 2px solid var(--gold-color);
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.45;
    font-variant-numeric: tabular-nums;

    .region-top-info {
      display: flex;
      flex-direction: column;
      gap: 2px;

      .block {
        margin-bottom: 0;
      }

      p {
        margin: 0;
        font-size: inherit;
        color: var(--text-muted);
      }

      .place,
      strong {
        color: var(--primary);
        font-weight: 700;
      }

      .date {
        color: var(--text-dark);
        font-weight: 600;
      }
    }

    .meta-desktop {
      display: none;
    }

    .meta-mobile {
      display: inline;
    }

    @media (min-width: 992px) {
      padding: 4px 0 4px 18px;
      font-size: 0.8125rem;

      .region-top-info {
        gap: 3px;
      }

      .meta-desktop {
        display: inline;
      }

      .meta-mobile {
        display: none;
      }
    }
  }
}

/* Roasted Coffee Navigation Ribbon (White Nav Text) */
.header-nav-ribbon {
  background-color: var(--nav-ribbon-bg, #52251f);
  position: relative;
  z-index: 15;

  @media (min-width: 992px) {
    border-bottom: 2px solid var(--gold-color);
  }
}

.navbar-anwar {
  padding: 0;
  position: relative;

  .navbar-collapse {
    display: none;
    width: 100%;

    &.show {
      display: block;
    }

    @media (min-width: 992px) {
      display: flex;
      justify-content: flex-end;
      align-items: center;
    }
  }

  .region-navigation-collapsible {
    width: 100%;

    @media (min-width: 992px) {
      width: auto;
    }

    .block {
      margin-bottom: 0;
    }
  }

  ul.menu,
  .navbar-nav {
    list-style: none;
    margin: 0;
    padding: 8px 0 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;

    @media (min-width: 992px) {
      flex-direction: row;
      align-items: center;
      padding: 0;
      gap: 4px;
    }
  }

  li.menu-item,
  .nav-item {
    position: relative;
    margin: 0;

    > a,
    > .nav-link {
      color: #ffffff;
      font-weight: 500;
      font-size: 0.875rem;
      letter-spacing: 0.015em;
      padding: 10px 14px;
      display: block;
      text-decoration: none;
      border-radius: var(--border-radius-sm);
      transition:
        color 0.18s ease,
        background-color 0.18s ease,
        border-color 0.18s ease;

      &:hover {
        color: #ffffff;
        background-color: rgba(255, 255, 255, 0.1);
        text-decoration: none;
      }

      &.active,
      &.is-active,
      &[aria-current="page"] {
        color: #ffffff;
        background-color: rgba(255, 255, 255, 0.14);
        font-weight: 700;
      }

      @media (min-width: 992px) {
        padding: 11px 16px;
        border-radius: 0;
        border-bottom: 3px solid transparent;

        &.active,
        &.is-active,
        &[aria-current="page"] {
          border-bottom-color: var(--gold-color);
          background-color: rgba(255, 255, 255, 0.1);
        }
      }
    }
  }

  .dropdown {
    position: relative;
  }

  .dropdown-menu {
    display: none;
    position: static;
    min-width: 190px;
    padding: 4px 0 4px 12px;
    margin: 0;
    background-color: rgba(0, 0, 0, 0.16);
    border-radius: var(--border-radius-sm);
    list-style: none;

    &.show {
      display: block;
    }

    .nav-link,
    a {
      color: rgba(255, 255, 255, 0.92);
      font-weight: 400;
      font-size: 0.875rem;
      padding: 8px 14px;
      display: block;
      text-decoration: none;

      &:hover {
        color: var(--gold-light);
        background-color: rgba(255, 255, 255, 0.08);
      }
    }

    @media (min-width: 992px) {
      position: absolute;
      top: 100%;
      left: 0;
      z-index: 100;
      padding: 6px 0;
      margin: 0;
      background-color: #ffffff;
      border: 1px solid var(--gold-color);
      box-shadow: var(--shadow-md);

      .nav-link,
      a {
        color: var(--text-dark);
        font-weight: 500;

        &:hover {
          background-color: var(--parchment-color);
          color: var(--primary);
        }
      }
    }
  }
}
