/* -------------------- Hero -------------------- */
.blog-hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 160px 0 90px;
  background:
    radial-gradient(120% 140% at 85% 0%, rgba(131, 7, 222, 0.55) 0%, rgba(131, 7, 222, 0) 55%),
    linear-gradient(160deg, #1c083a 0%, #0a0328 55%, #07002b 100%);
  color: #fff;
}

.blog-hero__inner {
  position: relative;
  z-index: 2;
  max-width: 720px;
  margin: 0 auto;
}

.blog-hero__title {
  color: #fff;
  font-weight: var(--font-weight-700);
  letter-spacing: -0.3px;
  margin: 0 0 18px;
}

.blog-hero__sub {
  color: rgba(255, 255, 255, 0.72);
  margin: 0 auto;
  max-width: 600px;
}

.blog-hero__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  pointer-events: none;
}

.blog-hero__glow--a {
  width: 320px;
  height: 320px;
  top: -120px;
  right: -60px;
  background: #8307de;
}

.blog-hero__glow--b {
  width: 240px;
  height: 240px;
  bottom: -140px;
  left: -40px;
  background: #4b1e8c;
}

/* -------------------- Section wrapper -------------------- */
.blog-section {
  padding: 64px 0;
}

.blog-section--tint {
  background: linear-gradient(180deg, rgba(131, 7, 222, 0.06) 0%, rgba(131, 7, 222, 0.015) 45%, transparent 100%);
}

/* -------------------- Trending / featured -------------------- */
.blog-trending {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 5px 22px rgba(29, 29, 29, 0.09);
  padding: 32px;
  overflow: hidden;
  position: relative;
}

.blog-trending::after {
  /* soft purple corner accent (Figma banner) */
  content: "";
  position: absolute;
  top: -80px;
  right: -80px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle at 70% 30%, rgba(214, 158, 255, 0.55), rgba(214, 158, 255, 0) 62%);
  pointer-events: none;
}

.blog-trending__title {
  position: relative;
  z-index: 1;
  margin: 0 0 26px;
  font-weight: var(--font-weight-700);
  letter-spacing: -0.3px;
}

.blog-trending__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: stretch;
}

/* Left: list of trending posts — thumbnail LEFT, text RIGHT (matches design) */
.blog-trending__list {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.blog-tpost {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 18px;
  align-items: center;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--color-border);
}

.blog-tpost:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.blog-tpost__thumb {
  width: 100%;
  height: 128px;
  border-radius: var(--radius-md);
  object-fit: cover;
  display: block;
}

.blog-tpost__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.blog-tpost__heading {
  color: var(--color-heading);
  font-weight: var(--font-weight-500);
  margin: 0;
  min-height: 2.6em;
  line-height: 1.3;
}

.blog-tpost__excerpt {
  color: var(--color-body);
  margin: 0;
  min-height: 2.8em;
  line-height: 1.4;
}

.blog-tpost__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 2px;
}

/* Right: one large featured post — info card overlaps the image (matches design) */
.blog-feature {
  position: relative;
  display: flex;
  flex-direction: column;
}

.blog-feature__img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-lg);
}

.blog-feature__body {
  position: relative;
  margin: -74px 24px 0;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 30px rgba(29, 29, 29, 0.12);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.blog-feature__heading {
  color: var(--color-heading);
  font-weight: var(--font-weight-600);
  margin: 0;
  min-height: 2.6em;
  line-height: 1.3;
}

.blog-feature__excerpt {
  color: var(--color-body);
  margin: 0;
  min-height: 4.4em;
  line-height: 1.5;
}

/* -------------------- Meta row (date) -------------------- */
.blog-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-heading);
}

.blog-meta svg {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--color-primary);
}

/* -------------------- Read more pill / link -------------------- */
.blog-readmore {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 18px;
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-pill);
  color: var(--color-primary);
  font-weight: var(--font-weight-500);
  transition: all var(--transition-normal);
  white-space: nowrap;
}

.blog-readmore:hover {
  background: var(--color-primary);
  color: #fff;
}

.blog-readmore svg {
  width: 16px;
  height: 16px;
}

/* -------------------- Category tabs (pillow shape) -------------------- */
.blog-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 46px;
}

/* The pillow tab shape (assets/img/tabs-bg.svg) is applied as a mask so its
   fill follows --tab-bg — lets us theme active/inactive/hover + dark mode. */
.blog-tab::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--tab-bg);
  -webkit-mask: url('../img/tabs-bg.svg') center / cover no-repeat;
  mask: url('../img/tabs-bg.svg') center / cover no-repeat;
  transition: background-color var(--transition-normal);
  z-index: -1;
}

.blog-tab:hover {
  --tab-fg: var(--color-primary);
}

.blog-tab.is-active {
  --tab-bg: var(--color-primary);
  --tab-fg: #fff;
  filter: drop-shadow(0 10px 20px rgba(131, 7, 222, 0.35));
}

.otto-nav-tabs .nav-link.is-active {
  color: #FFFFFF !important;
}

.blog-tabs.otto-nav-tabs {
  justify-content: center;
  gap: 14px;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-bottom: -2px;
}

@media (max-width: 1180px) {
  .blog-tabs.otto-nav-tabs .nav-link {
    width: 140px;
    height: 48px;
    font-size: 14px !important;
    line-height: 15px;
  }
}

@media (max-width: 767px) {
  .blog-tabs.otto-nav-tabs {
    justify-content: start;
    margin-bottom: 0;
  }
}

/* -------------------- Blog grid -------------------- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  background-color: var(--color-white);
}

.blog-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 16px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.06);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(131, 7, 222, 0.14);
}

.blog-card[hidden] {
  display: none;
}

.blog-card__img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  border-radius: var(--radius-md);
  display: block;
}

.blog-card__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Equal height: reserve 2 lines for the title and 3 lines for the excerpt */
.blog-card__title {
  color: var(--color-heading);
  font-weight: var(--font-weight-500);
  margin: 0;
  line-height: 1.35;
  min-height: 2.7em;
}

.blog-card__excerpt {
  color: var(--color-body);
  margin: 0;
  line-height: 1.5;
  min-height: 4.5em;
}

.blog-card__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-primary);
  font-weight: var(--font-weight-600);
  margin-top: auto;
}

.blog-card__link svg {
  width: 16px;
  height: 16px;
  transition: transform var(--transition-fast);
}

.blog-card__link:hover svg {
  transform: translateX(3px);
}

.blog-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--color-muted);
  padding: 48px 0;
}

/* -------------------- Load more -------------------- */
.blog-loadmore-wrap {
  display: flex;
  justify-content: center;
  margin-top: 48px;
}

.blog-loadmore {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 34px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  color: #fff;
  font-weight: var(--font-weight-600);
  font-size: var(--font-size-16);
  cursor: pointer;
  transition: background var(--transition-normal), transform var(--transition-fast), box-shadow var(--transition-normal);
}

.blog-loadmore:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 10px 26px rgba(131, 7, 222, 0.3);
}

.blog-loadmore:active {
  transform: translateY(1px);
}

.blog-loadmore svg {
  width: 18px;
  height: 18px;
}

.blog-loadmore[hidden] {
  display: none;
}

/* Blog DETAIL */
.blog-detail-hero {
  padding-bottom: 120px;
}

.blog-detail-hero__inner {
  max-width: 860px;
}

.blog-detail__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.75);
  font-weight: var(--font-weight-500);
  margin-bottom: 22px;
}

.blog-detail__back:hover {
  color: #fff;
}

.blog-detail__cat {
  display: inline-block;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  background: rgba(131, 7, 222, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-weight: var(--font-weight-600);
  margin-bottom: 18px;
}

.blog-detail__title {
  color: #fff;
  font-weight: var(--font-weight-700);
  letter-spacing: -0.3px;
  margin: 0;
}

/* White card that holds the article + sidebar, pulled up over the hero */
.blog-post {
  position: relative;
  z-index: 3;
  margin-top: -80px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 50px rgba(10, 3, 40, 0.16);
  padding: 34px;
}

.blog-post__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 44px;
  align-items: start;
}

/* Main column: cover image is CLASS-FREE, styled via its parent .blog-post__cover */
.blog-post__cover {
  margin: 0 0 22px;
}

.blog-post__cover img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-lg);
  display: block;
}

.blog-post__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--color-border);
}

.blog-post__meta .author-details {
  margin: 0;
}

.blog-post__meta .author-txt strong {
  color: var(--color-heading);
  display: block;
}

.blog-post__main .article-details {
  max-width: none;
  margin: 0;
}

/* Sidebar */
.blog-post__side {
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 96px;
}

.blog-side-block__title {
  color: var(--color-heading);
  font-weight: var(--font-weight-700);
  margin: 0 0 16px;
}

.blog-side-post {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}

.blog-side-post:last-child {
  border-bottom: 0;
}

.blog-side-post img {
  width: 92px;
  height: 70px;
  object-fit: cover;
  border-radius: var(--radius-md);
  display: block;
}

.blog-side-post__title {
  color: var(--color-heading);
  font-weight: var(--font-weight-500);
  margin: 0 0 6px;
  line-height: 1.3;
}

.blog-side-post__title a {
  color: inherit;
}

.blog-side-post__title a:hover {
  color: var(--color-primary);
}

/* "New Add" promo card */
.blog-promo {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 230px;
  padding: 22px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: #fff;
}

.blog-promo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 0, 43, 0.15) 0%, rgba(7, 0, 43, 0.85) 100%);
}

.blog-promo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-promo__tag,
.blog-promo__title,
.blog-promo__text {
  position: relative;
  z-index: 1;
}

.blog-promo__tag {
  color: rgba(255, 255, 255, 0.8);
  font-weight: var(--font-weight-500);
  margin-bottom: 6px;
}

.blog-promo__title {
  color: #fff;
  font-weight: var(--font-weight-700);
  margin: 0 0 8px;
}

.blog-promo__text {
  color: rgba(255, 255, 255, 0.82);
  margin: 0;
}

.blog-promo:hover .blog-promo__title {
  color: #e6c8ff;
}

/* -------------------- Responsive -------------------- */
@media (max-width: 1199.98px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .blog-post {
    padding: 20px;
    margin-top: -100px;
  }
}

@media (max-width: 991.98px) {
  .blog-trending__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .blog-hero {
    padding: 140px 0 70px;
  }

  .blog-post__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .blog-post__side {
    position: static;
  }


  .blog-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }

  .blog-tabs.otto-nav-tabs {
    margin-bottom: -8px;
  }
}

@media (max-width: 767.98px) {
  .blog-section {
    padding: 44px 0;
  }

  .blog-trending {
    padding: 20px;
  }

  .blog-post {
    padding: 15px;
    margin-top: -130px;
  }

  .blog-grid {
    grid-template-columns: 1fr;
  }

  .blog-tpost {
    grid-template-columns: 130px 1fr;
    gap: 14px;
  }

  .blog-tpost__thumb {
    height: 104px;
  }

  .blog-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }

  .blog-tab {
    flex: none;
    min-width: 118px;
    padding: 14px 20px 18px;
  }

  .blog-feature__img {
    height: 230px;
  }

  .blog-hero {
    padding: 120px 0 56px;
  }

  .blog-detail-hero {
    padding-bottom: 100px;
  }

  /* single-line/loose text on small screens still equalises, but relax reserves */
  .blog-card__excerpt {
    min-height: 0;
  }
}

@media (max-width: 479.98px) {
  .blog-tpost {
    grid-template-columns: 1fr;
  }

  .blog-tpost__thumb {
    height: 180px;
    order: -1;
  }

  .blog-feature__body {
    margin-left: 14px;
    margin-right: 14px;
  }
}

/* ==========================================================================
   BLOG DETAIL — article body enhancements (CMS content, class-free)
   The CMS injects raw HTML into .article-details; these rules style bare tags
   using theme-aware tokens so the article reads correctly in light AND dark.
   Later in the file than the base .article-details block, so these win.
   ========================================================================== */
.article-details {
  max-width: 820px;
  margin: 0 auto;
  font-size: var(--font-size-18);
  line-height: 1.75;
  color: var(--color-body);
}

.article-details>*:first-child {
  margin-top: 0;
}

.article-details>*:last-child {
  margin-bottom: 0;
}

.article-details h1,
.article-details h2,
.article-details h3,
.article-details h4,
.article-details h5,
.article-details h6 {
  color: var(--color-heading);
  font-family: var(--font-family-base);
  font-weight: var(--font-weight-700);
  line-height: 1.3;
  letter-spacing: -0.2px;
  margin: 2.2rem 0 0.9rem;
}

.article-details h2 {
  font-size: var(--font-size-28);
}

.article-details h3 {
  font-size: var(--font-size-22);
}

.article-details h4 {
  font-size: var(--font-size-20);
}

.article-details h5 {
  font-size: var(--font-size-18);
}

.article-details h6 {
  font-size: var(--font-size-16);
}

.article-details p,
.article-details li,
.article-details span,
.article-details td,
.article-details th {
  color: var(--color-body);
  font-family: var(--font-family-base);
  font-size: var(--font-size-18);
  line-height: 1.75;
}

.article-details p {
  margin: 0 0 1.15rem;
}

.article-details strong,
.article-details b {
  color: var(--color-heading);
  font-weight: var(--font-weight-700);
}

.article-details a,
.article-details p a,
.article-details li a,
.article-details span a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-details a:hover {
  color: var(--color-primary-hover);
}

.article-details ul,
.article-details ol {
  margin: 0 0 1.25rem;
  padding-left: 1.4rem;
}

.article-details ul li {
  list-style: disc;
  margin-bottom: 0.5rem;
}

.article-details ol li {
  list-style: decimal;
  margin-bottom: 0.5rem;
}

.article-details li::marker {
  color: var(--color-primary);
}

.article-details blockquote {
  margin: 1.75rem 0;
  padding: 0.5rem 0 0.5rem 1.4rem;
  border-left: 4px solid var(--color-primary);
  background: linear-gradient(90deg, rgba(131, 7, 222, 0.06), transparent 80%);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.article-details blockquote p {
  color: var(--color-heading);
  font-size: var(--font-size-20);
  font-style: italic;
  margin-bottom: 0;
}

.article-details img {
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  margin: 1.5rem auto;
  border-radius: var(--radius-md);
  display: block;
}

.article-details figure {
  margin: 1.75rem 0;
}

.article-details figcaption {
  color: var(--color-muted);
  font-size: var(--font-size-14);
  text-align: center;
  margin-top: 0.5rem;
}

.article-details hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 2.25rem 0;
}

.article-details code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--color-surface);
  color: var(--color-primary);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
}

.article-details pre {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  overflow-x: auto;
  margin: 0 0 1.25rem;
}

.article-details pre code {
  background: transparent;
  color: var(--color-body);
  padding: 0;
}

.article-details table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.5rem;
  font-size: var(--font-size-16);
}

.article-details th,
.article-details td {
  border: 1px solid var(--color-border);
  padding: 0.65rem 0.85rem;
  text-align: left;
}

.article-details th {
  background: var(--color-surface);
  color: var(--color-heading);
  font-weight: var(--font-weight-600);
}

@media screen and (max-width: 767px) {
  .article-details {
    font-size: var(--font-size-16);
    line-height: 1.7;
  }

  .article-details p,
  .article-details li,
  .article-details span {
    font-size: var(--font-size-16);
  }

  .article-details h2 {
    font-size: var(--font-size-24);
  }

  .article-details h3 {
    font-size: var(--font-size-20);
  }

  .article-details blockquote p {
    font-size: var(--font-size-18);
  }
}