/* ==========================================================================
   Desktop / Tablet Styles (Hide Hamburger by Default)
   ========================================================================== */
.mobile-hamburger-wrapper {
  display: none;
}

/* ==========================================================================
   Mobile Styles (Break-point: Adjust 768px to fit your theme's design)
   ========================================================================== */
@media screen and (max-width: 767px) {
  
  /* 1. HIDE the standard desktop main menu */
  /* Change this selector to match your active Drupal theme's menu wrapper */
  .region-primary-menu, 
  .block-system-menu-block-main {
    display: none !important;
  }

  /* 2. SHOW and align the mobile hamburger wrapper to the right */
  .mobile-hamburger-wrapper {
    display: flex;
    justify-content: flex-end; /* Pushes the button to the right side of its container */
    width: 100%;               /* Ensures it takes full width to allow right-alignment */
    position: relative;
    box-sizing: border-box;
  }

  /* Simple CSS Hamburger styling */
  .hamburger-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    padding: 0;
    z-index: 100;
  }

  .hamburger-bar {
    width: 100%;
    height: 3px;
    background-color: #333; /* Change to match your branding */
    transition: all 0.3s ease;
  }

  /* Toggle animation to an 'X' when open */
  .is-open .hamburger-bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .is-open .hamburger-bar:nth-child(2) {
    opacity: 0;
  }
  .is-open .hamburger-bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* 3. The hidden drawer menu styling (Anchored Right) */
  .hamburger-drawer {
    display: none;
    position: absolute;
    top: 40px;
    right: 0; /* Anchors the drop-down box perfectly to the right side edge */
    background: #fff;
    border: 1px solid #ccc;
    width: 260px;
    padding: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    z-index: 99;
  }

  /* Display drawer when wrapper has .is-open class */
  .mobile-hamburger-wrapper.is-open .hamburger-drawer {
    display: block;
  }

  /* Optional neatening: Right-align text links inside the mobile drawer */
  .hamburger-drawer ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: right; 
  }

  .hamburger-drawer ul li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
  }

  .hamburger-drawer ul li:last-child {
    border-bottom: none;
  }
}
