/* tribeCast.org — Your Sovereign Space (RIGHTRAIL-01)
 *
 * Companion stylesheet to js/right-rail.js. Nothing here paints anything
 * for a logged-out visitor — every selector below only ever matches
 * elements that right-rail.js creates itself after a session exists.
 *
 * Visual language echoes the left rail (#tc-rail): row heights, icon
 * sizing, orange accent — LED-free per charter (no left-rail-style
 * active/section indicator strip on this side).
 */

:root {
  --tcrr-w: 260px;
}

/* ── Avatar chip ─────────────────────────────────────────────────────── */

.tcrr-avatar-chip {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #0a0a0a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.15s ease;
  font-family: 'Geist', 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
}
.tcrr-avatar-chip:hover,
.tcrr-avatar-chip:focus-visible {
  border-color: rgba(255, 122, 41, 0.6);
  outline: none;
}
.tcrr-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tcrr-avatar-initials {
  color: #ff7a29;
}

/* ── Shared row language (mirrors .tcnav-row: 44px rows, 32px icons) ──── */

.tcrr-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 8px 0 12px;
  border-radius: 8px;
  width: 100%;
  background: transparent;
  border: 0;
  color: #d4d4d8;
  font-family: 'Geist', 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.tcrr-row:hover,
.tcrr-row:focus-visible {
  background: rgba(255, 122, 41, 0.08);
  color: #fff;
  outline: none;
}
.tcrr-row[aria-disabled="true"] {
  cursor: default;
  opacity: 0.72;
}
.tcrr-row--sub {
  min-height: 38px;
  font-size: 14px;
  padding-left: 20px;
}
.tcrr-row-ico {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.tcrr-row-ico svg {
  width: 20px;
  height: 20px;
}
.tcrr-row-label {
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tcrr-stub-badge {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 1px 7px;
}

.tcrr-section {
  margin: 10px 0;
}
.tcrr-section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 0 12px;
  min-height: 36px;
  font-family: 'Geist', 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.4);
}
.tcrr-sub {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tcrr-group-link .tcrr-sub {
  margin-top: 2px;
}

/* ── Mode toggle (footer, both shells) ─────────────────────────────── */

.tcrr-footer {
  padding: 10px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.tcrr-mode-toggle {
  width: 100%;
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: #a1a1aa;
  font-family: 'Geist', 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.tcrr-mode-toggle:hover,
.tcrr-mode-toggle:focus-visible {
  color: #fff;
  border-color: rgba(255, 122, 41, 0.4);
  background: rgba(255, 122, 41, 0.08);
  outline: none;
}

/* ── Mode B — drawer sliding from the right off the avatar chip ───────── */

.tcrr-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.tcrr-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}
.tcrr-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--tcrr-w);
  max-width: 88vw;
  background: #050505;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: -20px 0 60px -10px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 16px 8px 0;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.tcrr-drawer-backdrop.is-open .tcrr-drawer {
  transform: translateX(0);
}

/* ── Mode C — persistent mirror rail, symmetric to #tc-rail ──────────── */

.tcrr-rail {
  display: none;
  flex-direction: column;
  position: fixed;
  right: 0;
  top: 64px;
  bottom: 0;
  width: var(--tcrr-w);
  z-index: 40;
  background: #050505;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}
.tcrr-rail[data-tcrr-mode="C"] {
  display: flex;
}
.tcrr-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 8px;
  scrollbar-width: thin;
}

@media (max-width: 767px) {
  /* Mirror rail is a desktop-width feature, same as the left rail
     (#tc-rail is `hidden md:flex`). Known v0 scope gap, flagged in the
     PR/SEEING GUIDE: mode C has no mobile fallback yet — a visitor who
     picks C on desktop and later opens the site on a phone sees no right
     side at all until they switch back to B. Mode B (drawer) works at
     every width and is the default for exactly this reason. */
  .tcrr-rail {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tcrr-drawer,
  .tcrr-drawer-backdrop {
    transition: none !important;
  }
}
