/* ===== Articles Hub — Professional Blog Layout ===== */
:root {
  --article-bg: #f5f7fb;
  --article-surface: #ffffff;
  --article-accent: #1d9a8a;
  --article-accent-hover: #17867a;
  --article-accent-alt: #6a60f0;
  --article-text: #15212e;
  --article-muted: #5b6875;
  --article-border: rgba(16, 49, 73, 0.08);
  --article-radius: 16px;
  --article-radius-sm: 12px;
  --article-shadow: 0 2px 12px rgba(20, 63, 73, 0.08);
  --article-shadow-hover: 0 8px 30px rgba(20, 63, 73, 0.14);
}

/* ===== Shell ===== */
.articles-shell {
  background: var(--article-bg);
  padding: 100px 0 80px;
  min-height: 100vh;
}

/* ===== Page Header ===== */
.articles-page-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.articles-page-header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--article-text);
  letter-spacing: -0.02em;
}

.articles-page-header p {
  margin: 0;
  color: var(--article-muted);
  font-size: 1.05rem;
  max-width: 520px;
  margin-inline: auto;
  line-height: 1.6;
}

/* ===== Hero (Latest Article Feature) ===== */
.articles-hero {
  position: relative;
  background: var(--article-surface);
  border-radius: var(--article-radius);
  overflow: hidden;
  box-shadow: var(--article-shadow);
  border: 1px solid var(--article-border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 320px;
  margin-bottom: 1rem;
}

.articles-hero__media {
  position: relative;
  min-height: 280px;
  overflow: hidden;
}

.articles-hero__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 400ms ease;
}

.articles-hero:hover .articles-hero__media img {
  transform: scale(1.03);
}

.articles-hero__body {
  padding: clamp(1.5rem, 3vw, 2.5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.9rem;
}

.articles-hero__label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--article-accent);
  background: rgba(29, 154, 138, 0.1);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  width: fit-content;
}

.articles-hero__body h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  font-weight: 700;
  color: var(--article-text);
  line-height: 1.3;
}

.articles-hero__meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--article-muted);
}

.articles-hero__meta i {
  margin-right: 0.25rem;
}

.articles-hero__body > p {
  margin: 0;
  line-height: 1.65;
  color: var(--article-muted);
  font-size: 0.95rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.articles-hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--article-accent);
  color: #fff;
  padding: 0.65rem 1.3rem;
  border-radius: var(--article-radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 200ms ease, transform 200ms ease;
  width: fit-content;
}

.articles-hero__cta:hover {
  background: var(--article-accent-hover);
  color: #fff;
  transform: translateY(-1px);
}

/* Hero empty state */
.articles-hero--empty {
  grid-template-columns: 1fr;
  text-align: center;
  min-height: 200px;
}

.articles-hero--empty .articles-hero__body {
  align-items: center;
  padding: 3rem 2rem;
}

.articles-hero--empty .articles-hero__empty-icon {
  font-size: 2.5rem;
  color: var(--article-accent);
  opacity: 0.5;
  margin-bottom: 0.25rem;
}

.articles-hero--empty h1 {
  font-size: 1.5rem;
  color: var(--article-text);
}

.articles-hero--empty p {
  max-width: 420px;
  color: var(--article-muted);
}

/* ===== Section Headers ===== */
.articles-section {
  margin-top: 2.5rem;
}

.articles-section__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.articles-section__header h2 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--article-text);
}

.articles-section__controls {
  display: inline-flex;
  gap: 0.4rem;
}

.articles-section__controls button {
  border: 1px solid var(--article-border);
  background: var(--article-surface);
  color: var(--article-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 180ms ease;
}

.articles-section__controls button:not(:disabled):hover {
  background: var(--article-accent);
  color: #fff;
  border-color: var(--article-accent);
}

.articles-section__controls button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ===== Article Card Grid ===== */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* ===== Article Card ===== */
.article-card {
  background: var(--article-surface);
  border-radius: var(--article-radius);
  border: 1px solid var(--article-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--article-shadow);
  transition: transform 250ms ease, box-shadow 250ms ease;
  text-decoration: none;
  color: inherit;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--article-shadow-hover);
}

/* Card image */
.article-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, #e8f5f3, #e8e6ff);
}

.article-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 350ms ease;
}

.article-card:hover .article-card__media img {
  transform: scale(1.04);
}

.article-card__badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--article-accent);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.article-card__badge.article-card__badge--members {
  left: auto;
  right: 0.75rem;
  color: var(--article-accent-alt);
  background: rgba(255, 255, 255, 0.92);
}

.articles-hero__label--members {
  background: rgba(106, 96, 240, 0.1);
  color: var(--article-accent-alt);
}

.article-card__read-time {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

/* Card body */
.article-card__body {
  padding: 1.15rem 1.25rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.article-card__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--article-muted);
}

.article-card__meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.article-card__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--article-text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card__excerpt {
  margin: 0;
  color: var(--article-muted);
  line-height: 1.55;
  font-size: 0.88rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* Card footer */
.article-card__footer {
  padding: 0.75rem 1.25rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--article-border);
}

.article-card__author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--article-muted);
}

.article-card__author img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}

.article-card__author span {
  font-weight: 600;
  color: var(--article-text);
}

.article-card__footer a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--article-accent);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: gap 200ms ease;
}

.article-card__footer a:hover {
  gap: 0.5rem;
}

/* ===== Empty State ===== */
.articles-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  grid-column: 1 / -1;
}

.articles-empty__icon {
  font-size: 2.5rem;
  color: var(--article-accent);
  opacity: 0.4;
  margin-bottom: 1rem;
}

.articles-empty p {
  color: var(--article-muted);
  max-width: 380px;
  margin-inline: auto;
  line-height: 1.6;
  font-size: 0.95rem;
}

/* ===== Responsive ===== */
@media (max-width: 991.98px) {
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767.98px) {
  .articles-shell {
    padding: 90px 0 60px;
  }

  .articles-hero {
    grid-template-columns: 1fr;
  }

  .articles-hero__media {
    min-height: 200px;
    aspect-ratio: 16 / 9;
  }

  .articles-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .article-card__media {
    aspect-ratio: 16 / 9;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
