/* ==========================================================
   RESPONSIVE - Tất cả breakpoint: desktop từ var(--container), tablet 768–1199px, mobile từ 767px trở xuống.
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}

@media (max-width: 1100px) {
.primary-nav .menu { gap: 1.3rem; }
}

@media (max-width: 1024px) {
.svc-grid, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .timeline, .process { grid-template-columns: repeat(2, 1fr); row-gap: 2.5rem; }
  .tl-step::after { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
.menu-toggle { display: inline-block; }
  .primary-nav {
    display: none; position: absolute; top: 84px; left: 0; right: 0; background: var(--paper);
    flex-direction: column; align-items: stretch; gap: 0; padding: .75rem 1.5rem 1.5rem; border-bottom: 1px solid var(--rule);
  }
  .primary-nav.open { display: flex; }
  .primary-nav .menu { flex-direction: column; gap: 0; }
  .primary-nav .menu a { display: block; padding: .95rem 0; border-bottom: 1px solid var(--rule); font-size: 1rem; }
  .primary-nav .menu a::after { display: none; }
  .nav-cta { margin-top: 1rem; width: 100%; }
  .hero-grid, .split, .feature, .cta, .cta-band, .contact-layout { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 520px; width: 100%; margin: 0 auto; }
  .feature.flip .feature-media { order: 0; }
  .sec-head { grid-template-columns: 1fr; gap: 1rem; }
  .why-grid, .grid-3, .grid-2, .service-row { grid-template-columns: 1fr; }
  .why, .why + .why { padding: 2.2rem 0; border-left: 0; border-bottom: 1px solid var(--rule); }
  .partner-grid { grid-template-columns: repeat(2, 1fr); }
  .float-card { left: .5rem; bottom: 1rem; }
}

@media (max-width: 640px) {
.wrap, .container, .narrow, .nav, .hero-grid, .split, .sec-head, .svc-grid, .feature, .why-grid, .timeline, .process,
  .partner-grid, .contact-layout, .cta, .cta-band, .footer-grid, .footer-bottom, .grid, .service-list, .hero-grid { width: min(100% - 2rem, var(--container)); }
  .svc-grid, .grid-4, .timeline, .process, .footer-grid { grid-template-columns: 1fr; }
  .contact-form .row { grid-template-columns: 1fr; }
  .row .btn, .hero-actions .btn { width: 100%; }
  .cta-side .btn { max-width: none; }
  .partner-grid { grid-template-columns: 1fr 1fr; }
  .brand-sub { display: none; }
}

@media (max-width: 1199px) {
.system-grid { grid-template-columns: repeat(2, 1fr); }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 899px) {
.portal-hero-grid, .portal-about-grid { grid-template-columns: 1fr; }
  .portal-photo { order: -1; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 767px) {
.portal-hero-grid, .portal-about-grid, .system-grid, .news-grid, .footer-grid { width: min(100% - 2rem, var(--container)); }
  .system-grid, .news-grid { grid-template-columns: 1fr; }
  .system-card { flex-direction: row; align-items: center; gap: 1rem; padding: 1rem; }
  .system-logo { margin-bottom: 0; flex: 0 0 56px; width: 56px; height: 56px; }
  .system-card .system-body { flex: 1; }
  .system-link { display: none; }
  .portal-stats { gap: .6rem; }
  .stat { padding: 1.1rem .5rem; }
  .fcol summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
  .fcol summary::after { content: "+"; color: var(--indigo); font-size: 1.2rem; }
  .fcol[open] summary::after { content: "–"; }
  .footer-grid { grid-template-columns: 1fr; gap: 1rem; }
  .brand-word { font-size: 1.25rem; }
  .lang span { min-width: 30px; }
}

@media (max-width: 767px) {
  .post-nav { grid-template-columns: 1fr; }
  .post-nav-next { text-align: left; }
  .author-box { grid-template-columns: 56px 1fr; }
  .author-avatar img { width: 56px; height: 56px; }
  .cookie-notice { flex-direction: column; align-items: stretch; }
  .topbar-in { justify-content: center; text-align: center; }
}
