/* =========================================================
   Ricohome — trang chủ (bản xem trước)
   Màu: kem/be ~60%, xanh cổ vịt ~30%, hổ phách ~10%
   ========================================================= */

:root {
  --cream: #F9F8F6;
  --beige: #EFECE6;
  --beige-line: #E2DDD3;
  --teal: #0F3D3E;
  --teal-90: #1A4C4D;
  --teal-soft: #DCE6E3;
  --amber: #D97706;
  --amber-dark: #B45F04;
  --ink: #18181B;
  --ink-soft: #45454D;
  --on-teal: #F9F8F6;
  --on-teal-soft: #C9D6D3;

  /* Manrope (600/700/800) cho tiêu đề, Inter (400/500/600) cho nội dung, form, bảng */
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --header-h: 76px;
  --radius: 14px;
  --radius-sm: 10px;
  --container: 1200px;
  --gutter: clamp(20px, 4vw, 40px);
  --section-y: clamp(64px, 9vw, 112px);
  --shadow: 0 1px 2px rgba(15, 61, 62, .06), 0 8px 24px rgba(15, 61, 62, .08);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -.015em;
  margin: 0;
  color: var(--teal);
  text-wrap: balance;
}
h1 { font-weight: 800; }

/* Form và bảng dùng font nội dung, không lấy font mặc định của trình duyệt */
button, input, select, textarea, table { font-family: var(--font-body); }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

section[id], article[id] { scroll-margin-top: calc(var(--header-h) + 12px); }

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--teal); color: var(--on-teal);
  padding: 10px 16px; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
  border-radius: 4px;
}

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--amber-dark);
  margin-bottom: 12px;
}

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 2px solid transparent;
  font: 600 16px/1.2 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s;
  white-space: nowrap;
}
.btn-primary { background: var(--amber); color: var(--ink); }
.btn-primary:hover { background: #E58A1C; }
.btn-primary:active { transform: translateY(1px); }
.btn-outline { background: transparent; color: var(--teal); border-color: var(--teal); }
.btn-outline:hover { background: var(--teal); color: var(--on-teal); }
.btn-lg { min-height: 54px; padding: 14px 28px; font-size: 17px; }
.btn-block { width: 100%; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 48px;
  font-weight: 600;
  color: var(--teal);
  text-decoration: underline;
  text-decoration-color: rgba(15, 61, 62, .35);
  text-underline-offset: 5px;
  text-decoration-thickness: 2px;
}
.link-arrow:hover { text-decoration-color: var(--amber); }

/* =========================================================
   1. Thanh menu
   ========================================================= */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(249, 248, 246, .96);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.site-header.is-scrolled {
  border-bottom-color: var(--beige-line);
  box-shadow: 0 4px 18px rgba(15, 61, 62, .06);
}
.header-inner {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { display: block; flex-shrink: 0; }
.brand img { height: 50px; width: auto; }

.main-nav { display: flex; align-items: center; gap: 28px; }
.nav-list { display: flex; align-items: center; gap: 4px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  border: 0; background: none;
  font: 500 16px/1.2 var(--font-body);
  color: var(--ink);
  text-decoration: none;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
}
.nav-link:hover { color: var(--teal); background: var(--beige); }
.nav-link.is-active { color: var(--teal); font-weight: 600; }
.nav-link.is-active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px;
  height: 2px; border-radius: 2px; background: var(--amber);
}
.chevron { width: 12px; height: 12px; transition: transform .2s; }
.sub-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }

.has-sub { position: relative; }
.sub-menu {
  position: absolute; top: calc(100% + 8px); left: 0;
  min-width: 250px;
  padding: 8px;
  background: var(--cream);
  border: 1px solid var(--beige-line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .18s, transform .18s, visibility .18s;
}
.sub-menu.is-open { opacity: 1; visibility: visible; transform: none; }
.sub-menu a {
  display: block;
  padding: 11px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
}
.sub-menu a:hover { background: var(--beige); color: var(--teal); }

.nav-toggle { display: none; }

/* Menu điện thoại / máy tính bảng */
@media (max-width: 1023px) {
  :root { --header-h: 66px; }
  /* backdrop-filter tạo khối chứa cho phần tử fixed, làm panel menu bị cắt */
  .site-header { backdrop-filter: none; background: var(--cream); }
  .brand img { height: 40px; }

  .nav-toggle {
    display: inline-flex; align-items: center; gap: 10px;
    min-height: 44px; padding: 8px 14px;
    border: 1.5px solid var(--teal); border-radius: 999px;
    background: transparent; color: var(--teal);
    font: 600 15px/1 var(--font-body);
    cursor: pointer;
  }
  .nav-toggle-bars,
  .nav-toggle-bars::before,
  .nav-toggle-bars::after {
    display: block; width: 18px; height: 2px; border-radius: 2px;
    background: currentColor; transition: transform .2s, opacity .2s;
  }
  .nav-toggle-bars { position: relative; }
  .nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-bars::before { top: -6px; }
  .nav-toggle-bars::after { top: 6px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

  .main-nav {
    position: fixed;
    top: var(--header-h); left: 0; right: 0; bottom: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 12px var(--gutter) 28px;
    background: var(--cream);
    border-top: 1px solid var(--beige-line);
    overflow-y: auto;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .2s, transform .2s, visibility .2s;
  }
  .main-nav.is-open { opacity: 1; visibility: visible; transform: none; }

  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-list > li { border-bottom: 1px solid var(--beige-line); }
  .nav-link {
    width: 100%; justify-content: space-between;
    padding: 16px 4px; font-size: 18px; border-radius: 0;
  }
  .nav-link:hover { background: none; }
  .nav-link.is-active::after { display: none; }
  .nav-link.is-active { color: var(--amber-dark); }

  .sub-menu {
    position: static; min-width: 0;
    padding: 0 0 10px 12px;
    background: none; border: 0; box-shadow: none;
    opacity: 1; visibility: visible; transform: none;
    display: none;
  }
  .sub-menu.is-open { display: block; }
  .sub-menu a { padding: 12px 12px; font-size: 17px; color: var(--ink-soft); }

  .nav-cta { margin-top: 24px; min-height: 54px; font-size: 17px; }
  body.nav-open { overflow: hidden; }
}

/* =========================================================
   2. Banner
   ========================================================= */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  min-height: min(calc(100vh - var(--header-h)), 760px);
  background: var(--cream);
}
.hero-text {
  display: flex; align-items: center;
  padding: clamp(40px, 6vw, 80px) clamp(32px, 5vw, 72px) clamp(40px, 6vw, 80px) max(var(--gutter), calc((100vw - var(--container)) / 2));
}
.hero-text-inner { max-width: 560px; }
.hero h1 {
  font-size: clamp(34px, 4.4vw, 58px);
  letter-spacing: -.02em;
  margin-bottom: 22px;
}
.hero-lead {
  font-size: clamp(17px, 1.35vw, 19px);
  color: var(--ink-soft);
  max-width: 34em;
  margin-bottom: 32px;
}
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.hero-media { position: relative; overflow: hidden; }
.hero-media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 68% 60%;
  border-bottom-left-radius: 28px;
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-text { padding: 28px var(--gutter) 28px; }
  .hero h1 { font-size: clamp(30px, 8.4vw, 40px); margin-bottom: 14px; }
  .hero-lead { font-size: 16px; line-height: 1.6; margin-bottom: 22px; }
  .hero-actions { gap: 4px 20px; }
  .hero-actions .btn { flex: 1 1 100%; }
  .hero-media { aspect-ratio: 4 / 3; margin-inline: var(--gutter); border-radius: var(--radius); }
  .hero-media img { border-radius: var(--radius); object-position: 70% 55%; }
}

/* =========================================================
   Phần chung
   ========================================================= */
.section { padding-block: var(--section-y); }
.section-head { max-width: 720px; margin-bottom: clamp(32px, 4vw, 48px); }
.section h2 { font-size: clamp(28px, 3.2vw, 42px); }

/* =========================================================
   3. Dịch vụ
   ========================================================= */
.services { background: var(--beige); }
.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 2.4vw, 32px);
}
.service-card {
  display: flex; flex-direction: column;
  background: var(--cream);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow .2s, transform .2s;
}
.service-card:target { outline: 3px solid var(--amber); outline-offset: 4px; }
.service-media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--beige-line); }
.service-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.service-card:hover .service-media img { transform: scale(1.03); }
.service-body {
  display: flex; flex-direction: column; flex: 1;
  padding: 24px 24px 28px;
}
.service-body h3 { font-size: 24px; margin-bottom: 12px; }
.service-body p { color: var(--ink-soft); font-size: 16px; margin-bottom: 24px; }
.service-body .btn { margin-top: auto; align-self: flex-start; }

@media (max-width: 860px) {
  .service-grid { grid-template-columns: 1fr; }
  .service-media { aspect-ratio: 16 / 10; }
  .service-body { padding: 22px 20px 24px; }
  .service-body .btn { align-self: stretch; }
}

/* =========================================================
   4. Giới thiệu
   ========================================================= */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
}
.about-media { border-radius: var(--radius); overflow: hidden; aspect-ratio: 5 / 4; }
.about-media img { width: 100%; height: 100%; object-fit: cover; object-position: 52% 50%; }
.about-text h2 { margin-bottom: 20px; }
.about-text p:not(.eyebrow) { font-size: 18px; color: var(--ink-soft); max-width: 32em; }

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-media { aspect-ratio: 3 / 2; order: 2; }
  .about-text { order: 1; }
  .about-text p:not(.eyebrow) { font-size: 17px; }
}

/* =========================================================
   5. Công trình — nền xanh cổ vịt
   ========================================================= */
.projects { background: var(--teal); color: var(--on-teal); }
.projects h2 { color: var(--on-teal); }
.projects .eyebrow { color: #F3A847; }
.project-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  grid-template-rows: auto auto;
  gap: clamp(16px, 2vw, 24px);
}
.project { margin: 0; display: flex; flex-direction: column; }
.project img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--teal-90);
}
.project-tall { grid-row: span 2; }
.project-tall img { flex: 1; aspect-ratio: auto; min-height: 0; height: 100%; }
.project figcaption {
  margin-top: 12px;
  font-size: 16px;
  font-weight: 500;
  color: var(--on-teal);
}

@media (max-width: 860px) {
  .project-grid { grid-template-columns: 1fr; }
  .project-tall { grid-row: auto; }
  .project-tall img { aspect-ratio: 4 / 5; height: auto; object-position: 50% 45% !important; }
  .project img { aspect-ratio: 4 / 3; }
}

/* =========================================================
   6. Liên hệ
   ========================================================= */
.contact { background: var(--beige); }
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: start;
}
.contact-intro h2 { margin-bottom: 18px; }
.contact-intro p:not(.eyebrow) { font-size: 18px; color: var(--ink-soft); max-width: 30em; }

.contact-form {
  background: var(--cream);
  padding: clamp(24px, 3vw, 36px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid; gap: 18px;
}
.field { display: grid; gap: 8px; }
.field label { font-weight: 600; font-size: 15px; color: var(--ink); }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  font: 400 16px/1.5 var(--font-body);
  color: var(--ink);
  background: #fff;
  border: 1.5px solid #CFC8BB;
  border-radius: var(--radius-sm);
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input::placeholder, .field textarea::placeholder { color: #7A7A82; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 61, 62, .18);
}
.select-wrap { position: relative; }
.select-wrap::after {
  content: ""; position: absolute; right: 16px; top: 50%;
  width: 8px; height: 8px; margin-top: -6px;
  border-right: 2px solid var(--teal); border-bottom: 2px solid var(--teal);
  transform: rotate(45deg); pointer-events: none;
}
.field select { appearance: none; padding-right: 40px; cursor: pointer; }
.field select.is-prefilled { animation: prefill 1.6s ease-out; }
@keyframes prefill {
  0%, 30% { border-color: var(--amber); box-shadow: 0 0 0 4px rgba(217, 119, 6, .25); }
  100% { border-color: #CFC8BB; box-shadow: none; }
}

.form-status:empty { display: none; }
.form-status {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 600;
  font-size: 15px;
}

@media (max-width: 860px) {
  .contact-grid { grid-template-columns: 1fr; }
  .contact-intro p:not(.eyebrow) { font-size: 17px; }
}

/* =========================================================
   7. Chân trang
   ========================================================= */
.site-footer {
  background: var(--teal);
  color: var(--on-teal);
  padding-top: clamp(48px, 6vw, 72px);
  border-top: 1px solid rgba(249, 248, 246, .12);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1.2fr;
  gap: 40px;
  padding-bottom: 44px;
}
.footer-logo {
  display: inline-block;
  background: var(--cream);
  padding: 12px 18px;
  border-radius: 12px;
  margin-bottom: 18px;
}
.footer-logo img { height: 44px; width: auto; }
.footer-brand p { color: var(--on-teal-soft); font-size: 15px; max-width: 30em; }
.footer-title {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #F3A847;
  margin-bottom: 14px;
}
.footer-col li + li { margin-top: 4px; }
.footer-col a {
  display: inline-block; padding: 6px 0;
  text-decoration: none; color: var(--on-teal);
}
.footer-col a:hover { text-decoration: underline; text-underline-offset: 4px; }
.contact-list { margin: 0; display: grid; gap: 12px; }
.contact-list div { display: grid; grid-template-columns: 130px 1fr; gap: 12px; }
.contact-list dt { color: var(--on-teal-soft); font-size: 15px; }
.contact-list dd { margin: 0; font-size: 15px; }
.contact-list dd[data-placeholder] { color: var(--on-teal-soft); font-style: italic; opacity: .85; }

.footer-bottom {
  padding-block: 20px;
  border-top: 1px solid rgba(249, 248, 246, .14);
  font-size: 14px;
  color: var(--on-teal-soft);
}

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .contact-list div { grid-template-columns: 1fr; gap: 2px; }
}

/* =========================================================
   Số liệu: chữ số cùng độ rộng để cột số thẳng hàng.
   Dùng cho bảng báo giá, phần trăm tiến độ và mọi chỗ hiển thị số.
   Phần tử mới: thêm class .so-lieu hoặc thuộc tính data-numeric.
   Đặt cuối tệp vì khai báo `font:` rút gọn ở trên sẽ đặt lại font-variant.
   ========================================================= */
table, td, th, output, progress, meter,
.field input[type="tel"], .field input[type="number"],
input[type="tel"], input[type="number"],
.so-lieu, [data-numeric],
.bang-bao-gia, .bao-gia, .tien-do, .phan-tram,
.contact-list dd {
  font-variant-numeric: tabular-nums;
}

/* Thẻ dịch vụ có trang riêng: tiêu đề là liên kết, thêm liên kết "Xem chi tiết" */
.card-title-link { color: inherit; text-decoration: none; }
.card-title-link:hover { color: var(--amber-dark); text-decoration: underline; text-underline-offset: 4px; }
.service-actions {
  margin-top: auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px;
}
.service-actions .btn { margin-top: 0; }
.link-arrow-sm { font-size: 15px; min-height: 44px; }
@media (max-width: 860px) {
  .service-actions .btn { flex: 1 1 100%; }
}
