/*
Theme Name: Charcoal Machinery
Theme URI: https://malongfei.com
Author: Malongfei
Author URI: https://malongfei.com
Description: A bold Full Site Editing theme for publishing charcoal machinery, briquette lines, carbonization systems, and industrial production solutions.
Requires at least: 6.4
Tested up to: 6.6
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: charcoalmachinery
*/

:root {
  --cm-navy: #061a3d;
  --cm-navy-2: #0b254f;
  --cm-orange: #ff5a14;
  --cm-orange-dark: #da4405;
  --cm-steel: #7f8796;
  --cm-ink: #151923;
  --cm-paper: #f5f6f8;
  --cm-line: #dfe3ea;
  --cm-white: #ffffff;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  background: var(--cm-paper);
  color: var(--cm-ink);
  margin: 0;
}

body,
h1,
h2,
h3,
h4,
p,
figure {
  margin: 0;
}

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

a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(255, 90, 20, 0.34);
  outline-offset: 4px;
}

.cm-topbar {
  background: var(--cm-navy);
  color: var(--cm-white);
  min-height: 118px;
  overflow: hidden;
  position: relative;
}

.cm-topbar::before {
  background: var(--cm-orange);
  content: "";
  inset: 0 auto 0 0;
  position: absolute;
  width: min(43vw, 760px);
}

.cm-topbar::after {
  border-bottom: 118px solid var(--cm-navy);
  border-left: 54px solid transparent;
  content: "";
  left: min(43vw, 760px);
  position: absolute;
  top: 0;
}

.cm-brand-row {
  align-items: center;
  display: flex;
  min-height: 118px;
  padding-inline: clamp(18px, 5vw, 88px);
  position: relative;
  z-index: 2;
}

.cm-brand {
  align-items: center;
  color: var(--cm-white);
  display: flex;
  gap: 18px;
}

.cm-mark {
  align-items: center;
  background: var(--cm-white);
  clip-path: polygon(50% 0, 92% 25%, 92% 72%, 50% 100%, 8% 72%, 8% 25%);
  color: var(--cm-orange);
  display: flex;
  font-weight: 900;
  height: 58px;
  justify-content: center;
  line-height: 1;
  width: 58px;
}

.cm-mark span {
  border-bottom: 8px solid currentColor;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  height: 32px;
  position: relative;
  width: 34px;
}

.cm-mark span::before {
  background: currentColor;
  content: "";
  height: 8px;
  left: 6px;
  position: absolute;
  top: 8px;
  width: 22px;
}

.cm-site-title,
.cm-site-title a {
  color: var(--cm-white);
  font-size: clamp(1.72rem, 1.4rem + 1.2vw, 2.8rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
}

.cm-tagline {
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(0.82rem, 0.78rem + 0.2vw, 1rem);
  font-weight: 800;
  line-height: 1.25;
  margin-top: 9px;
  text-transform: uppercase;
}

.cm-nav-wrap {
  background: var(--cm-white);
  border-bottom: 1px solid var(--cm-line);
  box-shadow: 0 12px 28px rgba(6, 26, 61, 0.06);
}

.cm-nav {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 82px;
  padding-inline: clamp(16px, 4vw, 72px);
}

.cm-nav .wp-block-navigation__container,
.cm-nav-menu {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: clamp(18px, 4vw, 58px);
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.cm-nav a {
  color: var(--cm-steel);
  font-size: clamp(0.95rem, 0.86rem + 0.28vw, 1.18rem);
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
}

.cm-nav a:hover,
.cm-nav a[aria-current="page"],
.cm-nav .current-menu-item > a,
.cm-nav-menu > .menu-item:nth-child(4) > a {
  color: var(--cm-orange);
}

.cm-section {
  padding: clamp(54px, 7vw, 98px) clamp(18px, 5vw, 88px);
}

.cm-inner {
  margin-inline: auto;
  max-width: 1200px;
}

.cm-hero {
  background:
    linear-gradient(90deg, rgba(6, 26, 61, 0.95), rgba(6, 26, 61, 0.82)),
    linear-gradient(135deg, #122e59 0%, #061a3d 55%, #111827 100%);
  color: var(--cm-white);
  overflow: hidden;
  padding-block: clamp(62px, 8vw, 112px);
  position: relative;
}

.cm-hero::after {
  background: var(--cm-orange);
  content: "";
  height: 100%;
  opacity: 0.96;
  position: absolute;
  right: -18vw;
  top: 0;
  transform: skewX(-23deg);
  width: min(50vw, 620px);
}

.cm-hero-grid {
  align-items: center;
  display: grid;
  gap: clamp(34px, 6vw, 78px);
  grid-template-columns: minmax(0, 1.03fr) minmax(300px, 0.97fr);
  position: relative;
  z-index: 2;
}

.cm-kicker {
  color: var(--cm-orange);
  font-size: 0.9rem;
  font-weight: 900;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.cm-hero h1 {
  color: var(--cm-white);
  font-size: clamp(2.45rem, 1.72rem + 3.4vw, 5.45rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.98;
  max-width: 820px;
  text-transform: uppercase;
}

.cm-hero p {
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(1.02rem, 0.96rem + 0.28vw, 1.22rem);
  line-height: 1.72;
  margin-top: 22px;
  max-width: 650px;
}

.cm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.cm-button .wp-block-button__link,
.cm-button-secondary .wp-block-button__link {
  border-radius: 0;
  font-weight: 900;
  padding: 15px 26px;
  text-transform: uppercase;
}

.cm-button .wp-block-button__link {
  background: var(--cm-orange);
  color: var(--cm-white);
}

.cm-button-secondary .wp-block-button__link {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.62);
  color: var(--cm-white);
}

.cm-machine-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.52);
  color: var(--cm-ink);
  padding: clamp(18px, 2.4vw, 32px);
  position: relative;
}

.cm-machine-card::before {
  background: var(--cm-orange);
  content: "";
  height: 8px;
  left: 0;
  position: absolute;
  right: 34%;
  top: 0;
}

.cm-machine-card figcaption {
  color: var(--cm-steel);
  font-size: 0.9rem;
  font-weight: 800;
  margin-top: 16px;
  text-transform: uppercase;
}

.cm-section-title {
  color: var(--cm-navy);
  font-size: clamp(2rem, 1.56rem + 1.6vw, 3.35rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.03;
  text-transform: uppercase;
}

.cm-section-lead {
  color: var(--cm-steel);
  font-size: 1.08rem;
  line-height: 1.72;
  margin-top: 16px;
  max-width: 720px;
}

.cm-heading-row {
  align-items: end;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 0.62fr);
  margin-bottom: 34px;
}

.cm-product-grid,
.cm-spec-grid,
.cm-project-grid {
  display: grid;
  gap: 22px;
}

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

.cm-spec-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.cm-card,
.cm-spec,
.cm-project {
  background: var(--cm-white);
  border: 1px solid var(--cm-line);
}

.cm-card,
.cm-project {
  padding: 0;
}

.cm-card-body,
.cm-project-body,
.cm-spec {
  padding: 24px;
}

.cm-card h3,
.cm-project h3,
.cm-spec strong {
  color: var(--cm-navy);
  display: block;
  font-size: 1.22rem;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.cm-card p,
.cm-project p,
.cm-spec span {
  color: var(--cm-steel);
  display: block;
  line-height: 1.65;
  margin-top: 10px;
}

.cm-band {
  background: var(--cm-navy);
  color: var(--cm-white);
  position: relative;
}

.cm-band::before {
  background: var(--cm-orange);
  content: "";
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: 10px;
}

.cm-band .cm-section-title,
.cm-band h2,
.cm-band h3 {
  color: var(--cm-white);
}

.cm-band p,
.cm-band li {
  color: rgba(255, 255, 255, 0.78);
}

.cm-line-grid {
  align-items: center;
  display: grid;
  gap: clamp(30px, 5vw, 72px);
  grid-template-columns: minmax(300px, 0.95fr) minmax(0, 1.05fr);
}

.cm-process {
  display: grid;
  gap: 14px;
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
}

.cm-process li {
  border-left: 4px solid var(--cm-orange);
  font-weight: 800;
  padding: 12px 0 12px 16px;
  text-transform: uppercase;
}

.cm-contact {
  background: var(--cm-orange);
  color: var(--cm-white);
}

.cm-contact .cm-section-title,
.cm-contact p {
  color: var(--cm-white);
}

.cm-contact-grid {
  align-items: center;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.cm-product-page {
  background: var(--cm-paper);
}

.cm-product-hero {
  background:
    linear-gradient(90deg, rgba(6, 26, 61, 0.95), rgba(6, 26, 61, 0.84)),
    linear-gradient(135deg, #0b254f 0%, #061a3d 58%, #151923 100%);
  color: var(--cm-white);
  overflow: hidden;
  position: relative;
}

.cm-product-hero::after {
  background: var(--cm-orange);
  content: "";
  height: 100%;
  opacity: 0.96;
  position: absolute;
  right: -20vw;
  top: 0;
  transform: skewX(-23deg);
  width: min(52vw, 660px);
}

.cm-product-hero-grid,
.cm-product-spec-band {
  align-items: center;
  display: grid;
  gap: clamp(32px, 6vw, 78px);
  grid-template-columns: minmax(0, 1.02fr) minmax(300px, 0.98fr);
  position: relative;
  z-index: 2;
}

.cm-product-hero h1 {
  color: var(--cm-white);
  font-size: clamp(2.35rem, 1.68rem + 3.1vw, 5.1rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.98;
  max-width: 820px;
  text-transform: uppercase;
}

.cm-product-hero p {
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(1.02rem, 0.96rem + 0.28vw, 1.22rem);
  line-height: 1.72;
  margin-top: 22px;
  max-width: 680px;
}

.cm-product-note {
  background: var(--cm-white);
  border-left: 8px solid var(--cm-orange);
  box-shadow: 0 16px 42px rgba(6, 26, 61, 0.08);
  padding: 24px;
}

.cm-product-note p {
  color: var(--cm-steel);
  font-weight: 800;
  line-height: 1.65;
}

.cm-product-list-section {
  padding-top: 0;
}

.cm-product-query .wp-block-post-template {
  gap: 24px;
}

.cm-product-archive-card {
  background: var(--cm-white);
  border: 1px solid var(--cm-line);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.cm-product-archive-image {
  background: #e9edf3;
  border-bottom: 1px solid var(--cm-line);
  margin: 0;
}

.cm-product-archive-image img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
}

.cm-product-archive-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 24px;
}

.cm-product-archive-body h3,
.cm-product-archive-body .wp-block-post-title {
  color: var(--cm-navy);
  font-size: 1.22rem;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.cm-product-archive-body h3 a,
.cm-product-archive-body .wp-block-post-title a {
  color: inherit;
  text-decoration: none;
}

.cm-product-archive-body h3 a:hover,
.cm-product-archive-body .wp-block-post-title a:hover {
  color: var(--cm-orange);
}

.cm-product-archive-body .wp-block-post-excerpt {
  color: var(--cm-steel);
  line-height: 1.65;
  margin-top: 12px;
}

.cm-product-archive-body .wp-block-post-excerpt__more-link {
  color: var(--cm-orange);
  display: inline-block;
  font-weight: 900;
  margin-top: 16px;
  text-decoration: none;
  text-transform: uppercase;
}

.cm-empty-products {
  background: var(--cm-white);
  border: 1px solid var(--cm-line);
  padding: clamp(28px, 4vw, 46px);
}

.cm-empty-products h3 {
  color: var(--cm-navy);
  font-size: 1.45rem;
  font-weight: 900;
  text-transform: uppercase;
}

.cm-empty-products p {
  color: var(--cm-steel);
  line-height: 1.7;
  margin-top: 10px;
}

.cm-pagination {
  gap: 12px;
  margin-top: 34px;
}

.cm-pagination a,
.cm-pagination .page-numbers {
  background: var(--cm-white);
  border: 1px solid var(--cm-line);
  color: var(--cm-navy);
  font-weight: 900;
  padding: 10px 14px;
  text-decoration: none;
}

.cm-pagination .current,
.cm-pagination a:hover {
  background: var(--cm-orange);
  border-color: var(--cm-orange);
  color: var(--cm-white);
}

.cm-footer {
  background: #071229;
  color: rgba(255, 255, 255, 0.68);
  padding: 28px clamp(18px, 5vw, 88px);
}

.cm-footer-inner {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  margin-inline: auto;
  max-width: 1200px;
}

@media (max-width: 900px) {
  .cm-topbar {
    min-height: 96px;
  }

  .cm-topbar::before {
    width: 100%;
  }

  .cm-topbar::after {
    display: none;
  }

  .cm-brand-row {
    min-height: 96px;
  }

  .cm-nav {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .cm-nav .wp-block-navigation__container,
  .cm-nav-menu {
    flex-wrap: nowrap;
    justify-content: flex-start;
    min-width: max-content;
  }

  .cm-hero-grid,
  .cm-product-hero-grid,
  .cm-product-spec-band,
  .cm-heading-row,
  .cm-line-grid,
  .cm-contact-grid {
    grid-template-columns: 1fr;
  }

  .cm-hero::after {
    bottom: -160px;
    height: 280px;
    right: -120px;
    top: auto;
    width: 360px;
  }

  .cm-product-hero::after {
    bottom: -160px;
    height: 280px;
    right: -120px;
    top: auto;
    width: 360px;
  }

  .cm-product-grid,
  .cm-spec-grid,
  .cm-project-grid {
    grid-template-columns: 1fr;
  }

  .cm-product-query .wp-block-post-template {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .cm-brand {
    gap: 12px;
  }

  .cm-mark {
    height: 46px;
    width: 46px;
  }

  .cm-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .cm-button .wp-block-button__link,
  .cm-button-secondary .wp-block-button__link {
    text-align: center;
    width: 100%;
  }
}
