/* library.css — Brief Library index and detail page styles */

/* ── Base ── */
.library-body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #09090b;
  color: #e4e4e7;
  line-height: 1.6;
}

/* ── Nav ── */
.lib-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  background: rgba(9,9,11,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #e4e4e7;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6366f1;
  box-shadow: 0 0 8px rgba(99,102,241,0.6);
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
}

.nav-links a {
  color: #a1a1aa;
  text-decoration: none;
  transition: color 0.15s;
}

.nav-links a:hover,
.nav-links a.active { color: #e4e4e7; }

.btn-nav-cta {
  background: #6366f1;
  color: #fff !important;
  padding: 7px 16px;
  border-radius: 6px;
  font-weight: 600;
  transition: background 0.15s !important;
}

.btn-nav-cta:hover { background: #4f46e5 !important; }

/* ── Sticky CTA (brief detail only) ── */
.sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px 24px;
  background: #6366f1;
  transform: translateY(100%);
  transition: transform 0.25s ease;
  font-size: 14px;
}

.sticky-cta span { color: #e0e0ff; }
.sticky-cta em { font-style: normal; font-weight: 600; color: #fff; }

.btn-sticky-cta {
  background: #fff;
  color: #4f46e5;
  padding: 8px 18px;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
  font-size: 13px;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-sticky-cta:hover { background: #e0e0ff; }

/* ── Library Hero (index) ── */
.lib-hero {
  padding: 72px 24px 56px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(99,102,241,0.12) 0%, transparent 70%);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.lib-hero-inner {
  max-width: 640px;
  margin: 0 auto;
}

.lib-hero-badge {
  display: inline-block;
  background: rgba(99,102,241,0.15);
  color: #818cf8;
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.lib-hero-h1 {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 700;
  color: #f4f4f5;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.lib-hero-sub {
  font-size: 16px;
  color: #a1a1aa;
  margin: 0 0 28px;
  line-height: 1.6;
}

.lib-hero-sub strong { color: #e4e4e7; }

.btn-lib-cta {
  display: inline-block;
  background: #6366f1;
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}

.btn-lib-cta:hover {
  background: #4f46e5;
  transform: translateY(-1px);
}

/* ── Library Grid ── */
.lib-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}

/* ── Brief Card ── */
.lib-card {
  background: #111113;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.lib-card:hover {
  border-color: rgba(99,102,241,0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.lib-card-link {
  display: block;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  height: 100%;
  box-sizing: border-box;
}

.lib-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.lib-card-chip {
  background: rgba(99,102,241,0.12);
  color: #818cf8;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lib-card-views {
  font-size: 11px;
  color: #52525b;
}

.lib-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #e4e4e7;
  margin: 0 0 8px;
  line-height: 1.4;
}

.lib-card-desc {
  font-size: 13px;
  color: #71717a;
  margin: 0 0 16px;
  line-height: 1.5;
}

.lib-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lib-card-competitors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lib-competitor-chip {
  background: rgba(255,255,255,0.05);
  color: #a1a1aa;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
}

.lib-competitor-chip--more {
  background: rgba(99,102,241,0.1);
  color: #818cf8;
}

.lib-card-arrow {
  color: #52525b;
  font-size: 16px;
  transition: color 0.15s, transform 0.15s;
}

.lib-card:hover .lib-card-arrow {
  color: #6366f1;
  transform: translateX(3px);
}

/* ── Empty State ── */
.lib-empty {
  text-align: center;
  padding: 80px 24px;
}

.lib-empty-icon {
  font-size: 40px;
  margin-bottom: 16px;
}

.lib-empty h2 {
  font-size: 20px;
  font-weight: 600;
  color: #e4e4e7;
  margin: 0 0 8px;
}

.lib-empty p {
  font-size: 14px;
  color: #71717a;
  max-width: 400px;
  margin: 0 auto 24px;
}

/* ── Pagination ── */
.lib-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.lib-page-btn {
  background: #18181b;
  border: 1px solid rgba(255,255,255,0.1);
  color: #a1a1aa;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.lib-page-btn:hover {
  border-color: #6366f1;
  color: #e4e4e7;
}

.lib-page-info {
  font-size: 13px;
  color: #52525b;
}

/* ── Bottom CTA ── */
.lib-bottom-cta {
  text-align: center;
  padding: 80px 24px;
  background: #0d0d10;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.lib-bottom-cta h2 {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
  color: #f4f4f5;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.lib-bottom-cta p {
  font-size: 15px;
  color: #71717a;
  max-width: 520px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

.lib-cta-note {
  margin-top: 12px;
  font-size: 12px;
  color: #52525b;
}

/* ── Brief Detail Hero ── */
.lib-brief-hero {
  padding: 48px 24px 40px;
  max-width: 900px;
  margin: 0 auto;
}

.lib-breadcrumb {
  font-size: 12px;
  color: #52525b;
  margin-bottom: 16px;
}

.lib-breadcrumb a {
  color: #71717a;
  text-decoration: none;
  transition: color 0.15s;
}

.lib-breadcrumb a:hover { color: #a1a1aa; }

.lib-brief-h1 {
  font-size: clamp(22px, 4vw, 34px);
  font-weight: 700;
  color: #f4f4f5;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.lib-brief-sub {
  font-size: 15px;
  color: #71717a;
  margin: 0 0 16px;
}

.lib-brief-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-chip {
  background: rgba(255,255,255,0.05);
  color: #a1a1aa;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
}

/* ── Brief Detail Layout ── */
.lib-brief-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 120px;
}

.lib-brief-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  align-items: start;
}

/* ── Brief Article (markdown rendered) ── */
.lib-brief-article {
  min-width: 0;
}

.lib-brief-article h1,
.lib-brief-article h2 {
  color: #f4f4f5;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 40px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.lib-brief-article h1 { font-size: 24px; }
.lib-brief-article h2 { font-size: 20px; }

.lib-brief-article h3 {
  color: #e4e4e7;
  font-size: 16px;
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 10px;
}

.lib-brief-article p {
  color: #a1a1aa;
  margin-bottom: 16px;
  font-size: 15px;
  line-height: 1.7;
}

.lib-brief-article ul,
.lib-brief-article ol {
  color: #a1a1aa;
  padding-left: 24px;
  margin-bottom: 16px;
}

.lib-brief-article li {
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 4px;
}

.lib-brief-article strong { color: #e4e4e7; }
.lib-brief-article em { color: #c4c4c8; }

.lib-brief-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}

.lib-brief-article th {
  background: #18181b;
  color: #e4e4e7;
  font-weight: 600;
  padding: 10px 14px;
  text-align: left;
  border: 1px solid rgba(255,255,255,0.08);
}

.lib-brief-article td {
  padding: 9px 14px;
  border: 1px solid rgba(255,255,255,0.06);
  color: #a1a1aa;
  vertical-align: top;
}

.lib-brief-article tr:nth-child(even) td {
  background: rgba(255,255,255,0.02);
}

.lib-brief-article code {
  background: #18181b;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 13px;
  color: #c084fc;
}

.lib-brief-article blockquote {
  border-left: 3px solid #6366f1;
  margin: 20px 0;
  padding: 12px 16px;
  background: rgba(99,102,241,0.06);
  border-radius: 0 6px 6px 0;
}

.lib-brief-article blockquote p {
  margin: 0;
  color: #c4c4c8;
}

/* ── Sidebar ── */
.lib-brief-sidebar {
  position: sticky;
  top: 72px;
}

.lib-sidebar-cta {
  background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(139,92,246,0.08));
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.lib-sidebar-cta-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #818cf8;
  margin-bottom: 8px;
}

.lib-sidebar-cta h3 {
  font-size: 15px;
  font-weight: 700;
  color: #f4f4f5;
  margin: 0 0 8px;
  line-height: 1.3;
}

.lib-sidebar-cta p {
  font-size: 13px;
  color: #71717a;
  margin: 0 0 16px;
  line-height: 1.5;
}

.btn-sidebar-cta {
  display: block;
  background: #6366f1;
  color: #fff;
  text-align: center;
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  transition: background 0.15s;
}

.btn-sidebar-cta:hover { background: #4f46e5; }

.lib-sidebar-note {
  text-align: center;
  font-size: 11px;
  color: #52525b;
  margin-top: 8px;
}

.lib-sidebar-section {
  background: #111113;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.lib-sidebar-section h4 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #52525b;
  margin: 0 0 12px;
}

.lib-competitor-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lib-competitor-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.lib-competitor-list li:last-child { border-bottom: none; }

.lib-competitor-list a {
  color: #a1a1aa;
  text-decoration: none;
  transition: color 0.15s;
}

.lib-competitor-list a:hover { color: #e4e4e7; }

.lib-comp-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #52525b;
  flex-shrink: 0;
}

.lib-comp-dot--product { background: #6366f1; }

.lib-comp-badge {
  font-size: 10px;
  color: #52525b;
  margin-left: auto;
}

.lib-related-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lib-related-list li {
  padding: 5px 0;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.lib-related-list li:last-child { border-bottom: none; }

.lib-related-list a {
  color: #71717a;
  text-decoration: none;
  transition: color 0.15s;
}

.lib-related-list a:hover { color: #a1a1aa; }

.lib-sidebar-pricing {
  text-align: center;
  padding: 12px;
}

.lib-sidebar-pricing a {
  font-size: 12px;
  color: #52525b;
  text-decoration: none;
  transition: color 0.15s;
}

.lib-sidebar-pricing a:hover { color: #a1a1aa; }

/* ── Publish toggle (in app.css context) ── */
.lib-publish-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(99,102,241,0.06);
  border: 1px solid rgba(99,102,241,0.18);
  border-radius: 8px;
  font-size: 13px;
}

.lib-publish-toggle-label {
  color: #a1a1aa;
  flex: 1;
}

.lib-publish-toggle-url {
  font-size: 11px;
  color: #6366f1;
  text-decoration: none;
}

.lib-publish-toggle-url:hover { text-decoration: underline; }

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #3f3f46;
  border-radius: 20px;
  transition: background 0.2s;
}

.toggle-slider:before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
  background: #6366f1;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(16px);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .lib-brief-layout {
    grid-template-columns: 1fr;
  }

  .lib-brief-sidebar {
    position: static;
    order: -1;
  }

  .lib-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    gap: 12px;
    font-size: 13px;
  }

  .lib-hero {
    padding: 48px 16px 40px;
  }

  .sticky-cta {
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
  }
}

/* ── BriefFooterCTA ───────────────────────────────────────────────────────── */
.brief-footer-cta {
  max-width: 900px;
  margin: 0 auto;
  padding: 56px 24px 72px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* Two-card row */
.brief-footer-cta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 40px;
}

.brief-footer-card {
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.brief-footer-card--primary {
  background: linear-gradient(135deg, rgba(99,102,241,0.16) 0%, rgba(139,92,246,0.10) 100%);
  border: 1px solid rgba(99,102,241,0.30);
}

.brief-footer-card--secondary {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
}

.brief-footer-card-eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #818cf8;
}

.brief-footer-card--secondary .brief-footer-card-eyebrow {
  color: #71717a;
}

.brief-footer-card-title {
  font-size: 17px;
  font-weight: 700;
  color: #f4f4f5;
  margin: 0;
  line-height: 1.3;
}

.brief-footer-card-body {
  font-size: 14px;
  color: #71717a;
  margin: 0;
  line-height: 1.6;
  flex: 1;
}

.brief-footer-btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s, transform 0.1s;
  align-self: flex-start;
  white-space: nowrap;
}

.brief-footer-btn--primary {
  background: #6366f1;
  color: #fff;
}

.brief-footer-btn--primary:hover {
  background: #4f46e5;
  transform: translateY(-1px);
}

.brief-footer-btn--secondary {
  background: rgba(255,255,255,0.07);
  color: #e4e4e7;
  border: 1px solid rgba(255,255,255,0.12);
}

.brief-footer-btn--secondary:hover {
  background: rgba(255,255,255,0.10);
  transform: translateY(-1px);
}

.brief-footer-trust {
  font-size: 11px;
  color: #52525b;
  line-height: 1.4;
}

/* Related briefs carousel */
.brief-footer-related {
  margin-bottom: 28px;
}

.brief-footer-related-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #52525b;
  margin: 0 0 14px;
}

.brief-footer-carousel {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.brief-footer-carousel::-webkit-scrollbar {
  height: 4px;
}

.brief-footer-carousel::-webkit-scrollbar-track { background: transparent; }
.brief-footer-carousel::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
}

.brief-footer-carousel-card {
  flex: 0 0 260px;
  background: #111113;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 16px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s, transform 0.15s;
}

.brief-footer-carousel-card:hover {
  border-color: rgba(99,102,241,0.35);
  transform: translateY(-2px);
}

.brief-footer-carousel-title {
  font-size: 13px;
  font-weight: 600;
  color: #e4e4e7;
  line-height: 1.4;
}

.brief-footer-carousel-desc {
  font-size: 12px;
  color: #71717a;
  line-height: 1.5;
  flex: 1;
}

.brief-footer-carousel-cta {
  font-size: 12px;
  color: #6366f1;
  font-weight: 600;
  margin-top: 4px;
}

/* Trust microcopy */
.brief-footer-microcopy {
  text-align: center;
  font-size: 12px;
  color: #3f3f46;
  margin-top: 12px;
}

/* ── BriefFooterCTA responsive ── */
@media (max-width: 640px) {
  .brief-footer-cta-row {
    grid-template-columns: 1fr;
  }

  .brief-footer-carousel-card {
    flex: 0 0 220px;
  }
}

/* ── LinkedIn Referral Banner ─────────────────────────────────────────────── */
.linkedin-referral-banner {
  background: rgba(10, 102, 194, 0.10);
  border-bottom: 1px solid rgba(10, 102, 194, 0.25);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
}

.linkedin-referral-text {
  color: #a1c4e8;
}

.linkedin-referral-cta {
  display: inline-block;
  background: #0a66c2;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
}

.linkedin-referral-cta:hover {
  background: #0860b8;
  color: #fff;
}

@media (max-width: 520px) {
  .linkedin-referral-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
