/* Niravin blog: list cards + article typography */

.nv-blog-font-fa,
.nv-blog-font-fa * {
  font-family: 'Vazirmatn', 'Vazir', 'Tahoma', sans-serif;
}

/* ---------- Cards ---------- */
.nv-post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.75rem;
}

.nv-post-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: none;
  transition: border-color 0.2s ease;
}

.nv-post-card:hover {
  border-color: #cbd5e1;
}

/* ---------- Pagination ---------- */
.nv-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
}

.nv-pagination a,
.nv-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  height: 2.4rem;
  padding: 0 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.6rem;
  background: #fff;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.nv-pagination a:hover {
  border-color: #94a3b8;
  color: #0f172a;
}

.nv-pagination .is-current {
  border-color: #1a73e8;
  background: #1a73e8;
  color: #fff;
}

.nv-pagination .is-disabled {
  color: #cbd5e1;
  cursor: default;
}

.nv-pagination__summary {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
}

.nv-post-card__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #f1f5f9;
}

.nv-post-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.nv-post-card:hover .nv-post-card__media img {
  transform: scale(1.04);
}

.nv-post-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.25rem 1.35rem 1.4rem;
  flex: 1;
}

.nv-post-card__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #64748b;
}

.nv-post-card__meta .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #cbd5e1;
}

.nv-post-card__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nv-post-card__title a {
  color: #0f172a;
  text-decoration: none;
}

.nv-post-card__title a:hover {
  color: #1a73e8;
}

.nv-post-card__excerpt {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.85;
  color: #475569;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nv-post-card__more {
  margin-top: auto;
  padding-top: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #1a73e8;
  text-decoration: none;
}

/* Generated cover for posts without a featured image */
.nv-cover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 1.25rem 1.4rem;
  overflow: hidden;
}

.nv-cover::before,
.nv-cover::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  opacity: 0.55;
}

.nv-cover::before {
  width: 62%;
  aspect-ratio: 1;
  top: -28%;
  inset-inline-end: -12%;
  background: rgba(255, 255, 255, 0.7);
}

.nv-cover::after {
  width: 34%;
  aspect-ratio: 1;
  bottom: -18%;
  inset-inline-start: -8%;
  background: rgba(255, 255, 255, 0.45);
}

.nv-cover--0 { background: linear-gradient(135deg, #e0f2fe 0%, #ede9fe 100%); }
.nv-cover--1 { background: linear-gradient(135deg, #dcfce7 0%, #e0f2fe 100%); }
.nv-cover--2 { background: linear-gradient(135deg, #fef3c7 0%, #fce7f3 100%); }
.nv-cover--3 { background: linear-gradient(135deg, #ede9fe 0%, #fce7f3 100%); }
.nv-cover--4 { background: linear-gradient(135deg, #cffafe 0%, #dcfce7 100%); }
.nv-cover--5 { background: linear-gradient(135deg, #ffe4e6 0%, #fef9c3 100%); }

/* ---------- Article ---------- */
.nv-article {
  max-width: 780px;
  margin: 0 auto;
}

/* Post title sits in the page banner instead of above the article */
.nv-post-hero {
  padding-top: 7rem;
  padding-bottom: 6rem;
}

.nv-post-hero .container {
  position: relative;
  z-index: 1;
}

.nv-post-hero--cover {
  background-size: cover;
  background-position: center;
}

/* Thumbnails are light pastel; darken them so the white title stays readable */
.nv-post-hero__shade {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.55) 0%, rgba(15, 23, 42, 0.45) 45%, rgba(15, 23, 42, 0.65) 100%);
  opacity: 1;
}

.nv-post-hero__title {
  font-size: clamp(1.8rem, 3.6vw, 2.9rem);
  font-weight: 800;
  line-height: 1.45;
  margin: 0 0 1rem;
  text-shadow: 0 2px 18px rgba(15, 23, 42, 0.35);
  overflow-wrap: anywhere;
}

.nv-post-hero__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.88);
}

.nv-post-hero__meta .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
}

.blog-content {
  font-size: 1.075rem;
  line-height: 1.95;
  color: #1e293b;
  word-wrap: break-word;
}

.blog-content[dir='ltr'] {
  line-height: 1.8;
}

.blog-content > *:first-child {
  margin-top: 0;
}

.blog-content p {
  margin: 0 0 1.35rem;
}

.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4,
.blog-content h5,
.blog-content h6 {
  color: #0f172a;
  font-weight: 800;
  line-height: 1.55;
  margin: 2.4rem 0 1rem;
  scroll-margin-top: 90px;
}

.blog-content h1 { font-size: 1.85rem; }
.blog-content h2 {
  font-size: 1.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}
.blog-content h3 { font-size: 1.3rem; }
.blog-content h4 { font-size: 1.12rem; }
.blog-content h5,
.blog-content h6 { font-size: 1rem; }

.blog-content a {
  color: #1a73e8;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.blog-content strong,
.blog-content b {
  color: #0f172a;
  font-weight: 700;
}

.blog-content ul,
.blog-content ol {
  margin: 0 0 1.5rem;
  padding-inline-start: 1.6rem;
}

.blog-content li {
  margin-bottom: 0.55rem;
}

.blog-content li::marker {
  color: #1a73e8;
}

.blog-content ul[data-type='taskList'] {
  list-style: none;
  padding-inline-start: 0.25rem;
}

.blog-content ul[data-type='taskList'] li {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}

.blog-content blockquote {
  margin: 1.8rem 0;
  padding: 1rem 1.25rem;
  border-inline-start: 4px solid #1a73e8;
  background: #f1f7ff;
  border-radius: 0.75rem;
  color: #334155;
  font-style: normal;
}

.blog-content blockquote p:last-child {
  margin-bottom: 0;
}

.blog-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.8rem auto;
  border-radius: 0.9rem;
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.08);
}

.blog-content figure {
  margin: 1.8rem 0;
}

.blog-content figcaption {
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
  margin-top: -1rem;
}

.blog-content hr {
  border: 0;
  height: 1px;
  background: #e2e8f0;
  margin: 2.5rem 0;
  opacity: 1;
}

.blog-content code {
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.88em;
  background: #f1f5f9;
  color: #be185d;
  padding: 0.15em 0.4em;
  border-radius: 0.35rem;
  direction: ltr;
  unicode-bidi: embed;
}

.blog-content pre {
  direction: ltr;
  text-align: left;
  background: #0f172a;
  color: #e2e8f0;
  padding: 1.1rem 1.25rem;
  border-radius: 0.9rem;
  overflow-x: auto;
  margin: 1.8rem 0;
  font-size: 0.9rem;
  line-height: 1.7;
  white-space: pre;
}

.blog-content pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

.blog-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.8rem 0;
  font-size: 0.95rem;
  display: block;
  overflow-x: auto;
}

.blog-content th,
.blog-content td {
  border: 1px solid #e2e8f0;
  padding: 0.65rem 0.85rem;
  text-align: start;
  vertical-align: top;
}

.blog-content th {
  background: #f8fafc;
  font-weight: 700;
}

.blog-content tr:nth-child(even) td {
  background: #fcfdff;
}

.blog-content iframe,
.blog-content video {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  border-radius: 0.9rem;
  margin: 1.8rem 0;
}

.blog-content mark {
  background: #fef08a;
  padding: 0 0.2em;
  border-radius: 0.2rem;
}

.blog-content .ql-align-center,
.blog-content [style*='text-align: center'] { text-align: center; }
.blog-content .ql-align-right { text-align: right; }
.blog-content .ql-align-left { text-align: left; }
.blog-content .ql-align-justify { text-align: justify; }
.blog-content .ql-direction-rtl { direction: rtl; }

/* ---------- Related ---------- */
.nv-related {
  max-width: 1100px;
  margin: 3.5rem auto 0;
}

.nv-related__title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  color: #0f172a;
}

.nv-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #64748b;
}
