/*
Theme Name: SEWON M-TECH Modern
Theme URI: https://kezlife.com/
Author: Eazydoc Codex
Description: Modern WordPress theme for SEWON M-TECH industrial extrusion systems with faceted product discovery and English-first SEO.
Version: 1.0.3
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 8.1
Text Domain: sewonmtech
*/

:root {
  --cds-background: #ffffff;
  --cds-layer-01: #f4f4f4;
  --cds-layer-02: #e8e8e8;
  --cds-text-primary: #161616;
  --cds-text-secondary: #525252;
  --cds-text-muted: #6f6f6f;
  --cds-border-subtle: #d0d0d0;
  --cds-border-strong: #8d8d8d;
  --cds-interactive: #0f62fe;
  --cds-interactive-hover: #0043ce;
  --cds-interactive-soft: #edf5ff;
  --cds-dark: #161616;
  --cds-dark-02: #262626;
  --cds-dark-03: #393939;
  --swm-safety: #f1c21b;
  --swm-success: #24a148;
  --swm-max: 1440px;
  --swm-gutter: clamp(16px, 4vw, 48px);
  --swm-header: 72px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--cds-background);
  color: var(--cds-text-primary);
  font-family: "IBM Plex Sans", "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
}

body.admin-bar .site-header {
  top: 32px;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--cds-interactive);
}

button,
input,
textarea,
select {
  font: inherit;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 100;
  background: var(--cds-interactive);
  color: #fff;
  padding: 12px 16px;
}

.skip-link:focus {
  top: 16px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--swm-header);
  background: rgba(22, 22, 22, 0.96);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
}

.header-inner {
  display: grid;
  grid-template-columns: minmax(170px, 240px) 1fr auto;
  align-items: center;
  gap: 24px;
  width: min(100%, var(--swm-max));
  min-height: var(--swm-header);
  margin: 0 auto;
  padding: 0 var(--swm-gutter);
}

.brand {
  display: inline-grid;
  gap: 2px;
  color: #fff;
}

.brand-mark {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.1;
}

.brand-sub {
  color: #c6c6c6;
  font-size: 12px;
  letter-spacing: 0.32px;
}

.primary-nav {
  justify-self: end;
}

.primary-nav ul {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.primary-nav a {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  padding: 0 14px;
  color: #c6c6c6;
  font-size: 14px;
  letter-spacing: 0.16px;
  border-bottom: 2px solid transparent;
}

.primary-nav .current-menu-item > a,
.primary-nav .current_page_item > a,
.primary-nav a:hover {
  color: #fff;
  border-bottom-color: var(--cds-interactive);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.language-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
}

.language-link,
.menu-toggle,
.button,
.wp-block-button__link,
.facet-reset {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 0;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.language-link {
  min-height: 40px;
  padding: 0 12px;
  color: #fff;
  border-color: #525252;
  font-size: 13px;
}

.language-link:hover {
  background: #262626;
  color: #fff;
  border-color: #8d8d8d;
}

.language-link.is-active {
  background: #262626;
  border-color: var(--cds-interactive);
}

.menu-toggle {
  display: none;
  width: 48px;
  background: transparent;
  color: #fff;
  border-color: #525252;
}

.menu-toggle span,
.menu-toggle::before,
.menu-toggle::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  content: "";
}

.menu-toggle {
  gap: 4px;
  flex-direction: column;
}

.button,
.wp-block-button__link {
  gap: 14px;
  padding: 13px 18px;
  background: var(--cds-interactive);
  color: #fff;
  font-weight: 600;
}

.button:hover,
.wp-block-button__link:hover {
  background: var(--cds-interactive-hover);
  color: #fff;
  transform: translateY(-1px);
}

.button.secondary {
  background: #393939;
  color: #fff;
}

.button.ghost {
  background: transparent;
  color: var(--cds-interactive);
  border-color: var(--cds-interactive);
}

.button.ghost:hover {
  background: var(--cds-interactive-soft);
  color: var(--cds-interactive-hover);
}

.button.on-dark {
  background: #fff;
  color: #161616;
}

.site-main {
  min-height: 70vh;
}

.section {
  padding: clamp(56px, 8vw, 112px) var(--swm-gutter);
}

.section.tight {
  padding-block: clamp(40px, 6vw, 72px);
}

.section.dark {
  background: var(--cds-dark);
  color: #f4f4f4;
}

.section.gray {
  background: var(--cds-layer-01);
}

.section-inner {
  width: min(100%, var(--swm-max));
  margin: 0 auto;
}

.section-kicker {
  margin: 0 0 12px;
  color: var(--cds-interactive);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.32px;
  text-transform: uppercase;
}

.dark .section-kicker {
  color: #78a9ff;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1,
.display-title {
  max-width: 940px;
  margin-bottom: 24px;
  font-size: clamp(44px, 7vw, 92px);
  font-weight: 300;
  line-height: 1.05;
}

h2 {
  max-width: 860px;
  margin-bottom: 24px;
  font-size: clamp(32px, 4.8vw, 64px);
  font-weight: 300;
  line-height: 1.12;
}

h3 {
  margin-bottom: 12px;
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 400;
  line-height: 1.25;
}

h4 {
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 600;
}

.lead {
  max-width: 720px;
  color: var(--cds-text-secondary);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.45;
}

.dark .lead,
.dark .muted {
  color: #c6c6c6;
}

.muted {
  color: var(--cds-text-secondary);
}

.hero {
  position: relative;
  display: grid;
  min-height: calc(100svh - var(--swm-header));
  isolation: isolate;
  overflow: hidden;
  background: #161616;
  color: #fff;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.88) contrast(1.05);
  transform: scale(1.02);
}

.hero::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.58) 45%, rgba(0, 0, 0, 0.18) 100%),
    linear-gradient(0deg, rgba(22, 22, 22, 0.78) 0%, transparent 45%);
  content: "";
}

.hero-content {
  display: grid;
  align-content: end;
  width: min(100%, var(--swm-max));
  min-height: inherit;
  margin: 0 auto;
  padding: clamp(64px, 8vw, 96px) var(--swm-gutter);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  gap: clamp(32px, 7vw, 96px);
  align-items: end;
}

.hero-copy {
  max-width: 900px;
}

.hero-copy .lead {
  color: #e0e0e0;
}

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

.proof-panel {
  display: grid;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.proof-item {
  padding: 18px;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(22, 22, 22, 0.42);
}

.proof-value {
  display: block;
  font-size: 32px;
  font-weight: 300;
  line-height: 1.1;
}

.proof-label {
  display: block;
  margin-top: 8px;
  color: #c6c6c6;
  font-size: 13px;
  letter-spacing: 0.16px;
}

.split-grid,
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}

.content-grid.equal {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.media-block {
  overflow: hidden;
  background: var(--cds-layer-02);
}

.media-block img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--cds-border-subtle);
}

.tile {
  display: grid;
  min-height: 260px;
  padding: 24px;
  background: #fff;
  transition: background 180ms ease, transform 180ms ease;
}

.tile:hover {
  background: var(--cds-interactive-soft);
  color: var(--cds-text-primary);
}

.tile .tile-arrow {
  align-self: end;
  color: var(--cds-interactive);
  font-family: "IBM Plex Mono", monospace;
  font-size: 22px;
}

.tile-image {
  aspect-ratio: 4 / 3;
  margin: -24px -24px 24px;
  overflow: hidden;
  background: var(--cds-layer-02);
}

.tile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.tag,
.post-categories a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  background: var(--cds-interactive-soft);
  color: var(--cds-interactive-hover);
  border-radius: 24px;
  font-size: 12px;
  letter-spacing: 0.16px;
}

.timeline {
  display: grid;
  border-top: 1px solid var(--cds-border-subtle);
}

.timeline-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--cds-border-subtle);
}

.timeline-year {
  color: var(--cds-interactive);
  font-family: "IBM Plex Mono", monospace;
}

.workflow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--cds-border-subtle);
  border-left: 1px solid var(--cds-border-subtle);
}

.workflow-step {
  min-height: 180px;
  padding: 20px;
  border-right: 1px solid var(--cds-border-subtle);
  border-bottom: 1px solid var(--cds-border-subtle);
  background: #fff;
}

.workflow-index {
  display: block;
  margin-bottom: 28px;
  color: var(--cds-interactive);
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
}

.facet-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.facet-panel {
  position: sticky;
  top: calc(var(--swm-header) + 24px);
  background: var(--cds-layer-01);
  border-top: 4px solid var(--cds-interactive);
}

.facet-panel-inner {
  padding: 20px;
}

.facet-search {
  width: 100%;
  height: 48px;
  margin-bottom: 20px;
  padding: 0 14px;
  background: #fff;
  color: var(--cds-text-primary);
  border: 0;
  border-bottom: 2px solid var(--cds-text-primary);
  border-radius: 0;
}

.facet-search:focus {
  outline: 2px solid var(--cds-interactive);
  outline-offset: 0;
}

.facet-group {
  margin: 0;
  padding: 18px 0;
  border: 0;
  border-top: 1px solid var(--cds-border-subtle);
}

.facet-group legend {
  margin-bottom: 12px;
  color: var(--cds-text-secondary);
  font-size: 12px;
  letter-spacing: 0.32px;
  text-transform: uppercase;
}

.facet-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  color: var(--cds-text-primary);
  font-size: 14px;
}

.facet-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--cds-interactive);
}

.facet-reset {
  width: 100%;
  margin-top: 8px;
  background: #393939;
  color: #fff;
}

.facet-reset:hover {
  background: #262626;
}

.facet-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--cds-border-subtle);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--cds-border-subtle);
}

.product-card {
  display: grid;
  min-height: 100%;
  background: #fff;
}

.product-card[hidden] {
  display: none;
}

.product-card-media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--cds-layer-02);
}

.product-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 240ms ease, filter 240ms ease;
}

.product-card:hover .product-card-media img {
  filter: contrast(1.04);
  transform: scale(1.035);
}

.product-card-body {
  display: grid;
  gap: 14px;
  padding: 24px;
}

.product-card h3 {
  margin-bottom: 0;
  font-size: 24px;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--cds-text-secondary);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}

.empty-state {
  display: none;
  padding: 40px;
  background: #fff;
  border: 1px solid var(--cds-border-subtle);
}

.empty-state.is-visible {
  display: block;
}

.product-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: end;
}

.product-hero-media {
  background: var(--cds-layer-01);
}

.product-hero-media img {
  width: 100%;
  max-height: 620px;
  object-fit: contain;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.spec-table th,
.spec-table td {
  padding: 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--cds-border-subtle);
}

.spec-table th {
  width: 34%;
  color: var(--cds-text-secondary);
  font-weight: 400;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--cds-border-subtle);
}

.gallery-grid .media-block {
  aspect-ratio: 4 / 3;
}

.contact-band {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
  padding: clamp(32px, 5vw, 56px);
  background: var(--cds-dark);
  color: #fff;
}

.contact-list {
  display: grid;
  gap: 14px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.contact-list li {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--cds-border-subtle);
}

.page-hero {
  background: var(--cds-layer-01);
}

.page-hero .section-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 48px;
  align-items: end;
}

.entry-content > * {
  max-width: 920px;
}

.entry-content > .alignwide,
.entry-content > .section,
.entry-content > .tile-grid,
.entry-content > .workflow,
.entry-content > .content-grid {
  max-width: none;
}

.entry-content a {
  color: var(--cds-interactive);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer {
  background: var(--cds-dark);
  color: #f4f4f4;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  width: min(100%, var(--swm-max));
  margin: 0 auto;
  padding: 56px var(--swm-gutter);
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a,
.footer-meta {
  color: #c6c6c6;
}

.footer-bottom {
  width: min(100%, var(--swm-max));
  margin: 0 auto;
  padding: 16px var(--swm-gutter) 32px;
  color: #8d8d8d;
  font-size: 13px;
  border-top: 1px solid #393939;
}

.reveal {
  opacity: 1;
  transform: none;
  transition: opacity 520ms ease, transform 520ms ease;
}

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

.hero .reveal {
  animation: swm-fade-up 640ms ease both;
}

@keyframes swm-fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@media (max-width: 1100px) {
  .header-inner {
    grid-template-columns: 1fr auto auto;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .primary-nav {
    position: fixed;
    inset: var(--swm-header) 0 auto 0;
    display: none;
    background: #161616;
    border-top: 1px solid #393939;
  }

  body.nav-open .primary-nav {
    display: block;
  }

  .primary-nav ul {
    display: grid;
    width: min(100%, var(--swm-max));
    margin: 0 auto;
    padding: 8px var(--swm-gutter) 24px;
  }

  .primary-nav a {
    justify-content: space-between;
    border-bottom-color: #393939;
  }

  .hero-grid,
  .split-grid,
  .content-grid,
  .content-grid.equal,
  .product-hero,
  .page-hero .section-inner,
  .footer-inner,
  .contact-band {
    grid-template-columns: 1fr;
  }

  .proof-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tile-grid,
  .workflow,
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .facet-shell {
    grid-template-columns: 1fr;
  }

  .facet-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  body.admin-bar .site-header {
    top: 46px;
  }

  .header-inner {
    min-height: 64px;
  }

  :root {
    --swm-header: 64px;
  }

  .language-switcher {
    display: none;
  }

  .hero {
    min-height: calc(92svh - var(--swm-header));
  }

  .hero-content {
    padding-block: 48px;
  }

  .proof-panel,
  .tile-grid,
  .workflow,
  .product-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .timeline-item,
  .contact-list li {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .facet-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-links {
    grid-template-columns: 1fr;
  }
}
