/* MachFolio Design System — v1.0 */

:root {
  --color-bg: #ffffff;
  --color-surface: #f7f7f5;
  --color-border: #e2e2de;
  --color-text-primary: #1a1a18;
  --color-text-secondary: #6b6b66;
  --color-accent: #2d6a4f;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text-primary);
  background: var(--color-bg);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--color-border);
  padding: 16px 0;
}

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

.site-logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-nav a {
  font-size: 14px;
  color: var(--color-text-secondary);
  text-decoration: none;
  margin-left: 24px;
}

.site-nav a:hover {
  color: var(--color-accent);
}

/* Main */
.site-main {
  padding: 40px 0;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 24px 0;
  margin-top: 60px;
}

.site-footer p {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

/* Tier badges */
.tier-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ffffff;
  vertical-align: middle;
  margin-left: 8px;
}

.tier-badge--weekend-warrior  { background: #9e9e9e; }
.tier-badge--hobbyist          { background: #7b9e7b; }
.tier-badge--serious-hobbyist  { background: #2d6a4f; }
.tier-badge--semi-pro          { background: #1a4a6b; }
.tier-badge--professional      { background: #2d2d2d; }

/* Spec table */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-bottom: 24px;
}

.spec-table tr:nth-child(even) {
  background: var(--color-surface);
}

.spec-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border);
}

.spec-table td:first-child {
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
  width: 45%;
}

/* Section headers */
.section-header {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 6px;
  margin-bottom: 12px;
  margin-top: 28px;
}

/* Affiliate buttons */
.affiliate-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: var(--color-accent);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
  transition: opacity 0.15s ease;
}

.affiliate-btn:hover {
  opacity: 0.85;
}

.affiliate-btn-retailer {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.affiliate-btn-price {
  font-weight: 400;
  opacity: 0.9;
}

/* Entry layout */
.entry-layout {
  display: grid;
  grid-template-columns: 35% 65%;
  gap: 40px;
  margin-top: 24px;
}

@media (max-width: 768px) {
  .entry-layout {
    grid-template-columns: 1fr;
  }
}

/* Entry header */
.entry-header {
  margin-bottom: 8px;
}

.entry-title {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
}

.entry-meta {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-top: 6px;
}

.entry-meta span {
  margin-right: 12px;
}

/* Breadcrumb */
.breadcrumb {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
}

.breadcrumb a {
  color: var(--color-text-secondary);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--color-accent);
}

.breadcrumb span {
  margin: 0 6px;
}

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 24px;
}

@media (max-width: 768px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}

.entry-card {
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 16px;
  background: var(--color-bg);
  text-decoration: none;
  display: block;
  transition: border-color 0.15s ease;
}

.entry-card:hover {
  border-color: var(--color-accent);
}

.entry-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.entry-card-meta {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.entry-card-excerpt {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* Prose content */
.prose {
  font-size: 15px;
  line-height: 1.65;
  color: var(--color-text-primary);
}

.prose ul {
  padding-left: 20px;
  margin-top: 8px;
}

.prose li {
  margin-bottom: 6px;
}

/* Sourcing note */
.sourcing-note {
  font-size: 12px;
  color: var(--color-text-secondary);
  border-top: 1px solid var(--color-border);
  padding-top: 16px;
  margin-top: 40px;
  font-style: italic;
}

/* Category index page */
.category-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}

.category-title {
  font-size: 28px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.category-meta {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.no-entries {
  font-size: 15px;
  color: var(--color-text-secondary);
  margin-top: 24px;
}

/* Homepage */
.home-hero {
  padding: 48px 0 40px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 40px;
}

.home-title {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
  margin-bottom: 8px;
}

.home-tagline {
  font-size: 16px;
  color: var(--color-text-secondary);
  max-width: 520px;
}

.home-section {
  margin-bottom: 48px;
}

/* Category grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

@media (max-width: 768px) {
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.category-card {
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  text-decoration: none;
  background: var(--color-bg);
  transition: border-color 0.15s ease;
}

.category-card:hover {
  border-color: var(--color-accent);
}

.category-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.category-card-count {
  font-size: 12px;
  color: var(--color-text-secondary);
}

/* Comparison page */
.compare-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}

.compare-title {
  font-size: 26px;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.3;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
  margin-bottom: 32px;
}

.compare-table thead th {
  text-align: left;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
  border-bottom: 2px solid var(--color-border);
  width: 37.5%;
  vertical-align: bottom;
  overflow-wrap: anywhere;
}

.compare-table thead th:first-child {
  width: 25%;
}

.compare-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
  overflow-wrap: anywhere;
}

.compare-table tbody tr:nth-child(even) {
  background: var(--color-surface);
}

.compare-label {
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
}

.compare-verdict {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

@media (max-width: 768px) {
  .compare-verdict {
    grid-template-columns: 1fr;
  }
}

/* Verdict cards: contain the text and bottom-align the buy button */
.compare-verdict-block {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.compare-verdict-block .section-header {
  margin-top: 0;
}

.compare-verdict-block .prose {
  flex: 1 1 auto;
  margin-bottom: 20px;
}

.compare-verdict-block .affiliate-btn {
  margin-top: auto;
  margin-bottom: 0;
}

/* Full-entry CTAs: prominent buttons, aligned under each card */
.compare-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  padding-top: 24px;
  margin-top: 8px;
  border-top: 1px solid var(--color-border);
}

@media (max-width: 768px) {
  .compare-links {
    grid-template-columns: 1fr;
  }
}

.entry-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  border: 1px solid var(--color-accent);
  border-radius: 4px;
  color: var(--color-accent);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.entry-link-btn:hover {
  background: var(--color-accent);
  color: #ffffff;
}

/* Alternatives list */
.alt-list {
  list-style: none;
  padding-left: 0;
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.6;
}

.alt-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}

.alt-note {
  margin: 0 0 6px;
  color: var(--color-text-secondary);
}

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

.alt-list a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 600;
}

.alt-list a:hover {
  text-decoration: underline;
}

/* Guides */
.guide {
  max-width: 760px;
}

.guide-title {
  font-size: 30px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-text-primary);
  margin-bottom: 8px;
}

.guide-subtitle {
  font-size: 17px;
  color: var(--color-text-secondary);
  margin-bottom: 28px;
  line-height: 1.5;
}

.guide-body {
  font-size: 16px;
  line-height: 1.7;
}

.guide-body h2 {
  font-size: 20px;
  font-weight: 600;
  margin-top: 36px;
  margin-bottom: 12px;
  color: var(--color-text-primary);
}

.guide-body h3 {
  font-size: 17px;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 8px;
  color: var(--color-text-primary);
}

.guide-body p {
  margin-bottom: 16px;
}

.guide-body ul, .guide-body ol {
  margin-bottom: 16px;
  padding-left: 22px;
}

.guide-body li {
  margin-bottom: 6px;
}

.guide-body a {
  color: var(--color-accent);
  text-decoration: underline;
}

/* Guide recommendation callout — use with a blockquote or a div class in Markdown */
.guide-body blockquote {
  border-left: 3px solid var(--color-accent);
  background: var(--color-surface);
  padding: 16px 20px;
  margin: 24px 0;
  border-radius: 0 4px 4px 0;
}

.guide-body blockquote p:last-child {
  margin-bottom: 0;
}

/* Category filter bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
  margin: 24px 0;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
}

.filter-group select {
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-bg);
  color: var(--color-text-primary);
  cursor: pointer;
  min-width: 150px;
}

.filter-count {
  margin-left: auto;
  font-size: 13px;
  color: var(--color-text-secondary);
  align-self: center;
}

@media (max-width: 768px) {
  .filter-group select {
    min-width: 0;
    width: 100%;
  }
  .filter-group {
    flex: 1 1 45%;
  }
  .filter-count {
    margin-left: 0;
    flex-basis: 100%;
  }
}

/* Tier legend */
.tier-legend {
  max-width: 500px;
  margin: 20px 0 8px;
  padding: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--color-text-secondary);
}
.tier-legend-intro {
  display: block;
  margin-bottom: 12px;
}
.tier-legend-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}
.tier-legend-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  color: var(--color-text-secondary);
}
/* Badge sits in the fixed-width first column so all descriptors align */
.tier-legend .tier-badge {
  margin-left: 0;
  justify-self: start;
}
.tier-legend-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  color: var(--color-accent);
  text-decoration: underline;
}

/* Hamburger button — hidden on desktop, shown on mobile */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text-primary);
  border-radius: 2px;
  transition: all 0.2s ease;
}

/* Turn the bars into an X when the menu is open */
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .site-header .container {
    position: relative;
    flex-wrap: wrap;
  }

  /* Nav hidden by default on mobile, shown when .open is present */
  .site-nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    gap: 0;
    margin-top: 12px;
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    margin-left: 0;
    padding: 12px 4px;
    border-top: 1px solid var(--color-border);
    font-size: 15px;
  }
}
