/* ============================================================================
   MEMBER STRIP — homepage recognition band (2026-09-03)
   ----------------------------------------------------------------------------
   Rendered by main.src.js (_renderMemberStrip) directly under the nav, ABOVE
   the hero, for SIGNED-IN users only. Khalid's ruling 2026-09-03: this is an
   ADDITION, not a replacement — members re-take the quizzes, so the hero and
   the "Choose Your Grant Discovery Method" chooser stay exactly as they are.

   Lives in its own file on purpose: homepage-v7.css carries legacy duplicate
   rules that silently win the cascade (see CLAUDE.md § CSS Editing Discipline),
   and nothing here needs to reach into it. Every selector is .gc-mstrip-scoped
   so it cannot leak onto the hero or the chooser.

   Tokens (--parchment, --forest, --sienna, --serif, --sans…) come from
   homepage-v7.css :root, which loads first. Each var() carries a literal
   fallback so a load-order change degrades to the right colour rather than an
   invalid property (the "undefined var() invalidates the whole declaration"
   gotcha).
   ============================================================================ */

.gc-mstrip {
  /* The nav is fixed (56px + safe-area); the hero normally reserves that space
     in its own padding-top. When the strip is present it takes over that job. */
  /* Inside .hero (which already clears the fixed nav): no nav gutter of its own.
     Width is bounded at EVERY viewport — the old max-width alone let it run
     edge-to-edge between 641px and 880px. */
  margin: 0 auto 1.75rem;
  width: min(860px, calc(100% - 32px));  /* 860 matches .hero__inner */
  box-sizing: border-box;
  padding: 22px 26px;
  background: var(--paper-warm, #FFF9F0);
  border: 1px solid var(--ink-5, #E7E5E4);
  border-left: 5px solid var(--forest, #1B4332);
  border-radius: var(--r-lg, 14px);
  box-shadow: var(--sh-sm, 0 1px 3px rgba(28, 25, 23, .04));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;   /* minmax(0,…) — a 1fr track
                                                   floors at min-content and a
                                                   long fact line would push the
                                                   page into h-scroll */
  gap: 20px;
  align-items: center;
  position: relative;
}

/* The hero reserves nav clearance in its own padding-top. With the strip above
   it that space is doubled, so trim it — scoped to the strip's presence, and a
   browser without :has() simply keeps today's spacing. */
/* (no :has() hack any more — the strip sits inside the hero's own padding) */

.gc-mstrip__main { min-width: 0; }

.gc-mstrip__eyebrow {
  font-family: var(--mono, var(--sans, 'Plus Jakarta Sans', sans-serif));
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--forest-mid, #2D6A4F);
  margin: 0 0 8px;
}

.gc-mstrip__facts {
  font-family: var(--serif, 'Fraunces', Georgia, serif);
  font-size: 21px;
  line-height: 1.28;
  font-weight: 600;
  color: var(--ink, #1C1917);
  margin: 0 0 7px;
}

.gc-mstrip__needs { color: var(--sienna, #C4532B); }

.gc-mstrip__profile {
  font-family: var(--sans, 'Plus Jakarta Sans', sans-serif);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-2, #57534E);
  margin: 0;
}

.gc-mstrip__profile a,
.gc-mstrip__profile a:hover,
.gc-mstrip__profile a:focus,
.gc-mstrip__profile a:visited,
.gc-mstrip__profile a:active {
  /* Sitewide `a:hover { color: var(--sienna) }` would otherwise recolour this
     on hover only — state the colour across every state at (0,0,2,1). */
  color: var(--forest-mid, #2D6A4F);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.gc-mstrip__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  flex-shrink: 0;
}

.gc-mstrip__cta,
.gc-mstrip__cta:hover,
.gc-mstrip__cta:focus,
.gc-mstrip__cta:visited,
.gc-mstrip__cta:active {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;                 /* touch-target floor */
  padding: 11px 18px;
  background: var(--forest, #1B4332);
  color: #fff;
  font-family: var(--sans, 'Plus Jakarta Sans', sans-serif);
  font-size: 14.5px;
  font-weight: 700;
  border-radius: var(--r-md, 10px);
  text-decoration: none;
  white-space: nowrap;
}

.gc-mstrip__cta:hover { background: var(--forest-dk, #143728); }

.gc-mstrip__alt,
.gc-mstrip__alt:hover,
.gc-mstrip__alt:focus,
.gc-mstrip__alt:visited,
.gc-mstrip__alt:active {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  color: var(--forest-mid, #2D6A4F);
  font-family: var(--sans, 'Plus Jakarta Sans', sans-serif);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.gc-mstrip__alt:hover { text-decoration: underline; }

.gc-mstrip__dismiss {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--ink-3, #A8A29E);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  border-radius: var(--r-sm, 6px);
}

.gc-mstrip__dismiss:hover { color: var(--ink-2, #57534E); background: rgba(28, 25, 23, .05); }
.gc-mstrip__dismiss:focus-visible { outline: 2px solid var(--forest-mid, #2D6A4F); outline-offset: 2px; }

/* The HTML [hidden] attribute loses to any rule that sets `display` — state it
   explicitly or a dismissed strip stays an invisible click-blocker. */
.gc-mstrip[hidden] { display: none !important; }

@media (max-width: 640px) {
  /* Phone: compact. At 240px the strip pushed the headline and the quiz
     chooser below the fold (quiz-card top 404 → 656 on 390×844). */
  .gc-mstrip {
    margin: 0 auto 1rem;
    padding: 12px 14px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
  }
  .gc-mstrip__eyebrow { margin: 0 0 3px; font-size: 11px; }
  .gc-mstrip__facts { font-size: 15px; margin: 0; }
  .gc-mstrip__profile { display: none; }
  .gc-mstrip__alt { display: none; }
  .gc-mstrip__actions { align-items: stretch; }
  .gc-mstrip__cta { padding: 10px 12px; font-size: 13px; white-space: nowrap; }
  .gc-mstrip__actions { align-items: stretch; }
  .gc-mstrip__cta { width: 100%; white-space: normal; }
  .gc-mstrip__alt { white-space: normal; }
  .gc-mstrip__dismiss { top: 4px; right: 4px; }
}
