/* =============================================================
   Neramit PROJECT — custom.css
   Color tokens come from settings_helper.php (CSS vars)
   ============================================================= */

* { -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Kanit', sans-serif;
  font-weight: 300;
  background: #fff;
  color: var(--text);
}

.kanit-light  { font-weight: 300; }
.kanit-reg    { font-weight: 400; }
.kanit-medium { font-weight: 500; }
.kanit-bold   { font-weight: 600; }

h1, h2, h3, h4, h5 { font-weight: 600; color: var(--secondary); }

/* ===== TEXT ACCENTS ===== */
.txtex   { color: var(--secondary); font-weight: 600; }
.txtb    { color: var(--secondary); font-weight: 600; }
.txt-pri { color: var(--primary); }

/* ===== NAVBAR ===== */
.navbar {
  padding: 12px 0;
  box-shadow: 0 1px 6px rgba(0,0,0,.04);
  transition: box-shadow .2s;
}
.navbar.sticky { box-shadow: 0 2px 14px rgba(0,0,0,.08); }
.navbar-brand img { transition: height .2s; }
.navbar .nav-link {
  font-weight: 500;
  padding: 8px 14px;
  margin: 0 2px;
  border-radius: 6px;
  transition: all .15s;
}
.navbar .nav-link:hover { background: var(--bg-light); color: var(--primary-dark); }
.navbar .nav-link.active {
  color: var(--primary-dark) !important;
  border-bottom: 2px solid var(--primary);
  border-radius: 0;
}

/* ===== HERO / SLIDESHOW ===== */
.hero-slider {
  position: relative;
  overflow: hidden;
  background: var(--bg-dark);
}
.hero-slider .slide-item {
  position: relative;
  min-height: 75vh;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
}
.hero-slider .slide-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,var(--overlay,.4));
}
.hero-slider .slide-content {
  position: relative;
  z-index: 2;
  color: #fff;
  max-width: 720px;
  padding: 40px;
}
.hero-slider .slide-content h1 {
  color: #fff;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.25;
}
.hero-slider .slide-content .subtitle {
  font-size: 1.25rem;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 12px;
}
.hero-slider .slide-content .desc {
  font-size: 1.05rem;
  margin-bottom: 24px;
  opacity: .95;
}

@media(max-width:768px){
  .hero-slider .slide-item {
    min-height: 0;
    aspect-ratio: 16/10;  /* บังคับ aspect ratio ตามภาพ */
  }
  .hero-slider .slide-item::before { background: rgba(0,0,0,.45); }  /* บน mobile ทึบขึ้นนิดให้อ่านชัด */
  .hero-slider .slide-content {
    padding: 20px;
    max-width: 100%;       /* container ไม่ทะลุภาพ */
    text-align: center !important;  /* override inline */
    margin: 0 auto;
  }
  .hero-slider .slide-content h1 {
    font-size: 1.6rem;     /* h1 เล็กลงสำหรับ mobile */
    line-height: 1.3;
    margin-bottom: 10px;
  }
  .hero-slider .slide-content .subtitle {
    font-size: .95rem;
    margin-bottom: 8px;
  }
  .hero-slider .slide-content .desc {
    font-size: .92rem;
    margin-bottom: 16px;
    /* clamp 2 บรรทัด ไม่ให้ลาก */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .hero-slider .slide-content .btn-lg {
    padding: 8px 18px;
    font-size: .95rem;
  }
  .hero-slider .carousel-control-prev,
  .hero-slider .carousel-control-next { width: 12%; }
}

@media(max-width:480px){
  .hero-slider .slide-content h1 { font-size: 1.3rem; }
  .hero-slider .slide-content .subtitle { font-size: .85rem; }
  .hero-slider .slide-content .desc { font-size: .85rem; }
}

/* ===== SECTIONS ===== */
.section {
  padding: 70px 0;
}
.section.sec-light { background: var(--bg-light); }
.section.sec-dark  { background: var(--bg-dark); color: #fff; }
.section.sec-dark h1, .section.sec-dark h2,
.section.sec-dark h3, .section.sec-dark h4 { color: #fff; }

.section-title {
  font-weight: 700;
  margin-bottom: 12px;
  position: relative;
  display: inline-block;
}
.section-subtitle {
  color: var(--text-muted);
  margin-bottom: 40px;
  max-width: 720px;
}

/* ===== SERVICE CARD ===== */
.service-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 14px;
  padding: 32px 24px;
  text-align: center;
  height: 100%;
  transition: all .25s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(26,37,64,.12);
  border-color: var(--primary);
  color: inherit;
}
.service-card .ico {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 18px;
  transition: all .25s;
}
.service-card:hover .ico {
  background: var(--secondary);
  color: var(--primary);
}
.service-card h3 {
  font-size: 1.25rem;
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--secondary);
}
.service-card p {
  color: var(--text-muted);
  font-size: .95rem;
  margin: 0;
}

/* ===== VALUE CARD (Brand Identity) ===== */
.value-card {
  text-align: center;
  padding: 24px 16px;
}
.value-card .vc-ico {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 16px;
}
.value-card h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.value-card .sub {
  font-size: .85rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 6px;
}
.value-card p {
  font-size: .9rem;
  color: var(--text-muted);
}

/* ===== PROJECT CARD ===== */
.project-card {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #eee;
  text-decoration: none;
  color: inherit;
  height: 100%;
  transition: all .25s;
}
.project-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0,0,0,.1);
  color: inherit;
}
.project-card .img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--bg-light);
}
.project-card .img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s;
}
.project-card:hover .img-wrap img { transform: scale(1.05); }
.project-card .img-wrap .cat-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--primary);
  color: var(--secondary);
  font-size: .72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  z-index: 2;
}
.project-card .body {
  padding: 18px 18px 20px;
}
.project-card .body h4 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--secondary);
  line-height: 1.4;
}
.project-card .body .client {
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.project-card .body .meta {
  font-size: .8rem;
  color: var(--primary-dark);
  font-weight: 500;
}

/* ===== PARTNER LOGO ===== */
.partner-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  height: 100px;
  transition: all .2s;
}
.partner-logo:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.partner-logo img {
  max-width: 100%;
  max-height: 60px;
  object-fit: contain;
  filter: grayscale(40%);
  opacity: .8;
  transition: all .2s;
}
.partner-logo:hover img { filter: none; opacity: 1; }

/* ===== TEAM CARD ===== */
.team-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 14px;
  overflow: hidden;
  transition: all .25s;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.team-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(26,37,64,.12);
  border-color: var(--primary);
}
.team-card .team-photo {
  aspect-ratio: 3/4;
  background: linear-gradient(135deg, var(--bg-light) 0%, #fff 100%);
  overflow: hidden;
  position: relative;
}
.team-card .team-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform .4s;
}
.team-card:hover .team-photo img { transform: scale(1.05); }
.team-card .team-info {
  padding: 16px 16px 20px;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.team-card .team-info h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--secondary);
  line-height: 1.3;
}
.team-card .team-thname {
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.team-card .team-position {
  font-size: .85rem;
  color: var(--primary-dark);
  font-weight: 500;
  margin-top: 4px;
  min-height: 2.4em;
  display: flex;
  align-items: center;
  justify-content: center;
}
.team-card .team-social {
  display: flex;
  gap: 10px;
  font-size: 1rem;
}
.team-card .team-social a {
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-light);
  transition: all .15s;
  text-decoration: none;
}
.team-card .team-social a:hover {
  background: var(--primary);
  color: var(--secondary);
}

/* ===== CTA SECTION ===== */
.cta-band {
  background: linear-gradient(135deg, var(--secondary) 0%, #2a3a5e 100%);
  color: #fff;
  padding: 60px 0;
  text-align: center;
}
.cta-band h2 { color: #fff; margin-bottom: 14px; }
.cta-band p  { color: rgba(255,255,255,.85); margin-bottom: 22px; }

/* ===== FOOTER ===== */
footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 50px 0 0;
}
footer h4 {
  color: var(--primary);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
}
footer a {
  color: var(--footer-text);
  text-decoration: none;
  transition: color .15s;
}
footer a:hover { color: var(--primary); }
footer .footer-bottom {
  margin-top: 30px;
  padding: 18px 0;
  background: rgba(0,0,0,.2);
  text-align: center;
  font-size: .85rem;
}

/* ===== FLOATING BUTTONS ===== */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: var(--secondary) !important;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
  transition: all .15s;
}
.back-to-top:hover { background: var(--primary-dark); color: #fff !important; }

.contact-button {
  position: fixed;
  bottom: 24px;
  left: 24px;
  background: #06c755;
  color: #fff !important;
  padding: 10px 18px;
  border-radius: 50px;
  font-weight: 500;
  text-decoration: none;
  z-index: 999;
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
  font-size: .9rem;
}
.contact-button:hover { background: #05a847; }

/* ===== BREADCRUMB ===== */
.breadcrumb-band {
  background: var(--bg-light);
  padding: 20px 0;
  border-bottom: 1px solid #eee;
}
.breadcrumb-band .breadcrumb { margin: 0; }
.breadcrumb-band .breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb-band .breadcrumb .active { color: var(--secondary); font-weight: 500; }

/* ===== ARTICLE CONTENT ===== */
.article-content { line-height: 1.85; }
.article-content h2, .article-content h3, .article-content h4 {
  margin-top: 1.5em;
  margin-bottom: .6em;
}
.article-content img { max-width: 100%; height: auto; border-radius: 8px; margin: 1em 0; }
.article-content blockquote {
  border-left: 4px solid var(--primary);
  padding: 12px 20px;
  margin: 1.5em 0;
  background: var(--bg-light);
  color: var(--text-muted);
}
.article-content ul, .article-content ol { padding-left: 1.5em; }
.article-content li { margin-bottom: .4em; }

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 30px;
}
.filter-bar .filter-btn {
  padding: 8px 18px;
  border-radius: 50px;
  background: #fff;
  border: 1.5px solid #e5e7eb;
  color: var(--text-muted);
  font-size: .9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all .15s;
}
.filter-bar .filter-btn:hover {
  border-color: var(--primary);
  color: var(--secondary);
}
.filter-bar .filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--secondary);
}

/* ===== GALLERY ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.gallery-grid .g-item {
  aspect-ratio: 1/1;
  overflow: hidden;
  border-radius: 10px;
  cursor: pointer;
  background: var(--bg-light);
}
.gallery-grid .g-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s;
}
.gallery-grid .g-item:hover img { transform: scale(1.06); }

/* ===== UTILS ===== */
.text-shadow { text-shadow: 0 2px 12px rgba(0,0,0,.4); }
.divider { height: 3px; width: 60px; background: var(--primary); margin: 10px 0 20px; border-radius: 2px; }
.section-title .divider { display: block; margin-left: 0; }
