/* === 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 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;
  transition: background 0.15s ease, transform 0.1s ease;
  cursor: pointer;
}
.tags .tag:hover{
  background: #dcdce0;
  transform: translateY(-1px);
  text-decoration: none;
}

.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";
}

/* Убираем подчёркивание у ВСЕГО кликабельного текста карточки (и заголовок, и excerpt) */
.card-content-link,
.card-content-link:hover,
.card-content-link:focus,
.card-content-link:active{
  text-decoration: none;
  color: inherit;
}
.card-content-link .title,
.card-content-link .excerpt,
.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; }
.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; }
.leftspace a:hover { text-decoration: underline; }

.site-about {
  font-weight: 600;
  font-size: 22px;
  color: #111;
  text-decoration: none;
}
.site-about:hover { text-decoration: none; }

/* ===== Спойлер ===== */
.spoiler {
  background: #f6f6f6;
  border-radius: 14px;
  padding: 18px 20px;
  margin: 20px 0;
  border: 1px solid #e8e8e8;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.spoiler:hover { background: #f1f1f1; border-color: #dedede; }

.spoiler summary {
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.spoiler summary:hover { color: #000; }

.spoiler summary::before {
  content: "▶";
  font-size: 14px;
  transition: transform 0.2s ease, opacity 0.2s ease;
  opacity: 0.6;
}
.spoiler:hover summary::before { opacity: 1; }
.spoiler[open] summary::before { transform: rotate(90deg); }

.spoiler-body { margin-top: 12px; line-height: 1.55; }
.spoiler summary::-webkit-details-marker { display: none; }

/* ==========================================================
   КАРТИНКИ В РЯД: 2/3/4 в ряд + общая подпись ИЛИ подписи под каждой
   (убрал дубли .images-row, и убрал aspect-ratio, который ломал вертикалки)
   ========================================================== */

/* Вариант А: одна общая подпись на весь ряд */
.images-group{
  margin: 16px 0 8px;
  text-align: center;
}

/* Сетка по умолчанию: 2 в ряд */
.images-row{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0; /* важно: не добавляем лишний отступ между картинками и подписью */
}

/* Модификаторы: 3/4 в ряд */
.images-row.cols-3{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
.images-row.cols-4{ grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Картинки в рядах: без жёсткого aspect-ratio => вертикалки останутся вертикалками */
.images-row img{
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;

}

/* Общая подпись под рядом */
.images-group > figcaption{
  margin-top: 8px;
  font-size: 14px;
  color: #777;
}

/* Вариант Б: подпись под каждой картинкой */
.images-row.has-captions{
  /* тот же grid, но внутри figure */
}
.images-row.has-captions figure{
  margin: 0;
}
.images-row.has-captions img{
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
}
.images-row.has-captions figcaption{
  margin-top: 6px;
  font-size: 14px;
  color: #777;
  text-align: center;
}

/* Мобилка: в столбик */
@media (max-width: 640px) {
  .images-row,
  .images-row.cols-3,
  .images-row.cols-4{
    grid-template-columns: 1fr;
  }
}

/* (Если тебе нужен отдельный "красивый" grid, оставляю класс, но БЕЗ обрезки вертикалок) */
.images-grid{
  display:grid;
  gap:16px;
  grid-template-columns:repeat(3, minmax(0, 1fr));
}
.images-grid img{
  width:100%;
  height:auto;
  border-radius:16px;
  display:block;
}
@media (max-width: 640px){
  .images-grid{ grid-template-columns: 1fr; }
}


audio {
  width: 100%;
  margin: 16px 0;
}

.track{
  background:#fff;
  border:1px solid #eee;
  border-radius:16px;
  padding:12px 12px 10px;
  margin:18px 0;
  box-shadow:0 8px 22px rgba(0,0,0,.05);
}

.track-title{
  font-weight:700;
  font-size:14px;
  line-height:1.2;
  margin:0 0 8px;
}

.track audio{
  width:100%;
  display:block;
}

/* Цитаты внутри постов */
.post-body blockquote {
  margin: 16px 0;
  padding: 14px 16px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-left: 4px solid #cbd5e1;
  border-radius: 12px;
  color: #111827;
}



/* Убираем лишние отступы у текста внутри цитаты */
.post-body blockquote > :first-child { margin-top: 0; }
.post-body blockquote > :last-child { margin-bottom: 0; }

/* Если внутри цитаты несколько абзацев */
.post-body blockquote p { margin: 8px 0; }

.post-image {
  max-width: 100%;
  height: auto;
}

.specs p {
  margin: 6px 0;
  line-height: 1.45;
}



.post-body figure.figure-sm { margin: 16px 0; text-align: center; }

.post-body figure.figure-sm img { width: min(400px, 100%); margin: 0 auto; border-radius: 14px; }


/* Картинки кликабельные */
@media (hover: hover) and (pointer: fine){
  .post-body img { cursor: zoom-in; }
}


/* Оверлей */
.img-zoom {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.78);
  z-index: 9999;
  padding: 16px;
}



.img-zoom.open {
  display: flex;
}

.img-zoom img {
  max-width: 96vw;
  max-height: 92vh;
  width: auto;
  height: auto;
  display: block;
  border-radius: 14px;
  cursor: zoom-out;
}

body.zoom-lock {
  overflow: hidden;
}

/* FIX: в зуме всегда показываем целиком, без кропа */
.img-zoom img{
  aspect-ratio: auto !important;
  object-fit: contain !important;
  width: auto !important;
  height: auto !important;
  max-width: 98vw !important;
  max-height: 96vh !important;
}

