/* modules/articles/articles.css */


/* -------- page wrapper / title -------- */

.articles-page{
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.articles-head{
  margin: 0 0 16px;
  padding: 16px 18px;

  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.articles-body{
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.articles-title{
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  position: relative;
  padding-left: 14px;
}

.articles-title::before{
  content:"";
  position:absolute;
  left:0;
  top: .22em;
  bottom: .22em;
  width: 4px;
  border-radius: 999px;
  background: var(--accent);
  opacity: .85;
}

@media (max-width: 520px){
  .articles-page{ padding: 14px; }
  .articles-title{ font-size: 22px; }
}

/* -------- controls -------- */

.articles-controls{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin: 12px 0 18px;
}

.articles-topnav{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.articles-topnav__link{
  display:inline-flex;
  align-items:center;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  text-decoration:none;
  font-weight:700;
  line-height:1;
}

.articles-topnav__link:hover{
  border-color: var(--accent);
}

.articles-topnav__link.is-active{
  background: var(--accent);
  color: var(--accent-contrast, #fff);
  border-color: transparent;
}

.articles-controls__right{
  display:flex;
  align-items:center;
  gap:8px;
  color: var(--text-muted);
  font-weight:700;
}

.perpage-select{
  padding:8px 10px;
  border-radius:12px;
  border:1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
}

/* -------- list -------- */

.articles-list,
.articles-list-wrap{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.article-card{
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 14px 14px 12px;
}

.article-card__meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom: 8px;
}

.article-badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius: 999px;
  border:1px solid var(--border-color);
  background: var(--bg-body);
  color: var(--text-main);
  text-decoration:none;
  font-weight:800;
  font-size: 12px;
}

.article-badge:hover{ border-color: var(--accent); }

.article-date{
  color: var(--text-muted);
  font-size: 12px;
  font-weight:800;
  white-space:nowrap;
}


.article-card h2{
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 900;
}

.article-card h2 a{
  color: var(--text-main);
  text-decoration:none;
}

.article-card h2 a:hover{
  color: var(--accent-hover);
  text-decoration:underline;
}

.article-card__excerpt{
  margin:0;
  color: var(--text-muted);
  line-height:1.5;
}

/* -------- terms (categories/tags) -------- */

.terms-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap:12px;
}

.term-card{
  display:block;
  text-decoration:none;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 14px;
  color: var(--text-main);
}

.term-card:hover{ border-color: var(--accent); }

.term-card__title{
  font-weight:900;
  margin-bottom: 6px;
}

.term-card__meta{
  color: var(--text-muted);
  font-weight:800;
  font-size: 12px;
}

/* -------- article page -------- */

.articles-crumbs{
  display:flex;
  align-items:center;
  gap:8px;
  margin: 2px 0 14px;
  color: var(--text-muted);
}

.articles-crumbs a{
  color: var(--text-muted);
  text-decoration:none;
  font-weight:800;
}

.articles-crumbs a:hover{ color: var(--accent-hover); text-decoration:underline; }
.articles-crumbs .sep{ opacity:.6; }

.article-full{
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 14px;
}

.tags-line{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom: 12px;
}

.article-meta{
  margin: 6px 0 14px;
  font-size: 13px;
  color: var(--text-muted);
}

.tag,
.tag-chip{
  display:inline-flex;
  align-items:center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-body);
  color: var(--text-main);
  text-decoration:none;
  font-weight:800;
  font-size: 12px;
}

.tag:hover,
.tag-chip:hover{ border-color: var(--accent); }

.tags-more{
  border:0;
  padding:0;
  margin:0;
}

.tags-more > summary{
  list-style:none;
  cursor:pointer;
  user-select:none;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px dashed var(--border-color);
  background: var(--bg-body);
  color: var(--text-muted);
  font-weight:900;
  font-size: 12px;
}

.tags-more > summary::-webkit-details-marker{ display:none; }

.tags-more__list{
  margin-top:8px;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.article-content{
  color: var(--text-main);
  line-height: 1.65;
}

/* FIX списков */
.article-content ul,
.article-content ol{
  padding-left: 1.2em;
  margin: 0.5em 0 1em;
  list-style-position: outside;
}
.article-content li{ margin: 0.25em 0; }

.article-content h2{ margin: 14px 0 8px; font-size: 20px; }
.article-content h3{ margin: 10px 0 6px; font-size: 16px; }

.article-content .note,
.article-content .tip{
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}
.article-content .tip{ border-color: var(--accent); }

.article-acc__body ul,
.article-acc__body ol{
  padding-left: 1.2em;
  margin: 0.5em 0 1em;
  list-style-position: inside;
}
.article-acc__body li{ margin: 0.25em 0; }

/* -------- “Подробнее” -------- */

.article-acc{
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px dashed var(--border-color);
  background: var(--bg-body);
}

/* summary как кнопка + стрелка */
.article-acc > summary{
  list-style:none;
  cursor:pointer;
  user-select:none;

  display:flex;
  align-items:center;
  justify-content:space-between;

  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);

  font-weight: 900;
  color: var(--text-main);
}

.article-acc > summary::-webkit-details-marker{ display:none; }

.article-acc > summary::after{
  content: "▾";
  font-size: 14px;
  opacity: .8;
  transition: transform .15s ease;
}

.article-acc[open] > summary::after{
  transform: rotate(180deg);
}

/* “превью” текста, пока не раскрыто */
.article-acc__body{
  margin-top: 10px;
  color: var(--text-main);
  line-height: 1.65;
}

.article-acc:not([open]) .article-acc__body{
  max-height: 70px;      /* можно 30–70 как ты хотел */
  overflow: hidden;
  position: relative;
}

.article-acc:not([open]) .article-acc__body::after{
  content:"";
  position:absolute;
  left:0; right:0; bottom:0;
  height: 44px;
  pointer-events:none;
  background: linear-gradient(to bottom, rgba(0,0,0,0), var(--bg-body));
}

/* -------- empty -------- */

.articles-empty{
  padding:18px;
  border:1px solid var(--border-color);
  border-radius:16px;
  background: var(--bg-body);
  color: var(--text-muted);
  text-align:center;
}
