/**
 * blog.css
 *
 * Dandiran WooCommerce Theme — Blog Archive & Shared Sidebar
 *
 * Mobile-first. Uses the shared --dnd-* tokens (assets/css/dnd-tokens.css)
 * for colour/spacing/radius so the module matches the rest of the
 * "dnd-" prefixed components (reviews, wishlist, my-account, etc.).
 * Loaded on: home.php (blog archive), archive.php (category / tag /
 * date / author archives). single-blog.css layers single-post-only
 * rules on top of this file.
 *
 * @version 1.0.0
 */

/* ==========================================================================
   Archive header
   ========================================================================== */

.dnd-blog-archive {
  padding: 24px 0 48px;
}

.dnd-blog-archive__header {
  margin-bottom: 24px;
}

.dnd-blog-archive__title {
  font-size: 22px;
  font-weight: 700;
  color: var(--dnd-text);
  margin-bottom: 8px;
}

.dnd-blog-archive__subtitle {
  font-size: 14px;
  color: var(--dnd-muted);
}

/* ==========================================================================
   Post list (archive / category / search results)
   ========================================================================== */

.dnd-blog-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.dnd-blog-card {
  width: 100%;
  background: var(--dnd-white);
  border: 1px solid var(--dnd-border);
  border-radius: var(--dnd-radius-lg);
  overflow: hidden;
  box-shadow: var(--dnd-shadow);
  transition: box-shadow 0.2s ease;
}

.dnd-blog-card:hover {
  box-shadow: var(--dnd-shadow-lg, var(--dnd-shadow));
}

.dnd-blog-card__link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.dnd-blog-card__thumb {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  background: var(--dnd-bg-soft);
  overflow: hidden;
}

.dnd-blog-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dnd-blog-card__thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--dnd-muted);
}

.dnd-blog-card__body {
  padding: 14px 16px;
}

/* Still used by single.php's category badge (dnd-blog-single__header). */
.dnd-blog-card__cat {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 600;
  color: var(--dnd-primary);
  background: var(--dnd-primary-soft);
  border-radius: var(--dnd-radius-pill);
  padding: 4px 10px;
  text-decoration: none;
}

.dnd-blog-card__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--dnd-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dnd-blog-card__link:hover .dnd-blog-card__title {
  color: var(--dnd-primary);
}

/* ==========================================================================
   Empty state
   ========================================================================== */

.dnd-blog-empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--dnd-muted);
  background: var(--dnd-bg-soft);
  border-radius: var(--dnd-radius-lg);
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.dnd-blog-pagination {
  margin: 32px 0 0;
  text-align: center;
}

.dnd-blog-pagination ul.page-numbers {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.dnd-blog-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--dnd-border);
  border-radius: var(--dnd-radius-md);
  background: var(--dnd-white);
  color: var(--dnd-text);
  font-size: 13px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.dnd-blog-pagination .page-numbers:hover {
  border-color: var(--dnd-primary);
  color: var(--dnd-primary);
}

.dnd-blog-pagination .page-numbers.current {
  background: var(--dnd-primary);
  border-color: var(--dnd-primary);
  color: var(--dnd-white);
}

.dnd-blog-pagination .page-numbers.dots {
  border: none;
  background: transparent;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */

.dnd-blog-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dnd-blog-widget {
  background: var(--dnd-white);
  border: 1px solid var(--dnd-border);
  border-radius: var(--dnd-radius-lg);
  padding: 16px;
}

.dnd-blog-widget__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--dnd-text);
  margin-bottom: 12px;
}

/* search widget */

.dnd-blog-search-form .input-group {
  border: 1px solid var(--dnd-border);
  border-radius: var(--dnd-radius-md);
  overflow: hidden;
}

.dnd-blog-search-form__input.form-control {
  border: none;
  box-shadow: none;
  font-size: 13px;
  padding: 10px 12px;
}

.dnd-blog-search-form__input.form-control:focus {
  box-shadow: none;
}

.dnd-blog-search-form__btn.btn {
  background: var(--dnd-primary);
  color: var(--dnd-white);
  border: none;
  border-radius: 0;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* categories widget */

.dnd-blog-cats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dnd-blog-cats__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-radius: var(--dnd-radius-md);
  color: var(--dnd-text);
  text-decoration: none;
  font-size: 13.5px;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.dnd-blog-cats__link:hover,
.dnd-blog-cats__link.is-active {
  background: var(--dnd-primary-soft);
  color: var(--dnd-primary);
}

.dnd-blog-cats__count {
  font-size: 11px;
  color: var(--dnd-muted);
}

.dnd-blog-cats__link.is-active .dnd-blog-cats__count {
  color: var(--dnd-primary);
}

/* recent posts widget */

.dnd-blog-recent {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dnd-blog-recent__link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.dnd-blog-recent__thumb {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: var(--dnd-radius-md);
  overflow: hidden;
  background: var(--dnd-bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dnd-muted);
}

.dnd-blog-recent__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dnd-blog-recent__meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.dnd-blog-recent__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--dnd-text);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dnd-blog-recent__date {
  font-size: 11px;
  color: var(--dnd-muted);
}

/* ==========================================================================
   Tablet / Desktop
   ========================================================================== */

@media (min-width: 576px) {
  .dnd-blog-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (min-width: 992px) {
  .dnd-blog-archive {
    padding: 32px 0 64px;
  }

  .dnd-blog-archive__title {
    font-size: 28px;
  }

  .dnd-blog-list {
    grid-template-columns: repeat(3, 1fr);
  }

  .dnd-blog-sidebar {
    position: sticky;
    top: 24px;
  }
}
