/* ============================================================
   HOME PAGE — front-page.php specific styles
   ============================================================ */

/* ============================================================
   HERO BANNER
   ============================================================ */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 55%) minmax(0, 45%);
  width: min(calc(100% - 48px), 1280px);
  height: clamp(500px, 35vw, 550px);
  margin: var(--space-lg) auto var(--space-2xl);
  --hero-card-image-width: clamp(130px, 11vw, 175px);
  background: #ffffff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.05);
}

.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  z-index: 0;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.9) 10%, rgba(255, 255, 255, 0.8) 30%, rgba(255, 255, 255, 0.1) 40%);
  z-index: 1;
}

.hero__left {
  position: relative;
  z-index: 2;
  height: 100%;
}

.hero__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  max-width: 540px;
  padding: clamp(30px, 5vw, 60px);
}

.hero__cat {
  display: inline-block;
  font-size: clamp(14px, 1.2vw, 16px);
  font-weight: 700;
  text-transform: uppercase;
  color: #222222;
  margin-bottom: 16px;
}

.hero__headline {
  font-size: clamp(28px, 2.8vw, 42px);
  font-weight: 800;
  line-height: 1.2;
  color: var(--color-accent);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  --line-clamp: 3;
  overflow: hidden;
  margin-bottom: 24px;
}

.hero__excerpt {
  display: none !important;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: var(--text-nav);
  font-weight: 600;
  color: #ffffff;
  background: var(--color-accent);
  border-radius: 50px;
  width: fit-content;
  text-decoration: none;
  transition: all 0.3s ease;
}

.hero__cta:hover {
  background: var(--color-accent-hover);
  transform: translateY(-2px);
}

.hero__right {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 20px;
  padding: clamp(20px, 3vw, 40px);
  height: 100%;
}

.latest-card__card {
  overflow: hidden;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.latest-card__card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.85);
}

.latest-card__card--feature {
  width: min(100%, 450px);
}

.latest-card__card:not(.latest-card__card--feature) {
  width: min(100%, 450px);
}

.latest-card__card--mobile-hero {
  display: none;
}

.latest-card__link {
  display: grid;
  grid-template-columns: var(--hero-card-image-width) 1fr;
  color: #222222;
  text-decoration: none;
  height: 100%;
}

.latest-card__img-wrap {
  width: var(--hero-card-image-width);
  height: 100%;
  min-height: 140px;
  overflow: hidden;
}

.latest-card__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.latest-card__body {
  display: flex;
  flex-direction: column;
  padding: 16px;
  min-width: 0;
}

.latest-card__date {
  font-size: var(--text-body);
  font-weight: 500;
  color: #666666;
  margin-bottom: 6px;
}

.latest-card__title {
  font-size: clamp(14px, 1.1vw, 16px);
  font-weight: 700;
  line-height: 1.3;
  color: #111111;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}

.latest-card__excerpt {
  font-size: var(--text-body);
  line-height: 1.4;
  color: #444444;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.latest-card__readmore {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--color-accent);
  margin-top: auto;
  padding-top: 8px;
}

@media (max-width: 767px) {
  .hero {
    grid-template-columns: 1fr;
    width: 100%;
    height: auto;
    margin: var(--space-lg) 0 var(--space-2xl);
    border-radius: 0;
  }

  .hero__left {
    display: none;
  }

  .hero__right {
    display: grid;
    gap: var(--space-md);
    padding: var(--space-lg);
    align-items: start;
  }

  .latest-card__card,
  .latest-card__card--feature,
  .latest-card__card:not(.latest-card__card--feature) {
    width: 100%;
    position: relative;
  }

  .latest-card__card--mobile-hero {
    display: block;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .hero {
    grid-template-columns: minmax(0, 52%) minmax(0, 48%);
    height: clamp(400px, 38vw, 480px);
  }

  .hero__content {
    padding: var(--space-xl);
  }

  .hero__headline {
    font-size: clamp(26px, 3vw, 36px);
  }

  .hero__right {
    gap: 16px;
  }

  .latest-card__card--feature {
    width: min(100%, 400px);
  }

  .latest-card__card:not(.latest-card__card--feature) {
    width: min(100%, 400px);
  }
}

/* ============================================================
   SECTION A — List + Featured
   ============================================================ */

.section-a {
  padding-block: var(--space-xl);
  background: var(--color-bg);
}

.section-a__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--col-gap-desktop);
  align-items: center;
  margin-top: var(--space-lg);
}

.list-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-md) 0;
  border-top: 1px solid var(--color-border);
}

.list-card:first-child {
  padding-top: 0;
  border-top: none;
}

.list-card__bottom {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: var(--space-md);
  align-items: start;
}

.list-card__img-wrap {
  overflow: hidden;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  display: block;
}

.list-card__img-wrap img {
  width: 116px;
  height: 88px;
  object-fit: cover;
  display: block;
  transition: transform var(--duration-base) var(--ease-out);
}

.list-card:hover .list-card__img-wrap img {
  transform: scale(1.05);
}

.list-card__body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-xs);
  min-height: 88px;
}

.list-card__title {
  font-size: var(--text-nav);
  font-weight: 600;
  line-height: var(--leading-card);
  color: var(--color-text-primary);
  overflow: hidden;
  display: -webkit-box;
  /* stylelint-disable-next-line property-no-vendor-prefix */
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  transition: color var(--duration-fast) var(--ease-in-out);
}

.list-card:hover .list-card__title {
  color: var(--color-accent);
}

.list-card__excerpt {
  font-size: var(--text-body);
  font-weight: 400;
  line-height: var(--leading-body);
  color: var(--color-text-secondary);
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.list-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: 2px;
}

.list-card__date {
  font-size: var(--text-body);
  font-weight: 400;
  letter-spacing: var(--tracking-wide);
  color: var(--color-text-secondary);
}

.list-card__views {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--text-meta);
  font-weight: 400;
  color: var(--color-text-secondary);
}

.list-card__views svg {
  opacity: 0.6;
  flex-shrink: 0;
}

.featured-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.featured-card__img-wrap {
  overflow: hidden;
}

.featured-card__img-wrap img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.featured-card__overlay {
  position: relative;
}

.featured-card__overlay::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
}

.featured-card__body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-md);
}

.featured-card__meta {
  font-size: var(--text-meta);
  font-weight: 400;
  letter-spacing: var(--tracking-wide);
  color: rgba(255, 255, 255, 0.75);
}

.featured-card__title {
  margin-top: var(--space-xs);
  font-size: clamp(18px, 2.2vw, 26px);
  font-weight: 600;
  line-height: var(--leading-card);
  color: #ffffff;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  --line-clamp: 3;
  overflow: hidden;
  padding-bottom: 2px;
}

.featured-card__excerpt {
  margin-top: var(--space-sm);
  font-size: var(--text-nav);
  font-weight: 400;
  line-height: var(--leading-body);
  color: rgba(255, 255, 255, 0.80);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

@media (max-width: 767px) {
  .section-a__grid {
    grid-template-columns: 1fr;
  }

  .section-a__grid .featured-card {
    order: -1;
  }
}

/* ============================================================
   SECTION B — Description + Overlay Cards
   ============================================================ */

.section-b {
  padding-block: var(--space-xl);
  background: var(--color-bg);
}

.section-b__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) 1px minmax(0, 7fr);
  gap: var(--col-gap-desktop);
  align-items: center;
  margin-top: var(--space-lg);
}

.section-b__divider {
  align-self: stretch;
  background: var(--color-border);
}

.section-b__desc {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.section-b__cat-name {
  margin-top: var(--space-sm);
  font-size: var(--text-heading);
  font-weight: 700;
  line-height: var(--leading-heading);
  color: var(--color-text-primary);
}

.section-b__text {
  margin-top: var(--space-md);
  font-size: 16px;
  font-weight: 400;
  line-height: var(--leading-body);
  color: var(--color-text-secondary);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  --line-clamp: 5;
  overflow: hidden;
}

.section-b__viewall {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  margin-top: var(--space-lg);
  font-size: var(--text-nav);
  font-weight: 600;
  color: var(--color-accent);
  transition: color var(--duration-fast) var(--ease-in-out);
}

.section-b__viewall:hover {
  color: var(--color-accent-hover);
}

.section-b__cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.overlay-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/3;
  border-radius: var(--radius-md);
}

.overlay-card a {
  display: block;
  width: 100%;
  height: 100%;
}

.overlay-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.overlay-card__gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 40%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
}

.overlay-card__body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-md);
  pointer-events: none;
}

.overlay-card__meta {
  font-size: var(--text-meta);
  font-weight: 400;
  letter-spacing: var(--tracking-wide);
  color: rgba(255, 255, 255, 0.95);
}

.overlay-card__title {
  margin-top: var(--space-xs);
  font-size: var(--text-nav);
  font-weight: 600;
  line-height: var(--leading-card);
  color: #ffffff;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  --line-clamp: 2;
  overflow: hidden;
  padding-bottom: 2px;
}

@media (max-width: 767px) {
  .section-b__grid {
    grid-template-columns: 1fr;
  }

  .section-b__divider {
    display: none;
  }

  .section-b__cards {
    grid-template-columns: 1fr;
  }

  .overlay-card {
    aspect-ratio: 16/9;
  }
}

/* ============================================================
   SECTION D — Nổi Bật (Most Viewed)
   ============================================================ */

.section-most-viewed {
  padding-block: var(--space-xl);
  background: var(--color-surface);
}

.most-viewed__layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.most-viewed__content {
  flex: 1;
  min-width: 0;
}

.most-viewed__banner {
  width: 320px;
  flex-shrink: 0;
  position: sticky;
  top: 80px;
}

.banner-carousel {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.banner-carousel__item {
  transition: opacity 0.3s ease;
}

.banner-carousel__item.is-hidden {
  display: none;
}

.most-viewed__card-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.mv-item {
  background: var(--color-bg);
  border-radius: 10px;
  border: 1px solid var(--color-border);
  overflow: hidden;
  padding: 10px var(--space-md);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition:
    box-shadow var(--duration-fast) var(--ease-in-out),
    transform var(--duration-fast) var(--ease-in-out);
}

.mv-item:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.09);
  transform: translateY(-1px);
}

.mv-item__link {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: var(--space-sm);
  align-items: center;
  color: inherit;
}

.mv-item__img-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  aspect-ratio: 4 / 3;
  width: 140px;
}

.mv-item__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mv-ribbon {
  position: absolute;
  z-index: 2;
  display: block;
  width: 8em;
  height: 1.4em;
  line-height: 1.4em;
  text-align: center;
  user-select: none;
  top: 0;
  left: 0;
  transform: translate(-2.35em, 1em) rotate(-45deg);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.mv-ribbon--gold {
  background: #C8941A;
}

.mv-ribbon--silver {
  background: #7A95A8;
}

.mv-ribbon--bronze {
  background: #9E6B3F;
}

.mv-num-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
  font-size: var(--text-meta);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  letter-spacing: 0.04em;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.mv-item__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.mv-item__footer {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: 2px;
}

.mv-item__cat {
  font-size: var(--text-meta);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.mv-item__title {
  font-size: var(--text-body);
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text-primary);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  --line-clamp: 2;
  overflow: hidden;
  transition: color var(--duration-fast) var(--ease-in-out);
}

.mv-item:hover .mv-item__title {
  color: var(--color-accent);
}

.mv-item__excerpt {
  font-size: var(--text-body);
  font-weight: 400;
  line-height: 1.55;
  color: var(--color-text-secondary);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.mv-item__views {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-body);
  color: var(--color-text-secondary);
}

.mv-item__views svg {
  flex-shrink: 0;
  opacity: 0.65;
}

.mv-item__date {
  font-size: var(--text-body);
  color: var(--color-text-secondary);
}

@media (max-width: 767px) {
  .most-viewed__layout {
    flex-direction: column;
  }

  .most-viewed__banner {
    position: static;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .most-viewed__banner::-webkit-scrollbar {
    display: none;
  }

  /* AdRotate wrapper — bất kể class gì */
  .most-viewed__banner>* {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: var(--space-md);
    width: max-content !important;
    padding-block: var(--space-xs);
  }

  /* Từng banner item */
  .most-viewed__banner>*>* {
    flex-shrink: 0 !important;
    width: 260px !important;
    display: block !important;
  }

  .most-viewed__banner>*>* img {
    width: 100% !important;
    height: auto !important;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .most-viewed__banner {
    width: 240px;
  }
}