/* BayurNews Shortcodes Styles */

/* Base shortcode styles */
.bayurnews-shortcode-posts,
.bayurnews-trending-shortcode,
.bayurnews-featured-shortcode {
  margin: 1.5rem 0;
}

/* Category Posts Shortcode */
.bayurnews-shortcode-posts .shortcode-post-item {
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bayurnews-shortcode-posts .shortcode-post-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.shortcode-post-item .post-thumbnail img {
  transition: transform 0.3s ease;
}

.shortcode-post-item:hover .post-thumbnail img {
  transform: scale(1.05);
}

.shortcode-post-item .post-title a {
  text-decoration: none;
  transition: color 0.3s ease;
}

.shortcode-post-item .post-title a:hover {
  color: #3b82f6;
}

/* Trending Shortcode */
.bayurnews-trending-shortcode .trending-shortcode-item {
  transition: all 0.3s ease;
}

.bayurnews-trending-shortcode .trending-shortcode-item:hover {
  background-color: #f8fafc;
}

.trending-shortcode-item .trending-number {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  font-weight: 700;
}

.trending-shortcode-item .trending-title a {
  text-decoration: none;
  transition: color 0.3s ease;
}

.trending-shortcode-item .trending-title a:hover {
  color: #3b82f6;
}

/* Featured Shortcode */
.bayurnews-featured-shortcode .featured-shortcode-item {
  background: #fff;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bayurnews-featured-shortcode .featured-shortcode-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.featured-shortcode-item .featured-title a {
  text-decoration: none;
  transition: color 0.3s ease;
}

.featured-shortcode-item .featured-title a:hover {
  color: #3b82f6;
}

/* Hero layout specific */
.featured-hero-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

.featured-hero-layout .featured-main {
  grid-row: span 2;
}

.featured-hero-layout .featured-secondary {
  height: fit-content;
}

/* Responsive design */
@media (max-width: 768px) {
  .featured-hero-layout {
    grid-template-columns: 1fr;
  }

  .bayurnews-shortcode-posts.grid {
    grid-template-columns: 1fr !important;
  }

  .bayurnews-trending-shortcode.grid {
    grid-template-columns: 1fr !important;
  }

  .bayurnews-featured-shortcode.grid {
    grid-template-columns: 1fr !important;
  }
}

/* Carousel scrollbar styling */
.bayurnews-shortcode-posts.flex,
.bayurnews-trending-shortcode.flex,
.bayurnews-featured-shortcode.flex {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e0 #f7fafc;
}

.bayurnews-shortcode-posts.flex::-webkit-scrollbar,
.bayurnews-trending-shortcode.flex::-webkit-scrollbar,
.bayurnews-featured-shortcode.flex::-webkit-scrollbar {
  height: 8px;
}

.bayurnews-shortcode-posts.flex::-webkit-scrollbar-track,
.bayurnews-trending-shortcode.flex::-webkit-scrollbar-track,
.bayurnews-featured-shortcode.flex::-webkit-scrollbar-track {
  background: #f7fafc;
  border-radius: 4px;
}

.bayurnews-shortcode-posts.flex::-webkit-scrollbar-thumb,
.bayurnews-trending-shortcode.flex::-webkit-scrollbar-thumb,
.bayurnews-featured-shortcode.flex::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 4px;
}

.bayurnews-shortcode-posts.flex::-webkit-scrollbar-thumb:hover,
.bayurnews-trending-shortcode.flex::-webkit-scrollbar-thumb:hover,
.bayurnews-featured-shortcode.flex::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .bayurnews-shortcode-posts .shortcode-post-item,
  .bayurnews-trending-shortcode .trending-shortcode-item,
  .bayurnews-featured-shortcode .featured-shortcode-item {
    background-color: #1f2937;
    color: #f9fafb;
  }

  .bayurnews-trending-shortcode .trending-shortcode-item:hover {
    background-color: #374151;
  }

  .shortcode-post-item .post-title a,
  .trending-shortcode-item .trending-title a,
  .featured-shortcode-item .featured-title a {
    color: #f9fafb;
  }

  .shortcode-post-item .post-title a:hover,
  .trending-shortcode-item .trending-title a:hover,
  .featured-shortcode-item .featured-title a:hover {
    color: #60a5fa;
  }
}

/* Loading animation */
.shortcode-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100px;
}

.shortcode-loading::after {
  content: "";
  width: 20px;
  height: 20px;
  border: 2px solid #3b82f6;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* No posts found message */
.no-posts-found {
  text-align: center;
  color: #6b7280;
  font-style: italic;
  padding: 2rem;
  background: #f9fafb;
  border-radius: 0.5rem;
  border: 1px dashed #d1d5db;
}

/* Meta information styling */
.post-meta,
.trending-date {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Title typography */
.post-title,
.trending-title,
.featured-title {
  line-height: 1.3;
  font-weight: 600;
}

/* Excerpt styling */
.post-excerpt {
  line-height: 1.5;
  opacity: 0.8;
}

/* Line clamp utility for consistent text truncation */
.line-clamp-2 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

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

/* Focus states for accessibility */
.shortcode-post-item a:focus,
.trending-shortcode-item a:focus,
.featured-shortcode-item a:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .bayurnews-shortcode-posts,
  .bayurnews-trending-shortcode,
  .bayurnews-featured-shortcode {
    break-inside: avoid;
  }

  .shortcode-post-item,
  .trending-shortcode-item,
  .featured-shortcode-item {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #000;
  }
}
