/* Личный блог. Цвета, шрифты и скругления — только из tokens.css (общий файл трёх шаблонов). */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
}

.muted {
  color: var(--muted);
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--shell-pad);
}

/* Колонка для чтения: всё содержимое блога стоит в ней */
.measure,
main > .section,
main > .intro {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

/* Главная и «Ещё записи» — по ширине шапки; текст вступления остаётся колонкой для чтения */
.type-home main > .section,
.type-home main > .intro,
main > .more-posts {
  max-width: none;
}

.intro-home .lead,
.intro-home .measure {
  max-width: 720px;
  margin-left: 0;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 100;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

/* Шапка */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  min-height: 64px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand {
  color: var(--ink);
  font-weight: 700;
  font-size: 19px;
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

.nav a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 6px;
}

/* Главная */
.intro {
  padding: 64px 0 8px;
}

.intro-photo {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin-bottom: 24px;
  background: var(--paper-2);
}

.intro h1,
.post-head h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.intro-small {
  padding-bottom: 0;
}

.intro-small h1 {
  font-size: clamp(26px, 4vw, 34px);
}

.lead {
  margin: 16px 0 0;
  color: var(--ink-2);
  font-size: 21px;
  line-height: 1.5;
}

.intro .content {
  margin-top: 20px;
}

.section {
  padding: 32px 0 48px;
}

.section-title {
  margin: 0 0 8px;
  color: var(--muted-2);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Записи карточками: вся карточка — ссылка, теги кликаются отдельно */
.posts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.post-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 8px 24px rgba(27, 33, 40, .07);
}

.post-title {
  color: var(--ink);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}

.post-title::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.post-card:hover .post-title {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 4px;
}

.post-desc {
  margin: 0;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.55;
}

.post-card .meta {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 6px;
}

/* «Ещё записи»: одна строка из трёх карточек */
.more-posts .post-card:nth-child(n+4) {
  display: none;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.tag {
  color: var(--muted);
  text-decoration: none;
}

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

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.pager a {
  text-decoration: none;
  font-weight: 500;
}

/* Запись */
.post-head {
  padding: 56px 0 8px;
}

.post-head .meta {
  margin-bottom: 16px;
}

.post > .content {
  padding: 24px 0 8px;
}

.post-author {
  padding: 32px 0 0;
}

.content > :first-child {
  margin-top: 0;
}

.content h2 {
  margin: 44px 0 12px;
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.content h3 {
  margin: 32px 0 10px;
  font-size: 22px;
  line-height: 1.3;
}

.content p,
.content ul,
.content ol {
  margin: 0 0 18px;
}

.content li {
  margin: 6px 0;
}

.content img {
  display: block;
  border-radius: var(--radius);
  margin: 28px 0;
}

.content hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 40px 0;
}

.content blockquote {
  margin: 28px 0;
  padding: 2px 0 2px 22px;
  border-left: 3px solid var(--accent);
  color: var(--ink-1);
  font-size: 20px;
}

.content code {
  font-family: var(--font-mono);
  font-size: .86em;
  background: var(--paper-2);
  padding: 2px 6px;
  border-radius: 6px;
}

.content pre {
  overflow-x: auto;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 15px;
}

.content pre code {
  background: none;
  padding: 0;
}

.content table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 16px;
}

.content th,
.content td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

/* Выноски Obsidian */
.callout {
  margin: 24px 0;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.callout-title {
  font-weight: 600;
}

.callout-body {
  margin-top: 6px;
}

.callout-body > :last-child {
  margin-bottom: 0;
}

details.callout summary {
  cursor: pointer;
}

/* Теги */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 0 8px;
}

.tag-cloud .tag {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-1);
  font-size: 15px;
}

.tag-group {
  padding-top: 24px;
  scroll-margin-top: 16px;
}

.tag-group h2 {
  margin: 0;
  font-size: 22px;
}

/* Автор */
.author {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.author-photo {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--paper-2);
}

.author p {
  margin: 0;
}

.author-name {
  font-weight: 600;
}

.author-bio {
  margin-top: 4px !important;
  color: var(--ink-2);
  font-size: 16px;
}

.author-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 8px !important;
  font-size: 15px;
}

/* Подвал */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 32px;
}

.site-footer .author {
  max-width: 720px;
  margin: 0 auto;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  max-width: 720px;
  margin: 24px auto 0;
  font-size: 14px;
}

.footer-bottom a {
  color: var(--ink-1);
}

/* 404 (общая разметка шаблонов) */
.notfound {
  padding-top: 72px;
  padding-bottom: 96px;
}

.notfound .lead {
  margin: 12px 0 28px;
}

.notfound .btn {
  margin-top: 0;
}

.notfound .section-title {
  color: var(--ink);
  font-size: 36px;
  letter-spacing: 0;
  text-transform: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 16px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 500;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

@media (max-width: 640px) {
  :root {
    --shell-pad: 16px;
  }

  body {
    font-size: 17px;
  }

  .intro {
    padding-top: 40px;
  }

  .post-head {
    padding-top: 36px;
  }

  .lead {
    font-size: 19px;
  }

  .post-title {
    font-size: 19px;
  }

  .post-card {
    padding: 20px;
  }

  .content h2 {
    font-size: 24px;
  }

  .author {
    padding: 18px;
  }
}

/* Подписка: адрес ленты и кнопка «Скопировать» */
.feed-box {
  margin: 8px auto 28px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.feed-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.feed-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.feed-url {
  flex: 1 1 260px;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  font: 15px var(--font-mono);
}

.feed-copy {
  margin-top: 0;
  border: 0;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
