:root {
  --cream: #F7F4ED;
  --ink: #152A4E;
  --bleu: #0055A4;
  --rouge: #EF4135;
  --stone: #8B8578;
  --line: #DAD4C2;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Public Sans', -apple-system, sans-serif;
}

h1, h2 { font-family: 'Fraunces', Georgia, serif; margin: 0; }

/* ===== Header ===== */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
  border-bottom: 2px solid var(--ink);
  background: var(--cream);
}
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.logo svg { width: 42px; height: 42px; }
.logo-text { font-family: 'Fraunces', serif; font-weight: 600; font-size: 18px; line-height: 1.1; }
.logo-text span { color: var(--rouge); }
nav { display: flex; gap: 28px; }
nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
nav a:hover { color: var(--bleu); }
.btn-deposer {
  background: var(--ink); color: var(--cream); padding: 10px 20px;
  border-radius: 4px; text-decoration: none; font-weight: 600;
}
.btn-deposer:hover { background: var(--bleu); }

/* ===== Flash messages ===== */
.flash { padding: 14px 40px; font-weight: 500; }
.flash-succes { background: #E1F0D8; color: #2E6B1F; }
.flash-erreur { background: #FBE0DD; color: #A32E20; }

/* ===== Hero ===== */
.hero {
  display: flex; align-items: center; justify-content: space-between;
  padding: 60px 40px; gap: 40px; flex-wrap: wrap;
}
.hero h1 { font-size: 42px; line-height: 1.15; max-width: 560px; }
.hero h1 em { color: var(--rouge); font-style: normal; }
.hero p { max-width: 480px; color: var(--stone); font-size: 16px; margin-top: 16px; }

.cachet {
  width: 160px; height: 160px; border-radius: 50%;
  border: 4px double var(--ink);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background:
    repeating-linear-gradient(90deg, var(--bleu) 0 8px, transparent 8px 16px, var(--rouge) 16px 24px, transparent 24px 32px);
  position: relative;
}
.cachet-inner {
  width: 120px; height: 120px; border-radius: 50%; background: var(--cream);
  border: 2px solid var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.cachet .num { font-family: 'IBM Plex Mono', monospace; font-size: 34px; font-weight: 600; }
.cachet .sub { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--stone); }

/* ===== Recherche ===== */
.search-wrap { padding: 0 40px 30px; }
.search-bar {
  display: flex; gap: 10px; background: white; padding: 12px;
  border: 2px solid var(--ink); border-radius: 6px; max-width: 800px; flex-wrap: wrap;
}
.search-bar input, .search-bar select {
  flex: 1; min-width: 140px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 4px; font-family: inherit; font-size: 14px;
}
.search-bar button {
  background: var(--rouge); color: white; border: none; padding: 10px 24px;
  border-radius: 4px; font-weight: 600; cursor: pointer;
}
.search-bar button:hover { background: #d43327; }

/* ===== Categories ===== */
.cats { padding: 20px 40px 40px; }
.cats-head h2 { font-size: 24px; margin-bottom: 18px; }
.cat-grid { display: flex; gap: 14px; flex-wrap: wrap; }
.cat-tab {
  display: flex; align-items: center; gap: 8px;
  background: white; border: 1px solid var(--line); padding: 12px 18px;
  border-radius: 30px; text-decoration: none; color: var(--ink); font-weight: 500;
}
.cat-tab:hover { border-color: var(--bleu); color: var(--bleu); }
.emoji { font-size: 18px; }

/* ===== Listings ===== */
.listings { padding: 20px 40px 60px; }
.listings-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 22px; }
.listings-head h2 { font-size: 24px; }
.listings-head a { color: var(--bleu); text-decoration: none; font-weight: 600; }
.vide { color: var(--stone); }
.vide a { color: var(--bleu); }

.listing-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px;
}
.card {
  background: white; border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden; text-decoration: none; color: var(--ink);
  position: relative; transition: transform 0.15s, box-shadow 0.15s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(21,42,78,0.12); }
.card .photo {
  height: 160px; background: #EFEAE0; display: flex; align-items: center; justify-content: center;
  color: var(--stone); font-size: 13px; overflow: hidden;
}
.card .photo img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 14px; border-top: 1px dashed var(--line); }
.card .price { font-family: 'IBM Plex Mono', monospace; font-weight: 600; color: var(--rouge); font-size: 18px; }
.card .title { font-weight: 600; margin: 6px 0 4px; }
.card .meta { color: var(--stone); font-size: 13px; }

/* ===== Page titre generique ===== */
.page-head { padding: 40px 40px 0; }
.page-title { font-size: 32px; }

/* ===== Formulaire ===== */
.form-wrap { max-width: 640px; margin: 0 auto; padding: 40px 20px 80px; }
.form-sous-titre { color: var(--stone); margin-top: 6px; }
.annonce-form { margin-top: 26px; display: flex; flex-direction: column; gap: 6px; }
.annonce-form label { font-weight: 600; margin-top: 14px; font-size: 14px; }
.annonce-form input, .annonce-form select, .annonce-form textarea {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px;
  font-family: inherit; font-size: 15px; background: white;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-separateur {
  margin-top: 28px; padding-top: 16px; border-top: 2px dashed var(--line);
  font-family: 'Fraunces', serif; font-weight: 600; font-size: 18px;
}
.btn-publier {
  margin-top: 26px; background: var(--rouge); color: white; border: none;
  padding: 16px; border-radius: 6px; font-weight: 700; font-size: 16px; cursor: pointer;
}
.btn-publier:hover { background: #d43327; }

/* ===== Detail annonce ===== */
.detail-wrap { max-width: 1100px; margin: 0 auto; padding: 30px 40px 80px; }
.retour { color: var(--bleu); text-decoration: none; font-weight: 600; }
.detail-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; margin-top: 24px; }
.photo-principale {
  border-radius: 8px; overflow: hidden; height: 380px; background: #EFEAE0;
  display: flex; align-items: center; justify-content: center; color: var(--stone);
}
.photo-principale img { width: 100%; height: 100%; object-fit: cover; }
.photo-miniatures { display: flex; gap: 10px; margin-top: 10px; }
.photo-miniatures img { width: 70px; height: 70px; object-fit: cover; border-radius: 6px; }
.detail-categorie {
  display: inline-block; background: var(--bleu); color: white; font-size: 12px;
  padding: 5px 12px; border-radius: 20px; font-weight: 600; text-transform: uppercase;
}
.detail-titre { font-size: 30px; margin-top: 14px; }
.detail-prix { font-family: 'IBM Plex Mono', monospace; font-size: 30px; color: var(--rouge); font-weight: 600; margin-top: 10px; }
.detail-meta { display: flex; gap: 18px; color: var(--stone); margin-top: 14px; font-size: 14px; flex-wrap: wrap; }
.detail-description, .detail-contact { margin-top: 26px; padding-top: 20px; border-top: 1px dashed var(--line); }
.detail-description h2, .detail-contact h2 { font-size: 18px; margin-bottom: 8px; }
.detail-description p { line-height: 1.6; color: #3a3a3a; }
.btn-supprimer {
  margin-top: 30px; background: none; border: 1px solid var(--rouge); color: var(--rouge);
  padding: 10px 18px; border-radius: 6px; cursor: pointer; font-weight: 600;
}
.btn-supprimer:hover { background: var(--rouge); color: white; }

/* ===== 404 ===== */
.page-404 { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 80px 20px; gap: 20px; }

/* ===== Footer ===== */
footer {
  border-top: 2px solid var(--ink); padding: 30px 40px; text-align: center;
  color: var(--stone); font-size: 13px;
}
.foot-brand { font-family: 'Fraunces', serif; font-weight: 600; color: var(--ink); font-size: 16px; margin-bottom: 6px; }
.bars { display: flex; height: 4px; width: 100px; margin: 14px auto 0; }
.bars div { flex: 1; }

@media (max-width: 800px) {
  header { padding: 14px 20px; flex-wrap: wrap; gap: 12px; }
  .hero { padding: 40px 20px; }
  .search-wrap, .cats, .listings, .page-head, .detail-wrap { padding-left: 20px; padding-right: 20px; }
  .detail-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
