/* WrenchRig.com — Design System
   Dark theme, mobile-first, big tap targets for greasy hands.
   ALL site CSS lives here. No inline styles, no second stylesheet. */

/* ========== RESET & BASE ========== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif;
  background: #121212;
  color: #f0f0f0;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: #ef4444;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #f87171;
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ========== LAYOUT ========== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

main {
  flex: 1;
  padding: 2rem 0;
}

/* ========== HEADER ========== */
.site-header {
  background: #1e1e1e;
  border-bottom: 2px solid #ef4444;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.logo {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #f0f0f0;
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
  color: #f0f0f0;
}

.logo .accent {
  color: #ef4444;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  padding: 0.625rem 1rem;
  min-height: 48px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #ccc;
  transition: background 0.2s ease, color 0.2s ease;
}

.site-nav a:hover,
.site-nav a.active {
  background: #2a2a2a;
  color: #f0f0f0;
  text-decoration: none;
}

/* ========== BREADCRUMBS ========== */
.breadcrumbs {
  padding: 1rem 0 0.5rem;
  font-size: 0.875rem;
  color: #999;
}

.breadcrumbs a {
  color: #999;
}

.breadcrumbs a:hover {
  color: #ef4444;
}

.breadcrumbs span {
  margin: 0 0.375rem;
}

/* ========== HERO ========== */
.hero {
  text-align: center;
  padding: 3rem 1rem;
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero h1 .accent {
  color: #ef4444;
}

.hero p {
  font-size: 1.125rem;
  color: #aaa;
  max-width: 640px;
  margin: 0 auto;
}

/* ========== CARDS & GRID ========== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.card {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.card:hover {
  border-color: #ef4444;
  transform: translateY(-2px);
}

.card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.card a:hover {
  text-decoration: none;
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.card h2, .card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #f0f0f0;
}

.card p {
  font-size: 0.95rem;
  color: #aaa;
  line-height: 1.5;
}

.card .tool-count {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #ef4444;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ========== TOOL LIST (inside category pages) ========== */
.tool-list {
  list-style: none;
}

.tool-list li {
  border-bottom: 1px solid #333;
}

.tool-list li:last-child {
  border-bottom: none;
}

.tool-list a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1rem;
  min-height: 64px;
  border-radius: 8px;
  color: #f0f0f0;
  transition: background 0.2s ease;
}

.tool-list a:hover {
  background: #1e1e1e;
  text-decoration: none;
}

.tool-list .tool-name {
  font-weight: 600;
  font-size: 1.05rem;
}

.tool-list .tool-desc {
  font-size: 0.875rem;
  color: #999;
}

/* ========== CALCULATOR TOOL PAGE ========== */
.tool-header {
  margin-bottom: 2rem;
}

.tool-header h1 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.tool-header p {
  font-size: 1.05rem;
  color: #aaa;
}

.calc-section {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.calc-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #333;
}

/* ========== FORM ELEMENTS ========== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #ddd;
}

.form-group .hint {
  display: block;
  font-size: 0.8rem;
  color: #888;
  margin-top: 0.25rem;
}

.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.form-row .form-group {
  flex: 1;
  min-width: 140px;
}

input[type="number"],
input[type="text"],
select {
  width: 100%;
  padding: 0.875rem 1rem;
  min-height: 52px;
  font-size: 1.1rem;
  font-family: inherit;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 10px;
  color: #f0f0f0;
  transition: border-color 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
  outline: none;
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* ========== UNIT TOGGLE ========== */
.unit-toggle {
  display: inline-flex;
  border: 1px solid #444;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.unit-toggle button {
  padding: 0.75rem 1.25rem;
  min-height: 48px;
  min-width: 80px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  background: #2a2a2a;
  color: #999;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.unit-toggle button.active {
  background: #ef4444;
  color: #fff;
}

.unit-toggle button:hover:not(.active) {
  background: #333;
  color: #f0f0f0;
}

/* ========== RESULTS ========== */
.results-card {
  background: #1a2a1a;
  border: 1px solid #2d5a2d;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.results-card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #4ade80;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.85rem;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.result-row:last-child {
  border-bottom: none;
}

.result-label {
  font-size: 0.95rem;
  color: #aaa;
}

.result-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #f0f0f0;
  font-variant-numeric: tabular-nums;
}

.result-value.highlight {
  color: #4ade80;
  font-size: 1.5rem;
}

.result-value .unit {
  font-size: 0.85rem;
  font-weight: 400;
  color: #888;
  margin-left: 0.25rem;
}

/* ========== PRODUCT RECOMMENDATIONS ========== */
.products-section {
  margin: 2rem 0;
}

.products-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.product-card {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 1.25rem;
  text-align: center;
  transition: border-color 0.2s ease;
}

.product-card:hover {
  border-color: #ef4444;
}

.product-card a {
  color: inherit;
  text-decoration: none;
}

.product-card .product-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.product-card .product-name {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #f0f0f0;
}

.product-card .product-desc {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 0.75rem;
}

.product-card .product-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  min-height: 48px;
  background: #ef4444;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.product-card .product-cta:hover {
  background: #dc2626;
  text-decoration: none;
}

/* ========== FAQ ========== */
.faq-section {
  margin: 2rem 0;
}

.faq-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.faq-item {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 10px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.faq-item summary {
  padding: 1.125rem 1.25rem;
  min-height: 56px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  list-style: none;
  color: #f0f0f0;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-right: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #ef4444;
  flex-shrink: 0;
}

.faq-item[open] summary::before {
  content: "−";
}

.faq-item .faq-answer {
  padding: 0 1.25rem 1.25rem;
  font-size: 0.95rem;
  color: #aaa;
  line-height: 1.7;
}

/* ========== FOOTER ========== */
.site-footer {
  background: #1e1e1e;
  border-top: 1px solid #333;
  padding: 2rem 0;
  margin-top: auto;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
}

.footer-section h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: #f0f0f0;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section ul a {
  color: #888;
  font-size: 0.9rem;
}

.footer-section ul a:hover {
  color: #ef4444;
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #333;
  text-align: center;
  font-size: 0.8rem;
  color: #666;
}

.footer-bottom .disclaimer {
  max-width: 700px;
  margin: 0.75rem auto 0;
  line-height: 1.5;
  font-size: 0.75rem;
}

/* ========== ADSENSE ========== */
.ad-slot {
  text-align: center;
  margin: 2rem 0;
  min-height: 90px;
  background: #1a1a1a;
  border: 1px dashed #333;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #444;
  font-size: 0.75rem;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 1.75rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .result-value {
    font-size: 1.1rem;
  }

  .result-value.highlight {
    font-size: 1.25rem;
  }

  .footer-content {
    flex-direction: column;
    gap: 1.5rem;
  }

  .site-nav {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 0.75rem;
  }

  .calc-section {
    padding: 1rem;
  }

  .card {
    padding: 1.25rem;
  }
}

/* ========== UTILITY ========== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: #888;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ========== VISUAL COMPARISON (for tire size etc.) ========== */
.comparison-visual {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  overflow-x: auto;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #333;
  font-size: 0.95rem;
}

.comparison-table th {
  font-weight: 700;
  color: #aaa;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.comparison-table td {
  color: #f0f0f0;
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.change-positive {
  color: #4ade80;
}

.change-negative {
  color: #ef4444;
}

.change-neutral {
  color: #888;
}
