/* ==========================================================================
   Artith Landing Page
   Bootstrap 5.3 + custom styles
   ========================================================================== */

/* ---------- 1. Brand tokens ---------- */
:root {
  --at-primary: #00706E;        /* teal (logo) */
  --at-primary-dark: #00504F;
  --at-primary-darker: #003B3A;
  --at-primary-light: #E0F0EF;
  --at-accent: #EE6F31;         /* orange (logo) – lines & bars only */
  --at-accent-text: #A3421A;    /* orange for text (passes contrast) */
  --at-accent-soft: #FFB088;    /* orange on dark backgrounds */
  --at-text: #1C2B2B;
  --at-text-muted: #4A5B5B;
  --at-border: #D5E6E5;
  --at-bg-soft: #EEF6F6;
  --at-bg-grey: #F1F3F3;
  --at-hero-bg: linear-gradient(180deg, #CDCED0 0%, #D1D2D6 20%, #D8D7DD 40%, #F0F0F0 60%, #E4E2E5 80%, #C5C4CC 100%);
  --at-header-h: 82px;

  /* Bootstrap overrides */
  --bs-body-font-family: 'Noto Sans Thai', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bs-body-color: var(--at-text);
  --bs-link-color-rgb: 0, 107, 105;
  --bs-link-hover-color-rgb: 0, 79, 77;
}

html { scroll-padding-top: var(--at-header-h); }
body { font-family: var(--bs-body-font-family); color: var(--at-text); }
img { max-width: 100%; height: auto; }

/* ---------- 2. Shared pieces ---------- */
.brand-stripe { height: 4px; background: var(--at-accent); }

.section { position: relative; overflow: hidden; padding: 96px 0; }
.section > .container { position: relative; z-index: 1; }

.eyebrow {
  margin: 0 0 12px;
  font-style: italic;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--at-accent-text);
}
.section-title {
  margin: 0;
  font-style: italic;
  font-weight: 700;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.2;
  color: var(--at-primary-dark);
}
.title-bar {
  display: block;
  width: 48px;
  height: 3px;
  margin: 14px 0 16px;
  border-radius: 2px;
  background: var(--at-accent);
}
.section-lead { margin: 0; font-size: 17px; line-height: 1.7; color: var(--at-text-muted); max-width: 720px; }

/* Fan watermark (decorative SVG) */
.fan-watermark {
  position: absolute;
  z-index: 0;
  width: 680px;
  height: 680px;
  pointer-events: none;
  color: var(--at-primary);
  opacity: .12;
}
.fan-watermark--tr { right: -220px; top: -160px; }
.fan-watermark--bl { left: -260px; bottom: -200px; }
.fan-watermark--light { color: #FFFFFF; opacity: .08; width: 760px; height: 760px; right: -240px; top: -200px; }

/* ---------- 3. Buttons ---------- */
.btn-at {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 24px;
  border: 1.5px solid var(--at-primary);
  border-radius: 10px;
  background: transparent;
  color: var(--at-primary-dark);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  transition: border-color .15s, color .15s, background-color .15s;
}
.btn-at:hover, .btn-at:focus-visible { border-color: var(--at-accent); color: var(--at-accent-text); }
.btn-at--block { width: 100%; min-height: 46px; }

.btn-link-at {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 50px;
  padding: 0 6px;
  color: var(--at-primary-dark);
  font-weight: 600;
  font-size: 16px;
  text-decoration: underline;
  text-underline-offset: 5px;
  transition: color .15s, text-decoration-color .15s;
}
.btn-link-at:hover { color: var(--at-accent-text); text-decoration-color: var(--at-accent); }

.btn-line {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--at-primary);
  color: #FFFFFF;
  font-weight: 600;
  text-decoration: none;
}
.btn-line:hover { background: var(--at-primary-dark); color: #FFFFFF; }

/* ---------- 4. Header / navbar ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: #FFFFFF;
  border-bottom: 1px solid #E2ECEB;
  transition: box-shadow .2s;
}
.site-header.is-scrolled { box-shadow: 0 6px 20px rgba(0, 59, 58, .08); }
.site-header .navbar { padding: 16px 0; transition: padding .2s; }
.site-header.is-scrolled .navbar { padding: 8px 0; }
.navbar-brand img { height: 46px; width: auto; transition: height .2s; }
.site-header.is-scrolled .navbar-brand img { height: 38px; }

.navbar .nav-link {
  padding: 10px 14px !important;
  font-weight: 500;
  color: var(--at-text);
  position: relative;
}
.navbar .nav-link:hover, .navbar .nav-link.active { color: var(--at-primary-dark); }
.navbar .nav-link.active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 2px;
  background: var(--at-accent);
}

.lang-switch { display: inline-flex; border: 1px solid #C9DCDB; border-radius: 10px; overflow: hidden; }
.lang-switch a, .lang-switch span { padding: 10px 12px; font-weight: 600; font-size: 14px; color: var(--at-primary-dark); text-decoration: none; }
.lang-switch .is-current { background: var(--at-primary-dark); color: #FFFFFF; }

/* ---------- 5. Hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, 40%); background: var(--at-hero-bg); overflow: hidden; }
.hero__media { position: relative; min-height: 560px; }
.hero__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right bottom;
  -webkit-mask-image: linear-gradient(to right, #000 93%, transparent 100%);
  mask-image: linear-gradient(to right, #000 93%, transparent 100%);
}
.hero__copy { display: flex; align-items: center; padding: 48px 40px 56px 32px; background: var(--at-hero-bg); }
.hero__inner { max-width: 460px; display: flex; flex-direction: column; gap: 18px; }
.hero__badge {
  align-self: flex-start;
  padding: 7px 14px;
  border: 1.5px solid var(--at-accent);
  border-radius: 999px;
  color: var(--at-accent-text);
  font-style: italic;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .1em;
}
.hero__title { margin: 0; font-style: italic; font-weight: 700; font-size: clamp(36px, 4.2vw, 48px); line-height: 1.15; color: var(--at-primary-dark); }
.hero__title span { display: block; }
.hero__title span + span { color: var(--at-primary); }
.hero__lead { margin: 0; font-size: 17px; line-height: 1.7; color: #2A3838; }
.hero__stats { display: flex; flex-wrap: wrap; gap: 32px; margin: 4px 0 0; padding: 18px 0 0; border-top: 1px solid #C3CCCC; list-style: none; }
.hero__stats li { display: flex; flex-direction: column; gap: 2px; }
.hero__stats strong { font-style: italic; font-weight: 600; font-size: 30px; line-height: 1.1; color: var(--at-primary-dark); }
.hero__stats span { font-size: 14px; color: #3A4B4B; }

@media (max-width: 991.98px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero__media { min-height: 280px; }
  .hero__media img { -webkit-mask-image: none; mask-image: none; }
  .hero__copy { padding: 40px 24px 48px; }
  .hero__inner { max-width: none; }
}

/* ---------- 6. Certifications strip ---------- */
.certs { background: #FFFFFF; border-bottom: 1px solid #E2ECEB; padding: 28px 0; }
.certs__label { font-style: italic; font-weight: 600; font-size: 15px; color: var(--at-primary-dark); margin: 0; }
.cert-logo {
  width: 140px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 10px;
}
.cert-logo img { max-height: 56px; width: auto; }
/* placeholder until real logo files arrive */
.cert-logo--placeholder { flex-direction: column; gap: 2px; text-align: center; border: 1.5px dashed #9CBFBE; background: #F7FBFB; }
.cert-logo--placeholder b { font-weight: 600; font-size: 12px; letter-spacing: .14em; color: var(--at-primary-dark); }
.cert-logo--placeholder span { font-size: 12px; line-height: 1.3; color: #3A4B4B; }

/* ---------- 7. About ---------- */
.about { background: var(--at-primary-dark); text-align: center; }
.about .eyebrow { color: var(--at-accent-soft); }
.about .section-title { color: #FFFFFF; font-size: clamp(32px, 4.6vw, 48px); }
.about .section-title span { color: var(--at-accent-soft); }
.about .title-bar { margin-left: auto; margin-right: auto; }
.about__lead { max-width: 760px; margin: 0 auto; font-size: 18px; line-height: 1.8; color: #E3F0EF; }

.video-card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-top: 40px;
  border: 1px solid #2A7473;
  border-radius: 18px;
  overflow: hidden;
  background: #F1EEE8;
}
.video-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.video-card:hover img { transform: scale(1.03); }
.video-card__play {
  position: absolute;
  left: 24px;
  bottom: 24px;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--at-primary);
  color: #FFFFFF;
  box-shadow: 0 0 0 10px rgba(0, 112, 110, .25);
  transition: transform .2s, background-color .2s;
}
.video-card:hover .video-card__play { transform: scale(1.08); background: var(--at-accent); box-shadow: 0 0 0 10px rgba(238, 111, 49, .25); }

.about__points { margin-top: 32px; text-align: left; }
.about__point { padding-top: 16px; border-top: 1px solid #2A7473; height: 100%; }
.about__point h3 { margin: 0 0 4px; font-style: italic; font-weight: 700; font-size: 20px; color: #FFFFFF; }
.about__point p { margin: 0; font-size: 15px; line-height: 1.6; color: #CFE5E4; }

/* ---------- 8. Catalog ---------- */
.catalog { background: var(--at-bg-soft); }
.catalog__grid { margin-top: 40px; }
.product-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--at-border);
  border-radius: 16px;
  overflow: hidden;
  background: #FFFFFF;
  transition: transform .2s, box-shadow .2s;
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(0, 59, 58, .10); }
.product-card__img { display: block; width: 100%; aspect-ratio: 753 / 410; object-fit: cover; background: #388081; }
.product-card__body { flex-grow: 1; display: flex; flex-direction: column; gap: 12px; padding: 20px 22px 22px; }
.product-card__en { margin: 0; font-style: italic; font-weight: 600; font-size: 13px; letter-spacing: .08em; color: #5A6B6B; }
.product-card__title { margin: 0; font-weight: 600; font-size: 21px; line-height: 1.3; color: var(--at-text); }
.product-card__desc { flex-grow: 1; margin: 0; font-size: 15px; line-height: 1.65; color: var(--at-text-muted); }
.product-card__meta { margin: 0; font-size: 13px; color: #5A6B6B; }

/* ---------- 9. Contact ---------- */
.contact { background: #FFFFFF; }
.hq-card {
  display: flex;
  flex-wrap: wrap;
  margin-top: 40px;
  border: 1px solid #DDE3E3;
  border-radius: 20px;
  overflow: hidden;
  background: var(--at-bg-grey);
}
.hq-card__info { flex: 1 1 480px; min-width: 0; padding: 40px; display: flex; flex-direction: column; gap: 20px; }
.hq-card__tag { margin: 0; font-style: italic; font-weight: 500; font-size: 14px; letter-spacing: .1em; color: var(--at-accent-text); }
.hq-card__title { margin: 0; font-weight: 600; font-size: clamp(24px, 3vw, 30px); line-height: 1.25; color: var(--at-primary-dark); }
.hq-card__map { flex: 1 1 380px; min-width: 0; min-height: 320px; position: relative; display: block; border-left: 1px solid #DDE3E3; background: #F1F3F4; }
.hq-card__map img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 46%; }
.hq-card__map-btn {
  position: absolute;
  right: 12px;
  top: 12px;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #DADCE0;
  border-radius: 8px;
  background: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
  color: var(--at-primary-dark);
}
@media (max-width: 767.98px) { .hq-card__info { padding: 28px 24px; } .hq-card__map { border-left: 0; border-top: 1px solid #DDE3E3; } }

.contact-list { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; font-size: 16px; line-height: 1.6; color: #1E4A49; font-style: normal; }
.contact-list li { display: flex; gap: 12px; align-items: flex-start; }
.contact-list .ico { flex: none; margin-top: 3px; color: var(--at-primary); }
.contact-list a { color: var(--at-primary-dark); font-weight: 600; }

.branch-list { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.branch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  padding: 18px 24px;
  border: 1px solid var(--at-border);
  border-radius: 14px;
  background: #FFFFFF;
  transition: border-color .2s;
}
.branch:hover { border-color: #9CCBC9; }
.branch__name { flex: 0 0 250px; min-width: 0; display: flex; align-items: center; gap: 14px; }
.branch__no { width: 40px; height: 40px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #FDEBE2; color: #8A3A14; font-weight: 600; font-size: 15px; }
.branch__name h3 { margin: 0; font-weight: 600; font-size: 18px; color: var(--at-text); }
.branch__name small { font-size: 13px; color: #5A6B6B; }
.branch__addr { flex: 1 1 320px; min-width: 0; display: flex; gap: 10px; align-items: flex-start; margin: 0; font-style: normal; font-size: 15px; line-height: 1.6; color: #3A4B4B; }
.branch__addr .ico { flex: none; margin-top: 3px; color: var(--at-primary); }
.branch .btn-at { flex: none; min-height: 44px; padding: 0 16px; border-color: #9CCBC9; color: #006B69; }
.branch .btn-at:hover { border-color: var(--at-accent); color: var(--at-accent-text); }
@media (max-width: 575.98px) { .branch__name { flex-basis: 100%; } .branch .btn-at { width: 100%; } }

.social-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 28px; padding: 24px 28px; border-radius: 16px; background: var(--at-bg-soft); }
.social-bar p { margin: 0; font-weight: 600; font-size: 18px; color: var(--at-primary-dark); }
.social-bar a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #C9DCDB;
  border-radius: 10px;
  background: #FFFFFF;
  color: var(--at-text);
  font-weight: 600;
  text-decoration: none;
  transition: border-color .15s, color .15s;
}
.social-bar a:hover { border-color: var(--at-accent); color: var(--at-accent-text); }
.social-bar .ico { color: var(--at-primary); }

/* ---------- 10. Footer ---------- */
.site-footer { background: var(--at-primary-darker); color: #B8D6D5; padding: 40px 0; }
.site-footer__logo { display: inline-flex; padding: 10px 14px; border-radius: 10px; background: #FFFFFF; }
.site-footer__logo img { height: 40px; width: auto; }
.site-footer p { margin: 0; font-size: 14px; }

/* ---------- 11. Back to top ---------- */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1020;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--at-primary);
  border-radius: 12px;
  background: #FFFFFF;
  color: var(--at-primary-dark);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .2s, transform .2s, visibility .2s, border-color .15s, color .15s;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { border-color: var(--at-accent); color: var(--at-accent-text); }

/* ---------- 12. Reveal on scroll ----------
   Content is visible by default. Only when JS runs (html.js) do elements
   start hidden and fade in – so crawlers and no-JS users always see text. */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .product-card, .video-card img, .video-card__play { transition: none; }
}

/* Video modal */
.modal-video .modal-content { background: #000; border: 0; border-radius: 14px; overflow: hidden; }
.modal-video .btn-close { position: absolute; right: 12px; top: 12px; z-index: 2; width: 40px; height: 40px; padding: 0; border-radius: 50%; background-color: #FFFFFF; background-size: 14px; opacity: 1; box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.modal-video .btn-close:hover { background-color: #FDEBE2; }

/* ---------- 13. Catalog details & bilingual downloads ---------- */
.product-card__sub { margin: 4px 0 0; font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--at-primary-dark); }
.product-card__series { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; flex-grow: 1; }
.product-card__series li { padding-left: 14px; border-left: 2px solid var(--at-primary-light); display: flex; flex-direction: column; }
.product-card__series strong { font-weight: 600; font-size: 14px; line-height: 1.45; color: var(--at-text); }
.product-card__series span { font-size: 13px; line-height: 1.5; color: var(--at-text-muted); }
.product-card__dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding-top: 4px; }
.btn-dl { min-height: 56px; padding: 6px 12px; gap: 8px; }
.btn-dl > span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.btn-dl b { font-weight: 600; font-size: 15px; }
.btn-dl small { font-weight: 400; font-size: 12px; color: var(--at-text-muted); }
.btn-dl--na { display: flex; align-items: center; justify-content: center; text-align: center; border: 1.5px dashed #C9DCDB; border-radius: 10px; font-size: 12px; line-height: 1.4; color: #5A6B6B; }

.enquiry { margin-top: 56px; padding-top: 40px; border-top: 1px solid #C9DCDB; }
.enquiry__title { margin: 0 0 6px; font-style: italic; font-weight: 700; font-size: 24px; color: var(--at-primary-dark); }
.enquiry__lead { margin: 0 0 24px; font-size: 16px; color: var(--at-text-muted); }
.product-card--mini .product-card__img { aspect-ratio: 753 / 300; }
.product-card--mini .product-card__body { gap: 8px; padding: 16px 20px 18px; }
.product-card--mini .product-card__title { font-size: 18px; }
.product-card--mini .btn-link-at { min-height: 44px; align-self: flex-start; }
.product-card:not(.product-card--mini) .product-card__desc { flex-grow: 0; }
/* placeholder until the sketch image arrives */
.product-card__img--placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-bottom: 2px dashed #8FC3C1; color: #E0F0EF; text-align: center; }
.product-card__img--placeholder b { font-weight: 600; font-size: 20px; letter-spacing: .14em; color: #FFFFFF; }
.product-card__img--placeholder span { font-size: 13px; }

/* ---------- 14. Real certificate logos ---------- */
.cert-logo { width: 96px; height: 96px; padding: 0; border-radius: 12px; overflow: hidden; background: #F4F6F6; border: 1px solid #E2ECEB; transition: transform .2s, box-shadow .2s; }
.cert-logo img { display: block; width: 100%; height: 100%; max-height: none; object-fit: contain; }
.cert-logo:hover { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(0, 59, 58, .10); }
@media (max-width: 575.98px) { .cert-logo { width: 76px; height: 76px; } }

/* video lightbox */
.video-card { cursor: pointer; }
.modal-video .modal-dialog { max-width: min(1100px, 92vw); }
.modal-backdrop.show { opacity: .85; }
.contact-list a[href^="tel:"] { white-space: nowrap; }
.product-card:not(.product-card--mini) .product-card__desc { flex-grow: 1; }
