/* Custom styles for Ed Robinson Blog */

/* Category color variables */
:root {
  --all-primary: #F59E0B;
  --all-accent: #FBBF24;
  --tech-primary: #3B82F6;
  --tech-accent: #60A5FA;
  --outdoors-primary: #10B981;
  --outdoors-accent: #34D399;
  --herpetology-primary: #F59E0B;
  --herpetology-accent: #FBBF24;
  --recreation-primary: #EC4899;
  --recreation-accent: #F472B6;
  --faith-primary: #A855F7;
  --faith-accent: #C084FC;
}

/* Category-specific styling */
body[data-category="all"] {
  --category-primary: var(--all-primary);
  --category-accent: var(--all-accent);
}

body[data-category="tech"] {
  --category-primary: var(--tech-primary);
  --category-accent: var(--tech-accent);
}

body[data-category="outdoors"] {
  --category-primary: var(--outdoors-primary);
  --category-accent: var(--outdoors-accent);
}

body[data-category="herpetology"] {
  --category-primary: var(--herpetology-primary);
  --category-accent: var(--herpetology-accent);
}

body[data-category="recreation"] {
  --category-primary: var(--recreation-primary);
  --category-accent: var(--recreation-accent);
}

body[data-category="faith"] {
  --category-primary: var(--faith-primary);
  --category-accent: var(--faith-accent);
}

/* Apply category colors to interactive elements */
.blog-card:hover h3,
.category-nav a.active,
.category-nav a:hover,
.nav-btn:hover,
.sidebar-link:hover {
  color: var(--category-primary);
}

.blog-card:hover {
  border-color: var(--category-primary);
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

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

/* Modal overlay */
#post-modal {
  backdrop-filter: blur(2px);
  animation: fadeIn 0.2s ease-in-out;
}

#post-modal.hidden {
  display: none !important;
}

.modal-container {
  animation: slideUp 0.3s ease-out;
  max-height: 90vh;
  overflow-y: auto;
}

/* Custom scrollbar for modal */
.modal-container::-webkit-scrollbar {
  width: 10px;
}

.modal-container::-webkit-scrollbar-track {
  background: rgba(31, 41, 55, 0.5);
  border-radius: 5px;
}

.modal-container::-webkit-scrollbar-thumb {
  background: rgba(107, 114, 128, 0.8);
  border-radius: 5px;
}

.modal-container::-webkit-scrollbar-thumb:hover {
  background: rgba(156, 163, 175, 0.9);
}

/* Close button */
.close-btn {
  position: sticky;
  top: 1rem;
  right: 1rem;
  float: right;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(31, 41, 55, 0.9);
  color: white;
  border-radius: 50%;
  transition: all 0.2s;
  z-index: 10;
  cursor: pointer;
  border: 2px solid transparent;
}

.close-btn:hover {
  background: rgba(220, 38, 38, 0.9);
  border-color: rgba(239, 68, 68, 0.5);
  transform: rotate(90deg);
}

/* Navigation buttons */
.nav-btn {
  padding: 0.75rem 1.5rem;
  background: rgba(31, 41, 55, 0.8);
  color: white;
  border-radius: 0.5rem;
  border: 2px solid rgba(75, 85, 99, 0.5);
  transition: all 0.2s;
  cursor: pointer;
  font-weight: 600;
}

.nav-btn:hover {
  background: rgba(55, 65, 81, 1);
  border-color: var(--category-primary);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.nav-btn-placeholder {
  width: 120px;
}

/* Sidebar transitions */
#sidebar {
  transition: transform 0.3s ease-in-out;
}

#sidebar-overlay {
  transition: opacity 0.3s ease-in-out;
}

/* Hamburger menu animation */
.hamburger-line {
  transition: all 0.3s ease;
}

/* Category navigation */
.category-nav a {
  position: relative;
  transition: all 0.2s;
}

.category-nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--category-primary);
  transition: width 0.2s;
}

.category-nav a.active::after,
.category-nav a:hover::after {
  width: 100%;
}

/* Prose styling for blog content */
.prose h2 {
  color: white;
  font-weight: 700;
  font-size: 2rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-family: 'Montserrat', sans-serif;
}

.prose h3 {
  color: white;
  font-weight: 600;
  font-size: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-family: 'Montserrat', sans-serif;
}

.prose p {
  color: rgb(229, 231, 235);
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

.prose a {
  color: var(--category-accent);
  text-decoration: underline;
}

.prose a:hover {
  color: var(--category-primary);
}

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

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

/* Focus styles for accessibility */
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--category-primary);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  #sidebar,
  #sidebar-overlay,
  .category-nav,
  #menu-btn,
  .post-navigation {
    display: none !important;
  }

  .modal-container {
    max-height: none !important;
    overflow: visible !important;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .modal-container {
    width: 95vw !important;
    padding: 1rem !important;
  }

  .post-title {
    font-size: 2rem !important;
  }

  .nav-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
}
