/* ============================================================
   Blog System Styles — blog.css
   Matches the JohnWeekend dark glassmorphism theme
   ============================================================ */

/* ─── Category color tokens ──────────────────────────────── */
:root {
  --cat-tutorial: #f70353;
  --cat-news:     #3b82f6;
  --cat-tips:     #8b5cf6;
  --cat-guide:    #10b981;
  --cat-general:  #6366f1;
  --cat-update:   #f59e0b;
  --cat-review:   #ec4899;
}

/* ─── Blog Hero ────────────────────────────────────────────── */
.blog-hero {
  padding: 8rem 1.5rem 4rem;
  text-align: center;
  position: relative;
}
.blog-hero-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f70353;
  background: rgba(247, 3, 83, 0.12);
  border: 1px solid rgba(247, 3, 83, 0.25);
  border-radius: 30px;
  padding: 0.35rem 1rem;
  margin-bottom: 1.25rem;
}
.blog-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.65) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.blog-hero p {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.55);
  max-width: 560px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

/* ─── Category filter pills ────────────────────────────────── */
.blog-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  padding: 0 1.5rem 3rem;
}
.blog-filter-pill {
  display: inline-block;
  padding: 0.42rem 1.1rem;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: all 0.22s ease;
  letter-spacing: 0.02em;
}
.blog-filter-pill:hover,
.blog-filter-pill.active {
  background: rgba(247, 3, 83, 0.15);
  border-color: rgba(247, 3, 83, 0.45);
  color: #f70353;
}

/* ─── Blog grid ─────────────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.75rem;
  padding: 0 1.5rem 3rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* ─── Blog Card ─────────────────────────────────────────────── */
.blog-card {
  background: rgba(13, 13, 35, 0.75);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(12px);
  transition: transform 0.32s cubic-bezier(.22,1,.36,1),
              box-shadow 0.3s ease,
              border-color 0.3s ease;
  position: relative;
}
.blog-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 24px 64px rgba(0,0,0,0.35), 0 0 0 1px rgba(247,3,83,0.15);
  border-color: rgba(247,3,83,0.3);
}

/* colored top bar */
.blog-card-top-bar {
  height: 4px;
  border-radius: 20px 20px 0 0;
  flex-shrink: 0;
}
.cat-tutorial { background: linear-gradient(90deg, var(--cat-tutorial), #ff6b9d); }
.cat-news     { background: linear-gradient(90deg, var(--cat-news),     #60a5fa); }
.cat-tips     { background: linear-gradient(90deg, var(--cat-tips),     #c4b5fd); }
.cat-guide    { background: linear-gradient(90deg, var(--cat-guide),    #34d399); }
.cat-general  { background: linear-gradient(90deg, var(--cat-general),  #a5b4fc); }
.cat-update   { background: linear-gradient(90deg, var(--cat-update),   #fde68a); }
.cat-review   { background: linear-gradient(90deg, var(--cat-review),   #f9a8d4); }

.blog-card-body {
  padding: 1.5rem 1.6rem 1.6rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.blog-card-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 0.5rem;
}

/* category badge */
.blog-cat-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.26rem 0.75rem;
  border-radius: 30px;
}
.blog-cat-badge.cat-tutorial { background: rgba(247,3,83,0.15);  color: #f77; border: 1px solid rgba(247,3,83,0.3); }
.blog-cat-badge.cat-news     { background: rgba(59,130,246,0.15); color: #93c5fd; border: 1px solid rgba(59,130,246,0.3); }
.blog-cat-badge.cat-tips     { background: rgba(139,92,246,0.15); color: #c4b5fd; border: 1px solid rgba(139,92,246,0.3); }
.blog-cat-badge.cat-guide    { background: rgba(16,185,129,0.15); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.3); }
.blog-cat-badge.cat-general  { background: rgba(99,102,241,0.15); color: #a5b4fc; border: 1px solid rgba(99,102,241,0.3); }
.blog-cat-badge.cat-update   { background: rgba(245,158,11,0.15); color: #fde68a; border: 1px solid rgba(245,158,11,0.3); }
.blog-cat-badge.cat-review   { background: rgba(236,72,153,0.15); color: #f9a8d4; border: 1px solid rgba(236,72,153,0.3); }

.blog-read-time {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.38);
  font-weight: 500;
  white-space: nowrap;
}

/* title — this IS the visual focal point */
.blog-card-title {
  font-size: 1.22rem;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 0.85rem;
  flex-grow: 0;
}
.blog-card-title a {
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, #fff, rgba(255,255,255,0.75));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: opacity 0.2s;
}
.blog-card:hover .blog-card-title a {
  opacity: 0.85;
}

.blog-card-excerpt {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.48);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 1.2rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-footer {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 1rem;
  margin-top: auto;
}
.blog-card-date,
.blog-card-views {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.3);
  font-weight: 500;
}
.blog-read-more {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 700;
  color: #f70353;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: opacity 0.2s;
}
.blog-read-more:hover { opacity: 0.75; }

/* Small card variant (sidebar / related) */
.blog-card-sm .blog-card-title { font-size: 1rem; }
.blog-card-sm .blog-card-excerpt { -webkit-line-clamp: 2; }

/* ─── Load More ─────────────────────────────────────────────── */
.blog-load-more-wrap {
  text-align: center;
  padding: 1rem 1.5rem 4rem;
}
#loadMoreBtn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 2.4rem;
  border-radius: 50px;
  font-size: 0.92rem;
  font-weight: 700;
  background: rgba(247,3,83,0.12);
  color: #f70353;
  border: 1px solid rgba(247,3,83,0.35);
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: all 0.25s ease;
}
#loadMoreBtn:hover {
  background: rgba(247,3,83,0.22);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(247,3,83,0.2);
}
#loadMoreBtn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}
.blog-end-msg {
  display: inline-block;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.3);
  padding: 1rem 0;
  display: none;
}

/* ─── Single Post Page ──────────────────────────────────────── */
.post-hero {
  padding: 8rem 1.5rem 3.5rem;
  max-width: 860px;
  margin: 0 auto;
}
.post-breadcrumb {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.35);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.post-breadcrumb a {
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  transition: color 0.2s;
}
.post-breadcrumb a:hover { color: #f70353; }
.post-breadcrumb .bc-sep { color: rgba(255,255,255,0.2); }

.post-h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.75) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.post-meta-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 2.5rem;
}
.post-meta-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.42);
  font-weight: 500;
}
.post-meta-item .meta-icon { font-size: 0.85rem; }

/* Post content typography */
.post-content-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}
.blog-content {
  color: rgba(255,255,255,0.8);
  font-size: 1.06rem;
  line-height: 1.85;
}
.blog-content h2 {
  font-size: 1.55rem;
  font-weight: 800;
  color: #fff;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.blog-content h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  margin: 2rem 0 0.75rem;
}
.blog-content h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  margin: 1.5rem 0 0.5rem;
}
.blog-content p { margin-bottom: 1.4rem; }
.blog-content ul,
.blog-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.4rem;
}
.blog-content li { margin-bottom: 0.5rem; }
.blog-content a {
  color: #f70353;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.blog-content a:hover { opacity: 0.8; }
.blog-content strong { color: #fff; font-weight: 700; }
.blog-content em { color: rgba(255,255,255,0.7); font-style: italic; }
.blog-content blockquote {
  border-left: 3px solid #f70353;
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: rgba(247,3,83,0.06);
  border-radius: 0 12px 12px 0;
  font-style: italic;
  color: rgba(255,255,255,0.7);
}
.blog-content code {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 5px;
  padding: 0.15rem 0.45rem;
  font-size: 0.88em;
  font-family: 'Fira Code', 'Courier New', monospace;
  color: #c4b5fd;
}
.blog-content pre {
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin-bottom: 1.4rem;
}
.blog-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.85);
}
.blog-content hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin: 2.5rem 0;
}
.blog-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.4rem;
  font-size: 0.9rem;
}
.blog-content th,
.blog-content td {
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255,255,255,0.08);
  text-align: left;
}
.blog-content th {
  background: rgba(255,255,255,0.05);
  font-weight: 700;
  color: #fff;
}

/* Tags row */
.post-tags-row {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.post-tags-label {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: 0.25rem;
}
.post-tag-chip {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 30px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: all 0.2s;
}
.post-tag-chip:hover {
  background: rgba(247,3,83,0.1);
  border-color: rgba(247,3,83,0.3);
  color: #f70353;
}

/* Share row */
.post-share-row {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 2.5rem;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.share-label {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.35);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: 30px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.22s;
}
.share-btn:hover {
  background: rgba(247,3,83,0.1);
  border-color: rgba(247,3,83,0.3);
  color: #f70353;
}

/* Related posts section */
.related-posts-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.related-posts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.related-posts-header h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
}
.related-posts-header a {
  font-size: 0.85rem;
  color: #f70353;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: opacity 0.2s;
}
.related-posts-header a:hover { opacity: 0.75; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* ─── Home page blog preview section ───────────────────────── */
.home-blog-section {
  padding: 5rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}
.home-blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.75rem;
  margin-bottom: 2.5rem;
}
.home-blog-cta {
  text-align: center;
}

/* ─── Admin blog panel (inside dashboard) ──────────────────── */
.blog-admin-table th,
.blog-admin-table td {
  font-size: 0.85rem;
}
.blog-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.65rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.blog-status-published {
  background: rgba(34,197,94,0.15);
  color: #4ade80;
  border: 1px solid rgba(34,197,94,0.3);
}
.blog-status-draft {
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.4);
  border: 1px solid rgba(255,255,255,0.1);
}
.blog-featured-star {
  color: #f59e0b;
  font-size: 0.9rem;
}

/* SEO panel in admin form */
.seo-panel {
  background: rgba(247,3,83,0.04);
  border: 1px solid rgba(247,3,83,0.15);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  margin-top: 1.5rem;
}
.seo-panel-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #f70353;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.char-counter {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.35);
  float: right;
  margin-top: 0.25rem;
}
.char-counter.warn { color: #f59e0b; }
.char-counter.over { color: #f70353; }

/* ─── Animate on scroll ─────────────────────────────────────── */
.blog-card.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease,
              box-shadow 0.3s ease, border-color 0.3s ease;
}
.blog-card.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}
.blog-card:hover {
  transform: translateY(-8px) scale(1.01) !important;
}

/* ─── Empty state ──────────────────────────────────────────── */
.blog-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 5rem 1rem;
  color: rgba(255,255,255,0.3);
}
.blog-empty-icon { font-size: 3.5rem; margin-bottom: 1rem; }

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .blog-grid { grid-template-columns: 1fr; padding: 0 1rem 2rem; }
  .blog-hero  { padding: 7rem 1rem 3rem; }
  .post-hero  { padding: 6.5rem 1rem 2rem; }
  .post-content-wrap { padding: 0 1rem 2rem; }
  .post-meta-bar { gap: 0.65rem; }
  .related-grid { grid-template-columns: 1fr; }
  .home-blog-grid { grid-template-columns: 1fr; }
}
