/* ================================================================
   RESEARCH LIBRARY  —  research.css
   All classes prefixed  rl-
   No modifications to styles.css or education.css
================================================================ */

/* ── Nav Active State ─────────────────────────────────────────── */
.nav-active          { color: #ffffff !important; }
.nav-active::after   { width: 100% !important; }

/* ================================================================
   HERO
================================================================ */
.rl-hero {
  padding: 80px 0 64px 0;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}

.rl-hero-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #9b7bff;
  margin-bottom: 18px;
}

.rl-hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(28px, 4.5vw, 54px);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 18px;
}

.rl-hero-title {
  white-space: nowrap;
}

@media (max-width: 680px) {
  .rl-hero-title { white-space: normal; }
}

.rl-hero-sub {
  font-size: clamp(15px, 1.5vw, 18px);
  opacity: 0.72;
  line-height: 1.65;
  margin-bottom: 44px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Stats Row — hidden, replaced by ticker ─────────────────────── */
.rl-stats {
  display: none;
}

.rl-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 28px;
}

.rl-stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 700;
  color: #9b7bff;
  line-height: 1;
  margin-bottom: 5px;
}

.rl-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(196,176,255,0.52);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.rl-stat-divider {
  width: 1px;
  height: 36px;
  background: rgba(123,77,255,0.22);
  flex-shrink: 0;
}

.rl-stat-value--count {
  font-size: clamp(16px, 2vw, 22px);
  white-space: nowrap;
}

.rl-stat-value--members {
  font-size: clamp(14px, 1.4vw, 17px);
  letter-spacing: 0.06em;
  color: #c4b0ff;
}

/* ── Search Bar ────────────────────────────────────────────────── */
.rl-search-wrap {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 auto 24px auto;
}

.rl-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(155,123,255,0.52);
  pointer-events: none;
}

.rl-search-input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(123,77,255,0.28);
  border-radius: 12px;
  padding: 14px 16px 14px 46px;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.rl-search-input::placeholder           { color: rgba(196,176,255,0.36); }
.rl-search-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

.rl-search-input:focus {
  border-color: rgba(123,77,255,0.6);
  box-shadow: 0 0 0 3px rgba(123,77,255,0.11);
}

/* ── Filter Tabs ───────────────────────────────────────────────── */
.rl-filters {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 64px;
}

.rl-filter-btn {
  background: transparent;
  border: 1px solid rgba(123,77,255,0.22);
  border-radius: 20px;
  color: rgba(196,176,255,0.65);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 18px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.rl-filter-btn:hover {
  border-color: rgba(123,77,255,0.5);
  color: #c4b0ff;
  background: rgba(123,77,255,0.08);
}

.rl-filter-btn.active {
  background: rgba(123,77,255,0.2);
  border-color: rgba(123,77,255,0.6);
  color: #ffffff;
}

/* ================================================================
   TWO-COLUMN LAYOUT
================================================================ */
.rl-layout {
  display: grid;
  grid-template-columns: 256px 1fr;
  gap: 52px;
  align-items: start;
  padding-bottom: 100px;
}

/* ── Sidebar ───────────────────────────────────────────────────── */
.rl-sidebar {
  position: sticky;
  top: 82px;
}

.rl-sidebar-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(155,123,255,0.6);
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(123,77,255,0.17);
}

.rl-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rl-sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  color: rgba(196,176,255,0.56);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.18s, color 0.18s;
  border-left: 2px solid transparent;
  line-height: 1.35;
}

.rl-sidebar-link:hover {
  background: rgba(123,77,255,0.08);
  color: #c4b0ff;
}

.rl-sidebar-link.active {
  background: rgba(123,77,255,0.12);
  border-left-color: #7b4dff;
  color: #ffffff;
  font-weight: 600;
}

.rl-sidebar-count {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  background: rgba(123,77,255,0.16);
  border: 1px solid rgba(123,77,255,0.24);
  border-radius: 20px;
  padding: 2px 7px;
  color: rgba(155,123,255,0.85);
  flex-shrink: 0;
}

/* ── Main Content ──────────────────────────────────────────────── */
.rl-main {
  min-width: 0;
}

/* ================================================================
   SECTIONS
================================================================ */
.rl-section {
  margin-bottom: 72px;
  scroll-margin-top: 92px;
}

.rl-section:last-child { margin-bottom: 0; }

.rl-section-head {
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(123,77,255,0.12);
}

.rl-section-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9b7bff;
  margin-bottom: 8px;
}

.rl-section-head h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 700;
  margin-bottom: 6px;
  color: #ffffff;
  line-height: 1.2;
}

.rl-section-head p {
  font-size: 13.5px;
  opacity: 0.62;
  margin: 0;
  line-height: 1.6;
}

/* ================================================================
   CARD GRID
================================================================ */
.rl-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

/* 2-card sections → 2 columns */
.rl-cards.cols-2 { grid-template-columns: repeat(2, 1fr); }

/* ================================================================
   INDIVIDUAL CARD
   Cards use a <div> wrapper so compound cards can carry both
   a research link and a Shop link without nesting <a> in <a>.
================================================================ */
.rl-card {
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(123,77,255,0.18);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.rl-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 28px rgba(123,77,255,0.22);
  border-color: rgba(123,77,255,0.4);
}

/* ── Card Header (tag + optional Shop pill) ─────────────────────── */
.rl-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 0 18px;
  gap: 8px;
}

/* Tag pill — mirrors purity-badge pattern */
.rl-card-tag {
  display: inline-block;
  background: rgba(123,77,255,0.15);
  border: 1px solid rgba(123,77,255,0.3);
  color: #c4b0ff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 20px;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* Per-tag colour overrides */
.rl-card[data-tag="Guide"] .rl-card-tag {
  background: rgba(0,180,255,0.09);
  border-color: rgba(0,180,255,0.28);
  color: #7dd8ff;
}

.rl-card[data-tag="Research"] .rl-card-tag {
  background: rgba(80,220,140,0.09);
  border-color: rgba(80,220,140,0.28);
  color: #7de8b0;
}

.rl-card[data-tag="Reference"] .rl-card-tag {
  background: rgba(255,180,50,0.09);
  border-color: rgba(255,180,50,0.28);
  color: #ffd580;
}

.rl-card[data-tag="Safety"] .rl-card-tag {
  background: rgba(255,110,60,0.09);
  border-color: rgba(255,110,60,0.28);
  color: #ffb07b;
}

/* Shop pill — top-right of compound cards */
.rl-shop-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #9b7bff;
  background: rgba(123,77,255,0.12);
  border: 1px solid rgba(123,77,255,0.28);
  border-radius: 20px;
  padding: 4px 10px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
  /* Raises above the card-body link click zone */
  position: relative;
  z-index: 2;
}

.rl-shop-pill:hover {
  background: rgba(123,77,255,0.24);
  border-color: rgba(123,77,255,0.55);
  color: #c4b0ff;
}

.rl-shop-pill svg {
  flex-shrink: 0;
  transition: transform 0.18s;
}

.rl-shop-pill:hover svg { transform: translateX(2px); }

/* ── Card Body (the clickable link area) ────────────────────────── */
.rl-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 14px 18px 18px 18px;
  text-decoration: none;
  color: #ffffff;
}

.rl-card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: #e8e0ff;
  line-height: 1.3;
  transition: color 0.18s;
}

.rl-card:hover .rl-card-title { color: #ffffff; }

.rl-card-desc {
  font-size: 12.5px;
  line-height: 1.65;
  opacity: 0.62;
  margin: 0 0 14px 0;
  flex-grow: 1;
}

.rl-card-read {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(155,123,255,0.6);
  transition: color 0.18s, gap 0.18s;
  margin-top: auto;
}

.rl-card:hover .rl-card-read {
  color: #9b7bff;
  gap: 8px;
}

/* ── Hidden states ──────────────────────────────────────────────── */
.rl-card[hidden]    { display: none; }
.rl-section[hidden] { display: none; }

/* ── Empty State ────────────────────────────────────────────────── */
.rl-empty-state {
  text-align: center;
  padding: 72px 20px;
  color: rgba(196,176,255,0.44);
}

.rl-empty-state svg {
  margin: 0 auto 16px auto;
  display: block;
  opacity: 0.32;
}

.rl-empty-state p {
  font-size: 14px;
  opacity: 0.55;
  margin: 0;
}

/* ================================================================
   RESPONSIVE
================================================================ */
@media (max-width: 1100px) {
  .rl-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .rl-sidebar {
    position: static;
    overflow-x: auto;
    padding-bottom: 14px;
    margin-bottom: 36px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .rl-sidebar::-webkit-scrollbar { display: none; }
  .rl-sidebar-label { display: none; }

  .rl-sidebar-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
    white-space: nowrap;
  }

  .rl-sidebar-link {
    border-left: none;
    border-bottom: 2px solid transparent;
    border-radius: 8px;
    padding: 7px 14px;
    flex-shrink: 0;
  }

  .rl-sidebar-link.active {
    border-left: none;
    border-bottom-color: #7b4dff;
  }

  .rl-sidebar-count { display: none; }
}

@media (max-width: 900px) {
  .rl-cards             { grid-template-columns: repeat(2, 1fr); }
  .rl-cards.cols-2      { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .rl-hero             { padding-top: 60px; padding-bottom: 48px; padding-left: 16px; padding-right: 16px; }
  .rl-stat             { padding: 0 18px; }
  .rl-search-wrap      { max-width: 100%; }
  .rl-filters          { gap: 6px; margin-bottom: 48px; }
  .rl-filter-btn       { font-size: 12px; padding: 6px 14px; }
  .rl-section          { margin-bottom: 56px; }
}

/* ── Ticker (all screens) ──────────────────────────────────────── */
@keyframes rl-ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.rl-ticker-wrap {
  display: block;
  width: 100%;
  overflow: hidden;
  border-top: 1px solid rgba(123,77,255,0.2);
  border-bottom: 1px solid rgba(123,77,255,0.2);
  background: rgba(123,77,255,0.06);
  padding: 12px 0;
  margin-bottom: 44px;
}

.rl-ticker-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: rl-ticker-scroll 30s linear infinite;
}

.rl-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #c4b0ff;
  white-space: nowrap;
  padding: 0 36px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rl-ticker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7b4dff;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .rl-stats-desktop    { display: none; }
  .rl-ticker-item      { font-size: 12px; padding: 0 24px; gap: 8px; }
  .rl-ticker-dot       { width: 5px; height: 5px; }
  .rl-ticker-wrap      { padding: 10px 0; margin-bottom: 36px; }

  .rl-stat             { padding: 0 14px; flex-shrink: 0; }
  .rl-stat-value       { font-size: 13px; white-space: nowrap; }
  .rl-stat-divider     { flex-shrink: 0; }
  .rl-cards,
  .rl-cards.cols-2     { grid-template-columns: 1fr; gap: 10px; }
  .rl-card-header      { padding: 14px 14px 0 14px; }
  .rl-card-body        { padding: 12px 14px 14px 14px; }
  .rl-filters {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    padding-left: 2px;
    padding-right: 16px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .rl-filters::-webkit-scrollbar { display: none; }
  .rl-filter-btn { flex-shrink: 0; }
  .rl-layout { padding-bottom: 120px; }
}

/* ================================================================
   MEMBERS GATE OVERLAY
================================================================ */
.rl-gate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,5,15,0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.rl-gate-box {
  background: linear-gradient(160deg, rgba(18,10,38,0.99) 0%, rgba(8,5,20,0.99) 100%);
  border: 1px solid rgba(123,77,255,0.35);
  border-radius: 24px;
  padding: 52px 44px;
  text-align: center;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 0 80px rgba(123,77,255,0.18), 0 32px 80px rgba(0,0,0,0.6);
  position: relative;
  overflow: hidden;
}

.rl-gate-box::before {
  content: '';
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  height: 140px;
  background: radial-gradient(ellipse, rgba(123,77,255,0.22) 0%, transparent 70%);
  pointer-events: none;
}

.rl-gate-lock {
  width: 52px;
  height: 52px;
  background: rgba(123,77,255,0.15);
  border: 1px solid rgba(123,77,255,0.35);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
  color: #9b7bff;
}

.rl-gate-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9b7bff;
  margin-bottom: 14px;
}

.rl-gate-box h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 12px;
  line-height: 1.2;
}

.rl-gate-box > p {
  font-size: 15px;
  color: rgba(196,176,255,0.65);
  line-height: 1.7;
  margin-bottom: 30px;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.rl-gate-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.rl-gate-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(123,77,255,0.3);
  border-radius: 12px;
  padding: 14px 18px;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.rl-gate-input::placeholder { color: rgba(196,176,255,0.35); }

.rl-gate-input:focus {
  border-color: rgba(123,77,255,0.6);
  box-shadow: 0 0 0 3px rgba(123,77,255,0.1);
}

.rl-gate-btn {
  width: 100%;
  padding: 15px 24px;
  background: linear-gradient(135deg, #7b4dff 0%, #5a32cc 100%);
  border: none;
  border-radius: 12px;
  color: #ffffff;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  letter-spacing: 0.02em;
}

.rl-gate-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.rl-gate-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.rl-gate-error {
  font-size: 13px;
  color: #ff7b7b;
  min-height: 18px;
  text-align: center;
  margin-bottom: 4px;
}

.rl-gate-fine {
  font-size: 12px;
  color: rgba(196,176,255,0.3);
  margin-bottom: 20px !important;
}

.rl-gate-perks {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.rl-gate-perks span {
  font-size: 12px;
  color: rgba(196,176,255,0.55);
  background: rgba(123,77,255,0.1);
  border: 1px solid rgba(123,77,255,0.2);
  border-radius: 20px;
  padding: 4px 12px;
  font-weight: 500;
}

@media (max-width: 520px) {
  .rl-gate-box { padding: 40px 24px; }
}
