/*
 * bipanel blogu: liste kartları, yazı sayfası, içindekiler, SSS ve çağrı kutusu. Yalnızca blog sayfalarında site.css'ten
 * sonra yüklenir; renkler ve ölçüler site.css'teki değişkenlerden gelir (açık ve koyu tema kendiliğinden).
 */

/* ------------------------------------------------------------------ liste */

.blog-head .lead a {
  color: var(--ink);
}
.blog-list {
  padding-block: 56px 88px;
}
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}
.post-card {
  display: grid;
  grid-template-rows: auto 1fr;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.post-card:hover {
  border-color: var(--line-2);
  box-shadow: var(--shadow);
}
.post-card.lead {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  grid-template-rows: none;
}
.post-card-media {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--sunken);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.post-card.lead .post-card-media {
  aspect-ratio: auto;
  min-height: 100%;
  border-bottom: 0;
  border-right: 1px solid var(--line);
}
.post-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.post-ph {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 160px;
  background:
    repeating-linear-gradient(0deg, transparent 0 23px, color-mix(in srgb, var(--line) 70%, transparent) 23px 24px),
    var(--sunken);
}
.post-ph-mark {
  width: 64px;
  height: auto;
  opacity: 0.85;
}
.post-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 22px 22px;
}
.post-card.lead .post-card-body {
  justify-content: center;
  padding: 32px 36px;
}
.post-card h2,
.post-card h3 {
  font-size: 19px;
  line-height: 1.3;
}
.post-card.lead h2 {
  font-size: clamp(24px, 2.6vw, 32px);
}
.post-card h2 a,
.post-card h3 a {
  text-decoration: none;
}
.post-card h2 a:hover,
.post-card h3 a:hover {
  color: var(--ink);
  text-decoration: underline;
}
/* Kartın tamamı tıklanabilir: başlık bağlantısı kartı kaplar */
.post-card {
  position: relative;
}
.post-card h2 a::after,
.post-card h3 a::after {
  content: '';
  position: absolute;
  inset: 0;
}
.post-excerpt {
  color: var(--ink-2);
  font-size: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card.lead .post-excerpt {
  font-size: 16.5px;
  -webkit-line-clamp: 4;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-size: 13px;
  color: var(--ink-3);
}
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}
.post-tags li {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 550;
  background: var(--sunken);
  color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.blog-pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin-top: 44px;
  font-size: 14px;
}
.blog-pager a[rel='next'] {
  justify-self: end;
}

/* ------------------------------------------------------------------ yazı */

.post-head {
  padding-block: 40px 32px;
}
/* Başlık bloğu gövde sütunuyla hizalı (solda içindekiler sütunu varsa onun genişliği kadar içeride) */
.post-headwrap {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 56px;
}
.post-headwrap.no-toc {
  grid-template-columns: minmax(0, 1fr);
}
.post-head-inner {
  grid-column: -2;
  min-width: 0;
  max-width: 820px;
}
.post-preview {
  margin-bottom: 20px;
}
.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  font-size: 13.5px;
  color: var(--ink-3);
}
.crumbs li + li::before {
  content: '/';
  margin-right: 8px;
  color: var(--line-2);
}
.crumbs a {
  color: var(--ink-2);
  text-decoration: none;
}
.crumbs a:hover {
  color: var(--ink);
  text-decoration: underline;
}
.crumbs [aria-current] {
  display: inline-block;
  max-width: 42ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.post-head h1 {
  font-size: clamp(32px, 4.4vw, 50px);
  max-width: 22ch;
}
.post-head .lead {
  margin-top: 16px;
  max-width: 64ch;
  font-size: 18.5px;
  color: var(--ink-2);
}
.post-head .post-meta {
  margin-top: 20px;
  font-size: 14px;
}
.post-head .post-tags {
  margin-top: 14px;
}
/* Kapaklı yazı: görsel başlığın solunda (başlık, özet ve yazı ilk ekranda kalır); mobilde başlığın altında, alçak */
.post-headwrap.has-cover {
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 44px;
  align-items: center;
}
.post-headwrap.has-cover .post-head-inner {
  grid-column: auto;
  max-width: none;
}
.post-headwrap.has-cover h1 {
  font-size: clamp(28px, 3.3vw, 42px);
}
.post-headwrap.has-cover .lead {
  font-size: 17.5px;
}
.post-cover {
  margin: 0;
}
.post-cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  max-height: 340px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--sunken);
}
.post-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  padding-block: 40px 72px;
}
.post-layout.no-toc {
  grid-template-columns: minmax(0, 1fr);
}
.post-main {
  min-width: 0;
  max-width: 760px;
}
.post-toc {
  position: sticky;
  top: 88px;
  font-size: 13.5px;
}
.post-toc .toc-label {
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.post-toc ol {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--line);
}
.post-toc a {
  display: block;
  padding: 5px 0 5px 14px;
  margin-left: -1px;
  border-left: 1px solid transparent;
  color: var(--ink-2);
  text-decoration: none;
  line-height: 1.4;
}
.post-toc a:hover {
  color: var(--ink);
  border-left-color: var(--ink);
}

/* Gövde: site.css .prose üzerine uzun metin ayarları */
.post-body {
  max-width: none;
  font-size: 17px;
  line-height: 1.72;
}
.post-body > :first-child {
  margin-top: 0;
}
.post-body h2 {
  font-size: 26px;
  margin: 48px 0 14px;
  scroll-margin-top: 88px;
}
.post-body h3 {
  font-size: 20px;
  margin: 32px 0 10px;
  scroll-margin-top: 88px;
}
.post-body h4 {
  color: var(--ink);
  font-size: 17px;
  margin: 24px 0 8px;
}
.post-body p,
.post-body ul,
.post-body ol,
.post-body blockquote,
.post-body pre,
.post-body .table-wrap {
  margin: 0 0 18px;
}
.post-body a {
  color: var(--ink);
  text-decoration-color: color-mix(in srgb, var(--green) 70%, transparent);
  text-decoration-thickness: 2px;
}
.post-body a:hover {
  color: var(--green-ink);
}
.post-body img {
  display: block;
  max-width: 100%;
  max-height: min(560px, 70vh);
  width: auto;
  height: auto;
  object-fit: contain;
  margin-inline: auto;
  margin: 8px 0 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.post-body pre {
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
}
.post-body pre code {
  background: none;
  border: 0;
  padding: 0;
  color: var(--ink);
}
.post-body blockquote {
  padding: 4px 0 4px 18px;
  border-left: 3px solid var(--green);
  color: var(--ink);
}
.post-body blockquote p {
  margin: 0;
}
.post-body hr {
  margin: 40px 0;
  border: 0;
  border-top: 1px solid var(--line);
}
.post-body table.t {
  font-size: 15px;
}
.post-body table.t td.r,
.post-body table.t th.r {
  text-align: right;
}

.post-faq {
  margin-top: 56px;
}
.post-faq h2 {
  font-size: 26px;
  margin-bottom: 12px;
}
.post-faq .faq summary {
  font-size: 16.5px;
}

.post-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px 32px;
  align-items: center;
  margin-top: 56px;
  padding: 28px 30px;
  border-radius: var(--radius);
  background: var(--band);
  color: var(--band-ink);
}
@media (prefers-color-scheme: dark) {
  .post-cta {
    border: 1px solid var(--line);
  }
}
.post-cta h2 {
  font-size: 22px;
}
.post-cta p {
  margin-top: 8px;
  color: var(--band-ink-2);
  font-size: 15.5px;
  max-width: 56ch;
}
.post-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.post-cta .btn-primary {
  background: #fafafa;
  color: #0a0a0b;
}
.post-cta .btn-primary:hover {
  background: #e4e4e7;
}
.post-cta .btn-ghost {
  color: #fafafa;
  border-color: #3f3f46;
}
.post-cta .btn-ghost:hover {
  border-color: #fafafa;
}
.post-translation {
  margin-top: 28px;
  font-size: 15px;
  color: var(--ink-2);
}
.post-translation a {
  color: var(--ink);
}

.post-related {
  border-top: 1px solid var(--line);
  padding-block: 64px 88px;
}
.post-related-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 20px;
  margin-bottom: 28px;
}
.post-related-head h2 {
  font-size: 26px;
}
.post-related-head a {
  font-size: 14.5px;
  color: var(--ink-2);
}

/* ------------------------------------------------------------------ duyarlı */

@media (max-width: 1040px) {
  .post-headwrap {
    grid-template-columns: minmax(0, 1fr);
  }
  .post-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
  .post-toc {
    position: static;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
  }
  .post-toc ol {
    border-left: 0;
  }
  .post-toc a {
    padding-left: 0;
    border-left: 0;
  }
  .post-main {
    max-width: 760px;
  }
}
@media (max-width: 860px) {
  .post-headwrap.has-cover {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }
  .post-headwrap.has-cover .post-cover {
    order: 2;
  }
  .post-cover img {
    max-height: 220px;
  }
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .post-card.lead {
    grid-template-columns: minmax(0, 1fr);
  }
  .post-card.lead .post-card-media {
    aspect-ratio: 16 / 9;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .post-card.lead .post-card-body {
    padding: 22px;
  }
  .post-cta {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 640px) {
  .post-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .post-body {
    font-size: 16.5px;
  }
  .post-body h2,
  .post-faq h2 {
    font-size: 22px;
  }
  .post-cta {
    padding: 22px;
  }
  .blog-pager {
    grid-template-columns: 1fr 1fr;
  }
  .blog-pager .muted {
    grid-column: 1 / -1;
    grid-row: 2;
    text-align: center;
  }
}
@media print {
  .post-toc,
  .post-cta,
  .post-related,
  .crumbs {
    display: none;
  }
}
