/* ==========================================================================
   Blog: liste ve detay sayfası
   Sitenin renk değişkenlerini (style.css) kullanır; açık/koyu tema ile uyumludur.
   ========================================================================== */

.blog-page {
  --blog-radius: 18px;
  --blog-muted: var(--text-light);
  padding-bottom: 4rem;
  background-color: var(--bg-contact);
}

/* ---------- Ortak: meta satırı, rozet ---------- */
.blog-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1rem;
  font-size: 0.875rem;
  color: var(--blog-muted);
}
.blog-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.blog-meta i {
  color: var(--primary-color);
  font-size: 0.85em;
}
.blog-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-color);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ---------- Liste: giriş ve filtre çubuğu ---------- */
.blog-intro {
  max-width: 720px;
  margin: 0 auto 2rem;
  text-align: center;
  color: var(--blog-muted);
  font-size: 1.05rem;
  line-height: 1.7;
}
.blog-toolbar {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--blog-radius);
  box-shadow: var(--shadow-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
}
.blog-toolbar-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.75rem;
  align-items: center;
}
.blog-search {
  position: relative;
}
.blog-search i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--blog-muted);
  pointer-events: none;
}
.blog-search input {
  width: 100%;
  height: 46px;
  padding: 0 1rem 0 2.6rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--input-bg);
  color: var(--text-color);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.blog-search input:focus,
.blog-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.blog-select {
  height: 46px;
  min-width: 170px;
  padding: 0 2.25rem 0 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background-color: var(--input-bg);
  color: var(--text-color);
}
.blog-toolbar-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border-color);
}
.blog-years {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.blog-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}
.blog-chip small {
  color: var(--blog-muted);
  font-weight: 500;
}
.blog-chip:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}
.blog-chip.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}
.blog-chip.active small {
  color: rgba(255, 255, 255, 0.8);
}
.blog-result {
  font-size: 0.9rem;
  color: var(--blog-muted);
}
.blog-result a {
  margin-left: 0.5rem;
  font-weight: 600;
}

/* ---------- Kartlar ---------- */
.blog-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--blog-radius);
  overflow: hidden;
  color: var(--text-color);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
  color: var(--text-color);
}
.blog-card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-light);
}
.blog-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.blog-card:hover .blog-card-media img {
  transform: scale(1.05);
}
.blog-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-light), var(--bg-light));
  color: var(--primary-color);
  font-size: 2.5rem;
  opacity: 0.85;
}
.blog-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.65rem;
  padding: 1.25rem 1.35rem 1.4rem;
}
.blog-card-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card-excerpt {
  margin: 0;
  color: var(--blog-muted);
  font-size: 0.93rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card-more {
  margin-top: auto;
  padding-top: 0.4rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--primary-color);
  font-weight: 700;
  font-size: 0.9rem;
}
.blog-card-more i {
  transition: transform 0.2s ease;
}
.blog-card:hover .blog-card-more i {
  transform: translateX(4px);
}
[dir="rtl"] .blog-card:hover .blog-card-more i {
  transform: translateX(-4px) scaleX(-1);
}
[dir="rtl"] .blog-card-more i {
  transform: scaleX(-1);
}

/* Öne çıkan yazı: yatay büyük kart */
.blog-featured {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  margin-bottom: 2.5rem;
}
.blog-featured .blog-card-media {
  aspect-ratio: auto;
  min-height: 320px;
}
.blog-featured .blog-card-body {
  justify-content: center;
  padding: 2rem 2.25rem;
  gap: 0.9rem;
}
.blog-featured .blog-card-title {
  font-size: 1.6rem;
  -webkit-line-clamp: 3;
}
.blog-featured .blog-card-excerpt {
  font-size: 1rem;
  -webkit-line-clamp: 4;
}
.blog-featured .blog-card-more {
  margin-top: 0.5rem;
}

/* Boş durum */
.blog-empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--blog-muted);
}
.blog-empty i {
  font-size: 2.75rem;
  color: var(--primary-color);
  opacity: 0.6;
  margin-bottom: 1rem;
  display: block;
}

/* Sayfalama */
.blog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}
.blog-pagination a,
.blog-pagination span {
  min-width: 42px;
  height: 42px;
  padding: 0 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-color);
  text-decoration: none;
  font-weight: 600;
}
.blog-pagination a:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}
.blog-pagination .active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

/* ---------- Detay: başlık alanı (sade) ---------- */
.blog-detail-header {
  padding-bottom: 150px;
}
.blog-detail-header h1 {
  font-size: clamp(1.7rem, 1.1rem + 1.8vw, 2.5rem);
  line-height: 1.25;
  max-width: 860px;
  margin: 1.25rem auto 0;
}
/* Breadcrumb'da uzun başlık tekrar edilmez, kısaltılır */
.blog-crumb-current {
  max-width: 28ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.blog-detail-header .breadcrumb {
  flex-wrap: nowrap;
  max-width: 100%;
}
.blog-hero-meta {
  justify-content: center;
  margin-top: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
}
/* Alttaki dalga şekli meta satırının üzerine binmesin */
@media (max-width: 767.98px) {
  .blog-detail-header {
    padding-bottom: 80px;
  }
  .blog-crumb-current {
    max-width: 14ch;
  }
}
.blog-hero-meta i {
  color: #fff;
}
.blog-cover {
  margin: -1rem 0 2.5rem;
  border-radius: var(--blog-radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 21 / 9;
  background: var(--bg-light);
}
.blog-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.blog-lead {
  font-size: 1.2rem;
  line-height: 1.7;
  font-weight: 500;
  color: var(--text-color);
  border-left: 4px solid var(--primary-color);
  padding: 0.25rem 0 0.25rem 1.1rem;
  margin: 0 0 2rem;
}
[dir="rtl"] .blog-lead {
  border-left: 0;
  border-right: 4px solid var(--primary-color);
  padding: 0.25rem 1.1rem 0.25rem 0;
}

/* ---------- Detay: makale tipografisi ---------- */
.blog-article {
  color: var(--text-color);
  font-size: 1.06rem;
  line-height: 1.85;
  overflow-wrap: anywhere;
}
.blog-article > *:first-child {
  margin-top: 0;
}
.blog-article p {
  margin: 0 0 1.25rem;
  color: var(--text-color);
}
.blog-article h2 {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.3;
  margin: 2.75rem 0 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-color);
  scroll-margin-top: 110px;
}
.blog-article h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 2rem 0 0.75rem;
  scroll-margin-top: 110px;
}
.blog-article h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 1.5rem 0 0.6rem;
}
.blog-article ul,
.blog-article ol {
  margin: 0 0 1.5rem;
  padding-left: 1.4rem;
}
[dir="rtl"] .blog-article ul,
[dir="rtl"] .blog-article ol {
  padding-left: 0;
  padding-right: 1.4rem;
}
.blog-article li {
  margin-bottom: 0.55rem;
}
.blog-article li::marker {
  color: var(--primary-color);
  font-weight: 700;
}
.blog-article strong {
  font-weight: 700;
  color: var(--text-color);
}
.blog-article a {
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.blog-article img {
  max-width: 100%;
  height: auto;
  border-radius: 14px;
  margin: 0.5rem 0 1.5rem;
}
.blog-article blockquote {
  margin: 1.75rem 0;
  padding: 1.1rem 1.4rem;
  border-left: 4px solid var(--primary-color);
  background: var(--bg-search);
  border-radius: 0 14px 14px 0;
  font-style: italic;
}
.blog-article em {
  color: var(--blog-muted);
}
/* Tablolar: sunucu tarafında .blog-table-wrap içine alınır, dar ekranda yatay kaydırılır */
.blog-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  -webkit-overflow-scrolling: touch;
}
.blog-article table {
  width: 100% !important;
  min-width: 560px;
  margin: 0;
  border: 0 !important;
  border-collapse: collapse !important;
  font-size: 0.95rem;
  line-height: 1.5;
}
.blog-article th,
.blog-article td {
  padding: 0.8rem 1rem !important;
  border: 0 !important;
  border-bottom: 1px solid var(--border-color) !important;
  text-align: start;
  vertical-align: top;
}
.blog-article th {
  background: var(--primary-light);
  color: var(--text-color);
  font-weight: 700;
  white-space: nowrap;
}
.blog-article tbody tr:nth-child(even) td {
  background: var(--bg-light);
}
.blog-article tbody tr:last-child td {
  border-bottom: 0 !important;
}

/* ---------- Detay: kenar çubuğu ---------- */
.blog-aside {
  position: sticky;
  top: 110px;
}
.blog-box {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--blog-radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow-sm);
}
.blog-box-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blog-muted);
  margin: 0 0 0.9rem;
}
.blog-toc {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 60vh;
  overflow-y: auto;
}
.blog-toc li a {
  display: block;
  padding: 0.4rem 0.75rem;
  border-left: 2px solid var(--border-color);
  color: var(--blog-muted);
  font-size: 0.9rem;
  line-height: 1.45;
  text-decoration: none;
  transition: all 0.2s ease;
}
[dir="rtl"] .blog-toc li a {
  border-left: 0;
  border-right: 2px solid var(--border-color);
}
.blog-toc li.level-3 a {
  padding-left: 1.6rem;
  font-size: 0.85rem;
}
[dir="rtl"] .blog-toc li.level-3 a {
  padding-left: 0.75rem;
  padding-right: 1.6rem;
}
.blog-toc li a:hover,
.blog-toc li a.active {
  color: var(--primary-color);
  border-color: var(--primary-color);
  background: var(--bg-search);
}
.blog-toc li a.active {
  font-weight: 700;
}
/* Mobil içindekiler (açılır) */
.blog-toc-mobile {
  margin-bottom: 1.75rem;
}
.blog-toc-mobile summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
}
.blog-toc-mobile summary::-webkit-details-marker {
  display: none;
}
.blog-toc-mobile summary i {
  transition: transform 0.2s ease;
}
.blog-toc-mobile[open] summary i {
  transform: rotate(180deg);
}
.blog-toc-mobile .blog-toc {
  margin-top: 0.9rem;
  max-height: none;
}

/* Paylaş */
.blog-share {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.blog-share a,
.blog-share button {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-color);
  font-size: 1.05rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}
.blog-share a:hover,
.blog-share button:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
  transform: translateY(-2px);
}
.blog-share .copied {
  background: #10b981 !important;
  border-color: #10b981 !important;
  color: #fff !important;
}
.blog-share-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}
.blog-share-row strong {
  font-size: 0.95rem;
}

/* Önceki / sonraki */
.blog-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
}
.blog-nav a {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--card-bg);
  color: var(--text-color);
  text-decoration: none;
  transition: all 0.2s ease;
}
.blog-nav a:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow);
}
.blog-nav small {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--primary-color);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.blog-nav span {
  font-weight: 700;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-nav .next {
  text-align: end;
  align-items: flex-end;
}

/* Teklif kutusu */
.blog-cta {
  margin-top: 3rem;
  padding: 2.25rem;
  border-radius: 22px;
  background: var(--cta-bg);
  color: var(--cta-text);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  box-shadow: var(--shadow-lg);
}
.blog-cta h2 {
  color: #fff;
  font-size: 1.45rem;
  font-weight: 800;
  margin: 0 0 0.4rem;
}
.blog-cta p {
  color: rgba(255, 255, 255, 0.88);
  margin: 0;
  max-width: 560px;
}
.blog-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.blog-cta .btn-light {
  font-weight: 700;
  color: var(--primary-dark);
}
.blog-cta .btn-outline-light {
  font-weight: 700;
}

/* Benzer yazılar */
.blog-related {
  margin-top: 4rem;
}
.blog-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.blog-section-title h2 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
}
.blog-section-title a {
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

/* ---------- Duyarlı ---------- */
@media (max-width: 991.98px) {
  .blog-featured {
    grid-template-columns: 1fr;
  }
  .blog-featured .blog-card-media {
    min-height: 0;
    aspect-ratio: 16 / 9;
  }
  .blog-featured .blog-card-body {
    padding: 1.5rem;
  }
  .blog-featured .blog-card-title {
    font-size: 1.35rem;
  }
  .blog-aside {
    position: static;
  }
  .blog-cover {
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 767.98px) {
  .blog-toolbar-form {
    grid-template-columns: 1fr 1fr;
  }
  .blog-search {
    grid-column: 1 / -1;
  }
  .blog-select {
    min-width: 0;
    width: 100%;
  }
  .blog-article {
    font-size: 1rem;
    line-height: 1.8;
  }
  .blog-article h2 {
    font-size: 1.35rem;
    margin-top: 2.25rem;
  }
  .blog-article h3 {
    font-size: 1.15rem;
  }
  .blog-lead {
    font-size: 1.08rem;
  }
  .blog-nav {
    grid-template-columns: 1fr;
  }
  .blog-nav .next {
    text-align: start;
    align-items: flex-start;
  }
  .blog-cta {
    padding: 1.6rem;
  }
  .blog-cta-actions,
  .blog-cta-actions .btn {
    width: 100%;
  }
  .blog-cover {
    margin-top: 0;
    border-radius: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blog-card,
  .blog-card-media img,
  .blog-card-more i {
    transition: none;
  }
  .blog-card:hover,
  .blog-card:hover .blog-card-media img {
    transform: none;
  }
}
