/* Article-only header layout. Desktop uses two rows; Mobile keeps the original drawer. */
@media (min-width: 861px) {
  body.homey-article-page .homey-universal-header > nav {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
  }

  body.homey-article-page .homey-universal-header .homey-universal-logo {
    order: 1 !important;
  }

  body.homey-article-page .homey-universal-header .homey-universal-right {
    order: 2 !important;
    margin-inline-start: auto !important;
  }

  body.homey-article-page .homey-universal-header .homey-universal-links {
    order: 3 !important;
    flex: 1 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    justify-content: flex-start !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
  }
}

/* The sitewide contrast stylesheet has a mobile article rule that keeps the
   links in a visible second row. Override only that rule on article pages so
   the existing hamburger drawer remains functional. */
@media (max-width: 760px) {
  body.homey-article-page .homey-universal-header > nav {
    flex-wrap: nowrap !important;
    gap: 8px !important;
  }

  body.homey-article-page .homey-universal-header .homey-universal-logo {
    order: 1 !important;
    max-width: none !important;
  }

  body.homey-article-page .homey-universal-header .homey-menu-toggle {
    display: grid !important;
    order: 2 !important;
  }

  body.homey-article-page .homey-universal-header .homey-universal-right {
    order: 3 !important;
    margin-inline-start: auto !important;
    max-width: none !important;
  }

  body.homey-article-page .homey-universal-header .homey-universal-links {
    position: fixed !important;
    z-index: 1001 !important;
    top: 70px !important;
    inset-inline: 12px !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    flex: none !important;
    width: auto !important;
    max-width: none !important;
    max-height: calc(100dvh - 88px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 12px !important;
    border: 1px solid rgba(216,181,106,.42) !important;
    border-radius: 20px !important;
    background: rgba(8,22,49,.985) !important;
    box-shadow: 0 24px 60px rgba(0,0,0,.42) !important;
    transform: translateY(-12px) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    white-space: normal !important;
    transition: transform .2s ease, opacity .2s ease, visibility .2s ease !important;
  }

  body.homey-article-page .homey-universal-header .homey-universal-links.homey-open {
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  body.homey-article-page .homey-universal-header .homey-universal-links a {
    min-height: 48px !important;
    padding: 10px 9px !important;
    border-radius: 14px !important;
    background: rgba(255,255,255,.055) !important;
    font-size: 12.5px !important;
    line-height: 1.25 !important;
    white-space: normal !important;
  }

  body.homey-article-page .homey-universal-header .homey-universal-links a.catalog-link,
  body.homey-article-page .homey-universal-header .homey-universal-links a[href*="/journal"] {
    color: #f0db9c !important;
    background: rgba(216,181,106,.13) !important;
  }
}

@media (max-width: 390px) {
  body.homey-article-page .homey-universal-header .homey-universal-links {
    grid-template-columns: 1fr !important;
  }
}
