/* ============================================================
   StackHire — Blog Frontend Styles
   /assets/css/blog.css
   ============================================================ */

/* ── BLOG LISTING PAGE ────────────────────────────────────── */
.blog-wrap {
  max-width:  1100px;
  margin:     0 auto;
  padding:    0 1.25rem 4rem;
}

/* Hero */
.blog-hero {
  padding:    3.5rem 0 2.5rem;
  text-align: center;
}
.blog-hero-tag {
  font-family:    var(--mono);
  font-size:      .72rem;
  color:          var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom:  .75rem;
}
.blog-hero-title {
  font-family:   var(--display);
  font-size:     clamp(2rem, 5vw, 3.5rem);
  font-weight:   800;
  color:         var(--text);
  line-height:   1.15;
  margin-bottom: .75rem;
}
.blog-hero-accent { color: var(--accent); }
.blog-hero-sub {
  font-size:  1rem;
  color:      var(--muted);
  max-width:  520px;
  margin:     0 auto;
  line-height: 1.7;
}

/* Featured Card */
.blog-featured { margin-bottom: 2rem; }
.blog-featured-card {
  display:         grid;
  grid-template-columns: 1fr 1fr;
  gap:             0;
  background:      var(--surface);
  border:          1.5px solid var(--border);
  border-radius:   var(--r-xl);
  overflow:        hidden;
  text-decoration: none;
  transition:      border-color .2s, transform .2s;
}
.blog-featured-card:hover {
  border-color: var(--accent);
  transform:    translateY(-2px);
}
@media (max-width: 768px) {
  .blog-featured-card { grid-template-columns: 1fr; }
}

.blog-featured-img {
  position:   relative;
  min-height: 280px;
  overflow:   hidden;
}
.blog-featured-img img {
  width:      100%;
  height:     100%;
  object-fit: cover;
}
.blog-featured-badge {
  position:      absolute;
  top:           1rem;
  left:          1rem;
  font-family:   var(--mono);
  font-size:     .65rem;
  font-weight:   700;
  background:    rgba(245,158,11,.15);
  color:         var(--yellow);
  border:        1px solid rgba(245,158,11,.3);
  padding:       3px 10px;
  border-radius: 100px;
}

.blog-featured-body {
  padding:        2rem;
  display:        flex;
  flex-direction: column;
  justify-content: center;
  gap:            .75rem;
}
.blog-featured-title {
  font-family:  var(--display);
  font-size:    1.4rem;
  font-weight:  800;
  color:        var(--text);
  line-height:  1.3;
}
.blog-featured-excerpt {
  font-size:   .9rem;
  color:       var(--muted);
  line-height: 1.7;
}
.blog-read-more {
  font-family: var(--mono);
  font-size:   .75rem;
  color:       var(--accent);
  font-weight: 700;
  margin-top:  .25rem;
}

/* Blog Meta */
.blog-meta {
  display:     flex;
  align-items: center;
  gap:         .85rem;
  flex-wrap:   wrap;
}
.blog-author,
.blog-date,
.blog-views {
  font-family: var(--mono);
  font-size:   .68rem;
  color:       var(--muted);
  display:     flex;
  align-items: center;
  gap:         4px;
}
.blog-author i,
.blog-date i,
.blog-views i { font-size: .6rem; }

/* Posts Grid */
.blog-grid {
  display:               grid;
  grid-template-columns: repeat(3, 1fr);
  gap:                   1.1rem;
  margin-bottom:         2rem;
}
@media (max-width: 900px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .blog-grid { grid-template-columns: 1fr; }
}

.blog-card {
  background:      var(--surface);
  border:          1.5px solid var(--border);
  border-radius:   var(--r-xl);
  overflow:        hidden;
  text-decoration: none;
  transition:      border-color .2s, transform .2s;
  display:         flex;
  flex-direction:  column;
}
.blog-card:hover {
  border-color: var(--accent);
  transform:    translateY(-2px);
}

.blog-card-img {
  height:   180px;
  overflow: hidden;
  position: relative;
}
.blog-card-img img {
  width:      100%;
  height:     100%;
  object-fit: cover;
  transition: transform .3s;
}
.blog-card:hover .blog-card-img img { transform: scale(1.03); }

.blog-card-badge {
  position:      absolute;
  top:           .6rem;
  right:         .6rem;
  font-size:     .7rem;
  background:    rgba(245,158,11,.15);
  border:        1px solid rgba(245,158,11,.3);
  padding:       2px 7px;
  border-radius: 100px;
}

.blog-card-body {
  padding:        1.1rem;
  display:        flex;
  flex-direction: column;
  gap:            .5rem;
  flex:           1;
}
.blog-card-title {
  font-size:   .92rem;
  font-weight: 700;
  color:       var(--text);
  line-height: 1.4;
}
.blog-card-excerpt {
  font-size:   .8rem;
  color:       var(--muted);
  line-height: 1.65;
  flex:        1;
}
.blog-card-footer {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  margin-top:      .25rem;
}
.blog-read-more-sm {
  font-family: var(--mono);
  font-size:   .68rem;
  color:       var(--accent);
  font-weight: 700;
}

/* Image placeholder */
.blog-img-placeholder {
  width:           100%;
  height:          180px;
  background:      var(--surface2);
  display:         flex;
  align-items:     center;
  justify-content: center;
  color:           var(--muted2);
  font-size:       1.75rem;
}

/* Empty state */
.blog-empty {
  text-align: center;
  padding:    4rem 1rem;
}
.blog-empty-icon  { font-size: 2.5rem; margin-bottom: .75rem; }
.blog-empty-title { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: .4rem; }
.blog-empty-sub   { font-size: .85rem; color: var(--muted); }

/* Pagination */
.blog-pagination {
  display:         flex;
  align-items:     center;
  justify-content: center;
  gap:             .35rem;
  margin-top:      2rem;
  flex-wrap:       wrap;
}
.blog-page-btn {
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  min-width:       36px;
  height:          36px;
  padding:         0 .75rem;
  border-radius:   8px;
  border:          1px solid var(--border);
  background:      var(--surface);
  font-family:     var(--mono);
  font-size:       .75rem;
  color:           var(--muted);
  text-decoration: none;
  transition:      all .15s;
}
.blog-page-btn:hover  { border-color: var(--accent); color: var(--accent); }
.blog-page-btn.active { background: var(--accent); border-color: var(--accent); color: #07070e; font-weight: 700; }


/* ── SINGLE POST PAGE ─────────────────────────────────────── */
.post-wrap {
  max-width: 1100px;
  margin:    0 auto;
  padding:   2rem 1.25rem 4rem;
}

/* Header */
.post-header {
  max-width:     720px;
  margin:        0 auto 2rem;
  text-align:    center;
}
.post-back {
  display:         inline-flex;
  align-items:     center;
  gap:             .4rem;
  font-family:     var(--mono);
  font-size:       .72rem;
  color:           var(--muted);
  text-decoration: none;
  margin-bottom:   1.5rem;
  transition:      color .15s;
}
.post-back:hover { color: var(--accent); }

.post-meta-row {
  display:         flex;
  align-items:     center;
  justify-content: center;
  gap:             1rem;
  flex-wrap:       wrap;
  margin-bottom:   1rem;
}
.post-author,
.post-date,
.post-views {
  font-family: var(--mono);
  font-size:   .72rem;
  color:       var(--muted);
  display:     flex;
  align-items: center;
  gap:         5px;
}

.post-title {
  font-family:   var(--display);
  font-size:     clamp(1.6rem, 4vw, 2.5rem);
  font-weight:   800;
  color:         var(--text);
  line-height:   1.25;
  margin-bottom: .85rem;
}
.post-excerpt {
  font-size:     1rem;
  color:         var(--muted);
  line-height:   1.75;
  margin-bottom: 1.25rem;
}

/* Share row */
.post-share {
  display:         flex;
  align-items:     center;
  justify-content: center;
  gap:             .5rem;
}
.share-label {
  font-family: var(--mono);
  font-size:   .68rem;
  color:       var(--muted2);
}
.share-btn {
  width:         30px;
  height:        30px;
  border-radius: 7px;
  border:        1px solid var(--border);
  background:    var(--surface);
  color:         var(--muted);
  font-size:     .75rem;
  font-weight:   700;
  cursor:        pointer;
  display:       inline-flex;
  align-items:   center;
  justify-content: center;
  text-decoration: none;
  transition:    all .15s;
}
.share-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Cover */
.post-cover {
  border-radius: var(--r-xl);
  overflow:      hidden;
  margin-bottom: 2.5rem;
  max-height:    460px;
}
.post-cover img {
  width:      100%;
  height:     100%;
  object-fit: cover;
}

/* Layout */
.post-layout {
  display:               grid;
  grid-template-columns: 1fr 300px;
  gap:                   2rem;
  align-items:           start;
}
@media (max-width: 900px) {
  .post-layout { grid-template-columns: 1fr; }
}

/* Content */
.post-content {
  font-size:   .95rem;
  line-height: 1.85;
  color:       var(--text);
  min-width:   0;
}

/* Sidebar */
.post-sidebar { display: flex; flex-direction: column; gap: 1rem; }

.post-sidebar-card {
  background:    var(--surface);
  border:        1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding:       1.25rem;
}
.post-sidebar-title {
  font-family:   var(--mono);
  font-size:     .65rem;
  font-weight:   700;
  color:         var(--muted2);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: .85rem;
}

/* Author card */
.post-author-card {
  display:     flex;
  align-items: center;
  gap:         .75rem;
}
.post-author-avatar {
  width:           40px;
  height:          40px;
  border-radius:   10px;
  background:      linear-gradient(135deg, var(--accent), var(--blue));
  display:         flex;
  align-items:     center;
  justify-content: center;
  font-family:     var(--mono);
  font-size:       .9rem;
  font-weight:     700;
  color:           #07070e;
  flex-shrink:     0;
}
.post-author-name { font-size: .85rem; font-weight: 700; color: var(--text); }
.post-author-role { font-family: var(--mono); font-size: .65rem; color: var(--muted); margin-top: 2px; }

/* Related posts */
.post-related-list { display: flex; flex-direction: column; gap: .65rem; }
.post-related-item {
  display:         flex;
  gap:             .75rem;
  text-decoration: none;
  align-items:     center;
  padding:         .5rem;
  border-radius:   8px;
  transition:      background .15s;
}
.post-related-item:hover { background: var(--surface2); }
.post-related-img {
  width:         52px;
  height:        40px;
  border-radius: 7px;
  overflow:      hidden;
  flex-shrink:   0;
  background:    var(--surface2);
}
.post-related-img img { width: 100%; height: 100%; object-fit: cover; }
.post-related-title {
  font-size:   .8rem;
  font-weight: 600;
  color:       var(--text);
  line-height: 1.35;
}
.post-related-date {
  font-family: var(--mono);
  font-size:   .62rem;
  color:       var(--muted);
  margin-top:  3px;
}

/* CTA card */
.post-cta-card { text-align: center; }
.post-cta-icon {
  font-size:     1.5rem;
  color:         var(--accent);
  margin-bottom: .5rem;
}
.post-cta-title {
  font-size:     .9rem;
  font-weight:   700;
  color:         var(--text);
  margin-bottom: .35rem;
}
.post-cta-sub {
  font-size:     .78rem;
  color:         var(--muted);
  line-height:   1.6;
  margin-bottom: 1rem;
}
.post-cta-btn {
  display:         inline-flex;
  align-items:     center;
  padding:         .55rem 1.25rem;
  background:      var(--accent);
  color:           #07070e;
  border-radius:   8px;
  font-weight:     700;
  font-size:       .82rem;
  text-decoration: none;
  transition:      background .2s;
}
.post-cta-btn:hover { background: #00f0c0; }



/* ── HOMEPAGE BLOG STRIP ──────────────────────────────────── */
.blog-strip {
  padding:    3.5rem 1.25rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.blog-strip-inner {
  max-width: 1100px;
  margin:    0 auto;
}

/* Header */
.blog-strip-hdr {
  display:         flex;
  align-items:     flex-end;
  justify-content: space-between;
  margin-bottom:   2rem;
  flex-wrap:       wrap;
  gap:             .75rem;
}
.blog-strip-tag {
  font-family:    var(--mono);
  font-size:      .7rem;
  color:          var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom:  .35rem;
}
.blog-strip-title {
  font-family: var(--display);
  font-size:   1.6rem;
  font-weight: 800;
  color:       var(--text);
}
.blog-strip-all {
  font-family:     var(--mono);
  font-size:       .75rem;
  color:           var(--accent);
  text-decoration: none;
  font-weight:     700;
  white-space:     nowrap;
  transition:      opacity .15s;
}
.blog-strip-all:hover { opacity: .7; }

/* Grid */
.blog-strip-grid {
  display:               grid;
  grid-template-columns: repeat(3, 1fr);
  gap:                   1.1rem;
}
@media (max-width: 900px) {
  .blog-strip-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .blog-strip-grid { grid-template-columns: 1fr; }
}

/* Card */
.blog-strip-card {
  background:      var(--surface2);
  border:          1.5px solid var(--border);
  border-radius:   var(--r-xl);
  overflow:        hidden;
  text-decoration: none;
  display:         flex;
  flex-direction:  column;
  transition:      border-color .2s, transform .2s;
}
.blog-strip-card:hover {
  border-color: var(--accent);
  transform:    translateY(-2px);
}

/* Image */
.blog-strip-img {
  height:   180px;
  overflow: hidden;
  position: relative;
}
.blog-strip-img img {
  width:      100%;
  height:     100%;
  object-fit: cover;
  transition: transform .3s;
}
.blog-strip-card:hover .blog-strip-img img { transform: scale(1.03); }

.blog-strip-placeholder {
  width:           100%;
  height:          100%;
  background:      var(--surface);
  display:         flex;
  align-items:     center;
  justify-content: center;
  color:           var(--muted2);
  font-size:       1.75rem;
}
.blog-strip-badge {
  position:      absolute;
  top:           .6rem;
  left:          .6rem;
  font-family:   var(--mono);
  font-size:     .62rem;
  font-weight:   700;
  background:    rgba(245,158,11,.15);
  color:         var(--yellow);
  border:        1px solid rgba(245,158,11,.3);
  padding:       2px 8px;
  border-radius: 100px;
}

/* Body */
.blog-strip-body {
  padding:        1.1rem;
  display:        flex;
  flex-direction: column;
  gap:            .5rem;
  flex:           1;
}
.blog-strip-meta {
  display:     flex;
  align-items: center;
  gap:         .85rem;
  flex-wrap:   wrap;
}
.blog-strip-meta span {
  font-family: var(--mono);
  font-size:   .65rem;
  color:       var(--muted);
  display:     flex;
  align-items: center;
  gap:         4px;
}
.blog-strip-meta i { font-size: .6rem; }

.blog-strip-post-title {
  font-size:   .92rem;
  font-weight: 700;
  color:       var(--text);
  line-height: 1.4;
}
.blog-strip-excerpt {
  font-size:   .8rem;
  color:       var(--muted);
  line-height: 1.65;
  flex:        1;
  display:     -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow:    hidden;
}
.blog-strip-read {
  font-family: var(--mono);
  font-size:   .7rem;
  color:       var(--accent);
  font-weight: 700;
  margin-top:  .25rem;
}



/* ── IMAGE SKELETON LOADING ───────────────────────────────── */
.img-skeleton {
  position:   relative;
  overflow:   hidden;
  background: #e2e8f0; /* light mode base */
}

.img-skeleton::before {
  content:    '';
  position:   absolute;
  inset:      0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,.6) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation:  shimmer 1.5s infinite;
  z-index:    1;
}

.img-skeleton img {
  opacity:    0;
  transition: opacity .4s ease;
  position:   relative;
  z-index:    2;
}

.img-skeleton.loaded::before {
  display: none;
}

.img-skeleton.loaded img {
  opacity: 1;
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* Dark mode override */
[data-theme="dark"] .img-skeleton,
.dark .img-skeleton,
body.dark .img-skeleton {
  background: var(--surface2);
}

[data-theme="dark"] .img-skeleton::before,
.dark .img-skeleton::before,
body.dark .img-skeleton::before {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,.04) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
}



/* ── POST CONTENT — INLINE IMAGES (inserted via Quill) ───── */

/* Base image styles inside blog post body */
.post-content img {
  max-width:     100%;
  height:        auto;
  display:       block;
  border-radius: 12px;
  margin:        1.75rem auto;
  border:        1.5px solid var(--border);
  box-shadow:    0 4px 24px rgba(0,0,0,.25);
  transition:    border-color .2s, box-shadow .2s, transform .2s;
}

/* Hover — subtle lift */
.post-content img:hover {
  border-color: var(--accent);
  box-shadow:   0 8px 32px rgba(0,212,170,.15);
  transform:    translateY(-2px);
  cursor:       zoom-in;
}

/* Full-width breakout for large images */
.post-content img.img-full {
  width:         100%;
  margin-left:   0;
  margin-right:  0;
  border-radius: var(--r-xl);
}

/* Small/inline images side by side */
.post-content img.img-inline {
  display:       inline-block;
  margin:        .5rem .5rem .5rem 0;
  vertical-align: middle;
}

/* Figure + caption pattern */
.post-content figure {
  margin:  1.75rem 0;
}
.post-content figure img {
  margin-bottom: .6rem;
}
.post-content figcaption {
  font-family:   var(--mono);
  font-size:     .7rem;
  color:         var(--muted);
  text-align:    center;
  letter-spacing: .3px;
  line-height:   1.5;
}

/* Lightbox overlay (toggled by JS on click) */
.post-img-lightbox {
  position:        fixed;
  inset:           0;
  z-index:         9999;
  background:      rgba(7,7,14,.92);
  display:         flex;
  align-items:     center;
  justify-content: center;
  padding:         1.5rem;
  cursor:          zoom-out;
  animation:       lbFadeIn .18s ease;
}
.post-img-lightbox img {
  max-width:     90vw;
  max-height:    88vh;
  object-fit:    contain;
  border-radius: 12px;
  border:        1.5px solid var(--border);
  box-shadow:    0 16px 64px rgba(0,0,0,.7);
  cursor:        zoom-out;
  /* override hover transform inside lightbox */
  transform:     none !important;
}
.post-img-lightbox-close {
  position:      fixed;
  top:           1.25rem;
  right:         1.25rem;
  width:         36px;
  height:        36px;
  border-radius: 8px;
  border:        1px solid var(--border);
  background:    var(--surface2);
  color:         var(--muted);
  font-size:     1rem;
  display:       flex;
  align-items:   center;
  justify-content: center;
  cursor:        pointer;
  transition:    border-color .15s, color .15s;
}
.post-img-lightbox-close:hover {
  border-color: var(--accent);
  color:        var(--accent);
}
@keyframes lbFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Mobile */
@media (max-width: 640px) {
  .post-content img {
    border-radius: 8px;
    margin:        1.25rem auto;
  }
  .post-img-lightbox img {
    max-width:  95vw;
    max-height: 80vh;
  }
}





/* ── Category pill bar ─────────────────────────────────────── */

.blog-categories {
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 50;
  margin-bottom: 2rem;
}

.blog-cat-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  padding: .75rem 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.blog-cat-inner::-webkit-scrollbar { display: none; }

.blog-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .85rem;
  border-radius: 999px;
  font-size: .78rem;
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  letter-spacing: .02em;
  transition: all .18s ease;
  border: 1.5px solid var(--border);
  color: var(--muted);
  background: transparent;
}

.blog-cat-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(232,100,44,.06);
}

.blog-cat-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.blog-cat-count {
  background: var(--surface2);
  color: var(--muted);
  border-radius: 999px;
  padding: .05rem .42rem;
  font-size: .68rem;
}

.blog-cat-pill.active .blog-cat-count {
  background: rgba(0,0,0,0.2);
  color: #fff;
}

/* ── Filter heading ──────────────────────────────────────── */
.blog-filter-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: .6rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: .82rem;
  font-family: var(--mono, monospace);
  color: var(--muted);
}

.blog-filter-label strong {
  color: var(--accent);
}

.blog-filter-clear {
  margin-left: auto;
  color: var(--muted2);
  text-decoration: none;
  font-size: .75rem;
  transition: color .15s;
}

.blog-filter-clear:hover {
  color: var(--accent);
}

/* ── Category tag on post card images ───────────────────── */
.blog-cat-tag {
  position: absolute;
  bottom: .6rem;
  left: .6rem;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  color: #fff;
  font-family: var(--mono, monospace);
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: .18rem .55rem;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.2);
  pointer-events: none;
}

.blog-cat-tag-sm {
  font-size: .6rem;
  padding: .14rem .45rem;
}