/* ============================================================
   main.css — EduVenture Global Styles
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green-50: #e8f5ee;
  --green-100: #c1e3d0;
  --green-500: #1a7f5a;
  --green-600: #156648;
  --green-700: #0f4f38;
  --blue-50: #e4f0fc;
  --blue-500: #1860a5;
  --amber-50: #faeeda;
  --amber-500: #ba7517;
  --gray-50: #f5f5f3;
  --gray-100: #e8e8e4;
  --gray-400: #9a9890;
  --gray-600: #5f5e5a;
  --gray-900: #1c1c1a;
  --red-500: #a32d2d;
  --red-50: #fcebeb;

  --font: 'Be Vietnam Pro', sans-serif;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --transition: .2s ease;
}

html { scroll-behavior: smooth; min-height: 100%; }
body { min-height: 100vh; display: flex; flex-direction: column; }

/* Brand color transitions — applied to color-sensitive elements */
.btn, .navbar__cta, .footer, .cta-section,
.hero__badge, .hero__badge-dot,
.section__eyebrow, .stats-bar__num,
.skill-pill--active, .partner-pill--highlight,
.news-card__link, .testi-card__avatar,
a[class], .badge--green, .pill--active {
  transition: background-color .4s ease, color .4s ease, border-color .4s ease;
}
main { flex: 1; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--gray-900);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: var(--font); cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: var(--font); }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: .625rem 1.25rem;
  border-radius: var(--radius);
  font-size: .9375rem;
  font-weight: 500;
  font-family: var(--font);
  line-height: 1;
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
}
.btn--primary { background: var(--green-500); color: #fff; border: 1.5px solid var(--green-500); }
.btn--primary:hover { background: var(--green-600); border-color: var(--green-600); }
.btn--outline { background: transparent; color: var(--green-500); border: 1.5px solid var(--green-500); }
.btn--outline:hover { background: var(--green-50); }
.btn--white { background: #fff; color: var(--green-700); border: 1.5px solid #fff; }
.btn--white:hover { background: var(--green-50); }
.btn--outline-white { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.6); }
.btn--outline-white:hover { background: rgba(255,255,255,.15); }
.btn--danger { background: var(--red-50); color: var(--red-500); border: 1.5px solid #f09595; }
.btn--danger:hover { background: #f7c1c1; }
.btn--warning { background: #fffbeb; color: #b45309; border: 1.5px solid #fcd34d; }
.btn--warning:hover { background: #fef3c7; }
.btn--sm { padding: .375rem .75rem; font-size: .8125rem; }
.btn--lg { padding: .875rem 1.75rem; font-size: 1rem; }
.btn--block { width: 100%; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .2em .7em;
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 500;
}
.badge--green { background: var(--green-50); color: var(--green-500); }
.badge--blue { background: var(--blue-50); color: var(--blue-500); }
.badge--gray { background: var(--gray-100); color: var(--gray-600); }
.badge--amber { background: var(--amber-50); color: var(--amber-500); }

/* ── Pills (filter) ───────────────────────────────────────── */
.pill {
  display: inline-block;
  padding: .3em 1em;
  border-radius: 999px;
  font-size: .875rem;
  border: 1px solid var(--gray-100);
  color: var(--gray-600);
  background: #fff;
  transition: all var(--transition);
}
.pill:hover { border-color: var(--green-500); color: var(--green-500); }
.pill--active { background: var(--green-500); color: #fff; border-color: var(--green-500); }

/* ── Flash messages ───────────────────────────────────────── */
.flash {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  min-width: 320px;
  max-width: 560px;
  padding: .875rem 1.25rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: .9rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: flashIn .3s ease;
}
.flash--success { background: var(--green-50); color: var(--green-600); border: 1px solid var(--green-100); }
.flash--error { background: var(--red-50); color: var(--red-500); border: 1px solid #f09595; }
.flash--admin { position: fixed; top: 1.25rem; left: 50%; transform: translateX(-50%); min-width: unset; max-width: unset; margin: 0; animation: flashIn .28s ease; border-radius: 999px; padding: .7rem 1.4rem; }
.flash__close { background: none; border: none; cursor: pointer; font-size: 1rem; opacity: .6; }
.flash__close:hover { opacity: 1; }
@keyframes flashIn { from { opacity: 0; transform: translateX(-50%) translateY(-28px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ── Navbar ───────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-100);
}
.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.navbar__brand { display: flex; align-items: center; gap: 10px; }
.navbar__name { font-size: 1.0625rem; font-weight: 700; color: var(--green-700); }
.navbar__nav { display: flex; align-items: center; gap: .25rem; }
.navbar__link {
  padding: .4rem .85rem;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 500;
  color: var(--gray-600);
  transition: all var(--transition);
}
.navbar__link:hover { color: var(--green-600); background: var(--green-50); }
.navbar__link--active { color: var(--green-600); background: var(--green-50); }
.navbar__link--cta { background: var(--green-500); color: #fff; margin-left: .5rem; }
.navbar__link--cta:hover { background: var(--green-600); color: #fff; }
.navbar__toggle { display: none; flex-direction: column; gap: 5px; padding: 6px; }
.navbar__toggle span { display: block; width: 22px; height: 2px; background: var(--gray-600); border-radius: 2px; transition: var(--transition); }
.navbar__mobile { display: none; flex-direction: column; padding: .5rem 1.5rem 1rem; border-top: 1px solid var(--gray-100); }
.navbar__mobile .navbar__link { padding: .625rem 0; border-radius: 0; border-bottom: 1px solid var(--gray-100); }

/* ── Footer ───────────────────────────────────────────────── */
.footer {
  background-color: var(--green-500);
  background-image: radial-gradient(ellipse at 20% 50%, rgba(255,255,255,.10) 0%, rgba(0,0,0,.18) 55%, rgba(0,0,0,.35) 100%);
  color: rgba(255,255,255,.88);
  position: relative;
  overflow: hidden;
}
.footer::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(255,255,255,.12) 0%, transparent 65%);
  pointer-events: none;
}
.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 3.5rem 1.5rem 2.5rem;
  gap: 3rem;
  flex-wrap: wrap;
  position: relative;
}
.footer__brand { display: flex; align-items: flex-start; gap: 14px; max-width: 280px; }
.footer__logo { background: rgba(255,255,255,.1); border-radius: 10px; padding: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.footer__brand-name { font-size: 1.15rem; font-weight: 700; color: #fff; letter-spacing: -.01em; }
.footer__brand-tagline { font-size: .8125rem; color: rgba(255,255,255,.5); margin-top: 4px; line-height: 1.4; }
.footer__brand-desc { font-size: .8125rem; color: rgba(255,255,255,.45); margin-top: 10px; line-height: 1.6; }
.footer__links { display: flex; gap: 4rem; }
.footer__col { display: flex; flex-direction: column; gap: .55rem; }
.footer__col-title {
  font-size: .7rem;
  font-weight: 700;
  color: rgba(255,255,255,.35);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: .5rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.footer__col a, .footer__col span { font-size: .875rem; color: rgba(255,255,255,.65); }
.footer__col a:hover { color: #fff; padding-left: 2px; transition: all .2s; }
.footer__bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 1.25rem 1.5rem;
  font-size: .8125rem;
  color: rgba(255,255,255,.35);
  text-align: center;
  background: rgba(0,0,0,.15);
}
.footer__social-link {
  display: flex !important;
  align-items: center;
  gap: .4rem;
  color: rgba(255,255,255,.65) !important;
  text-decoration: none;
  transition: color .2s;
  background: rgba(255,255,255,.07);
  padding: .3em .65em;
  border-radius: 5px;
  width: fit-content;
  margin-top: .1rem;
}
.footer__social-link:hover { color: #fff !important; background: rgba(255,255,255,.13); }

/* ── Sections ─────────────────────────────────────────────── */
.section { padding: 4rem 0; }
.section--gray { background: var(--gray-50); }
.section__header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 2rem; }
.section__title { font-size: 1.75rem; font-weight: 700; color: var(--gray-900); }
.section__sub { font-size: .9375rem; color: var(--gray-600); margin-top: .25rem; }
.section__more { font-size: .9rem; color: var(--green-500); font-weight: 500; }
.section__more:hover { text-decoration: underline; }

/* ── Page header ──────────────────────────────────────────── */
.page-header {
  background: linear-gradient(135deg, var(--green-50) 0%, #e0f0ff 100%);
  padding: 3.5rem 0;
  border-bottom: 1px solid var(--gray-100);
}
.page-header__title { font-size: 2.25rem; font-weight: 700; margin-bottom: .5rem; }
.page-header__sub { font-size: 1rem; color: var(--gray-600); max-width: 560px; }

/* ── Breadcrumb ───────────────────────────────────────────── */
.breadcrumb { background: var(--gray-50); border-bottom: 1px solid var(--gray-100); }
.breadcrumb__inner { display: flex; align-items: center; gap: .5rem; padding: .75rem 1.5rem; font-size: .875rem; color: var(--gray-600); flex-wrap: wrap; }
.breadcrumb__inner a:hover { color: var(--green-500); }
.breadcrumb__inner span:last-child { color: var(--gray-900); font-weight: 500; }

/* ── News cards grid ──────────────────────────────────────── */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.news-card {
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.news-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.news-card__img {
  height: 180px;
  background: linear-gradient(135deg, var(--green-50), #d4eaff);
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.news-card__img-placeholder { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.news-card__cat {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--green-500);
  color: #fff;
  font-size: .75rem;
  font-weight: 500;
  padding: .2em .7em;
  border-radius: 4px;
}
.news-card__body { padding: 1.125rem; }
.news-card__meta { display: flex; gap: .75rem; font-size: .8125rem; color: var(--gray-600); margin-bottom: .5rem; }
.news-card__loc { color: var(--green-500); }
.news-card__title { font-size: 1rem; font-weight: 600; line-height: 1.4; margin-bottom: .5rem; color: var(--gray-900); }
.news-card__summary { font-size: .875rem; color: var(--gray-600); margin-bottom: .875rem; line-height: 1.55; }
.news-card__link { font-size: .875rem; font-weight: 600; color: var(--green-500); }
.news-card__link:hover { text-decoration: underline; }

/* ── Article list — kiểu báo (trang chủ & tất cả trang) ──── */
.article-list {
  display: flex;
  flex-direction: column;
}
.article-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.125rem;
  padding: 1.125rem 0;
  border-bottom: 1px solid var(--gray-100);
  text-decoration: none;
  color: inherit;
}
.article-row:first-child { padding-top: 0; }
.article-row:last-child { border-bottom: none; }
.article-row:hover .article-row__title a { color: var(--green-500); }

.article-row__thumb-link { display: block; flex-shrink: 0; width: 180px; }
.article-row__thumb {
  width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: var(--radius);
  background-color: var(--green-50);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: opacity var(--transition);
  overflow: hidden;
}
.article-row__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: var(--radius);
}
.article-row__thumb-link:hover .article-row__thumb { opacity: .92; }
.article-row__thumb--placeholder {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 24 24' fill='none' stroke='%231a7f5a' stroke-width='1.2' opacity='0.3'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpath d='m21 15-5-5L5 21'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 40px;
}

.article-row__body { display: flex; flex-direction: row; justify-content: space-between; align-items: center; min-width: 0; gap: 1rem; }
.article-row__content { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.article-row__action { flex-shrink: 0; align-self: center; }
.article-row__top {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .375rem;
  flex-wrap: wrap;
}
.article-row__cat {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--green-500);
  background: var(--green-50);
  padding: .15em .6em;
  border-radius: 3px;
}
.article-row__time {
  font-size: .78rem;
  color: var(--gray-400);
}
.article-row__title {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: .4rem;
  color: var(--gray-900);
}
.article-row__title a { color: inherit; transition: color var(--transition); }
.article-row__title a:hover { color: var(--green-500); }
.article-row__summary {
  font-size: .875rem;
  color: var(--gray-600);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-row__badge {
  font-size: .72rem;
  font-weight: 500;
  color: var(--gray-600);
  background: var(--gray-100);
  padding: .15em .55em;
  border-radius: 3px;
}
.article-row__link {
  display: inline-block;
  margin-top: .5rem;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--green-500);
}
.article-row__link:hover { text-decoration: underline; }

/* Tablet */
@media (max-width: 900px) {
  .article-row { grid-template-columns: 140px 1fr; }
  .article-row__thumb-link { width: 140px; }
  .article-row__thumb { aspect-ratio: 3 / 2; }
}

/* Mobile */
@media (max-width: 600px) {
  .article-row {
    grid-template-columns: 100px 1fr;
    gap: .75rem;
    padding: .875rem 0;
  }
  .article-row__thumb-link { width: 100px; }
  .article-row__thumb { aspect-ratio: 3 / 2; border-radius: 6px; }
  .article-row__body { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .article-row__cat { font-size: .65rem; }
  .article-row__time { font-size: .7rem; }
  .article-row__title { font-size: .9rem; margin-bottom: .25rem; }
  .article-row__summary { font-size: .8rem; -webkit-line-clamp: 2; }
  .article-row__link { display: none; }
}

/* ── Event list — kiểu bài báo ────────────────────────────── */
.event-list { display: flex; flex-direction: column; }
.event-item {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--gray-100);
  border-radius: 0;
  transition: none;
}
.event-item:first-child { padding-top: 0; }
.event-item:hover { box-shadow: none; }
.event-item:hover .event-item__title a { color: var(--green-500); }

/* Thumbnail bên trái — tỉ lệ 4:3 */
.event-item__thumb-wrap { width: 140px; flex-shrink: 0; }
.event-item__thumb {
  width: 140px;
  height: 105px;
  border-radius: var(--radius);
  background-color: var(--green-50);
  background-size: cover;
  background-position: center;
}
.event-item__thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}
.event-item__thumb--placeholder::after {
  content: '';
  display: block;
  width: 36px;
  height: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 24 24' fill='none' stroke='%231a7f5a' stroke-width='1.5' opacity='0.35'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpath d='m21 15-5-5L5 21'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
}

/* Ngày + meta + tiêu đề + tóm tắt */
.event-item__date-line {
  font-size: .78rem;
  color: var(--gray-400);
  margin-bottom: .3rem;
}
.event-item__meta { display: flex; gap: .4rem; margin-bottom: .35rem; flex-wrap: wrap; align-items: center; }
.event-item__title { font-size: 1rem; font-weight: 700; margin-bottom: .35rem; line-height: 1.4; }
.event-item__title a { color: var(--gray-900); transition: color var(--transition); }
.event-item__title a:hover { color: var(--green-500); }
.event-item__summary { font-size: .875rem; color: var(--gray-600); line-height: 1.55; }

/* ── Pagination ───────────────────────────────────────────── */
.pagination { display: flex; justify-content: center; align-items: center; gap: .5rem; margin-top: 2.5rem; }
.pagination__btn {
  min-width: 36px;
  height: 36px;
  padding: 0 .75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  border: 1px solid var(--gray-100);
  font-size: .875rem;
  color: var(--gray-600);
  transition: all var(--transition);
}
.pagination__btn:hover { border-color: var(--green-500); color: var(--green-500); }
.pagination__btn--active { background: var(--green-500); color: #fff; border-color: var(--green-500); }

/* ── Stats section ────────────────────────────────────────── */
.stats-section { background: var(--green-500); padding: 3rem 0; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.stat-item { text-align: center; }
.stat-item__num { font-size: 2.25rem; font-weight: 700; color: #fff; }
.stat-item__label { font-size: .875rem; color: rgba(255,255,255,.75); margin-top: .25rem; }

/* ── CTA section ──────────────────────────────────────────── */
.cta-section {
  background-color: var(--green-500);
  background-image: linear-gradient(135deg, rgba(0,0,0,.28) 0%, rgba(0,0,0,.12) 100%);
  padding: 3.5rem 0;
}
.cta-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}
.cta-section__title { font-size: 1.625rem; font-weight: 700; color: #fff; margin-bottom: .375rem; }
.cta-section__desc { color: rgba(255,255,255,.75); font-size: .9375rem; }
.cta-section__actions { display: flex; gap: .875rem; }

/* ── Filter bar ───────────────────────────────────────────── */
.filter-bar { margin-bottom: 1.75rem; }
.filter-bar__pills { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ── Article ──────────────────────────────────────────────── */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2.5rem;
  align-items: start;
}
.article { min-width: 0; max-width: 100%; }
.article__header { margin-bottom: 2rem; }
.article__meta { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.article__title { font-size: 2rem; font-weight: 700; line-height: 1.3; margin-bottom: .75rem; }
.article__date { display: flex; align-items: center; gap: 6px; font-size: .875rem; color: var(--gray-600); margin-bottom: 1rem; }
.article__lead { font-size: 1.0625rem; color: var(--gray-600); line-height: 1.6; border-left: 3px solid var(--green-500); padding-left: 1rem; }
.article__cover { margin-bottom: 2rem; border-radius: var(--radius-lg); overflow: hidden; }
.article__cover img {
  width: 100%;
  height: 360px;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* Mobile: dùng aspect-ratio thay height cứng để ảnh không bị méo */
@media (max-width: 600px) {
  .article__cover { border-radius: var(--radius); margin-bottom: 1.25rem; }
  .article__cover img {
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: center;
  }
}
.prose { line-height: 1.8; font-size: 1rem; }
.prose p { margin-bottom: 1.2em; }
.prose h2, .prose h3 { font-weight: 700; margin: 1.5em 0 .5em; }
.prose ul, .prose ol { margin: 1em 0 1em 1.5em; }
.prose li { margin-bottom: .4em; }
.prose img {
  border-radius: var(--radius);
  margin: 1.5em 0;
  max-width: 100%;
  height: auto;
  display: block;
}
.article__footer { display: flex; gap: 1rem; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--gray-100); }
.article-sidebar { display: flex; flex-direction: column; gap: 1.25rem; }
.article-sidebar--sticky { position: sticky; top: 1.5rem; max-height: calc(100vh - 3rem); overflow-y: auto; scrollbar-width: none; }
.article-sidebar--sticky::-webkit-scrollbar { display: none; }
.sidebar-widget { border: 1px solid var(--gray-100); border-radius: var(--radius-lg); padding: 1.25rem; }
.sidebar-widget__title { font-size: 1rem; font-weight: 600; margin-bottom: .5rem; }
.sidebar-widget__desc { font-size: .875rem; color: var(--gray-600); margin-bottom: 1rem; }
/* Related news list */
.related-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .875rem; }
.related-item { display: flex; gap: .75rem; align-items: flex-start; }
.related-item__thumb-link { flex-shrink: 0; width: 64px; height: 48px; border-radius: 6px; overflow: hidden; display: block; }
.related-item__thumb { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .2s; }
.related-item__thumb-link:hover .related-item__thumb { opacity: .85; }
.related-item__body { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.related-item__title { font-size: .825rem; font-weight: 600; color: var(--color-text); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; transition: color var(--transition); }
.related-item__title:hover { color: var(--green-500); }

/* ── Download page ────────────────────────────────────────── */
.download-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2.5rem;
  align-items: start;
}
.dl-card {
  border: 1.5px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  position: relative;
}
.dl-card--primary { border-color: var(--green-500); background: var(--green-50); }
.dl-card__badge {
  position: absolute;
  top: -12px;
  left: 1.5rem;
  background: var(--green-500);
  color: #fff;
  font-size: .75rem;
  font-weight: 600;
  padding: .2em .9em;
  border-radius: 4px;
}
.dl-card__top { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.25rem; }
.dl-card__icon { width: 52px; height: 52px; border-radius: var(--radius); background: #fff; display: flex; align-items: center; justify-content: center; border: 1px solid var(--green-100); flex-shrink: 0; }
.dl-card__name { font-size: 1.0625rem; font-weight: 600; margin-bottom: .25rem; }
.dl-card__info { font-size: .8125rem; color: var(--gray-600); }
.dl-card__note { font-size: .8125rem; color: var(--green-600); margin-top: .875rem; }
.dl-alt-title { font-size: .9375rem; font-weight: 600; color: var(--gray-600); margin-bottom: .875rem; }
.dl-alts { display: flex; flex-direction: column; gap: .75rem; }
.dl-alt-card {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
}
.dl-alt-card:hover { border-color: var(--blue-500); background: var(--blue-50); }
.dl-alt-card__icon { width: 36px; height: 36px; border-radius: var(--radius); background: var(--blue-50); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dl-alt-card__label { font-size: .9375rem; font-weight: 500; }
.dl-alt-card__url { font-size: .8125rem; color: var(--gray-600); }
.dl-alt-card__arrow { margin-left: auto; color: var(--gray-400); }
.aside-box { border: 1px solid var(--gray-100); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1.25rem; }
.aside-box--help { background: var(--green-50); border-color: var(--green-100); }
.aside-box__title { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }
.aside-box p { font-size: .875rem; color: var(--gray-600); margin-bottom: 1rem; }
.sysreq-table { width: 100%; font-size: .8125rem; border-collapse: collapse; }
.sysreq-table tr { border-bottom: 1px solid var(--gray-100); }
.sysreq-table tr:last-child { border-bottom: none; }
.sysreq-table td { padding: .5rem 0; }
.sysreq-table td:first-child { color: var(--gray-600); width: 40%; }
.sysreq-table td:last-child { font-weight: 500; }

/* ── Contact page ─────────────────────────────────────────── */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}
.contact-form-wrap__title { font-size: 1.5rem; font-weight: 700; margin-bottom: .5rem; }
.contact-form-wrap__desc { color: var(--gray-600); margin-bottom: 2rem; font-size: .9375rem; }
.contact-map { margin-bottom: 1.5rem; }
.contact-map__placeholder {
  height: 280px;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  color: var(--gray-400);
  font-size: .875rem;
  border: 1px dashed var(--gray-100);
}
.contact-details { display: flex; flex-direction: column; gap: 1rem; }
.contact-detail-item { display: flex; gap: 1rem; align-items: flex-start; }
.contact-detail-item__icon { font-size: 1.25rem; flex-shrink: 0; margin-top: .1rem; }
.contact-detail-item__label { font-size: .8rem; color: var(--gray-400); margin-bottom: .15rem; }
.contact-detail-item__value { font-size: .9375rem; font-weight: 500; }
.contact-detail-item__value a:hover { color: var(--green-500); text-decoration: underline; }

/* ── Forms ────────────────────────────────────────────────── */
.contact-form, .admin-form { display: flex; flex-direction: column; gap: 1.125rem; }
.form-group { display: flex; flex-direction: column; gap: .375rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row--3 { grid-template-columns: 1fr 1fr 1fr; }
.form-label { font-size: .8875rem; font-weight: 500; color: var(--gray-600); }
.required { color: var(--red-500); }
.form-input {
  width: 100%;
  padding: .625rem .875rem;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  font-size: .9375rem;
  color: var(--gray-900);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-input:focus { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(26,127,90,.1); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239a9890' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .875rem center; padding-right: 2.5rem; }
.form-hint { font-size: .8rem; color: var(--gray-400); margin-top: .25rem; }
.form-checkboxes { display: flex; gap: 1.5rem; }
.checkbox-label { display: flex; align-items: center; gap: .5rem; font-size: .9rem; cursor: pointer; }
.checkbox-label input { width: 16px; height: 16px; accent-color: var(--green-500); cursor: pointer; }
.form-actions { display: flex; gap: .875rem; padding-top: .5rem; }
.form-section-title { font-size: 1rem; font-weight: 600; padding-bottom: .75rem; border-bottom: 1px solid var(--gray-100); margin-bottom: .25rem; }

/* ── Label tag ────────────────────────────────────────────── */
.label-tag { display: inline-block; background: var(--green-50); color: var(--green-500); font-size: .8125rem; font-weight: 600; padding: .2em .8em; border-radius: 4px; margin-bottom: .75rem; }

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--gray-400);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.empty-state p { font-size: .9375rem; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .navbar__nav { display: none; }
  .navbar__toggle { display: flex; }
  .navbar__mobile.open { display: flex; }
  .news-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .article-layout, .download-layout, .contact-layout { grid-template-columns: 1fr; }
  .footer__inner { flex-direction: column; gap: 2rem; }
  .footer__links { flex-wrap: wrap; gap: 2rem; }
  .cta-inner { flex-direction: column; align-items: flex-start; }
  .cta-section__actions { flex-wrap: wrap; }
  .event-item { grid-template-columns: 120px 1fr; }
  .event-item__action { display: none; }
  .event-item__thumb-wrap { width: 120px; }
  .event-item__thumb { width: 120px; height: 90px; }
  .section__header { flex-direction: row; align-items: center; gap: .5rem; }
  .article-layout > :last-child { order: -1; }
  .download-layout > :last-child { order: -1; }
  /* Ẩn sidebar bài viết trên tablet/mobile */
  .article-sidebar { display: none; }
}

@media (max-width: 600px) {
  .news-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .form-row--3 { grid-template-columns: 1fr; }
  .page-header { padding: 2rem 0; }
  .page-header__title { font-size: 1.625rem; }
  .page-header__sub { font-size: .9rem; }
  .article__title { font-size: 1.375rem; }
  .section { padding: 2.5rem 0; }
  .section__title { font-size: 1.5rem; }
  .stats-section { padding: 2rem 0; }
  .stat-item__num { font-size: 1.875rem; }
  .cta-section { padding: 2.5rem 0; }
  .cta-section__title { font-size: 1.375rem; }
  .cta-section__actions { flex-direction: column; width: 100%; }
  .cta-section__actions .btn { width: 100%; justify-content: center; }
  .pagination { gap: .25rem; }
  .pagination__btn { min-width: 32px; height: 32px; font-size: .8125rem; }
  .flash { min-width: calc(100vw - 2rem); max-width: calc(100vw - 2rem); }
  .breadcrumb__inner { font-size: .8125rem; }
  .filter-bar__pills { gap: .375rem; }
  .pill { font-size: .8125rem; padding: .25em .75em; }
  .container { padding: 0 1rem; }
}


/* ============================================================
   MOBILE — toàn bộ responsive trang công khai (≤600px)
   ============================================================ */

/* ── Container ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .container { padding: 0 1rem; }
}

/* ── Navbar ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .navbar__inner { height: 56px; }
  .navbar__name  { font-size: .9rem; }
  /* Toggle button lớn hơn, dễ bấm */
  .navbar__toggle {
    padding: 8px;
    gap: 5px;
    -webkit-tap-highlight-color: transparent;
  }
  .navbar__toggle span { width: 22px; height: 2px; }
  /* Mobile menu */
  .navbar__mobile .navbar__link {
    padding: .8rem 0;
    font-size: .95rem;
    border-bottom: 1px solid var(--gray-100);
  }
  .navbar__mobile .navbar__link:last-child { border-bottom: none; }
}

/* ── Page header ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .page-header { padding: 1.5rem 0 1.25rem; }
  .page-header__title { font-size: 1.5rem; margin-bottom: .3rem; }
  .page-header__sub   { font-size: .875rem; line-height: 1.5; }
}

/* ── Section ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .section { padding: 1.75rem 0; }
  .section__header {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 1rem;
    gap: .5rem;
  }
  .section__title { font-size: 1.2rem; }
  .section__sub   { font-size: .825rem; color: var(--gray-600); margin-top: .15rem; }
  .section__more  { font-size: .825rem; flex-shrink: 0; }
}

/* ── Hero (banner có ảnh) ────────────────────────────────── */
@media (max-width: 600px) {
  .hero {
    padding: 0 !important;
    min-height: 68vw;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background-size: cover !important;
    background-position: center !important;
  }
  /* KHÔNG override #heroOverlay ở đây — để admin settings kiểm soát */
  .hero__inner {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
    padding: 2.5rem 1rem 1.75rem;
    position: relative;
    z-index: 1;
  }
  .hero__visual  { display: none !important; }
  .hero__badge   { font-size: .72rem; padding: .28em .8em; margin-bottom: .6rem; }
  .hero__title   {
    font-size: 1.45rem !important;
    line-height: 1.2;
    margin-bottom: .625rem;
    text-shadow: 0 1px 8px rgba(0,0,0,.4);
  }
  .hero__desc    {
    font-size: .875rem !important;
    margin-bottom: 1.125rem;
    line-height: 1.55;
    text-shadow: 0 1px 5px rgba(0,0,0,.3);
    opacity: 1 !important;
  }
  .hero__actions              { flex-direction: column !important; gap: .6rem !important; }
  .hero__actions .btn         { width: 100% !important; padding: .75rem 1rem; font-size: .9375rem; }
  /* Hero không có ảnh */
  .hero:not([style*="background-image"]) {
    min-height: unset;
    padding: 2rem 0 1.75rem !important;
  }
}

/* ── Event item mobile — kiểu bài báo ───────────────────── */
@media (max-width: 600px) {
  .event-list { gap: 0; }
  .event-item {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: .75rem;
    padding: .875rem 0;
    border-bottom: 1px solid var(--gray-100);
    border-radius: 0;
    align-items: flex-start;
  }
  .event-item:first-child { padding-top: 0; }
  .event-item__action { display: none; }
  .event-item__thumb-wrap { width: 100px; }
  .event-item__thumb {
    width: 100px !important;
    height: 75px !important;
    border-radius: 7px;
    background-size: cover !important;
    background-position: center !important;
  }
  .event-item__body { min-width: 0; }
  .event-item__date-line {
    font-size: .68rem;
    color: var(--gray-400);
    margin-bottom: .2rem;
  }
  .event-item__meta { margin-bottom: .2rem; gap: .25rem; flex-wrap: wrap; }
  .event-item__title {
    font-size: .9rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: .2rem;
  }
  .event-item__title a { color: var(--gray-900); }
  .event-item__summary {
    font-size: .775rem; color: var(--gray-600); line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .badge { font-size: .65rem; padding: .15em .45em; }
}

/* ── News cards (trang chủ) ──────────────────────────────── */
@media (max-width: 600px) {
  .news-grid {
    grid-template-columns: 1fr !important;
    gap: .75rem;
  }

  /* Tất cả card: featured style - ảnh trên to, nội dung dưới */
  .news-card {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: unset !important;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
  }
  .news-card__img {
    height: 180px !important;
    min-height: 180px !important;
    width: 100% !important;
    border-right: none !important;
    border-radius: 0;
    background-size: cover !important;
    background-position: center !important;
  }
  .news-card__cat { display: block; }
  .news-card__body { padding: 1rem; }
  .news-card__meta { font-size: .78rem; margin-bottom: .4rem; }
  .news-card__title { font-size: 1rem; font-weight: 700; line-height: 1.4; margin-bottom: .4rem; }
  .news-card__summary {
    font-size: .85rem; margin-bottom: .6rem; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .news-card__link { font-size: .85rem; font-weight: 600; }
}

/* ── Filter bar (pills) ──────────────────────────────────── */
@media (max-width: 600px) {
  .filter-bar { margin-bottom: 1.25rem; }
  .filter-bar__pills { gap: .375rem; flex-wrap: wrap; }
  .pill { font-size: .8rem; padding: .3em .85em; }
}

/* ── Stats section ───────────────────────────────────────── */
@media (max-width: 600px) {
  .stats-section { padding: 1rem 0; }
  .stats-grid    { grid-template-columns: repeat(2,1fr) !important; gap: .4rem 1rem; }
  .stat-item__num   { font-size: 1.5rem; }
  .stat-item__label { font-size: .75rem; }
}

/* ── CTA section ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .cta-section { padding: 1.25rem 0; }
  .cta-inner   { flex-direction: column !important; align-items: stretch !important; gap: .75rem !important; }
  .cta-section__title { font-size: 1.05rem; margin-bottom: .2rem; }
  .cta-section__desc  { font-size: .8rem; }
  .cta-section__actions { flex-direction: column !important; gap: .5rem; }
  .cta-section__actions .btn { width: 100% !important; justify-content: center !important; padding: .65rem 1rem; }
}

/* ── Footer ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .footer__inner {
    flex-direction: column;
    padding: 1.75rem 1rem 1.25rem;
    gap: 1.5rem;
  }
  .footer__brand     { max-width: 100%; align-items: flex-start; }
  .footer__brand-name    { font-size: 1rem; }
  .footer__brand-tagline { font-size: .78rem; }
  .footer__links {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }
  .footer__col:first-child { display: none; }
  .footer__col-title { font-size: .72rem; margin-bottom: .25rem; }
  .footer__col a, .footer__col span { font-size: .8rem; line-height: 1.5; word-break: break-word; overflow-wrap: anywhere; }
  .footer__col span { display: flex; align-items: flex-start; gap: 4px; }
  .footer__bottom    { font-size: .76rem; padding: .875rem 1rem; }
}

/* ── Event banner (trang chủ) ────────────────────────────── */
@media (max-width: 600px) {
  .event-banner-section { padding: .875rem 0 0 !important; }
  .event-banner-section div[style*="height:220px"] { height: 140px !important; }
  .event-banner-section h2 { font-size: 1.05rem !important; margin-bottom: .5rem !important; }
}

/* ── Forms ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .form-row   { grid-template-columns: 1fr !important; }
  .form-row--3{ grid-template-columns: 1fr !important; }
  /* Prevent iOS zoom on focus */
  .form-input, .form-textarea, .form-select { font-size: 16px !important; }
}

/* ── Flash ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .flash {
    min-width: calc(100vw - 2rem);
    max-width: calc(100vw - 2rem);
    top: 64px;
    border-radius: 8px;
  }
}

/* ── Pagination ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .pagination { gap: .25rem; flex-wrap: wrap; justify-content: center; margin-top: 1.5rem; }
  .pagination__btn { min-width: 34px; height: 34px; font-size: .8rem; }
}
/* ── Public search/filter bar ────────────────────────────── */
.pub-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .625rem;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: .875rem 1.125rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
}
.pub-filter-bar__search {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex: 1;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  padding: .45rem .75rem;
}
.pub-filter-bar__search svg { color: var(--gray-400); flex-shrink: 0; }
.pub-filter-bar__input {
  border: none;
  outline: none;
  background: transparent;
  font-size: .9rem;
  color: var(--gray-900);
  width: 100%;
  font-family: var(--font);
}
.pub-filter-bar__input::placeholder { color: var(--gray-400); }
.pub-filter-bar__select {
  padding: .45rem .75rem;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  font-size: .875rem;
  color: var(--gray-700, #374151);
  background: #fff;
  cursor: pointer;
  font-family: var(--font);
}
.pub-filter-bar__select:focus { outline: none; border-color: var(--green-500); }
.pub-filter-bar__btn {
  padding: .45rem 1.125rem;
  background: var(--green-500);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: background var(--transition);
}
.pub-filter-bar__btn:hover { background: var(--green-600); }
.pub-filter-bar__clear {
  font-size: .85rem;
  color: var(--gray-400);
  text-decoration: none;
  padding: .45rem .5rem;
  border-radius: var(--radius);
  transition: color var(--transition);
}
.pub-filter-bar__clear:hover { color: var(--gray-900); }
.pub-filter-bar__result {
  font-size: .85rem;
  color: var(--gray-600);
  margin-bottom: 1rem;
  margin-top: -.5rem;
}
@media (max-width: 600px) {
  .pub-filter-bar { padding: .75rem; gap: .5rem; }
  .pub-filter-bar__search { min-width: 100%; }
  .pub-filter-bar__select { flex: 1; min-width: 0; }
  .pub-filter-bar__btn { padding: .45rem .875rem; }
}
/* ── Download page — mobile ─────────────────────────────── */
@media (max-width: 600px) {
  /* Layout: stack thành 1 cột, sidebar lên trên */
  .download-layout {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .download-layout > .download-aside {
    order: -1;
  }

  /* dl-card: giảm padding, badge nhỏ hơn */
  .dl-card {
    padding: 1.25rem 1rem;
    margin-bottom: 1rem;
    border-radius: 12px;
  }
  .dl-card__badge {
    font-size: .7rem;
    top: -10px;
    left: 1rem;
    padding: .18em .75em;
  }
  .dl-card__top {
    gap: .75rem;
    margin-bottom: 1rem;
  }
  .dl-card__icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
  }
  .dl-card__name { font-size: .95rem; }
  .dl-card__info { font-size: .78rem; }
  .dl-card__note { font-size: .78rem; }

  /* Form bên trong card */
  .dl-card .btn--lg {
    width: 100%;
    justify-content: center;
    padding: .75rem 1rem;
    font-size: .95rem;
  }
  .dl-card .form-control {
    font-size: 16px !important; /* chặn iOS zoom */
  }

  /* Alt download cards */
  .dl-alt-card {
    padding: .875rem 1rem;
    gap: .75rem;
    border-radius: 10px;
  }
  .dl-alt-card__icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
  }
  .dl-alt-card__label { font-size: .875rem; }
  .dl-alt-card__url   { font-size: .75rem; word-break: break-all; }

  /* Aside boxes */
  .aside-box {
    padding: 1rem;
    margin-bottom: .875rem;
    border-radius: 10px;
  }
  .aside-box__title { font-size: .9rem; margin-bottom: .75rem; }
  .aside-box p      { font-size: .825rem; margin-bottom: .75rem; }
  .aside-box .btn--block {
    font-size: .875rem;
    padding: .6rem 1rem;
  }

  /* Sysreq table */
  .sysreq-table { font-size: .78rem; }
  .sysreq-table td { padding: .4rem 0; }
  .sysreq-table td:first-child { width: 45%; }

  /* Maintenance banner */
  .download-layout [style*="background:#fff7ed"] {
    padding: 1rem !important;
    gap: .75rem !important;
    border-radius: 10px !important;
  }
  .download-layout [style*="background:#fff7ed"] .btn {
    font-size: .825rem;
    padding: .45rem .9rem;
  }
}