/* ============================================================================
   ProFaber — blog

   site.css ning davomi: shu yerdagi qoidalar faqat blog sahifalarida
   ulanadi. O‘zgaruvchilar (--line, --white, --paper, --steel, --accent),
   `.shell`, `.band`, `.label`, `.btn` — hammasi site.css dan olinadi,
   bu yerda takrorlanmaydi. Brend motivlari ham o‘sha: 45° kesim (chamfer),
   chizg‘ich qirrasi va to‘q sariq urg‘u.
   ========================================================================== */

/* ============================================================================
   1. Ro‘yxat sahifasi
   ========================================================================== */

.blog-h1 {
  font-size: 2.25rem;
  font-weight: 800;
}

.blog-grid {
  display: grid;
  gap: 1.25rem;
  margin-top: 3rem;
  grid-template-columns: 1fr;
}

.post-card { height: 100%; }

.post-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--line);
  background: var(--white);
  transition: border-color .18s, box-shadow .18s;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%);
}
.post-card-link:hover {
  border-color: rgba(36, 41, 47, .3);
  box-shadow: 0 18px 32px -24px rgba(36, 41, 47, .35);
}

.post-cover {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.post-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease-out;
}
.post-card-link:hover .post-cover img { transform: scale(1.03); }

/* Rasm qo‘yilmagan maqola ham to‘rda bir xil balandlikda tursin — bo‘sh joy
   chizg‘ich qirrasi bilan to‘ldiriladi (site.css dagi `.ruler` motivi). */
.post-cover-blank {
  background-color: var(--paper);
  background-image:
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 60px),
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 12px);
  background-size: 100% 18px, 100% 9px;
  background-position: left bottom;
  background-repeat: no-repeat;
}

.post-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.5rem;
}

.post-date {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--steel);
}

.post-title {
  margin-top: .625rem;
  font-family: var(--heading);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.post-card-link:hover .post-title { color: var(--accent); }

/* Qisqa matn uzunligi har xil bo‘lsa ham kartochkalar bir xil ko‘rinsin. */
.post-excerpt {
  margin-top: .625rem;
  font-size: .9375rem;
  line-height: 1.7;
  color: var(--steel);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-more {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  margin-top: auto;
  padding-top: 1.25rem;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--accent);
}
.post-more svg { width: 1rem; height: 1rem; transition: transform .18s; }
.post-card-link:hover .post-more svg { transform: translateX(3px); }

/* --- sahifalash ----------------------------------------------------------- */

.blog-pager {
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.blog-pager-now {
  font-size: .875rem;
  font-weight: 600;
  color: var(--steel);
}
/* Chekka sahifada tugma o‘rnida sust matn turadi — qator sakramaydi. */
.blog-pager-off {
  font-size: .875rem;
  color: rgba(76, 84, 94, .45);
}

.blog-empty {
  margin-top: 3rem;
  padding: 3rem 1.5rem;
  border: 1px dashed rgba(76, 84, 94, .4);
  background: var(--white);
  text-align: center;
  font-size: .9375rem;
  color: var(--steel);
}

/* ============================================================================
   2. Maqola sahifasi
   ========================================================================== */

/* Uzun matn uchun o‘qish kengligi cheklanadi — qator 75 belgidan oshmasin. */
.post {
  max-width: 44rem;
  margin: 0 auto;
}

.post-back {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  font-size: .875rem;
  font-weight: 600;
  color: var(--steel);
  transition: color .18s;
}
.post-back svg { width: 1rem; height: 1rem; }
.post-back:hover { color: var(--accent); }

.post-head { margin-top: 1.75rem; }
.post-head h1 {
  margin-top: .75rem;
  font-size: 2rem;
  font-weight: 800;
}
.post-lede {
  margin-top: 1.25rem;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--steel);
}

.post-hero {
  margin: 2.5rem 0 0;
  border: 1px solid var(--line);
  background: var(--white);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%);
}
.post-hero img { display: block; width: 100%; height: auto; }

/* --- matn ---------------------------------------------------------------- */
/* Admin yozgan oddiy HTML shu yerda chiqadi, shuning uchun site.css da nolga
   tushirilgan `p`, `ul`, `li` oraliqlari faqat shu blok ichida tiklanadi. */

.post-body {
  margin-top: 2.5rem;
  font-size: 1.0625rem;
  line-height: 1.8;
}
.post-body > :first-child { margin-top: 0; }

.post-body p { margin: 0 0 1.25rem; }

.post-body h2 {
  margin: 2.5rem 0 .875rem;
  font-size: 1.5rem;
  font-weight: 700;
}
.post-body h3 {
  margin: 2rem 0 .75rem;
  font-size: 1.1875rem;
  font-weight: 700;
}

.post-body ul, .post-body ol {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
  list-style: disc;
}
.post-body ol { list-style: decimal; }
.post-body li { margin-bottom: .5rem; }
.post-body li::marker { color: var(--accent); }

.post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.post-body a:hover { color: var(--ink); }

.post-body strong { font-weight: 700; }

.post-body img {
  display: block;
  width: 100%;
  height: auto;
  margin: 2rem 0;
  border: 1px solid var(--line);
}

.post-body blockquote {
  margin: 2rem 0;
  padding: .25rem 0 .25rem 1.25rem;
  border-left: 2px solid var(--accent);
  color: var(--steel);
}

.post-body table {
  width: 100%;
  margin: 0 0 1.5rem;
  border-collapse: collapse;
  font-size: .9375rem;
}
.post-body th, .post-body td {
  padding: .625rem .875rem;
  border: 1px solid var(--line);
  text-align: left;
}
.post-body th { background: var(--white); font-weight: 600; }

/* Kod bloki sahifani kengaytirib yubormasin — o‘zi ichida siljiydi. */
.post-body pre {
  margin: 0 0 1.5rem;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--white);
  font-size: .875rem;
  line-height: 1.6;
}
.post-body pre code { background: none; padding: 0; }

.post-body hr {
  margin: 2.5rem 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.post-foot {
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}

/* ============================================================================
   3. Kengroq ekranlar
   ========================================================================== */

@media (min-width: 640px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
  .blog-h1 { font-size: 3rem; }
  .post-head h1 { font-size: 2.75rem; }
}

@media (min-width: 1024px) {
  .blog-grid { grid-template-columns: repeat(3, 1fr); }
}
