/* DMA public — Member "side tab / notch" quick-access (Phase-3 slice 3, workstream C).
   Style N tokens only; both light + dark themes come free because every colour is a token.
   Public page-type layer — fully separate from the CMS theme. Own hooks (.pub-notch*) — this file
   styles nothing shared and restyles nothing else.

   WHY THE LEFT EDGE (justification):
     - The tab is pinned to the LEFT edge of the viewport per the DMA C4 requirement. It stays a
       persistent, always-available "utility" affordance that hugs the empty vertical gutter and
       reveals on scroll, expanding rightward into the page.
     - The header logo + primary nav sit ABOVE this notch (higher z-index) and the notch is vertically
       centred, so it never competes with or covers that primary chrome.

   LAYERING: header (#pubHeader) is z-index 60 and the classic slide-in panel (.pub-cm) is 55. The
   notch must sit BELOW both so it never covers the header or the open menu panel -> z-index 45. */

.pub-notch {
  position: fixed;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  z-index: 45;
  display: flex;
  align-items: center;
  /* tab hugs the LEFT edge, panel sits to the RIGHT of the tab (opens into the page) */
  flex-direction: row;
}

/* ---- Edge tab (always visible) ---- */
.pub-notch__tab {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 40px;
  padding: 16px 0;
  border: 0;
  /* rounded on the INNER (right) side only, flush to the viewport edge on the left */
  border-radius: 0 var(--pub-radius) var(--pub-radius) 0;
  background: var(--brand-red);
  color: #fff;
  cursor: pointer;
  box-shadow: 6px 6px 22px -12px var(--pub-shadow-lg);
  transition: transform var(--motion-base, .28s) var(--ease-out),
              background var(--motion-fast, .18s) var(--ease-out);
}
.pub-notch__tabico { width: 20px; height: 20px; }
.pub-notch__tabtext {
  /* vertical label, reading top-to-bottom for the left edge (hinges from the left) */
  writing-mode: vertical-rl;
  transform: none;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
}
@media (hover: hover) {
  .pub-notch__tab:hover { background: var(--pub-red-ink); transform: translateX(2px); }
}
.pub-notch__tab:focus-visible { outline: 2px solid var(--brand-navy); outline-offset: 2px; }

/* When open, nudge the tab flush and de-emphasise (panel carries the affordance). */
.pub-notch.is-open .pub-notch__tab { background: var(--pub-red-ink); }

/* ---- Panel (slides / fades in to the RIGHT of the tab, opening into the page) ---- */
.pub-notch__panel {
  width: 232px;
  margin-left: 6px;
  padding: 10px;
  background: var(--pub-card);
  border: 1px solid var(--pub-line);
  border-radius: var(--pub-radius);
  box-shadow: 0 24px 46px -28px var(--pub-shadow-lg);
  /* collapsed visual state (panel is also [hidden] until JS opens it); slides in from the left */
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity var(--motion-base, .28s) var(--ease-out),
              transform var(--motion-base, .28s) var(--ease-out);
}
.pub-notch.is-open .pub-notch__panel {
  opacity: 1;
  transform: translateX(0);
}

.pub-notch__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 8px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--pub-line);
}
.pub-notch__title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pub-accent-ink);
}
.pub-notch__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: var(--pub-radius);
  background: transparent;
  color: var(--pub-mut);
  cursor: pointer;
  transition: color var(--motion-fast, .18s) var(--ease-out),
              background var(--motion-fast, .18s) var(--ease-out);
}
.pub-notch__close :where(svg) { width: 18px; height: 18px; }
@media (hover: hover) {
  .pub-notch__close:hover { color: var(--pub-red-ink); background: var(--pub-soft); }
}
.pub-notch__close:focus-visible { outline: 2px solid var(--brand-navy); outline-offset: 2px; }

/* ---- Links ---- */
.pub-notch__links { display: grid; gap: 2px; }
.pub-notch__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: var(--pub-radius);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--pub-ink);
  text-decoration: none;
  transition: color var(--motion-fast, .18s) var(--ease-out),
              background var(--motion-fast, .18s) var(--ease-out);
}
.pub-notch__ico { width: 18px; height: 18px; flex: 0 0 auto; color: var(--pub-mut); }
@media (hover: hover) {
  .pub-notch__link:hover { background: var(--pub-soft); color: var(--pub-red-ink); }
  .pub-notch__link:hover .pub-notch__ico { color: var(--pub-red-ink); }
}
.pub-notch__link:focus-visible { outline: 2px solid var(--brand-navy); outline-offset: 2px; }

/* Member "My Panel" link — two-line (label + member name) */
.pub-notch__linktext { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.pub-notch__linklabel { display: block; }
.pub-notch__linkname {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--pub-mut);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 150px;
}

/* ============================ RESPONSIVE ============================ */
/* <=1024px (phones AND tablets): the vertical edge tab risks covering content on narrow screens.
   Drop the tall vertical tab and DOCK a small floating round button to the BOTTOM-left; the panel
   opens above it, docked to the same corner (not viewport-centered), and stays dismissible via
   close / Esc / outside-tap.
   1024px = tablet landscape and below, the same cut-off used for the translucent hero arrows and
   accessibility tab, so all of the floating overlay chrome changes form at one width. */
@media (max-width: 1024px) {
  .pub-notch {
    top: auto;
    bottom: 16px;
    left: 16px;
    transform: none;
    flex-direction: column-reverse; /* button at the bottom, panel above it */
    align-items: flex-start;
    gap: 10px;
  }

  .pub-notch__tab {
    flex-direction: row;
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 50%;
  }
  .pub-notch__tabico { width: 22px; height: 22px; }
  .pub-notch__tabtext { display: none; } /* icon-only FAB at this size */

  .pub-notch__panel {
    width: min(80vw, 260px);
    margin-left: 0;
    /* collapsed state slides up from the corner instead of in from the side */
    transform: translateY(12px);
  }
  .pub-notch.is-open .pub-notch__panel { transform: translateY(0); }
  @media (hover: hover) { .pub-notch__tab:hover { transform: none; } }
}

/* ============================ REDUCED MOTION ============================ */
@media (prefers-reduced-motion: reduce) {
  .pub-notch__tab,
  .pub-notch__panel,
  .pub-notch__link,
  .pub-notch__close { transition: none !important; }
}
