/* ============================================================
   HALLY PHARMA — Blog Article & Blog Index Styles
   ============================================================ */

/* ===== Blog index hero ===== */
.blog-hero {
  background: var(--purple-dark);
  padding: 100px 0 60px;
  color: var(--white);
  text-align: center;
}

.blog-hero .section-tag {
  background: rgba(255,255,255,0.12);
  color: var(--white);
  margin: 0 auto 20px;
}

.blog-hero h1 {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.2;
}

.blog-hero p {
  font-size: 18px;
  color: rgba(255,255,255,0.7);
  max-width: 540px;
  margin: 0 auto;
}

.blog-index-main {
  padding: 64px 0 100px;
  background: var(--gray-50);
  min-height: 60vh;
}

/* ===== Article page ===== */
.article-main {
  padding-top: 100px;
  padding-bottom: 80px;
}

/* Breadcrumb */
.article-breadcrumb {
  margin-bottom: 40px;
}

.breadcrumb-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-500);
  transition: color var(--transition);
}

.breadcrumb-link:hover {
  color: var(--purple);
}

/* Article header */
.article-header {
  max-width: 760px;
  margin-bottom: 56px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.article-title {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  line-height: 1.2;
  color: var(--gray-900);
  margin-bottom: 18px;
}

.article-lead {
  font-size: 18px;
  color: var(--gray-600);
  line-height: 1.75;
  margin-bottom: 32px;
}

.article-cover {
  display: block;
  max-width: 80%;
  max-height: 520px;
  object-fit: contain;
  border-radius: var(--radius-lg);
  margin: 0 auto 48px;
}

.article-byline {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--gray-500);
}

.byline-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--purple-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Layout: article + sidebar */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 64px;
  align-items: start;
}

/* Article body typography */
.article-body {
  font-size: 16px;
  line-height: 1.8;
  color: var(--gray-700);
}

.article-body h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-900);
  margin-top: 52px;
  margin-bottom: 16px;
  padding-top: 52px;
  border-top: 1px solid var(--gray-200);
}

.article-body h2:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.article-body h3 {
  font-size: 19px;
  font-weight: 700;
  color: var(--gray-800);
  margin-top: 36px;
  margin-bottom: 12px;
}

.article-body h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-800);
  margin-top: 28px;
  margin-bottom: 10px;
}

.article-body p {
  margin-bottom: 20px;
}

.article-body p:last-child {
  margin-bottom: 0;
}

.article-body ul {
  list-style: disc;
  margin: 0 0 20px 24px;
}

.article-body ol {
  list-style: decimal;
  margin: 0 0 20px 24px;
}

.article-body li {
  margin-bottom: 8px;
}

.article-body strong {
  font-weight: 700;
  color: var(--gray-800);
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: 40px 0;
}

/* Blockquote */
.article-body blockquote {
  border-left: 3px solid var(--purple);
  padding: 14px 20px;
  margin: 24px 0;
  background: var(--gray-50);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--gray-600);
}

.article-body blockquote p:last-child {
  margin-bottom: 0;
}

/* Formula / code box */
.formula-box {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 24px 0;
  font-family: 'Courier New', 'Consolas', monospace;
  font-size: 15px;
  font-weight: 600;
  color: var(--purple-dark);
}

.formula-vars {
  list-style: none;
  margin: 12px 0 0 0;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  color: var(--gray-600);
}

.formula-vars li {
  margin-bottom: 4px;
  padding-left: 4px;
}

/* Callout box */
.article-callout {
  background: rgba(117, 81, 232, 0.06);
  border-left: 3px solid var(--purple);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 22px;
  margin: 24px 0;
}

.article-callout p:last-child {
  margin-bottom: 0;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  margin: 24px 0;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 400px;
}

.article-body th {
  background: var(--purple-dark);
  color: var(--white);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}

.article-body td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--gray-200);
  vertical-align: top;
}

.article-body tr:last-child td {
  border-bottom: none;
}

.article-body tr:nth-child(even) td {
  background: var(--gray-50);
}

/* Sidebar */
.article-sidebar {
  position: sticky;
  top: 100px;
}

.sidebar-cta {
  background: var(--purple-dark);
  border-radius: var(--radius-lg);
  padding: 28px;
  color: var(--white);
}

.sidebar-cta h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.4;
}

.sidebar-cta p {
  font-size: 14px;
  line-height: 1.65;
  color: rgba(255,255,255,0.72);
  margin-bottom: 20px;
}

.sidebar-cta .btn-accent {
  width: 100%;
  justify-content: center;
}

/* Article footer nav */
.article-footer-nav {
  display: flex;
  justify-content: center;
  padding-top: 56px;
  margin-top: 56px;
  border-top: 1px solid var(--gray-200);
}

/* Active nav link */
.nav-links a.active {
  color: var(--purple);
  font-weight: 600;
}

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .article-layout {
    grid-template-columns: 1fr;
  }

  .article-sidebar {
    position: static;
    order: -1;
  }

  .sidebar-cta {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0 20px;
    align-items: start;
  }

  .sidebar-cta h3 { grid-column: 1 / -1; }
  .sidebar-cta p  { grid-column: 1; margin-bottom: 0; }
  .sidebar-cta a  { grid-column: 2; grid-row: 2; align-self: center; width: auto; }
}

@media (max-width: 600px) {
  .article-main {
    padding-top: 80px;
    padding-bottom: 60px;
  }

  .article-lead {
    font-size: 16px;
  }

  .sidebar-cta {
    display: block;
  }

  .sidebar-cta p {
    margin-bottom: 16px;
  }
}
