/* Blog-specific tweaks on top of DataVision styles.css */

/* account for fixed nav */
.blog-page { 
  padding-top: 110px;
  background: linear-gradient(180deg, 
    rgba(10, 15, 30, 0.98) 0%, 
    rgba(10, 15, 30, 0.95) 100%);
}

.blog-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 5%;
}

.blog-hero {
  padding: 40px 0 20px;
  text-align: left;
}

.blog-hero h1 {
  font-size: clamp(2rem, 3vw, 3rem);
  margin-bottom: 12px;
}

.blog-hero p {
  color: var(--text-gray);
  max-width: 700px;
  font-size: 1.1rem;
  line-height: 1.6;
}

.blog-list { padding: 40px 0 90px; }

/* Post tags styling - FIXED: separate tags */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 15px 0 25px;
  padding: 0;
  list-style: none;
}

.post-tag {
  display: inline-block;
  padding: 6px 14px;
  background: linear-gradient(135deg, 
    rgba(0, 100, 200, 0.2) 0%, 
    rgba(0, 150, 255, 0.15) 100%);
  color: #93c5fd !important;
  font-size: 0.9rem;
  font-weight: 600 !important;
  text-decoration: none !important;
  border-radius: 20px;
  border: 1px solid rgba(0, 217, 255, 0.3);
  transition: all 0.3s ease;
  letter-spacing: 0.2px;
  box-shadow: 0 2px 6px rgba(0, 100, 200, 0.2);
  position: relative;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.post-tag:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, 
    rgba(0, 150, 255, 0.3) 0%, 
    rgba(0, 217, 255, 0.25) 100%);
  color: #dbeafe !important;
  border-color: rgba(0, 217, 255, 0.5);
  box-shadow: 0 4px 12px rgba(0, 150, 255, 0.3);
  text-decoration: none !important;
}

/* Featured image - FIXED: keep square but smaller */
.featured-wrap {
  margin: 20px 0 30px;
  background: rgba(15, 20, 35, 0.8);
  border-radius: 16px;
  padding: 15px;
  border: 1px solid rgba(0, 217, 255, 0.08);
  text-align: center;
}

.featured-image {
  display: inline-block;
  max-width: 400px;
  width: 100%;
  margin: 0 auto;
}

.featured-image img {
  width: 100%;
  height: auto;
  aspect-ratio: 1/1;
  display: block;
  border-radius: 12px;
  border: 1px solid rgba(0, 217, 255, 0.12);
  object-fit: contain;
  background: rgba(0, 0, 0, 0.2);
}

/* Featured video/audio smaller */
.featured-video .embed,
.featured-audio .embed {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding-top: 56.25%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0, 217, 255, 0.12);
  background: rgba(0, 0, 0, 0.3);
}

.featured-audio .embed { 
  max-width: 500px;
  padding-top: 56.25%; 
}

.featured-video iframe,
.featured-audio iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Post content container with improved background */
.post-content-container {
  background: rgba(15, 20, 35, 0.7);
  border-radius: 20px;
  padding: 30px;
  margin: 20px 0;
  border: 1px solid rgba(0, 217, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 
    0 8px 20px rgba(0, 0, 0, 0.25),
    0 1px 3px rgba(0, 217, 255, 0.1);
}

/* Make HTMly post body readable - IMPROVED TYPOGRAPHY */
.post-body {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #f1f5f9 !important;
  max-width: 750px;
  margin: 0 auto;
  padding: 0 10px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.post-body p {
  margin-bottom: 1.5em;
  text-align: justify;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  padding: 8px 0;
  border-radius: 4px;
  color: #f1f5f9 !important;
}

.post-body strong, .post-body b {
  color: #ffffff !important;
  font-weight: 700;
}

.post-body em, .post-body i {
  color: #dbeafe !important;
}

.post-body li {
  margin-bottom: 0.5em;
  line-height: 1.6;
  padding-left: 5px;
  color: #f1f5f9 !important;
}

.post-body ul, .post-body ol {
  padding-left: 1.8em;
  margin-bottom: 1.5em;
  background: rgba(255, 255, 255, 0.03);
  padding: 15px 20px;
  border-radius: 12px;
  /* ლურჯი ხაზი მარცხნიდან წაშლილია */
  border-left: none;
}

.post-body ul li::marker {
  color: var(--cyan-accent);
}

.post-body ol li::marker {
  color: var(--cyan-accent);
  font-weight: 500;
}

.post-body a { 
  color: #60a5fa !important;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: all 0.2s ease;
  font-weight: 600;
  padding: 0 2px;
  border-radius: 3px;
}

.post-body a:hover { 
  color: #38bdf8 !important;
  text-decoration: underline;
  background: rgba(0, 217, 255, 0.15);
}

.post-body h1, .post-body h2, .post-body h3, .post-body h4 {
  color: #ffffff !important;
  margin-top: 1.5em;
  margin-bottom: 0.75em;
  line-height: 1.3;
  font-weight: 700;
  position: relative;
  padding-bottom: 8px;
}

.post-body h1::after, 
.post-body h2::after,
.post-body h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, #60a5fa, #38bdf8);
  border-radius: 2px;
}

.post-body h1 { 
  font-size: 2rem;
  padding-top: 10px;
}

.post-body h2 { 
  font-size: 1.75rem;
  padding-top: 8px;
}

.post-body h3 { 
  font-size: 1.5rem;
  padding-top: 6px;
}

.post-body h4 { 
  font-size: 1.25rem;
  color: #38bdf8 !important;
}

.post-meta { 
  color: #cbd5e1 !important;
  margin: 10px 0 25px;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px 16px;
  border-radius: 10px;
  display: inline-block;
}

.post-body img {
  max-width: 650px;
  width: 100%;
  height: auto;
  display: block;
  margin: 25px auto;
  border-radius: 12px;
  border: 1px solid rgba(0, 217, 255, 0.12);
  background: var(--card-bg);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* For regular images inside posts that are square */
.post-body img[src*="featured"] {
  max-width: 400px;
  aspect-ratio: 1/1;
  object-fit: contain;
}

.featured-quote blockquote {
  margin: 1.5em 0;
  padding: 1.5em 2em;
  border-radius: 16px;
  border: 1px solid rgba(0, 217, 255, 0.12);
  background: linear-gradient(135deg, 
    rgba(0, 150, 255, 0.15) 0%, 
    rgba(0, 217, 255, 0.1) 100%);
  color: #ffffff !important;
  font-style: italic;
  font-size: 1.2rem;
  line-height: 1.6;
  position: relative;
  /* ლურჯი ხაზი მარცხნიდან წაშლილია */
  border-left: none;
}

.featured-quote blockquote::before {
  content: '"';
  position: absolute;
  top: -15px;
  left: 15px;
  font-size: 3rem;
  color: rgba(56, 189, 248, 0.3);
  font-family: Georgia, serif;
}

/* Thumbnail on cards */
.case-thumb img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}

/* Cards: reuse existing case-card styles but ensure links look right */
.case-card a { text-decoration: none; }
.case-title { color: var(--text-light); }

/* Code blocks */
.post-body pre {
  background: linear-gradient(135deg, 
    rgba(10, 20, 40, 0.9) 0%, 
    rgba(15, 25, 45, 0.9) 100%);
  border: 1px solid rgba(0, 217, 255, 0.15);
  border-radius: 12px;
  padding: 1.2em;
  overflow: auto;
  margin: 1.5em 0;
  font-size: 0.95rem;
  line-height: 1.5;
  box-shadow: inset 0 1px 8px rgba(0, 0, 0, 0.5);
}

.post-body code { 
  color: #7dd3fc !important;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.95em;
  padding: 0.2em 0.4em;
  border-radius: 4px;
  background: rgba(125, 211, 252, 0.2);
  font-weight: 500;
}

.post-body pre code {
  background: transparent;
  padding: 0;
  color: #f1f5f9 !important;
}

/* Tables */
.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.95rem;
  background: rgba(15, 20, 35, 0.7);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(0, 217, 255, 0.1);
}

.post-body th, .post-body td {
  border: 1px solid rgba(0, 217, 255, 0.1);
  padding: 12px 15px;
  text-align: left;
  color: #f1f5f9 !important;
}

.post-body th { 
  color: #ffffff !important;
  background: linear-gradient(135deg, 
    rgba(0, 100, 200, 0.35) 0%, 
    rgba(0, 150, 255, 0.25) 100%);
  font-weight: 700;
  border-bottom: 2px solid #38bdf8;
}

.post-body tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.04);
}

.post-body tr:hover {
  background: rgba(56, 189, 248, 0.1);
  transition: background 0.2s ease;
}

/* Text selection */
.post-body ::selection {
  background: rgba(56, 189, 248, 0.4);
  color: white;
}

.post-body ::-moz-selection {
  background: rgba(56, 189, 248, 0.4);
  color: white;
}

/* Blog cards: make them look like article cards (small date, title under it) */
.blog-container .case-card { 
  border-radius: 16px; 
  overflow: hidden;
  background: rgba(15, 20, 35, 0.7);
  border: 1px solid rgba(0, 217, 255, 0.1);
  transition: all 0.3s ease;
}

.blog-container .case-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
  border-color: rgba(0, 217, 255, 0.2);
}

.blog-container .case-thumb img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

/* Override DataVision "case" header (it had huge centered metric) */
.blog-container .case-header {
  padding: 16px 18px 0;
  background: transparent;
  text-align: left;
}

.blog-container .case-metric {
  font-size: 0.85rem;
  font-weight: 500;
  margin: 0 0 8px;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: var(--text-gray);
}

.blog-container .case-title {
  font-size: 1.25rem;
  line-height: 1.3;
  margin: 0 0 10px;
  color: var(--text-white);
}

.blog-container .case-body { 
  padding: 0 18px 18px;
}

.blog-container .case-body p {
  font-size: 0.98rem;
  line-height: 1.6;
  margin: 0 0 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-container .blog-readlink {
  display: inline-block;
  font-weight: 600;
  text-decoration: none;
  color: var(--primary-blue);
  margin-top: 10px;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(0, 100, 200, 0.1);
  border: 1px solid rgba(0, 217, 255, 0.1);
  transition: all 0.2s ease;
}

.blog-container .blog-readlink:hover { 
  color: var(--cyan-accent); 
  text-decoration: none;
  background: rgba(0, 217, 255, 0.15);
  border-color: rgba(0, 217, 255, 0.3);
}

/* Keep the edit link readable on dark background */
.blog-container a[href$="/edit?destination=post"] { 
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 5px 10px;
  border-radius: 6px;
  display: inline-block;
  margin-top: 20px;
}

/* Tablet */
@media (max-width: 1024px) {
  .post-body {
    font-size: 1.05rem;
    line-height: 1.65;
    padding: 0 10px;
  }
  
  .post-content-container {
    padding: 25px;
    margin: 15px 0;
  }
  
  .featured-image {
    max-width: 350px;
  }
  
  .featured-video .embed,
  .featured-audio .embed {
    max-width: 500px;
  }
  
  .post-tags {
    gap: 6px;
  }
  
  .post-tag {
    padding: 5px 12px;
    font-size: 0.85rem;
  }
  
  .post-body img {
    max-width: 100%;
    margin: 20px auto;
  }
  
  .post-body img[src*="featured"] {
    max-width: 350px;
  }
  
  .post-body h1 { font-size: 1.8rem; }
  .post-body h2 { font-size: 1.6rem; }
  .post-body h3 { font-size: 1.4rem; }
  .post-body h4 { font-size: 1.2rem; }
}

/* Mobile */
@media (max-width: 640px) {
  .blog-page {
    padding-top: 90px;
  }
  
  .blog-hero {
    padding: 25px 0 15px;
  }
  
  .post-body {
    font-size: 1rem;
    line-height: 1.6;
    padding: 0 5px;
  }
  
  .post-content-container {
    padding: 20px 12px;
    margin: 10px 0;
    border-radius: 16px;
  }
  
  .featured-wrap {
    padding: 12px;
    margin: 15px 0 20px;
  }
  
  .featured-image {
    max-width: 280px;
  }
  
  .featured-image img {
    border-radius: 10px;
  }
  
  .featured-video .embed,
  .featured-audio .embed {
    max-width: 100%;
    padding-top: 56.25%;
  }
  
  .post-tags {
    gap: 5px;
    margin: 12px 0 20px;
  }
  
  .post-tag {
    padding: 4px 10px;
    font-size: 0.8rem;
    border-radius: 15px;
  }
  
  .post-body img {
    margin: 18px 0;
    border-radius: 10px;
  }
  
  .post-body img[src*="featured"] {
    max-width: 280px;
  }
  
  .post-body h1 { font-size: 1.6rem; }
  .post-body h2 { font-size: 1.4rem; }
  .post-body h3 { font-size: 1.2rem; }
  .post-body h4 { font-size: 1.1rem; }
  
  .post-body p {
    text-align: left;
  }
  
  .post-body table {
    font-size: 0.9rem;
    display: block;
    overflow-x: auto;
  }
  
  .post-body th, .post-body td {
    padding: 8px 10px;
  }
  
  .post-body ul, .post-body ol {
    padding: 10px 12px;
    margin-left: 0;
  }
}

