:root{--bg:#f6f9ff;--surface:#fff;--ink:#0f172a;--muted:#667085;--line:#e5e7eb;--brand:#2563eb}
*{box-sizing:border-box}
body{margin:0;background:linear-gradient(180deg,var(--bg),#fff);color:var(--ink);font:16px/1.6 Inter,system-ui,Segoe UI,Roboto}
.container{max-width:1100px;margin:0 auto;padding:16px}
.header{position:sticky;top:0;background:#ffffffd9;backdrop-filter:blur(6px);border-bottom:1px solid var(--line)}
.brand{font-weight:700}
.nav{display:flex;gap:12px}
.btn{display:inline-block;padding:10px 14px;border-radius:12px;border:1px solid #1e40af;color:#fff;background:linear-gradient(180deg,#60a5fa,#3b82f6);font-weight:600;text-decoration:none}
.input,select,textarea{width:100%;background:#fff;border:1px solid var(--line);border-radius:12px;padding:12px 14px}
.card{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:18px;box-shadow:0 8px 28px #0001}
.grid{display:grid;gap:14px}
.cols-2{grid-template-columns:repeat(2,1fr)}
.cols-4{grid-template-columns:repeat(4,1fr)}
@media(max-width:920px){.cols-4{grid-template-columns:repeat(2,1fr)}}
@media(max-width:520px){.cols-2,.cols-4{grid-template-columns:1fr}}
.ad{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:12px 0}
.ad>div{height:200px;border:2px dashed var(--line);border-radius:12px;background:#f8fafc;display:flex;align-items:center;justify-content:center;color:#94a3b8;font-weight:600}
.meta{font-size:13px;color:#667085}
.thumb{width:100px;height:100px;border:1px solid var(--line);border-radius:12px;display:flex;align-items:center;justify-content:center;overflow:hidden;background:#f8fafc}

/* Craigslist-style category columns on Home */
.catgrid{display:grid;grid-template-columns:1fr 12px 1fr 12px 1fr;gap:0}
.catgutter{width:12px}
.catcolumn table{width:100%;border-collapse:collapse;margin:0 0 8px} /* was 12px */
.catheadl{padding:3px 10px;font-weight:600;line-height:1.2}         /* was 8px */
.catheadr{padding:3px 10px;text-align:right;color:#667085;line-height:1.0}
.subcats .subrow1,
.subcats .subrow2{padding:2px 10px;line-height:1.0}                  /* was 6px */
.subcat{font-size:14px;text-decoration:none;color:inherit}            /* slightly smaller */
.catheader{border-radius:8px}
.subcats{border-radius:0 0 8px 8px}
@media(max-width:900px){.catgrid{grid-template-columns:1fr}}
/* Light hover highlight for subcategory rows */
.subcats td{ transition: background-color .12s ease }
.subcats tbody tr:hover td{ background:#f0f6ff }     /* gentle blue tint */
.subcats tbody tr:hover a.subcat{ text-decoration: underline }

/* Keyboard focus support */
.subcats a.subcat:focus-visible{
  outline:2px solid var(--brand);
  outline-offset:2px;
  border-radius:4px;
}
/* Category header background */
:root{
  --catHeaderBg:#f3f6ff;   /* tweak to taste */
  --catHeaderText:#0f172a; /* header text color */
}

.catheader{
  background:var(--catHeaderBg);
  border:1px solid var(--line);
  border-radius:8px 8px 0 0;          /* top corners only */
  overflow:hidden;
}

/* Ensure header cells pick up the background + tighter rhythm */
.catheader td{
  background:var(--catHeaderBg);
  color:var(--catHeaderText);
  padding:6px 10px;                   /* matches your tightened spacing */
  line-height:1.2;
}

/* Keep the sub-table attached visually */
.subcats{
  border:1px solid var(--line);
  border-top:0;                        /* merges with header border */
  border-radius:0 0 8px 8px;           /* bottom corners only */
}
/* Stronger category header + tighter join to subcats */
:root{
  --catHeaderBg:#d6e3ff;   /* stronger blue */
  --catHeaderText:#0b1324;
  --subHover:#e2efff;      /* stronger hover */
}

/* close the gap between header table and subcats table */
.catcolumn .catheader{ margin:0 }               /* no bottom margin on header */
.catcolumn .subcats{ margin:0 0 8px }           /* keep a small gap after the group */

.catheader{
  background:var(--catHeaderBg);
  border:1px solid var(--line);
  border-radius:8px 8px 0 0;                    /* top corners only */
  overflow:hidden;
}
.catheader td{
  background:var(--catHeaderBg);
  color:var(--catHeaderText);
  padding:6px 10px;
  line-height:1.2;
}

/* slightly stronger base striping (optional) */
.subcats .subrow1{ background:#f1f5ff }         /* was #fff */
.subcats .subrow2{ background:#edf2ff }         /* was #f8fafc */

/* stronger hover highlight across the full row */
.subcats td{ transition: background-color .12s ease }
.subcats tbody tr:hover td{ background:var(--subHover) }
.subcats tbody tr:hover a.subcat{ text-decoration: underline }

/* keep the visual merge tight */
.subcats{
  border:1px solid var(--line);
  border-top:0;                                 /* merges with header border */
  border-radius:0 0 8px 8px;                    /* bottom corners only */
}
/* 3-across, standard 300x250 ad slots */
.ad{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
  margin:12px 0;
}
.ad .slot{
  width:100%;
  max-width:300px;     /* width cap for standard size */
  min-height:250px;    /* fixed height to prevent layout shift */
  margin:0 auto;
  border:2px dashed var(--line);
  border-radius:12px;
  background:#f8fafc;
  display:flex;align-items:center;justify-content:center;
  color:#94a3b8;font-weight:600;
}

/* Mobile: stack them; keep 300x250 size */
@media(max-width:920px){
  .ad{ grid-template-columns:1fr }
}
/* make images fill the thumb box neatly */
.thumb img{width:100%;height:100%;object-fit:cover;display:block}

/* lightbox overlay */
.lb-backdrop{
  position:fixed;inset:0;background:rgba(0,0,0,.7);
  display:none;align-items:center;justify-content:center;z-index:9999;
}
.lb-backdrop.open{display:flex}
.lb-frame{max-width:min(96vw,1200px);max-height:92vh;background:#000;box-shadow:0 20px 60px rgba(0,0,0,.6);border-radius:8px;overflow:hidden}
.lb-frame img{max-width:100%;max-height:92vh;display:block}
.lb-close{
  position:absolute;top:12px;right:12px;background:#fff;border:none;border-radius:999px;
  padding:6px 10px;font-weight:700;cursor:pointer
}
