/* ==========================================================================
   DeskCharm Blog & Magazine Stylesheet
   ========================================================================== */

/* Blog Portal Hub Styles */
.blog-hero {
  text-align: center;
  margin-bottom: 48px;
}

.blog-hero .pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(3, 53, 252, 0.08);
  color: var(--cta);
  border: 1px solid rgba(3, 53, 252, 0.18);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}

.blog-title {
  font-family: var(--display);
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.035em;
  margin: 0 0 16px;
  color: var(--ink);
}

.blog-subtitle {
  font-size: 18px;
  color: var(--muted);
  max-width: 680px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

/* Category Filters & Search Controls */
.blog-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 40px;
}

.blog-categories {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.category-tab {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--faint);
  font-size: 13.5px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
}

.category-tab:hover {
  color: var(--ink);
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.category-tab.active {
  background: var(--cta);
  color: #ffffff;
  border-color: var(--cta);
  box-shadow: 0 4px 14px rgba(3, 53, 252, 0.25);
}

.blog-search-bar {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  position: relative;
}

.blog-search-input {
  width: 100%;
  padding: 12px 18px 12px 42px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--card);
  font-family: var(--sans);
  font-size: 14.5px;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.blog-search-input:focus {
  border-color: var(--cta);
  box-shadow: 0 0 0 3px rgba(3, 53, 252, 0.12);
}

.blog-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  pointer-events: none;
}

/* Featured Article Card */
.featured-card {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 32px;
  background: linear-gradient(135deg, rgba(3, 53, 252, 0.04) 0%, rgba(226, 194, 100, 0.06) 100%), var(--card);
  border: 1px solid rgba(3, 53, 252, 0.18);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 48px;
  box-shadow: var(--shadow-card);
  align-items: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.featured-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-float);
}

.featured-image-wrap {
  width: 100%;
  height: 280px;
  border-radius: 16px;
  overflow: hidden;
  background: #0b0f1d;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.featured-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.featured-card:hover .featured-image-wrap img {
  transform: scale(1.03);
}

.featured-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(3, 53, 252, 0.9);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 14px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.featured-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--faint);
  margin-bottom: 12px;
}

.featured-title {
  font-family: var(--display);
  font-size: clamp(1.5rem, 2.5vw, 1.9rem);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 14px;
}

.featured-title a {
  color: var(--ink);
  text-decoration: none;
}

.featured-title a:hover {
  color: var(--cta);
}

.featured-excerpt {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 20px;
}

.featured-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.read-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--cta);
  font-weight: 600;
  font-size: 14px;
}

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

.blog-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  position: relative;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-float);
  border-color: #cbd5e1;
}

.card-image-wrap {
  width: 100%;
  height: 175px;
  background: #0f1424;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.blog-card:hover .card-image-wrap img {
  transform: scale(1.04);
}

.card-category-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(14, 20, 38, 0.82);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 12px;
  letter-spacing: 0.02em;
}

.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--faint);
  margin-bottom: 10px;
}

.card-title {
  font-family: var(--display);
  font-size: 17.5px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 10px;
}

.card-title a {
  color: var(--ink);
  text-decoration: none;
}

.card-title a:hover {
  color: var(--cta);
}

.card-excerpt {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 16px;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-size: 12.5px;
  color: var(--faint);
}

.author-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--ink);
}

/* Article Reading Progress Bar */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #104fc8, #0335fc, #f4c444);
  z-index: 1000;
  width: 0%;
  transition: width 0.1s ease-out;
}

/* Article Page Layout */
.article-shell {
  max-width: 780px;
  margin: 0 auto;
}

.article-header {
  margin-bottom: 32px;
}

.article-category {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--cta);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.article-title {
  font-family: var(--display);
  font-size: clamp(2.2rem, 4.5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0 0 18px;
}

.article-lead {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.55;
  color: #3b3c4d;
  margin-bottom: 24px;
}

.article-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  margin-bottom: 32px;
  font-size: 13.5px;
  color: var(--faint);
  flex-wrap: wrap;
  gap: 12px;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #121a36;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.author-name {
  font-weight: 600;
  color: var(--ink);
}

.author-role {
  font-size: 12px;
  color: var(--faint);
}

.article-hero-media {
  width: 100%;
  max-height: 420px;
  border-radius: 18px;
  overflow: hidden;
  background: #090d1a;
  margin-bottom: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-card);
}

.article-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Article Prose Typography */
.article-prose {
  font-size: 17px;
  line-height: 1.75;
  color: #272733;
}

.article-prose h2 {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  margin: 40px 0 16px;
  letter-spacing: -0.02em;
}

.article-prose h3 {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  margin: 28px 0 12px;
}

.article-prose p {
  margin: 0 0 20px;
}

.article-prose ul, .article-prose ol {
  margin: 0 0 24px;
  padding-left: 24px;
}

.article-prose li {
  margin-bottom: 8px;
}

.article-prose strong {
  color: var(--ink);
}

.article-callout {
  background: var(--tint);
  border-left: 4px solid var(--cta);
  padding: 18px 22px;
  border-radius: 0 12px 12px 0;
  margin: 28px 0;
  font-size: 15.5px;
  line-height: 1.6;
}

.article-callout strong {
  color: var(--blue-2);
}

/* Author Bio Card */
.author-bio-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
  margin: 48px 0 32px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow-card);
}

.author-bio-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #104fc8, #0335fc);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 22px;
  flex-shrink: 0;
}

.author-bio-text h4 {
  margin: 0 0 4px;
  font-size: 16.5px;
  font-family: var(--display);
  font-weight: 700;
}

.author-bio-text p {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
}

/* Article Navigation */
.article-nav-row {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 24px;
  margin-top: 32px;
  gap: 20px;
}

.article-nav-btn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 48%;
  font-size: 13px;
  color: var(--faint);
}

.article-nav-btn strong {
  color: var(--cta);
  font-size: 14.5px;
}

@media (max-width: 768px) {
  .featured-card {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px;
  }
  .featured-image-wrap {
    height: 200px;
  }
  .blog-grid {
    grid-template-columns: 1fr;
  }
  .author-bio-card {
    flex-direction: column;
    text-align: center;
  }
  .article-nav-row {
    flex-direction: column;
  }
  .article-nav-btn {
    max-width: 100%;
  }
}
