/* ============================================================
   MIE SEIKI (THAILAND) — Main Stylesheet
   ============================================================ */

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:    #1b2a4a;
  --accent:     #e07820;
  --accent2:    #e8a020;
  --bg:         #f5f6f8;
  --white:      #ffffff;
  --text:       #2d2d2d;
  --muted:      #6b7280;
  --border:     #dde1e7;
  --radius:     8px;
  --shadow:     0 2px 12px rgba(0,0,0,.10);
  --font-base:    'Noto Sans JP', sans-serif;
  --font-jp:      'Noto Sans JP', sans-serif;
  --font-th:      'Noto Sans JP', 'Noto Sans Thai', sans-serif;
  --font-heading: 'Noto Sans JP', sans-serif;
  --font-serif:   'Noto Serif JP', serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-base);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 15px;
}

.lang-jp body, .lang-jp,
.lang-en body, .lang-en,
.lang-th body, .lang-th { font-family: var(--font-base); }

/* Headings — Poppins for EN, Noto Sans JP for JP */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  letter-spacing: -.01em;
}
.lang-jp h1, .lang-jp h2, .lang-jp h3,
.lang-jp h4, .lang-jp h5, .lang-jp h6 {
  font-family: var(--font-jp);
  letter-spacing: .02em;
}
.lang-th h1, .lang-th h2, .lang-th h3,
.lang-th h4, .lang-th h5, .lang-th h6 {
  font-family: var(--font-base);
  letter-spacing: 0;
}
.lang-en h1, .lang-en h2, .lang-en h3,
.lang-en h4, .lang-en h5, .lang-en h6 {
  font-family: var(--font-base);
  letter-spacing: 0;
}

/* Nav, buttons, labels — Poppins */
.nav-link, .btn-primary, .btn-secondary,
.lang-btn, .filter-tab, .badge,
.part-number, .machine-code { font-family: var(--font-heading); }
.lang-en .nav-link, .lang-en .btn-primary, .lang-en .btn-secondary,
.lang-en .lang-btn, .lang-en .filter-tab, .lang-en .badge,
.lang-en .part-number, .lang-en .machine-code,
.lang-th .nav-link, .lang-th .btn-primary, .lang-th .btn-secondary,
.lang-th .lang-btn, .lang-th .filter-tab, .lang-th .badge,
.lang-th .part-number, .lang-th .machine-code {
  font-family: var(--font-base);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Top Bar ---- */
.topbar {
  background: var(--primary);
  color: rgba(255,255,255,.85);
  font-size: 13px;
  padding: 7px 0;
}
.topbar-inner { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.topbar-tel { letter-spacing: .3px; }

.lang-switcher { display: flex; gap: 6px; }
.lang-btn {
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.3);
  color: rgba(255,255,255,.75);
  font-size: 12px;
  font-weight: 500;
  transition: all .2s;
  cursor: pointer;
}
.lang-btn:hover, .lang-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---- Header ---- */
.site-header {
  background: var(--white);
  border-bottom: 3px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
  gap: 20px;
}

.logo { display: flex; align-items: center; gap: 14px; }
.logo-img { height: 48px; width: auto; display: block; object-fit: contain; }
.footer-logo-img { height: 72px; width: auto; display: block; object-fit: contain; margin-bottom: 18px; }
.logo-on-dark {
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.25));
}
.logo-text { line-height: 1.2; }
.logo-main {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 2px;
}
.logo-sub {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 3px;
  text-transform: uppercase;
}

.main-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.main-nav a {
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: background .2s, color .2s;
  white-space: nowrap;
}
.main-nav a:hover, .main-nav a.active { background: var(--bg); color: var(--primary); }
.main-nav a.nav-cta {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 8px 18px;
  margin-left: 6px;
}
.main-nav a.nav-cta:hover { background: #c0601a; }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 0 9px;
  margin-left: auto;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
}
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- Hero Section ---- */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #2a4080 60%, #1b2a4a 100%);
  color: #fff;
  padding: 90px 0 80px;
  position: relative;
  overflow: hidden;
  text-align: center;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 30 L30 0 L60 30 L30 60Z' fill='none' stroke='rgba(255,255,255,.04)' stroke-width='1'/%3E%3C/svg%3E") repeat;
}
.hero-content { position: relative; z-index: 1; }
.hero-tag {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 16px;
  text-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.hero-sub {
  font-size: clamp(15px, 2vw, 20px);
  font-weight: 300;
  opacity: .85;
  max-width: 640px;
  margin: 0 auto 32px;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 13px 32px;
  border-radius: 40px;
  font-size: 15px;
  transition: background .2s, transform .2s;
  border: none;
  cursor: pointer;
}
.btn-primary:hover { background: #c0601a; transform: translateY(-2px); }
.btn-outline {
  display: inline-block;
  background: transparent;
  color: #fff;
  font-weight: 600;
  padding: 13px 32px;
  border-radius: 40px;
  font-size: 15px;
  border: 2px solid rgba(255,255,255,.5);
  transition: border-color .2s, background .2s;
  cursor: pointer;
}
.btn-outline:hover { border-color: #fff; background: rgba(255,255,255,.1); }

/* ---- Section General ---- */
.section { padding: 70px 0; }
.section-alt { background: var(--white); }
.section-title {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}
.section-title-wrap { text-align: center; margin-bottom: 50px; }
.section-subtitle { color: var(--muted); font-size: 15px; margin-top: 8px; }
.title-line {
  width: 50px; height: 4px;
  background: var(--accent);
  border-radius: 2px;
  margin: 12px auto 0;
}

/* ---- Cards ---- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-5px); box-shadow: 0 8px 28px rgba(0,0,0,.14); }
.card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: #e8eaed;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
}
.card-img-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #e8eaed 0%, #d1d5db 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.card-body { padding: 20px 22px; }
.card-tag {
  display: inline-block;
  background: #eef2ff;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; color: var(--primary); }
.card-text { font-size: 14px; color: var(--muted); line-height: 1.6; }
.card-date { font-size: 12px; color: var(--muted); margin-top: 12px; }

/* ---- Mission / About blocks ---- */
.mission-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
}
.mission-text { padding: 20px; }
.mission-quote {
  font-size: clamp(18px, 2.5vw, 26px);
  font-weight: 700;
  color: var(--primary);
  border-left: 5px solid var(--accent);
  padding-left: 20px;
  margin-bottom: 16px;
  line-height: 1.5;
}
.mission-body { color: var(--muted); font-size: 15px; line-height: 1.8; }
.mission-img {
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary) 0%, #2a4080 100%);
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mission-img-placeholder {
  color: rgba(255,255,255,.5);
  font-size: 14px;
  text-align: center;
  padding: 20px;
}

/* ---- Stats Bar ---- */
.stats-bar {
  background: var(--primary);
  color: #fff;
  padding: 40px 0;
}
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 24px; text-align: center; }
.stat-num { font-size: 36px; font-weight: 700; color: var(--accent2); }
.stat-label { font-size: 13px; opacity: .75; margin-top: 4px; }

/* ---- Page Banner ---- */
.page-banner {
  background: linear-gradient(135deg, var(--primary) 0%, #2a4080 100%);
  color: #fff;
  padding: 50px 0 44px;
  text-align: center;
}
.page-banner h1 { font-size: clamp(24px, 4vw, 40px); font-weight: 700; }
.page-banner p {
  max-width: 1200px;
  margin: 10px auto 0;
  opacity: .86;
  font-size: 15px;
  line-height: 1.9;
}
.lang-en .page-banner p {
  max-width: 1120px;
  font-size: 14px;
}
.breadcrumb { font-size: 13px; opacity: .65; margin-top: 8px; }
.breadcrumb a { opacity: .8; }
.breadcrumb a:hover { opacity: 1; }

/* ---- Table (Parts) ---- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
table.data-table { width: 100%; border-collapse: collapse; background: var(--white); }
table.data-table th {
  background: var(--primary);
  color: #fff;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
table.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
  vertical-align: top;
}
table.data-table tr:hover td { background: #f8f9ff; }
table.data-table tr:last-child td { border-bottom: none; }

/* ---- Contact ---- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 40px; }
.contact-info-box {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 32px;
}
.contact-info-box h3 { font-size: 20px; color: var(--primary); margin-bottom: 24px; }
.info-row { display: flex; gap: 14px; margin-bottom: 18px; align-items: flex-start; }
.info-icon {
  width: 40px; height: 40px; min-width: 40px;
  background: #eef2ff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  font-size: 16px;
}
.info-label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.info-val { font-size: 15px; font-weight: 500; margin-top: 2px; }

.map-box {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  min-height: 380px;
  background: #e8eaed;
}
.map-box iframe { width: 100%; height: 100%; min-height: 380px; border: none; }

/* ---- Recruit ---- */
.recruit-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 30px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 20px;
  transition: transform .2s;
}
.recruit-card:hover { transform: translateY(-3px); }
.recruit-badge {
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  white-space: nowrap;
  margin-top: 4px;
}
.recruit-body { flex: 1; }
.recruit-title { font-size: 18px; font-weight: 700; color: var(--primary); margin-bottom: 6px; }
.recruit-dept { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.recruit-desc { font-size: 14px; color: var(--text); line-height: 1.7; }
.no-position {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.no-position h3 { font-size: 20px; color: var(--primary); margin-bottom: 10px; }

/* ---- News Detail ---- */
.news-detail {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.news-detail-img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  background: linear-gradient(135deg, #e8eaed, #d1d5db);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.news-detail-body { padding: 32px 36px; }

/* ---- Utility ---- */
.text-center { text-align: center; }
.mt-12 { margin-top: 12px; }
.mt-24 { margin-top: 24px; }
.mt-40 { margin-top: 40px; }
.mb-24 { margin-bottom: 24px; }
.label-accent { color: var(--accent); font-weight: 700; }
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.badge-csr    { background: #dcfce7; color: #16a34a; }
.badge-act    { background: #dbeafe; color: #1d4ed8; }
.badge-news   { background: #fef3c7; color: #92400e; }

.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}
.empty-state h3 { font-size: 20px; color: var(--primary); margin-bottom: 8px; }

/* ---- Footer ---- */
.site-footer {
  background: var(--primary);
  color: rgba(255,255,255,.8);
  padding: 56px 0 0;
  margin-top: 0;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.footer-logo {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 2px;
  margin-bottom: 14px;
  line-height: 1.3;
}
.footer-logo small { font-size: 11px; letter-spacing: 1px; opacity: .7; }
.footer-col:first-child p {
  color: #fff;
  font-size: 16px;
  line-height: 1.8;
  font-weight: 500;
}
.footer-addr { opacity: 1; margin-bottom: 10px; }
.footer-col h4 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
  margin-bottom: 16px;
}
.footer-col a {
  display: block;
  font-size: 13px;
  color: rgba(255,255,255,.7);
  margin-bottom: 8px;
  transition: color .2s;
}
.footer-col a:hover { color: #fff; }
.footer-link {
  display: inline-block;
  color: var(--accent2) !important;
  font-weight: 600;
  font-size: 14px !important;
}
.footer-bottom {
  padding: 16px 0;
  font-size: 12px;
  color: rgba(255,255,255,.45);
  text-align: center;
}

/* ---- Admin Link (small) ---- */
.admin-link {
  position: fixed;
  bottom: 20px; right: 20px;
  background: var(--primary);
  color: rgba(255,255,255,.7);
  font-size: 11px;
  padding: 8px 14px;
  border-radius: 20px;
  box-shadow: var(--shadow);
  z-index: 200;
  transition: color .2s;
}
.admin-link:hover { color: #fff; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .mission-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }

  .hamburger { display: flex; }
  .main-nav {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 16px;
    right: 16px;
    background: var(--white);
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: 0 18px 34px rgba(0,0,0,.18);
    max-height: calc(100vh - 112px);
    overflow-y: auto;
    padding: 8px 0 14px;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity .2s, transform .2s, visibility .2s;
  }
  .main-nav.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }
  .main-nav a {
    display: block;
    width: 100%;
    padding: 15px 22px;
    border-radius: 0;
    border-bottom: 1px solid var(--border);
    color: var(--primary);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    white-space: normal;
  }
  .main-nav a:hover,
  .main-nav a.active {
    background: var(--bg);
    color: var(--primary);
  }
  .main-nav a.nav-cta {
    width: auto;
    margin: 12px 18px 0;
    border: 0;
    border-radius: var(--radius);
    background: var(--accent);
    color: #fff;
    text-align: center;
  }
  .main-nav a:last-child { border-bottom: 0; }
  .site-header { position: relative; }
  .header-inner { position: relative; }
  .logo { min-width: 0; }
  .logo-img { max-width: min(260px, calc(100vw - 112px)); height: 42px; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .topbar-tel { display: none; }
}
@media (max-width: 480px) {
  .hero { padding: 60px 0 50px; }
  .section { padding: 48px 0; }
  .cards-grid { grid-template-columns: 1fr; }
}
