/* ==========================================================================
   K4Converter — Blog Styling (Listing, Cards, Detail Page & Typography)
   ========================================================================== */

/* ---------- Blog Hero & Search ---------- */
.blog-hero {
  padding: 48px 0 36px;
  text-align: center;
  position: relative;
}
.blog-hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--orange-700, var(--orange));
  padding: 6px 16px;
  border-radius: var(--pill);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}
.blog-hero h1 {
  font-size: clamp(2rem, 5vw, 3.1rem);
  font-weight: 800;
  line-height: 1.18;
  color: var(--ink);
  margin: 0 auto 16px;
  max-width: 820px;
  letter-spacing: -0.02em;
}
.blog-hero h1 .highlight {
  position: relative;
  display: inline-block;
  color: var(--orange);
}
.blog-hero .lead {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto 28px;
}

.blog-search-bar {
  max-width: 580px;
  margin: 0 auto 24px;
  position: relative;
  display: flex;
  align-items: center;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--pill);
  padding: 4px 6px 4px 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.blog-search-bar:focus-within {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(255, 107, 26, 0.15);
}
.blog-search-bar svg {
  width: 20px;
  height: 20px;
  color: var(--muted);
  flex-shrink: 0;
  margin-right: 10px;
}
.blog-search-bar input {
  border: none !important;
  background: transparent !important;
  outline: none !important;
  box-shadow: none !important;
  font-size: 0.98rem;
  color: var(--ink);
  width: 100%;
  padding: 10px 0;
}
.blog-search-bar button {
  border-radius: var(--pill) !important;
  padding: 9px 20px !important;
}

/* Category Filter Chips */
.cat-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 36px;
}
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: var(--pill);
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--ink-2);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}
.cat-chip:hover {
  border-color: var(--orange);
  color: var(--orange);
  transform: translateY(-1px);
}
.cat-chip.active {
  background: var(--orange);
  border-color: var(--orange);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(255, 107, 26, 0.3);
}
.cat-chip .count {
  font-size: 0.76rem;
  background: rgba(0, 0, 0, 0.08);
  padding: 2px 7px;
  border-radius: 10px;
}
.cat-chip.active .count {
  background: rgba(255, 255, 255, 0.25);
}

/* ---------- Blog Grid & Cards ---------- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  margin-bottom: 48px;
}

.blog-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s;
  box-shadow: 4px 4px 0 var(--border-strong);
  text-decoration: none;
  color: inherit;
}
.blog-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 7px 7px 0 var(--orange);
  border-color: var(--orange);
}
.blog-card-thumb-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-alt);
  position: relative;
}
.blog-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.blog-card:hover .blog-card-thumb {
  transform: scale(1.04);
}
.blog-card-category {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(23, 17, 13, 0.85);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: var(--pill);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
[data-theme="dark"] .blog-card-category {
  background: rgba(255, 107, 26, 0.9);
}

.blog-card-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.blog-card-meta .sep {
  opacity: 0.5;
}
.blog-card h2 {
  font-size: 1.22rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
  margin: 0 0 10px;
  transition: color 0.2s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card:hover h2 {
  color: var(--orange);
}
.blog-card p {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 18px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: auto;
}
.blog-card-author {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink-2);
}
.author-avatar-sm {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
}
.blog-read-more {
  color: var(--orange);
  font-weight: 700;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.2s ease;
}
.blog-card:hover .blog-read-more {
  gap: 8px;
}

/* ---------- Pagination ---------- */
.blog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 32px 0 56px;
  flex-wrap: wrap;
}
.blog-pagination a,
.blog-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  border-radius: var(--pill);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  transition: all 0.2s;
}
.blog-pagination a:hover {
  border-color: var(--orange);
  color: var(--orange);
}
.blog-pagination .current {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
  font-weight: 700;
}

/* ---------- Blog Detail / Single Post Layout ---------- */
.blog-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 42px;
  padding: 32px 0 60px;
  align-items: start;
}
.blog-article {
  min-width: 0;
}

/* Breadcrumbs */
.blog-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 22px;
}
.blog-breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.blog-breadcrumbs a:hover {
  color: var(--orange);
}
.blog-breadcrumbs .sep {
  opacity: 0.5;
}
.blog-breadcrumbs .current {
  color: var(--ink);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 320px;
}

/* Post Header */
.post-header {
  margin-bottom: 28px;
}
.post-header .category-badge {
  display: inline-block;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--orange);
  padding: 5px 14px;
  border-radius: var(--pill);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
  text-decoration: none;
}
.post-header h1 {
  font-size: clamp(2.1rem, 4.5vw, 2.9rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 18px;
  letter-spacing: -0.02em;
}
.post-header-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.author-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}
.author-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(255, 107, 26, 0.3);
}
.post-meta-details {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--muted);
  flex-wrap: wrap;
}

/* Featured Image */
.post-featured-image {
  margin: 0 0 32px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1.5px solid var(--border);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
}
.post-featured-image img {
  width: 100%;
  max-height: 480px;
  /* object-fit: cover; */
  display: block;
}
.post-featured-image figcaption {
  font-size: 0.84rem;
  color: var(--muted);
  text-align: center;
  padding: 10px 14px;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
}

/* Post Body (Typography via Prose) */
.post-content.prose {
  font-size: 1.06rem;
  line-height: 1.8;
  color: var(--ink-2);
}
.post-content.prose h2 {
  font-size: 1.65rem;
  font-weight: 800;
  margin: 38px 0 16px;
  color: var(--ink);
  letter-spacing: -0.01em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.post-content.prose h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 28px 0 12px;
  color: var(--ink);
}
.post-content.prose p {
  margin: 0 0 20px;
}
.post-content.prose ul,
.post-content.prose ol {
  margin: 0 0 24px;
  padding-left: 26px;
}
.post-content.prose li {
  margin-bottom: 8px;
}
.post-content.prose blockquote {
  margin: 28px 0;
  padding: 16px 22px;
  background: var(--bg-alt);
  border-left: 4px solid var(--orange);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--ink);
}
.post-content.prose blockquote p:last-child {
  margin-bottom: 0;
}
.post-content.prose img {
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin: 24px 0;
}
.post-content.prose a {
  color: var(--orange);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.post-content.prose a:hover {
  color: var(--orange-700, #e55a10);
}
.post-content.prose code {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.9em;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Tags & Sharing */
.post-tags-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 40px 0;
}
.post-tags-label {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--ink);
}
.post-tag {
  display: inline-block;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--ink-2);
  padding: 4px 12px;
  border-radius: var(--pill);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}
.post-tag:hover {
  border-color: var(--orange);
  color: var(--orange);
}

/* Author Box */
.author-card {
  display: flex;
  gap: 22px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  margin: 36px 0;
  box-shadow: 4px 4px 0 var(--border-strong);
}
.author-card-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(255, 107, 26, 0.35);
}
.author-card-info h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px;
}
.author-card-info p {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 12px;
}
.author-socials {
  display: flex;
  gap: 12px;
}
.author-socials a {
  color: var(--muted);
  transition: color 0.2s;
}
.author-socials a:hover {
  color: var(--orange);
}

/* ---------- Sidebar ---------- */
.blog-sidebar {
  position: sticky;
  top: calc(var(--header-h, 72px) + 24px);
  display: grid;
  gap: 24px;
}
.sidebar-widget {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 3px 3px 0 var(--border-strong);
}
.sidebar-widget h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-widget h3 svg {
  width: 18px;
  height: 18px;
  color: var(--orange);
}

/* Popular Tools List */
.sidebar-tools-list {
  display: grid;
  gap: 10px;
}
.sidebar-tool-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  transition: all 0.2s ease;
}
.sidebar-tool-link:hover {
  border-color: var(--orange);
  color: var(--orange);
  background: var(--bg-alt);
  transform: translateX(3px);
}
.sidebar-tool-link svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
  transition: transform 0.2s;
}
.sidebar-tool-link:hover svg {
  color: var(--orange);
  transform: translateX(2px);
}

/* Categories List */
.sidebar-cat-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}
.sidebar-cat-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.15s;
}
.sidebar-cat-list a:hover {
  background: var(--bg-alt);
  color: var(--orange);
}
.sidebar-cat-list .count {
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 10px;
}

/* Recent Posts */
.sidebar-recent-post {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  text-decoration: none;
  color: inherit;
}
.sidebar-recent-post:last-child {
  margin-bottom: 0;
}
.sidebar-recent-post-thumb {
  width: 64px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-alt);
  flex-shrink: 0;
}
.sidebar-recent-post h4 {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sidebar-recent-post:hover h4 {
  color: var(--orange);
}
.sidebar-recent-post .date {
  font-size: 0.76rem;
  color: var(--muted);
}

/* Share Toast */
.share-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #17110d;
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--pill);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 8px;
}
.share-toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .blog-detail-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .blog-sidebar {
    position: static;
  }
}
@media (max-width: 640px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }
  .author-card {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
  .author-socials {
    justify-content: center;
  }
}
