/* ===== LangExchange — страница статей ===== */

:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #eff6ff;
  --green: #10b981;
  --ink: #111827;
  --muted: #4b5563;
  --line: #e5e7eb;
  --soft: #f9fafb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--soft);
  color: var(--ink);
}

/* ============================================================
   ШАПКА
   ============================================================ */

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  padding: 0 80px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.frame {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.logo-letter {
  width: 32px;
  height: 32px;
  background: var(--blue);
  color: #fff;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
  flex-shrink: 0;
}

.text-wrapper {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.navbar {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 76px;
}

.navbar .div {
  display: inline-flex;
  align-items: center;
  height: 76px;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  box-sizing: border-box;
  white-space: nowrap;
  transition: color .15s;
}
.navbar .div:hover { color: var(--blue); }
.navbar .div.is-active {
  color: var(--blue);
  font-weight: 600;
  border-bottom-color: var(--blue);
}

.frame-2 {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.text-wrapper-2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.text-wrapper-2:hover { color: var(--blue); }

/* ============================================================
   КОНТЕНТ
   ============================================================ */

.articles-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.articles-page h1 {
  margin: 0;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--ink);
}

.articles-page .subtitle {
  margin: 0 0 16px;
  font-size: 16px;
  color: var(--muted);
  line-height: 1.5;
}

#articles-status {
  margin: 0;
  padding: 20px 0;
  text-align: center;
  font-size: 15px;
  color: var(--muted);
}

/* ---------- Сетка статей ---------- */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 8px;
}

/* ---------- Карточка ---------- */
.article-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 180px;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,.03);
  text-decoration: none;
  color: inherit;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.article-card:hover {
  border-color: var(--blue);
  box-shadow: 0 12px 28px rgba(37,99,235,.1);
  transform: translateY(-2px);
}

.article-card .article-top,
.article-card .article-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.article-card .article-tag {
  display: inline-flex;
  padding: 4px 10px;
  background: var(--blue-soft);
  color: var(--blue);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.article-card .article-topic {
  display: inline-flex;
  padding: 4px 10px;
  background: var(--soft);
  color: var(--muted);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
}

.article-card .article-date {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
}

.article-card h3,
.article-card .article-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.article-card p,
.article-card .article-desc {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
}

.article-card .article-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

/* Заглушка */
.articles-grid .state-box,
.articles-grid .empty {
  grid-column: 1 / -1;
  padding: 48px;
  text-align: center;
  font-size: 15px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}

/* ============================================================
   АДАПТИВ
   ============================================================ */

@media (max-width: 1100px) {
  .header-container { padding: 0 40px; }
  .articles-page { padding: 40px 24px 64px; }
  .articles-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  /* Шапка — в 2 строки */
  .header-container {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 16px 0 16px;
    gap: 0;
  }

  .frame { order: 1; flex: 1 1 auto; min-width: 0; gap: 8px; }
  .logo-letter { width: 28px; height: 28px; border-radius: 8px; font-size: 14px; }
  .text-wrapper {
    font-size: 17px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .frame-2 { order: 2; flex: 0 0 auto; }
  .text-wrapper-2 { font-size: 13px; }

  .navbar {
    order: 3;
    display: flex;
    flex-basis: 100%;
    width: 100%;
    height: 44px;
    gap: 6px;
    margin: 10px -16px 0 -16px;
    padding: 8px 32px 8px 16px;
    overflow-x: auto;
    overflow-y: hidden;
    border-top: 1px solid var(--line);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    align-items: center;
  }
  .navbar::-webkit-scrollbar { display: none; }
  .navbar .div {
    flex: 0 0 auto;
    height: 32px;
    padding: 0 14px;
    font-size: 14px;
    border-radius: 100px;
    border-bottom: 0;
    background: #fff;
    border: 1px solid var(--line);
  }
  .navbar .div.is-active {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
    padding-top: 0;
    font-weight: 600;
  }

  /* Контент */
  .articles-page { padding: 24px 12px 56px; gap: 8px; }
  .articles-page h1 { font-size: 26px; }
  .articles-page .subtitle { font-size: 15px; margin-bottom: 12px; }

  .articles-grid { grid-template-columns: 1fr; gap: 14px; }
  .article-card {
    min-height: 0;
    padding: 18px;
    border-radius: 14px;
    gap: 10px;
  }
  .article-card h3,
  .article-card .article-title { font-size: 17px; }
  .article-card p,
  .article-card .article-desc { font-size: 13px; }
}

@media (max-width: 380px) {
  .articles-page h1 { font-size: 22px; }
  .article-card { padding: 16px; }
}
