/* ==========================================================================
   TRIKONET RECENT ARTICLES & CAREER INSIGHTS SECTION (PREMIUM EDITORIAL DESIGN)
   ========================================================================== */

.recent-section {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 80px 0 88px;
  position: relative;
  border-top: 1px solid #edf2f7;
  border-bottom: 1px solid #edf2f7;
  overflow: hidden;
}

/* Header Container */
.recent-articles-header-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 34px;
  flex-wrap: wrap;
}

.recent-articles-header-text {
  flex: 1;
  min-width: 280px;
}

.recent-articles-heading {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.22;
  color: #0f172a;
  margin: 0 0 8px;
}

.recent-articles-subheading {
  font-size: 15.5px;
  color: #64748b;
  margin: 0;
  line-height: 1.55;
  max-width: 620px;
}

/* Header Action Controls */
.recent-articles-nav-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.recent-articles-viewall-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #b00008;
  font-size: 14px;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 999px;
  background: #ffffff;
  border: 1.5px solid rgba(176, 0, 8, 0.22);
  text-decoration: none;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.recent-articles-viewall-link:hover {
  background: #b00008;
  color: #ffffff;
  border-color: #b00008;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(176, 0, 8, 0.2);
}

.recent-articles-arrows {
  display: none !important;
}

.recent-articles-arrows .carousel-arrow {
  position: static;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  color: #1e293b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  padding: 0;
}

.recent-articles-arrows .carousel-arrow:hover {
  background: #b00008;
  color: #ffffff;
  border-color: #b00008;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(176, 0, 8, 0.25);
}

.recent-articles-arrows .carousel-arrow:active {
  transform: translateY(0);
}

/* Slider Track & Container */
.articles-carousel-wrap {
  position: relative;
  max-width: 1260px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 20px;
}

.recent-slider .articles {
  display: flex;
  gap: 28px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  padding: 8px 0 20px;
  margin: 0;
  box-sizing: border-box;
}

.recent-slider .articles::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Modern Article Card */
.recent-slider .article,
.recent-section .article.modern-article-card {
  flex: 0 0 calc((100% - 56px) / 3);
  min-width: 0;
  max-width: none;
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease;
  text-decoration: none;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

@media (min-width: 981px) {
  .recent-slider .articles {
    width: 100%;
  }
  .recent-slider .article,
  .recent-section .article.modern-article-card {
    flex: 0 0 calc((100% - 56px) / 3);
    width: calc((100% - 56px) / 3);
  }
}

.recent-slider .article:hover,
.recent-section .article.modern-article-card:hover {
  transform: translateY(-7px);
  box-shadow: 0 22px 36px -10px rgba(15, 23, 42, 0.12), 0 8px 18px -4px rgba(176, 0, 8, 0.08);
  border-color: rgba(176, 0, 8, 0.3);
}

/* Cover Image Box */
.article-cover-wrap {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: #f1f5f9;
}

.article-cover-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
}

.recent-slider .article-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  display: block;
  box-shadow: none;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.recent-slider .article:hover .article-cover,
.recent-section .article.modern-article-card:hover .article-cover {
  transform: scale(1.06);
  box-shadow: none;
}

/* Overlaid Badges on Image */
.article-badge-category {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  padding: 4px 12px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 2;
  pointer-events: none;
}

.article-badge-readtime {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #1e293b;
  font-size: 11px;
  font-weight: 650;
  padding: 4px 10px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
  pointer-events: none;
}

.article-badge-readtime svg {
  color: #b00008;
}

/* Card Body Content */
.recent-section .article-body {
  padding: 22px 24px 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 550;
  margin-bottom: 10px;
}

.article-meta-date {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #64748b;
}

.article-meta-dot {
  color: #cbd5e1;
}

.article-meta-author {
  color: #94a3b8;
}

.article-title {
  font-size: 17.5px;
  font-weight: 750;
  line-height: 1.42;
  color: #0f172a;
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 50px;
  transition: color 0.2s ease;
}

.article-title a {
  color: #0f172a;
  text-decoration: none;
  transition: color 0.2s ease;
}

.recent-slider .article:hover .article-title a,
.recent-section .article.modern-article-card:hover .article-title a {
  color: #b00008;
}

.article-excerpt {
  color: #64748b;
  font-size: 13.5px;
  line-height: 1.6;
  margin: 0 0 18px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card Footer / Read More CTA */
.article-card-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.article-read-link {
  color: #b00008;
  font-weight: 700;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: gap 0.2s ease;
}

.article-arrow-icon {
  transition: transform 0.2s ease;
}

.recent-slider .article:hover .article-read-link,
.recent-section .article.modern-article-card:hover .article-read-link {
  gap: 9px;
}

.recent-slider .article:hover .article-arrow-icon,
.recent-section .article.modern-article-card:hover .article-arrow-icon {
  transform: translateX(3px);
}

.article-card-arrow-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fef2f2;
  color: #b00008;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.recent-slider .article:hover .article-card-arrow-circle,
.recent-section .article.modern-article-card:hover .article-card-arrow-circle {
  background: #b00008;
  color: #ffffff;
  transform: translateX(3px);
}

/* Dots Pagination */
.recent-slider-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 22px;
}

.recent-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #cbd5e1;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.recent-dot.active {
  width: 22px;
  background: #b00008;
}

.recent-articles-footer {
  display: none !important;
}

/* ==========================================================================
   DESKTOP ALIGNMENT (min-width: 851px)
   ========================================================================== */

@media (min-width: 851px) {
  .recent-section > .wrap {
    width: min(1320px, 100%) !important;
    max-width: 1320px !important;
    margin-inline: auto !important;
    padding-inline: 30px !important;
    box-sizing: border-box !important;
  }
  .recent-articles-header-bar {
    width: 100% !important;
    max-width: 1260px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    align-items: center !important;
  }
  .recent-articles-nav-controls {
    align-self: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 12px !important;
    margin: 0 !important;
  }
  .recent-articles-viewall-link {
    align-self: center !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 0 20px !important;
    line-height: 1 !important;
  }
}

/* Tablet (between 851px and 980px) */
@media (min-width: 851px) and (max-width: 980px) {
  .recent-articles-heading {
    font-size: 27px;
  }
  .recent-slider .article,
  .recent-section .article.modern-article-card {
    flex: 0 0 calc((100% - 24px) / 2) !important;
    width: calc((100% - 24px) / 2) !important;
  }
  .recent-slider .articles {
    gap: 20px;
  }
}

/* ==========================================================================
   MOBILE VIEW (max-width: 850px)
   - Generous side space on both borders (24px padding)
   - Neither text nor cards touch the border
   - Exactly ONE full card shown at a time
   - Clean, modern touch carousel with dots
   ========================================================================== */

@media (max-width: 850px) {
  .recent-section {
    padding: 44px 0 50px !important;
    overflow: hidden !important;
  }

  /* Both borders have generous 24px padding - text and cards never touch borders */
  .recent-section > .wrap {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
    box-sizing: border-box !important;
    margin: 0 auto !important;
  }

  .recent-articles-header-bar {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    margin-bottom: 22px !important;
    width: 100% !important;
  }

  .recent-articles-header-text {
    width: 100% !important;
    min-width: 0 !important;
  }

  .recent-articles-heading {
    margin: 0 0 6px !important;
    font-size: 24px !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
    letter-spacing: -0.02em !important;
    color: #0f172a !important;
  }

  .recent-articles-subheading {
    font-size: 13.5px !important;
    line-height: 1.55 !important;
    color: #64748b !important;
    margin: 0 !important;
  }

  .recent-articles-nav-controls {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    margin-top: 6px !important;
  }

  .recent-articles-viewall-link {
    min-height: 38px !important;
    padding: 8px 16px !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    border-radius: 999px !important;
  }

  .recent-articles-arrows {
    display: none !important;
  }

  .recent-articles-arrows .carousel-arrow {
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    border: 1.5px solid #e2e8f0 !important;
    background: #ffffff !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
  }

  /* Carousel wrapper stays cleanly inside the 24px padded wrap */
  .articles-carousel-wrap {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .recent-slider .articles {
    display: flex !important;
    width: 100% !important;
    gap: 20px !important;
    padding: 4px 0 16px !important;
    margin: 0 !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    box-sizing: border-box !important;
  }

  /* Exactly ONE card at a time on mobile */
  .recent-slider .article,
  .recent-section .article.modern-article-card {
    flex: 0 0 100% !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px !important;
    scroll-snap-align: start !important;
    scroll-snap-stop: always !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 8px -1px rgba(15, 23, 42, 0.03) !important;
    border: 1px solid rgba(226, 232, 240, 0.95) !important;
  }

  .article-cover-wrap {
    height: 195px !important;
  }

  .recent-section .article-body {
    padding: 20px 22px 22px !important;
  }

  .article-meta-row {
    gap: 6px !important;
    font-size: 11.5px !important;
    margin-bottom: 8px !important;
  }

  .article-title {
    min-height: 0 !important;
    font-size: 17.5px !important;
    line-height: 1.4 !important;
    margin: 0 0 8px !important;
  }

  .article-excerpt {
    font-size: 13.5px !important;
    line-height: 1.55 !important;
    margin: 0 0 16px !important;
  }

  .article-read-link {
    font-size: 13px !important;
  }

  .article-card-arrow-circle {
    width: 32px !important;
    height: 32px !important;
  }

  .recent-slider-dots {
    margin-top: 14px !important;
    gap: 7px !important;
  }

  .recent-articles-footer {
    display: none !important;
  }
}

@media (max-width: 420px) {
  .recent-section > .wrap {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
  .recent-articles-heading {
    font-size: 22px !important;
  }
  .article-cover-wrap {
    height: 180px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .recent-slider .articles {
    scroll-behavior: auto;
  }
}
