/*
Theme Name: CPE Journal
Theme URI: https://chinaplasticextrusion.com/
Author: China Plastic Extrusion Ltd.
Description: Official blog theme for chinaplasticextrusion.com — blue & white, liquid-glass navigation, matched 1:1 with the main site design system.
Version: 1.0.0
Requires at least: 5.8
Requires PHP: 7.4
License: Proprietary
Text Domain: cpe-journal
*/

/* ── Fonts (self-hosted Instrument Sans) ─────────────────────────────── */
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/instrument-0.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/instrument-1.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Instrument Sans';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/instrument-2.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Sans';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/instrument-3.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ── Design tokens (mirrors main site) ───────────────────────────────── */
:root {
  --ink: #101820;
  --ink-60: rgba(16, 24, 32, 0.6);
  --ink-40: rgba(16, 24, 32, 0.4);
  --paper: #ffffff;
  --mist: #f2f7fc;
  --blue: #035bb0;
  --blue-bright: #0a7de0;
  --blue-deep: #023a72;
  --blue-ghost: rgba(3, 91, 176, 0.08);
  --ease-out: cubic-bezier(0.215, 0.61, 0.355, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Instrument Sans', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; }
a { color: var(--blue); text-decoration: none; }

.screen-reader-text {
  position: absolute; width: 1px; height: 1px;
  clip: rect(1px, 1px, 1px, 1px); overflow: hidden;
}

/* ── Liquid glass navigation ─────────────────────────────────────────── */
.cpe-nav-wrap {
  position: fixed;
  top: 18px; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  pointer-events: none;
}
.cpe-nav {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: center;
  gap: 22px;
  width: min(1120px, 100%);
  padding: 10px 12px 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(22px) saturate(1.8);
  backdrop-filter: blur(22px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 8px 32px rgba(2, 58, 114, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  overflow: hidden;
}
/* specular sheen that follows the pointer */
.cpe-nav::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(220px circle at var(--sheen-x, 50%) 50%, rgba(255,255,255,0.55), transparent 70%);
  opacity: var(--sheen-o, 0);
  transition: opacity 0.4s var(--ease-out);
  pointer-events: none;
}
.cpe-nav .brand { display: flex; align-items: center; flex-shrink: 0; }
.cpe-nav .brand img {
  height: 36px; width: auto;
  border-radius: 8px;
  background: #fff;
  padding: 3px 8px;
  box-shadow: 0 1px 4px rgba(2, 58, 114, 0.15);
  object-fit: contain;
}
.cpe-nav .links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.cpe-nav .links a {
  position: relative;
  z-index: 1;
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-60);
  transition: color 0.25s var(--ease-out), background 0.25s var(--ease-out);
}
.cpe-nav .links a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.6); }
.cpe-nav .links a.active {
  color: var(--blue);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 2px 10px rgba(2, 58, 114, 0.10);
}
.cpe-nav .cta {
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-bright) 100%);
  box-shadow: 0 4px 14px rgba(3, 91, 176, 0.35);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}
.cpe-nav .cta:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(3, 91, 176, 0.45); color: #fff; }

.cpe-burger {
  display: none;
  position: relative; z-index: 1;
  width: 40px; height: 40px;
  border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.cpe-burger span { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .3s var(--ease-out), opacity .3s; }
.cpe-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.cpe-burger.open span:nth-child(2) { opacity: 0; }
.cpe-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.cpe-mobile-menu {
  pointer-events: auto;
  display: none;
  width: min(1120px, 100%);
  margin: 8px auto 0;
  padding: 10px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.75);
  -webkit-backdrop-filter: blur(22px) saturate(1.8);
  backdrop-filter: blur(22px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 12px 40px rgba(2, 58, 114, 0.14);
}
.cpe-mobile-menu.open { display: block; }
.cpe-mobile-menu a {
  display: block;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 500;
  color: var(--ink-60);
}
.cpe-mobile-menu a:hover { background: rgba(255,255,255,.8); color: var(--ink); }
.cpe-mobile-menu a.active { color: var(--blue); font-weight: 600; }

.cpe-nav-wrap { flex-direction: column; align-items: center; }

/* ── Page hero ───────────────────────────────────────────────────────── */
.cpe-hero {
  padding: 158px 24px 30px;
  text-align: center;
  background:
    radial-gradient(900px 400px at 50% -120px, rgba(10, 125, 224, 0.10), transparent 70%),
    var(--paper);
}
.cpe-eyebrow {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--blue-ghost);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.cpe-hero h1 {
  margin: 22px auto 14px;
  max-width: 720px;
  font-size: clamp(34px, 5.4vw, 56px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.cpe-hero p {
  margin: 0 auto;
  max-width: 560px;
  font-size: 17px;
  color: var(--ink-60);
}

/* ── Post grid ───────────────────────────────────────────────────────── */
.cpe-main { max-width: 1120px; margin: 0 auto; padding: 40px 24px 90px; }

.cpe-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
  margin-top: 26px;
}
.cpe-card {
  display: flex; flex-direction: column;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(2, 58, 114, 0.07);
  box-shadow: 0 4px 18px rgba(2, 58, 114, 0.06);
  transition: transform 0.45s var(--ease-out), box-shadow 0.45s var(--ease-out);
}
.cpe-card:hover { transform: translateY(-6px); box-shadow: 0 18px 44px rgba(2, 58, 114, 0.14); }
.cpe-card .thumb { aspect-ratio: 16 / 10; overflow: hidden; background: var(--mist); }
.cpe-card .thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.7s var(--ease-out);
}
.cpe-card:hover .thumb img { transform: scale(1.06); }
.cpe-card .body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.cpe-card .meta { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--ink-40); }
.cpe-chip {
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--blue-ghost);
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cpe-card h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.cpe-card h2 a { color: var(--ink); }
.cpe-card h2 a:hover { color: var(--blue); }
.cpe-card .excerpt { margin: 0; font-size: 14.5px; color: var(--ink-60); flex: 1; }
.cpe-card .read {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
  display: inline-flex; align-items: center; gap: 6px;
}
.cpe-card .read .arr { transition: transform 0.3s var(--ease-out); }
.cpe-card:hover .read .arr { transform: translateX(4px); }

.cpe-empty {
  text-align: center;
  color: var(--ink-60);
  padding: 60px 0;
}

/* ── Pagination ──────────────────────────────────────────────────────── */
.cpe-pagination { margin-top: 46px; text-align: center; }
.cpe-pagination .page-numbers {
  display: inline-block;
  min-width: 42px;
  padding: 9px 14px;
  margin: 0 4px;
  border-radius: 999px;
  background: var(--mist);
  color: var(--ink-60);
  font-weight: 600;
  font-size: 14px;
  transition: all 0.25s var(--ease-out);
}
.cpe-pagination .page-numbers:hover { background: var(--blue-ghost); color: var(--blue); }
.cpe-pagination .page-numbers.current {
  background: linear-gradient(135deg, var(--blue), var(--blue-bright));
  color: #fff;
}

/* ── Single article ──────────────────────────────────────────────────── */
.cpe-article-wrap { max-width: 780px; margin: 0 auto; padding: 148px 24px 90px; }
.cpe-back {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 14px; font-weight: 600; color: var(--ink-60);
  margin-bottom: 26px;
  transition: color 0.25s;
}
.cpe-back:hover { color: var(--blue); }
.cpe-article .meta { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; font-size: 13px; color: var(--ink-40); }
.cpe-article h1.cpe-title {
  margin: 0 0 26px;
  font-size: clamp(30px, 4.4vw, 42px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.cpe-cover {
  border-radius: 22px;
  overflow: hidden;
  margin-bottom: 40px;
  box-shadow: 0 16px 44px rgba(2, 58, 114, 0.13);
}
.cpe-cover img { display: block; width: 100%; }

.cpe-content { font-size: 17px; line-height: 1.85; color: rgba(16, 24, 32, 0.86); }
.cpe-content p { margin: 0 0 1.5em; }
.cpe-content h2 {
  margin: 2.1em 0 0.8em;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.cpe-content h3 { margin: 1.8em 0 0.7em; font-size: 21px; color: var(--ink); }
.cpe-content ul, .cpe-content ol { margin: 0 0 1.5em; padding-left: 0; list-style: none; }
.cpe-content li { position: relative; padding-left: 26px; margin-bottom: 0.6em; }
.cpe-content ul li::before {
  content: '';
  position: absolute; left: 4px; top: 0.72em;
  width: 8px; height: 8px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-bright));
}
.cpe-content ol { counter-reset: cpe-ol; }
.cpe-content ol li::before {
  counter-increment: cpe-ol;
  content: counter(cpe-ol) '.';
  position: absolute; left: 0;
  font-weight: 700; color: var(--blue);
}
.cpe-content a { text-decoration: underline; text-underline-offset: 3px; }
.cpe-content img { border-radius: 16px; margin: 0.5em 0; }
.cpe-content blockquote {
  margin: 0 0 1.5em;
  padding: 18px 24px;
  border-left: 3px solid var(--blue);
  background: var(--mist);
  border-radius: 0 16px 16px 0;
  color: var(--ink-60);
}
.cpe-content code {
  background: var(--mist);
  padding: 2px 7px; border-radius: 6px;
  font-size: 0.9em;
}

/* ── CTA card ────────────────────────────────────────────────────────── */
.cpe-cta-card {
  margin-top: 56px;
  padding: 40px 36px;
  border-radius: 26px;
  background:
    radial-gradient(600px 200px at 15% 0%, rgba(10, 125, 224, 0.12), transparent 70%),
    var(--mist);
  border: 1px solid rgba(2, 58, 114, 0.08);
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.cpe-cta-card h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: -0.015em; }
.cpe-cta-card p { margin: 0; color: var(--ink-60); font-size: 15px; }
.cpe-cta-card .btn {
  flex-shrink: 0;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600; font-size: 15px; color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-bright));
  box-shadow: 0 6px 18px rgba(3, 91, 176, 0.35);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}
.cpe-cta-card .btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(3, 91, 176, 0.45); color: #fff; }

/* ── Footer ──────────────────────────────────────────────────────────── */
.cpe-footer {
  border-top: 1px solid rgba(2, 58, 114, 0.08);
  padding: 40px 24px;
  text-align: center;
}
.cpe-footer nav { margin-bottom: 14px; display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 22px; }
.cpe-footer nav a { font-size: 14px; color: var(--ink-60); }
.cpe-footer nav a:hover { color: var(--blue); }
.cpe-footer p { margin: 0; font-size: 13px; color: var(--ink-40); }

/* ── Reveal animation ────────────────────────────────────────────────── */
.cpe-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.cpe-reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .cpe-reveal { opacity: 1; transform: none; transition: none; }
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .cpe-nav .links { display: none; }
  .cpe-burger { display: flex; margin-left: auto; }
  .cpe-nav .cta { display: none; }
  .cpe-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .cpe-grid { grid-template-columns: 1fr; }
  .cpe-cta-card { padding: 30px 24px; }
}
