/* === Tinkoff-Journal vibe: серый фон, белые широкие карточки, большие превью === */
:root{
  --page-bg: #f5f5f7;
  --card-bg: #fff;
  --text:    #111;
  --muted:   #666;
  --link:    #0b63f6;

  --max-wrap: 1400px;   /* ширина общей обёртки */
  --list-wrap: 1200px;  /* ширина ленты на главной */
  --radius: 12px;
  --gap-lg: 32px;       /* расстояние между карточками в ленте */
  --gap-md: 28px;
  --shadow: 0 2px 12px rgba(0,0,0,.06);

  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

/* base */
*{ box-sizing: border-box; }
html,body{ margin:0; padding:0; }
body{
  background: var(--page-bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 18px;
}

a{ color: var(--link); text-decoration: none; }
a:hover{ text-decoration: underline; }

/* container + header */
.container{
  max-width: var(--max-wrap);
  margin: 0 auto;
  padding: 40px 32px;
}
.header{ display:flex; align-items:center; justify-content:space-between; margin-bottom: 24px; }
.site-title{ font-weight: 700; font-size: 22px; }
.nav{ font-size: 14px; color: var(--muted); }

/* ===== Лента на главной ===== */
.list{
  max-width: var(--list-wrap);
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--gap-lg); /* меняешь это — меняется расстояние между постами */
}

/* Карточка поста: белая, широкая, с большим превью, зеркалится по рядам */
.card{
  position: relative;
  display: grid;
  grid-template-columns: 1.6fr 1fr;   /* фото крупнее, текст справа */
  grid-template-areas: "media content";
  gap: var(--gap-md);
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  align-items: start;                  /* верх фото = верх текста */
  width: 100%;
}
.list .card:nth-child(even){
  grid-template-columns: 1fr 1.6fr;
  grid-template-areas: "content media";
}

/* --- Кликабельные области БЕЗ оверлея (чтобы теги оставались кликабельными) --- */
.card-media-link{ display:block; }
.card-content-link{ display:block; text-decoration:none; color:inherit; }
.card-content-link:hover .title{ text-decoration: underline; }

/* Превью */
.card img{
  grid-area: media;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;     /* широкие, не квадратные */
  object-fit: cover;
  border-radius: calc(var(--radius) - 4px);
  margin: 0;
  align-self: start;
}

/* Правая колонка */
.card .meta{
  grid-area: content;
  display: grid;
  grid-template-rows: auto 1fr auto;  /* заголовок / описание / низ */
  min-width: 0;
  align-self: start;
}

/* Типографика */
.card .title{
  margin: 0 0 8px;
  font-size: 32px;
  line-height: 1.2;
  font-weight: 800;
  color: var(--text);
}

.card .excerpt{
  color: var(--muted);
  margin: 6px 0 14px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;   /* 3 строки и обрезка */
  overflow: hidden;
}

/* Низ карточки: теги + дата */
.card .bottom{
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 14px;
  color: var(--muted);
}

/* Теги в карточках — ссылки, НЕ скрываем */
.tags{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.tags .tag{
  background: #e8e8ec;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  color: #505050;
  text-decoration: none;
}
.tags .tag:hover{ text-decoration: underline; }

.read-time{ padding-left: 6px; }

/* Hover — мягкий (журнальный) */
@media (hover:hover){
  .card{
    transition: box-shadow .2s ease, transform .2s ease;
  }
  .card:hover{
    box-shadow: 0 6px 22px rgba(0,0,0,.08);
    transform: translateY(-1px);
  }
}

/* ===== Внутренняя страница поста ===== */
.article-wrap{
  max-width: 1100px;      /* ширина белой карточки */
  margin: 0 auto;
  padding: 16px 0 56px;
}

.article-card{
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  padding: 0 40px 32px;   /* верх = 0, т.к. обложка заполняет верх */
  overflow: hidden;       /* скругление режет и обложку */
}

/* Обложка внутри белой карточки, сверху, на всю ширину */
.article-hero-in{ margin: 0 -40px 16px; line-height: 0; }
.article-cover{
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 0;       /* радиус даёт карточка */
  margin: 0;
}

/* Заголовок/мета */
.article-title{
  font-size: 40px;
  line-height: 1.15;
  font-weight: 800;
  margin: 18px 0 10px;    /* контролируем расстояние под обложкой */
}
.article-meta{
  color: var(--muted);
  font-size: 14px;
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}
.meta-author{ font-weight: 600; color: #555; }
.article-meta .dot{ color:#aaa; }

/* Текстовая колонка внутри карточки */
.post-body{
  max-width: 740px;       /* комфортная ширина набора */
  margin: 0 auto;
  font-size: 18px;
  line-height: 1.7;
}
.post-body p{ margin: 1.2em 0; }

/* Картинки внутри текста (адекватные пропорции по умолчанию) */
.post-body img{
  display:block;
  margin:20px auto;
  max-width:100%;
  height:auto;            /* сохраняем пропорции */
  border-radius: 8px;
}
.post-body figure{ margin:0 auto 24px; text-align:center; }
.post-body figcaption{ font-size:14px; color:#777; margin-top:6px; }

/* ===== Страницы тегов ===== */
.tags-index h1{ margin: 0 0 16px; }
.tags-cloud{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: var(--list-wrap);
  margin: 0 auto;
}
.tag-chip{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
  color: inherit;
  text-decoration: none;
  font-size: 14px;
}
.tag-chip .count{
  color: #777;
  font-size: 12px;
}

/* ===== Адаптив ===== */
@media (max-width: 900px){
  .container{ padding: 24px 16px; }
  .list{ gap: 24px; }                       /* компактнее между постами на мобиле */
  .card,
  .list .card:nth-child(even){
    grid-template-columns: 1fr;
    grid-template-areas:
      "media"
      "content";
    padding: 16px;
  }
  .card img{ aspect-ratio: 16/9; }
  .card .title{ font-size: 24px; }

  .article-card{ padding: 0 18px 20px; border-radius: 12px; }
  .article-hero-in{ margin: 0 -18px 12px; }
  .article-title{ font-size: 28px; }
  .post-body{ max-width: 100%; }
}

/* если нет обложки — карточка становится одно-колоночной */
.card.no-cover{
  grid-template-columns: 1fr;
  grid-template-areas: "content";
}

/* убираем подчеркивание у заголовков и описаний */
.card-content-link {
  text-decoration: none;
  color: inherit;
}
.card-content-link:hover {
  text-decoration: none;
}
.card .title:hover,
.card .excerpt:hover {
  text-decoration: none;
}

/* обновлённый стиль тегов */
.tags .tag {
  background: #e8e8ec;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  color: #505050;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease;
  cursor: pointer;
}

.tags .tag:hover {
  background: #dcdce0; /* немного темнее при наведении */
  transform: translateY(-1px); /* лёгкий подскок */
  text-decoration: none; /* убираем подчёркивание */
}

/* Убираем подчёркивание у всего текстового контента карточки */
.card-content-link {
  color: inherit;
  text-decoration: none;
}

.card-content-link:hover,
.card-content-link:focus,
.card-content-link:active {
  text-decoration: none;
}

.card-content-link .title,
.card-content-link .excerpt {
  text-decoration: none;
}

.card-content-link:hover .title,
.card-content-link:hover .excerpt {
  text-decoration: none;
}

/* ====== РЕЗЮМЕ СТИЛЬ ====== */
.section {
  display: grid;
  grid-template-columns: 160px 1fr; /* левая колонка (заголовок) + правая */
  gap: 30px;
  padding: 20px 0;
  font-family: "Arial", "Helvetica Neue", sans-serif;
  color: #222;
}

.section:first-of-type {
  border-top: none;
}

.section .title {
  font-weight: bold;
  font-size: 16px;
  white-space: nowrap;
  color: #000;
}

.section .content {
  border-left: 1px solid #ddd; /* вертикальные линии */
  padding-left: 30px;
  position: relative;
}

.section .note {
  float: right;
  font-style: italic;
  font-size: 14px;
  color: #888;
  margin-top: -4px;
  margin-left: 10px;
}

.section ul {
  list-style-type: disc;
  margin: 0;
  padding-left: 20px;
}

.section li {
  margin-bottom: 6px;
  line-height: 1.6;
}

.section em {
  font-style: italic;
  color: #555;
}


.section a {
  color: inherit;
  text-decoration: none ; /* или underline */
}
.section a:hover {
  text-decoration: underline;
}


/* ====== адаптив под узкий экран ====== */
@media (max-width: 700px) {
  .section {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .section .content {
    border-left: none;
    padding-left: 0;
  }
  .section .note {
    float: none;
    display: block;
    margin: 0 0 8px 0;
    text-align: right;
  }
}

.leftspace {
  line-height: 0.9; 
}

.leftspace a {
  color: inherit;
  text-decoration: none ; /* или underline */
}

.leftspace a:hover {
  text-decoration: underline;
}

.site-about {
  font-weight: 600; 
  font-size: 22px; 
  color: #111;
  text-decoration: none ; /* или underline */
}

.site-about:hover {
  text-decoration: none;
} 