/* Brixzly Blog Posts Layouts - minimal, responsive styles */

.bp-wrapper {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.bp-items {
  display: grid;
  grid-gap: 24px;
  max-width: 100%;
}

/* Grid layout */
.bp-layout-grid .bp-items {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.bp-layout-grid.bp-columns-1 .bp-items { grid-template-columns: 1fr; }
.bp-layout-grid.bp-columns-2 .bp-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bp-layout-grid.bp-columns-3 .bp-items { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bp-layout-grid.bp-columns-4 .bp-items { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bp-layout-grid.bp-columns-5 .bp-items { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.bp-layout-grid.bp-columns-6 .bp-items { grid-template-columns: repeat(6, minmax(0, 1fr)); }

/* List layout */
.bp-layout-list .bp-items {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.bp-layout-list .bp-card {
  flex-direction: row;
  align-items: flex-start;
}

.bp-layout-list .bp-thumb {
  flex-shrink: 0;
  width: 300px;
  max-width: 40%;
}

.bp-layout-list .bp-thumb img {
  height: 100%;
  min-height: 200px;
}

.bp-layout-list .bp-content {
  flex: 1;
  min-width: 0;
}

/* Masonry layout using CSS columns */
.bp-layout-masonry .bp-items {
  /* Override base grid so CSS columns can work */
  display: block;
  column-gap: 24px;
}
.bp-layout-masonry .bp-card {
  /* Prevent cards from splitting between columns */
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  break-inside: avoid;
  break-inside: avoid-column;
  margin: 0 0 24px;
}

.bp-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0; /* Prevents flex items from overflowing */
}

.bp-card .bp-thumb {
  display: block;
  overflow: hidden;
}

.bp-card .bp-thumb img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.bp-content {
  padding: 16px;
  min-width: 0; /* Ensures text wraps properly */
  overflow-wrap: break-word;
}

.bp-title {
  font-size: 1.125rem;
  margin: 0 0 8px;
}

.bp-title a {
  color: inherit;
  text-decoration: none;
}

.bp-title a:hover {
  text-decoration: underline;
}

.bp-meta {
  display: flex;
  gap: 12px;
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 8px;
}

.bp-excerpt {
  color: #374151;
}

.bp-actions {
  margin-top: 12px;
}

.bp-read-more {
  display: inline-block;
  color: #2563eb;
  text-decoration: none;
}

.bp-read-more:hover {
  text-decoration: underline;
}

.bp-pagination {
  margin-top: 24px;
}

.bp-pagination ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
}

.bp-pagination a,
.bp-pagination span {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  text-decoration: none;
}

.bp-load-more-wrap {
  margin-top: 24px;
  text-align: center;
}

.bp-load-more {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.bp-load-more:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Better text wrapping and overflow handling */
.bp-title {
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
  max-width: 100%;
}

.bp-excerpt {
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  line-height: 1.6;
  max-width: 100%;
}

.bp-meta {
  flex-wrap: wrap;
  max-width: 100%;
  overflow-wrap: break-word;
}

.bp-meta > * {
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

/* Responsive */
@media (max-width: 1024px) {
  .bp-layout-grid.bp-columns-4 .bp-items { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bp-layout-grid.bp-columns-5 .bp-items { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bp-layout-grid.bp-columns-6 .bp-items { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  
  /* Masonry: reduce to 3 columns */
  .bp-layout-masonry .bp-items {
    -webkit-column-count: 3 !important;
    column-count: 3 !important;
  }
}

@media (max-width: 768px) {
  /* Force grid to 2 columns on tablets - need higher specificity */
  .bp-layout-grid .bp-items,
  .bp-layout-grid.bp-columns-1 .bp-items,
  .bp-layout-grid.bp-columns-2 .bp-items,
  .bp-layout-grid.bp-columns-3 .bp-items,
  .bp-layout-grid.bp-columns-4 .bp-items,
  .bp-layout-grid.bp-columns-5 .bp-items,
  .bp-layout-grid.bp-columns-6 .bp-items {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  
  /* Keep single column as single */
  .bp-layout-grid.bp-columns-1 .bp-items {
    grid-template-columns: 1fr !important;
  }
  
  /* Masonry: reduce to 2 columns */
  .bp-layout-masonry .bp-items {
    -webkit-column-count: 2 !important;
    column-count: 2 !important;
  }
  
  /* List layout: adjust thumbnail size on tablets */
  .bp-layout-list .bp-thumb {
    width: 250px;
    max-width: 35%;
  }
  
  .bp-layout-list .bp-thumb img {
    min-height: 180px;
  }
  
  /* Reduce spacing on tablets */
  .bp-items {
    grid-gap: 16px;
  }
  
  .bp-layout-list .bp-items {
    gap: 16px;
  }
  
  .bp-layout-masonry .bp-items {
    column-gap: 16px;
  }
  
  .bp-layout-masonry .bp-card {
    margin: 0 0 16px;
  }
  
  /* Slightly smaller text on tablets */
  .bp-title {
    font-size: 1rem;
  }
  
  .bp-meta {
    font-size: 0.8125rem;
  }
}

@media (max-width: 480px) {
  /* All layouts stack to single column on mobile - force with higher specificity */
  .bp-layout-grid .bp-items,
  .bp-layout-grid.bp-columns-1 .bp-items,
  .bp-layout-grid.bp-columns-2 .bp-items,
  .bp-layout-grid.bp-columns-3 .bp-items,
  .bp-layout-grid.bp-columns-4 .bp-items,
  .bp-layout-grid.bp-columns-5 .bp-items,
  .bp-layout-grid.bp-columns-6 .bp-items { 
    grid-template-columns: 1fr !important;
  }
  
  .bp-layout-masonry .bp-items {
    -webkit-column-count: 1 !important;
    column-count: 1 !important;
  }
  
  /* List layout: stack vertically on mobile */
  .bp-layout-list .bp-card {
    flex-direction: column;
  }
  
  .bp-layout-list .bp-thumb {
    width: 100%;
    max-width: 100%;
  }
  
  .bp-layout-list .bp-thumb img {
    min-height: auto;
  }
  
  /* Tighter spacing on mobile */
  .bp-items {
    grid-gap: 12px;
  }
  
  .bp-layout-list .bp-items {
    gap: 12px;
  }
  
  .bp-layout-masonry .bp-items {
    column-gap: 12px;
  }
  
  .bp-layout-masonry .bp-card {
    margin: 0 0 12px;
  }
  
  /* Reduce padding inside cards */
  .bp-content {
    padding: 12px;
  }
  
  /* Optimize text sizing for mobile */
  .bp-title {
    font-size: 0.9375rem;
    margin: 0 0 6px;
  }
  
  .bp-meta {
    font-size: 0.75rem;
    gap: 8px;
    margin-bottom: 6px;
  }
  
  .bp-excerpt {
    font-size: 0.875rem;
  }
  
  .bp-actions {
    margin-top: 8px;
  }
  
  .bp-read-more {
    font-size: 0.875rem;
  }
}


