:root {
  --bg:      #f7f5f2;
  --surface: #ffffff;
  --border:  #e2ddd8;
  --text:    #1a1a1a;
  --muted:   #888;
  --accent:  #c0233e;
  --green:   #c9922a;
  --yellow:  #8a6500;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Sans', sans-serif;
  min-height: 100vh;
}

/* ── HEADER ── */
.site-header {
  border-bottom: 2px solid var(--text);
  padding: 32px 24px 24px;
  max-width: 960px;
  margin: 0 auto;
}

.site-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 64px;
  letter-spacing: 3px;
  line-height: 1;
  color: var(--text);
  text-decoration: none;
  display: block;
}

.site-title span { color: #c9922a; }

.tagline {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 6px;
}

.search-block {
  margin-top: 20px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  outline: none;
  transition: border-color 0.15s;
}

.search-input:focus { border-color: var(--accent); }

.sbtn {
  padding: 10px 16px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}

.sbtn:hover { opacity: 0.85; }
.sbtn-site   { background: var(--text);   color: var(--bg); }
.sbtn-ebay   { background: #e53238;       color: #fff; }
.sbtn-amazon { background: #ff9900;       color: #000; }

.search-buttons { display: contents; }

/* ── CATEGORY NAV ── */
.cat-nav {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.cat-nav-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 4px;
}

.cat-pill {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s;
}

.cat-pill:hover, .cat-pill.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* ── MAIN LAYOUT ── */
.site-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  align-items: start;
}

/* ── DIRECTORY ROWS ── */
.dir-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--text);
}

.dir-header h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 40px;
  letter-spacing: 2px;
}

.dir-header p {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.6;
}

.col-headers {
  display: flex;
  justify-content: space-between;
  padding: 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  gap: 12px;
}

.col-headers .col-item  { flex: 1; }
.col-headers .col-ship  { min-width: 80px; text-align: right; }
.col-headers .col-links { min-width: 40px; }
.col-headers .col-value { min-width: 100px; text-align: right; }

.dir-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 7px 4px;
  border-bottom: 1px dotted var(--border);
  gap: 12px;
  text-decoration: none;
  color: inherit;
  transition: background 0.1s;
}

.dir-row:hover { background: #f0ece6; }
.dir-row:hover .item-name { color: var(--accent); }

.item-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: color 0.15s;
  flex: 1;
  min-width: 0;
}

.item-excerpt {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 2px;
  white-space: normal;
}

.item-ship {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 80px;
  max-width: 120px;
  text-align: right;
  padding-top: 2px;
}

.item-links { display: flex; gap: 6px; flex-shrink: 0; }

.item-link {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  padding: 2px 7px;
  border-radius: 2px;
  transition: opacity 0.15s;
  white-space: nowrap;
  cursor: pointer;
}

.item-link:hover { opacity: 0.75; }

.item-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 100px;
  max-width: 140px;
  text-align: right;
  padding-top: 1px;
}

.val-green { color: var(--green); }
.val-yellow { color: var(--yellow); }
.val-red  { color: var(--accent); }

/* ── PAGINATION ── */
.pagination {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
}

.pagination a {
  color: var(--accent);
  text-decoration: none;
}

.pagination a:hover { text-decoration: underline; }

/* ── POST PAGE ── */
.post-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--text);
}

.post-breadcrumb {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}

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

.post-breadcrumb a:hover { text-decoration: underline; }

.post-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 40px;
  letter-spacing: 2px;
  line-height: 1.1;
}

.post-price {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 22px;
  font-weight: 600;
  color: var(--green);
  margin-top: 10px;
}

.post-content p.price { display: none; }

.post-content { font-size: 15px; line-height: 1.7; }

.post-content p { margin-bottom: 1em; }

/* ── SIDEBAR ── */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 20px;
}

.card h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.decision-row {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dotted var(--border);
  font-size: 13px;
  line-height: 1.4;
  align-items: flex-start;
}

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

.decision-if {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  margin-top: 1px;
  min-width: 28px;
}

.decision-then { font-size: 13px; color: var(--text); }
.decision-then strong { color: var(--accent); }
.decision-then .go { color: var(--green); font-weight: 600; }

.ship-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dotted var(--border);
  font-size: 13px;
}

.ship-row:last-child { border-bottom: none; }
.ship-cost { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--muted); font-weight: 600; }

.cat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.cat-grid-link {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text);
  text-decoration: none;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg);
  transition: all 0.15s;
  display: block;
}

.cat-grid-link:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* ── FOOTER ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  max-width: 960px;
  margin: 0 auto;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.7;
}

.site-footer a { color: var(--muted); }

/* ── GHOST CARD WIDTHS ── */
.kg-width-wide {
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

.kg-width-full {
  max-width: 100%;
  width: 100%;
}

/* ── RESPONSIVE ── */

/* Tablet: collapse sidebar */
@media (max-width: 700px) {
  .site-main { grid-template-columns: 1fr; gap: 32px; }
  .sidebar { position: static; }
}

/* Mobile: 375px and up */
@media (max-width: 480px) {

  /* Header */
  .site-header { padding: 18px 16px 16px; }
  .site-title { font-size: 44px; letter-spacing: 2px; }
  .tagline { font-size: 10px; letter-spacing: 1px; }

  /* Search — input full width, buttons side-by-side below */
  .search-block { flex-direction: column; gap: 6px; }
  .search-input { min-width: 0; width: 100%; }
  .search-buttons { display: flex; gap: 6px; }
  .sbtn { flex: 1; padding: 11px 8px; font-size: 10px; text-align: center; }

  /* Category nav */
  .cat-nav { padding: 10px 16px; gap: 5px; }
  .cat-pill { font-size: 10px; padding: 4px 8px; }

  /* Main layout */
  .site-main { padding: 20px 16px; gap: 24px; }

  /* Directory header */
  .dir-header h1 { font-size: 28px; }
  .post-title { font-size: 28px; }

  /* Column headers — hide ship and links, keep item + value */
  .col-headers .col-ship,
  .col-headers .col-links { display: none; }

  /* Item rows: name on its own line, badge + value on second line */
  .dir-row {
    flex-wrap: wrap;
    align-items: center;
    padding: 10px 4px;
    gap: 4px 8px;
  }
  .item-name {
    flex-basis: 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    font-size: 13px;
    line-height: 1.3;
  }
  .item-ship { display: none; }
  .item-links { flex-shrink: 0; }
  .item-link { font-size: 10px; padding: 3px 8px; }
  .item-value {
    margin-left: auto;
    min-width: 0;
    font-size: 12px;
  }

  /* Sidebar */
  .card { padding: 16px; }
  .cat-grid { grid-template-columns: 1fr 1fr 1fr; }

  /* Footer */
  .site-footer { padding: 16px; font-size: 10px; }
}
