/* Blog list (blogs/index.php) and post (blogs/post.php). Keeps the pages' own class names. Requires sc-tokens.css. */

body { background: var(--sc-bg-subtle); }

/* ---------- List: hero ---------- */
.blog-hero {
  padding: clamp(3rem, 2rem + 4vw, 5rem) var(--sc-gutter);
  color: var(--sc-navy-200);
  text-align: center;
  background:
    radial-gradient(40rem 20rem at 100% 0%, rgba(247, 116, 98, 0.18), transparent 60%),
    radial-gradient(40rem 24rem at 0% 100%, rgba(36, 84, 137, 0.4), transparent 60%),
    var(--sc-navy-900);
}
.blog-hero h1 { margin-bottom: var(--sc-space-3); font-family: var(--sc-font-heading); font-size: var(--sc-text-4xl); font-weight: var(--sc-weight-bold); color: var(--sc-white); }
.blog-hero p { max-width: 640px; margin: 0 auto var(--sc-space-8); font-size: var(--sc-text-lg); color: var(--sc-navy-200); }
.blog-search-box { position: relative; max-width: 560px; margin: 0 auto; }
.blog-search-input {
  width: 100%;
  min-height: 56px;
  padding: 0 64px 0 var(--sc-space-6);
  font: inherit;
  font-size: var(--sc-text-base);
  color: var(--sc-text);
  background: var(--sc-white);
  border: 0;
  border-radius: var(--sc-radius-pill);
  box-shadow: var(--sc-shadow-lg);
}
.blog-search-input:focus { outline: none; box-shadow: var(--sc-shadow-lg), var(--sc-ring); }
.blog-search-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--sc-navy-900);
  background: var(--sc-accent);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.blog-search-btn:hover { background: var(--sc-accent-hover); }

/* ---------- List: category pills ---------- */
.category-pills-wrap { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sc-space-2); margin-bottom: var(--sc-space-8); padding: var(--sc-space-2) 0; }
.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 var(--sc-space-4);
  font-size: var(--sc-text-sm);
  font-weight: var(--sc-weight-medium);
  color: var(--sc-text);
  background: var(--sc-white);
  border: 1px solid var(--sc-border-strong);
  border-radius: var(--sc-radius-pill);
  text-decoration: none;
  transition: all var(--sc-duration) var(--sc-ease);
}
.cat-pill small { color: var(--sc-text-subtle); }
.cat-pill:hover { color: var(--sc-primary); border-color: var(--sc-primary); }
.cat-pill.active { color: var(--sc-white); background: var(--sc-primary); border-color: var(--sc-primary); }
.cat-pill.active small { color: var(--sc-navy-200); }

/* ---------- List: cards ---------- */
.blog-card { display: flex; flex-direction: column; height: 100%; overflow: hidden; background: var(--sc-white); border: 1px solid var(--sc-border); border-radius: var(--sc-radius-lg); transition: transform var(--sc-duration) var(--sc-ease), box-shadow var(--sc-duration) var(--sc-ease); }
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--sc-shadow-md); }
.blog-thumb-wrap { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--sc-gray-100); }
.blog-thumb { width: 100%; height: 100%; object-fit: contain; transition: transform 400ms var(--sc-ease); } /* uncropped, as before */
.blog-card:hover .blog-thumb { transform: scale(1.03); }
.blog-cat-badge { position: absolute; top: var(--sc-space-3); left: var(--sc-space-3); padding: 0.2rem 0.65rem; font-size: var(--sc-text-xs); font-weight: var(--sc-weight-semibold); color: var(--sc-white); background: rgba(10, 31, 56, 0.85); border-radius: var(--sc-radius-pill); }
.blog-card-body { display: flex; flex: 1; flex-direction: column; padding: var(--sc-space-5); }
.blog-date { margin-bottom: var(--sc-space-2); font-size: var(--sc-text-sm); font-weight: var(--sc-weight-medium); color: var(--sc-accent-text); }
.blog-card-body > a { text-decoration: none; }
.blog-card-title {
  margin-bottom: var(--sc-space-2);
  font-family: var(--sc-font-heading);
  font-size: var(--sc-text-lg);
  font-weight: var(--sc-weight-semibold);
  line-height: var(--sc-leading-snug);
  color: var(--sc-heading);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card-title:hover { color: var(--sc-primary); }
.blog-card-excerpt {
  flex-grow: 1;
  margin-bottom: var(--sc-space-4);
  font-size: var(--sc-text-sm);
  line-height: 1.6;
  color: var(--sc-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.read-more-link { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; font-size: var(--sc-text-sm); font-weight: var(--sc-weight-semibold); color: var(--sc-primary); text-decoration: none; transition: gap var(--sc-duration) var(--sc-ease); }
.read-more-link:hover { gap: 10px; color: var(--sc-primary-hover); }

/* ---------- List: pagination ---------- */
.pagination-wrap { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sc-space-2); margin: var(--sc-space-12) 0; }
.page-btn { display: inline-grid; place-items: center; min-width: 42px; height: 42px; padding: 0 var(--sc-space-3); font-size: var(--sc-text-sm); font-weight: var(--sc-weight-semibold); color: var(--sc-text); background: var(--sc-white); border: 1px solid var(--sc-border); border-radius: var(--sc-radius-md); text-decoration: none; transition: all var(--sc-duration) var(--sc-ease); }
.page-btn:hover { color: var(--sc-primary); border-color: var(--sc-primary); }
.page-btn.active { color: var(--sc-white); background: var(--sc-primary); border-color: var(--sc-primary); }
.page-btn.disabled { opacity: 0.5; pointer-events: none; }

/* ---------- Post: breadcrumb + header ---------- */
.blog-breadcrumbs { padding: var(--sc-space-3) 0; font-size: var(--sc-text-sm); color: var(--sc-text-subtle); background: var(--sc-white); border-bottom: 1px solid var(--sc-border); }
.blog-breadcrumbs a { color: var(--sc-text-muted); text-decoration: none; }
.blog-breadcrumbs a:hover { color: var(--sc-primary); text-decoration: underline; }
.blog-breadcrumbs span { color: var(--sc-text); }

.article-header { margin-bottom: var(--sc-space-6); }
.article-cat-badge { display: inline-block; margin-bottom: var(--sc-space-3); padding: 0.2rem 0.7rem; font-size: var(--sc-text-xs); font-weight: var(--sc-weight-semibold); letter-spacing: 0.04em; text-transform: uppercase; color: var(--sc-accent-text); background: var(--sc-coral-50); border-radius: var(--sc-radius-pill); }
.article-cat-badge:empty { display: none; }
.article-title { margin-bottom: var(--sc-space-5); font-family: var(--sc-font-heading); font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); font-weight: var(--sc-weight-bold); line-height: 1.2; letter-spacing: -0.01em; color: var(--sc-heading); }
.article-meta-bar { display: flex; flex-wrap: wrap; gap: var(--sc-space-2) var(--sc-space-6); padding: var(--sc-space-3) 0; font-size: var(--sc-text-sm); color: var(--sc-text-muted); border-top: 1px solid var(--sc-border); border-bottom: 1px solid var(--sc-border); }
.article-meta-item .fa { margin-right: 4px; color: var(--sc-navy-400) !important; }
.article-featured-img { display: block; width: 100%; max-height: 520px; margin-bottom: var(--sc-space-8); object-fit: contain; background: var(--sc-gray-100); border-radius: var(--sc-radius-lg); }

/* ---------- Post: article body (readable measure and rhythm) ---------- */
.article-body { padding: clamp(1.25rem, 0.5rem + 3vw, 2.5rem); font-size: 1.0625rem; line-height: 1.8; color: var(--sc-gray-700); background: var(--sc-white); border: 1px solid var(--sc-border); border-radius: var(--sc-radius-lg); }
.article-body > :first-child { margin-top: 0; }
.article-body h2 { margin: var(--sc-space-10) 0 var(--sc-space-4); font-family: var(--sc-font-heading); font-size: var(--sc-text-2xl); font-weight: var(--sc-weight-semibold); line-height: 1.3; color: var(--sc-heading); }
.article-body h3 { margin: var(--sc-space-8) 0 var(--sc-space-3); font-family: var(--sc-font-heading); font-size: var(--sc-text-xl); font-weight: var(--sc-weight-semibold); color: var(--sc-heading); }
.article-body h4, .article-body h5, .article-body h6 { margin: var(--sc-space-6) 0 var(--sc-space-2); font-family: var(--sc-font-heading); font-weight: var(--sc-weight-semibold); color: var(--sc-heading); }
.article-body p { margin-bottom: var(--sc-space-5); }
.article-body ul, .article-body ol { margin-bottom: var(--sc-space-5); padding-left: var(--sc-space-6); }
.article-body li { margin-bottom: var(--sc-space-2); }
.article-body li::marker { color: var(--sc-accent); }
.article-body img { display: block; max-width: 100%; height: auto; margin: var(--sc-space-6) auto; border-radius: var(--sc-radius-md); }
.article-body a { color: var(--sc-primary); font-weight: var(--sc-weight-medium); text-decoration: underline; text-decoration-color: var(--sc-navy-200); text-underline-offset: 3px; }
.article-body a:hover { text-decoration-color: currentColor; }
.article-body blockquote { margin: var(--sc-space-6) 0; padding: var(--sc-space-4) var(--sc-space-6); font-style: italic; color: var(--sc-text); background: var(--sc-navy-50); border-left: 4px solid var(--sc-accent); border-radius: 0 var(--sc-radius-md) var(--sc-radius-md) 0; }
.article-body table { width: 100%; margin-bottom: var(--sc-space-5); border-collapse: collapse; font-size: var(--sc-text-sm); }
.article-body th, .article-body td { padding: var(--sc-space-2) var(--sc-space-3); border: 1px solid var(--sc-border); }
.article-body th { background: var(--sc-gray-50); }

/* ---------- Post: share + CTA ---------- */
.share-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sc-space-2); margin-top: var(--sc-space-6); padding: var(--sc-space-4); font-size: var(--sc-text-sm); background: var(--sc-white); border: 1px solid var(--sc-border); border-radius: var(--sc-radius-lg); }
.share-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; font-size: 16px; color: var(--sc-white); border-radius: 50%; text-decoration: none; transition: transform var(--sc-duration) var(--sc-ease); }
.share-btn:hover { color: var(--sc-white); transform: translateY(-2px); }
.share-wa { background: #25d366; }
.share-li { background: #0a66c2; }
.share-tw { background: #0f1419; }
.share-fb { background: #1877f2; }
.share-copy { color: var(--sc-text); background: var(--sc-gray-200); }
.share-copy:hover { color: var(--sc-text); }

.sc-blog-cta { margin: var(--sc-space-10) 0; padding: var(--sc-space-8); text-align: center; color: var(--sc-navy-100); background: radial-gradient(30rem 16rem at 100% 0%, rgba(247, 116, 98, 0.25), transparent 60%), var(--sc-navy-900); border-radius: var(--sc-radius-xl); }
.sc-blog-cta h4 { font-family: var(--sc-font-heading); font-size: var(--sc-text-2xl); font-weight: var(--sc-weight-semibold); color: var(--sc-white); }
.sc-blog-cta p { margin: var(--sc-space-2) 0 var(--sc-space-5); color: var(--sc-navy-200); }

/* ---------- Post: sidebar ---------- */
.course-cta-card { margin-bottom: var(--sc-space-6); padding: var(--sc-space-6); color: var(--sc-navy-100); background: linear-gradient(140deg, var(--sc-navy-600), var(--sc-navy-800)); border-radius: var(--sc-radius-lg); }
.course-cta-card > .fa { font-size: 28px; color: var(--sc-coral-300) !important; }
.course-cta-card h4 { margin: var(--sc-space-3) 0 var(--sc-space-2); font-family: var(--sc-font-heading); font-size: var(--sc-text-xl); font-weight: var(--sc-weight-semibold); color: var(--sc-white); }
.course-cta-card p { font-size: var(--sc-text-sm); color: var(--sc-navy-200); }
.course-cta-btn { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; font-family: var(--sc-font-heading); font-weight: var(--sc-weight-semibold); color: var(--sc-navy-900); background: var(--sc-accent); border-radius: var(--sc-radius-md); text-decoration: none; }
.course-cta-btn:hover { color: var(--sc-navy-900); background: var(--sc-accent-hover); }

.sidebar-widget { margin-bottom: var(--sc-space-6); padding: var(--sc-space-5); background: var(--sc-white); border: 1px solid var(--sc-border); border-radius: var(--sc-radius-lg); }
.sidebar-widget-title { margin-bottom: var(--sc-space-4); font-family: var(--sc-font-heading); font-size: var(--sc-text-base); font-weight: var(--sc-weight-semibold); color: var(--sc-heading); }
.sidebar-widget > div:not(.recent-post-item) { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sc-space-2); }
.recent-post-item { display: flex; gap: var(--sc-space-3); padding: var(--sc-space-3) 0; border-bottom: 1px solid var(--sc-gray-100); }
.recent-post-item:last-child { border-bottom: 0; padding-bottom: 0; }
.recent-post-thumb { flex: none; width: 84px; aspect-ratio: 16 / 9; object-fit: contain; background: var(--sc-gray-100); border-radius: var(--sc-radius-sm); }
.recent-post-title { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: var(--sc-text-sm); font-weight: var(--sc-weight-medium); line-height: 1.4; color: var(--sc-text); text-decoration: none; }
.recent-post-title:hover { color: var(--sc-primary); }
.recent-post-date { margin-top: 4px; font-size: var(--sc-text-xs); color: var(--sc-text-subtle); }

@media (min-width: 992px) {
  aside.col-lg-4 { position: sticky; top: calc(var(--sc-header-height) + 60px); align-self: flex-start; }
}

/* ---------- Post: related ---------- */
.related-card { height: 100%; overflow: hidden; background: var(--sc-white); border: 1px solid var(--sc-border); border-radius: var(--sc-radius-lg); transition: transform var(--sc-duration) var(--sc-ease), box-shadow var(--sc-duration) var(--sc-ease); }
.related-card:hover { transform: translateY(-3px); box-shadow: var(--sc-shadow-md); }
.related-thumb { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: var(--sc-gray-100); }
.related-body { padding: var(--sc-space-4); }
.related-title { font-family: var(--sc-font-heading); font-weight: var(--sc-weight-semibold); line-height: 1.35; color: var(--sc-heading); text-decoration: none; }
.related-title:hover { color: var(--sc-primary); }
