@layer pages {
  .home-hero { position: relative; overflow: hidden; min-height: min(780px, calc(100vh - 2rem)); display: grid; align-items: center; background: linear-gradient(125deg, #f1faef 0%, #fff 52%, #fbf4dd 100%); }
  .home-hero__inner { position: relative; z-index: 2; display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: clamp(2rem, 6vw, 5.5rem); padding-block: clamp(4rem, 10vw, 8.5rem); }
  .home-hero__content { display: grid; gap: 1.5rem; }
  .home-hero__content h1 span { color: var(--brand-green); }
  .home-hero__visual { position: relative; min-height: 510px; }
  .home-hero__visual img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 30px 45px rgba(6,76,39,.16)); }
  .floating-card { position: absolute; display: grid; gap: .2rem; min-width: 185px; padding: .95rem 1rem; background: rgba(255,255,255,.92); border: 1px solid rgba(255,255,255,.7); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); backdrop-filter: blur(12px); }
  .floating-card strong { color: var(--brand-green-700); }
  .floating-card--one { left: -2rem; bottom: 12%; }
  .floating-card--two { right: -1rem; top: 12%; }
  .hero-trust { display: flex; align-items: center; flex-wrap: wrap; gap: 1.25rem; padding-top: 1.15rem; border-top: 1px solid var(--line); color: var(--ink-600); font-size: .9rem; }
  .hero-trust strong { color: var(--ink-950); }
  .usp-strip { position: relative; z-index: 4; margin-top: -2.6rem; }
  .usp-strip__inner { display: grid; grid-template-columns: repeat(3,1fr); background: white; border: 1px solid var(--line); border-radius: var(--radius-xl); box-shadow: var(--shadow-md); }
  .usp-item { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .9rem; padding: 1.35rem; }
  .usp-item + .usp-item { border-left: 1px solid var(--line); }
  .split { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(2.5rem, 7vw, 6rem); }
  .split__media { position: relative; }
  .split__media img { width: 100%; border-radius: var(--radius-xl); box-shadow: var(--shadow-md); }
  .split__media::before { content: ""; position: absolute; width: 38%; aspect-ratio: 1; left: -1.2rem; bottom: -1.2rem; z-index: -1; background: var(--brand-gold-100); border-radius: var(--radius-xl); }
  .process { counter-reset: process; display: grid; gap: 1rem; }
  .process__item { counter-increment: process; display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; padding: 1.1rem; background: white; border: 1px solid var(--line); border-radius: var(--radius-md); }
  .process__item::before { content: counter(process, decimal-leading-zero); width: 2.6rem; height: 2.6rem; display: grid; place-items: center; color: white; background: var(--brand-green); border-radius: .8rem; font-weight: 900; }
  .logo-wall { display: grid; grid-template-columns: repeat(5,1fr); gap: 1rem; }
  .logo-placeholder { min-height: 80px; display: grid; place-items: center; padding: 1rem; color: var(--ink-600); background: white; border: 1px solid var(--line); border-radius: var(--radius-md); font-weight: 800; }
  .news-heading { max-width: 800px; display: grid; gap: 1rem; margin-bottom: 2rem; }
  .news-filter { display: grid; grid-template-columns: minmax(240px,1fr) 220px auto; gap: .75rem; margin: 1.7rem 0 2.2rem; padding: 1rem; background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--radius-lg); }
  .news-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1.5rem; }
  .news-card { overflow: hidden; background: white; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); transition: transform var(--transition), box-shadow var(--transition); }
  .news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
  .news-card-media { display: block; aspect-ratio: 16/9; overflow: hidden; background: linear-gradient(135deg, var(--brand-green-100), var(--brand-gold-100)); }
  .news-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 350ms ease; }
  .news-card:hover .news-card-media img { transform: scale(1.04); }
  .news-placeholder { height: 100%; display: grid; place-items: center; color: var(--brand-green-700); font-size: 2rem; font-weight: 950; }
  .news-card-body { display: grid; gap: .85rem; padding: 1.3rem; }
  .news-card h2 { font-size: 1.25rem; }
  .news-card p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .news-meta, .news-stats, .article-byline { display: flex; align-items: center; flex-wrap: wrap; gap: .7rem; color: var(--ink-600); font-size: .84rem; }
  .news-meta a { color: var(--brand-green-700); font-weight: 700; }
  .news-stats { padding-top: .85rem; border-top: 1px solid var(--line); }
  .empty-state { padding: 3rem; text-align: center; background: var(--surface-soft); border: 1px dashed #b7c8bd; border-radius: var(--radius-lg); }
  .article-detail { width: min(900px,100%); margin-inline: auto; }
  .article-header { display: grid; gap: 1rem; margin-bottom: 2rem; }
  .article-header h1 { font-size: clamp(2.25rem,5vw,4.35rem); }
  .article-summary { font-size: 1.2rem; line-height: 1.75; }
  .featured-media { margin: 2rem 0; }
  .featured-media img, .article-media-section img, .article-media-section video { width: 100%; border-radius: var(--radius-lg); }
  figure figcaption { margin-top: .65rem; color: var(--ink-600); font-size: .86rem; }
  .article-content { font-size: 1.07rem; line-height: 1.88; }
  .article-content > * + * { margin-top: 1.35rem; }
  .article-content h2, .article-content h3 { margin-top: 2.2rem; }
  .article-content a { color: var(--brand-green-700); text-decoration: underline; text-underline-offset: 3px; }
  .article-content blockquote { padding: 1.25rem 1.5rem; color: var(--ink-800); background: var(--brand-green-100); border-left: 4px solid var(--brand-green); border-radius: 0 var(--radius-md) var(--radius-md) 0; }
  .article-content pre { overflow: auto; padding: 1rem; color: white; background: var(--ink-950); border-radius: var(--radius-md); }
  /* Định dạng do trình soạn bài tạo ra. API không cho thuộc tính style nên căn lề, bảng, ảnh
     và video đều đi bằng class (xem normalize-html.js và RichContentTransformer). */
  .article-content { display: flow-root; } /* chứa ảnh float, không tràn xuống phần sau bài */
  .article-content h2, .article-content h3, .article-content h4, .article-content hr,
  .article-content .table-scroll, .article-content .video-embed { clear: both; }
  .article-content hr { border: 0; border-top: 1px solid var(--line); }
  .article-content .align-center { text-align: center; }
  .article-content .align-right { text-align: right; }
  .article-content .align-justify { text-align: justify; }
  .article-content img { max-width: 100%; height: auto; border-radius: var(--radius-md); }
  .article-content img.img-center { margin-inline: auto; }
  .article-content img.img-left { float: left; max-width: 50%; margin: .35rem 1.5rem .75rem 0; }
  .article-content img.img-right { float: right; max-width: 50%; margin: .35rem 0 .75rem 1.5rem; }
  .article-content .table-scroll { overflow-x: auto; }
  .article-content table { width: 100%; border-collapse: collapse; font-size: .96rem; line-height: 1.6; }
  .article-content th, .article-content td { min-width: 5.5rem; padding: .6rem .85rem; vertical-align: top; text-align: left; border: 1px solid var(--line); }
  .article-content th { color: var(--ink-950); background: var(--surface-muted); font-weight: 700; }
  @media (max-width: 640px) {
    .article-content img.img-left, .article-content img.img-right { float: none; max-width: 100%; margin: 1rem auto; }
  }
  /* Khung video YouTube (RichContentTransformer): ảnh thu nhỏ + nút phát nằm trong một link thật.
     video-facade.js thay nó bằng trình phát khi bấm; trước đó không nạp gì từ YouTube. */
  .article-content .video-embed { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--ink-950); border-radius: var(--radius-lg); }
  .article-content .video-embed__link { position: absolute; inset: 0; display: grid; place-items: center; color: white; text-decoration: none; }
  .article-content .video-embed__link img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
  .article-content .video-embed__link::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(0,0,0,.6)); }
  .video-embed__play { position: relative; z-index: 1; width: 4.75rem; height: 3.35rem; background: var(--brand-green); border-radius: 1rem; box-shadow: var(--shadow-md); transition: transform var(--transition), background var(--transition); }
  .video-embed__play::before { content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-38%, -50%); border-style: solid; border-width: .7rem 0 .7rem 1.15rem; border-color: transparent transparent transparent white; }
  .video-embed__link:hover .video-embed__play, .video-embed__link:focus-visible .video-embed__play { background: var(--brand-green-700); transform: scale(1.07); }
  .video-embed__label { position: absolute; left: 1rem; right: 1rem; bottom: .8rem; z-index: 1; font-size: .9rem; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.65); }
  .video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
  .article-media-section, .article-attachments, .engagement-panel { margin-top: 2.5rem; }
  .gallery-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; margin-top: 1rem; }
  .article-attachments { padding: 1.25rem; background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--radius-lg); }
  .tag-list { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 2rem; }
  .tag-list a { padding: .4rem .7rem; color: var(--brand-green-700); background: var(--brand-green-100); border-radius: 999px; font-weight: 700; }
  .engagement-panel { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1.3rem; padding: 1.35rem; background: white; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
  .rating-buttons { display: inline-flex; gap: .2rem; margin: .5rem .6rem .5rem 0; }
  .rating-buttons button, .favorite-button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 2.45rem; padding: .45rem .7rem; color: var(--ink-700); background: white; border: 1px solid var(--line); border-radius: var(--radius-sm); transition: color var(--transition), background var(--transition), border-color var(--transition); }
  .rating-buttons button:hover, .favorite-button:hover { color: var(--brand-gold-700); border-color: var(--brand-gold); }
  /* Selected state fills the star/heart so it reads as "set", not just tinted. */
  .rating-buttons button.selected, .favorite-button.selected { color: #7a5b00; background: var(--brand-gold-100); border-color: var(--brand-gold); }
  .rating-buttons button.selected .icon, .favorite-button.selected .icon { fill: currentColor; }
  /* Icon + number pairs (view count, rating) share one baseline. */
  .news-stat { display: inline-flex; align-items: center; gap: .32rem; font-variant-numeric: tabular-nums; }
  .related-news { margin-top: 4rem; }
  .product-filter-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
  .product-card .card__media { aspect-ratio: 4/3; }
  .product-card__price { color: var(--brand-green-700); font-size: 1.15rem; font-weight: 850; }
  .about-values { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; }
  .value-card { min-height: 220px; padding: 1.5rem; background: white; border: 1px solid var(--line); border-radius: var(--radius-lg); }
  .value-card strong { display: inline-grid; place-items: center; width: 3rem; height: 3rem; margin-bottom: 1rem; color: white; background: var(--brand-green); border-radius: 1rem; }
  .contact-layout { display: grid; grid-template-columns: .8fr 1.2fr; gap: 2rem; align-items: start; }
  .contact-info { display: grid; gap: 1rem; }
  .contact-info__item { padding: 1.15rem; background: var(--surface-soft); border-radius: var(--radius-md); }
  @media (max-width: 1000px) {
    .home-hero__inner, .split, .contact-layout { grid-template-columns: 1fr; }
    .home-hero__visual { min-height: 420px; }
    .news-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .logo-wall { grid-template-columns: repeat(3,1fr); }
  }
  @media (max-width: 760px) {
    .usp-strip { margin-top: 0; padding-top: 1rem; }
    .usp-strip__inner { grid-template-columns: 1fr; }
    .usp-item + .usp-item { border-left: 0; border-top: 1px solid var(--line); }
    .news-filter { grid-template-columns: 1fr; }
    .news-grid, .about-values { grid-template-columns: 1fr; }
    .home-hero__visual { min-height: 330px; }
    .floating-card { display: none; }
    .logo-wall { grid-template-columns: repeat(2,1fr); }
    .gallery-grid { grid-template-columns: 1fr; }
  }
}
