/* ─── Reset & Base ─────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: #1a1a1a;
  background: #FFF;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1 { margin-bottom: 20px; }

/* ─── Акцентный цвет ─────────────────────────── */
:root {
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
}

/* ─── Header ─────────────────────────────────── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-logo {
  font-weight: 700;
  font-size: 18px;
  color: #1a1a1a;
  margin: 0 auto;
}

.back-link {
  font-size: 14px;
  color: #666;
}

.back-link:hover { color: #1a1a1a; }

.site-nav {
  display: flex;
  gap: 24px;
}

.nav-link {
  font-size: 15px;
  color: #555;
  transition: color 0.2s;
}

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

.nav-toggle { display: none; }

/* ─── Layout ────────────────────────────────── */
.site-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 20px 30px;
}

.site-main--wide {
  max-width: 960px;
}

.site-main--full {
  max-width: 1080px;
}

.site-footer {
  text-align: center;
  padding: 32px;
  color: #999;
  font-size: 14px;
  border-top: 1px solid #eee;
}

/* ─── Hero ───────────────────────────────────── */
.hero {
  max-width: 720px;
  margin: 60px auto 80px;
  padding: 0 24px;
  text-align: center;
}

.hero__title {
  font-size: 2em;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
}

.hero__sub {
  font-size: 18px;
  color: #666;
  margin-bottom: 32px;
}

.btn-primary {
  display: inline-block;
  padding: 12px 28px;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  transition: background 0.2s;
}

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

/* ─── Home sections ──────────────────────────── */
.home-section {
  max-width: 960px;
  margin: 0 auto 60px;
  padding: 0 24px;
}

.home-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
}

.home-section__head h2 {
  font-size: 22px;
  font-weight: 700;
}

.link-more {
  font-size: 14px;
  color: var(--accent);
}

.link-more:hover { text-decoration: underline; }

/* ─── Post grid on home ──────────────────────── */
.post-list--grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* ─── Projects ───────────────────────────────── */
.projects-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.project-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(37,99,235,0.08);
}

.project-card__icon { font-size: 28px; }

.project-card__body { flex: 1; }

.project-card__title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.project-card__desc {
  font-size: 13px;
  color: #888;
}

.project-card__arrow {
  margin-left: auto;
  color: #ccc;
  font-size: 18px;
}

/* ─── Post list ─────────────────────────────── */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.post-body .post-list {margin-left: 24px;}

.post-card {
  display: grid;
  gap: 12px;
}

.post-card--article {
  border-radius: 4px;
  border: 1px solid #DDD;
  background: #fff;
}

.post-card__body {
  margin: 0px 10px 6px 10px;
}

.post-card__cover img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 4px;
}

.post-card__title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
}

.post-card__title a:hover { opacity: 0.7; }

.post-card__excerpt {
  color: #555;
  font-size: 15px;
}

.post-card__date {
  font-size: 13px;
  color: #999;
}

/* ─── Post type badge ───────────────────────── */
.post-type {
  display: inline-block;
  font-size: 12px;
  font-weight: lighter;
  /* font-weight: 600;
  padding: 1px 4px;
  border-radius: 4px;
  background: #4CAF50;
  color: #FFF;*/
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ─── Single post ───────────────────────────── */
.post-cover img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 32px;
}

.post-header { margin-bottom: 32px; }

.post-title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 12px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #999;
  font-size: 14px;
}

/* ─── Post body blocks ──────────────────────── */
.post-body { max-width: 100%; }

.post-heading {
  margin: 32px 0 12px;
  font-weight: 700;
  line-height: 1.3;
}

h2.post-heading { font-size: 26px; }
h3.post-heading { font-size: 21px; }
h4.post-heading { font-size: 18px; }

.post-paragraph {
  margin-bottom: 16px;
  color: #222;
}

.post-image { margin: 24px 0; }

.post-image img {
  width: 100%;
  border-radius: 10px;
}

.post-image figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: #999;
  text-align: center;
}

.post-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin: 24px 0;
}

.post-gallery__item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  transition: opacity 0.2s;
}

.post-gallery__item:hover img { opacity: 0.85; }

.post-quote {
  margin: 24px 0;
  padding: 16px 24px;
  border-left: 4px solid #1a1a1a;
  background: #f9f9f9;
  border-radius: 0 8px 8px 0;
}

.post-quote p { font-style: italic; font-size: 18px; }
.post-quote cite { display: block; margin-top: 8px; font-size: 14px; color: #999; }

.post-code {
  background: #f4f4f4;
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  font-size: 14px;
  margin: 20px 0;
}

.post-delimiter {
  border: none;
  border-top: 2px solid #eee;
  margin: 32px 0;
}

.post-warning {
  background: #fff8e6;
  border: 1px solid #ffd97d;
  border-radius: 8px;
  padding: 16px;
  margin: 20px 0;
}

.post-warning strong { display: block; margin-bottom: 6px; }

/* ─── Tags ──────────────────────────────────── */
.post-tags {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 4px 12px;
  background: #f0f0f0;
  border-radius: 20px;
  font-size: 13px;
  color: #555;
  transition: background 0.2s;
}

.tag:hover { background: #e0e0e0; }

.tag-filter-title {
  font-size: 1.2em;
  font-weight: 600;
}

/* ─── Post edit ─────────────────────────────── */
.post-edit-bar {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.btn-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #f0f0f0;
  border-radius: 8px;
  font-size: 14px;
  color: #333;
  transition: background 0.2s;
}

.btn-edit:hover { background: #e0e0e0; }

.btn-delete {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #fff0f0;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  color: #cc3333;
  cursor: pointer;
  margin-left: 8px;
  transition: background 0.2s;
}

.btn-delete:hover { background: #ffd9d9; }

/* ─── Заметки ───────────────────────────────── */
.post-card--note {
  padding: 8px 8px 8px 16px;
  border-left: 4px solid #4CAF50;
  border-right: 1px solid #4CAF50;
  border-top: 1px solid #4CAF50;
  border-bottom: 1px solid #4CAF50;
  background: #fff;
}

.post-card--note .post-card__cover { display: none; }

.post-card--note .post-card__title a {
  font-size: 18px;
  font-weight: 600;
}

.post--note .post-cover { display: none; }
.post--note .post-title { font-size: 24px; }
.post--note .post-body { color: #333; }

/* ─── Pagination ─────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 40px;
  list-style: none;
  padding: 0;
}

.pagination .page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 14px;
  color: #333;
  background: #f0f0f0;
  transition: background 0.2s;
}

.pagination .page-item a.page-link:hover { background: #e0e0e0; }

.pagination .page-item.active .page-link {
  background: #1a1a1a;
  color: #fff;
}

.pagination .page-item.disabled .page-link {
  color: #aaa;
  cursor: default;
}

/* ─── Mobile ────────────────────────────────── */
@media (max-width: 600px) {
  .post-title { font-size: 26px; }
  .site-main { padding: 10px 8px 20px; }
  .post-gallery { grid-template-columns: repeat(2, 1fr); }
  .hero__title { font-size: 28px; }
  .post-list--grid { grid-template-columns: 1fr; }

  .site-nav {
    display: none;
    position: absolute;
    top: 57px;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: 16px 24px;
    border-bottom: 1px solid #eee;
    gap: 16px;
  }

  .site-nav.open { display: flex; }
  .nav-toggle {
	display: block;
	background: none;
	border: none;
	font-size: 20px;
	font-weight: bold;
	cursor: pointer; 
  }
}

/* ─── About ──────────────────────────────────── */
.about-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 17px;
  line-height: 1.7;
  color: #333;
}

@media (max-width: 600px) {
  .about-card { padding: 20px 16px; }
}