/* frontend/static/css/custom.css */
/* custom.css - Cosmic Architect Dark Theme */

/* ========================================================================= */
/* UTILITY DOUBLE-CLASSES (NÚT BẤM KHẨN CẤP)                                 */
/* ========================================================================= */
.d-none.d-none { display: none; }
.d-block.d-block { display: block; }
.text-center.text-center { text-align: center; }
.text-left.text-left { text-align: left; }
.text-right.text-right { text-align: right; }
.text-white.text-white { color: #ffffff; }
.text-red.text-red { color: #dc3545; }
.text-muted.text-muted { color: var(--text-muted); }
.mt-0.mt-0 { margin-top: 0; }
.mt-1.mt-1 { margin-top: 0.5rem; }
.mt-2.mt-2 { margin-top: 1rem; }
.mt-3.mt-3 { margin-top: 1.5rem; }
.mb-0.mb-0 { margin-bottom: 0; }
.mb-1.mb-1 { margin-bottom: 0.5rem; }
.mb-2.mb-2 { margin-bottom: 1rem; }
.mb-3.mb-3 { margin-bottom: 1.5rem; }
.w-100.w-100 { width: 100%; }
.m-r-1.m-r-1 { margin-right: 1rem; }
.border-none.border-none { border: none; }
.bg-white.bg-white { background-color: #ffffff; }

/* ========================================================================= */
/* GLOBAL VARIABLES & RESET                                                  */
/* ========================================================================= */
/* custom.css - Cosmic Architect Dark Theme */
:root {
  --font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bg-color: #18181b;
  /* Nền chính đen nhã nhặn (Zinc 900) */
  --bg-section: #09090b;
  /* Nền tối hơn cho các section */
  --bg-card: #121214;
  /* Nền Card */
  --text-main: #f4f4f5;
  /* Chữ trắng xám */
  --text-muted: #a1a1aa;
  /* Chữ mờ */
  --btn-bg: #27272a;
  --btn-hover: #3f3f46;
  --border-color: #27272a;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  line-height: 1.6;
}


h1,
h2,
h3,
h4 {
  color: #ffffff;
  font-weight: 700;
  margin-top: 0;
}

a {
  color: var(--text-main);
  text-decoration: none;
  transition: 0.3s;
}

a:hover {
  color: #fff;
  opacity: 0.8;
}

/* Header */
.site-header {
  max-width: 1200px;
  padding: 1.5rem 1rem;
  padding-bottom: 0.5rem;
  margin: 0 auto;
}

.site-header nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-header nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.site-header nav a {
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 1px;
}

.site-header .logo-text a {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 2px;
}

/* Buttons */
.btn-primary {
  display: inline-block;
  background: var(--btn-bg);
  color: #fff;
  padding: 0.8rem 2rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  text-transform: uppercase;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 1px;
}

.btn-primary:hover {
  background: var(--text-main);
  color: #000;
}

/* Hero */
.hero-fullscreen {
  position: relative;
  width: 100%;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Hero overlay bị gỡ để tránh làm tối gap viền của grid */

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 4rem 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.hero-content h1 {
  font-size: 3.5rem;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 1);
  transition: all 0.4s ease;
}

.hero-content h1:hover {
  transform: scale(1.08);
  text-shadow: 0 0 40px rgba(255, 255, 255, 0.5), 0 4px 20px rgba(0, 0, 0, 1);
}

.hero-content p {
  font-size: 1.15rem;
  color: #e4e4e7;
  margin-bottom: 2.5rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 1);
  transition: all 0.4s ease;
}

.hero-content p:hover {
  transform: scale(1.05);
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.4), 0 2px 10px rgba(0, 0, 0, 1);
}

/* Stats */
.stats-section {
  background: var(--bg-section);
  padding: 5rem 1rem;
}

.stats-section .stats {
  display: flex;
  justify-content: center;
  gap: 6rem;
  max-width: 1000px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.stats-section .stat-item {
  text-align: center;
}

.stats-section .stat-num {
  font-size: 4rem;
  font-weight: 300;
  display: block;
  color: #fff;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stats-section .stat-label {
  font-size: 1.1rem;
  color: #9ab;
  display: block;
  margin-bottom: 0.2rem;
}

.stats-section .stat-link {
  font-size: 0.85rem;
  color: #9ab;
  opacity: 0.7;
}

/* Services */
.services-section {
  background: var(--bg-section);
  padding: 2rem 1rem 6rem;
}

.services-section .services-container {
  max-width: 1200px;
  margin: 0 auto;
}

.services-section .services-container h2 {
  font-size: 2rem;
  font-style: italic;
  font-weight: 400;
  margin-bottom: 3rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.services-section .grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.services-section .service-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2.5rem 2rem;
  transition: transform 0.3s;
}

.services-section .service-card:hover {
  transform: translateY(-5px);
  border-color: #555;
}

.services-section .service-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 2rem;
  filter: invert(1);
  opacity: 0.8;
}

.services-section .service-card h3 {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1.5rem;
}

.services-section .service-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* Dynamic Project Hero Grid */
.hero-dynamic-gallery {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  gap: 0.5rem;
  padding: 0.5rem;
  z-index: 0;
  background: var(--bg-color);
}

.hero-grid-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: var(--bg-card);
  display: block;
}

.hero-grid-item::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  pointer-events: none;
  z-index: 1;
}

.hero-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s ease;
  display: block;
}

/* Đã gỡ bỏ hiệu ứng zoom ảnh khi hover */

/* Grids Setup - Progressive Mosaic */
.hero-grid-1 {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

.hero-grid-2 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
}

.hero-grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr;
}

.hero-grid-4 {
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.hero-grid-4 .hero-grid-item:nth-child(1) {
  grid-column: 1 / 3;
  grid-row: 1;
}

.hero-grid-4 .hero-grid-item:nth-child(2) {
  grid-column: 3;
  grid-row: 1;
}

.hero-grid-4 .hero-grid-item:nth-child(3) {
  grid-column: 1;
  grid-row: 2;
}

.hero-grid-4 .hero-grid-item:nth-child(4) {
  grid-column: 2 / 4;
  grid-row: 2;
}

.hero-grid-5 {
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(5, 1fr);
}

.hero-grid-5 .hero-grid-item:nth-child(1) {
  grid-column: 1 / 4;
  grid-row: 1 / 3;
}

.hero-grid-5 .hero-grid-item:nth-child(2) {
  grid-column: 4 / 9;
  grid-row: 1 / 4;
}

.hero-grid-5 .hero-grid-item:nth-child(3) {
  grid-column: 1 / 4;
  grid-row: 3 / 6;
}

.hero-grid-5 .hero-grid-item:nth-child(4) {
  grid-column: 4 / 6;
  grid-row: 4 / 6;
}

.hero-grid-5 .hero-grid-item:nth-child(5) {
  grid-column: 6 / 9;
  grid-row: 4 / 6;
}

.hero-grid-6 {
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr 1fr 1fr;
}

.hero-grid-6 .hero-grid-item:nth-child(1) {
  grid-column: 1;
  grid-row: 1 / 3;
}

.hero-grid-6 .hero-grid-item:nth-child(2) {
  grid-column: 2;
  grid-row: 1 / 4;
}

.hero-grid-6 .hero-grid-item:nth-child(3) {
  grid-column: 3;
  grid-row: 1 / 3;
}

.hero-grid-6 .hero-grid-item:nth-child(4) {
  grid-column: 1;
  grid-row: 3 / 6;
}

.hero-grid-6 .hero-grid-item:nth-child(5) {
  grid-column: 3;
  grid-row: 3 / 6;
}

.hero-grid-6 .hero-grid-item:nth-child(6) {
  grid-column: 2;
  grid-row: 4 / 6;
}

/* Responsive - Mobile */
@media (max-width: 768px) {

  .hero-fullscreen .hero-grid-2,
  .hero-fullscreen .hero-grid-3,
  .hero-fullscreen .hero-grid-4,
  .hero-fullscreen .hero-grid-5,
  .hero-fullscreen .hero-grid-6 {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-auto-rows: 1fr;
  }

  .hero-fullscreen .hero-grid-item:nth-child(n) {
    grid-column: auto;
    grid-row: auto;
  }
}

/* Projects Filter & Grid */
.projects-section {
  padding: 5rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

.projects-section .grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.projects-section h2 {
  text-transform: uppercase;
  font-size: 1.8rem;
  margin-bottom: 3rem;
  text-align: center;
  letter-spacing: 2px;
}

.projects-section .filter-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 4rem;
  flex-wrap: wrap;
}

.projects-section .filter-btn {
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-size: 0.9rem;
  text-transform: uppercase;
  font-weight: 500;
  letter-spacing: 1px;
  cursor: pointer;
  padding: 0.5rem 1rem;
  transition: 0.3s;
}

.projects-section .filter-btn.active,
.projects-section .filter-btn:hover {
  color: #fff;
  border-bottom: 2px solid #fff;
}

.projects-section .project-card {
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

.projects-section .project-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  transition: transform 0.6s ease;
  display: block;
  opacity: 0.9;
}

.projects-section .project-card:hover img {
  transform: scale(1.05);
  opacity: 1;
}

.projects-section .card-body {
  padding: 1.5rem;
}

.projects-section .card-body h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: #fff;
}

.projects-section .card-body p {
  font-size: 0.9rem;
  color: var(--text-muted);
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.projects-section .card-meta {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #666;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 0.5rem;
}

/* Footer */
.site-footer {
  background: #000;
  border-top: 1px solid var(--border-color);
  padding: 5rem 1rem 2rem;
  margin-top: 5rem;
}

.site-footer .footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 4rem;
  margin-bottom: 4rem;
}

@media(min-width: 768px) {
  .site-footer .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

.site-footer .footer-bottom {
  text-align: center;
  color: #555;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
}

/* ========================================================================= */
/* DỊCH THUẬT CLASS CỦA QUILLJS (ĐỒNG BỘ HIỂN THỊ TỪ EDITOR SANG PUBLIC) */
/* ========================================================================= */
.ql-align-center { text-align: center; }
.ql-align-right { text-align: right; }
.ql-align-justify { text-align: justify; }

.ql-indent-1 { padding-left: 3rem; }
.ql-indent-2 { padding-left: 6rem; }
.ql-indent-3 { padding-left: 9rem; }
.ql-indent-4 { padding-left: 12rem; }

/* ========================================================================= */
/* ẨN HAMBURGER TRÊN DESKTOP (khai báo ngoài @media để đảm bảo PC không bị ảnh hưởng) */
/* ========================================================================= */
.site-header .mobile-menu-btn {
  display: none;
}

/* ========================================================================= */
/* RESPONSIVE MOBILE — max-width: 768px                                       */
/* Tất cả rule nằm trong scope wrapper class tương ứng.                       */
/* Không dùng !important. Không dùng @layer.                                  */
/* ========================================================================= */
@media (max-width: 768px) {

  /* --- 1. HEADER NAV --- */

  /* Hiện nút Hamburger trên mobile */
  .site-header .mobile-menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    order: 3;
  }

  .site-header .mobile-menu-btn span {
    display: block;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  /* Hiệu ứng X khi menu mở */
  .site-header .mobile-menu-btn.is-active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
  }
  .site-header .mobile-menu-btn.is-active span:nth-child(2) {
    opacity: 0;
  }
  .site-header .mobile-menu-btn.is-active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
  }

  /* Nav cho phép flex-wrap để các ul xếp xuống dòng */
  .site-header nav {
    flex-wrap: wrap;
    position: relative;
  }

  /* Danh sách link ẩn mặc định, hiện ra khi .nav-open */
  .site-header nav #nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    padding: 1rem 0;
    gap: 0.5rem;
    border-top: 1px solid var(--border-color);
    margin-top: 0.75rem;
  }

  .site-header nav #nav-links.nav-open {
    display: flex;
  }

  .site-header nav #nav-links li {
    width: 100%;
  }

  .site-header nav #nav-links li a,
  .site-header nav #nav-links li a[role="button"] {
    display: block;
    padding: 0.6rem 0;
    font-size: 0.95rem;
    text-align: left;
  }

  /* --- 2. HERO SECTION --- */

  .hero-fullscreen {
    min-height: 60vh;
  }

  .hero-content {
    padding: 2rem 1rem;
  }

  .hero-content h1 {
    font-size: 2.2rem;
    line-height: 1.25;
    margin-bottom: 1rem;
  }

  .hero-content p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }

  /* --- 3. STATS SECTION --- */

  .stats-section {
    padding: 3rem 1rem;
  }

  .stats-section .stats {
    flex-direction: column;
    gap: 2rem;
    align-items: center;
  }

  .stats-section .stat-num {
    font-size: 3rem;
  }

  /* --- 4. SERVICES & PROJECTS GRID --- */

  .services-section {
    padding: 2rem 1rem 3rem;
  }

  .services-section .grid-3 {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .services-section .services-container h2 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
  }

  .projects-section {
    padding: 3rem 1rem;
  }

  .projects-section .grid-3 {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .projects-section h2 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
  }

  /* --- 5. HERO MOSAIC GALLERY --- */
  /* Ghi đè rule ở dòng 436-450 bằng layout 2 cột tỉ lệ viewport */

  .hero-fullscreen .hero-grid-2,
  .hero-fullscreen .hero-grid-3,
  .hero-fullscreen .hero-grid-4,
  .hero-fullscreen .hero-grid-5,
  .hero-fullscreen .hero-grid-6 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    grid-auto-rows: 30vw;
  }

  .hero-fullscreen .hero-grid-item:nth-child(n) {
    grid-column: auto;
    grid-row: auto;
  }

  /* --- 6. FOOTER --- */

  .site-footer {
    padding: 3rem 1rem 2rem;
    margin-top: 2rem;
  }

  .site-footer .footer-inner {
    gap: 2rem;
    margin-bottom: 2rem;
  }
}