/* ============================================================
   TJN WEBSITE — MAIN STYLESHEET
   Thai-Japan Gas Network Co., Ltd.
   Colors: Navy #0A2342 | Teal #028090 | Font: DM Sans + DM Serif Display
   ============================================================ */

/* ---------- CSS VARIABLES ---------- */
:root {
  --navy:        #0A2342;
  --navy-mid:    #0D2D56;
  --navy-light:  #1A3A5C;
  --teal:        #028090;
  --teal-light:  #03A0B5;
  --teal-pale:   #E6F4F6;
  --orange:      #E97020;
  --white:       #FFFFFF;
  --off-white:   #F4F7FA;
  --gray-100:    #EEF2F7;
  --gray-300:    #C8D4E0;
  --gray-500:    #7A8FA6;
  --gray-700:    #3D4F62;
  --text:        #1A2A3A;
  --placeholder-bg: #E8EEF4;
  --placeholder-border: #C0CDD9;

  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;

  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --shadow-sm:   0 2px 8px rgba(10,35,66,0.08);
  --shadow-md:   0 4px 20px rgba(10,35,66,0.12);
  --shadow-lg:   0 8px 40px rgba(10,35,66,0.16);

  --nav-height:  88px;
  --max-width:   1200px;
  --section-gap: 96px;
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ---------- UTILITIES ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--teal);
  color: var(--white);
  border-color: var(--teal);
}
.btn-primary:hover {
  background: var(--teal-light);
  border-color: var(--teal-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.6);
}
.btn-outline:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--white);
}
.btn-white {
  background: var(--white);
  color: var(--navy);
  border-color: var(--white);
}
.btn-white:hover {
  background: var(--off-white);
  transform: translateY(-1px);
}
.btn-lg { padding: 14px 32px; font-size: 15px; }

.section { padding: var(--section-gap) 0; }

.section-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 12px;
}
.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 56px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.2;
  color: var(--navy);
  margin-bottom: 16px;
}
.section-sub {
  font-size: 16px;
  color: var(--gray-500);
  line-height: 1.7;
}

/* placeholder style for [INSERT COPY] blocks */
.section-sub:not([data-live]),
p:not([data-live]) {
  /* nothing — placeholders show naturally */
}

/* ---------- NAVIGATION ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  transition: box-shadow 0.3s ease;
}
.site-header.scrolled {
  box-shadow: 0 2px 16px rgba(10,35,66,0.10);
}
.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
  gap: 24px;
}
.logo { display: flex; align-items: center; flex-shrink: 0; }
.logo-img { height: 44px; width: auto; }

/* Logo placeholder if image missing */
.logo-img[src="assets/logo.png"]:not([data-loaded]) {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.1);
  color: white;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 4px;
  height: 36px;
  width: 160px;
}

.main-nav ul { display: flex; align-items: center; gap: 4px; }
.main-nav ul li { position: relative; }
.main-nav ul li a {
  display: block;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--navy);
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}
.main-nav ul li a:hover,
.main-nav ul li a.active {
  color: var(--teal);
  background: var(--teal-pale);
}

/* Dropdown */
.has-dropdown { position: relative; }
.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  padding: 8px 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  transition-delay: 0.1s;
  z-index: 200;
}
.has-dropdown:hover .dropdown {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
  transition-delay: 0s;
}
.has-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 12px;
}
.dropdown li a {
  display: block;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 400;
  color: var(--gray-700) !important;
  background: transparent !important;
  border-radius: 0 !important;
  transition: background 0.15s, color 0.15s;
}
.dropdown li a:hover {
  background: var(--teal-pale) !important;
  color: var(--teal) !important;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.lang-toggle {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: color 0.2s;
}
.lang-toggle:hover { color: var(--navy); }
.lang-active { color: var(--navy); font-weight: 700; }
.nav-cta { display: none; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: all 0.2s;
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: var(--nav-height);
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-img-placeholder {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 50%, #0a3558 100%);
  display: flex;
  align-items: flex-end;
  padding: 24px;
}
.hero-img-placeholder span {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  font-style: italic;
  border: 1px dashed rgba(255,255,255,0.2);
  padding: 6px 12px;
  border-radius: 4px;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(10,35,66,0.85) 40%, rgba(10,35,66,0.3) 100%);
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 640px;
  padding-top: 48px;
  padding-bottom: 48px;
}
.hero-tag {
  display: inline-block;
  background: rgba(2,128,144,0.25);
  border: 1px solid rgba(2,128,144,0.5);
  color: var(--teal-light);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 24px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 6vw, 72px);
  line-height: 1.1;
  color: var(--white);
  margin-bottom: 20px;
}
.hero-title em {
  font-style: italic;
  color: var(--teal-light);
}
.hero-sub {
  font-size: 17px;
  line-height: 1.7;
  color: rgba(255,255,255,0.75);
  margin-bottom: 36px;
  max-width: 520px;
}
.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.hero-scroll-hint {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.4);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.4), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(0.7); }
}

/* ---------- TRUST BAR ---------- */
.trust-bar {
  background: var(--navy);
  padding: 32px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.trust-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}
.trust-item {
  flex: 1;
  min-width: 160px;
  text-align: center;
  padding: 16px 24px;
}
.trust-number {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--teal-light);
  line-height: 1;
  margin-bottom: 6px;
}
.trust-label {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  line-height: 1.4;
}
.trust-divider {
  width: 1px;
  height: 48px;
  background: rgba(255,255,255,0.12);
  flex-shrink: 0;
}

/* ---------- PRODUCTS ---------- */
.products-section { background: var(--off-white); }
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.product-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  border: 1px solid var(--gray-100);
  position: relative;
  transition: box-shadow 0.2s, transform 0.2s;
}
.product-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.product-card--featured {
  border-color: var(--teal);
  box-shadow: 0 0 0 1px var(--teal), var(--shadow-md);
}
.product-icon {
  width: 48px;
  height: 48px;
  color: var(--teal);
  margin-bottom: 20px;
}
.product-tag {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--teal-pale);
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
}
.product-card h3 {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--navy);
  margin-bottom: 12px;
}
.product-card p {
  font-size: 14px;
  color: var(--gray-500);
  line-height: 1.7;
  margin-bottom: 20px;
}
.product-features {
  margin-bottom: 24px;
}
.product-features li {
  font-size: 13px;
  color: var(--gray-700);
  padding: 6px 0;
  padding-left: 16px;
  position: relative;
  border-bottom: 1px solid var(--gray-100);
}
.product-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
}
.product-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--teal);
  transition: gap 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.product-link:hover { color: var(--navy); }

/* ---------- SERVICES ---------- */
.services-section { background: var(--white); }
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.service-item {
  background: var(--white);
  padding: 48px 40px;
  position: relative;
}
.service-number {
  font-family: var(--font-display);
  font-size: 48px;
  color: var(--gray-100);
  line-height: 1;
  margin-bottom: 16px;
  font-weight: 400;
}
.service-item h3 {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--navy);
  margin-bottom: 12px;
}
.service-item p {
  font-size: 14px;
  color: var(--gray-500);
  line-height: 1.75;
  margin-bottom: 20px;
}
.service-stats {
  display: flex;
  gap: 24px;
  margin-top: 20px;
}
.stat strong {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--teal);
  font-family: var(--font-display);
}
.stat span {
  font-size: 12px;
  color: var(--gray-500);
}
.service-list {
  margin-top: 8px;
}
.service-list li {
  font-size: 14px;
  color: var(--gray-700);
  padding: 5px 0 5px 20px;
  position: relative;
}
.service-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--teal);
  font-size: 12px;
}
.service-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--teal);
  margin-top: 8px;
  transition: color 0.2s;
}
.service-link:hover { color: var(--navy); }

/* ---------- WHY TJN ---------- */
.why-section { background: var(--off-white); }
.why-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: center;
}
.why-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--placeholder-bg);
  border: 2px dashed var(--placeholder-border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.img-placeholder {
  font-size: 12px;
  color: var(--gray-500);
  text-align: center;
  padding: 24px;
  font-style: italic;
}
.why-intro {
  font-size: 16px;
  color: var(--gray-500);
  line-height: 1.75;
  margin-bottom: 32px;
}
.why-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 36px;
}
.why-list li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.why-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background: var(--teal);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  margin-top: 2px;
}
.why-list li strong {
  display: block;
  font-size: 15px;
  color: var(--navy);
  margin-bottom: 4px;
}
.why-list li p {
  font-size: 14px;
  color: var(--gray-500);
  line-height: 1.6;
}

/* ---------- CASE STUDIES ---------- */
.case-section { background: var(--white); }
.case-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.case-card {
  background: var(--off-white);
  border-radius: var(--radius-lg);
  padding: 32px;
  border: 1px solid var(--gray-100);
  transition: box-shadow 0.2s, transform 0.2s;
}
.case-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.case-placeholder {
  border: 2px dashed var(--placeholder-border);
  background: var(--placeholder-bg);
  opacity: 0.85;
}
.case-industry {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 12px;
}
.case-title {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--navy);
  margin-bottom: 20px;
  line-height: 1.3;
}
.case-metrics {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--gray-300);
  border-bottom: 1px solid var(--gray-300);
}
.metric-value {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--navy);
}
.metric-label {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 2px;
}
.case-desc {
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.7;
  margin-top: 12px;
}

/* ---------- CTA BANNER ---------- */
.cta-banner {
  background: linear-gradient(135deg, var(--navy) 0%, var(--teal) 100%);
  padding: 80px 0;
  text-align: center;
}
.cta-content h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 44px);
  color: var(--white);
  margin-bottom: 16px;
}
.cta-content p {
  font-size: 17px;
  color: rgba(255,255,255,0.75);
  margin-bottom: 32px;
}

/* ---------- FOOTER ---------- */
.site-footer {
  background: var(--gray-100);
  padding-top: 64px;
  border-top: 1px solid var(--gray-300);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--gray-300);
}
.footer-logo {
  height: 40px;
  margin-bottom: 16px;
  opacity: 0.9;
}
.footer-tagline {
  font-size: 14px;
  color: var(--gray-500);
  line-height: 1.6;
  margin-bottom: 8px;
}
.footer-backed {
  font-size: 12px;
  color: var(--teal);
  font-weight: 500;
}
.footer-nav h4 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 16px;
}
.footer-nav ul li {
  margin-bottom: 8px;
}
.footer-nav ul li a {
  font-size: 14px;
  color: var(--gray-700);
  transition: color 0.2s;
}
.footer-nav ul li a:hover { color: var(--teal); }
.footer-contact h4 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 16px;
}
.footer-contact p {
  font-size: 13px;
  color: var(--gray-700);
  line-height: 1.7;
  margin-bottom: 8px;
}
.footer-contact a { color: var(--gray-700); transition: color 0.2s; }
.footer-contact a:hover { color: var(--teal); }

.footer-bottom {
  padding: 20px 0;
  border-top: 1px solid var(--gray-300);
  margin-top: 0;
}
.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-bottom p {
  font-size: 12px;
  color: var(--gray-500);
}
.footer-lang {
  font-size: 12px;
  color: var(--gray-500);
}
.footer-lang a { color: var(--gray-500); transition: color 0.2s; }
.footer-lang a:hover,
.footer-lang .lang-active { color: var(--navy); }

/* ---------- RESPONSIVE ---------- */
@media (min-width: 1024px) {
  .nav-cta { display: inline-flex; }
}

@media (max-width: 1023px) {
  .main-nav { display: none; }
  .hamburger { display: flex; }
  .products-grid { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; }
  .services-grid { grid-template-columns: 1fr; }
  .why-container { grid-template-columns: 1fr; gap: 40px; }
  .case-grid { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .trust-grid { justify-content: flex-start; }
  .trust-divider { display: none; }
}

@media (max-width: 767px) {
  :root { --section-gap: 64px; }
  .hero-actions { flex-direction: column; align-items: flex-start; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom-inner { flex-direction: column; gap: 8px; text-align: center; }
}

/* ---------- MOBILE NAV OPEN STATE ---------- */
.main-nav.open {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: var(--nav-height);
  left: 0; right: 0;
  background: var(--white);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  z-index: 99;
}
.main-nav.open ul {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}
.main-nav.open ul li a { padding: 12px 8px; font-size: 16px; }
.main-nav.open .dropdown {
  position: static;
  opacity: 1;
  pointer-events: all;
  transform: none;
  box-shadow: none;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-sm);
  padding: 4px 0;
  margin: 4px 0 8px 16px;
}
.main-nav.open .dropdown li a {
  color: rgba(255,255,255,0.65) !important;
  font-size: 14px;
  padding: 8px 16px;
}


/* ---------- ANCHOR SCROLL OFFSET (fixed nav compensation) ---------- */
section[id], div[id] {
  scroll-margin-top: calc(var(--nav-height) + 16px);
}
