/* ==========================================================================
   M.I.H. Group — Public Blog Additional Styles
   Extends blog.css with article page styles and card improvements.
   ========================================================================== */

/* ============================================================ ARTICLE PAGE === */
.article-page { padding-top: calc(var(--nav-h) + clamp(40px, 6vh, 72px)); }

.article-header {
  padding: 0 0 clamp(32px, 5vh, 64px);
  max-width: 760px;
  margin-inline: auto;
}

.article-back {
  display: block;
  margin-bottom: 24px;
  margin-top: 8px;
  color: var(--c-text-3);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: color .2s ease;
}

.article-back:hover { color: var(--c-gold); }

.article-meta-top { max-width: 760px; margin: 0 auto; }

.article-subtitle {
  display: block;
  font-size: clamp(16px, 2vw, 22px);
  color: var(--c-text-2);
  margin-bottom: 12px;
  font-weight: 400;
  text-align: left;
}

.article-title {
  font-size: clamp(28px, 5vw, 56px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.02em;
  margin-bottom: 20px;
  text-align: left;
  max-width: 760px;
  margin-inline: auto;
}

.article-meta {
  display: flex;
  justify-content: flex-start;
  gap: clamp(16px, 3vw, 32px);
  flex-wrap: wrap;
  color: var(--c-text-3);
  font-size: 14px;
}

.article-meta-row {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--c-stroke);
  border-radius: 12px;
  background: rgba(197, 160, 89, 0.04);
  max-width: 760px;
  width: 100%;
}

.article-cover-wrap {
  max-width: 760px;
  margin: 0 auto 18px;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,.02);
  border: 1px solid var(--c-stroke);
}

.article-cover-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
}

.article-meta i { color: var(--c-gold); margin-right: 6px; }

.article-body {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px clamp(16px, 3vw, 56px) 60px;
  font-size: clamp(16px, 1.2vw, 19px);
  line-height: 1.8;
  color: var(--c-text-2);
  text-align: justify;
}

.article-body h1,
.article-body h2 {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  color: var(--c-text);
  margin: 48px 0 20px;
  line-height: 1.3;
}

.article-body h3 {
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 700;
  color: var(--c-gold);
  margin: 36px 0 14px;
}

.article-body h4,
.article-body h5,
.article-body h6 {
  font-size: clamp(16px, 1.5vw, 20px);
  font-weight: 700;
  color: var(--c-text);
  margin: 28px 0 12px;
}

.article-body p { margin-bottom: 18px; }
.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6 {
  text-align: left;
}

/* Force justification on all body text elements — headings stay left */
.article-body p,
.article-body li,
.article-body blockquote p,
.article-body address {
  text-align: justify;
  text-justify: inter-word;
  word-spacing: -0.02em;
}


.article-body ul, .article-body ol {
  margin: 16px 0 16px 24px;
  padding: 0;
}

.article-body li { margin: 8px 0; line-height: 1.7; }

.article-body blockquote {
  border-left: 3px solid var(--c-gold);
  padding: 16px 24px;
  margin: 28px 0;
  font-style: italic;
  color: var(--c-text-2);
  background: rgba(197, 160, 89, .06);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.article-body a { color: var(--c-gold); text-decoration: underline; }
.article-body a:hover { color: var(--c-gold-soft); }

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--r-md);
  margin: 20px 0;
}

/* ============================================================ RELATED ARTICLES == */
.related-articles {
  padding: 60px 0;
  border-top: 1px solid var(--c-stroke);
}

.related-title {
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 32px;
  text-align: center;
}

/* ============================================================ CTA ====== */
.article-cta {
  text-align: center;
  padding: 60px 24px;
  background: var(--c-surface);
  border-radius: var(--r-md);
  margin: 0 0 60px;
}

.article-cta h2 {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 12px;
}

.article-cta .btn { margin-top: 20px; }

/* ============================================================ BLOG CARDS ====== */
.course-body { padding: 18px; display: flex; flex-direction: column; flex: 1; }
.course-thumb.blog-thumb { overflow: hidden; border-bottom: 1px solid var(--c-stroke); }
.course-thumb.blog-thumb img { display: block; width: 100%; height: 220px; object-fit: cover; }
.blog-card-meta { margin-bottom: 12px; }
.blog-card-categories { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.blog-card-categories span {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px;
  background: rgba(197, 160, 89, 0.08); border: 1px solid rgba(197, 160, 89, 0.2); color: var(--c-gold);
  font-size: 11px; font-weight: 600;
}
.course-title { font-size: clamp(18px, 2vw, 24px); font-weight: 700; color: var(--c-text); line-height: 1.4; margin: 0 0 8px; }
.course-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--c-text-3); margin-bottom: 10px; }
.course-meta i { color: var(--c-gold); margin-right: 4px; }
.course-desc { font-size: 14px; color: var(--c-text-2); line-height: 1.6; margin-bottom: 14px; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  text-align: justify;
}
.course-foot { margin-top: auto; }

/* ============================================================ SHARE BAR === */
.share-bar {
  position: fixed;
  right: 20px;
  left: auto;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(12, 16, 24, 0.9);
  border: 1px solid rgba(210, 174, 101, 0.35);
  border-radius: 14px;
  padding: 12px 8px;
  box-shadow: 0 10px 26px rgba(0,0,0,.28);
  backdrop-filter: blur(6px);
}

.share-bar-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.share-label {
  font-size: 9px;
  color: var(--c-text-3);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 700;
  transform: rotate(180deg);
  margin: 2px 0;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--c-text-2);
  font-size: 16px;
  text-decoration: none;
  transition: all .2s ease;
  position: relative;
}

.share-btn:hover { color: #fff; transform: scale(1.1); }
.share-btn.share-fb:hover { background: #1877f2; }
.share-btn.share-li:hover { background: #0a66c2; }
.share-btn.share-wa:hover { background: #25d366; }

.share-count {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 9px;
  font-weight: 700;
  background: var(--c-gold);
  color: var(--c-bg);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Card-level share buttons */
.card-share {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--c-stroke);
}

.card-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--c-text-3);
  font-size: 13px;
  text-decoration: none;
  transition: all .2s ease;
}

.card-share-btn:hover { color: #fff; }
.card-share-btn.share-fb:hover { background: #1877f2; }
.card-share-btn.share-li:hover { background: #0a66c2; }
.card-share-btn.share-wa:hover { background: #25d366; }

/* Category filter */
.category-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.category-chip { padding: 4px 14px; border-radius: 20px; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid var(--c-stroke); background: transparent; color: var(--c-text-3); text-decoration: none; transition: all .2s ease; font-family: var(--font-sans); }
.category-chip:hover, .category-chip.active { border-color: var(--c-gold); color: var(--c-gold); background: var(--c-gold-dim); }

/* ============================================================ PAGINATION ==== */
.blog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
  padding-bottom: 8px;
  flex-wrap: wrap;
}

.blog-pagination[hidden] { display: none !important; }

.blog-pagination .page-link {
  padding: 9px 16px;
  border: 1px solid var(--c-stroke-strong);
  border-radius: 10px;
  color: var(--c-text-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  font-family: var(--font-sans);
  transition: all .2s ease;
}

.blog-pagination .page-link:hover:not(:disabled) {
  border-color: var(--c-gold);
  color: var(--c-gold);
}

.blog-pagination .page-link:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.blog-pagination .page-info {
  color: var(--c-text-3);
  font-size: 14px;
}

.loading-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--c-text-3);
  font-size: 16px;
}

.loading-state i { margin-right: 10px; color: var(--c-gold); }

/* ============================================================ RESPONSIVE ===== */
@media (max-width: 768px) {
  .share-bar {
    position: fixed;
    right: 12px;
    left: auto;
    top: auto;
    bottom: 16px;
    transform: none;
    flex-direction: row;
    border-radius: 12px;
    padding: 10px 12px;
    justify-content: center;
  }
  .share-label {
    display: block;
    writing-mode: horizontal-tb;
    transform: none;
    margin: 0 6px 0 0;
    letter-spacing: .08em;
    font-size: 8px;
  }
  .share-bar-inner { flex-direction: row; }
  .article-header { padding-bottom: 80px; }
  .article-meta { gap: 12px; font-size: 13px; }
  .article-body { padding: 24px 16px 40px; }
  .article-body h2 { margin-top: 36px; }
  .article-cta { margin: 0 0 40px; padding: 40px 20px; }
}

@media (max-width: 640px) {
  .article-title { font-size: 28px; }
  .article-meta { flex-direction: column; align-items: flex-start; gap: 8px; }
  .article-meta-row {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    gap: 8px 12px;
  }
  .blog-pagination {
    gap: 10px;
    justify-content: stretch;
  }
  .blog-pagination .page-link {
    flex: 1 1 100%;
    width: 100%;
    padding: 10px 14px;
    font-size: 12.5px;
  }
  .blog-pagination .page-info {
    width: 100%;
    text-align: center;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .article-page *, .article-page *::before, .article-page *::after,
  .blog-card *, .blog-card *::before, .blog-card *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
