/* =========================================================
   Blog list + post detail — scoped fixes over site-theme /
   Bootstrap / bloglist Tailwind collisions. Do not edit
   site-theme globally for these pages.
   ========================================================= */

/* ── Blog list page ── */

.blog-list-page {
  width: 100%;
}

/* Yekan / IRANYekanX files are missing; use Vazirmatn loaded in base.html */
body,
.blog-list-page,
.blog-list-page input,
.blog-list-page textarea,
.blog-list-page button,
.blog-list-page select,
.blog-list-page a,
.blog-list-page p,
.blog-list-page span,
.blog-list-page h1,
.blog-list-page h2,
.blog-list-page h3,
.blog-list-page label,
.blog-list-page li,
.blog-list-page strong {
  font-family: Vazirmatn, Tahoma, sans-serif !important;
  font-variation-settings: normal;
}

.blog-list-page .fa,
.blog-list-page .fas,
.blog-list-page .far,
.blog-list-page .fab,
.blog-list-page .fa-solid,
.blog-list-page .fa-regular,
.blog-list-page .fa-brands {
  font-family: "Font Awesome 6 Free" !important;
}

.blog-list-page .fab,
.blog-list-page .fa-brands {
  font-family: "Font Awesome 6 Brands" !important;
}

/* Category panel + checkboxes — see also blog-search.css */
.blog-list-page .blog-cat-panel {
  width: 100%;
  box-sizing: border-box;
}

.blog-list-page .blog-cat-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

.blog-list-page .blog-cat-item.checkbox,
.blog-list-page label.checkbox.blog-cat-item {
  display: grid !important;
  grid-template-columns: 1.125rem minmax(0, 1fr) !important;
  column-gap: 0.75rem !important;
  align-items: center !important;
  width: 100% !important;
  max-width: 100%;
  margin: 0 !important;
  padding: 0.55rem 0.35rem !important;
  box-sizing: border-box;
  direction: inherit;
  cursor: pointer;
  border-radius: 0.5rem;
  transition: background-color 0.15s ease;
}

.blog-list-page .blog-cat-item.checkbox:hover {
  background-color: rgba(0, 120, 212, 0.06);
}

.blog-list-page .blog-cat-item .checkbox__input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  opacity: 0 !important;
  pointer-events: none;
  inset: auto !important;
}

.blog-list-page .blog-cat-item .checkbox__marker {
  grid-column: 1;
  width: 1.125rem !important;
  height: 1.125rem !important;
  margin: 0 !important;
  border-radius: 0.35rem;
  border: 1.5px solid #94a3b8;
  background: #fff !important;
  position: relative;
  box-sizing: border-box;
}

.blog-list-page .blog-cat-item .checkbox__input:checked ~ .checkbox__marker {
  background: #0078d4 !important;
  border-color: #0078d4;
}

.blog-list-page .blog-cat-item .checkbox__input:checked ~ .checkbox__marker::after {
  content: "";
  position: absolute;
  top: 1px;
  right: 4px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.blog-list-page .blog-cat-name {
  grid-column: 2;
  display: block !important;
  min-width: 0;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.55;
  text-align: start !important;
}

.blog-list-page .container-blog {
  width: min(1240px, calc(100% - 32px));
  margin-inline: auto;
}

#blog-posts-results > .grid {
  align-items: stretch;
}

#blog-posts-results > .grid > .blog-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
  overflow: visible;
}

#blog-posts-results .blog-card__media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0.75rem;
  overflow: hidden;
  background: linear-gradient(145deg, #eef2f6 0%, #e2e8f0 100%);
  flex-shrink: 0;
}

#blog-posts-results .blog-card__media img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
  object-fit: cover;
  object-position: center;
}

#blog-posts-results .blog-card__media--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0078d4;
}

#blog-posts-results .blog-card__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 1.25rem;
  justify-content: space-between;
  padding: 0.75rem 1rem 3.25rem;
  position: relative;
  min-height: 0;
}

@media (min-width: 640px) {
  #blog-posts-results .blog-card__body {
    padding: 0.85rem 1.25rem 3.5rem;
  }
}

#blog-posts-results .blog-card__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  min-height: 5.5rem;
}

@media (min-width: 640px) {
  #blog-posts-results .blog-card__text {
    min-height: 6.5rem;
  }
}

#blog-posts-results .blog-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
}

#blog-posts-results .blog-card__meta img {
  width: 1.5rem !important;
  height: 1.5rem !important;
  max-height: none !important;
  min-height: 0 !important;
  object-fit: cover;
  border-radius: 999px;
  flex-shrink: 0;
}

#blog-posts-results .blog-card__cta {
  position: absolute;
  bottom: -1.35rem;
  right: 0;
  left: 0;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: calc(100% - 40px);
  height: 2.75rem;
  border-radius: 0.75rem;
  background: #0078d4;
  color: #fff !important;
  text-decoration: none !important;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.2s ease;
  z-index: 1;
}

#blog-posts-results .blog-card__cta:hover {
  background: #005a9e;
  color: #fff !important;
}

@media (min-width: 640px) {
  #blog-posts-results .blog-card__cta {
    height: 3rem;
  }
}

/* Counter site-theme img { width:100% } on list avatars/icons */
.blog-list-page img.size-4,
.blog-list-page img.size-6 {
  width: 1rem !important;
  height: 1rem !important;
  max-width: none;
}

@media (min-width: 640px) {
  .blog-list-page img.sm\:size-6 {
    width: 1.5rem !important;
    height: 1.5rem !important;
  }
}

/* ── Post detail: neutralize site-theme .article-card chrome ── */

.article-page .post-article,
.article-page article.post-article {
  position: relative;
  display: block;
  gap: 0;
  background: #fff;
  border: 1px solid #e9edf1;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.07);
}

.article-page .post-article::before,
.article-page .article-card::before {
  content: none !important;
  display: none !important;
}

/* Kill homepage card image constraints inside the article */
.article-page .post-article img,
.article-page .article-card img,
.article-page .content-typography img {
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}

/* Tailwind size-full / size-dvh from bloglist.css explode layout when
   editor HTML uses those classes on images/wrappers */
.article-page .content-typography .size-full,
.article-page .content-typography .size-dvh,
.article-page .content-typography [class*="size-full"],
.article-page .content-typography [class*="size-dvh"] {
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}

.article-page,
.article-page .article-main,
.article-page .article-container,
.article-page .article-layout,
.article-page .article-body,
.article-page .content-typography,
.article-page .post-article {
  min-height: 0 !important;
  height: auto !important;
}

.article-page .article-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 28px;
  align-items: start !important;
  grid-auto-rows: auto !important;
}

.article-page .content-typography > * {
  min-height: 0 !important;
  flex: none !important;
  align-self: auto !important;
}

.article-page .article-hero__image {
  width: 100%;
  height: 270px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.article-page .article-hero__image img {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
  object-fit: cover;
  display: block;
}

.article-page .article-hero__image--empty {
  color: rgba(125, 211, 252, 0.85);
}

.article-page .author-avatar {
  width: 38px !important;
  height: 38px !important;
  max-height: none !important;
  min-height: 0 !important;
  object-fit: cover;
  border-radius: 50%;
}

@media (max-width: 1050px) {
  .article-page .article-layout {
    grid-template-columns: 1fr !important;
  }
}
