/* NinjaPear Theme Styles */

/* Hide Ghost Portal button */
[data-portal],
.gh-portal-triggerbtn-container,
#ghost-portal-root button,
.gh-portal-triggerbtn,
iframe[title*="portal"],
iframe[src*="portal"] {
  display: none !important;
}

/* Custom styles for Parsley form validation errors */
.parsley-errors-list {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 0.5rem 0;
  font-size: 0.875rem;
}

.parsley-errors-list li {
  color: #ef4444; /* red color using Tailwind red-500 */
  margin: 0.125rem 0;
  padding: 0;
  line-height: 1.4;
}

.parsley-errors-list.filled {
  display: block;
}

.parsley-errors-list li::before {
  content: "⚠ ";
  margin-right: 0.25rem;
  font-size: 0.75rem;
}

.parsley-errors-list li + li {
  margin-top: 0.125rem;
}

.form-group .parsley-errors-list,
.form-floating .parsley-errors-list {
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}

/* Animation keyframes */
@keyframes moveHorizontal {
  0%,
  100% {
    transform: translateX(-10px);
  }
  50% {
    transform: translateX(10px);
  }
}

.animate-move-horizontal {
  animation: moveHorizontal 3s ease-in-out infinite;
}

.speech-bubble {
  position: relative;
  background: #f3e8ff;
  border-radius: 0.4em;
  padding: 0.5rem 1rem;
  color: #5b21b6;
  font-size: 0.875rem;
  max-width: max-content;
  margin: 0 auto 0.5rem auto;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.speech-bubble:after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 0;
  border: 10px solid transparent;
  border-top-color: #f3e8ff;
  border-bottom: 0;
  margin-left: -10px;
  margin-bottom: -10px;
}

/* CSS Variables for NinjaPear brand colors */
:root,
[data-bs-theme="light"] {
  /* Primary – Tailwind purple-600 (#9333ea) */
  --bs-primary: #9333ea;
  --bs-primary-rgb: 147, 51, 234;

  /* Secondary – Tailwind zinc-700 (#3f3f46) */
  --bs-secondary: #3f3f46;
  --bs-secondary-rgb: 63, 63, 70;

  /* Success – Tailwind green-500 (#22c55e) */
  --bs-success: #22c55e;
  --bs-success-rgb: 34, 197, 94;

  /* Info – Tailwind sky-500 (#0ea5e9) */
  --bs-info: #0ea5e9;
  --bs-info-rgb: 14, 165, 233;

  /* Warning – Tailwind amber-500 (#f59e0b) */
  --bs-warning: #f59e0b;
  --bs-warning-rgb: 245, 158, 11;

  /* Danger – Tailwind red-500 (#ef4444) */
  --bs-danger: #ef4444;
  --bs-danger-rgb: 239, 68, 68;

  /* Light & Dark (Zinc palette) */
  --bs-light: #f4f4f5; /* zinc-100 */
  --bs-light-rgb: 244, 244, 245;

  --bs-dark: #09090b; /* zinc-950 */
  --bs-dark-rgb: 9, 9, 11;
}

/* Override Bootstrap button color variables */
.btn-primary {
  --bs-btn-bg: #9333ea;
  --bs-btn-border-color: #9333ea;
  --bs-btn-hover-bg: #7e22ce;
  --bs-btn-hover-border-color: #7e22ce;
  --bs-btn-focus-shadow-rgb: 147, 51, 234;
  --bs-btn-active-bg: #6b21a8;
  --bs-btn-active-border-color: #6b21a8;
  --bs-btn-disabled-bg: #9333ea;
  --bs-btn-disabled-border-color: #9333ea;
}

.btn-outline-primary {
  --bs-btn-color: #9333ea;
  --bs-btn-border-color: #9333ea;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #9333ea;
  --bs-btn-hover-border-color: #9333ea;
  --bs-btn-focus-shadow-rgb: 147, 51, 234;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #9333ea;
  --bs-btn-active-border-color: #9333ea;
}

/* Always underline hyperlinks */
a.underline {
  text-decoration: underline !important;
}

/* Remove automatic underline on hover for all links */
a:hover {
  text-decoration: none !important;
}

/* Override some existing styles for better Tailwind integration */
.site-content {
  background: white;
}

/* Ensure proper z-index for navigation dropdowns */
.group:hover .group-hover\:opacity-100 {
  opacity: 1;
}

.group:hover .group-hover\:visible {
  visibility: visible;
}

/* Mobile menu toggle animations */
.transition-all {
  transition: all 0.2s ease-in-out;
}

/* Style overrides for Ghost content to work with NinjaPear theme */
.gh-content {
  color: #3f3f46; /* zinc-700 */
}

.gh-content h1,
.gh-content h2,
.gh-content h3,
.gh-content h4,
.gh-content h5,
.gh-content h6 {
  color: #18181b; /* zinc-900 */
}

.gh-content a {
  color: #9333ea; /* purple-600 */
}

.gh-content a:hover {
  color: #7e22ce; /* purple-700 */
  text-decoration: underline;
}

/* Override viewport background */
.viewport {
  background: white;
}

/* Make sure buttons use NinjaPear styling */
.btn {
  border-radius: 0.375rem; /* rounded-md equivalent */
  font-weight: 500; /* font-medium */
  transition: all 0.15s ease-in-out;
}

/* Ensure proper spacing around site content */
.site-content {
  padding-top: 0;
}

/* Custom Ghost card styling to match NinjaPear theme */
.post-card {
  border: 1px solid #e4e4e7; /* zinc-200 */
  border-radius: 0.5rem; /* rounded-lg */
  background: white;
  transition: all 0.15s ease-in-out;
}

.post-card:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.post-card-title a {
  color: #18181b; /* zinc-900 */
  text-decoration: none;
}

.post-card-title a:hover {
  color: #9333ea; /* purple-600 */
}

.post-card-excerpt {
  color: #71717a; /* zinc-500 */
}

/* Ensure navigation dropdown works properly */
.relative .absolute {
  z-index: 50;
}

/* Navigation font size consistency - override any Bootstrap remnants */
header nav a,
header nav button {
  font-size: 1rem !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
}

/* Ensure navigation text uses default Tailwind sizing */
.navbar-nav .nav-link,
.nav-link,
.navbar-brand {
  font-size: inherit !important;
  font-weight: inherit !important;
}

/* Override any Bootstrap navbar styles */
.navbar,
.navbar-nav,
.nav,
.nav-item {
  font-size: 1rem !important;
}

/* Ensure consistency with web app navigation */
nav a {
  font-size: 1rem;
  line-height: 1.5;
  font-weight: 400;
}

/* ===== MKDOCS-INSPIRED CONTENT STYLING ===== */

/* Typography and content styling inspired by mkdocs theme */
.gh-content {
  font-size: 1rem !important;
  line-height: 1.7;
  color: #374151; /* gray-700 */
  max-width: none;
}

/* Prose styling for article content */
.prose {
  max-width: none;
}

.prose h1 {
  color: #111827; /* gray-900 */
  font-weight: 700;
  font-size: 2.25rem;
  line-height: 1.2;
  margin-top: 0;
  margin-bottom: 1rem;
}

.prose h2 {
  color: #111827; /* gray-900 */
  font-weight: 600;
  font-size: 1.875rem;
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.prose h3 {
  color: #111827; /* gray-900 */
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.4;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.prose h4 {
  color: #111827; /* gray-900 */
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.4;
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
}

.prose h5, .prose h6 {
  color: #111827; /* gray-900 */
  font-weight: 600;
  font-size: 1.125rem;
  line-height: 1.4;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.prose p {
  margin-bottom: 1rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.prose a {
  color: #9333ea; /* purple-600 */
  text-decoration: underline;
  text-decoration-color: rgba(147, 51, 234, 0.3);
  text-underline-offset: 2px;
  transition: all 0.2s ease;
}

.prose a:hover {
  color: #7e22ce; /* purple-700 */
  text-decoration-color: #7e22ce;
}

/* Lists with proper bullet points (from mkdocs fixes) */
.prose ul {
  list-style-type: disc !important;
  list-style-position: outside !important;
  padding-left: 1.5rem !important;
  margin: 1rem 0;
}

.prose ul li {
  display: list-item !important;
  list-style-type: disc !important;
  margin: 0.5rem 0;
  padding-left: 0.25rem;
}

.prose ol {
  list-style-type: decimal !important;
  list-style-position: outside !important;
  padding-left: 1.5rem !important;
  margin: 1rem 0;
}

.prose ol li {
  display: list-item !important;
  list-style-type: decimal !important;
  margin: 0.5rem 0;
  padding-left: 0.25rem;
}

/* Nested lists */
.prose ul ul {
  list-style-type: circle !important;
  margin: 0.25rem 0 0.25rem 1rem;
}

.prose ul ul ul {
  list-style-type: square !important;
}

/* Images with shadows (from mkdocs) */
.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  box-shadow: 0 1px 25px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.15);
  margin: 1.5rem auto;
  display: block;
}

/* Remove shadow from small inline images */
.prose img[src*="logo"],
.prose img[src*="icon"],
.prose img[src*="favicon"] {
  box-shadow: none;
  border-radius: 0;
  display: inline-block;
  margin: 0;
}

/* Tables with proper styling */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.875rem;
  border: 1px solid #e5e7eb; /* gray-200 */
  border-radius: 0.5rem;
  overflow: hidden;
}

.prose th,
.prose td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb; /* gray-200 */
}

.prose th {
  background-color: #f9fafb; /* gray-50 */
  font-weight: 600;
  color: #374151; /* gray-700 */
  border-bottom: 2px solid #e5e7eb; /* gray-200 */
}

.prose tbody tr:hover {
  background-color: #f9fafb; /* gray-50 */
}

/* Code blocks and inline code */
.prose code {
  background: #f3f4f6; /* gray-100 */
  color: #dc2626; /* red-600 */
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
  font-weight: 500;
}

.prose pre {
  background: #1f2937; /* gray-800 */
  color: #f9fafb; /* gray-50 */
  overflow-x: auto;
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 1.5rem 0;
  font-size: 0.875rem;
  line-height: 1.7;
}

.prose pre code {
  background: none;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-weight: normal;
}

/* Blockquotes */
.prose blockquote {
  border-left: 4px solid #9333ea; /* purple-600 */
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  background: #faf5ff; /* purple-50 */
  border-radius: 0 0.5rem 0.5rem 0;
  font-style: italic;
  color: #6b21a8; /* purple-800 */
}

.prose blockquote p {
  margin: 0;
}

/* Horizontal rules */
.prose hr {
  border: none;
  border-top: 1px solid #e5e7eb; /* gray-200 */
  margin: 2rem 0;
}

/* Table of Contents Styling */
.gh-toc {
  font-size: 0.875rem;
}

.gh-toc ul {
  list-style: none !important;
  padding-left: 0 !important;
  margin: 0 !important;
}

.gh-toc li {
  margin: 0.25rem 0 !important;
  padding: 0 !important;
}

.gh-toc a {
  color: #6b7280; /* gray-500 */
  text-decoration: none !important;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  display: block;
  transition: all 0.2s;
}

.gh-toc a:hover {
  color: #9333ea; /* purple-600 */
  background: #faf5ff; /* purple-50 */
}

.gh-toc a.is-active-link {
  color: #9333ea; /* purple-600 */
  background: #f3e8ff; /* purple-100 */
  font-weight: 500;
}

/* Nested TOC items */
.gh-toc ul ul {
  padding-left: 1rem !important;
  margin-top: 0.25rem !important;
}

/* Mobile TOC toggle functionality */
#mobile-toc-toggle.active #mobile-toc-icon {
  transform: rotate(180deg);
}

/* Responsive tables */
.prose .table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Fix content overflow */
.gh-content {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Ensure proper spacing for content */
.site-main {
  padding-top: 0;
}

/* Line clamp utility for excerpts */
.line-clamp-3 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

/* ===== RESPONSIVE DESIGN & CONTAINER IMPROVEMENTS ===== */

/* Consistent container widths matching web app */
.max-w-7xl {
  max-width: 80rem;
}

.max-w-4xl {
  max-width: 56rem;
}

/* Responsive grid improvements */
@media (max-width: 768px) {
  .grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

  .prose {
    font-size: 0.9rem;
  }

  .prose h1 {
    font-size: 1.875rem;
  }

  .prose h2 {
    font-size: 1.5rem;
  }

  .prose h3 {
    font-size: 1.25rem;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Mobile content improvements */
@media (max-width: 640px) {
  .max-w-7xl,
  .max-w-4xl {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .text-4xl.lg\:text-5xl {
    font-size: 2rem;
  }

  .text-3xl.lg\:text-4xl {
    font-size: 1.875rem;
  }

  .py-16.lg\:py-20 {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }

  .py-12.lg\:py-16 {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }
}

/* Ensure proper spacing on all devices */
.site-content {
  min-height: calc(100vh - 200px);
}

/* Hide desktop TOC on mobile, show mobile TOC */
@media (max-width: 1024px) {
  .hidden.lg\:block {
    display: none !important;
  }

  .lg\:hidden {
    display: block;
  }
}

@media (min-width: 1024px) {
  .lg\:hidden {
    display: none;
  }

  .hidden.lg\:block {
    display: block !important;
  }
}

/* Improved aspect ratio for post card images */
.aspect-video {
  aspect-ratio: 16 / 9;
}

/* Smooth animations and transitions */
* {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus states for accessibility */
button:focus,
a:focus {
  outline: 2px solid #9333ea;
  outline-offset: 2px;
}

/* Improved text contrast for readability */
.text-zinc-600 {
  color: #52525b; /* Slightly darker for better contrast */
}

.text-zinc-500 {
  color: #6b7280; /* Slightly darker for better contrast */
}

/* Ensure buttons and interactive elements are properly sized */
button,
.btn {
  min-height: 2.5rem;
  min-width: 2.5rem;
}

/* Override any remaining viewport class styling */
.viewport {
  padding: 0;
  margin: 0;
  background: white;
}

/* Newsletter signup form styling improvements */
.subscribe-form {
  background: #fafafa;
  border-top: 1px solid #e5e7eb;
  padding: 3rem 0;
}

.subscribe-form .max-w-7xl {
  text-align: center;
}

.subscribe-form h3 {
  color: #111827;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.subscribe-form p {
  color: #6b7280;
  margin-bottom: 2rem;
}

.subscribe-form input {
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-right: 0.5rem;
  font-size: 0.875rem;
}

.subscribe-form button {
  background: #9333ea;
  color: white;
  border: none;
  border-radius: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.subscribe-form button:hover {
  background: #7e22ce;
}