/*
 * Public Pages Stylesheet
 * This file contains only the styles needed for public marketing pages
 * Separate from portal/admin styles to keep the bundle size minimal
 */

/* Progress bar styles for Turbo */
.progress-bar {
  z-index: 9999;
  transition: width 300ms ease-out, opacity 150ms ease-out;
}

.progress-bar.hidden {
  opacity: 0;
}

/* Loading states for public pages */
.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #3B82F6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Navigation link color transitions */
.nav-link {
  color: white;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: rgb(216, 180, 254); /* purple-300 */
}

/* When navbar has scrolled class */
.navbar-scrolled .nav-link {
  color: rgb(31, 41, 55); /* gray-800 */
}

.navbar-scrolled .nav-link:hover {
  color: rgb(147, 51, 234); /* purple-600 */
}

/* Animation utilities used in public pages */
.fade-in {
  animation: fadeIn 0.3s ease-in;
}

.slide-in {
  animation: slideIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from { 
    opacity: 0; 
    transform: translateY(20px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

/* Fix for Font Awesome spinner drift on public pages */
.fa-spin {
  display: inline-block;
  transform-origin: center center !important;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  perspective: 1000px;
  -webkit-perspective: 1000px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transform: translateZ(0);
  will-change: transform;
}

/* Custom spinner that doesn't drift */
.spinner-no-drift {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  border: 3px solid rgba(156, 163, 175, 0.5);
  border-radius: 50%;
  border-top-color: #3b82f6;
  animation: spin-no-drift 1s linear infinite;
}

.spinner-no-drift-sm {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(156, 163, 175, 0.5);
  border-radius: 50%;
  border-top-color: #3b82f6;
  animation: spin-no-drift 1s linear infinite;
}

.spinner-no-drift-lg {
  display: inline-block;
  width: 3rem;
  height: 3rem;
  border: 4px solid rgba(156, 163, 175, 0.5);
  border-radius: 50%;
  border-top-color: #3b82f6;
  animation: spin-no-drift 1s linear infinite;
}

@keyframes spin-no-drift {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ==========================================
   Medium-style Blog Post Styles
   ========================================== */

/* Article title - bold and commanding */
.blog-title {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #111111;
  margin-bottom: 1.25rem;
}

@media (max-width: 640px) {
  .blog-title {
    font-size: 1.75rem;
  }
}

/* Meta info - clearly secondary */
.blog-meta {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.875rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.blog-meta a {
  color: #6b7280;
  text-decoration: none;
}

.blog-meta a:hover {
  color: #374151;
}

/* Base prose/trix-content typography */
.prose .trix-content,
.trix-content {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 1.125rem;
  line-height: 1.8;
  color: #292929;
  letter-spacing: -0.003em;
}

/* Paragraphs - tighter spacing */
.trix-content > div,
.prose .trix-content > div {
  margin-bottom: 1em;
}

/* Empty divs (line breaks in Trix) - collapse them */
.trix-content > div:empty,
.prose .trix-content > div:empty {
  display: none;
}

/* Divs with only a br - also collapse */
.trix-content > div > br:only-child {
  display: none;
}

/* Lists */
.trix-content ul,
.prose .trix-content ul {
  list-style-type: disc;
  padding-left: 1.75rem;
  margin: 1rem 0;
}

.trix-content ol,
.prose .trix-content ol {
  list-style-type: decimal;
  padding-left: 1.75rem;
  margin: 1rem 0;
}

.trix-content li,
.prose .trix-content li {
  margin: 0.5rem 0;
  padding-left: 0.25rem;
  line-height: 1.6;
}

/* Tighter spacing for list items */
.trix-content li > div,
.prose .trix-content li > div {
  margin-bottom: 0;
}

/* Blockquotes - Medium style */
.trix-content blockquote,
.prose .trix-content blockquote {
  border-left: 3px solid #292929;
  padding-left: 1.25rem;
  margin: 1.75rem 0;
  color: #292929;
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.6;
}

/* Headings - Medium style with more weight */
.trix-content strong,
.prose .trix-content strong {
  font-weight: 700;
  color: #191919;
}

/* Bold text styling - keep inline, don't auto-convert to headers */
.trix-content strong,
.prose .trix-content strong {
  font-weight: 700;
  color: #191919;
}


.trix-content h1 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 2rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  letter-spacing: -0.02em;
  color: #191919;
}

.trix-content h2 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  letter-spacing: -0.02em;
  color: #191919;
}

.trix-content h3 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 1.75rem 0 0.5rem;
  letter-spacing: -0.01em;
  color: #191919;
}

/* Images */
.trix-content figure,
.prose .trix-content figure,
.trix-content .attachment,
.prose .trix-content .attachment {
  margin: 2rem 0;
}

.trix-content figure img,
.prose .trix-content figure img,
.trix-content .attachment img,
.prose .trix-content .attachment img,
.trix-content img,
.prose .trix-content img {
  border-radius: 4px;
  width: 100%;
  height: auto;
}

/* Image captions - Medium style */
.trix-content figcaption,
.prose .trix-content figcaption,
.trix-content .attachment__caption,
.prose .trix-content .attachment__caption {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.875rem;
  color: #757575;
  text-align: center;
  margin-top: 0.75rem;
  padding-bottom: 1.5rem;
  border-bottom: none;
  line-height: 1.4;
}

/* Action Text attachment captions */
.trix-content action-text-attachment,
.prose .trix-content action-text-attachment {
  display: block;
  margin: 2rem 0;
}

.trix-content action-text-attachment .attachment,
.prose .trix-content action-text-attachment .attachment {
  display: block;
}

.trix-content action-text-attachment .attachment__caption,
.prose .trix-content action-text-attachment .attachment__caption {
  display: block;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.875rem;
  color: #757575;
  text-align: center;
  margin-top: 0.75rem;
  margin-bottom: 1.5rem;
}

/* Links - Medium style */
.trix-content a,
.prose .trix-content a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(0, 0, 0, 0.3);
  text-underline-offset: 2px;
}

.trix-content a:hover,
.prose .trix-content a:hover {
  text-decoration-color: rgba(0, 0, 0, 0.8);
}

/* Horizontal rule */
.trix-content hr,
.prose .trix-content hr {
  border: none;
  text-align: center;
  margin: 2rem 0;
}

.trix-content hr::before,
.prose .trix-content hr::before {
  content: "...";
  font-size: 1.5rem;
  letter-spacing: 0.6em;
  color: #757575;
}

/* Text truncation utilities for blog posts and content */
.truncate-2-lines,
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.truncate-3-lines,
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Mobile menu hamburger icon visibility */
.mobile-menu-trigger .hamburger-line,
button.mobile-menu-trigger .hamburger-line,
.hamburger-line {
  background: #333333 !important;
  background-color: #333333 !important;
  display: block !important;
  width: 100% !important;
  height: 2px !important;
  border-radius: 1px !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Ensure hamburger icon container is visible */
.hamburger-icon {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
  width: 20px !important;
  height: auto !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Theme-specific hamburger colors */
[data-theme="dark"] .hamburger-line,
[data-theme="brand"] .hamburger-line {
  background: #ffffff !important;
  background-color: #ffffff !important;
}

[data-theme="light"] .hamburger-line,
[data-theme="corporate"] .hamburger-line {
  background: #000000 !important;
  background-color: #000000 !important;
}

/* Mobile menu trigger visibility */
.mobile-menu-trigger {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(0, 0, 0, 0.1) !important;
  border: 1px solid rgba(0, 0, 0, 0.3) !important;
  opacity: 1 !important;
  visibility: visible !important;
}
/* Scroll-triggered animations */
.scroll-animate-hidden {
  opacity: 0;
  transform: translateY(20px);
  will-change: opacity, transform;
}

.scroll-animate-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Stagger animation support - delays are set via inline styles by controller */
[data-scroll-animation-stagger] {
  transition-delay: 0s; /* Default, will be overridden by JS */
}
