/* RSHOF mobile UX layer: intentionally leaves desktop >= 961px unchanged. */
.rshof-mobile-menu-extra { display: none; }

/* Homepage priority: hero -> ticker -> current #1 -> member portal -> remaining modules. */
.rshof-front { display: flex; flex-direction: column; }
.rshof-front > * { order: 20; }
.rshof-front > .rshof-front-hero { order: 1; }
.rshof-front > .rshof-front-ticker { order: 2; }
.rshof-front > .rshof-front-section--champion { order: 3; }
.rshof-front > .rshof-front-section--members { order: 4; }
.rshof-front > .rshof-front-section--now { order: 5; }

@media (max-width: 960px) {
  body.rshof-menu-open { overflow: auto; }

  .rshof-site-header,
  .rshof-is-front-page .rshof-site-header,
  .rshof-site-header.is-scrolled,
  body:not(.rshof-is-front-page) .rshof-site-header.is-scrolled {
    position: sticky;
    top: 0;
  }

  .admin-bar .rshof-site-header,
  .admin-bar.rshof-is-front-page .rshof-site-header,
  .admin-bar .rshof-site-header.is-scrolled { top: 32px; }

  .rshof-primary-navigation {
    position: absolute;
    z-index: 1001;
    top: 100%;
    right: 18px;
    bottom: auto;
    width: min(390px, calc(100vw - 36px));
    max-height: min(72vh, 620px);
    overflow-y: auto;
    padding: 12px 18px 18px;
    transform: translateY(-8px) scale(.98);
    transform-origin: top right;
    border: 1px solid rgba(197,164,111,.3);
    border-radius: 0 0 18px 18px;
    background: #06131b;
    box-shadow: 0 24px 60px rgba(0,0,0,.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
  }

  .rshof-primary-navigation.is-open {
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .rshof-primary-navigation .rshof-menu,
  .rshof-mobile-menu-extra {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
    overflow: visible;
  }

  .rshof-primary-navigation .rshof-menu a,
  .rshof-mobile-menu-extra a {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 8px 2px;
    border-bottom: 1px solid rgba(255,255,255,.09);
    color: #f4f1ea;
    font-family: var(--rshof-sans);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .035em;
    line-height: 1.2;
    text-decoration: none;
  }

  .rshof-mobile-menu-extra { margin-top: 2px; }
  .rshof-mobile-menu-extra a { color: #d9c5a5; }

  .rshof-primary-navigation .rshof-header-search {
    width: 100%;
    min-height: 44px;
    margin-top: 14px;
  }

  .rshof-primary-navigation .rshof-header-search input { display: block; }
  .rshof-header-cta { width: 100%; margin-top: 10px; min-height: 44px; }

  /* The mobile menu replaces the large homepage shortcut button grid. */
  .rshof-front-hub { display: none !important; }

  /* Search page: readable, single-column controls and compact result cards. */
  .rshof-search-page { width: min(100% - 28px, 760px); margin-inline: auto; }
  .rshof-global-search { padding: 18px; border-radius: 18px; }
  .rshof-global-search > label { display: block; margin-bottom: 10px; font-size: 14px; line-height: 1.35; }
  .rshof-global-search > div { display: grid !important; grid-template-columns: 1fr; gap: 10px; }
  .rshof-global-search input,
  .rshof-global-search select,
  .rshof-global-search button { width: 100%; min-width: 0; min-height: 48px; }
  .rshof-global-search input { font-size: 16px; }
  .rshof-search-intro { grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 8px !important; }
  .rshof-search-intro article { min-width: 0; padding: 14px 10px !important; }
  .rshof-search-summary h2 { font-size: clamp(28px,8vw,42px) !important; line-height: 1.05; }
  .rshof-search-group > div { grid-template-columns: 1fr !important; gap: 10px !important; }
  .rshof-search-group article { min-width: 0; padding: 14px !important; border-radius: 14px !important; }
  .rshof-search-group article h4 { font-size: 18px !important; line-height: 1.2; }
  .rshof-search-group article img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; }
}

@media (max-width: 782px) {
  .admin-bar .rshof-site-header,
  .admin-bar.rshof-is-front-page .rshof-site-header,
  .admin-bar .rshof-site-header.is-scrolled { top: 46px; }
}

@media (max-width: 640px) {
  .rshof-announcement { display: none; }
  .rshof-header-main .rshof-shell { min-height: 62px; }
  .rshof-brand, .custom-logo-link { max-width: min(210px, 66vw); }
  .rshof-brand img, .custom-logo { max-height: 48px; }
  .rshof-menu-toggle { width: 40px; height: 40px; }
  .rshof-primary-navigation {
    right: 10px;
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 78px);
    padding: 10px 14px 14px;
  }
  .rshof-primary-navigation .rshof-menu,
  .rshof-mobile-menu-extra { gap: 0 10px; }
  .rshof-primary-navigation .rshof-menu a,
  .rshof-mobile-menu-extra a { min-height: 39px; font-size: 11px; }
  .rshof-front-hero__visual { margin-top: 62px !important; }
  .rshof-search-page { width: calc(100% - 20px); }
  .rshof-global-search { padding: 14px; }
}
