/*
Theme Name: HVAC Best
Theme URI: https://hvac.best
Author: HVAC Best
Author URI: https://hvac.best
Description: The Wikipedia of HVAC — dark industrial design for the world's HVAC intelligence hub.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: Proprietary
Text Domain: hvacbest
*/

/* ============================================================
   CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  --steel:       #0d1117;
  --steel-mid:   #161b22;
  --steel-light: #21262d;
  --pipe:        #e36b1a;
  --pipe-dim:    #8c3d08;
  --cold:        #1db8e8;
  --cold-dim:    #0a6a87;
  --white:       #f0f6fc;
  --muted:       #8b949e;
  --border:      #30363d;
  --green:       #39d353;

  /* Semantic aliases */
  --bg:          var(--steel);
  --bg-surface:  var(--steel-mid);
  --bg-elevated: var(--steel-light);
  --accent:      var(--pipe);
  --cyan:        var(--cold);
  --text:        var(--white);
  --subtext:     var(--muted);

  --font-head:  'Bebas Neue', sans-serif;
  --font-body:  'IBM Plex Sans', sans-serif;
  --font-mono:  'IBM Plex Mono', monospace;

  --radius:     4px;
  --radius-md:  6px;
  --radius-lg:  8px;
  --max-w:      1200px;
  --transition: 0.2s ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--steel);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Noise overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 999;
  opacity: 0.4;
}

img, video { max-width: 100%; height: auto; display: block; }

a { color: var(--cold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--white); }

ul, ol { list-style: none; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.1;
  color: var(--white);
}

h1 { font-size: clamp(2.5rem, 6vw, 5rem); }
h2 { font-size: clamp(1.8rem, 4vw, 3rem); }
h3 { font-size: clamp(1.4rem, 3vw, 2rem); }
h4 { font-size: 1.25rem; }

p { margin-bottom: 1rem; }

code, pre, kbd, samp { font-family: var(--font-mono); font-size: 0.9em; }

pre {
  background: var(--steel-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
}

blockquote {
  border-left: 3px solid var(--pipe);
  padding-left: 1.25rem;
  color: var(--muted);
  font-style: italic;
  margin: 1.5rem 0;
}

hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

.section      { padding: 5rem 0; }
.section--sm  { padding: 3rem 0; }
.section--lg  { padding: 7rem 0; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary {
  background: var(--pipe);
  color: var(--white);
}
.btn--primary:hover {
  background: #f07c30;
  transform: translateY(-1px);
  color: var(--white);
}

.btn--outline {
  background: transparent;
  color: var(--cold);
  border: 1px solid var(--cold-dim);
}
.btn--outline:hover {
  border-color: var(--cold);
  background: rgba(29,184,232,0.08);
  color: var(--cold);
}

.btn--ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn--ghost:hover { border-color: var(--cold); color: var(--cold); }

/* ============================================================
   SITE HEADER / TOPBAR
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: var(--steel);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 56px;
}

.site-logo {
  font-family: var(--font-head);
  font-size: 1.8rem;
  letter-spacing: 0.06em;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
}
.site-logo .logo-dot  { color: var(--pipe); }
.site-logo .logo-best { color: var(--cold); }

.topbar-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.topbar-links a { color: var(--muted); text-decoration: none; transition: color var(--transition); }
.topbar-links a:hover { color: var(--white); }

.topbar-right { display: flex; align-items: center; gap: 1rem; }

.btn-ghost-sm {
  padding: 0.4rem 1rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all var(--transition);
  text-decoration: none;
  display: inline-block;
}
.btn-ghost-sm:hover { border-color: var(--cold); color: var(--cold); }
.btn-ghost-sm.hot   { border-color: var(--pipe-dim); color: var(--pipe); }
.btn-ghost-sm.hot:hover { border-color: var(--pipe); background: rgba(227,107,26,0.08); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.hamburger span { display: block; width: 22px; height: 2px; background: var(--white); transition: all var(--transition); }

.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--steel-mid);
  border-top: 1px solid var(--border);
  padding: 1rem 2rem;
  gap: 0.25rem;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}
.mobile-nav a:hover { color: var(--white); }

/* ============================================================
   GLOSSARY TICKER
   ============================================================ */
.ticker-wrap {
  overflow: hidden;
  background: var(--steel-light);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.7rem 0;
}

.ticker {
  display: flex;
  animation: ticker 40s linear infinite;
  white-space: nowrap;
}

.ticker-item {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0 2.5rem;
  color: var(--muted);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.ticker-item .term { color: var(--pipe); }
.ticker-item.cold-item .term { color: var(--cold); }

@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============================================================
   SITE FOOTER
   ============================================================ */
.site-footer {
  background: var(--steel-mid);
  border-top: 1px solid var(--border);
  padding: 4rem 0 2rem;
}

.footer-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand .footer-logo {
  font-family: var(--font-head);
  font-size: 2rem;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  display: block;
  color: var(--white);
  text-decoration: none;
}
.footer-brand .footer-logo .logo-dot  { color: var(--pipe); }
.footer-brand .footer-logo .logo-best { color: var(--cold); }

.footer-brand p {
  font-size: 0.83rem;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.7;
  max-width: 280px;
}

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.2rem;
  font-weight: 400;
}

.footer-col ul { display: flex; flex-direction: column; gap: 0.6rem; }
.footer-col a { font-size: 0.85rem; color: var(--muted); text-decoration: none; transition: color var(--transition); }
.footer-col a:hover { color: var(--white); }

.footer-bottom {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem 2rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ============================================================
   CONTENT AREA (inner pages)
   ============================================================ */
.content-wrapper {
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.page-title {
  font-family: var(--font-head);
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.entry-content h1, .entry-content h2,
.entry-content h3, .entry-content h4 { margin: 2rem 0 0.75rem; }
.entry-content p { color: var(--muted); margin-bottom: 1.25rem; }
.entry-content a { color: var(--cold); }
.entry-content a:hover { color: var(--pipe); }
.entry-content ul, .entry-content ol { list-style: revert; padding-left: 1.5rem; margin-bottom: 1.25rem; }
.entry-content li { color: var(--muted); margin-bottom: 0.4rem; }

.entry-content table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; font-size: 0.9rem; }
.entry-content th { background: var(--steel-mid); color: var(--white); font-family: var(--font-head); letter-spacing: 0.05em; padding: 0.75rem 1rem; text-align: left; border: 1px solid var(--border); }
.entry-content td { padding: 0.65rem 1rem; border: 1px solid var(--border); color: var(--muted); }
.entry-content tr:nth-child(even) td { background: var(--steel-mid); }

/* ============================================================
   404 PAGE
   ============================================================ */
.error-404 { text-align: center; padding: 8rem 2rem; }
.error-404__code { font-family: var(--font-head); font-size: 10rem; line-height: 1; color: var(--border); margin-bottom: 1rem; }
.error-404__title { font-size: 2.5rem; margin-bottom: 1rem; }
.error-404__desc { color: var(--muted); margin-bottom: 2rem; }

/* ============================================================
   ARCHIVE / BLOG
   ============================================================ */
.archive-header { padding: 3rem 0 2rem; border-bottom: 1px solid var(--border); margin-bottom: 3rem; }

.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; }

.post-card { background: var(--steel-mid); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; transition: border-color var(--transition), transform var(--transition); }
.post-card:hover { border-color: var(--pipe); transform: translateY(-2px); }
.post-card__thumb { aspect-ratio: 16/9; overflow: hidden; }
.post-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card__body { padding: 1.25rem; }
.post-card__cat { font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--pipe); margin-bottom: 0.5rem; }
.post-card__title { font-family: var(--font-head); font-size: 1.3rem; margin-bottom: 0.5rem; letter-spacing: 0.04em; }
.post-card__title a { color: var(--white); }
.post-card__title a:hover { color: var(--pipe); }
.post-card__excerpt { font-size: 0.85rem; color: var(--muted); font-weight: 300; }

/* ============================================================
   KADENCE BLOCKS COMPATIBILITY
   ============================================================ */
.wp-block-kadence-rowlayout { max-width: none !important; }
.kt-svg-icon-wrap svg { fill: currentColor; }

/* ============================================================
   WORDPRESS CORE ALIGNMENT
   ============================================================ */
.alignfull { width: 100vw; margin-left: calc(50% - 50vw); }
.alignwide { max-width: 1100px; margin-left: auto; margin-right: auto; }
.aligncenter { text-align: center; margin: 0 auto; }
.alignright { float: right; margin: 0 0 1rem 1.5rem; }
.alignleft { float: left; margin: 0 1.5rem 1rem 0; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 768px) {
  .topbar-links { display: none; }
  .topbar-right .btn-ghost-sm:first-child { display: none; }
  .hamburger { display: flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; gap: 0.75rem; text-align: center; }
}

@media (max-width: 480px) {
  .container { padding: 0 1rem; }
  .topbar { padding: 0 1rem; }
  .footer-grid { grid-template-columns: 1fr; padding: 0 1rem; }
  .footer-bottom { padding: 2rem 1rem 0; }
}
