/*
Theme Name: TriHex Dynamic
Theme URI: https://trihexdynamic.com
Author: TriHex Dynamic
Description: Custom theme for TriHex Dynamic - Mechanical Design, Simulation & Engineering Automation Services.
Version: 1.0
Text Domain: trihex-dynamic
*/

:root {
  --navy: #242831;
  --navy-light: #2f3542;
  --orange: #F49F1E;
  --red: #E13124;
  --blue: #1D8ECA;
  --cyan: #1EA0D4;
  --white: #ffffff;
  --gray-bg: #F5F6F8;
  --text-dark: #242831;
  --text-gray: #5b6472;
  --border-gray: #e3e6ea;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-dark);
  background: var(--white);
  line-height: 1.6;
}

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

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

ul { margin: 0; padding: 0; list-style: none; }

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

.section { padding: 90px 0; }
.section-gray { background: var(--gray-bg); }
.section-navy { background: var(--navy); color: var(--white); }

.eyebrow {
  color: var(--orange);
  font-weight: 700;
  letter-spacing: 1.5px;
  font-size: 13px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 12px;
}

.section-title {
  font-size: 36px;
  font-weight: 700;
  margin: 0 0 16px 0;
}

.title-underline {
  width: 70px;
  height: 4px;
  background: var(--orange);
  border-radius: 2px;
  margin-bottom: 40px;
}

.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 2px solid transparent;
}
.btn-primary {
  background: var(--orange);
  color: var(--navy);
}
.btn-primary:hover { background: #ffb43e; }
.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.5);
}
.btn-outline:hover { border-color: var(--white); }

/* Header */
.site-header {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.header-bar {
  height: 5px;
  background: linear-gradient(90deg, var(--orange) 25%, var(--red) 25% 50%, var(--blue) 50% 75%, var(--cyan) 75%);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: 1180px;
  margin: 0 auto;
}
.site-logo img { height: 38px; width: auto; display: block; }
.main-nav { display: flex; align-items: center; gap: 30px; }
.main-nav ul { display: flex; gap: 36px; align-items: center; }
.lang-switch { display: flex; align-items: center; gap: 8px; }
.lang-flag {
  display: flex;
  width: 26px;
  height: 18px;
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
  opacity: 0.55;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.2);
  transition: opacity 0.2s, box-shadow 0.2s;
}
.lang-flag svg { width: 100%; height: 100%; display: block; }
.lang-flag:hover { opacity: 0.85; }
.lang-flag.active { opacity: 1; box-shadow: 0 0 0 2px var(--orange); }
.main-nav a {
  color: var(--white);
  font-weight: 500;
  font-size: 15px;
  transition: color 0.2s;
}
.main-nav a:hover { color: var(--orange); }
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Hero */
.hero {
  background: var(--navy);
  color: var(--white);
  padding: 100px 0 110px;
  position: relative;
  overflow: hidden;
}
.hero .container { position: relative; z-index: 2; }
.hero::before,
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(30deg, rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(150deg, rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 46px 80px;
  pointer-events: none;
}
.hero-eyebrow {
  color: var(--orange);
  font-weight: 700;
  letter-spacing: 2px;
  font-size: 13px;
  text-transform: uppercase;
}
.hero h1 {
  font-size: 48px;
  font-weight: 700;
  max-width: 800px;
  margin: 18px 0 24px;
  line-height: 1.2;
}
.hero-tags {
  color: #b8c0cc;
  font-size: 16px;
  margin-bottom: 40px;
}
.hero-actions { display: flex; gap: 16px; }
.hero .container > .wp-block-group__inner-container {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}
.hero-graphic { display: flex; align-items: center; justify-content: center; }
.hero-graphic svg { width: 100%; height: auto; max-width: 420px; }
@media (max-width: 860px) {
  .hero .container > .wp-block-group__inner-container { grid-template-columns: 1fr; }
  .hero-graphic { max-width: 260px; margin: 0 auto; order: -1; }
}

/* About */
.about-grid > .wp-block-group__inner-container {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  align-items: start;
}
.about-text p { color: var(--text-gray); font-size: 16px; margin-bottom: 24px; }
.about-photo { width: 100%; height: 420px; object-fit: cover; border-radius: 14px; display: block; }
@media (max-width: 860px) { .about-photo { height: 260px; } }
.about-approach h3 {
  color: var(--blue);
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.about-approach li {
  padding-left: 20px;
  position: relative;
  color: var(--text-gray);
  margin-bottom: 12px;
}
.about-approach li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  background: var(--orange);
}
.glance-card {
  background: var(--navy);
  color: var(--white);
  border-radius: 12px;
  padding: 32px;
}
.glance-card .eyebrow { color: var(--orange); }
.glance-item {
  padding-left: 16px;
  border-left: 3px solid var(--orange);
  margin-bottom: 22px;
}
.glance-item:nth-child(3) { border-color: var(--red); }
.glance-item:nth-child(4) { border-color: var(--blue); }
.glance-item:nth-child(5) { border-color: var(--cyan); }
.glance-item h4 { margin: 0 0 4px; font-size: 17px; }
.glance-item span { color: #a9b2bf; font-size: 14px; }

/* Services grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 860px) {
  .services-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
}
.service-card {
  background: var(--white);
  border: 1px solid var(--border-gray);
  border-radius: 8px;
  overflow: hidden;
  padding: 32px 24px;
  border-top: 5px solid var(--orange);
}
.service-card:nth-child(2) { border-top-color: var(--red); }
.service-card:nth-child(3) { border-top-color: var(--blue); }
.service-card:nth-child(4) { border-top-color: var(--cyan); }
.service-card:nth-child(5) { border-top-color: var(--navy); }
.service-num { color: #cfd4da; font-size: 28px; font-weight: 700; }
.service-card h3 { font-size: 19px; margin: 8px 0 16px; }
.service-card p { color: var(--text-gray); font-size: 14px; margin: 0; }

/* Workflow */
.workflow-steps {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.workflow-step { text-align: center; flex: 1; min-width: 140px; }
.workflow-circle {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 700;
  font-size: 22px;
  margin: 0 auto 16px;
}
.workflow-step:nth-child(1) .workflow-circle { background: var(--orange); }
.workflow-step:nth-child(2) .workflow-circle { background: var(--red); }
.workflow-step:nth-child(3) .workflow-circle { background: var(--blue); }
.workflow-step:nth-child(4) .workflow-circle { background: var(--cyan); }
.workflow-step:nth-child(5) .workflow-circle { background: var(--navy); }
.workflow-step h4 { margin: 0 0 6px; font-size: 17px; }
.workflow-step p { color: var(--text-gray); font-size: 13px; margin: 0; }
.workflow-note {
  text-align: center;
  color: var(--text-gray);
  font-style: italic;
  margin-top: 48px;
  font-size: 16px;
}

/* Why choose */
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.why-grid.skills-grid { grid-template-columns: repeat(2, 1fr); }
.why-card {
  background: var(--white);
  border: 1px solid var(--border-gray);
  border-radius: 10px;
  padding: 28px;
}
.why-icon {
  width: 44px;
  height: 44px;
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.why-icon svg { width: 22px; height: 22px; color: var(--white); }
.why-card:nth-child(1) .why-icon { background: var(--orange); }
.why-card:nth-child(2) .why-icon { background: var(--red); }
.why-card:nth-child(3) .why-icon { background: var(--blue); }
.why-card:nth-child(4) .why-icon { background: var(--cyan); }
.why-card:nth-child(5) .why-icon { background: var(--navy); }
.why-card:nth-child(6) .why-icon { background: var(--orange); }
.why-card h4 { margin: 0 0 10px; font-size: 17px; }
.why-card p { color: var(--text-gray); font-size: 14px; margin: 0; }
.why-card.has-image { padding: 0; overflow: hidden; }
.why-card.has-image img { width: 100%; height: 170px; object-fit: cover; display: block; }
.why-card.has-image .why-card-body { padding: 24px 24px 28px; }
.why-card.has-image .why-icon { margin-bottom: 16px; }

/* Industries */
.industries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  text-align: center;
}
.industry-card {
  background: var(--gray-bg);
  border-radius: 10px;
  padding: 32px 16px;
}
.industry-icon {
  width: 54px;
  height: 54px;
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.industry-icon svg { width: 26px; height: 26px; color: var(--white); }
.industry-card:nth-child(1) .industry-icon { background: var(--orange); }
.industry-card:nth-child(2) .industry-icon { background: var(--red); }
.industry-card:nth-child(3) .industry-icon { background: var(--blue); }
.industry-card:nth-child(4) .industry-icon { background: var(--cyan); }
.industry-card:nth-child(5) .industry-icon { background: var(--navy); }
.industry-card h4 { margin: 0; font-size: 15px; }

/* CTA / Contact */
.cta-section {
  background: var(--navy);
  color: var(--white);
  text-align: center;
  padding: 70px 0;
}
.cta-section img.logo-icon { margin: 0 auto 28px; height: 70px; }
.cta-section h2 { font-size: 34px; margin: 0 0 12px; }
.cta-section p.sub { color: #b8c0cc; margin-bottom: 40px; }
.cta-contacts {
  display: flex;
  justify-content: center;
  gap: 80px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.cta-contacts .eyebrow { color: var(--orange); margin-bottom: 8px; }
.cta-contacts a { font-weight: 600; font-size: 17px; }

/* Contact form */
.contact-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border-gray);
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  margin-bottom: 18px;
}
.contact-form label { font-weight: 600; font-size: 14px; margin-bottom: 6px; display: block; }
.contact-form textarea { min-height: 130px; resize: vertical; }
.contact-info-card {
  background: var(--navy);
  color: var(--white);
  border-radius: 12px;
  padding: 36px;
}
.contact-info-card h3 { margin-top: 0; }
.contact-info-card .item { margin-bottom: 20px; }
.contact-info-card .item span { display: block; color: var(--orange); font-size: 13px; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 4px; }
.form-notice { padding: 14px 18px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; }
.form-notice.success { background: #e6f7ee; color: #17794c; }
.form-notice.error { background: #fdeaea; color: #b3261e; }

/* Footer */
.site-footer {
  background: var(--navy-light);
  border-top: 1px solid rgba(255,255,255,0.08);
  color: #a9b2bf;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
  padding: 56px 24px 40px;
}
.footer-col h4 {
  color: var(--white);
  font-size: 14px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin: 0 0 18px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col ul a { color: #a9b2bf; font-size: 14px; transition: color 0.2s; }
.footer-col ul a:hover { color: var(--orange); }
.footer-logo-img { height: 30px; width: auto; margin: 0 0 16px; }
.footer-brand p { font-size: 14px; line-height: 1.6; margin: 0 0 20px; max-width: 320px; }
.footer-social { display: flex; gap: 10px; }
.footer-social a {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.footer-social a:hover { background: var(--orange); color: var(--navy); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 18px 0;
  text-align: center;
  font-size: 13px;
}
.footer-bottom p { margin: 0; }

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* Page header (Services/Contact top banner) */
.page-hero {
  background: var(--navy);
  color: var(--white);
  padding: 70px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-hero .container { position: relative; z-index: 2; }
.page-hero h1 { font-size: 40px; margin: 0; }
.page-hero .subtitle {
  color: #b8c0cc;
  max-width: 640px;
  margin: 18px auto 0;
  font-size: 16px;
}
.service-quicknav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}
.service-quicknav a {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.22);
  color: var(--white);
  padding: 10px 22px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.service-quicknav a:hover { background: var(--orange); border-color: var(--orange); color: var(--navy); }

/* Service detail blocks */
.service-block { scroll-margin-top: 100px; }
.service-detail > .wp-block-group__inner-container {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 56px;
  align-items: start;
}
.service-detail.reverse > .wp-block-group__inner-container { grid-template-columns: 1fr 300px; }
.service-detail.reverse .service-detail-visual { order: 2; }
.service-detail-visual {
  border-radius: 16px;
  padding: 36px 28px;
  color: var(--white);
  position: sticky;
  top: 110px;
}
.service-detail-num {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  opacity: 0.8;
  display: block;
  margin-bottom: 18px;
}
.service-detail-visual h3 { font-size: 21px; margin: 0 0 10px; line-height: 1.35; }
.service-detail-visual .visual-tag { font-size: 14px; opacity: 0.85; margin: 0; }
.service-intro { color: var(--text-gray); font-size: 16px; margin-bottom: 28px; max-width: 660px; }
.service-capabilities { margin-bottom: 28px; }
.service-capabilities li {
  padding-left: 26px;
  position: relative;
  color: var(--text-dark);
  margin-bottom: 12px;
  font-size: 15px;
}
.service-capabilities li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  top: -1px;
  color: var(--orange);
  font-weight: 700;
}
.tool-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-gray);
  margin: 0 0 10px;
}
.tool-badges { display: flex; flex-wrap: wrap; gap: 10px; }
.tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--gray-bg);
  border: 1px solid var(--border-gray);
  color: var(--text-dark);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 50px;
}
.tool-badge svg { width: 13px; height: 13px; color: var(--orange); flex-shrink: 0; }

/* Insights (blog) */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}
.insight-card {
  display: block;
  background: var(--white);
  border: 1px solid var(--border-gray);
  border-radius: 10px;
  padding: 30px 26px;
  border-top: 4px solid var(--orange);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.insight-card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(36,40,49,0.08); }
.insight-card:nth-child(2) { border-top-color: var(--blue); }
.insight-card:nth-child(3) { border-top-color: var(--red); }
.insight-date {
  color: var(--text-gray);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.insight-card h3 { font-size: 19px; margin: 12px 0 10px; }
.insight-card p { color: var(--text-gray); font-size: 14px; margin: 0 0 16px; }
.insight-readmore { color: var(--orange); font-weight: 600; font-size: 14px; }

/* Single article */
.entry-content { max-width: 760px; margin: 0 auto; color: var(--text-dark); font-size: 16px; }
.entry-content h2 { font-size: 26px; margin: 40px 0 16px; }
.entry-content h3 { font-size: 20px; margin: 32px 0 12px; }
.entry-content p { color: var(--text-gray); margin: 0 0 20px; }
.entry-content ul, .entry-content ol { margin: 0 0 20px; padding-left: 22px; }
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }
.entry-content li { color: var(--text-gray); margin-bottom: 8px; }
.entry-back { max-width: 760px; margin: 20px auto 0; }
.btn-outline-dark {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 14px;
  border: 2px solid var(--border-gray);
  color: var(--text-dark);
}
.btn-outline-dark:hover { border-color: var(--orange); color: var(--orange); }

/* FAQ accordion (native details/summary, no JS) */
.faq-list { max-width: 800px; }
.faq-item {
  border-bottom: 1px solid var(--border-gray);
  padding: 6px 0;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  padding: 16px 30px 16px 0;
  position: relative;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 14px;
  font-size: 22px;
  color: var(--orange);
}
.faq-item[open] summary::after { content: '\2212'; }
.faq-item p { color: var(--text-gray); margin: 0 0 20px; padding-right: 30px; }

@media (max-width: 860px) {
  .hero h1 { font-size: 34px; }
  .about-grid, .contact-wrap { grid-template-columns: 1fr; }
  .workflow-steps { flex-direction: column; }
  .nav-toggle { display: flex; }
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--navy);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .main-nav.open { max-height: 500px; }
  .main-nav ul { flex-direction: column; gap: 0; align-items: stretch; padding: 8px 24px 20px; }
  .main-nav li { border-top: 1px solid rgba(255,255,255,0.08); }
  /* Scoped to "ul a" (not just "a") so this doesn't also hit the .lang-flag links below,
     which live outside the <ul> — a plain ".main-nav a" rule previously collapsed the
     flag SVGs to 0 height by overriding .lang-flag's own display:flex. */
  .main-nav ul a { display: block; padding: 14px 0; }
  .main-nav .lang-switch {
    justify-content: center;
    gap: 16px;
    padding: 16px 24px 22px;
    border-top: 1px solid rgba(255,255,255,0.08);
  }
  .lang-flag { width: 30px; height: 20px; }
  .service-detail, .service-detail.reverse,
  .service-detail > .wp-block-group__inner-container,
  .service-detail.reverse > .wp-block-group__inner-container { grid-template-columns: 1fr; }
  .service-detail-visual { position: static; order: -1 !important; }
  .about-grid > .wp-block-group__inner-container { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; text-align: center; }
  .why-grid.skills-grid { grid-template-columns: 1fr; }
}
