/* Blog list/detail pages — components/blog/{BlogCard,BlogSidebar,BlogComments}.tsx
   and app/(storefront)/blog/{page,[slug]/page}.tsx. Reuses .sw-blog-grid/
   .sw-blog-card from sw-home-showcase.css and .sw-shop-sidebar/.sw-shop-
   pagination from sw-shop.css, adding the sidebar widgets, comments and
   detail-page article styling that don't exist yet. Inherits the sitewide
   --sw-primary (theme.css, logo navy). */
.sw-blog-layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}
.sw-blog-main {
  flex: 1 1 auto;
  min-width: 0;
}
@media (max-width: 900px) {
  .sw-blog-layout {
    flex-direction: column;
  }
}

.sw-blog-image a,
.sw-blog-image {
  display: block;
}
.sw-blog-cover-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.85);
  font-size: 32px;
}
.sw-blog-category-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--sw-primary);
  margin-bottom: 8px;
}

/* Sidebar — override the tight 4px gap from .sw-shop-sidebar so each
   bordered widget (including the search box) gets proper breathing room. */
.sw-blog-sidebar {
  gap: 24px;
}
.sw-blog-sidebar-search {
  max-width: none;
  margin: 0;
}

/* Sidebar widgets */
.sw-blog-widget {
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 20px;
}
.sw-blog-widget h3 {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 700;
  color: #222;
}
.sw-blog-cat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sw-blog-cat-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  color: #444;
  padding: 8px 10px;
  border-radius: 8px;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.sw-blog-cat-list a:hover,
.sw-blog-cat-list a.active {
  color: var(--sw-primary);
  background: rgba(var(--sw-primary-rgb, 27, 94, 32), 0.08);
}
.sw-blog-cat-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}
.sw-blog-cat-name i {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--sw-primary-rgb, 27, 94, 32), 0.12);
  color: var(--sw-primary);
  font-size: 11px;
  flex-shrink: 0;
}
.sw-blog-cat-count {
  color: #888;
  font-size: 12px;
  font-weight: 600;
  background: #f2f2f2;
  border-radius: 999px;
  padding: 2px 9px;
}

/* Promo widget */
.sw-blog-promo-widget {
  border-radius: 12px;
  padding: 24px;
  background: linear-gradient(160deg, rgba(var(--sw-primary-rgb, 27, 94, 32), 0.1), rgba(var(--sw-primary-rgb, 27, 94, 32), 0.03));
  border: 1px solid rgba(var(--sw-primary-rgb, 27, 94, 32), 0.15);
}
.sw-blog-promo-eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--sw-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.sw-blog-promo-widget h3 {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 800;
  color: #171717;
  line-height: 1.3;
}
.sw-blog-promo-widget p {
  margin: 0 0 18px;
  font-size: 13px;
  color: #666;
}
.sw-blog-promo-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--sw-primary);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 999px;
}
.sw-blog-promo-btn:hover {
  background: var(--sw-primary-hover);
}

.sw-blog-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sw-blog-tag-pill {
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid #e2e2e2;
  color: #555;
}
.sw-blog-tag-pill:hover,
.sw-blog-tag-pill.active {
  background: var(--sw-primary);
  border-color: var(--sw-primary);
  color: #fff;
}

.sw-blog-gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.sw-blog-gallery-item {
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--sw-primary-light, #8ccf74), var(--sw-primary));
  border: none;
  padding: 0;
  cursor: pointer;
}
.sw-blog-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.sw-blog-gallery-item:hover img {
  transform: scale(1.12);
}

.sw-blog-lightbox {
  position: fixed;
  inset: 0;
  /* Above the fixed header (sw-header2.css z-index: 1200), or it hides the
     top of the enlarged image behind the header bar. */
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(15, 15, 15, 0.88);
  animation: sw-blog-lightbox-fade 0.15s ease;
}
@keyframes sw-blog-lightbox-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.sw-blog-lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.sw-blog-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.24);
}
.sw-blog-lightbox-content {
  max-width: min(880px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.sw-blog-lightbox-content img {
  max-width: 100%;
  max-height: 72vh;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.sw-blog-lightbox-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  margin-top: 16px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
.sw-blog-lightbox-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--sw-primary-light, #8ccf74);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.sw-blog-lightbox-link:hover {
  text-decoration: underline;
}

.sw-blog-recent-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sw-blog-recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sw-blog-recent-thumb {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--sw-primary-light, #8ccf74), var(--sw-primary));
}
.sw-blog-recent-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sw-blog-recent-info {
  min-width: 0;
}
.sw-blog-recent-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  line-height: 1.4;
  margin-bottom: 2px;
}
.sw-blog-recent-title:hover {
  color: var(--sw-primary);
}
.sw-blog-recent-date {
  font-size: 11.5px;
  color: #999;
}
.sw-blog-recent-date i {
  margin-right: 3px;
  font-size: 10.5px;
}

/* Detail page */
.sw-blog-detail-head {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid #eee;
}
.sw-blog-hero {
  flex: 1 1 46%;
  min-width: 0;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--sw-primary-light, #8ccf74), var(--sw-primary));
}
.sw-blog-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sw-blog-detail-head-info {
  flex: 1 1 54%;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.sw-blog-category-tag {
  align-self: flex-start;
  background: rgba(var(--sw-primary-rgb, 27, 94, 32), 0.1);
  border-radius: 999px;
  padding: 6px 16px;
}
.sw-blog-detail-title {
  font-size: 28px;
  font-weight: 800;
  color: #171717;
  line-height: 1.28;
  margin: 12px 0 10px;
}
.sw-blog-detail-excerpt {
  font-size: 14px;
  color: #666;
  line-height: 1.7;
  margin: 0 0 18px;
}
.sw-blog-detail-author {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.sw-blog-detail-author-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--sw-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}
.sw-blog-detail-author-name {
  display: block;
  font-weight: 700;
  color: #171717;
  font-size: 14px;
}
.sw-blog-detail-author-date {
  display: block;
  font-size: 12.5px;
  color: #999;
}
.sw-blog-detail-author-date i {
  margin-right: 3px;
}
.sw-blog-detail-share {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
}
.sw-blog-detail-share span {
  font-size: 13px;
  font-weight: 700;
  color: #333;
  margin-right: 2px;
}
.sw-blog-detail-share a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--sw-primary);
  color: #fff;
  font-size: 14px;
}
.sw-blog-detail-share a:hover {
  opacity: 0.85;
}
@media (max-width: 760px) {
  .sw-blog-detail-head {
    flex-direction: column;
  }
  .sw-blog-hero {
    width: 100%;
    aspect-ratio: 16 / 9;
  }
}
.sw-blog-detail-content {
  color: #444;
  line-height: 1.9;
  font-size: 15px;
}
.sw-blog-detail-content p {
  margin: 0 0 18px;
}
.sw-blog-detail-content h2,
.sw-blog-detail-content h3,
.sw-blog-detail-content h4 {
  color: #171717;
  font-weight: 800;
  line-height: 1.35;
  margin: 32px 0 14px;
}
.sw-blog-detail-content h2 {
  font-size: 22px;
}
.sw-blog-detail-content h3 {
  font-size: 18px;
}
.sw-blog-detail-content h4 {
  font-size: 15px;
}
.sw-blog-detail-content ul,
.sw-blog-detail-content ol {
  margin: 0 0 18px;
  padding-left: 22px;
}
.sw-blog-detail-content li {
  margin-bottom: 8px;
}
.sw-blog-detail-content blockquote {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  padding: 20px 24px;
  border-radius: 10px;
  background: rgba(var(--sw-primary-rgb, 27, 94, 32), 0.07);
  border: none;
  color: #333;
  font-size: 14px;
  font-style: normal;
}
.sw-blog-detail-content img {
  max-width: 100%;
  border-radius: 10px;
}
.sw-blog-content-eyebrow {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--sw-primary);
  margin: 32px 0 4px;
}
.sw-blog-detail-content .sw-blog-content-eyebrow + h2 {
  margin-top: 0;
}
.sw-blog-callout {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin: 24px 0;
  padding: 20px 24px;
  border-radius: 12px;
  background: rgba(var(--sw-primary-rgb, 27, 94, 32), 0.08);
}
.sw-blog-callout-icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(var(--sw-primary-rgb, 27, 94, 32), 0.16);
  color: var(--sw-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.sw-blog-callout-body {
  min-width: 0;
}
.sw-blog-callout-body h4 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 800;
  color: #171717;
}
.sw-blog-callout-body p {
  margin: 0;
  font-size: 13.5px;
  color: #555;
  line-height: 1.7;
}
.sw-blog-callout-body p + p {
  margin-top: 2px;
}
.sw-blog-detail-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0;
  padding-top: 20px;
  border-top: 1px solid #eee;
}
.sw-blog-detail-tags-label {
  font-weight: 700;
  font-size: 13.5px;
  color: #333;
  margin-right: 4px;
}

/* Prev/next navigation */
.sw-blog-prevnext {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  margin: 8px 0 32px;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}
.sw-blog-prevnext-link {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 46%;
  color: #333;
}
.sw-blog-prevnext-link.next {
  margin-left: auto;
  text-align: right;
  flex-direction: row-reverse;
}
.sw-blog-prevnext-link i {
  font-size: 18px;
  color: var(--sw-primary);
  flex-shrink: 0;
}
.sw-blog-prevnext-text {
  min-width: 0;
}
.sw-blog-prevnext-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #999;
  margin-bottom: 2px;
}
.sw-blog-prevnext-title {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: #222;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sw-blog-prevnext-link:hover .sw-blog-prevnext-title {
  color: var(--sw-primary);
}

/* Related articles — static row (not the horizontal-scroll .sw-blog-grid) */
.sw-blog-related {
  margin: 8px 0 40px;
}
.sw-blog-related h3 {
  font-size: 18px;
  font-weight: 700;
  color: #171717;
  margin: 0 0 18px;
}
.sw-blog-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 700px) {
  .sw-blog-related-grid {
    grid-template-columns: 1fr;
  }
}
.sw-blog-related-grid .sw-blog-card {
  width: 100%;
}

/* Comments */
.sw-blog-comments {
  margin-top: 32px;
  padding: 28px 28px 32px;
  border: 1px solid #eee;
  border-radius: 12px;
  background: #fff;
}
.sw-blog-comments h3 {
  font-size: 18px;
  font-weight: 800;
  color: #171717;
  margin: 0 0 20px;
}
.sw-blog-comment-list {
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
}
.sw-blog-comment {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid #f0f0f0;
}
.sw-blog-comment-list .sw-blog-comment:first-child {
  padding-top: 0;
}
.sw-blog-comment-list .sw-blog-comment:last-child {
  border-bottom: none;
  padding-bottom: 4px;
}
.sw-blog-comment-avatar {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--sw-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}
.sw-blog-comment-body {
  flex: 1 1 auto;
  min-width: 0;
}
.sw-blog-comment-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 5px;
}
.sw-blog-comment-name {
  font-weight: 700;
  font-size: 14px;
  color: #222;
}
.sw-blog-comment-date {
  font-size: 12px;
  color: #999;
}
.sw-blog-comment-message {
  font-size: 13.5px;
  color: #555;
  line-height: 1.7;
  margin: 0;
}

.sw-blog-comment-form {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #eee;
}
.sw-blog-comment-form h4 {
  font-size: 16px;
  font-weight: 800;
  color: #171717;
  margin: 0 0 16px;
}
.sw-blog-comment-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 600px) {
  .sw-blog-comment-form-grid {
    grid-template-columns: 1fr;
  }
}
.sw-blog-comment-form input,
.sw-blog-comment-form textarea {
  width: 100%;
  border: 1px solid #e2e2e2;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13.5px;
  font-family: inherit;
}
.sw-blog-comment-form textarea {
  margin-bottom: 16px;
  resize: vertical;
}
.sw-blog-comment-form button {
  border: none;
  border-radius: 999px;
  background: var(--sw-primary);
  color: #fff;
  font-weight: 700;
  font-size: 13.5px;
  padding: 12px 28px;
  cursor: pointer;
}
.sw-blog-comment-form button:hover:not(:disabled) {
  background: var(--sw-primary-hover);
}
.sw-blog-comment-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.sw-blog-comments-load-more {
  display: flex;
  justify-content: center;
  margin: 4px 0 32px;
}
.sw-blog-comments-load-more button {
  border: 1px solid #e2e2e2;
  border-radius: 999px;
  background: #fff;
  color: #555;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 28px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.sw-blog-comments-load-more button:hover {
  border-color: var(--sw-primary);
  color: var(--sw-primary);
}
