/* ==================== Resources List Page ==================== */
.res-hero {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  padding: 80px 0 60px;
  color: #fff;
  text-align: center;
  padding-top: 152px;
}
.res-hero .breadcrumb { justify-content: center; padding-top: 0; margin-bottom: 24px; color: rgba(255,255,255,0.6); }
.res-hero .breadcrumb a { color: var(--color-cyan); }
.res-hero__title { font-family: var(--font-heading); font-size: clamp(32px, 4vw, 48px); font-weight: 800; margin-bottom: 16px; }
.res-hero__subtitle { font-size: 16px; color: #94A3B8; max-width: 600px; margin: 0 auto; }

.res-main { padding: 60px 40px; }

.res-filters {
  display: flex; gap: 12px; margin-bottom: 40px;
  overflow-x: auto; scrollbar-width: none;
  -ms-overflow-style: none; padding-bottom: 8px;
}
.res-filters::-webkit-scrollbar { display: none; }

.res-filter-btn {
  padding: 8px 20px; border-radius: 24px;
  background: #F1F5F9; color: #475569;
  font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: all var(--transition-base);
}
.res-filter-btn:hover { background: #E2E8F0; color: #0F172A; }
.res-filter-btn.active { background: var(--color-cyan); color: #000; font-weight: 600; }

.res-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px;
}

.res-card {
  background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
/* JS Load More Logic - Hide cards beyond the first 6 initially */
.res-card:nth-child(n+7):not(.show) { display: none; }

.res-card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(0,0,0,0.1); }
.res-card__link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.res-card__cover { background: #f0f0f0; width: 100%; aspect-ratio: 40/21; overflow: hidden; }
.res-card__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.res-card:hover .res-card__cover img { transform: scale(1.05); }

.res-card__body { padding: 24px; display: flex; flex-direction: column; flex-grow: 1; }
.res-card__meta { font-size: 13px; color: var(--color-gray); margin-bottom: 12px; }
.res-card__title { font-size: 18px; font-weight: 700; color: #111827; margin-bottom: 12px; line-height: 1.4; }
.res-card__excerpt { font-size: 14px; color: #4B5563; line-height: 1.6; margin-bottom: 20px; flex-grow: 1; }
.res-card__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.res-card__tag { background: #F1F5F9; color: #475569; font-size: 12px; padding: 4px 10px; border-radius: 4px; }

.res-actions { text-align: center; margin-top: 48px; }
.res-load-more {
  padding: 12px 32px; border-radius: 8px; border: 1px solid #CBD5E1;
  background: transparent; color: #334155; font-weight: 600;
  transition: all var(--transition-base); display: inline-block;
}
.res-load-more:hover { background: #F8FAFC; border-color: #94A3B8; }
.res-empty { text-align: center; padding: 40px; color: var(--color-gray); }

/* Pagination */
.res-pagination {
  display: flex; justify-content: center; align-items: center;
  gap: 20px; margin-top: 48px; font-size: 14px; color: #475569;
}
.res-pagination a {
  color: var(--color-cyan); font-weight: 600;
  transition: color var(--transition-base);
}
.res-pagination a:hover { text-decoration: underline; }

/* ==================== Article Detail Page ==================== */
.article-page { background: #fff; padding-bottom: 80px; padding-top: 72px; }
.article-container { max-width: 1200px; padding: 0 40px; }
.article-page .breadcrumb { padding-top: 40px; }

.article-header { padding: 20px 0; text-align: center; max-width: 800px; margin: 0 auto; }
.article-header__meta { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 20px; font-size: 14px; color: var(--color-gray); flex-wrap: wrap; }
.article-header__tags { display: flex; gap: 8px; flex-wrap: wrap; }
.article-header__title { font-family: var(--font-heading); font-size: clamp(28px, 4vw, 44px); font-weight: 800; color: #111827; line-height: 1.2; margin-bottom: 40px; }
.article-header__cover { border-radius: 16px; overflow: hidden; margin-bottom: 40px; box-shadow: 0 20px 40px rgba(0,0,0,0.08); }
.article-header__cover img { width: 100%; height: auto; display: block; aspect-ratio: 16/9; object-fit: cover; }

.article-layout { display: grid; grid-template-columns: 1fr 300px; gap: 60px; max-width: 1100px; margin: 0 auto; }
.article-main { min-width: 0; }
.article-summary { background: #F8FAFC; border-left: 4px solid var(--color-cyan); padding: 20px 24px; border-radius: 0 8px 8px 0; margin-bottom: 40px; font-size: 16px; color: #334155; line-height: 1.7; }

/* Markdown Body Reset */
.markdown-body { font-size: 16px; line-height: 1.8; color: #374151; }
.markdown-body h2 { font-size: 24px; font-weight: 700; color: #111827; margin: 48px 0 24px; }
.markdown-body h3 { font-size: 20px; font-weight: 600; margin: 32px 0 16px; color: #111827; }
.markdown-body p { margin-bottom: 24px; }
.markdown-body img { border-radius: 8px; margin: 32px 0; max-width: 100%; }
.markdown-body ul, .markdown-body ol { margin-bottom: 24px; padding-left: 24px; }
.markdown-body li { margin-bottom: 8px; }
.markdown-body a { color: var(--color-cyan); text-decoration: underline; }
.markdown-body pre { background: #1E293B; border-radius: 8px; padding: 20px; overflow-x: auto; margin: 24px 0; }
.markdown-body code { font-size: 14px; }

.article-related-products { margin-top: 60px; padding-top: 40px; border-top: 1px solid #E2E8F0; }
.article-related-products h2 { font-size: 22px; font-weight: 700; color: #111827; margin-bottom: 20px; }
.related-products__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.product-card-sm { display: block; padding: 20px; border: 1px solid #E2E8F0; border-radius: 8px; background: #F8FAFC; transition: all 0.3s; text-decoration: none; }
.product-card-sm:hover { border-color: var(--color-cyan); background: #fff; box-shadow: 0 4px 12px rgba(0,229,255,0.1); }
.product-card-sm h3 { font-size: 16px; color: #111827; margin-bottom: 8px; }
.product-card-sm span { font-size: 13px; color: var(--color-cyan); font-weight: 600; }

/* Disabled product card (non-clickable) */
.product-card-sm--disabled {
  cursor: default;
  opacity: 0.7;
  background: #F1F5F9;
}
.product-card-sm--disabled:hover {
  border-color: #E2E8E0;
  background: #F1F5F9;
  box-shadow: none;
}
.product-card-sm--disabled span {
  display: none;
}

.article-sidebar { position: sticky; top: 100px; align-self: start; }
.sidebar-widget { background: #F8FAFC; padding: 24px; border-radius: 12px; }
.sidebar-widget h3 { font-size: 16px; font-weight: 700; color: #111827; margin-bottom: 16px; }

.article-nav { display: flex; justify-content: space-between; margin-top: 60px; padding-top: 40px; border-top: 1px solid #E2E8F0; max-width: 1100px; margin-inline: auto; }
.article-nav__link { display: flex; flex-direction: column; width: 45%; transition: color 0.3s; text-decoration: none; }
.article-nav__link--next { text-align: right; }
.article-nav__link small { font-size: 13px; color: var(--color-gray); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.05em; }
.article-nav__link span { font-size: 16px; font-weight: 600; color: #111827; }
.article-nav__link:hover span { color: var(--color-cyan); }

@media (max-width: 1024px) {
  .res-grid { grid-template-columns: repeat(2, 1fr); }
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { display: none; }
  .res-main { padding: 60px 24px; }
  .article-container { padding: 0 24px; }
}
@media (max-width: 640px) {
  .res-grid { grid-template-columns: 1fr; }
  .article-nav { flex-direction: column; gap: 24px; }
  .article-nav__link { width: 100%; text-align: left; }
  .res-main { padding: 40px 16px; }
  .article-container { padding: 0 16px; }
}
