/* =========================================================
   t2tDigital · HOME ADDONS · v2 (Scoped SSOT)
   - No :root here (tokens live in t2t-tokens.css)
   - Scope: .t2t-home (only Home page modules S2/S3/S4)
   - Keep legacy classnames in markup (t2t-sec-*, t2t-grid, t2t-card...)
========================================================= */

/* ---------------------------------------------------------
   0) Scope wrapper
--------------------------------------------------------- */
.t2t-home {
  /* fallback nhẹ nếu token thiếu (không tạo :root nữa) */
  --t2t-brand-primary: var(--t2t-brand-primary, #00ffd5);
  --t2t-brand-secondary: var(--t2t-brand-secondary, #00b7ff);

  --t2t-text: var(--t2t-text, #e8eaed);
  --t2t-text-light: var(--t2t-text-light, #bdbdbd);
  --t2t-text-dim: var(--t2t-text-dim, #9aa0a6);

  --t2t-card-bg: var(--t2t-card-bg, rgba(255, 255, 255, 0.04));
  --t2t-card-bd: var(--t2t-card-bd, rgba(255, 255, 255, 0.1));
  --t2t-radius: var(--t2t-radius, 14px);

  color: var(--t2t-text);
}

/* ---------------------------------------------------------
   1) Section frame (map từ file cũ)
   - cũ: .t2t-section / __head / .t2t-h ...
   - mới: dùng chính class markup hiện tại: .t2t-homesec, .t2t-sec-head...
--------------------------------------------------------- */
.t2t-home .t2t-homesec {
  margin: 3rem 0;
}

.t2t-home .t2t-sec-head {
  margin: 0 0 1rem;
}

.t2t-home .t2t-sec-head h2 {
  margin: 0;
  font-size: clamp(1.25rem, 1.1rem + 0.8vw, 1.6rem);
  line-height: 1.25;
}

.t2t-home .t2t-sec-head h2 em {
  color: var(--t2t-brand-primary);
}

/* ---------------------------------------------------------
   2) Tabs (map từ .t2t-tabs / .t2t-tab)
--------------------------------------------------------- */
.t2t-home .t2t-sec-tabs {
  display: inline-flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}

.t2t-home .t2t-sec-tabs a {
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  text-decoration: none;
  color: inherit;
  opacity: 0.78;
}

.t2t-home .t2t-sec-tabs a:hover,
.t2t-home .t2t-sec-tabs a.is-active {
  opacity: 1;
  border-color: var(--t2t-brand-primary);
}

/* CTA link (map từ .t2t-btn) */
.t2t-home .t2t-sec-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0.55rem 0.9rem;
  text-decoration: none;
  color: inherit;
}

.t2t-home .t2t-sec-more {
  margin-top: 1rem;
}

/* ---------------------------------------------------------
   3) Grid + Card (map từ .t2t-cards + .t2t-card…)
   - dùng class markup hiện tại: .t2t-grid .t2t-grid-3 .t2t-card…
--------------------------------------------------------- */
.t2t-home .t2t-grid {
  display: grid;
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.t2t-home .t2t-grid.t2t-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1024px) {
  .t2t-home .t2t-grid.t2t-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .t2t-home .t2t-grid.t2t-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Card shell */
.t2t-home .t2t-card {
  background: var(--t2t-card-bg);
  border: 1px solid var(--t2t-card-bd);
  border-radius: var(--t2t-radius);
  padding: 1rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.t2t-home .t2t-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}

/* Link wrapper */
.t2t-home .t2t-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* Thumbnail wrapper (markup hiện tại dùng .t2t-thumb) */
.t2t-home .t2t-thumb {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: 10px;
}

.t2t-home .t2t-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.t2t-home .t2t-card:hover .t2t-thumb img {
  transform: scale(1.02);
}

/* Body */
.t2t-home .t2t-card-title {
  font-size: 1.06rem;
  margin: 0.65rem 0 0.35rem;
  line-height: 1.35;
}

.t2t-home .t2t-card-meta {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: var(--t2t-text-dim);
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

/* Tag pill (markup hiện tại dùng .t2t-tag) */
.t2t-home .t2t-tag--glass {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
}

/* ---------------------------------------------------------
   4) Section-specific accents (S3 Decode, S4 Featured…)
--------------------------------------------------------- */

/* S3 · Decode (map từ .t2t-decode .t2t-card) */
.t2t-home .t2t-home-s3 .t2t-card {
  background: linear-gradient(180deg, rgba(0, 183, 255, 0.08), rgba(255, 255, 255, 0.03));
  border-color: rgba(0, 183, 255, 0.18);
}

.t2t-home .t2t-home-s3 .t2t-sec-head h2 em {
  color: var(--t2t-brand-secondary);
}

/* Utilities (giữ nhưng scope Home) */
.t2t-home .t2t-muted {
  color: var(--t2t-text-light);
}
.t2t-home .t2t-dim {
  color: var(--t2t-text-dim);
}

/* ================================
   HOME · S2 · Khám phá cùng t2tDigital
   Ép grid 3 card + căn giữa (Home-only implementation)
================================ */

.t2t-home #home-discovery .t2t-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--t2t-card-grid-gap, 20px);

  list-style: none;
  margin: 0 auto;
  padding: 0;

  max-width: var(--t2t-card-grid-max, 1180px);
}

.t2t-home #home-discovery .t2t-card {
  height: 100%;
}

@media (max-width: 960px) {
  .t2t-home #home-discovery .t2t-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: var(--t2t-card-grid-max-tablet, 760px);
  }
}

@media (max-width: 600px) {
  .t2t-home #home-discovery .t2t-grid {
    grid-template-columns: 1fr;
    max-width: var(--t2t-card-grid-max-mobile, 420px);
  }
}

/* Thay cho .t2t-homesc (typo), dùng selector đúng + scope home */
.t2t-home .t2t-homesec figure,
.t2t-home .t2t-homesec ul {
  margin: 0;
  padding: 0;
}

.t2t-home#home-discovery .t2t-grid,
.t2t-home#home-discovery figure {
  margin-left: auto;
  margin-right: auto;
}

