/**
 * Single blog post UI (Hamyar-inspired layout).
 * Scoped to body.hpq-blog-single
 */

body.hpq-blog-single {
  background: var(--hpq-bg, #f5f7f6);
}

body.hpq-blog-single .site-main.hpq-post-page {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0 0 3rem;
  background: transparent;
}

.hpq-post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17.5rem;
  gap: 2.25rem;
  width: min(100% - 2rem, 72rem);
  margin: 0 auto;
  padding: 1.75rem 0 0;
  font-family: var(--hpq-font, "Vazirmatn", Tahoma, ui-sans-serif, system-ui, sans-serif);
  color: var(--hpq-ink, #1a1a1a);
}

.hpq-post-main {
  min-width: 0;
}

.hpq-post-article {
  background: var(--hpq-white, #fff);
  border: 1px solid var(--hpq-border, #e5e7eb);
  border-radius: 12px;
  padding: 1.75rem 1.75rem 1.5rem;
  box-shadow: 0 1px 2px rgba(47, 101, 98, 0.04);
}

.hpq-post-title {
  margin: 0 0 0.85rem;
  font-size: clamp(1.45rem, 2.4vw, 1.95rem);
  font-weight: 800;
  line-height: 1.45;
  color: var(--hpq-ink, #1a1a1a);
  letter-spacing: -0.01em;
}

.hpq-post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 1rem;
  margin: 0 0 1.35rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--hpq-border, #e5e7eb);
  font-size: 0.8125rem;
  color: var(--hpq-muted, #525252);
}

.hpq-post-meta__item {
  color: inherit;
  text-decoration: none;
}

.hpq-post-meta a.hpq-post-meta__item:hover,
.hpq-post-meta a.hpq-post-meta__item:focus-visible {
  color: var(--hpq-teal-deep, #2f6562);
}

.hpq-post-meta__cat {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--hpq-teal-deep, #2f6562);
  background: rgba(15, 118, 110, 0.1);
}

.hpq-post-cover {
  margin: 0 0 1.5rem;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, #e8f1ef, #f3ebe3);
}

.hpq-post-cover img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.hpq-post-body {
  font-size: 1.02rem;
  line-height: 1.9;
  color: #2a2a2a;
}

.hpq-post-body > *:first-child {
  margin-top: 0;
}

.hpq-post-body p {
  margin: 0 0 1.15rem;
  text-align: justify;
  text-justify: inter-word;
}

.hpq-post-body p:last-child {
  margin-bottom: 0;
}

.hpq-post-body h2,
.hpq-post-body h3 {
  margin: 1.75rem 0 0.75rem;
  line-height: 1.45;
  font-weight: 800;
  color: var(--hpq-ink, #1a1a1a);
}

.hpq-post-body h2 {
  font-size: 1.28rem;
}

.hpq-post-body h3 {
  font-size: 1.12rem;
}

.hpq-post-body strong {
  font-weight: 700;
  color: var(--hpq-ink, #1a1a1a);
}

.hpq-post-body a {
  color: var(--hpq-teal-deep, #2f6562);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hpq-post-body ul,
.hpq-post-body ol {
  margin: 0 0 1.15rem;
  padding-right: 1.25rem;
}

.hpq-post-body li {
  margin-bottom: 0.4rem;
}

.hpq-post-body img,
.hpq-post-body figure {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.hpq-post-body blockquote {
  margin: 1.25rem 0;
  padding: 0.85rem 1rem;
  border-right: 3px solid var(--hpq-teal, #54a29e);
  background: rgba(15, 118, 110, 0.06);
  color: var(--hpq-muted, #525252);
}

/* Mid-content CTA */
.hpq-post-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1.25rem;
  margin: 1.5rem 0;
  padding: 0.95rem 1.1rem;
  border-radius: 8px;
  background: #1a1a1a;
  color: #fff;
}

.hpq-post-cta__text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}

.hpq-post-cta__text strong {
  font-size: 0.95rem;
  color: #fff;
}

.hpq-post-cta__text span {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.72);
}

.hpq-post-cta__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.15rem;
  border-radius: 6px;
  background: var(--hpq-copper, #b87333);
  color: #fff !important;
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.hpq-post-cta__btn:hover,
.hpq-post-cta__btn:focus-visible {
  background: var(--hpq-copper-dark, #9a5f28);
}

.hpq-post-cta__tools {
  margin: 10px 0 0;
  width: 100%;
  font-size: 0.9rem;
  line-height: 1.6;
}

.hpq-post-cta__tools a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Tags */
.hpq-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1.5rem 0 0;
  padding-top: 1.15rem;
  border-top: 1px solid var(--hpq-border, #e5e7eb);
}

.hpq-post-tags__label {
  width: 100%;
  margin: 0 0 0.2rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--hpq-ink, #1a1a1a);
}

.hpq-post-tag {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--hpq-ink, #1a1a1a);
  background: rgba(26, 26, 26, 0.06);
}

.hpq-post-tag:hover,
.hpq-post-tag:focus-visible {
  background: rgba(15, 118, 110, 0.12);
  color: var(--hpq-teal-deep, #2f6562);
}

/* Share */
.hpq-post-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 1.25rem 0 0;
}

.hpq-post-share__label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--hpq-muted, #525252);
  margin-left: 0.35rem;
}

.hpq-post-share__btn {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--hpq-border, #e5e7eb);
  border-radius: 6px;
  background: #fff;
  color: var(--hpq-ink, #1a1a1a);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.hpq-post-share__btn:hover,
.hpq-post-share__btn:focus-visible,
.hpq-post-share__btn.is-copied {
  border-color: var(--hpq-teal, #54a29e);
  color: var(--hpq-teal-deep, #2f6562);
}

/* Reactions (like / dislike) */
.hpq-post-react {
  margin: 1.5rem 0 0;
  padding: 1.15rem 1.1rem;
  border: 1px solid var(--hpq-border, #e5e7eb);
  border-radius: 10px;
  background: rgba(15, 118, 110, 0.04);
}

.hpq-post-react__title {
  display: block;
  margin: 0 0 0.25rem;
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--hpq-ink, #1a1a1a);
}

.hpq-post-react__hint {
  margin: 0 0 0.95rem;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--hpq-muted, #525252);
}

.hpq-post-react__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.hpq-post-react__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--hpq-border, #e5e7eb);
  border-radius: 8px;
  background: #fff;
  color: var(--hpq-ink, #1a1a1a);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.hpq-post-react__btn:hover,
.hpq-post-react__btn:focus-visible {
  border-color: var(--hpq-teal, #54a29e);
  color: var(--hpq-teal-deep, #2f6562);
}

.hpq-post-react__btn--like.is-active {
  border-color: var(--hpq-teal, #54a29e);
  background: rgba(84, 162, 158, 0.14);
  color: var(--hpq-teal-deep, #2f6562);
}

.hpq-post-react__btn--dislike.is-active {
  border-color: var(--hpq-copper, #b87333);
  background: rgba(184, 115, 51, 0.12);
  color: var(--hpq-copper-dark, #9a5f28);
}

.hpq-post-react__icon {
  font-size: 0.7rem;
  line-height: 1;
}

.hpq-post-react__count {
  display: inline-flex;
  min-width: 1.4rem;
  justify-content: center;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: rgba(26, 26, 26, 0.06);
  font-size: 0.78rem;
  font-weight: 700;
}

.hpq-post-react__btn.is-active .hpq-post-react__count {
  background: rgba(255, 255, 255, 0.55);
}

.hpq-post-react__value {
  margin-top: 0.95rem;
}

.hpq-post-react__bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(26, 26, 26, 0.08);
  overflow: hidden;
}

.hpq-post-react__bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--hpq-teal, #54a29e), var(--hpq-teal-deep, #2f6562));
  transition: width 0.25s ease;
}

.hpq-post-react__summary {
  margin: 0.55rem 0 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--hpq-teal-deep, #2f6562);
}

.hpq-post-react__msg {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  color: var(--hpq-muted, #525252);
}

.hpq-post-react.is-loading {
  opacity: 0.72;
  pointer-events: none;
}

/* Author */
.hpq-post-author {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  margin: 1.5rem 0 0;
  padding: 1rem;
  border: 1px solid var(--hpq-border, #e5e7eb);
  border-radius: 10px;
  background: rgba(15, 118, 110, 0.04);
}

.hpq-post-author__avatar {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
}

.hpq-post-author__name {
  display: inline-block;
  margin-bottom: 0.25rem;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--hpq-ink, #1a1a1a);
  text-decoration: none;
}

.hpq-post-author__name:hover,
.hpq-post-author__name:focus-visible {
  color: var(--hpq-teal-deep, #2f6562);
}

.hpq-post-author__bio {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--hpq-muted, #525252);
}

/* Related */
.hpq-post-related {
  margin: 2rem 0 0;
  padding: 1.5rem 1.25rem;
  border-radius: 12px;
  background: #2c3338;
  color: #fff;
}

.hpq-post-related__title {
  margin: 0 0 1.15rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
}

.hpq-post-related__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.hpq-post-related__card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.hpq-post-related__img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 8px;
  background: #3d454c;
}

.hpq-post-related__card-title {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.45;
  color: #fff;
}

.hpq-post-related__card-excerpt {
  font-size: 0.78rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.65);
}

.hpq-post-related__card:hover .hpq-post-related__card-title,
.hpq-post-related__card:focus-visible .hpq-post-related__card-title {
  color: var(--hpq-teal-light, #7ec4c0);
}

/* Sidebar */
.hpq-post-sidebar {
  min-width: 0;
}

@media (min-width: 961px) {
  .hpq-post-sidebar {
    position: sticky;
    top: calc(var(--hh-sticky-offset, 0px) + 5.5rem);
    align-self: start;
  }
}

.hpq-post-widget {
  margin: 0 0 1.25rem;
  padding: 1.1rem 1rem;
  background: var(--hpq-white, #fff);
  border: 1px solid var(--hpq-border, #e5e7eb);
  border-radius: 10px;
}

.hpq-post-widget__title {
  margin: 0 0 0.85rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--hpq-border, #e5e7eb);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--hpq-ink, #1a1a1a);
}

.hpq-post-widget__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hpq-post-widget__list li {
  margin: 0;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(229, 231, 235, 0.8);
}

.hpq-post-widget__list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.hpq-post-widget__list a {
  display: block;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--hpq-ink, #1a1a1a);
  text-decoration: none;
}

.hpq-post-widget__list a:hover,
.hpq-post-widget__list a:focus-visible {
  color: var(--hpq-teal-deep, #2f6562);
}

.hpq-post-widget__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.hpq-post-widget__tags a {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--hpq-muted, #525252);
  background: rgba(26, 26, 26, 0.06);
}

.hpq-post-widget__tags a:hover,
.hpq-post-widget__tags a:focus-visible {
  color: var(--hpq-teal-deep, #2f6562);
  background: rgba(15, 118, 110, 0.12);
}

/* Comments */
body.hpq-blog-single .comments-area {
  margin: 2rem 0 0;
  padding: 1.5rem 1.5rem 1.35rem;
  background: var(--hpq-white, #fff);
  border: 1px solid var(--hpq-border, #e5e7eb);
  border-radius: 12px;
}

body.hpq-blog-single .comments-area .title-comments,
body.hpq-blog-single .comments-area .comment-reply-title {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--hpq-ink, #1a1a1a);
}

body.hpq-blog-single .comment-list {
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}

body.hpq-blog-single .comment-list .comment {
  margin: 0 0 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--hpq-border, #e5e7eb);
}

body.hpq-blog-single .comment-author {
  font-weight: 700;
}

body.hpq-blog-single .comment-content {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #2a2a2a;
}

body.hpq-blog-single .hpq-comment-form label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--hpq-ink, #1a1a1a);
}

body.hpq-blog-single .hpq-comment-form input[type="text"],
body.hpq-blog-single .hpq-comment-form input[type="email"],
body.hpq-blog-single .hpq-comment-form input[type="url"],
body.hpq-blog-single .hpq-comment-form textarea {
  width: 100%;
  max-width: 100%;
  margin-bottom: 0.85rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--hpq-border, #e5e7eb);
  border-radius: 8px;
  background: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--hpq-ink, #1a1a1a);
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}

body.hpq-blog-single .hpq-comment-form textarea {
  min-height: 8rem;
  resize: vertical;
}

body.hpq-blog-single .hpq-comment-form input:focus,
body.hpq-blog-single .hpq-comment-form textarea:focus {
  outline: none;
  border-color: var(--hpq-teal, #54a29e);
  box-shadow: 0 0 0 3px rgba(84, 162, 158, 0.18);
}

body.hpq-blog-single .hpq-comment-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.25rem;
  padding: 0.7rem 1.4rem;
  border: 0;
  border-radius: 8px;
  background: var(--hpq-copper, #b87333);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

body.hpq-blog-single .hpq-comment-submit:hover,
body.hpq-blog-single .hpq-comment-submit:focus-visible {
  background: var(--hpq-copper-dark, #9a5f28);
}

body.hpq-blog-single .must-log-in {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  background: rgba(15, 118, 110, 0.06);
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--hpq-muted, #525252);
}

body.hpq-blog-single .must-log-in a {
  color: var(--hpq-teal-deep, #2f6562);
  font-weight: 700;
}

/* Legacy class safety (if old markup appears) */
.site-main:has(.hpq-post-layout) .post-tags {
  display: none;
}

@media (max-width: 960px) {
  .hpq-post-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-top: 1.25rem;
  }

  .hpq-post-article {
    padding: 1.25rem 1.1rem 1.15rem;
  }

  .hpq-post-related__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hpq-post-sidebar {
    order: 2;
  }
}

@media (max-width: 560px) {
  .hpq-post-layout {
    width: min(100% - 1.25rem, 72rem);
  }

  .hpq-post-related {
    padding: 1.15rem 0.9rem;
  }

  .hpq-post-related__grid {
    grid-template-columns: 1fr;
  }

  .hpq-post-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .hpq-post-cta__btn {
    text-align: center;
  }

  body.hpq-blog-single .comments-area {
    padding: 1.15rem 1rem;
  }
}
