/**
 * Blog Detail Page Styles
 * Al Hussan Tech - الحصان تك
 */

/* ===== READING PROGRESS BAR ===== */
.bd-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--clr-accent, #a855f7), var(--clr-primary, #542187));
  z-index: 10000;
  transition: width 0.1s linear;
}

/* ===== COMPACT HERO ===== */
.bd-hero {
  position: relative;
  padding: 8rem 0 2.5rem;
  background: linear-gradient(135deg, #1d0a32 0%, #2d1149 50%, #1a0a2e 100%);
  overflow: hidden;
}

.bd-hero__decor {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.bd-hero__decor--1 {
  width: 250px;
  height: 250px;
  top: -80px;
  right: -40px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.12) 0%, transparent 70%);
  animation: blogFloat 8s ease-in-out infinite;
}

.bd-hero__decor--2 {
  width: 180px;
  height: 180px;
  bottom: -50px;
  left: 10%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.08) 0%, transparent 70%);
  animation: blogFloat2 10s ease-in-out infinite;
}

.bd-hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
}

.bd-hero__breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.85rem;
}

.bd-hero__breadcrumb a {
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: color 0.3s;
}

.bd-hero__breadcrumb a:hover {
  color: var(--clr-accent, #a855f7);
}

.bd-hero__breadcrumb svg {
  width: 14px;
  height: 14px;
  opacity: 0.4;
}

.bd-hero__breadcrumb span {
  color: rgba(255, 255, 255, 0.85);
}

/* ===== ARTICLE HEADER ===== */
.bd-header {
  padding: 2.5rem 0 1.5rem;
}

.bd-header__inner {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.bd-header__cat {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 1rem;
  border-radius: 50px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(84, 33, 135, 0.12));
  color: var(--clr-accent, #a855f7);
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.bd-header__cat svg {
  width: 14px;
  height: 14px;
}

.bd-header__title {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 700;
  color: var(--clr-heading, #1e1b4b);
  line-height: 1.35;
  margin-bottom: 1.2rem;
}

.bd-header__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.2rem;
  font-size: 0.85rem;
  color: var(--clr-body, #64748b);
}

.bd-header__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.bd-header__meta-item svg {
  width: 15px;
  height: 15px;
  opacity: 0.6;
}

.bd-header__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(84, 33, 135, 0.15));
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bd-header__avatar svg {
  width: 16px;
  height: 16px;
  stroke: var(--clr-accent, #a855f7);
  opacity: 1;
}

/* ===== COVER IMAGE ===== */
.bd-cover {
  max-width: 920px;
  margin: 0 auto 2.5rem;
  padding: 0 1rem;
}

.bd-cover__figure {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(84, 33, 135, 0.1);
}

.bd-cover__figure img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.bd-cover__caption {
  text-align: center;
  font-size: 0.8rem;
  color: var(--clr-body, #64748b);
  margin-top: 0.8rem;
  font-style: italic;
}

/* ===== ARTICLE LAYOUT ===== */
.bd-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

/* ===== ARTICLE BODY ===== */
.bd-body {
  min-width: 0;
}

.bd-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--clr-heading, #1e1b4b);
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(168, 85, 247, 0.15);
}

.bd-body h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--clr-heading, #1e1b4b);
  margin: 1.5rem 0 0.8rem;
}

.bd-body p {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--clr-body, #475569);
  margin-bottom: 1.2rem;
}

.bd-body ul,
.bd-body ol {
  margin: 1rem 0 1.2rem 1.5rem;
  padding: 0;
}

[dir="rtl"] .bd-body ul,
[dir="rtl"] .bd-body ol {
  margin-left: 0;
  margin-right: 1.5rem;
}

.bd-body li {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--clr-body, #475569);
  margin-bottom: 0.5rem;
}

.bd-body blockquote {
  position: relative;
  padding: 1.2rem 1.5rem;
  margin: 1.5rem 0;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.06), rgba(84, 33, 135, 0.04));
  border-radius: 12px;
  border-right: 4px solid var(--clr-accent, #a855f7);
  font-style: italic;
  color: var(--clr-heading, #1e1b4b);
}

[dir="ltr"] .bd-body blockquote {
  border-right: none;
  border-left: 4px solid var(--clr-accent, #a855f7);
}

.bd-body code {
  background: rgba(168, 85, 247, 0.08);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--clr-primary, #542187);
}

.bd-body img {
  max-width: 100%;
  border-radius: 12px;
  margin: 1.5rem 0;
}

/* ===== TAGS ===== */
.bd-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1.5rem 0;
  margin-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.bd-tags__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--clr-heading, #1e1b4b);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.5rem;
}

[dir="ltr"] .bd-tags__label {
  margin-left: 0;
  margin-right: 0.5rem;
}

.bd-tags__label svg {
  width: 16px;
  height: 16px;
}

.bd-tag {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border-radius: 50px;
  background: rgba(168, 85, 247, 0.08);
  color: var(--clr-accent, #a855f7);
  font-size: 0.78rem;
  text-decoration: none;
  transition: all 0.3s;
}

.bd-tag:hover {
  background: var(--clr-accent, #a855f7);
  color: #fff;
}

/* ===== SHARE SECTION ===== */
.bd-share {
  padding: 1.5rem 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.bd-share__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--clr-heading, #1e1b4b);
  margin-bottom: 0.8rem;
}

.bd-share__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.bd-share__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
  transition: all 0.3s;
}

.bd-share__btn svg {
  width: 16px;
  height: 16px;
}

.bd-share__btn--x { background: #000; }
.bd-share__btn--facebook { background: #1877f2; }
.bd-share__btn--linkedin { background: #0a66c2; }
.bd-share__btn--whatsapp { background: #25d366; }
.bd-share__btn--copy {
  background: rgba(168, 85, 247, 0.12);
  color: var(--clr-accent, #a855f7);
}

.bd-share__btn:hover {
  opacity: 0.85;
  transform: translateY(-2px);
}

/* ===== SIDEBAR ===== */
.bd-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: sticky;
  top: 90px;
  align-self: start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 85, 247, 0.2) transparent;
}

.bd-sidebar::-webkit-scrollbar {
  width: 4px;
}

.bd-sidebar::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.2);
  border-radius: 4px;
}

/* TOC Widget */
.bd-toc {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 1.2rem;
  border: 1px solid rgba(168, 85, 247, 0.1);
}

.bd-toc__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--clr-heading, #1e1b4b);
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.bd-toc__title svg {
  width: 16px;
  height: 16px;
  stroke: var(--clr-accent, #a855f7);
}

.bd-toc__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.bd-toc__item {
  margin-bottom: 0.3rem;
}

.bd-toc__item a {
  display: block;
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
  color: var(--clr-body, #64748b);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s;
  border-right: 2px solid transparent;
}

[dir="ltr"] .bd-toc__item a {
  border-right: none;
  border-left: 2px solid transparent;
}

.bd-toc__item a:hover,
.bd-toc__item a.active {
  color: var(--clr-accent, #a855f7);
  background: rgba(168, 85, 247, 0.06);
  border-right-color: var(--clr-accent, #a855f7);
}

[dir="ltr"] .bd-toc__item a:hover,
[dir="ltr"] .bd-toc__item a.active {
  border-left-color: var(--clr-accent, #a855f7);
}

.bd-toc__item--h3 a {
  padding-right: 1.6rem;
  font-size: 0.78rem;
}

[dir="ltr"] .bd-toc__item--h3 a {
  padding-right: 0.8rem;
  padding-left: 1.6rem;
}

/* Author Card Widget */
.bd-sidebar-author {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 1.2rem;
  border: 1px solid rgba(168, 85, 247, 0.1);
  text-align: center;
}

.bd-sidebar-author__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(84, 33, 135, 0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.6rem;
}

.bd-sidebar-author__avatar svg {
  width: 28px;
  height: 28px;
  stroke: var(--clr-accent, #a855f7);
}

.bd-sidebar-author__name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--clr-heading, #1e1b4b);
  margin-bottom: 0.3rem;
}

.bd-sidebar-author__role {
  font-size: 0.78rem;
  color: var(--clr-body, #64748b);
  margin-bottom: 0.5rem;
}

.bd-sidebar-author__bio {
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--clr-body, #64748b);
}

/* Sidebar Newsletter */
.bd-sidebar-nl {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 1.2rem;
  border: 1px solid rgba(168, 85, 247, 0.1);
}

.bd-sidebar-nl__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--clr-heading, #1e1b4b);
  margin-bottom: 0.4rem;
}

.bd-sidebar-nl__desc {
  font-size: 0.8rem;
  color: var(--clr-body, #64748b);
  line-height: 1.5;
  margin-bottom: 0.8rem;
}

.bd-sidebar-nl__form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bd-sidebar-nl__input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(168, 85, 247, 0.15);
  background: rgba(255, 255, 255, 0.8);
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.3s;
}

.bd-sidebar-nl__input:focus {
  border-color: var(--clr-accent, #a855f7);
}

.bd-sidebar-nl__btn {
  width: 100%;
  padding: 0.6rem;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, var(--clr-primary, #542187), var(--clr-accent, #a855f7));
  color: #fff;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.3s;
}

.bd-sidebar-nl__btn:hover {
  opacity: 0.9;
}

/* ===== AUTHOR BIO SECTION ===== */
.bd-author-bio {
  max-width: 860px;
  margin: 0 auto 2rem;
  padding: 0 1rem;
}

.bd-author-bio__card {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  border: 1px solid rgba(168, 85, 247, 0.1);
}

.bd-author-bio__avatar {
  width: 72px;
  height: 72px;
  min-width: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(84, 33, 135, 0.15));
  display: flex;
  align-items: center;
  justify-content: center;
}

.bd-author-bio__avatar svg {
  width: 36px;
  height: 36px;
  stroke: var(--clr-accent, #a855f7);
}

.bd-author-bio__info {
  flex: 1;
}

.bd-author-bio__label {
  font-size: 0.75rem;
  color: var(--clr-accent, #a855f7);
  font-weight: 500;
  margin-bottom: 0.2rem;
}

.bd-author-bio__name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--clr-heading, #1e1b4b);
  margin-bottom: 0.2rem;
}

.bd-author-bio__role {
  font-size: 0.82rem;
  color: var(--clr-body, #94a3b8);
  margin-bottom: 0.6rem;
}

.bd-author-bio__text {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--clr-body, #64748b);
}

/* ===== RELATED ARTICLES ===== */
.bd-related {
  padding: 3rem 0;
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.02) 0%, rgba(84, 33, 135, 0.04) 100%);
}

.bd-related__header {
  text-align: center;
  margin-bottom: 2rem;
}

.bd-related__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 1.2rem;
  border-radius: 50px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(84, 33, 135, 0.12));
  color: var(--clr-accent, #a855f7);
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 0.8rem;
}

.bd-related__badge svg {
  width: 14px;
  height: 14px;
}

.bd-related__title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--clr-heading, #1e1b4b);
}

.bd-related__title span {
  background: linear-gradient(135deg, var(--clr-primary, #542187), var(--clr-accent, #a855f7));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bd-related__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* ===== COMMENTS ===== */
.bd-comments {
  max-width: 860px;
  margin: 0 auto;
  padding: 2.5rem 1rem;
}

.bd-comments__title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--clr-heading, #1e1b4b);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bd-comments__title svg {
  width: 22px;
  height: 22px;
  stroke: var(--clr-accent, #a855f7);
}

.bd-comments__form {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid rgba(168, 85, 247, 0.1);
  margin-bottom: 2rem;
}

.bd-comments__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.bd-comments__input,
.bd-comments__textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(168, 85, 247, 0.15);
  background: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.3s;
  font-family: inherit;
}

.bd-comments__input:focus,
.bd-comments__textarea:focus {
  border-color: var(--clr-accent, #a855f7);
}

.bd-comments__textarea {
  resize: vertical;
  min-height: 120px;
  margin-bottom: 1rem;
}

.bd-comments__submit {
  padding: 0.7rem 2rem;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--clr-primary, #542187), var(--clr-accent, #a855f7));
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.3s, transform 0.3s;
}

.bd-comments__submit:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Comment List */
.bd-comments__list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bd-comment {
  display: flex;
  gap: 1rem;
  padding: 1.2rem;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  border: 1px solid rgba(168, 85, 247, 0.06);
}

.bd-comment__avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(84, 33, 135, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
}

.bd-comment__avatar svg {
  width: 20px;
  height: 20px;
  stroke: var(--clr-accent, #a855f7);
}

.bd-comment__body {
  flex: 1;
}

.bd-comment__header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.4rem;
}

.bd-comment__name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--clr-heading, #1e1b4b);
}

.bd-comment__date {
  font-size: 0.75rem;
  color: var(--clr-body, #94a3b8);
}

.bd-comment__text {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--clr-body, #64748b);
}

/* ===== SCROLL ANIMATIONS (reuse blog.css keyframes) ===== */
.bd-animate {
  opacity: 0;
  transform: translateY(25px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.bd-animate.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
  .bd-layout {
    grid-template-columns: 1fr;
  }

  .bd-sidebar {
    order: 2;
    position: static;
    max-height: none;
    overflow-y: visible;
    gap: 1.5rem;
  }

  .bd-related__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .bd-hero {
    padding: 6rem 0 1.5rem;
  }

  .bd-header__title {
    font-size: 1.3rem;
  }

  .bd-header__meta {
    gap: 0.6rem;
    font-size: 0.78rem;
  }

  .bd-author-bio__card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .bd-comments__row {
    grid-template-columns: 1fr;
  }

  .bd-related__grid {
    grid-template-columns: 1fr;
  }

  .bd-share__btns {
    justify-content: center;
  }
}

@media (max-width: 576px) {
  .bd-hero {
    padding: 5.5rem 0 1rem;
  }

  .bd-hero .blog-hero__breadcrumb {
    font-size: 0.72rem;
    margin-bottom: 0.8rem;
  }

  .bd-header__title {
    font-size: 1.15rem;
  }

  .bd-cover {
    padding: 0 0.5rem;
    margin-bottom: 1.5rem;
  }

  .bd-layout {
    padding: 0 0.5rem 2rem;
    gap: 1.5rem;
  }

  .bd-body h2 {
    font-size: 1.15rem;
  }

  .bd-body h3 {
    font-size: 1rem;
  }

  .bd-body {
    font-size: 0.88rem;
  }

  .bd-body h2 {
    margin: 1.2rem 0 0.8rem;
  }

  .bd-body h3 {
    margin: 1rem 0 0.6rem;
  }

  .bd-body ul,
  .bd-body ol {
    margin: 0.8rem 0 1rem 1rem;
  }

  .bd-share__btns {
    gap: 0.35rem;
  }

  .bd-share__btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
  }

  .bd-comments {
    padding: 1.5rem 0.5rem;
  }

  .bd-comments__input,
  .bd-comments__textarea {
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
  }

  .bd-comments__textarea {
    min-height: 100px;
  }

  .bd-header__meta {
    gap: 0.4rem;
    font-size: 0.72rem;
  }
}
