/* =============================================================================================
   Home sections: "Industry Best Practices" and "Tech Updates" (responsive grid redesign)
   ============================================================================================= */
.tt-grid { display: grid; gap: 16px; }
.tt-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.tt-clamp-2, .tt-clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.tt-clamp-2 { -webkit-line-clamp: 2; }
.tt-clamp-3 { -webkit-line-clamp: 3; }

.tt-title { font-family: "Roboto", Arial, sans-serif; font-weight: 600; line-height: 1.35; color: #1d1f24; }
.tt-date { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #0c4da2; }

/* Large image card with the title over a gradient */
.tt-overlay-card { position: relative; display: block; border-radius: 8px; overflow: hidden; aspect-ratio: 16 / 10; background: #e9ecef; }
.tt-overlay-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.tt-overlay-card:hover img, .tt-overlay-card:focus-visible img { transform: scale(1.04); }
.tt-overlay-text { position: absolute; inset: auto 0 0 0; padding: 48px 16px 14px; display: flex; flex-direction: column; gap: 6px;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,.82) 70%); }
.tt-overlay-text .tt-title { color: #fff; font-size: 18px; }
.tt-overlay-text .authar-info, .tt-overlay-text .authar-info li, .tt-overlay-text .authar-info a { margin: 0; color: #fff !important; }

/* Compact list item: thumbnail + title + date */
.tt-list-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border-radius: 8px; background: #f7f8fa; transition: background .2s; }
.tt-list-item:hover { background: #eef2f8; }
.tt-list-item img { flex: 0 0 112px; width: 112px; height: 76px; object-fit: cover; border-radius: 6px; background: #e9ecef; }
.tt-list-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tt-list-text .tt-title { font-size: 15px; }

/* Tech Updates: featured article + small 2x2 grid */
.tt-feature-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.tt-feature-img { display: block; border-radius: 8px; overflow: hidden; aspect-ratio: 16 / 10; background: #e9ecef; margin-bottom: 10px; }
.tt-feature-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.tt-feature-img:hover img { transform: scale(1.04); }
.tt-feature-title { font-size: 20px; line-height: 1.35; margin: 8px 0 6px; }
.tt-feature-title a { color: #1d1f24; }
.tt-excerpt { margin: 8px 0 4px; color: #555; font-size: 15px; line-height: 1.55; }
.tt-read-more { font-weight: 600; font-size: 14px; }
.tt-small-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tt-small-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; background: #e9ecef; transition: opacity .2s; }
.tt-small-card:hover img { opacity: .9; }
.tt-small-card .tt-title { font-size: 15px; }
.tt-small-grid { align-content: start; }

.tt-overlay-card:hover .tt-title, .tt-list-item:hover .tt-title, .tt-small-card:hover .tt-title, .tt-feature-title a:hover { text-decoration: underline; }

/* Filter tabs: one scrollable row instead of wrapping on small screens */
.post-inner .filter-nav ul { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.post-inner .filter-nav ul::-webkit-scrollbar { display: none; }
.post-inner .filter-nav li { flex: 0 0 auto; }

/* Tablet */
@media (max-width: 991px) {
  .tt-feature-layout { grid-template-columns: 1fr; }
}
/* Phone */
@media (max-width: 575px) {
  .tt-grid-2:not(.tt-small-grid) { grid-template-columns: 1fr; }
  .tt-grid { gap: 12px; }
  .tt-overlay-text .tt-title { font-size: 16px; }
  .tt-list-item img { flex-basis: 96px; width: 96px; height: 68px; }
  .tt-feature-title { font-size: 18px; }
  .post-inner .post-head { flex-wrap: wrap; }
}

/* Dark mode */
.skin-dark .tt-title, .skin-dark .tt-feature-title a { color: #f1f1f1; }
.skin-dark .tt-overlay-text .tt-title { color: #fff; }
.skin-dark .tt-list-item { background: #23262d; }
.skin-dark .tt-list-item:hover { background: #2b2f38; }
.skin-dark .tt-excerpt { color: #c9c9c9; }

/* ---------- Carousel side arrows on phones ----------
   They sat in the middle of the slide, on top of captions and headlines. Phones can swipe, so:
   main slider -> small arrows in the top corners; other carousels -> hidden (their section header
   already has arrows, and swiping works). The article page's own "previous" button is not affected. */
@media (max-width: 767px) {
  .slider-inner [id^="carousel_prev_"] .prev,
  .slider-inner [id^="carousel_next_"] .next {
    top: 10px !important;
    transform: none !important;
    margin-top: 0 !important;
    padding: 2px 10px !important;
    font-size: 16px !important;
    opacity: .92;
  }
  /* both arrows together in the top-right corner, clear of the category badge */
  .slider-inner [id^="carousel_prev_"] .prev { left: auto !important; right: 52px !important; }
  .slider-inner [id^="carousel_next_"] .next { left: auto !important; right: 6px !important; }
  :not(.slider-inner) > * > [id^="carousel_prev_"] .prev,
  :not(.slider-inner) > * > [id^="carousel_next_"] .next,
  .post-inner [id^="carousel_prev_"] .prev,
  .post-inner [id^="carousel_next_"] .next {
    display: none !important;
  }
  .slider-inner [id^="carousel_prev_"] .prev,
  .slider-inner [id^="carousel_next_"] .next {
    display: inline-block !important;
  }
}

/* ---------- E-magazine archive: consistent cover cards ---------- */
.emagazine-card .featured-post { display: flex; flex-direction: column; align-items: center; gap: 10px; height: 100%; }
.emagazine-card .emagazine-image { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; background: #e9edf2; }
@media (max-width: 575px) {
  .emagazine-card { padding-left: 6px; padding-right: 6px; }
  .emagazine-card .emagazine-btn { font-size: 13px; padding: 6px 8px; }
}
