/* =======================================
   Bilkan AI – Blog Stylesheet
   ======================================= */

/* Blog Hero */
.blog-hero {
  padding: 180px 0 80px;
  text-align: center;
  position: relative;
}

.blog-hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  max-width: 760px;
  margin: 0 auto;
}

.blog-hero-title {
  font-family: var(--font-title);
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1.1;
  background: linear-gradient(135deg, #ffffff 30%, #a5b4fc 70%, #6366f1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.blog-hero-desc {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 600px;
}

/* =======================================
   Blog Cards Grid
   ======================================= */
.blog-cards-section {
  padding: 20px 0 100px;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.75rem;
}

/* 3D Blog Card */
.blog-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 22px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.3s ease;
  transform-style: preserve-3d;
  transform: perspective(1000px);
  display: flex;
  flex-direction: column;
}

.blog-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    color-mix(in srgb, var(--card-accent) 12%, transparent) 0%,
    transparent 55%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 2;
  border-radius: 22px;
}

.blog-card:hover::before {
  opacity: 1;
}

.blog-card:hover {
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.5),
    0 0 0 1px color-mix(in srgb, var(--card-accent) 30%, transparent);
}

/* Card Image */
.blog-card-img-wrap {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
  flex-shrink: 0;
}

.blog-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Category Badge on image */
.blog-card-category {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(8, 7, 20, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 5px 10px;
  border-radius: 100px;
  z-index: 3;
}

/* Card Body */
.blog-card-body {
  padding: 1.4rem 1.4rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-grow: 1;
  position: relative;
  z-index: 3;
}

.blog-card-title {
  font-family: var(--font-title);
  font-size: 0.97rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-excerpt {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.blog-card-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.blog-card-read {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--card-accent, var(--accent-cyan));
  transition: letter-spacing 0.3s ease;
}

.blog-card:hover .blog-card-read {
  letter-spacing: 0.5px;
}

/* =======================================
   Post Modal Overlay
   ======================================= */
.post-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 12, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  overflow-y: auto;
}

.post-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.post-modal {
  background: hsl(240, 15%, 6%);
  border: 1px solid var(--border-color);
  border-radius: 28px;
  max-width: 820px;
  width: 100%;
  position: relative;
  box-shadow: 0 40px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.05);
  transform: translateY(30px) scale(0.97);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.post-overlay.active .post-modal {
  transform: translateY(0) scale(1);
}

.post-close {
  position: sticky;
  top: 0;
  float: right;
  margin: 1.25rem 1.25rem 0 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.2s, color 0.2s;
}

.post-close:hover {
  background: rgba(255,255,255,0.15);
  color: white;
}

.post-modal-inner {
  padding: 0 3rem 3rem;
  clear: both;
}

/* Post hero image */
.post-hero-img {
  margin: 0 -3rem 2rem;
  height: 320px;
  overflow: hidden;
}

.post-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Post meta */
.post-meta {
  margin-bottom: 1.25rem;
}

.post-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: color-mix(in srgb, var(--c) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
  color: var(--c);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 100px;
  letter-spacing: 0.3px;
}

/* Post typography */
.post-modal-inner h1 {
  font-family: var(--font-title);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.5px;
  color: var(--text-main);
  margin-bottom: 1.25rem;
}

.post-modal-inner h2 {
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 2rem 0 0.75rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--accent-cyan);
}

.post-modal-inner h3 {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin: 1.5rem 0 0.5rem;
}

.post-modal-inner p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 1rem;
}

.post-modal-inner ul {
  list-style: none;
  padding: 0;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.post-modal-inner ul li {
  color: var(--text-muted);
  font-size: 0.97rem;
  line-height: 1.6;
  padding-left: 1.25rem;
  position: relative;
}

.post-modal-inner ul li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent-cyan);
  font-size: 0.8rem;
}

.post-modal-inner strong {
  color: var(--text-main);
  font-weight: 700;
}

.post-modal-inner em {
  color: var(--text-accent);
  font-style: italic;
}

/* Stat row inside posts */
.post-stat-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem 2rem;
  margin: 1.5rem 0;
}

.post-stat {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.post-stat .stat-num {
  font-family: var(--font-title);
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent-green);
}

.post-stat .stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.post-stat-arrow {
  font-size: 1.5rem;
  color: var(--text-muted);
}

/* CTA Box inside post */
.post-cta-box {
  margin-top: 2.5rem;
  background: linear-gradient(135deg, hsla(244, 96%, 60%, 0.1), hsla(185, 100%, 50%, 0.06));
  border: 1px solid hsla(215, 100%, 65%, 0.2);
  border-radius: 18px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post-cta-box h3 {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
  border: none;
  padding: 0;
}

.post-cta-box p {
  margin: 0;
  font-size: 0.95rem;
}

/* Table inside posts */
.post-table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.post-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.post-table th {
  background: rgba(255,255,255,0.04);
  color: var(--accent-cyan);
  font-weight: 700;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.post-table td {
  color: var(--text-muted);
  padding: 0.7rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.post-table tr:last-child td {
  border-bottom: none;
}

.post-table tr:hover td {
  background: rgba(255,255,255,0.02);
  color: var(--text-main);
}

/* Nav active state */
.nav-active {
  color: var(--accent-cyan) !important;
}

/* =======================================
   Responsive
   ======================================= */
@media (max-width: 1200px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .blog-hero-title {
    font-size: 2.4rem;
  }
  .blog-grid {
    grid-template-columns: 1fr;
  }
  .post-modal-inner {
    padding: 0 1.5rem 2rem;
  }
  .post-hero-img {
    margin: 0 -1.5rem 1.5rem;
    height: 220px;
  }
  .post-modal-inner h1 {
    font-size: 1.5rem;
  }
  .post-stat-row {
    flex-direction: column;
    gap: 1rem;
  }
}

.footer-credit a:hover {
  color: var(--accent-purple) !important;
  text-decoration: underline !important;
}
