/* Blog app — visually modeled on .demos-grid/.demo-card in the main stylesheet,
   kept as separate classes so blog cards don't couple to the demo modal JS. */

:root[data-theme="dark"] .blog-card-banner.has-image {
  background: #2c231b;
}

.blog-filters {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.blog-filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.blog-filter-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.blog-filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-fg);
}

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

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

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

.blog-card {
  text-align: left;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.blog-card-banner {
  position: relative;
  height: 160px;
  overflow: hidden;
}

.blog-card-banner.has-image { background: #f4f4f5; }
.blog-card-banner.no-image { display: grid; place-items: center; }

.blog-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.blog-card:hover .blog-card-img { transform: scale(1.06); }

.blog-card-category-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  padding: 1rem;
  text-align: center;
}

.blog-card-badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.95);
  color: #1a1a1a;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.blog-read-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--emerald);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.blog-read-badge svg {
  width: 0.75rem;
  height: 0.75rem;
}

.blog-card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-card-body h3 { font-size: 1.05rem; font-weight: 700; }

.blog-card-body p {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--fg-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.blog-card-meta {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--fg-soft);
}

.blog-cat-proje { background: linear-gradient(135deg, #06b6d4, #0d9488); }
.blog-cat-gunluk { background: linear-gradient(135deg, #f59e0b, #ea580c); }
.blog-cat-yazi { background: linear-gradient(135deg, #8b5cf6, #6366f1); }
.blog-cat-video { background: linear-gradient(135deg, #ef4444, #e11d48); }

.blog-pagination {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.blog-pagination-info {
  font-size: 0.8rem;
  color: var(--fg-muted);
}

/* Detail page */
.blog-detail-page { max-width: 760px; }

.blog-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--fg-muted);
  font-size: 0.85rem;
  text-decoration: none;
  margin-bottom: 1rem;
}

.blog-detail-meta {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--fg-muted);
}

.blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.blog-tag {
  display: inline-flex;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--fg-muted);
  font-size: 0.75rem;
}

.blog-detail-cover {
  margin-top: 2rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.blog-detail-cover img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  display: block;
}

.blog-content {
  margin-top: 2rem;
}

.blog-content.ql-editor {
  padding: 0;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--fg);
}

.blog-content img { max-width: 100%; border-radius: var(--radius); }

.blog-content .ql-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border-radius: var(--radius);
}

.blog-attachment {
  margin-top: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}

.blog-attachment:hover { border-color: var(--primary); }

/* Frontend Code Blocks (Syntax Highlighting) */
.blog-content pre,
.blog-content pre.ql-syntax {
  background-color: #000000 !important;
  color: #f5ede0 !important; /* warm white/cream text */
  padding: 1.25rem !important;
  border-radius: var(--radius) !important;
  border: 1px solid var(--border) !important;
  font-family: var(--font-mono) !important;
  font-size: 0.9rem !important;
  line-height: 1.6 !important;
  overflow-x: auto !important;
  margin: 1.5rem 0 !important;
  white-space: pre-wrap !important;
  word-break: break-all !important;
}

/* Custom warm-palette syntax highlighting for dark background */
.blog-content pre .hljs-comment,
.blog-content pre .hljs-quote,
.blog-content pre.ql-syntax .hljs-comment,
.blog-content pre.ql-syntax .hljs-quote {
  color: #8b7d6f !important; /* Muted warm gray */
  font-style: italic !important;
}

.blog-content pre .hljs-keyword,
.blog-content pre .hljs-selector-tag,
.blog-content pre.ql-syntax .hljs-keyword,
.blog-content pre.ql-syntax .hljs-selector-tag {
  color: #c2691b !important; /* Amber */
  font-weight: 600 !important;
}

.blog-content pre .hljs-number,
.blog-content pre .hljs-string,
.blog-content pre .hljs-regexp,
.blog-content pre.ql-syntax .hljs-number,
.blog-content pre.ql-syntax .hljs-string,
.blog-content pre.ql-syntax .hljs-regexp {
  color: #059669 !important; /* Emerald */
}

.blog-content pre .hljs-title,
.blog-content pre .hljs-title.class_,
.blog-content pre .hljs-title.function_,
.blog-content pre.ql-syntax .hljs-title,
.blog-content pre.ql-syntax .hljs-title.class_,
.blog-content pre.ql-syntax .hljs-title.function_ {
  color: #d97706 !important; /* Warm Amber */
}

.blog-content pre .hljs-built_in,
.blog-content pre .hljs-type,
.blog-content pre .hljs-symbol,
.blog-content pre.ql-syntax .hljs-built_in,
.blog-content pre.ql-syntax .hljs-type,
.blog-content pre.ql-syntax .hljs-symbol {
  color: #e28743 !important;
}

.blog-content pre .hljs-literal,
.blog-content pre.ql-syntax .hljs-literal {
  color: #e11d48 !important; /* Rose */
}

.blog-content pre .hljs-params,
.blog-content pre .hljs-variable,
.blog-content pre.ql-syntax .hljs-params,
.blog-content pre.ql-syntax .hljs-variable {
  color: #f5ede0 !important;
}

/* Custom HTML5 Video Player Styles */
.custom-video-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
}

.custom-video-player video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
}

.video-controls-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.custom-video-player:hover .video-controls-overlay {
  opacity: 1;
}

.video-control-btn {
  background: none;
  border: none;
  color: #ffffff !important;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, transform 0.1s;
}

.video-control-btn:hover {
  color: var(--primary) !important;
  transform: scale(1.1);
}

.video-control-btn:active {
  transform: scale(0.95);
}

.video-control-btn svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

.video-progress-container {
  flex-grow: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  transition: height 0.1s;
}

.video-progress-container:hover {
  height: 8px;
}

.video-progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  width: 0%;
  position: relative;
}

.video-time-display {
  color: #ffffff;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  min-width: 85px;
  text-align: center;
}

/* Code block wrapper and language badge styles */
.code-block-wrapper {
  position: relative;
  margin: 1.5rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.code-block-wrapper pre {
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  padding-top: 2.25rem !important; /* Space for the language badge */
}

.code-lang-badge {
  position: absolute;
  top: 10px;
  right: 12px;
  background-color: #2a1f15;
  color: #f5ede0;
  border: 1px solid #444444;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  font-family: var(--font-sans);
  z-index: 10;
  user-select: none;
  pointer-events: none;
  opacity: 0.85;
}

/* YouTube custom player additions */
.custom-video-player .video-element-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
  pointer-events: none; /* Block direct iframe interaction so click-overlay handles it */
}

.custom-video-player .video-element-wrapper iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.custom-video-player .video-click-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  cursor: pointer;
}
