/*
Theme Name: Transhill
Theme URI: https://transhill.com
Author: Transhill
Description: 淬山 TRANS HILL 生态无机石企业官网主题 — 支持 Elementor / Polylang 多语言
Version: 1.0.0
License: GPL-2.0+
Text Domain: transhill
*/

:root {
  --ink: #1b1b18;
  --muted: #6f716b;
  --paper: #f7f5ef;
  --surface: #ffffff;
  --line: #ddd9ce;
  --accent: #2f6f5e;
  --accent-dark: #214c42;
  --gold: #b08a48;
  --radius: 8px;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}

/* WordPress 管理栏偏移修复 */
body.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .site-header { top: 46px; } }

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

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 10px clamp(18px, 4vw, 56px);
  background: rgba(247, 245, 239, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
  font-family: 'SimSun', '宋体', 'Noto Serif SC', serif;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}
.brand-header .custom-logo {
  height: 48px;
  width: auto;
}
.brand-header .site-title {
  display: grid;
  line-height: 1.2;
  font-size: 18px;
  font-weight: 800;
}
.brand-header .site-title small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

/* ===== Navigation ===== */
#main-nav {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
}
#main-nav a,
.language-switcher a {
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  transition: transform 0.2s ease;
}
#main-nav a:hover,
#main-nav a[aria-current="page"],
#main-nav .current-menu-item > a,
.language-switcher a[aria-current="true"],
.language-switcher .current-lang a {
  color: var(--ink);
  background: #ebe7dc;
}
#main-nav a:hover,
.language-switcher a:hover {
  transform: scale(1.1);
}

.language-switcher {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu-button { display: none; }

/* ===== Hero (非 Elementor 首页使用) ===== */
.hero {
  min-height: calc(100svh - 72px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  align-items: stretch;
  border-bottom: 1px solid var(--line);
}
.hero-media { min-height: 520px; overflow: hidden; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(32px, 6vw, 72px);
  background: var(--surface);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(28px, 3.8vw, 50px); line-height: 1.25; letter-spacing: 0; font-weight: 800; }
h2 { margin: 0; font-size: clamp(24px, 3vw, 42px); line-height: 1.05; letter-spacing: 0; }
h3 { margin: 0; font-size: 18px; letter-spacing: 0; }
.lead { margin: 24px 0 0; max-width: 680px; color: var(--muted); font-size: clamp(17px, 1.8vw, 21px); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-weight: 800;
  transition: transform 0.2s ease;
  cursor: pointer;
}
.button:hover { transform: scale(1.1); }
.button.primary { color: white; background: var(--accent); border-color: var(--accent); }
.button.ghost { background: var(--surface); }

/* ===== Stats ===== */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
}
.stats article {
  padding: 26px clamp(18px, 4vw, 56px);
  border-inline-end: 1px solid var(--line);
  background: #eee9dd;
}
.stats article:last-child { border-inline-end: 0; }
.stats strong { display: block; font-size: 30px; line-height: 1; }
.stats span { color: var(--muted); font-weight: 650; }

/* ===== Sections ===== */
.section { padding: clamp(48px, 8vw, 96px) clamp(18px, 4vw, 56px); }
.section.band { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { max-width: 900px; margin-bottom: 28px; }
.section-head p { color: var(--muted); font-size: 18px; }

/* ===== Grid ===== */
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.grid.three { grid-template-columns: repeat(3, 1fr); margin-top: 24px; }
.grid.four { grid-template-columns: repeat(4, 1fr); }

/* ===== Cards ===== */
.card, .image-card, .project-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card { padding: 22px; }
.card p { color: var(--muted); }
.article { min-height: 190px; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.image-card { overflow: hidden; }
.image-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.image-card div { padding: 20px; }
.image-card p { color: var(--muted); }

.split-media {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}
.split-media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

/* ===== Table ===== */
.table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
}
.table div {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}
.table div:last-child { border-bottom: 0; }
.table span { color: var(--muted); }

/* ===== Chips ===== */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chips span {
  padding: 8px 10px;
  background: #ebe7dc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 700;
  color: var(--accent-dark);
}
.chips.compact { margin-top: 14px; }
.chips.compact span { font-size: 12px; }

/* ===== Project Grid ===== */
.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.project-card { overflow: hidden; }
.project-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.project-card div { padding: 18px; }
dl { margin: 16px 0 0; display: grid; gap: 8px; }
dl div { display: grid; grid-template-columns: 86px 1fr; gap: 8px; }
dt { color: var(--muted); font-weight: 750; }
dd { margin: 0; }

/* ===== FAQ ===== */
.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
}
.faq summary { cursor: pointer; font-weight: 800; }
.faq p { color: var(--muted); }

/* ===== Contact ===== */
.contact-panel {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
}
.contact-panel > div {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.contact-lines p {
  display: grid;
  gap: 4px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.contact-lines span,
.contact-panel li,
.contact-panel p { color: var(--muted); }

/* ===== Article Page ===== */
.article-page {
  display: grid;
  grid-template-columns: minmax(0, 860px);
  justify-content: center;
}
.article-page .section-head { margin-bottom: 36px; }
.article-body { display: grid; gap: 18px; }
.article-body section,
.article-cta {
  padding: clamp(22px, 4vw, 34px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.article-body h2,
.article-cta h2 { font-size: clamp(22px, 2.4vw, 34px); }
.article-body p,
.article-cta p { color: var(--muted); font-size: 18px; }
.article-cta { margin-top: 18px; }

/* ===== Entry Content (WordPress 编辑器) ===== */
.entry-content { line-height: 1.7; }
.entry-content h2 { margin: 32px 0 12px; }
.entry-content h3 { margin: 24px 0 8px; }
.entry-content p { margin: 0 0 16px; color: var(--muted); }
.entry-content ul, .entry-content ol { margin: 0 0 16px; padding-left: 24px; color: var(--muted); }

/* ===== Footer ===== */
.site-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
  padding: 36px clamp(18px, 4vw, 56px);
  color: white;
  background: var(--ink);
}
.site-footer p { color: #d7d2c6; margin: 4px 0; }
.site-footer a { color: white; text-decoration: underline; text-underline-offset: 4px; }

/* ===== WordPress 分页 ===== */
.nav-links { display: flex; gap: 12px; justify-content: center; padding: 24px 0; }
.nav-links a, .nav-links span { padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--radius); }
.nav-links .current { background: var(--accent); color: white; border-color: var(--accent); }

/* ===== Elementor 兼容 ===== */
.elementor-widget-container h1, .elementor-widget-container h2 { margin: 0; }
.elementor-widget-container .button { display: inline-flex; }
.elementor-page .site-header { position: sticky; }

/* ===== 响应式 ===== */
@media (max-width: 980px) {
  .site-header { grid-template-columns: auto 1fr auto; gap: 12px; }
  .brand-header .custom-logo { height: 36px; }
  .brand-header .site-title { font-size: 16px; }
  .brand-header .site-title small { font-size: 10px; }
  .menu-button {
    display: inline-flex;
    justify-content: center;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    font-weight: 800;
    cursor: pointer;
  }
  #main-nav {
    grid-column: 1 / -1;
    display: none;
    justify-content: start;
    flex-wrap: wrap;
  }
  #main-nav[data-open="true"] { display: flex; }
  #main-nav .language-switcher { grid-column: 1 / -1; }
  .hero { min-height: auto; grid-template-columns: 1fr; }
  .hero-media { min-height: 320px; }
  .stats,
  .grid.four,
  .grid.three,
  .project-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  h1 { font-size: 38px; line-height: 1; }
  .stats,
  .grid.two,
  .grid.three,
  .grid.four,
  .feature-grid,
  .split-media,
  .project-grid,
  .contact-panel { grid-template-columns: 1fr; }
  .table div { grid-template-columns: 1fr; gap: 6px; }
  .site-footer { grid-template-columns: 1fr; }
}
