/* Blog list style: "Latest Updates" slider, category tabs, photo cards with Read More, page numbers.
   Loaded after blog.css and content-map.css on the blog home and category pages. */
:root {
  --bs-navy: #0a2a5e;
  --bs-purple: #6d28d9;
  --bs-purple-soft: #ede7fb;
  --bs-cream: #faf8f4;
  --bs-text: #3b4252;
}

body.home-template, body.tag-template, body.paged { background: var(--bs-cream); }

/* ── Latest Updates slider ── */
.latest-updates { max-width: 1800px; margin: 0 auto; padding: 4rem 1.5rem 2.5rem; }
.latest-heading {
  text-align: center; text-transform: uppercase; letter-spacing: 0.02em;
  font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: clamp(1.9rem, 3.2vw, 2.9rem);
  color: var(--bs-navy); margin: 0 0 2.5rem;
}
.latest-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.latest-track::-webkit-scrollbar { display: none; }
.latest-slide {
  flex: 0 0 100%; scroll-snap-align: start; box-sizing: border-box;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 2.5rem; align-items: center; padding: 0 0.25rem;
}
.latest-body { min-width: 0; }
.latest-img { display: block; border-radius: 18px; overflow: hidden; aspect-ratio: 16 / 9; background: #e9e4f5; }
.latest-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s ease; }
.latest-slide:hover .latest-img img { transform: scale(1.03); }
.latest-tags {
  display: inline; background: var(--bs-purple); color: #fff; text-transform: uppercase;
  font-size: 0.82rem; font-weight: 700; letter-spacing: 0.02em; line-height: 2; padding: 0.3rem 0.6rem;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.latest-body h3 { font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: clamp(1.4rem, 2.3vw, 2.25rem); line-height: 1.3; margin: 1.1rem 0 0.9rem; }
.latest-body h3 a { color: #111827; text-decoration: none; }
.latest-body h3 a:hover { color: var(--bs-purple); }
.latest-body p {
  color: var(--bs-text); font-size: 1.08rem; line-height: 1.85; margin: 0 0 1.4rem;
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden;
}
.latest-more { color: var(--bs-purple); font-weight: 700; font-size: 1.15rem; text-decoration: none; }
.latest-more:hover { text-decoration: underline; }
.latest-dots { display: flex; justify-content: center; gap: 0.9rem; margin-top: 2.2rem; }
.latest-dots button { flex: 0 0 16px; width: 16px; height: 16px; min-width: 0; min-height: 0; border-radius: 50%; border: none; padding: 0; background: #d8cdf3; cursor: pointer; transition: background 0.2s, transform 0.2s; }
.latest-dots button.active { background: var(--bs-purple); transform: scale(1.1); }

/* Popular article section from the blog SEO structure. */
.popular-automation { padding: 2.5rem var(--bs-side, 3.2vw) 1rem; max-width: 1800px; margin: 0 auto; }
.popular-automation > h2 { color: var(--bs-navy); font-family: 'Montserrat', sans-serif; font-size: clamp(1.6rem, 2.6vw, 2.3rem); font-weight: 800; margin: 0 0 1.5rem; }
.sidebar-widget h2.widget-head { margin: 0; font-size: 0.95rem; }

/* ── Category tabs, with the search box at the end ── */
/* min-width 0 keeps the long tab row scrolling inside its column instead of widening the page. */
.main-wrap > main { min-width: 0; }
.cat-tabs-bar { display: flex; align-items: center; gap: 1rem; background: var(--bs-purple-soft); padding: 0.6rem 1rem 0.6rem 0.5rem; margin-bottom: 2.25rem; }
.cat-tabs { display: flex; gap: 0.25rem; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: thin; }
.cat-tab {
  flex-shrink: 0; padding: 0.65rem 1rem; color: #2d3142; text-decoration: none; white-space: nowrap;
  font-size: 1rem; letter-spacing: 0.06em; font-weight: 500; border-radius: 6px;
}
.cat-tab span { margin-left: 0.3rem; }
.cat-tab:hover { color: var(--bs-purple); }
.cat-tab.active { color: var(--bs-purple); font-weight: 700; }
.cat-tabs-bar .search-box { flex: 0 0 220px; max-width: 220px; background: #fff; }

/* ── Cards: photo on top, title, short text, Read More ── */
.article-grid { gap: 1.75rem 1.5rem; }
.article-card { border: none; border-radius: 6px; background: #fff; box-shadow: 0 6px 22px rgba(15, 23, 42, 0.07); }
.article-card:hover { box-shadow: 0 14px 34px rgba(15, 23, 42, 0.13); transform: translateY(-3px); }
.card-img-wrap { display: block; aspect-ratio: 16 / 9; border-radius: 6px 6px 0 0; }
.card-body { padding: 1.25rem 1.1rem 1.5rem; }
.card-title { font-family: 'Montserrat', sans-serif; font-size: 1.3rem; font-weight: 600; line-height: 1.4; margin: 0 0 1.1rem; }
.card-title a { color: var(--bs-navy); text-decoration: none; }
.card-title a:hover { color: var(--bs-purple); }
.card-excerpt { font-size: 1rem; line-height: 1.85; color: var(--bs-text); margin: 0 0 1.4rem; -webkit-line-clamp: 4; }
.card-more { margin-top: auto; color: var(--bs-purple); font-weight: 700; font-size: 0.98rem; text-decoration: none; }
.card-more:hover { text-decoration: underline; }

/* ── Page numbers: Prev, square numbered boxes, Next; on the right under the cards ── */
.blog-pagination { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 0.5rem; margin: 2.5rem 0 1rem; }
.blog-pagination a, .blog-pagination span { padding: 0; border-radius: 0; }
.page-num {
  min-width: 2.9rem; height: 2.9rem; padding: 0 0.6rem; box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; color: #1f2937; font-size: 1.05rem; font-weight: 500; text-decoration: none;
  border: 1px solid #5b6fb5 !important; border-radius: 7px !important; transition: background 0.2s, color 0.2s, border-color 0.2s;
}
a.page-num:hover { background: var(--bs-purple-soft); border-color: var(--bs-purple) !important; color: var(--bs-purple); }
.page-num.current { background: var(--bs-purple); border-color: var(--bs-purple) !important; color: #fff; }
.page-num.gap { background: none; border: none !important; min-width: 1.4rem; padding: 0; }
.page-num.prev { background: var(--bs-purple); border-color: var(--bs-purple) !important; color: #fff; padding: 0 1.1rem; }
.page-num.prev.disabled { background: #b9a3ee; border-color: #b9a3ee !important; cursor: default; }
.page-num.next { background: none; border: none !important; color: #1f2937; padding: 0 0.9rem; }
a.page-num.next:hover { color: var(--bs-purple); background: none; }
.page-num.next.disabled { color: #9ca3af; cursor: default; }

@media (max-width: 900px) {
  .latest-slide { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  .latest-updates { padding-top: 2.5rem; }
}
@media (max-width: 640px) {
  .cat-tabs-bar { flex-direction: column; align-items: stretch; padding: 0.5rem; }
  .cat-tabs-bar .search-box { flex: none; max-width: none; }
  .latest-body p { -webkit-line-clamp: 4; font-size: 1rem; }
}

/* ── Side margins: space at the left and right edges of the page.
      The sidebar is 280px so three cards still keep their size (about 360px) on a laptop screen. ── */
:root { --bs-side: clamp(1rem, 3.2vw, 4rem); }
.main-wrap { padding-left: var(--bs-side); padding-right: var(--bs-side); grid-template-columns: minmax(0, 1fr) 280px; }
.latest-updates { padding-left: var(--bs-side); padding-right: var(--bs-side); }
.extra-inner { padding-left: var(--bs-side); padding-right: var(--bs-side); }
@media (max-width: 1024px) {
  .main-wrap { grid-template-columns: minmax(0, 1fr); }
}
