/*
Theme Name: TorqMax
Theme URI: https://inqulm.com
Author: TorqMax Project
Description: TorqMax industrial dark theme — custom theme for the TorqMax machinery catalog and inquiry site. Dark surfaces with orange/yellow accents. Data lives in the torqmax-core plugin; this theme only presents it.
Version: 0.2.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: torqmax
*/

/* ============ Design tokens ============ */
:root {
  --bg:        #0d1117;
  --bg-panel:  #161c24;
  --bg-card:   #1a222d;
  --bg-hover:  #212b38;
  --border:    #2a3442;
  --text:      #e6eaf0;
  --text-dim:  #9aa7b8;
  --accent:    #f97316;
  --accent-2:  #fbbf24;
  --accent-dark:#c2410c;
  --ok:        #22c55e;
  --danger:    #ef4444;
  --radius:    10px;
  --container: 1200px;
  --space:     8px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

/* ============ Base ============ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.25; margin: 0 0 12px; }
h1 { font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3vw, 2.1rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 16px; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* ============ Buttons ============ */
.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 8px;
  font-weight: 700;
  font-size: .95rem;
  border: 0;
  cursor: pointer;
  transition: transform .12s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-accent { background: var(--accent); color: #0d1117 !important; }
.btn-accent:hover { background: var(--accent-2); }
.btn-ghost { background: transparent; color: var(--text) !important; border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-2) !important; }

/* ============ Header ============ */
.site-header {
  background: rgba(13, 17, 23, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}
.brand { font-size: 1.35rem; font-weight: 800; letter-spacing: .5px; color: var(--text) !important; }
.brand em { font-style: normal; color: var(--accent); }
.main-nav ul { list-style: none; display: flex; gap: 22px; margin: 0; padding: 0; }
.main-nav a { color: var(--text-dim); font-weight: 600; font-size: .95rem; }
.main-nav a:hover, .main-nav .current-menu-item a, .main-nav .current_page_item a { color: var(--accent-2); }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 8px 12px; font-size: 1.2rem; cursor: pointer; }

/* ============ Hero ============ */
.hero {
  padding: 90px 0 110px;
  background:
    radial-gradient(ellipse at 75% 20%, rgba(249, 115, 22, .14), transparent 55%),
    radial-gradient(ellipse at 15% 90%, rgba(251, 191, 36, .08), transparent 50%),
    var(--bg);
  border-bottom: 1px solid var(--border);
}
.hero h1 { max-width: 760px; }
.hero h1 .hl { color: var(--accent); }
.hero p.lead { font-size: 1.15rem; color: var(--text-dim); max-width: 640px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; }
.hero-stats { display: flex; gap: 48px; flex-wrap: wrap; margin-top: 46px; }
.stat b { display: block; font-size: 1.7rem; color: var(--accent-2); }
.stat span { color: var(--text-dim); font-size: .9rem; }

/* ============ Sections ============ */
.section { padding: 70px 0; }
.section-alt { background: var(--bg-panel); border-block: 1px solid var(--border); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 34px; }
.section-head h2 { margin: 0; }
.section-sub { color: var(--text-dim); max-width: 620px; }

/* ============ Category cards ============ */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.cat-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 22px;
  transition: border-color .15s ease, transform .15s ease;
  color: var(--text) !important;
}
.cat-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.cat-card .cat-count { display: inline-block; margin-top: 10px; font-size: .8rem; color: var(--accent-2); border: 1px solid var(--border); padding: 2px 10px; border-radius: 999px; }
.cat-card h3 { margin: 0 0 6px; }

/* ============ Product grid ============ */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .15s ease, transform .15s ease;
}
.product-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.product-card .thumb { aspect-ratio: 4 / 5; background: #0f141b; display: flex; align-items: center; justify-content: center; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: contain; }
.product-card .thumb .ph { color: var(--text-dim); font-size: .85rem; text-align: center; padding: 16px; }
.product-card .pbody { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; gap: 8px; }
.product-card .pmodel { color: var(--accent-2); font-size: .78rem; letter-spacing: .4px; font-weight: 700; }
.product-card h3 { font-size: .98rem; margin: 0; line-height: 1.4; }
.product-card .pdesc { color: var(--text-dim); font-size: .85rem; margin: 0; }
.product-card .pfoot { margin-top: auto; padding-top: 10px; }
.product-card .pfoot a { font-weight: 700; font-size: .88rem; }

/* ============ Product detail ============ */
.pd-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: start; }
.pd-media { border: 1px solid var(--border); border-radius: var(--radius); background: #0f141b; padding: 18px; }
.pd-media img { width: 100%; height: auto; object-fit: contain; margin: 0 auto; }
.pd-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.pd-gallery a { display: block; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #0f141b; transition: border-color .2s, transform .2s; }
.pd-gallery a:hover { border-color: var(--accent); transform: translateY(-2px); }
.pd-gallery img { aspect-ratio: 1/1; object-fit: cover; }
.pd-model { color: var(--accent-2); font-weight: 700; letter-spacing: .5px; }
.spec-table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: .93rem; }
.spec-table th, .spec-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.spec-table th { width: 38%; color: var(--text-dim); font-weight: 600; }
.spec-table td { color: var(--text); }
.pd-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.faq details { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 14px 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p { margin: 10px 0 0; color: var(--text-dim); }

/* ============ Features ============ */
.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.feat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.feat .ico { font-size: 1.6rem; margin-bottom: 8px; }
.feat h3 { margin: 0 0 6px; }
.feat p { color: var(--text-dim); margin: 0; font-size: .92rem; }

/* ============ CTA band ============ */
.cta-band { text-align: center; padding: 60px 20px; background: linear-gradient(120deg, rgba(249,115,22,.12), rgba(251,191,36,.06)), var(--bg-panel); border-top: 1px solid var(--border); }

/* ============ Footer ============ */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0; font-size: .9rem; color: var(--text-dim); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; }
.site-footer h4 { color: var(--text); margin: 0 0 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.footer-bottom { margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ============ Page / breadcrumbs ============ */
.page-hero { padding: 46px 0 40px; border-bottom: 1px solid var(--border); background: var(--bg-panel); }
.page-hero h1 { margin: 0 0 6px; }
.page-hero .crumb { color: var(--text-dim); font-size: .85rem; margin-bottom: 10px; }
.breadcrumbs { font-size: .85rem; color: var(--text-dim); margin-bottom: 8px; }
.breadcrumbs a { color: var(--text-dim); }
.breadcrumbs a:hover { color: var(--accent-2); }

/* ============ Blog / post list & pagination ============ */
.post-list .post-item { border-bottom: 1px solid var(--border); padding: 20px 0; }
.pagination { display: flex; gap: 8px; margin-top: 30px; }
.pagination a, .pagination span { border: 1px solid var(--border); padding: 6px 14px; border-radius: 6px; color: var(--text-dim); }
.pagination .current { background: var(--accent); color: #0d1117; border-color: var(--accent); font-weight: 700; }

/* ============ Forms (contact placeholder) ============ */
.tm-form input[type="text"], .tm-form input[type="email"], .tm-form input[type="tel"], .tm-form textarea, .tm-form select {
  width: 100%; background: var(--bg-card); border: 1px solid var(--border); color: var(--text);
  padding: 12px 14px; border-radius: 8px; font-size: .95rem; margin-bottom: 14px; font-family: inherit;
}
.tm-form input:focus, .tm-form textarea:focus { outline: none; border-color: var(--accent); }
.tm-form label { display: block; margin-bottom: 6px; font-weight: 600; font-size: .9rem; }
.tm-form .field { margin-bottom: 4px; }

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .pd-layout { grid-template-columns: 1fr; gap: 26px; }
  .footer-grid { grid-template-columns: 1fr; }
  .nav-toggle { display: block; }
  .main-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg-panel); border-bottom: 1px solid var(--border); padding: 14px 20px 20px; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: 14px; }
  .hero { padding: 60px 0 80px; }
  .section { padding: 50px 0; }
}
@media (max-width: 520px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .product-card .pbody { padding: 10px 12px 12px; }
  .hero-actions .btn { width: 100%; text-align: center; }
  .hero-stats { gap: 24px; }
}
/* ============ v0.2 design polish (2026-08) ============ */
::selection { background: var(--accent); color: #0d1117; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Header: shadow once scrolled */
.site-header { transition: box-shadow .2s ease, background .2s ease; }
.site-header.scrolled { box-shadow: 0 8px 28px rgba(0,0,0,.4); background: rgba(13,17,23,.97); }

/* Nav link underline animation */
.main-nav a { position: relative; }
.main-nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; border-radius: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .22s ease; }
.main-nav a:hover::after, .main-nav .current-menu-item a::after, .main-nav .current_page_item a::after { transform: scaleX(1); }

/* Buttons */
.btn { box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.btn-accent { background: linear-gradient(135deg, #f97316, #ea580c); box-shadow: 0 6px 20px rgba(249,115,22,.28); }
.btn-accent:hover { background: linear-gradient(135deg, #fb923c, #f97316); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(249,115,22,.34); }
.btn-accent:active { transform: translateY(0); box-shadow: 0 4px 12px rgba(249,115,22,.3); }
.btn-ghost:hover { transform: translateY(-2px); background: rgba(249,115,22,.06); }

/* Hero: faint engineering grid + stat dividers */
.hero {
  background:
    linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px),
    radial-gradient(ellipse at 75% 20%, rgba(249,115,22,.16), transparent 55%),
    radial-gradient(ellipse at 15% 90%, rgba(251,191,36,.09), transparent 50%),
    var(--bg);
  background-size: 44px 44px, 44px 44px, auto, auto, auto;
}
.hero .lead { font-size: 1.18rem; }
.hero-stats .stat { position: relative; }
.hero-stats .stat + .stat::before { content: ""; position: absolute; left: -24px; top: 12%; height: 76%; width: 1px; background: var(--border); }
.stat b { font-size: 1.9rem; letter-spacing: .5px; }

/* Section eyebrows */
.eyebrow { margin: 0 0 8px; font-size: .76rem; font-weight: 800; letter-spacing: 2.5px; text-transform: uppercase; color: var(--accent-2); }
.section-head { display: flex; align-items: flex-end; gap: 16px; }
.section-head h2 { margin: 0; }

/* Category cards */
.cat-card { position: relative; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.cat-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
.cat-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0,0,0,.35); }
.cat-card:hover::before { transform: scaleX(1); }
.cat-card h3 { font-size: 1.05rem; }
.cat-card .cat-count { transition: border-color .2s, color .2s; }
.cat-card:hover .cat-count { border-color: var(--accent); color: var(--text); }

/* Product cards */
.product-card { box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.product-card:hover { transform: translateY(-4px); box-shadow: 0 14px 32px rgba(0,0,0,.42); border-color: rgba(249,115,22,.55); }
.product-card .thumb { position: relative; overflow: hidden; }
.product-card .thumb img { transition: transform .45s ease; }
.product-card:hover .thumb img { transform: scale(1.06); }
.product-card .pmodel { display: inline-block; align-self: flex-start; background: rgba(251,191,36,.1); border: 1px solid rgba(251,191,36,.28); padding: 2px 9px; border-radius: 999px; }
.product-card h3 a { transition: color .15s ease; }
.product-card h3 a:hover { color: var(--accent-2); }
.product-card .pfoot a { color: var(--accent-2); transition: color .15s ease; border-bottom: 1px solid transparent; }
.product-card .pfoot a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* Product detail */
.pd-overview { max-width: 860px; margin: 0 0 30px; padding: 16px 20px; border-left: 3px solid var(--accent); background: var(--bg-card); border-radius: 0 var(--radius) var(--radius) 0; font-size: 1.04rem; color: var(--text); }
.pd-media { box-shadow: 0 6px 24px rgba(0,0,0,.3); }
.spec-table th { width: 34%; }
.spec-table tr:nth-child(odd) td { background: rgba(255,255,255,.02); }
.spec-table tr:hover td { background: rgba(249,115,22,.05); }
.spec-table th, .spec-table td { transition: background .15s ease; }

/* FAQ */
.faq details { transition: border-color .2s ease, background .2s ease; }
.faq details:hover { border-color: var(--border); }
.faq details[open] { border-color: rgba(249,115,22,.45); background: #1b2531; }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.3rem; line-height: 1; color: var(--accent-2); transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }

/* Page hero accent line */
.page-hero { position: relative; }
.page-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: linear-gradient(90deg, var(--accent), transparent 70%); opacity: .7; }

/* Breadcrumbs */
.breadcrumbs > * + *::before { content: "›"; margin: 0 8px; color: var(--text-dim); opacity: .7; }
.breadcrumbs a { color: var(--text-dim); }
.breadcrumbs a:hover { color: var(--accent-2); }
.breadcrumbs span { color: var(--text); }

/* CTA band as a card */
.cta-band { padding: 34px 20px; background: transparent; border-top: 1px solid var(--border); }
.cta-band .container { background: linear-gradient(135deg, rgba(249,115,22,.14), rgba(251,191,36,.05)), var(--bg-card); border: 1px solid var(--border); border-radius: 18px; padding: 48px 34px; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.cta-band h2 { margin-top: 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); }
.site-footer h4 { color: var(--accent-2); }
.site-footer a { color: var(--text-dim); transition: color .15s ease; }
.site-footer a:hover { color: var(--accent-2); }
.footer-bottom { color: var(--text-dim); }

/* Pagination */
.pagination a:hover { background: var(--bg-hover); color: var(--text); border-color: var(--accent); }
.pagination .current { background: linear-gradient(135deg, #f97316, #ea580c); color: #0d1117; border-color: transparent; box-shadow: 0 4px 12px rgba(249,115,22,.3); }

/* Scrollbar (webkit) */
::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--border); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; transform: none !important; }
  html { scroll-behavior: auto; }
}

/* Related products: 4-up like the archive */
@media (min-width: 901px) {
  .related-grid { grid-template-columns: repeat(4, 1fr); }
}
