/* =============================================================================
   Modern Blog Template — blog-style.css
   BEM convention | CSS Grid + Flexbox | Mobile-first
   Scoped under body.mbt-blog-page to prevent conflict with Flatsome theme.
   ============================================================================= */

/* ── CSS Custom Properties ─────────────────────────────────────────────────── */
:root {
  --mbt-primary:        #4f46e5;
  --mbt-primary-dark:   #3730a3;
  --mbt-primary-light:  #ede9fe;
  --mbt-amber:          #f59e0b;
  --mbt-amber-dark:     #92400e;
  --mbt-text-heading:   #111827;
  --mbt-text-body:      #374151;
  --mbt-text-muted:     #6b7280;
  --mbt-bg-page:        #f3f4f6;
  --mbt-bg-white:       #ffffff;
  --mbt-border:         #e5e7eb;

  --mbt-radius-sm:      6px;
  --mbt-radius-md:      12px;
  --mbt-radius-lg:      16px;

  --mbt-shadow-card:    0 1px 4px rgba(0, 0, 0, 0.07), 0 4px 12px rgba(0, 0, 0, 0.06);
  --mbt-shadow-hover:   0 8px 28px rgba(0, 0, 0, 0.13);

  --mbt-ease:           0.24s cubic-bezier(0.4, 0, 0.2, 1);

  --mbt-container:      1200px;
  --mbt-gap:            24px;

  --mbt-font-xs:        0.75rem;    /* 12px */
  --mbt-font-sm:        0.875rem;   /* 14px */
  --mbt-font-base:      1rem;       /* 16px */
  --mbt-font-lg:        1.125rem;   /* 18px */
  --mbt-font-xl:        1.375rem;   /* 22px */
  --mbt-font-2xl:       1.75rem;    /* 28px */
  --mbt-font-3xl:       2.25rem;    /* 36px */
}

/* ── Flatsome Layout Override ──────────────────────────────────────────────── */
/*
   Override Flatsome's #content constraints so our full-width sections work.
   Applied only on the blog page body class.
*/
body.mbt-blog-page #content,
body.mbt-blog-page .content-area,
body.mbt-blog-page #main {
  max-width: none;
  padding: 0;
  margin: 0;
  width: 100%;
  background-color: var(--mbt-bg-page);
}

/* ── Shared: Container ─────────────────────────────────────────────────────── */
.mbt-featured__container,
.mbt-grid__container {
  max-width: var(--mbt-container);
  margin-inline: auto;
  padding-inline: 16px;
}

@media (min-width: 768px) {
  .mbt-featured__container,
  .mbt-grid__container {
    padding-inline: 32px;
  }
}

/* ── Badge Component ───────────────────────────────────────────────────────── */
.mbt-badge {
  display: inline-flex;
  align-items: center;
  font-size: var(--mbt-font-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--mbt-radius-sm);
  padding: 3px 10px;
  line-height: 1.5;
  white-space: nowrap;
}

/* ── Scroll-Reveal Animation ───────────────────────────────────────────────── */
/* Applied by JS IntersectionObserver */
.mbt-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s var(--mbt-ease), transform 0.5s var(--mbt-ease);
}

.mbt-reveal:first-child .mbt-small-post__link {
  padding-top: 0;
}

.mbt-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Featured Section ──────────────────────────────────────────────────────── */
.mbt-featured {
  background-color: var(--mbt-bg-white);
  padding-block: 40px;
}

@media (min-width: 768px) {
  .mbt-featured {
    padding-block: 56px;
  }
}

/* Grid: hero (left) + sidebar (right) */
.mbt-featured__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 800px) {
  .mbt-featured__layout {
    grid-template-columns: 1fr 478px;
    gap: 16px;
    align-items: start;
  }
}

/* ── Hero Post ─────────────────────────────────────────────────────────────── */
.mbt-hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Thumbnail */
.mbt-hero__thumb-link {
  display: block;
  border-radius: var(--mbt-radius-lg);
  overflow: hidden;
}

.mbt-hero__figure {
  margin: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 4px;
}

.mbt-hero__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--mbt-ease);
}

.mbt-hero__thumb-link:hover .mbt-hero__image {
  transform: scale(1.04);
}

/* Meta row */
.mbt-hero__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mbt-hero__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.mbt-hero__date,
.mbt-badge--primary {
  font-size: 18px;
  font-weight: 400;
  color: #333333;
  text-transform: none;
}

.mbt-hero__separator {
  color: var(--mbt-text-muted);
  font-size: var(--mbt-font-sm);
  line-height: 1;
}

/* Title */
.mbt-hero__title,
.mbt-hero__title a {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.35;
  color: #202020;
  margin: 0;
}

/* Excerpt */
.mbt-hero__excerpt {
  font-size: var(--mbt-font-base);
  color: var(--mbt-text-muted);
  line-height: 1.65;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Featured Sidebar (Small Posts) ───────────────────────────────────────── */
.mbt-featured__sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Small Post Item ───────────────────────────────────────────────────────── */

.mbt-small-post__link {
  display: grid;
  grid-template-columns: 187px 1fr;
  gap: 20px;
  padding-block: 0;
  align-items: start;
  text-decoration: none;
  color: inherit;
  transition: opacity var(--mbt-ease);
}

.mbt-small-post__figure {
  margin: 0;
  overflow: hidden;
  border-radius: var(--mbt-radius-sm);
  flex-shrink: 0;
}

.mbt-small-post__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--mbt-ease);
}

.mbt-small-post__link:hover .mbt-small-post__image {
  transform: scale(1.06);
}

.mbt-small-post__body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

/* Meta */
.mbt-small-post__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.mbt-small-post__date,
.mbt-small-post__category {
  font-size: 16px;
  background: linear-gradient(321.04deg, #0200B9 22.36%, #020207 77.64%) text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  white-space: nowrap;
  font-weight: 400;
}

.mbt-small-post__separator {
  color: var(--mbt-text-muted);
  font-size: var(--mbt-font-xs);
}

.mbt-small-post__title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.45;
  color: #202020;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mbt-small-post__excerpt {
  font-size: 18px;
  color: #5C5D67;
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Blog Grid Section ─────────────────────────────────────────────────────── */
.mbt-grid {
  padding-block: 48px;
  background-color: #fff;
}

@media (min-width: 768px) {
  .mbt-grid {
    padding-block: 64px;
  }
}

/* Section heading */
.mbt-grid__heading {
  font-size: 40px;
  font-weight: 700;
  color: #30358B;
  margin: 0 0 8px;
  text-align: center;
  padding-bottom: 16px;
  margin-bottom: 32px;
}

@media (min-width: 768px) {
  .mbt-grid__heading {
    font-size: var(--mbt-font-3xl);
  }
}

/* Responsive post grid */
.mbt-grid__posts {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--mbt-gap);
}

@media (min-width: 600px) {
  .mbt-grid__posts {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .mbt-grid__posts {
    grid-template-columns: repeat(3, 1fr);
  }
}

.mbt-grid__empty {
  text-align: center;
  color: var(--mbt-text-muted);
  font-size: var(--mbt-font-lg);
  padding: 64px 0;
  margin: 0;
}

/* ── Post Card ─────────────────────────────────────────────────────────────── */
.mbt-card {
  background-color: var(--mbt-bg-white);
  border-radius: var(--mbt-radius-md);
  overflow: hidden;
  box-shadow: var(--mbt-shadow-card);
  transition: box-shadow var(--mbt-ease), transform var(--mbt-ease);
  display: flex;
  flex-direction: column;
}

.mbt-card:hover {
  box-shadow: var(--mbt-shadow-hover);
  transform: translateY(-5px);
}

.mbt-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

/* Media / thumbnail area */
.mbt-card__media {
  position: relative;
  overflow: hidden;
}

.mbt-card__figure {
  margin: 0;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.mbt-card__figure--placeholder {
  background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
  aspect-ratio: 16 / 10;
}

.mbt-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.36s var(--mbt-ease);
  display: block;
}

.mbt-card:hover .mbt-card__image {
  transform: scale(1.06);
}

/* Date badge on thumbnail */
.mbt-card__date-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  background-color: #fff;
  color: #0200B9;
  font-size: 14px;
  font-weight: 400;
  padding: 7px 12px;
  border-radius: 8px;
  line-height: 1.4;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

/* Card body */
.mbt-card__body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.mbt-card__category {
  align-self: flex-start;
  background-color: transparent;
  padding: 0;
  font-size: 16px;
  font-weight: 400;
  background: linear-gradient(321.04deg, #0200B9 22.36%, #020207 77.64%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.mbt-card__title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.45;
  color: #000000;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--mbt-ease);
}

.mbt-card__link:hover .mbt-card__title {
  color: var(--mbt-primary);
}

.mbt-card__excerpt {
  font-size: 18px;
  color: #333333;
  line-height: 1.6;
  font-weight: 400;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Pagination ────────────────────────────────────────────────────────────── */
.mbt-pagination {
  margin-top: 48px;
  display: flex;
  justify-content: center;
}

/* paginate_links( type='list' ) outputs a <ul class="page-numbers"> */
.mbt-pagination ul.page-numbers {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  justify-content: center;
}

.mbt-pagination ul.page-numbers li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mbt-pagination ul.page-numbers li a.page-numbers,
.mbt-pagination ul.page-numbers li span.page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding-inline: 12px;
  border-radius: var(--mbt-radius-sm);
  font-size: var(--mbt-font-sm);
  font-weight: 500;
  color: var(--mbt-text-body);
  background-color: var(--mbt-bg-white);
  border: 1px solid var(--mbt-border);
  transition:
    background-color var(--mbt-ease),
    color var(--mbt-ease),
    border-color var(--mbt-ease);
  line-height: 1;
  text-decoration: none;
  box-shadow: var(--mbt-shadow-card);
}

.mbt-pagination ul.page-numbers li a.page-numbers:hover {
  background-color: var(--mbt-primary);
  color: var(--mbt-bg-white);
  border-color: var(--mbt-primary);
}

/* Current / active page */
.mbt-pagination ul.page-numbers li span.current {
  background-color: var(--mbt-primary);
  color: var(--mbt-bg-white);
  border-color: var(--mbt-primary);
  font-weight: 700;
}

/* Dots "…" */
.mbt-pagination ul.page-numbers li span.dots {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  cursor: default;
  min-width: auto;
  padding-inline: 4px;
}

/* Prev / Next arrows */
.mbt-pagination ul.page-numbers li a.prev.page-numbers,
.mbt-pagination ul.page-numbers li a.next.page-numbers {
  font-size: 18px;
  font-weight: 400;
}
