/* blogs.css - spec-compliant styles for PrePilot Blogs indexing */

.blogs-hero {
  padding-block-end: 40px;
}

/* Glassmorphic Filter Bar */
.blogs-filter-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-block-end: 40px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(15, 15, 15, 0.08);
  padding: 16px 24px;
  border-radius: var(--radius);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

@media (min-width: 900px) {
  .blogs-filter-container {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.blogs-search-wrapper {
  position: relative;
  flex: 1;
  max-width: 400px;
  width: 100%;
}

.blogs-search-input {
  width: 100%;
  padding-block: 12px;
  padding-inline: 44px 16px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.blogs-search-input:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 4px rgba(255, 106, 44, 0.1);
  outline: none;
}

.blogs-search-icon {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 16px;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
  transition: color 0.25s ease;
}

.blogs-search-input:focus + .blogs-search-icon {
  color: var(--coral);
}

.blogs-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-block: 4px;
  scrollbar-width: none; /* Hide scrollbar for clean aesthetic */
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.blogs-tabs::-webkit-scrollbar {
  display: none;
}

.blogs-tab {
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.blogs-tab:hover {
  color: var(--ink);
  background: var(--line-2);
}

.blogs-tab.active {
  background: var(--coral);
  color: #fff;
  border-color: var(--coral);
  box-shadow: 0 4px 12px rgba(255, 106, 44, 0.2);
}

/* Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.bento-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  opacity: 1;
  min-width: 0;
}

.bento-card.hidden {
  display: none !important;
  opacity: 0;
  transform: scale(0.95);
}

.bento-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg), 0 20px 40px -15px rgba(255, 106, 44, 0.1);
  border-color: rgba(255, 106, 44, 0.4);
}

.bento-card.span-8 {
  grid-column: span 8;
}

.bento-card.span-6 {
  grid-column: span 6;
}

.bento-card.span-4 {
  grid-column: span 4;
}

.bento-card.span-12 {
  grid-column: span 12;
}

.bento-card.span-3 {
  grid-column: span 3;
}

/* Advanced Asymmetric Desktop Layout with Uniform Height Stabilization */
@media (min-width: 900px) {
  .bento-card:not(.sponsored-ad-card) {
    height: 420px;
  }

  .bento-card.span-8 {
    flex-direction: row !important;
  }
  
  .bento-card.span-8 .blog-image-wrapper {
    width: 45%;
    height: 100% !important;
    min-height: 100%;
  }
  
  .bento-card.span-8 .blog-content {
    width: 55%;
    padding: 32px 40px;
    height: 100%;
    display: flex;
    flex-direction: column;
  }

  .bento-card.span-4 .blog-image-wrapper,
  .bento-card.span-3 .blog-image-wrapper {
    height: 180px !important;
  }

  .bento-card.span-4 .blog-content,
  .bento-card.span-3 .blog-content {
    height: calc(100% - 180px);
    padding: 24px;
    display: flex;
    flex-direction: column;
  }
}

.blog-image-wrapper {
  width: 100%;
  position: relative;
  overflow: hidden;
  background: #0f1016;
}

.bento-card.span-8 .blog-image-wrapper {
  height: 320px;
}

.bento-card.span-6 .blog-image-wrapper {
  height: 240px;
}

.bento-card.span-4 .blog-image-wrapper,
.bento-card.span-3 .blog-image-wrapper {
  height: 200px;
}

.blog-gradient-placeholder {
  width: 100%;
  height: 100%;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.bento-card:hover .blog-gradient-placeholder {
  transform: scale(1.08);
}

/* Category Pattern Library (Replacing Flat Gradients with Glowing Node Wireframes) */
.pattern-playbook {
  background-color: #0c0d12;
  background-image: 
    radial-gradient(circle at 15% 25%, rgba(255, 106, 44, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(255, 143, 94, 0.08) 0%, transparent 45%),
    url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h20v20H0zm20 20h20v20H20z' fill='%23ff6a2c' fill-opacity='0.02' fill-rule='evenodd'/%3E%3Ccircle cx='20' cy='20' r='1' fill='%23ff6a2c' fill-opacity='0.15'/%3E%3Cpath d='M10 20h20M20 10v20' stroke='%23ff6a2c' stroke-width='0.5' stroke-opacity='0.08' stroke-dasharray='2,2'/%3E%3C/svg%3E");
}

.pattern-seo {
  background-color: #0a0e0e;
  background-image: 
    radial-gradient(circle at 80% 20%, rgba(31, 154, 101, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 20% 80%, rgba(31, 154, 101, 0.08) 0%, transparent 45%),
    url("data:image/svg+xml,%3Csvg width='50' height='50' viewBox='0 0 50 50' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='25' cy='25' r='15' fill='none' stroke='%231f9a65' stroke-width='0.5' stroke-opacity='0.15'/%3E%3Ccircle cx='25' cy='25' r='8' fill='none' stroke='%231f9a65' stroke-width='0.5' stroke-opacity='0.22' stroke-dasharray='1,2'/%3E%3Cpath d='M0 25h50M25 0v50' stroke='%231f9a65' stroke-width='0.5' stroke-opacity='0.08'/%3E%3C/svg%3E");
}

.pattern-cro {
  background-color: #0e0a12;
  background-image: 
    radial-gradient(circle at 50% 15%, rgba(139, 92, 246, 0.12) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 50 C 15 20, 30 20, 45 40 C 50 45, 55 45, 60 35' fill='none' stroke='%238b5cf6' stroke-width='1.5' stroke-opacity='0.25'/%3E%3Cpath d='M0 40 C 20 10, 40 50, 60 20' fill='none' stroke='%238b5cf6' stroke-width='0.75' stroke-opacity='0.1' stroke-dasharray='3,3'/%3E%3Ccircle cx='45' cy='40' r='3' fill='%238b5cf6' fill-opacity='0.4'/%3E%3Ccircle cx='23' cy='23' r='2' fill='%238b5cf6' fill-opacity='0.3'/%3E%3C/svg%3E");
}

.pattern-ads {
  background-color: #120e0a;
  background-image: 
    radial-gradient(circle at 10% 80%, rgba(251, 191, 36, 0.12) 0%, transparent 45%),
    url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='4' y='20' width='6' height='16' rx='1' fill='%23fbbf24' fill-opacity='0.15'/%3E%3Crect x='14' y='12' width='6' height='24' rx='1' fill='%23fbbf24' fill-opacity='0.2'/%3E%3Crect x='24' y='24' width='6' height='12' rx='1' fill='%23fbbf24' fill-opacity='0.15'/%3E%3Crect x='34' y='8' width='6' height='28' rx='1' fill='%23fbbf24' fill-opacity='0.25'/%3E%3Cpath d='M4 36h36' stroke='%23fbbf24' stroke-width='0.5' stroke-opacity='0.2'/%3E%3C/svg%3E");
}

.pattern-brand {
  background-color: #0a0d12;
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(59, 127, 232, 0.12) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='40' cy='40' r='30' fill='none' stroke='%233b7fe8' stroke-width='0.75' stroke-opacity='0.15'/%3E%3Ccircle cx='40' cy='40' r='18' fill='none' stroke='%233b7fe8' stroke-width='0.5' stroke-opacity='0.2'/%3E%3Ccircle cx='40' cy='40' r='11' fill='none' stroke='%233b7fe8' stroke-width='0.5' stroke-opacity='0.25' stroke-dasharray='1,1'/%3E%3Cpath d='M10 40h60M40 10v60' stroke='%233b7fe8' stroke-width='0.5' stroke-opacity='0.05'/%3E%3C/svg%3E");
}

.pattern-email {
  background-color: #0a120e;
  background-image: 
    radial-gradient(circle at 90% 15%, rgba(31, 154, 101, 0.12) 0%, transparent 45%),
    url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 12l12 10 12-10M8 28h24V12H8z' fill='none' stroke='%231f9a65' stroke-width='0.5' stroke-opacity='0.15'/%3E%3Cpath d='M0 0l40 40M40 0L0 40' stroke='%231f9a65' stroke-width='0.5' stroke-opacity='0.03'/%3E%3C/svg%3E");
}

.pattern-creative {
  background-color: #120a0c;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(255, 106, 44, 0.12) 0%, transparent 45%),
    url("data:image/svg+xml,%3Csvg width='60' height='40' viewBox='0 0 60 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 20h2M10 12h2M15 28h2M20 18h2M25 6h2M30 34h2M35 15h2M40 25h2M45 10h2M50 30h2M55 20h2' stroke='%23ff6a2c' stroke-width='1.5' stroke-linecap='round' stroke-opacity='0.25'/%3E%3Cpath d='M0 20h60' stroke='%23ff6a2c' stroke-width='0.5' stroke-opacity='0.08' stroke-dasharray='1,4'/%3E%3C/svg%3E");
}

.blog-content {
  padding: 32px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.bento-card.span-4 .blog-content,
.bento-card.span-3 .blog-content {
  padding: 24px;
}

.blog-category {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--coral);
  margin-block-end: 12px;
  display: inline-block;
}

.blog-content h2 {
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-block-end: 12px;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.blog-content h3 {
  font-size: clamp(17px, 1.8vw, 19px);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-block-end: 10px;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.blog-content p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  margin-block-end: 16px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* Specific Line Clamping for Bento Alignment */
.bento-card.span-8 .blog-content p {
  -webkit-line-clamp: 4;
}

.bento-card.span-4 .blog-content p,
.bento-card.span-3 .blog-content p {
  -webkit-line-clamp: 3;
}

.blog-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--muted-2);
  font-weight: 500;
  margin-block-start: auto;
}

/* Sponsored Ad Section */
.sponsored-ad-card {
  position: relative;
  background: linear-gradient(135deg, var(--bg) 0%, rgba(255, 106, 44, 0.05) 100%);
  border: 1px solid rgba(255, 106, 44, 0.2);
  padding: 40px;
  overflow: hidden;
}

.sponsored-badge {
  position: absolute;
  inset-block-start: 24px;
  inset-inline-end: 24px;
  background: var(--ink);
  color: var(--bg);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 6px 12px;
  border-radius: 999px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sponsored-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  position: relative;
  z-index: 1;
}

.sponsored-text {
  flex: 1;
  max-width: 600px;
}

.sponsored-text h2 {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  color: var(--ink);
  margin-block-end: 12px;
  letter-spacing: -0.015em;
}

.sponsored-text p {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.sponsored-cta {
  flex-shrink: 0;
}

/* RTL Logical Styles for Blogs */
html[dir="rtl"] .bento-grid {
  text-align: start;
}

/* Responsive styling */
@media (max-width: 900px) {
  .bento-card.span-8, .bento-card.span-6, .bento-card.span-4, .bento-card.span-3, .bento-card.span-12 {
    grid-column: span 12 !important;
  }
  
  .bento-card.span-8 .blog-image-wrapper {
    height: 240px;
  }
  
  .sponsored-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }
  
  .sponsored-badge {
    position: static;
    margin-block-end: 16px;
  }
}

@media (max-width: 600px) {
  .blogs-hero {
    padding-block-start: 40px;
    padding-block-end: 20px;
  }
  
  .blogs-filter-container {
    padding: 16px !important;
    border-radius: 16px;
  }
  
  .blog-content {
    padding: 20px !important;
  }
  
  .blog-content h2 {
    font-size: 22px !important;
  }
  
  .blog-content h3 {
    font-size: 18px !important;
  }
  
  .bento-card.span-8 .blog-image-wrapper,
  .bento-card.span-6 .blog-image-wrapper,
  .bento-card.span-4 .blog-image-wrapper,
  .bento-card.span-3 .blog-image-wrapper {
    height: 180px !important;
  }
  
  .sponsored-ad-card {
    padding: 24px !important;
  }
  
  .sponsored-text h2 {
    font-size: 20px !important;
  }
  
  .sponsored-text p {
    font-size: 14px !important;
  }
}

/* Premium Dynamic Pagination Styles */
.blogs-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-block-start: 48px;
  padding-block-start: 24px;
  border-block-start: 1px solid var(--line);
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding-inline: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--coral);
  color: var(--coral);
  background: rgba(255, 106, 44, 0.05);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 106, 44, 0.05);
}

.pagination-btn.active {
  background: var(--coral);
  color: #fff;
  border-color: var(--coral);
  box-shadow: 0 4px 12px rgba(255, 106, 44, 0.2);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

@media (max-width: 600px) {
  .blogs-pagination {
    gap: 6px;
    margin-block-start: 36px;
  }
  .pagination-btn {
    min-width: 36px;
    height: 36px;
    font-size: 13px;
    padding-inline: 8px;
    border-radius: 10px;
  }
  .pagination-ellipsis {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }
}

