/* ─────────────────────────────────────────────────────────────────────────────
   DianApps Blog Archive — pixel-perfect match to dianapps-rebranding_nextjs
   ───────────────────────────────────────────────────────────────────────────── */

/* ── Porto conflict resets (scoped to blog page) ────────────────────────────── */
/* Porto sets overflow-x:hidden on html which clips the thumbnail strip.
   We restore it only on blog archive pages via body class. */
body.blog .blogs-header,
body.archive .blogs-header,
body.home .blogs-header {
  overflow-x: visible;
}

/* ── Page wrapper ────────────────────────────────────────────────────────────── */
.da-blog-page {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  color: #060821;
}
.da-blog-page * {
  box-sizing: border-box;
}
.da-blog-page a {
  text-decoration: none;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════════════════════════════════════════════════ */
.blogs-header {
  /* Body already has 74px padding-top for the fixed header.
     Next.js used 132px top padding (header was overlapping from y=0).
     We need: 132 - 74 = ~58px → use 60px for clean number */
  padding: 60px 100px 60px;
  background: #fff url('../assets/homePageBg.svg') no-repeat top center;
  background-size: cover;
}
.blogs-header__container {
  max-width: 1400px;
  margin: 0 auto;
}
.blogs-header__main {
  display: grid;
  grid-template-columns: 45% calc(55% - 20px);
  gap: 20px;
  align-items: stretch;
}

/* Left content */
.blogs-header__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 0;
  gap: 15px;
  position: relative;
}
.blogs-header__category {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px !important;
  font-weight: 600 !important;
  letter-spacing: 0.08em;
  line-height: 1 !important;
  text-transform: uppercase;
  color: #F06F15 !important;
  align-self: flex-start;
  margin: 0 !important;
}
.blogs-header__title {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  width: 80%;
  font-size: 46px !important;
  font-weight: 500 !important;
  line-height: 56px !important;
  letter-spacing: -3px !important;
  margin: 0 !important;
  color: #060821 !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
}
.blogs-header__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
}
.blogs-header__author {
  display: flex;
  align-items: center;
  gap: 10px;
}
.blogs-header__author-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.blogs-header__author-name {
  font-size: 14px;
  font-weight: 600;
  color: #060821;
  line-height: 1.3;
}
.blogs-header__author-rt {
  font-size: 12px;
  font-weight: 400;
  color: #64748b;
  line-height: 1.3;
}
.blogs-header__author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.blogs-header__arrow-link {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #e2e8f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  color: #4b4f64;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  box-shadow: 0 2px 8px rgba(15,23,42,0.08);
  transform: translateX(-50%);
}
.blogs-header__arrow-link:hover {
  background: #f3f4f8;
  border-color: #cbd5e1;
  transform: translateX(-50%) scale(1.05);
  color: #4b4f64;
}
.blogs-header__arrow-link svg { width: 20px; height: 20px; }

/* Right featured card */
.blogs-header__featured-card {
  position: relative;
  display: flex;
  flex-direction: column;
}
.blogs-header__featured-image {
  display: block;
  width: 100%;
  flex: 1;
  border-radius: 24px;
  overflow: hidden;
  text-decoration: none;
  position: relative;
  z-index: 1;
  max-height: 436px;
}
.blogs-header__featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Thumbnail strip */
.blogs-header__related {
  display: flex;
  gap: 12px;
  position: absolute;
  bottom: 20px;
  left: 0;
  right: -120px;
  z-index: 2;
  justify-content: center;
  align-items: center;
}
.blogs-header__related-image {
  display: block;
  width: 116px;
  height: 69px;
  border-radius: 12px;
  overflow: hidden;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: box-shadow 0.2s ease;
  position: relative;
  box-shadow: 0 4px 12px rgba(15,23,42,0.1);
  flex-shrink: 0;
  box-sizing: border-box;
}
.blogs-header__related-image:hover:not(.is-active) {
  box-shadow: 0 8px 20px rgba(15,23,42,0.15);
}
.blogs-header__related-image.is-active {
  padding: 5px;
  border: 1px solid #fff;
}
.blogs-header__related-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 6px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   ALL BLOGS SECTION
   ═══════════════════════════════════════════════════════════════════════════════ */
.blogs-all {
  padding: 2rem 100px;
  background: #fff;
}
.blogs-all__container {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
}

/* Sidebar */
.blogs-all__sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: sticky;
  top: 100px;
  height: fit-content;
  align-self: flex-start;
  width: 280px;
  flex-shrink: 0;
}

/* Search */
.blogs-all__search {
  position: relative;
  width: 100%;
  display: block;
}
.blogs-all__search-input {
  display: block !important;
  width: 100% !important;
  /* Porto overrides input padding — force left padding to clear the icon */
  padding: 12px 16px 12px 44px !important;
  margin: 0 !important;
  border: 1px solid #E8E8E8 !important;
  border-radius: 50px !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  font-size: 0.95rem !important;
  line-height: 1.5 !important;
  color: #4b4f64 !important;
  background: #fff !important;
  box-shadow: none !important;
  outline: none !important;
  transition: border-color 0.2s ease;
  box-sizing: border-box !important;
  height: auto !important;
  -webkit-appearance: none;
  appearance: none;
}
.blogs-all__search-input:focus {
  border-color: #1E3A8A !important;
  box-shadow: none !important;
  outline: none !important;
}
.blogs-all__search-input::placeholder { color: #8e95a5; }
.blogs-all__search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  width: 20px;
  height: 20px;
  z-index: 1;
  display: block;
}

/* Categories */
.blogs-all__categories { display: flex; flex-direction: column; gap: 1rem; }
.blogs-all__categories-header-web { display: block; }
.blogs-all__categories-header { display: none; }
.blogs-all__categories-title {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  font-size: 1.1rem !important;
  font-weight: 600 !important;
  color: #181b32 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}
.blogs-all__categories-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}
.blogs-all__categories-list::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #e2e8f0;
  z-index: 0;
}
.blogs-all__category-item {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-align: left;
  padding: 9px 1rem 9px 1.5rem;
  border: none;
  background: transparent;
  color: #181b32;
  font-size: 0.95rem;
  font-weight: 400;
  cursor: pointer;
  border-radius: 0;
  transition: font-weight 0.2s ease;
  position: relative;
  z-index: 1;
  line-height: 1.4;
}
.blogs-all__category-item.is-active { font-weight: 600; }
.blogs-all__category-item.is-active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: #1E3A8A;
  z-index: 2;
}

/* Content area */
.blogs-all__content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  flex: 1;
  min-width: 0;
}
.blogs-all__content-title {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  font-size: 2rem !important;
  font-weight: 600 !important;
  color: #181b32 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}

/* Grid */
.blogs-all__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

/* Card */
.blogs-all__card {
  background: #fff;
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  min-height: 550px;
  padding: 16px;
  border-radius: 16px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  color: inherit;
}
.blogs-all__card:hover {
  box-shadow: rgba(0,0,0,0.24) 0px 3px 8px;
  transform: translateY(-5px);
  color: inherit;
  text-decoration: none;
}
.blogs-all__card-image {
  position: relative;
  padding-top: 56.25%;
  overflow: hidden;
  background: #f4f6fb;
  border-radius: 16px;
  flex-shrink: 0;
}
.blogs-all__card-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
}
.blogs-all__card-image--placeholder {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #0f62fe, #18a0fb);
  border-radius: 16px;
}
.blogs-all__card-body {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
}
.blogs-all__card-category {
  display: inline-flex;
  align-self: flex-start;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #F06F15;
  margin: 0;
}
.blogs-all__card-title {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  font-size: 1.25rem !important;
  font-weight: 600 !important;
  margin: 0 !important;
  color: #181b32 !important;
  line-height: 1.4 !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}
.blogs-all__card-description {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin: 0;
  color: #4b4f64;
  line-height: 1.6;
  font-size: 0.95rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blogs-all__card-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
}
.blogs-all__card-author {
  display: flex;
  align-items: center;
  gap: 10px;
}
.blogs-all__card-author-av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.blogs-all__card-author-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.blogs-all__card-author-name {
  font-size: 13px;
  font-weight: 600;
  color: #060821;
  line-height: 1.3;
}
.blogs-all__card-rt {
  font-size: 12px;
  font-weight: 400;
  color: #64748b;
  line-height: 1.3;
}
.blogs-all__card-footer-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.8125rem;
  color: #64748b;
}
.blogs-all__card-views {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #333333;
}
.blogs-all__card-footer-meta { color: #333333; }
.blogs-all__card-date { color: #333333; }
.blogs-all__card-meta-divider { color: #94a3b8; font-size: 0.875rem; }

/* Load more */
.blogs-all__load-more {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
}
.da-load-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 24px;
  background: #1E3A8A;
  color: #fff;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.75;
  border: none;
  border-radius: 44px;
  cursor: pointer;
  transition: background 0.6s ease, transform 0.6s ease, box-shadow 0.6s ease;
  text-decoration: none;
  outline: none;
  -webkit-user-select: none;
  user-select: none;
}
.da-load-more-btn:hover {
  background: linear-gradient(266.31deg, #2C52BE 3.03%, #FF822B 96.97%);
  transform: translateY(-3px);
  box-shadow: 0px 4px 11px 0px rgba(0,0,0,0.25);
  color: #fff;
  text-decoration: none;
}
.da-load-more-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* States */
.blogs-all__loading,
.blogs-all__empty {
  padding: 2rem;
  text-align: center;
  color: #64748b;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.95rem;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .blogs-header__related { bottom: -50px; gap: 10px; }
}

@media (max-width: 992px) {
  .blogs-header { padding: 30px 16px 60px; }
  .blogs-header__main { grid-template-columns: 1fr; gap: 2rem; }
  .blogs-header__title {
    width: 100%;
    font-size: 24px !important;
    line-height: 30px !important;
    letter-spacing: -1.38px !important;
  }
  .blogs-header__category { font-size: 12px !important; }
  .blogs-header__arrow-link { align-self: flex-start; }

  .blogs-all { padding: 2rem 16px; }
  .blogs-all__container { flex-direction: column; gap: 2rem; }
  .blogs-all__sidebar { width: 100%; position: relative; top: 0; }
  .blogs-all__categories-header-web { display: none; }
  .blogs-all__categories-header {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    color: #1E3A8A;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    padding: 0;
  }
  .blogs-all__categories-header .blogs-all__categories-title { color: #1E3A8A !important; }
  .blogs-all__categories-arrow {
    transition: transform 0.3s ease;
    color: #181b32;
  }
  .blogs-all__categories-arrow.open { transform: rotate(180deg); }
  .blogs-all__categories-list { display: none; }
  .blogs-all__categories-list.show { display: flex; }
  .blogs-all__categories-list::before { display: none; }
  .blogs-all__content-title { font-size: 24px !important; line-height: 32px !important; }
}

@media (max-width: 768px) {
  .blogs-header__related {
    bottom: 10px;
    right: -4px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .blogs-header__related-image {
    width: calc(22% - 6px);
    height: auto;
    aspect-ratio: 116 / 69;
  }
  .blogs-all__grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .blogs-all__card { min-height: auto; border: 0.65px solid #F3F4F6; border-radius: 24px; }
  .blogs-all__card-image { padding-top: 60%; }
}
