/**
 * Tin tức — home.php / archive.php / single.php / search.php
 * Figma: 703:4610 (tất cả), 703:5027 (chi tiết), 703:5196 (category).
 * Root: .hl-news (main). Enqueue: inc/news.php.
 */

.hl-news {
  --news-blue: #0b538d;
  --news-primary: #00a0e4;
  --news-text: #333;
  --news-cream: #f4eddf;
  --news-cream-2: #f5eee0;
  --news-chip-border: #ffeabe;
  --news-gold: #a17739;
  --news-line: rgba(11, 83, 141, 0.18);
  --news-radius: 10px;
  --news-pad: clamp(1rem, 6.944444vw, 100px);
  --news-max: 1240px;
  --news-ease: cubic-bezier(0.22, 1, 0.36, 1);
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--news-text);
  background: #fff;
}

.hl-news *,
.hl-news *::before,
.hl-news *::after {
  box-sizing: border-box;
}

.hl-news .hl-news__container {
  width: min(var(--news-max), calc(100% - 2 * var(--news-pad)));
  margin-inline: auto;
}

.hl-news a {
  color: inherit;
  text-decoration: none;
}

.hl-news .hl-news__img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

.hl-news .hl-news__accent {
  color: var(--news-primary);
}

.hl-news .screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* ── Banner (703:5285 + ảnh tòa nhà) ── */
.hl-news__hero {
  position: relative;
  height: clamp(220px, 35vw, 504px);
  overflow: hidden;
  background: var(--news-cream);
}

.hl-news .hl-news__hero-img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center bottom;
}

.hl-news__hero-bar {
  position: relative;
  z-index: 1;
  padding-block: clamp(14px, 1.67vw, 24px);
  background-image: linear-gradient(
    51.88deg,
    #a17739 5.26%,
    #bc955b 26.32%,
    rgba(246, 233, 195, 0.6) 42.76%,
    rgba(186, 141, 82, 0.4) 74.55%,
    rgba(255, 235, 191, 0) 102.12%
  );
}

.hl-news .hl-news__hero-title {
  margin: 0;
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  font-size: clamp(1.75rem, 2.78vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  text-transform: uppercase;
}

/* ── Breadcrumb (703:5288) ── */
.hl-news__breadcrumb {
  background: var(--news-cream);
  padding-block: 24px;
}

.hl-news .hl-news__breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  margin-block: 0;
  padding: 0;
  list-style: none;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--news-blue);
}

.hl-news__breadcrumb-item {
  min-width: 0;
}

.hl-news__breadcrumb-item + .hl-news__breadcrumb-item::before {
  content: '/';
  margin-inline: 0.3em;
}

.hl-news__breadcrumb-item [aria-current] {
  font-weight: 700;
}

.hl-news__breadcrumb-item a:hover {
  color: var(--news-primary);
}

/* ── Date meta ── */
.hl-news__date {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 37px;
  padding-block: 8px;
  font-size: 14px;
  line-height: 1.2;
  color: var(--news-text);
}

.hl-news__date svg {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--news-blue);
}

/* ── "Xem chi tiết" / "Xem tất cả" ── */
.hl-news .hl-news__more {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  min-height: 37px;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--news-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hl-news__more svg {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  transition: transform 0.3s var(--news-ease);
}

.hl-news__more:hover svg,
.hl-news__more:focus-visible svg {
  transform: translate(2px, -2px) rotate(45deg);
}

/* ── Cards ── */
.hl-news__card {
  position: relative;
  display: flex;
  min-width: 0;
}

.hl-news .hl-news__card-media {
  display: block;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: var(--news-radius);
  background: var(--news-cream);
}

.hl-news__card-media .hl-news__img {
  transition: transform 0.6s var(--news-ease);
}

.hl-news__card:hover .hl-news__card-media .hl-news__img {
  transform: scale(1.04);
}

.hl-news__card-body {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.hl-news .hl-news__card-title {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  line-height: 24px;
  color: var(--news-blue);
}

.hl-news .hl-news__card-title a {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  transition: color 0.2s ease;
}

.hl-news .hl-news__card-title a:hover,
.hl-news .hl-news__card-title a:focus-visible {
  color: var(--news-primary);
}

.hl-news .hl-news__card-excerpt {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--news-text);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* featured: ảnh 600×400 + tiêu đề 32px */
.hl-news__card--featured {
  align-items: center;
  gap: 24px;
}

.hl-news__card--featured .hl-news__card-media {
  width: 48.4%;
  aspect-ratio: 3 / 2;
}

.hl-news__card--featured .hl-news__card-body {
  gap: 12px;
}

.hl-news .hl-news__card--featured .hl-news__card-title {
  font-size: clamp(1.5rem, 2.22vw, 2rem);
  line-height: 1.25;
}

.hl-news .hl-news__card--featured .hl-news__card-excerpt {
  font-size: 16px;
  -webkit-line-clamp: 3;
}

/* wide: card trắng, ảnh 300×200 */
.hl-news__card--wide {
  align-items: center;
  gap: 24px;
  height: 100%;
  padding: 24px;
  border-radius: var(--news-radius);
  background: #fff;
}

.hl-news__card--wide .hl-news__card-media {
  width: 300px;
  max-width: 52%;
  aspect-ratio: 3 / 2;
}

.hl-news__card--wide .hl-news__card-body {
  gap: 4px;
}

.hl-news .hl-news__card--wide .hl-news__card-title {
  line-height: 28px;
}

.hl-news .hl-news__card--wide .hl-news__card-excerpt {
  -webkit-line-clamp: 3;
}

/* grid: ảnh trên */
.hl-news__card--grid {
  flex-direction: column;
  gap: 12px;
}

.hl-news__card--grid .hl-news__card-media {
  width: 100%;
  aspect-ratio: 3 / 2;
}

.hl-news__card--grid .hl-news__card-body {
  gap: 4px;
  width: 100%;
}

/* list: ảnh 150×100 */
.hl-news__card--list {
  align-items: center;
  gap: 12px;
}

.hl-news__card--list .hl-news__card-media {
  width: 150px;
  aspect-ratio: 3 / 2;
}

.hl-news .hl-news__card--list .hl-news__card-title a {
  -webkit-line-clamp: 2;
}

.hl-news .hl-news__card--list .hl-news__card-excerpt {
  -webkit-line-clamp: 1;
}

/* ── Khối nổi bật (703:4700) ── */
.hl-news__highlight {
  position: relative;
  overflow: hidden;
  padding-block: 48px 60px;
  background: var(--news-cream-2);
}

.hl-news__highlight::before,
.hl-news__related::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(131.76deg, rgba(248, 228, 192, 0.85) 0%, rgba(255, 255, 255, 0.55) 38%, rgba(255, 255, 255, 0) 74%),
    url('../images/tin-tuc/section-texture.webp') center bottom / cover no-repeat;
  opacity: 0.64;
  pointer-events: none;
}

.hl-news__highlight-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hl-news__highlight .hl-news__card--featured {
  padding: 24px;
  border-radius: var(--news-radius);
  background: #fff;
}

/* ── Carousel (nổi bật + liên quan) ── */
.hl-news__carousel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hl-news__carousel-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 24px) / 2);
  gap: 24px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.hl-news__carousel-track::-webkit-scrollbar {
  display: none;
}

.hl-news__carousel-slide {
  min-width: 0;
  scroll-snap-align: start;
}

.hl-news__carousel-nav {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.hl-news .hl-news__carousel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: #fff;
  color: var(--news-blue);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(11, 83, 141, 0.08);
  transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.hl-news .hl-news__carousel-btn:hover:not(:disabled) {
  background: var(--news-primary);
  color: #fff;
}

.hl-news .hl-news__carousel-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.hl-news__carousel.is-static .hl-news__carousel-nav {
  display: none;
}

/* ── Section chung ── */
.hl-news__section {
  padding-block: 48px 64px;
}

.hl-news__section--categories {
  padding-block: 64px;
}

.hl-news__section--categories > .hl-news__container {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.hl-news .hl-news__heading {
  margin: 0 0 32px;
  font-size: clamp(2rem, 3.33vw, 3rem);
  font-weight: 500;
  line-height: 1.17;
  color: var(--news-blue);
}

.hl-news .hl-news__divider {
  width: 100%;
  height: 0;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--news-line);
}

.hl-news .hl-news__divider--gold {
  margin-block: 48px;
  border-top-color: rgba(161, 119, 57, 0.35);
}

/* Lọc category (703:4758) */
.hl-news__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hl-news .hl-news__chip {
  display: inline-flex;
  align-items: center;
  height: 42px;
  padding: 8px 12px;
  border: 1.5px solid var(--news-chip-border);
  border-radius: 40px;
  background: #fff;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  color: var(--news-blue);
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.hl-news .hl-news__chip:hover,
.hl-news .hl-news__chip.is-active {
  background: var(--news-primary);
  color: #fff;
}

/* Nhóm theo category */
.hl-news__group {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hl-news__group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.hl-news .hl-news__group-title {
  margin: 0;
  font-size: clamp(1.5rem, 2.22vw, 2rem);
  font-weight: 500;
  line-height: 1.75;
  color: var(--news-blue);
  white-space: nowrap;
}

.hl-news__group-line {
  flex: 1 1 0;
  min-width: 24px;
  height: 1px;
  background: var(--news-line);
}

.hl-news__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.hl-news__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.hl-news__empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  font-size: 16px;
  color: var(--news-text);
}

.hl-news__empty p {
  margin: 0;
}

/* ── Phân trang (703:5423) ── */
.hl-news__pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin-top: 48px;
}

.hl-news .hl-news__page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid #f1f1f1;
  border-radius: 32px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  color: var(--news-text);
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.hl-news .hl-news__page svg {
  width: 16px;
  height: 16px;
}

.hl-news a.hl-news__page:hover {
  border-color: var(--news-primary);
  color: var(--news-primary);
}

.hl-news .hl-news__page.current {
  border-color: var(--news-primary);
  background: var(--news-primary);
  color: #fff;
}

.hl-news .hl-news__page.dots {
  border-color: transparent;
}

.hl-news .hl-news__page.is-disabled {
  opacity: 0.4;
}

/* ── Tìm kiếm ── */
.hl-news__search {
  display: flex;
  gap: 12px;
  margin-bottom: 40px;
  padding: 8px;
  border: 1.5px solid var(--news-chip-border);
  border-radius: 48px;
  background: #fff;
  box-shadow: 0 6px 24px rgba(11, 83, 141, 0.06);
}

.hl-news .hl-news__search-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 16px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 16px;
  color: var(--news-text);
  outline: none;
}

.hl-news .hl-news__search-input::placeholder {
  color: #8a8a8a;
}

.hl-news__search:focus-within {
  border-color: var(--news-primary);
}

.hl-news .hl-news__search-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 40px;
  background: var(--news-primary);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.hl-news .hl-news__search-btn:hover {
  background: var(--news-blue);
}

.hl-news .hl-news__heading--search {
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}

.hl-news .hl-news__count {
  margin: 0 0 32px;
  font-size: 16px;
  color: var(--news-text);
}

/* ── Chi tiết bài viết (703:5115) ── */
.hl-news__article {
  padding-block: 48px 64px;
}

.hl-news__article-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 24px;
}

.hl-news .hl-news__eyebrow {
  font-size: 16px;
  line-height: 20px;
  color: var(--news-primary);
  text-transform: uppercase;
}

.hl-news .hl-news__article-title {
  margin: 0;
  font-size: clamp(1.75rem, 3.33vw, 3rem);
  font-weight: 500;
  line-height: 1.17;
  color: var(--news-blue);
}

.hl-news__content {
  font-size: 16px;
  line-height: 1.6;
  color: var(--news-text);
  overflow-wrap: break-word;
}

.hl-news__content > * {
  margin-block: 0;
}

.hl-news__content > * + * {
  margin-top: 24px;
}

.hl-news__content a {
  color: var(--news-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hl-news__content h2,
.hl-news__content h3,
.hl-news__content h4 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--news-text);
}

.hl-news__content h2 {
  font-size: 24px;
  color: var(--news-blue);
}

.hl-news__content ul,
.hl-news__content ol {
  padding-left: 24px;
}

.hl-news__content li {
  line-height: 28px;
}

.hl-news__content img {
  max-width: 100%;
  height: auto;
}

.hl-news__content figure {
  margin-inline: 0;
}

/* Ảnh có chú thích: nền kem, caption nghiêng giữa (703:5133) */
.hl-news__content .wp-block-image:has(figcaption),
.hl-news__content figure.wp-caption {
  overflow: hidden;
  border-radius: var(--news-radius);
  background: var(--news-cream);
  width: 100% !important;
}

.hl-news__content .wp-block-image img,
.hl-news__content .wp-caption img {
  display: block;
  width: 100%;
  border-radius: var(--news-radius);
  object-fit: cover;
}

.hl-news__content .wp-block-image:has(figcaption) img,
.hl-news__content .wp-caption img {
  border-radius: var(--news-radius) var(--news-radius) 0 0;
}

.hl-news__content figcaption,
.hl-news__content .wp-caption-text {
  margin: 0;
  padding: 12px;
  font-size: clamp(1rem, 1.39vw, 1.25rem);
  font-style: italic;
  line-height: 1.4;
  text-align: center;
  color: var(--news-text);
}

/* Trích dẫn: viền vàng bo 22px (703:5137) */
.hl-news__content blockquote,
.hl-news__content .wp-block-quote,
.hl-news__content .wp-block-pullquote {
  margin-inline: 0;
  padding: 24px;
  border: 2px solid var(--news-gold);
  border-radius: 22px;
  font-size: clamp(1.0625rem, 1.39vw, 1.25rem);
  font-weight: 500;
  line-height: 1.4;
  color: var(--news-blue);
}

.hl-news__content blockquote p {
  margin: 0;
}

.hl-news__content blockquote p + p {
  margin-top: 12px;
}

.hl-news__content blockquote cite {
  display: block;
  margin-top: 12px;
  font-size: 15px;
  font-style: normal;
  color: var(--news-text);
}

.hl-news__content .wp-block-gallery {
  gap: 24px;
}

.hl-news__page-links {
  display: flex;
  gap: 8px;
}

/* Bài viết liên quan (703:5151) */
.hl-news__related {
  position: relative;
  overflow: hidden;
  padding-block: 64px 60px;
  background: var(--news-cream-2);
}

.hl-news__related > .hl-news__container {
  position: relative;
}

.hl-news .hl-news__related-title {
  margin: 0 0 48px;
  font-size: clamp(2rem, 3.33vw, 3rem);
  font-weight: 500;
  line-height: 1.17;
  text-align: center;
  color: var(--news-blue);
}

/* ── Focus ── */
.hl-news a:focus-visible,
.hl-news button:focus-visible {
  outline: 2px solid var(--news-primary);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .hl-news__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hl-news__carousel-track {
    grid-auto-columns: min(560px, 85%);
  }

  .hl-news__card--wide {
    padding: 16px;
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .hl-news__section,
  .hl-news__section--categories,
  .hl-news__article,
  .hl-news__related {
    padding-block: 40px;
  }

  .hl-news__highlight {
    padding-block: 32px 40px;
  }

  .hl-news__breadcrumb {
    padding-block: 14px;
  }

  .hl-news .hl-news__breadcrumb-list {
    font-size: 14px;
  }

  .hl-news .hl-news__breadcrumb-list {
    flex-wrap: nowrap;
  }

  .hl-news__breadcrumb-item {
    flex-shrink: 0;
    white-space: nowrap;
  }

  .hl-news__breadcrumb-item:last-child {
    flex-shrink: 1;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hl-news__card--featured {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .hl-news__card--featured .hl-news__card-media {
    width: 100%;
  }

  .hl-news__highlight .hl-news__card--featured {
    padding: 16px;
  }

  .hl-news__card--wide {
    flex-direction: column;
    align-items: stretch;
  }

  .hl-news__card--wide .hl-news__card-media {
    width: 100%;
    max-width: none;
  }

  .hl-news__carousel-track {
    grid-auto-columns: 82%;
    gap: 16px;
  }

  .hl-news__list {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .hl-news__grid {
    gap: 16px;
  }

  .hl-news__card--list .hl-news__card-media {
    width: 120px;
  }

  .hl-news .hl-news__card-title {
    font-size: 16px;
    line-height: 22px;
  }

  .hl-news__filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-inline: calc(-1 * var(--news-pad));
    padding-inline: var(--news-pad);
    scrollbar-width: none;
  }

  .hl-news__filters::-webkit-scrollbar {
    display: none;
  }

  .hl-news .hl-news__group-head {
    flex-wrap: wrap;
  }

  .hl-news .hl-news__group-line {
    display: none;
  }

  .hl-news .hl-news__group-head .hl-news__more {
    margin-left: auto;
    font-size: 16px;
  }

  .hl-news .hl-news__divider--gold {
    margin-block: 32px;
  }

  .hl-news .hl-news__related-title {
    margin-bottom: 28px;
  }

  .hl-news .hl-news__search-btn span {
    display: none;
  }

  .hl-news .hl-news__search-btn {
    padding: 0 14px;
  }

  .hl-news__content blockquote {
    padding: 18px;
    border-radius: 16px;
  }
}

@media (max-width: 480px) {
  .hl-news__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hl-news *,
  .hl-news__carousel-track {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
