/* =========================================================
   blog.css – TrackVid Professional Blog Styling
   ---------------------------------------------------------
   Features:
   ✓ Medium-style clean design
   ✓ TrackVid brand colors
   ✓ Fully responsive
   ✓ Smooth animations
   ✓ Professional typography
   ========================================================= */

/* ---------------------------------------------------------------------
   VARIABLES & RESET
   --------------------------------------------------------------------- */

:root {
  /* TrackVid Brand Colors */
  --primary: #0088A3;
  --secondary: #86CFD1;
  --primary-dark: #006B85;
  --secondary-light: #CDE7ED;
  
  /* Neutral Colors */
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted: #6b7280;
  --bg-white: #ffffff;
  --bg-gray: #f9fafb;
  /* --border-color: #e5e7eb; */
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
  
  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-primary);
  /* background: var(--bg-gray); */
  background: linear-gradient(to bottom, #E4F2F5, #94CDD880   ); 
  background-size: cover; 
  background-position: center 100%; 
  background-repeat: no-repeat;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------------------------------------------------------------------
   CONTAINER & LAYOUT
   --------------------------------------------------------------------- */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 120px 24px 80px;
}

@media (max-width: 768px) {
  .container {
    padding: 100px 16px 60px;
  }
}

/* ---------------------------------------------------------------------
   PAGE TITLE
   --------------------------------------------------------------------- */

.page-title {
  font-size: 3rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@media (max-width: 768px) {
  .page-title {
    font-size: 2rem;
  }
}

/* ---------------------------------------------------------------------
   SEARCH & FILTER CONTROLS
   --------------------------------------------------------------------- */

.blog-controls {
  display: flex;
  gap: 16px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.blog-search {
  flex: 1;
  min-width: 250px;
  padding: 14px 20px;
  font-size: 16px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  background: white;
  transition: var(--transition);
  outline: none;
}

.blog-search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 136, 163, 0.1);
}

.blog-filter {
  min-width: 180px;
  padding: 14px 20px;
  font-size: 16px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  background: white;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
}

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

@media (max-width: 768px) {
  .blog-controls {
    flex-direction: column;
    gap: 12px;
  }
  
  .blog-search,
  .blog-filter {
    width: 100%;
    min-width: unset;
  }
}

/* ---------------------------------------------------------------------
   BLOG LIST GRID
   --------------------------------------------------------------------- */

.blog-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 32px;
  margin-bottom: 64px;
}

@media (max-width: 768px) {
  .blog-list {
    grid-template-columns: 1fr;
    gap: 24px;
    /* Horizontal scroll for mobile */
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 20px;
  }
  
  .blog-list::-webkit-scrollbar {
    height: 8px;
  }
  
  .blog-list::-webkit-scrollbar-track {
    background: var(--bg-gray);
    border-radius: 10px;
  }
  
  .blog-list::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
  }
}

/* ---------------------------------------------------------------------
   BLOG CARD
   --------------------------------------------------------------------- */

.blog-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
}

.blog-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

@media (max-width: 768px) {
  .blog-card {
    min-width: 300px;
    max-width: 320px;
  }
}

.card-image {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  overflow: visible;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.blog-card:hover .card-image img {
  object-fit: cover;
  transform: scale(1.05);
  overflow: visible;
}

.card-category {
  background: var(--primary);
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-description {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.meta-date,
.meta-reading-time {
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  transition: var(--transition);
  text-align: center;
}

.card-btn:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

/* ---------------------------------------------------------------------
   PAGINATION
   --------------------------------------------------------------------- */

.blog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 64px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 44px;
  height: 44px;
  padding: 0 16px;
  border: 2px solid var(--border-color);
  background: white;
  color: var(--text-primary);
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.page-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--secondary-light);
}

.page-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.page-dots {
  color: var(--text-muted);
  padding: 0 8px;
}

@media (max-width: 768px) {
  .blog-pagination {
    gap: 8px;
  }
  
  .page-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    font-size: 14px;
  }
}

/* ---------------------------------------------------------------------
   BLOG DETAIL PAGE
   --------------------------------------------------------------------- */

.blog-detail {
  max-width: 1400px;
  margin: 0 auto;
  background-image: url('assets/images/hiw_BG.png'); background-size: cover;  background-repeat: no-repeat;
  border-radius: 16px;
  padding: 48px;
  position: relative;
  justify-content: center;
  box-shadow: var(--shadow-md);
}

@media (max-width: 768px) {
  .blog-detail {
    padding: 24px;
    border-radius: 12px;
  }
}

.hero-image {
  width: 100%;
  height: auto;
  border-radius: 12px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-md);
  content: cover;
}

#blog-title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

@media (max-width: 768px) {
  #blog-title {
    font-size: 1.75rem;
  }
}

.blog-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
}

.blog-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.meta-category {
  background: var(--primary);
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
}

.meta-divider {
  color: var(--text-muted);
}

.meta-date,
.meta-reading-time {
  color: var(--text-muted);
  font-size: 14px;
}

/* ---------------------------------------------------------------------
   BLOG CONTENT
   --------------------------------------------------------------------- */

.blog-content {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4 {
  margin-top: 48px;
  margin-bottom: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.blog-content h1 { font-size: 2rem; }
.blog-content h2 { font-size: 1.75rem; }
.blog-content h3 { font-size: 1.5rem; }
.blog-content h4 { font-size: 1.25rem; }

.blog-content p {
  margin-bottom: 24px;
}

.blog-content a {
  color: black;
  text-decoration: underline;
  transition: var(--transition);
}

.blog-content a:hover {
  color:white;
}

.blog-content ul,
.blog-content ol {
  margin: 24px 0;
  padding-left: 32px;
}

.blog-content li {
  margin-bottom: 12px;
}

.blog-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 32px 0;
  box-shadow: var(--shadow-md);
}

.blog-content blockquote {
  margin: 32px 0;
  padding: 20px 24px;
  border-left: 4px solid var(--primary);
  background: var(--secondary-light);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text-secondary);
}

.blog-content code {
  background: var(--bg-gray);
  padding: 3px 8px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  color: var(--primary-dark);
}

.blog-content pre {
  background: var(--text-primary);
  color: white;
  padding: 24px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 32px 0;
}

.blog-content pre code {
  background: none;
  padding: 0;
  color: white;
}

/* Smart Content Highlighting */
.highlight-stat {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  font-size: 1.1em;
}

.highlight-text {
  background: var(--secondary-light);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--primary-dark);
}

/* ---------------------------------------------------------------------
   CTA BUTTONS
   --------------------------------------------------------------------- */

.cta-button-container {
  margin: 48px 0;
  text-align: center;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.125rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.cta-button:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: var(--shadow-lg);
  color: #ffffff;
  text-decoration-color: #e5e7eb;
}

/* ---------------------------------------------------------------------
   SOCIAL SHARE
   --------------------------------------------------------------------- */

.social-share-section {
  margin: 64px 0;
  padding: 32px;
  /* background: var(--bg-gray); */
  border-radius: 16px;
  text-align: center;
}

.share-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.share-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.share-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  color: rgb(255, 255, 255);
}

.share-btn svg {
  width: 20px;
  height: 20px;
}

.share-btn.whatsapp {
  background: #25D366;
}

.share-btn.twitter {
  background: #1DA1F2;
}

.share-btn.linkedin {
  background: #0A66C2;
}

.share-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

@media (max-width: 768px) {
  .share-buttons {
    flex-direction: column;
    align-items: stretch;
  }
  
  .share-btn {
    justify-content: center;
  }
}

/* ---------------------------------------------------------------------
   RELATED POSTS
   --------------------------------------------------------------------- */

.related-posts-section {
  margin-top: 64px;
  padding-top: 48px;
  border-top: 2px solid var(--border-color);
}

.related-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 32px;
  color: var(--text-primary);
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}

@media (max-width: 768px) {
  .related-posts-grid {
    grid-template-columns: 1fr;
  }
}

.related-post-card {
  display: block;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  text-decoration: none;
}

.related-post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.related-post-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.related-post-content {
  padding: 20px;
}

.related-post-content h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-post-meta {
  font-size: 14px;
  color: var(--text-muted);
}

/* ---------------------------------------------------------------------
   ERROR & NO RESULTS STATES
   --------------------------------------------------------------------- */

.no-blogs,
.no-results,
.error-message {
  text-align: center;
  padding: 80px 20px;
}

.no-blogs p,
.no-results p,
.error-message p {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 28px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 600;
  transition: var(--transition);
}

.back-btn:hover {
  background: var(--primary-dark);
  transform: translateX(-4px);
}

/* ---------------------------------------------------------------------
   ANIMATIONS
   --------------------------------------------------------------------- */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.blog-card,
.blog-detail {
  animation: fadeIn 0.6s ease-out;
}

/* ---------------------------------------------------------------------
   RESPONSIVE TYPOGRAPHY
   --------------------------------------------------------------------- */

@media (max-width: 768px) {
  .blog-content {
    font-size: 1rem;
  }
  
  .blog-content h1 { font-size: 1.75rem; }
  .blog-content h2 { font-size: 1.5rem; }
  .blog-content h3 { font-size: 1.25rem; }
  .blog-content h4 { font-size: 1.125rem; }
}

/* Section wrapper */
.blog-list-container {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 60px 0;
  gap: 90px;
}

/* Small & clean card layout */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 400px); /* PERFECT card width */
  gap: 30px;
  justify-content: center;
  width: 100%;
  border: #006B85;
  border-width: 10px;
}

/* Small clean card */
.blog-card {
  width: 400px;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  transition: 0.3s ease;
  display: flex;
  flex-direction: column;
}

/* Hover effect */
.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 30px rgba(0,0,0,0.12);
}
/* slight zoom on hover */
.blog-card:hover .card-image img {
  transform: scale(1.05);
}

/* body inside card */
.card-content {
  padding: 20px;
  flex: 1;
  background-color: #94CDD880;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }
  .blog-card {
    width: 90%;
    margin: 0 auto;
  }
}
