:root {
  --brand-navy: #14324a;
  --brand-blue: #256f9c;
  --brand-sky: #e8f0f7;
  --brand-ink: #1f2933;
  --brand-muted: #667085;
  --brand-line: #d7e2ea;
  --brand-gold: #c88a2a;
  --brand-white: #ffffff;
  --shadow-soft: 0 14px 34px rgba(20, 50, 74, 0.12);
}

/* โครงหลักของเว็บ: ใช้ร่วมกันทุกหน้า */
body {
  background: #f7f9fb;
  color: var(--brand-ink);
  font-family: "Noto Sans Thai", myFirstFont, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}

a {
  color: inherit;
}

/* แถบนำทาง */
.site-navbar {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--brand-line);
  box-shadow: 0 6px 18px rgba(20, 50, 74, 0.06);
  position: sticky;
  top: 0;
  z-index: 1030;
}

.site-logo {
  max-height: 56px;
  width: auto;
}

.navbar-nav .nav-link {
  color: var(--brand-ink);
  font-size: 15px;
  font-weight: 600;
  padding-left: 14px;
  padding-right: 14px;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
  color: var(--brand-blue);
}

.nav-link-cta {
  background: var(--brand-navy);
  border-radius: 8px;
  color: var(--brand-white) !important;
  margin-left: 10px;
  padding-left: 18px !important;
  padding-right: 18px !important;
}

/* Hero หน้าแรก */
.hero-carousel .carousel-item {
  background: #0e2435;
  min-height: 0;
}

.hero-carousel .carousel-item img {
  height: auto;
  min-height: 0;
  object-fit: initial;
  width: 100%;
}

.hero-carousel .carousel-item::after {
  background: linear-gradient(90deg, rgba(13, 31, 45, 0.72), rgba(13, 31, 45, 0.36), rgba(13, 31, 45, 0.08));
  content: "";
  inset: 0;
  position: absolute;
}

.hero-caption {
  bottom: auto;
  left: 50%;
  max-width: 1140px;
  padding: 0 12px;
  right: auto;
  text-align: left;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  z-index: 2;
}

.hero-kicker {
  color: #f3c77c;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 10px;
}

.hero-subtitle {
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 8px;
  max-width: 620px;
}

.hero-title {
  color: var(--brand-white);
  font-size: clamp(34px, 4.2vw, 56px);
  font-weight: 800;
  line-height: 1.18;
  margin-bottom: 14px;
  max-width: 680px;
}

.hero-text {
  color: rgba(255, 255, 255, 0.88);
  font-size: 17px;
  line-height: 1.7;
  max-width: 600px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-caption .hero-kicker,
.hero-caption .hero-subtitle,
.hero-caption .hero-title,
.hero-caption .hero-text,
.hero-caption .hero-actions {
  animation: fadeSlideUp 700ms ease both;
}

.hero-caption .hero-subtitle {
  animation-delay: 100ms;
}

.hero-caption .hero-title {
  animation-delay: 200ms;
}

.hero-caption .hero-text {
  animation-delay: 300ms;
}

.hero-caption .hero-actions {
  animation-delay: 400ms;
}

/* ปุ่มหลัก */
.btn-brand,
.btn-ghost {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  font-weight: 700;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  text-decoration: none;
}

.btn-brand {
  background: var(--brand-gold);
  color: #111827;
}

.btn-brand:hover {
  background: #d79b3d;
  color: #111827;
  transform: translateY(-1px);
}

.btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: var(--brand-white);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--brand-white);
  transform: translateY(-1px);
}

.reveal-up {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 520ms ease, transform 520ms ease;
}

.reveal-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Section และหัวข้อกลาง */
.section-block {
  padding: 64px 0;
}

.section-block-alt {
  background: var(--brand-white);
}

.section-heading {
  margin-bottom: 28px;
}

.section-kicker {
  color: var(--brand-blue);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}

.section-title {
  color: var(--brand-navy);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
}

.section-description {
  color: var(--brand-muted);
  margin: 12px 0 0;
  max-width: 680px;
}

/* ข่าวสารและ card หน้าแรก */
.news-panel,
.info-card,
.service-card {
  background: var(--brand-white);
  border: 1px solid var(--brand-line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.news-list {
  display: grid;
  gap: 14px;
}

.news-item {
  align-items: center;
  border: 1px solid var(--brand-line);
  border-radius: 8px;
  color: var(--brand-ink);
  display: grid;
  gap: 16px;
  grid-template-columns: 112px 1fr auto;
  padding: 12px;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.news-item:hover {
  border-color: rgba(37, 111, 156, 0.45);
  box-shadow: 0 10px 24px rgba(20, 50, 74, 0.1);
  color: var(--brand-ink);
  transform: translateY(-2px);
}

.news-thumb {
  aspect-ratio: 4 / 3;
  background: var(--brand-sky);
  border-radius: 8px;
  overflow: hidden;
}

.news-thumb img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.news-placeholder {
  align-items: center;
  color: var(--brand-blue);
  display: flex;
  font-size: 28px;
  height: 100%;
  justify-content: center;
}

.news-date {
  color: var(--brand-muted);
  font-size: 14px;
  margin-bottom: 4px;
}

.news-name {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.42;
  margin: 0;
}

.news-badge-new {
  align-items: center;
  animation: newBadgeBounce 1.35s ease-in-out infinite;
  background: #d71920 !important;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(215, 25, 32, 0.28);
  color: var(--brand-white) !important;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  justify-content: center;
  line-height: 1;
  margin-left: 8px;
  min-height: 24px;
  min-width: 46px;
  padding: 6px 10px;
  text-transform: uppercase;
  vertical-align: middle;
}

.news-panel .news-badge-new {
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.14), 0 10px 20px rgba(215, 25, 32, 0.32);
}

.news-arrow {
  align-items: center;
  background: var(--brand-sky);
  border-radius: 8px;
  color: var(--brand-blue);
  display: flex;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.pagination .page-link {
  background: var(--brand-white);
  border-color: var(--brand-line);
  color: var(--brand-navy);
  font-weight: 700;
  min-width: 38px;
  text-align: center;
}

.pagination .page-link:hover,
.pagination .page-link:focus {
  background: var(--brand-sky);
  border-color: var(--brand-blue);
  color: var(--brand-blue);
  box-shadow: none;
}

.pagination .active .page-link {
  background: var(--brand-navy);
  border-color: var(--brand-navy);
  color: var(--brand-white);
  box-shadow: 0 8px 18px rgba(20, 50, 74, 0.18);
}

.news-pagination .page-link {
  align-items: center;
  display: inline-flex;
  height: 38px;
  justify-content: center;
}

.news-pagination .page-item.active .page-link {
  background: var(--brand-navy) !important;
  border-color: var(--brand-navy) !important;
  color: var(--brand-white) !important;
}

.info-card {
  height: 100%;
  padding: 24px;
}

.info-card-icon {
  align-items: center;
  background: var(--brand-sky);
  border-radius: 8px;
  color: var(--brand-blue);
  display: flex;
  font-size: 26px;
  height: 52px;
  justify-content: center;
  margin-bottom: 18px;
  width: 52px;
}

.info-card h3 {
  color: var(--brand-navy);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 14px;
}

.link-list {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.link-list a {
  align-items: flex-start;
  color: var(--brand-ink);
  display: flex;
  gap: 10px;
  text-decoration: none;
}

.link-list a:hover {
  color: var(--brand-blue);
}

.link-list i {
  color: var(--brand-gold);
  margin-top: 4px;
}

.service-card {
  height: 100%;
  overflow: hidden;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.service-card:hover {
  color: inherit;
  transform: translateY(-3px);
}

.service-card img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 240ms ease;
  width: 100%;
}

.service-card:hover img {
  transform: scale(1.035);
}

.service-card-body {
  padding: 20px;
}

.service-card h3 {
  color: var(--brand-navy);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.service-card p {
  color: var(--brand-muted);
  margin: 0;
}

.site-footer {
  background: var(--brand-navy);
  color: rgba(255, 255, 255, 0.78);
  padding: 30px 0;
}

.site-footer strong {
  color: var(--brand-white);
}

/* หน้ารอง: hero, content, article, contact, project, career */
.page-hero {
  background:
    linear-gradient(120deg, rgba(20, 50, 74, 0.94), rgba(37, 111, 156, 0.84)),
    url("../img/slideshow/5.png") center/cover;
  color: var(--brand-white);
  padding: 58px 0;
}

.page-hero .section-kicker {
  color: #f3c77c;
}

.page-hero .section-title,
.page-hero .section-description {
  color: var(--brand-white);
}

.page-hero .section-description {
  color: rgba(255, 255, 255, 0.82);
}

.content-shell {
  padding: 56px 0;
}

.content-card {
  background: var(--brand-white);
  border: 1px solid var(--brand-line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.content-card-body {
  padding: clamp(22px, 4vw, 36px);
}

.content-card h2,
.content-card h3,
.content-card h4 {
  color: var(--brand-navy);
  font-weight: 700;
}

.content-card p,
.content-card li {
  color: #344054;
  font-size: 17px;
}

.content-image {
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  object-fit: cover;
  width: 100%;
}

.feature-card {
  background: var(--brand-white);
  border: 1px solid var(--brand-line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  height: 100%;
  padding: 24px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.feature-card:hover {
  box-shadow: 0 18px 40px rgba(20, 50, 74, 0.16);
  transform: translateY(-3px);
}

.feature-card img {
  height: 96px;
  object-fit: contain;
  width: 96px;
}

.value-card {
  align-items: center;
  background: var(--brand-white);
  border: 1px solid var(--brand-line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 24px;
  grid-template-columns: 220px 1fr;
  margin-bottom: 22px;
  overflow: hidden;
  padding: 18px;
}

.value-card img {
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  object-fit: cover;
  width: 100%;
}

.value-card h3 {
  color: var(--brand-navy);
  font-size: 24px;
  font-weight: 700;
}

.quality-badge {
  align-items: center;
  background: var(--brand-sky);
  border: 1px solid var(--brand-line);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  padding: 28px;
}

.quality-badge img {
  max-height: 140px;
  object-fit: contain;
}

.contact-card {
  align-items: flex-start;
  background: var(--brand-white);
  border: 1px solid var(--brand-line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  display: flex;
  gap: 16px;
  padding: 22px;
}

.contact-card-icon {
  align-items: center;
  background: var(--brand-sky);
  border-radius: 8px;
  color: var(--brand-blue);
  display: flex;
  flex: 0 0 48px;
  font-size: 24px;
  height: 48px;
  justify-content: center;
  width: 48px;
}

.map-frame {
  border: 0;
  border-radius: 8px;
  min-height: 420px;
  width: 100%;
}

.project-section-title {
  align-items: center;
  color: var(--brand-navy);
  display: flex;
  font-size: 28px;
  font-weight: 700;
  gap: 10px;
  margin: 34px 0 18px;
}

.project-section-title::before {
  background: var(--brand-gold);
  border-radius: 999px;
  content: "";
  display: block;
  height: 10px;
  width: 10px;
}

.project-section-heading {
  margin: 42px 0 20px;
}

.project-section-kicker {
  color: var(--brand-blue);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 4px;
}

.project-section-heading .project-section-title {
  margin: 0;
}

.project-card {
  background: var(--brand-white);
  border: 1px solid var(--brand-line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  height: 100%;
  overflow: hidden;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.project-card:hover {
  border-color: rgba(37, 111, 156, 0.42);
  box-shadow: 0 20px 44px rgba(20, 50, 74, 0.18);
  transform: translateY(-6px);
}

.project-card-clean {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.project-card-thumb {
  align-items: center;
  aspect-ratio: 16 / 10;
  background: var(--brand-sky);
  color: var(--brand-blue);
  display: flex;
  font-size: 38px;
  justify-content: center;
  overflow: hidden;
}

.project-card-thumb img {
  height: 100%;
  object-fit: cover;
  transition: transform 240ms ease;
  width: 100%;
}

.project-card:hover .project-card-thumb img {
  transform: scale(1.04);
}

.project-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px;
  text-align: left;
}

.project-card-meta {
  align-items: center;
  color: var(--brand-muted);
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 600;
  gap: 8px;
  justify-content: flex-end;
  margin: 0;
  margin-left: auto;
}

.project-card-meta span {
  align-items: center;
  background: var(--brand-sky);
  border-radius: 999px;
  display: inline-flex;
  gap: 5px;
  padding: 5px 10px;
}

.project-card-heading {
  margin: 0;
}

.project-card-title {
  color: var(--brand-navy);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.45;
  margin: 0;
  text-decoration: none;
}

.project-card-title-clamp {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.project-card-title:hover {
  color: var(--brand-blue);
}

.project-card-footer {
  align-items: center;
  border-top: 1px solid var(--brand-line);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 16px;
}

.project-view-link {
  align-items: center;
  color: var(--brand-blue);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 700;
  gap: 7px;
  text-decoration: none;
  white-space: nowrap;
}

.project-view-link:hover {
  color: var(--brand-navy);
}

.job-card {
  background: var(--brand-white);
  border: 1px solid var(--brand-line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 22px;
  overflow: hidden;
}

.job-card-header {
  align-items: center;
  background: var(--brand-navy);
  color: var(--brand-white);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 18px 22px;
}

.job-card-header h3 {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
}

.job-card-body {
  padding: 24px;
}

.detail-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.detail-list dt {
  color: var(--brand-blue);
  font-weight: 700;
}

.detail-list dd {
  margin: 0;
}

.article-card {
  background: var(--brand-white);
  border: 1px solid var(--brand-line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  padding: clamp(22px, 4vw, 42px);
}

.article-title {
  color: var(--brand-navy);
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 700;
  line-height: 1.25;
}

.article-meta {
  color: var(--brand-muted);
  font-size: 15px;
}

.article-content {
  color: #344054;
  font-size: 18px;
  line-height: 1.85;
}

.article-carousel img,
.project-modal-carousel img {
  border-radius: 8px;
  max-height: 620px;
  object-fit: contain;
}

/* ปรับหน้ารองเดิมให้เข้ากับ UI ใหม่ แม้บางหน้าจะยังมี inline style เดิมอยู่ */
body > section[style*="#0d6efd"] {
  background:
    linear-gradient(120deg, rgba(20, 50, 74, 0.95), rgba(37, 111, 156, 0.86)),
    url("../img/slideshow/5.png") center/cover !important;
  padding: 52px 0 !important;
}

body > section[style*="#0d6efd"] .news-title,
body > section[style*="#0d6efd"] h3 {
  color: var(--brand-white) !important;
  font-family: "Noto Sans Thai", myFirstFont, sans-serif !important;
  font-size: clamp(30px, 4vw, 44px) !important;
  font-weight: 700;
  line-height: 1.25;
}

.bg-primary {
  background: var(--brand-navy) !important;
}

.text-primary {
  color: var(--brand-blue) !important;
}

.container.border,
.card[style*="#C6D8F3"],
.alert[style*="#C6D8F3"] {
  background: var(--brand-white) !important;
  border: 1px solid var(--brand-line) !important;
  border-radius: 8px !important;
  box-shadow: var(--shadow-soft);
}

.container.border {
  padding: clamp(22px, 4vw, 36px);
}

.service_blog {
  height: 100%;
  padding: 18px;
}

.service_blog img {
  border-radius: 8px;
}

.service_blog h4,
.service_blog h5,
.service_blog p,
.company-link,
.project-title-link,
.project-modal-title {
  font-family: "Noto Sans Thai", myFirstFont, sans-serif !important;
}

.company-link,
.project-title-link {
  color: var(--brand-navy) !important;
  font-size: 18px !important;
  font-weight: 700;
}

.company-link:hover,
.project-title-link:hover {
  color: var(--brand-blue) !important;
}

.modal-content {
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.modal-header {
  background: #14324a;
  color: var(--brand-white);
}

.modal-title.project-modal-title {
  color: var(--brand-white) !important;
  font-family: "Noto Sans Thai", myFirstFont, sans-serif !important;
  font-size: clamp(20px, 2.6vw, 28px);
  font-weight: 700;
  line-height: 1.35;
}

.modal-header .btn-close {
  filter: invert(1);
}

.v1 .row,
.v2 .row,
.v3 .row,
.v4 .row,
.v5 .row {
  background: var(--brand-white);
  border: 1px solid var(--brand-line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 22px;
  overflow: hidden;
}

.v1 .border,
.v2 .border,
.v3 .border,
.v4 .border,
.v5 .border {
  border: 0 !important;
}

.v1 img,
.v2 img,
.v3 img,
.v4 img,
.v5 img {
  border: 0 !important;
  border-radius: 8px;
  margin: 18px 0;
}

@media (max-width: 991.98px) {
  .nav-link-cta {
    display: inline-block;
    margin: 8px 0 0;
  }

  .hero-carousel .carousel-item,
  .hero-carousel .carousel-item img {
    height: 480px;
    min-height: 480px;
    object-fit: cover;
  }
}

@media (max-width: 767.98px) {
  .section-block {
    padding: 44px 0;
  }

  .news-item {
    grid-template-columns: 88px 1fr;
  }

  .news-arrow {
    display: none;
  }

  .value-card {
    grid-template-columns: 1fr;
  }

  .map-frame {
    min-height: 320px;
  }
}

@media (max-width: 575.98px) {
  .site-logo {
    max-height: 46px;
  }

  .hero-carousel .carousel-item,
  .hero-carousel .carousel-item img {
    height: 430px;
    min-height: 430px;
    object-fit: cover;
  }

  .hero-title {
    font-size: 30px;
  }

  .hero-subtitle {
    font-size: 19px;
  }

  .hero-text {
    font-size: 16px;
  }

  .project-card-body {
    padding: 16px;
  }

  .project-card-title {
    font-size: 17px;
  }

  .project-card-meta {
    font-size: 12px;
  }
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes newBadgeBounce {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  45% {
    transform: translateY(-3px) scale(1.04);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }

  .reveal-up {
    opacity: 1;
    transform: none;
  }
}
