/* ============================================
   ROBNISHTECH BLOG STYLES
   Clean editorial blog layout
   ============================================ */

:root {
  --blog-primary: #111827;
  --blog-accent: #2563eb;
  --blog-accent-soft: #eef2ff;
  --blog-text: #334155;
  --blog-text-muted: #64748b;
  --blog-eyebrow: #94a3b8;
  --blog-bg: #ffffff;
  --blog-surface: #ffffff;
  --blog-surface-soft: #f8fafc;
  --blog-border: #e5e7eb;
  --blog-card-border: #2f6df6;
  --blog-radius: 12px;
  --blog-max-width: 1200px;
  --blog-article-width: 860px;
  --blog-wide-width: 1120px;
  --blog-shadow: 0 18px 36px rgba(15, 23, 42, 0.07);
  --blog-shadow-hover: 0 24px 48px rgba(15, 23, 42, 0.12);
}

/* ==============================
   BLOG LISTING PAGE
   ============================== */

.blog-hero {
  margin-top: 64px;
  padding: 72px 24px 44px;
  background: var(--blog-bg);
  color: var(--blog-primary);
  text-align: center;
}

.blog-hero-inner {
  max-width: var(--blog-max-width);
  margin: 0 auto;
}

.blog-hero .label {
  display: block;
  margin: 0 0 18px;
  color: var(--blog-eyebrow);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
}

.blog-hero h1 {
  max-width: 940px;
  margin: 0 auto;
  color: var(--blog-primary);
  font-size: clamp(2.25rem, 4.6vw, 3.45rem);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.12;
}

.blog-hero p {
  max-width: 760px;
  margin: 18px auto 0;
  color: var(--blog-text-muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.blog-grid-section,
.blog-listing {
  min-height: 56vh;
  padding: 36px 24px 112px;
  background: var(--blog-bg);
}

.blog-grid-inner,
.blog-listing > .container {
  max-width: var(--blog-max-width);
  margin: 0 auto;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 450px));
  justify-content: start;
  gap: 32px;
}

.post-card {
  display: flex;
  width: 100%;
  max-width: 450px;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1.5px solid var(--blog-card-border);
  border-radius: var(--blog-radius);
  background: var(--blog-surface);
  box-shadow: var(--blog-shadow);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.post-card:hover {
  border-color: #1d4ed8;
  box-shadow: var(--blog-shadow-hover);
  color: inherit;
  transform: translateY(-4px);
}

.post-card:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 4px;
}

.post-card-image,
.post-card-image-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #e2e8f0;
}

.post-card-image {
  height: auto;
  object-fit: cover;
}

.post-card-image-placeholder {
  background:
    radial-gradient(circle at 72% 45%, rgba(37, 99, 235, 0.32), transparent 28%),
    linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
}

.post-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  padding: 24px 24px 18px;
}

.post-card-date,
.post-card > time {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 30px;
  padding: 4px 14px;
  border-radius: 6px;
  background: #f1f3f8;
  color: var(--blog-accent);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1;
}

.post-card > time {
  margin: 24px 24px 0;
}

.post-card-body h2,
.post-card > h2 {
  margin: 0;
  color: #253044;
  font-size: 1.45rem;
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1.38;
}

.post-card > h2 {
  margin: 14px 24px 0;
}

.post-card:hover h2 {
  color: var(--blog-accent);
}

.post-card-excerpt,
.post-card > p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #6b7280;
  font-size: 1rem;
  line-height: 1.62;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.post-card > p {
  margin: 14px 24px 24px;
}

.post-card-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 24px 24px;
  color: var(--blog-text-muted);
  font-size: 0.84rem;
}

.post-card-tag {
  max-width: 68%;
  overflow: hidden;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--blog-surface-soft);
  color: #475569;
  font-size: 0.76rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-card-readtime {
  margin-left: auto;
  color: var(--blog-text-muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

/* ==============================
   BLOG POST PAGE
   ============================== */

.blog-post {
  background: var(--blog-bg);
}

.post-header,
.post-hero,
.blog-post-header {
  margin-top: 64px;
  padding: 60px 24px 0;
  background: var(--blog-bg);
  color: var(--blog-primary);
}

.post-header-inner,
.post-hero-content,
.blog-post-header .container {
  max-width: var(--blog-wide-width);
  margin: 0 auto;
}

.post-back-link {
  display: inline-flex;
  align-items: center;
  margin-bottom: 34px;
  color: var(--blog-text-muted);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
}

.post-back-link:hover {
  color: var(--blog-accent);
}

.post-header h1,
.post-hero-content h1,
.blog-post-header h1 {
  max-width: 980px;
  margin: 0 0 18px;
  color: var(--blog-primary);
  font-size: clamp(2.35rem, 4.6vw, 3.55rem);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.13;
}

.post-meta,
.post-hero-content .post-meta,
.blog-post-header .post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 34px;
}

.post-date,
.post-header .post-date,
.post-hero-content .post-date,
.blog-post-header .post-meta time {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 14px;
  border-radius: 6px;
  background: #f1f3f8;
  color: var(--blog-accent);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1;
}

.post-category,
.post-header .post-category,
.post-hero-content .post-category,
.blog-post-header .post-category {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 12px;
  border: 1px solid var(--blog-border);
  border-radius: 6px;
  background: #fff;
  color: var(--blog-text-muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.post-readtime,
.post-hero-content .post-readtime {
  color: var(--blog-text-muted);
  font-size: 0.92rem;
}

.post-excerpt,
.post-hero-content .post-excerpt,
.blog-post-header p {
  max-width: 760px;
  margin: 0 0 30px;
  color: var(--blog-text-muted);
  font-size: 1.12rem;
  line-height: 1.7;
}

.post-featured-image {
  margin: 40px 0 0;
}

.post-featured-image img,
.post-hero-image {
  display: block;
  width: 100%;
  max-height: 680px;
  border: 1px solid var(--blog-border);
  border-radius: 8px;
  object-fit: cover;
}

.post-hero {
  min-height: 0;
  display: block;
  overflow: visible;
}

.post-hero-image {
  position: static;
  height: auto;
  aspect-ratio: 1200 / 630;
  margin: 36px auto 0;
}

.post-hero-overlay {
  display: none;
}

.post-hero-content {
  position: static;
  z-index: auto;
  width: auto;
  padding: 0;
}

.post-hero-no-image,
.blog-post-header {
  min-height: 0;
  display: block;
  padding-bottom: 44px;
}

/* ==============================
   POST CONTENT
   ============================== */

.post-content-wrapper {
  padding: 50px 24px 96px;
  background: var(--blog-bg);
}

.post-content,
.blog-article {
  max-width: var(--blog-article-width);
  margin: 0 auto;
  color: var(--blog-text);
  font-size: 1.06rem;
  line-height: 1.82;
}

.blog-article {
  padding-top: 56px;
  padding-bottom: 86px;
}

.post-content > p:first-of-type,
.blog-article > p:first-of-type {
  color: #243044;
  font-size: 1.13rem;
}

.post-content p,
.blog-article p {
  margin: 0 0 22px;
}

.post-content h2,
.blog-article h2 {
  margin: 58px 0 18px;
  color: var(--blog-primary);
  font-size: clamp(1.65rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.22;
}

.post-content h2:first-child,
.blog-article h2:first-child {
  margin-top: 0;
}

.post-content h2[id],
.blog-article h2[id] {
  scroll-margin-top: 104px;
}

.post-content h3,
.blog-article h3 {
  margin: 34px 0 12px;
  color: #1f2937;
  font-size: 1.28rem;
  font-weight: 750;
  line-height: 1.35;
}

.post-content strong,
.blog-article strong {
  color: #1f2937;
  font-weight: 750;
}

.post-content a,
.blog-article a {
  color: var(--blog-accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-content a:hover,
.blog-article a:hover {
  color: #1d4ed8;
}

.post-content img,
.blog-article img {
  max-width: 100%;
  height: auto;
  margin: 34px 0;
  border-radius: 8px;
}

.post-content ul,
.post-content ol,
.blog-article ul,
.blog-article ol {
  margin: 0 0 26px;
  padding-left: 1.35rem;
  list-style: revert;
}

.post-content li,
.blog-article li {
  margin-bottom: 10px;
  padding-left: 0.2rem;
}

.post-content blockquote,
.blog-article blockquote {
  margin: 34px 0;
  padding: 22px 26px;
  border-left: 4px solid var(--blog-accent);
  border-radius: 0 10px 10px 0;
  background: #f8fbff;
  color: #475569;
  font-style: italic;
}

.post-content code,
.blog-article code {
  padding: 2px 6px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #1f2937;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}

.post-content pre,
.blog-article pre {
  margin: 34px 0;
  overflow-x: auto;
  padding: 24px;
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
}

.post-content pre code,
.blog-article pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.post-content table,
.blog-article table {
  width: 100%;
  margin: 32px 0;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--blog-border);
  font-size: 0.95rem;
  line-height: 1.5;
}

.post-content th,
.post-content td,
.blog-article th,
.blog-article td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--blog-border);
  text-align: left;
  vertical-align: top;
}

.post-content th,
.blog-article th {
  background: #f8fafc;
  color: var(--blog-primary);
  font-weight: 800;
}

.post-content tr:last-child td,
.blog-article tr:last-child td {
  border-bottom: 0;
}

.key-takeaway,
.post-content .key-takeaway,
.blog-article .key-takeaway {
  margin: 36px 0;
  padding: 26px 28px;
  border: 1px solid #c7d2fe;
  border-radius: 12px;
  background: #f8fbff;
}

.key-takeaway h3,
.post-content .key-takeaway h3,
.blog-article .key-takeaway h3 {
  margin: 0 0 10px;
  color: var(--blog-accent);
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.key-takeaway p:last-child {
  margin-bottom: 0;
}

.post-toc {
  margin: 0 0 42px;
  padding: 24px 26px;
  border: 1px solid var(--blog-border);
  border-radius: 12px;
  background: var(--blog-surface-soft);
}

.post-toc h4 {
  margin: 0 0 14px;
  color: var(--blog-text-muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.post-toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-toc li {
  margin: 0 0 8px;
  padding: 0;
}

.post-toc li:last-child {
  margin-bottom: 0;
}

.post-toc a {
  color: #334155;
  font-size: 0.97rem;
  font-weight: 600;
  text-decoration: none;
}

.post-toc a:hover {
  color: var(--blog-accent);
}

.faq-section {
  margin: 58px 0 0;
  padding-top: 14px;
}

.faq-section > h2 {
  margin-top: 0;
}

.faq-item {
  margin: 0 0 14px;
  padding: 22px 24px;
  border: 1px solid var(--blog-border);
  border-radius: 12px;
  background: #fff;
}

.faq-item h3 {
  margin: 0 0 10px;
  font-size: 1.08rem;
}

.faq-item p {
  margin: 0;
  color: var(--blog-text-muted);
}

.post-cta {
  margin: 58px 0 0;
  padding: 38px 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, #111827 0%, #1e293b 100%);
  color: #fff;
  text-align: center;
}

.post-cta h3 {
  margin: 0 0 10px;
  color: #fff;
  font-size: 1.42rem;
}

.post-cta p {
  max-width: 600px;
  margin: 0 auto 24px;
  color: #cbd5e1;
}

.post-cta a.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 26px;
  border-radius: 8px;
  background: var(--blog-accent);
  color: #fff;
  font-size: 0.96rem;
  font-weight: 800;
  text-decoration: none;
}

.post-cta a.cta-button:hover {
  background: #1d4ed8;
  color: #fff;
}

/* ==============================
   RESPONSIVE
   ============================== */

@media (max-width: 768px) {
  .blog-hero {
    padding: 48px 20px 30px;
  }

  .blog-grid-section,
  .blog-listing {
    padding: 26px 20px 72px;
  }

  .posts-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .post-card {
    max-width: none;
  }

  .post-header,
  .post-hero,
  .blog-post-header {
    padding: 42px 20px 0;
  }

  .post-back-link {
    margin-bottom: 26px;
  }

  .post-meta {
    margin-bottom: 26px;
  }

  .post-featured-image {
    margin-top: 28px;
  }

  .post-content-wrapper {
    padding: 36px 20px 72px;
  }

  .post-content table,
  .blog-article table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .post-card-body {
    padding: 22px 20px 16px;
  }

  .post-card-footer {
    padding: 0 20px 22px;
  }

  .post-toc,
  .key-takeaway,
  .faq-item,
  .post-cta {
    padding: 22px 20px;
  }
}
