/*
Theme Name: Coremet
Theme URI: https://minmets.com/
Author: Coremet Limited
Author URI: https://minmets.com/
Description: Custom theme for Coremet Limited, a global minerals and metals trading company. Ported from the original static site — wave & mountain mark, Baloo 2 wordmark, product catalogue and contact page.
Version: 1.0.0
Requires at least: 5.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: coremet
*/

/* ---------- Design tokens ---------- */
:root {
  --navy: #0e1f3c;
  --navy-soft: #16294a;
  --teal: #1f9e96;
  --teal-light: #4fc3bb;
  --bronze: #a9713f;
  --bronze-light: #c98f5c;
  --ink: #16202e;
  --muted: #55647a;
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --border: #e6e8ec;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(14, 31, 60, 0.08);
  --container: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 16px; color: var(--navy); }
h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 16px; color: var(--muted); }

.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 12px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  border: 2px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: linear-gradient(120deg, var(--teal), var(--navy));
  background-clip: padding-box;
  color: #fff;
  box-shadow: 0 8px 8px -8px rgba(14, 31, 60, 0.55);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 12px -12px rgba(14, 31, 60, 0.5); }
.btn-ghost {
  background: transparent;
  color: var(--navy);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--navy); transform: translateY(-2px); }
.btn-small { padding: 10px 20px; font-size: 0.85rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.brand { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; }
.brand-logo { height: 36px; width: auto; }
.brand-text { display: flex; flex-direction: row; align-items: baseline; gap: 8px; line-height: 1.2; }
.brand .brand-text-en, .footer-brand .brand-text-en { font-family: "Baloo 2", sans-serif; font-weight: 700; font-size: 1rem; color: var(--navy); letter-spacing: 0.01em; text-decoration: none; }
.brand .brand-text-sep, .footer-brand .brand-text-sep { font-size: 0.85rem; color: var(--muted); opacity: 0.5; text-decoration: none; }
.brand .brand-text-cn, .footer-brand .brand-text-cn { font-size: 0.85rem; color: var(--muted); font-weight: 600; text-decoration: none; }

.main-nav {
  display: flex;
  gap: 28px;
  flex: 1;
  justify-content: center;
}
.main-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  position: relative;
  padding: 6px 0;
}
.main-nav a:hover { color: var(--teal); }
.main-nav a.active { color: var(--teal); }

.nav-dropdown { position: relative; }
.dropdown-trigger { display: inline-flex; align-items: center; gap: 5px; }
.dropdown-caret { width: 10px; height: 7px; padding: 6px; box-sizing: content-box; cursor: pointer; transition: transform 0.15s ease; }
.nav-dropdown:hover .dropdown-caret,
.nav-dropdown:focus-within .dropdown-caret,
.nav-dropdown.is-open .dropdown-caret { transform: rotate(180deg); }
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 170px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 50;
}
.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu,
.nav-dropdown.is-open .dropdown-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.dropdown-menu a {
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
}
.dropdown-menu a:hover { background: var(--bg-alt); }

.header-cta { flex-shrink: 0; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--navy);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 120px 0 100px;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #ffffff;
  overflow: hidden;
}
.hero-bg::before {
  content: "";
  position: absolute;
  inset: -100px;
  background: url('assets/minmets-mark.webp') no-repeat 85% 50%;
  background-size: min(90%, 980px) auto;
  filter: blur(4px);
  opacity: 0.6;
}
.hero-inner { max-width: 780px; text-align: left; }
.hero-sub { font-size: 1.1rem; max-width: 600px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Page header (interior pages) ---------- */
.page-header {
  position: relative;
  overflow: hidden;
  padding: 90px 0 64px;
  text-align: center;
}
.page-header .hero-bg { z-index: -1; }
.page-header h1 { margin-bottom: 12px; }
.page-header .section-sub { max-width: 560px; margin: 0 auto; }

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 640px; margin: 0 auto 48px; text-align: center; }
.section-sub { font-size: 1.05rem; }
.section-cta { text-align: center; margin-top: 48px; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 64px;
  align-items: center;
}
.about-media {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 40px;
  border: 1px solid var(--border);
}
.about-logo { width: 100%; }
.about-media-photo { padding: 0; background: none; border: none; }
.about-photo {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
  box-shadow: -10px 10px 24px rgba(0, 0, 0, 0.3);
}
.about-copy p { font-size: 1.02rem; }

.link-arrow {
  color: var(--teal);
  font-weight: 700;
  text-decoration: none;
}
.link-arrow:hover { text-decoration: underline; }

/* ---------- Products ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.product-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.product-card:hover { transform: translateY(-6px); box-shadow: 0 16px 36px rgba(14, 31, 60, 0.12); }
.product-card-image { aspect-ratio: 4 / 3; overflow: hidden; }
.product-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.product-card:hover .product-card-image img { transform: scale(1.05); }
.product-card-body { padding: 24px 26px; }
.product-card-body h3 { margin-bottom: 8px; }
.product-card-body p { font-size: 0.95rem; margin-bottom: 0; }

/* ---------- Product detail (products page) ---------- */
.product-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
.product-detail-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  scroll-margin-top: 100px;
}
.product-detail-card .product-card-image { aspect-ratio: 16 / 9; overflow: hidden; }
.product-detail-card .product-card-image img { width: 100%; height: 100%; object-fit: cover; }
.product-detail-card .product-card-body { padding: 36px; }
.spec-list {
  list-style: none;
  margin: 20px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 10px;
}
.spec-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.9rem;
  color: var(--muted);
}
.spec-list b { color: var(--navy); font-weight: 600; }
.spec-list[hidden] { display: none; }

.range-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--teal);
  font-weight: 600;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
}
.range-toggle .dropdown-caret { transition: transform 0.15s ease; }
.range-toggle[aria-expanded="true"] .dropdown-caret { transform: rotate(180deg); }

.range-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.range-list[hidden] { display: none; }
.range-list li {
  position: relative;
  display: grid;
  gap: 2px;
  padding-left: 18px;
  font-size: 0.9rem;
}
.range-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
}
.range-list b { color: var(--navy); font-weight: 600; }
.range-list span { color: var(--muted); }

.feature-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.feature-list[hidden] { display: none; }
.feature-list li {
  position: relative;
  padding-left: 18px;
  font-size: 0.9rem;
  color: var(--muted);
}
.feature-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
}

/* ---------- Approach list (about page) ---------- */
.approach-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.approach-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: 0 14px 34px rgba(14, 31, 60, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.approach-item:hover { transform: translateY(-6px); box-shadow: 0 20px 44px rgba(14, 31, 60, 0.34); }
/* ---------- Value grid ---------- */
.value-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  text-align: center;
}
.value-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 14px 34px rgba(14, 31, 60, 0.28);
  padding: 32px 28px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.value-item:hover { transform: translateY(-6px); box-shadow: 0 20px 44px rgba(14, 31, 60, 0.34); }
.value-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  color: var(--navy);
}
.value-item p { font-size: 0.95rem; margin-bottom: 0; }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(120deg, var(--navy) 0%, var(--navy-soft) 60%, #12352f 100%);
  color: #fff;
  padding: 90px 0;
  text-align: center;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,0.75); max-width: 520px; margin-left: auto; margin-right: auto; }
.cta-inner { display: flex; flex-direction: column; align-items: center; }

/* ---------- Contact page ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 0.8fr;
  gap: 48px;
  align-items: start;
}
.contact-form {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
}
.form-row { display: grid; gap: 8px; }
.form-row label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy);
}
.form-row input,
.form-row textarea {
  font: inherit;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--ink);
  resize: vertical;
}
.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--teal);
  background: #fff;
}
.form-note { font-size: 0.82rem; color: var(--muted); margin: 0; }
.form-success {
  display: none;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(31, 158, 150, 0.12);
  color: var(--teal);
  font-weight: 600;
  font-size: 0.9rem;
}
.form-success.is-visible { display: block; }

.contact-info-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  display: grid;
  gap: 22px;
}
.contact-info-item dt {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 4px;
}
.contact-info-item dd {
  margin: 0;
  font-size: 1rem;
  color: var(--navy);
  font-weight: 600;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 40px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}
.footer-brand { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.footer-logo { height: 56px; width: auto; }
.footer-brand .brand-text-en { font-size: 1.5rem; }
.footer-brand .brand-text-cn { font-size: 1.15rem; }
.footer-brand .brand-text-sep { font-size: 1.15rem; }
.footer-nav { display: flex; gap: 22px; }
.footer-nav a { color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 600; }
.footer-nav a:hover { color: var(--teal); }
.footer-email { color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 600; }
.footer-email:hover { color: var(--teal); }
.footer-copy { color: var(--muted); font-size: 0.85rem; margin: 0; }

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- WP core alignment/basic content helpers ---------- */
.wp-caption, .alignleft, .alignright, .aligncenter { max-width: 100%; }
.entry-content { font-size: 1.02rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .value-grid { grid-template-columns: 1fr; }
  .product-detail-grid { grid-template-columns: 1fr; }
  .approach-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    gap: 18px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }
  .main-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .header-cta { display: none; }
  .nav-toggle { display: flex; }
  .hero { padding: 90px 0 70px; text-align: center; }
  .hero-inner { margin: 0 auto; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .product-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; text-align: center; }

  .nav-dropdown { display: flex; flex-direction: column; align-items: center; }
  .dropdown-menu {
    position: static;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 4px 0 0;
    margin-top: 4px;
    align-items: center;
    gap: 10px;
  }
  .dropdown-menu a { color: var(--muted); font-size: 0.85rem; padding: 0; }
  .dropdown-caret { display: none; }
}
