/* LeChantier — bulletin-board aesthetic, TVC9 nostalgia.
   Palette: dark red #8B1A1A, yellow #ffcc00, light grey bg, white cards, black text.
   System fonts only (Arial / Helvetica). No frameworks. */

:root {
    --red: #8B1A1A;
    --red-dark: #6d1414;
    --yellow: #ffcc00;
    --bg: #e8e8e8;
    --card: #ffffff;
    --border: #cccccc;
    --text: #1a1a1a;
    --muted: #666666;
    --green: #2e7d32;
    --link: #8B1A1A;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
}

a { color: var(--link); }
a:hover { text-decoration: underline; }

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ---------- Header ---------- */
.site-header { background: var(--red); color: #fff; border-bottom: 4px solid var(--yellow); }
.header-inner { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding: 12px 16px; }
.logo { font-size: 28px; font-weight: bold; color: #fff; text-decoration: none; letter-spacing: -0.5px; }
.logo:hover { text-decoration: none; }
.logo-accent { color: var(--yellow); }
.tagline { margin: 0; font-size: 12px; color: #f0d0d0; flex: 1 1 auto; }
.lang-toggle { font-size: 13px; }
.lang-toggle a { color: #f0d0d0; text-decoration: none; }
.lang-toggle a.active { color: var(--yellow); font-weight: bold; }
.lang-toggle span { color: #c98; }

/* ---------- Nav ---------- */
.site-nav { background: var(--red-dark); }
.nav-inner { display: flex; justify-content: space-between; flex-wrap: wrap; }
.nav-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.nav-links li { margin: 0; }
.nav-links a { display: block; padding: 10px 14px; color: #fff; text-decoration: none; font-weight: bold; font-size: 14px; }
.nav-links a:hover { background: var(--red); text-decoration: none; }
.nav-user { padding: 10px 14px; color: #f0d0d0; font-weight: normal; font-size: 13px; }

/* ---------- Layout ---------- */
.main-content { padding: 20px 16px 40px; }
.layout { display: flex; gap: 20px; align-items: flex-start; }
.sidebar { flex: 0 0 230px; }
.content { flex: 1 1 auto; min-width: 0; }
@media (max-width: 720px) {
    .layout { flex-direction: column; }
    .sidebar { flex: 1 1 auto; width: 100%; }
}

/* ---------- Sponsor banner ---------- */
.sponsor-banner { text-align: center; margin: 0 0 20px; padding: 8px; background: #fff; border: 1px solid var(--border); }
.sponsor-label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 4px; }
.sponsor-banner img { max-width: 100%; height: auto; }

/* ---------- Headings ---------- */
h1 { font-size: 22px; color: var(--red); margin: 0 0 16px; border-bottom: 2px solid var(--yellow); padding-bottom: 6px; }
h2 { font-size: 17px; color: var(--red); margin: 0 0 10px; }

/* ---------- Filter sidebar ---------- */
.filter-box { background: var(--card); border: 1px solid var(--border); padding: 14px; margin-bottom: 16px; }
.filter-box h2 { margin-top: 0; }
.filter-box label { display: block; font-weight: bold; font-size: 13px; margin: 10px 0 4px; }
.filter-box select, .filter-box input { width: 100%; }
.filter-actions { margin-top: 12px; display: flex; gap: 8px; }

.type-toggle { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.type-toggle a { display: block; padding: 6px 10px; background: #f3f3f3; border: 1px solid var(--border); text-decoration: none; color: var(--text); font-size: 13px; }
.type-toggle a.active { background: var(--red); color: #fff; border-color: var(--red); font-weight: bold; }

/* ---------- Category list ---------- */
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list li a { display: flex; justify-content: space-between; padding: 5px 8px; text-decoration: none; color: var(--text); font-size: 13px; border-bottom: 1px solid #eee; }
.cat-list li a:hover { background: #f7f0f0; }
.cat-list li a.active { background: var(--red); color: #fff; font-weight: bold; }
.cat-icon { margin-right: 6px; }

/* ---------- Listing cards ---------- */
.listing-list { list-style: none; margin: 0; padding: 0; }
.listing-card { background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--red); padding: 12px 14px; margin-bottom: 10px; }
.listing-card:hover { border-left-color: var(--yellow); }
.listing-card .lc-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.listing-card h3 { margin: 0 0 4px; font-size: 16px; }
.listing-card h3 a { color: var(--red); text-decoration: none; }
.listing-card h3 a:hover { text-decoration: underline; }
.listing-meta { font-size: 12px; color: var(--muted); margin: 4px 0; }
.listing-meta .sep { margin: 0 6px; color: #bbb; }
.listing-excerpt { font-size: 14px; margin: 6px 0 0; color: #333; }
.listing-type-tag { display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 2px; font-weight: bold; text-transform: uppercase; letter-spacing: 0.5px; }
.tag-offer_work { background: var(--red); color: #fff; }
.tag-offer_service { background: var(--yellow); color: #4a3a00; }

.badge-verified { display: inline-block; background: var(--green); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 2px; font-weight: bold; }
.badge-unverified { display: inline-block; background: #ddd; color: #555; font-size: 11px; padding: 2px 7px; border-radius: 2px; }

.results-count { font-size: 13px; color: var(--muted); margin-bottom: 12px; }

/* ---------- Single listing ---------- */
.listing-detail { background: var(--card); border: 1px solid var(--border); padding: 20px; }
.listing-detail h1 { border: none; padding: 0; }
.detail-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; margin: 16px 0; padding: 14px; background: #f7f7f7; border: 1px solid var(--border); font-size: 14px; }
.detail-meta-grid .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.detail-meta-grid .value { font-weight: bold; }
.detail-description { white-space: pre-wrap; margin: 16px 0; font-size: 15px; line-height: 1.6; }

/* ---------- Buttons ---------- */
.btn { display: inline-block; padding: 9px 16px; background: var(--red); color: #fff; border: none; text-decoration: none; font-size: 14px; font-weight: bold; cursor: pointer; border-radius: 2px; font-family: inherit; }
.btn:hover { background: var(--red-dark); text-decoration: none; color: #fff; }
.btn-secondary { background: #f3f3f3; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #e4e4e4; color: var(--text); }
.btn-yellow { background: var(--yellow); color: #4a3a00; }
.btn-yellow:hover { background: #e6b800; color: #4a3a00; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-danger { background: #b00020; }
.btn-danger:hover { background: #8a0019; }

/* ---------- Forms ---------- */
.form-box { background: var(--card); border: 1px solid var(--border); padding: 22px; max-width: 560px; margin: 0 auto; }
.form-box.wide { max-width: 760px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: bold; font-size: 13px; margin-bottom: 4px; }
.form-group .help { font-size: 12px; color: var(--muted); margin-top: 3px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], select, textarea {
    width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: 2px; font-family: inherit; font-size: 14px; background: #fff;
}
textarea { min-height: 140px; resize: vertical; }
.form-row { display: flex; gap: 14px; }
.form-row > * { flex: 1; }
@media (max-width: 560px) { .form-row { flex-direction: column; gap: 0; } }
.form-actions { margin-top: 18px; }
fieldset { border: 1px solid var(--border); padding: 12px 14px; margin: 0 0 14px; }
legend { font-weight: bold; font-size: 13px; color: var(--red); padding: 0 6px; }
.radio-row label { display: inline-block; font-weight: normal; margin-right: 16px; }

/* ---------- Alerts ---------- */
.alert { padding: 10px 14px; border-radius: 2px; margin-bottom: 16px; font-size: 14px; border: 1px solid; }
.alert-error { background: #fdecea; border-color: #f5c6cb; color: #8a1f2b; }
.alert-success { background: #e7f5e9; border-color: #b6e0bd; color: #1e5e26; }
.alert-info { background: #fff8e1; border-color: #ffe7a0; color: #6b5500; }

/* ---------- NEQ inline status ---------- */
.neq-status { font-size: 13px; margin-top: 4px; font-weight: bold; min-height: 18px; }
.neq-status.ok { color: var(--green); }
.neq-status.bad { color: #b00020; }
.neq-status.pending { color: #6b5500; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 4px; flex-wrap: wrap; margin: 24px 0 0; justify-content: center; }
.pagination a, .pagination span { display: block; padding: 7px 12px; background: #fff; border: 1px solid var(--border); text-decoration: none; color: var(--text); font-size: 14px; }
.pagination a:hover { background: #f3f3f3; }
.pagination .current { background: var(--red); color: #fff; border-color: var(--red); font-weight: bold; }
.pagination .disabled { color: #bbb; }

/* ---------- Tables (admin) ---------- */
.admin-table { width: 100%; border-collapse: collapse; background: #fff; font-size: 13px; }
.admin-table th, .admin-table td { border: 1px solid var(--border); padding: 7px 9px; text-align: left; vertical-align: top; }
.admin-table th { background: var(--red); color: #fff; }
.admin-table tr:nth-child(even) td { background: #f7f7f7; }
.admin-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-nav a { padding: 8px 14px; background: #fff; border: 1px solid var(--border); text-decoration: none; color: var(--text); font-weight: bold; font-size: 13px; }
.admin-nav a.active { background: var(--red); color: #fff; border-color: var(--red); }
.stat-grid { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.stat-box { flex: 1 1 150px; background: #fff; border: 1px solid var(--border); border-top: 4px solid var(--red); padding: 16px; text-align: center; }
.stat-box .num { font-size: 30px; font-weight: bold; color: var(--red); }
.stat-box .lbl { font-size: 12px; color: var(--muted); text-transform: uppercase; }

.muted { color: var(--muted); }
.text-center { text-align: center; }
.mt { margin-top: 16px; }
