:root{
  --cnorme-red: #9a090c;
  --cnorme-dark:#222;
  --cnorme-light:#f7f7f7;
}

/* Filter form */
.cnorme-filters { margin: 16px 0; padding: 12px; border-radius:10px; background:#fff; box-shadow:0 6px 18px rgba(0,0,0,0.04); }
.cnorme-filter-row { display:flex; flex-wrap:wrap; gap:12px; align-items:flex-end; }
.cnorme-filter-row label { display:flex; flex-direction:column; font-size:0.9rem; }
.cnorme-filter-row input[type="text"], .cnorme-filter-row input[type="number"], .cnorme-filter-row select { padding:8px; border:1px solid #ddd; border-radius:6px; min-width:140px; }

/* Grid */
.cnorme-projets-grid{
  display:grid;
  grid-template-columns: repeat(3,1fr);
  gap:20px;
  margin:12px 0;
}

/* Card */
.cnorme-projet-card{
  background:#fff;
  border-radius:10px;
  box-shadow:0 6px 18px rgba(0,0,0,0.06);
  overflow:hidden;
  cursor:pointer;
  display:flex;
  flex-direction:column;
  transition:transform .18s ease, box-shadow .18s ease;
  border:1px solid rgba(0,0,0,0.04);
}
.cnorme-projet-card:hover{
  transform:translateY(-6px);
  box-shadow:0 12px 28px rgba(0,0,0,0.08);
}

/* Media box with badge - no overlay */
.card-media{
  width:100%;
  height:260px; /* légèrement augmenté pour netteté */
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
  background: #f3f3f3;
}
.card-media img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  -webkit-backface-visibility: hidden;
  image-rendering: auto;
  transform: translateZ(0);
}
.cnorme-placeholder{ width:100%; height:100%; display:block; background:linear-gradient(90deg,#eee,#ddd); }

/* Badge statut top-right */
.cnorme-badge{
  position:absolute;
  top:10px;
  right:10px;
  background:var(--cnorme-red);
  color:#ffffff;
  padding:6px 10px;
  font-size:0.78rem;
  font-weight:700;
  border-radius:999px;
  box-shadow:0 6px 12px rgba(0,0,0,0.12);
  text-transform:capitalize;
  z-index:5;
}

/* Body */
.card-body{ padding:12px; display:flex; flex-direction:column; gap:8px; min-height:150px; }
.project-title{ margin:0 0 6px 0; font-size:1.02rem; color:var(--cnorme-dark); line-height:1.2; }

/* Meta lines compact (each on own row) */
.project-meta{ display:block; color:#666; font-size:0.95rem; margin:0 0 6px 0; }
.project-meta .meta-line{ display:flex; align-items:center; gap:8px; margin:4px 0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.meta-icon{ display:inline-block; width:16px; height:16px; flex:0 0 16px; color:#9b9b9b; }
.meta-text{ display:inline-block; overflow:hidden; text-overflow:ellipsis; }

/* Excerpt + actions - compact, align boutons en bas */
.cnorme-projet-card .project-excerpt {
    margin-top: 8px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #555;

    /* Rendu propre sur 3 lignes max */
    display: -webkit-box;
    -webkit-line-clamp: 3;        /* nb de lignes visibles */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;

    /* Assure une hauteur stable, même si texte court */
    min-height: calc(1.5em * 3);
    max-height: calc(1.5em * 3);
}

.card-actions{ margin-top:auto; display:flex; justify-content:flex-end; gap:8px; }

/* CTA */
.btn{ display:inline-flex; align-items:center; gap:8px; padding:6px 10px; border-radius:8px; text-decoration:none; font-weight:600; font-size:0.92rem; }
.btn-view{ background:transparent; color:var(--cnorme-red); border:1px solid rgba(154,9,12,0.12); padding:6px 10px; }


/* Pagination premium */
.cnorme-pagination{
  margin-top:24px;
  text-align:center;
}
.cnorme-pagination ul{
  list-style:none;
  margin:0;
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
  gap:8px;
}
.cnorme-pagination .page-numbers{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:34px;
  height:34px;
  padding:0 10px;
  border-radius:999px; /* pills */
  border:1px solid rgba(0,0,0,0.06);
  background:#ffffff;
  text-decoration:none;
  font-size:0.9rem;
  font-weight:500;
  color:#555;
  box-shadow:0 4px 10px rgba(0,0,0,0.04);
  transition:
    background-color .15s ease,
    color .15s ease,
    box-shadow .15s ease,
    transform .15s ease,
    border-color .15s ease;
}
.cnorme-pagination .page-numbers.current{
  background:var(--cnorme-red);
  color:#ffffff;
  border-color:var(--cnorme-red);
  box-shadow:0 6px 16px rgba(0,0,0,0.16);
  transform:translateY(-1px);
}
.cnorme-pagination .page-numbers:hover:not(.current){
  border-color:var(--cnorme-red);
  color:var(--cnorme-red);
  box-shadow:0 6px 14px rgba(0,0,0,0.10);
  transform:translateY(-1px);
}
.cnorme-pagination .page-numbers.prev,
.cnorme-pagination .page-numbers.next{
  padding:0 14px;
  font-size:0.85rem;
}


/* Single project page */
.cnorme-single{ max-width:1100px; margin:30px auto; display:grid; grid-template-columns: 1fr 380px; gap:24px; padding:0 16px; box-sizing:border-box; }
.cnorme-gallery{ border-radius:12px; overflow:hidden; }
.cnorme-main-image{ width:100%; height:auto; max-height:720px; object-fit:cover; display:block; border-radius:8px; -webkit-backface-visibility: hidden; image-rendering: auto; }

/* thumbs */
.cnorme-thumbs{ display:flex; gap:8px; margin-top:12px; flex-wrap:wrap; }
.cnorme-thumb{ width:64px; height:64px; overflow:hidden; border-radius:8px; cursor:pointer; flex:0 0 64px; border:2px solid transparent; transition: border-color .12s ease; }
.cnorme-thumb img{ width:100%; height:100%; object-fit:cover; }
.cnorme-thumb.active{ border-color:var(--cnorme-red); }

/* Side panel */
.cnorme-side{ background:#fff; padding:16px; border-radius:12px; box-shadow:0 8px 20px rgba(0,0,0,0.04); }
.action-btn{ display:block; width:100%; padding:12px; text-align:center; border-radius:10px; font-weight:700; margin-bottom:10px; text-decoration:none; color:#fff; }
.action-contact{ background:var(--cnorme-red); }
.action-whatsapp{ background:#25D366; }

/* Modal */
.cnorme-modal{ position:fixed; inset:0; display:none; align-items:center; justify-content:center; z-index:9999; }
.cnorme-modal.active{ display:flex; }
.cnorme-modal-backdrop{ position:absolute; inset:0; background:rgba(0,0,0,0.5); }
.cnorme-modal-content{ position:relative; width:100%; max-width:640px; background:#fff; border-radius:12px; padding:20px; z-index:2; box-sizing:border-box; }
.cnorme-modal-close{ position:absolute; right:12px; top:12px; background:transparent; border:none; font-size:20px; cursor:pointer; }

.cnorme-form-row input,
.cnorme-form-row textarea{ width:100%; padding:10px; border-radius:8px; border:1px solid #ddd; box-sizing:border-box; margin-bottom:8px; }

/* Responsive */
@media (max-width: 1100px){
  .cnorme-projets-grid{ grid-template-columns: repeat(2,1fr); }
  .cnorme-main-image{ max-height:520px; }
}

@media (max-width: 700px){
  .cnorme-projets-grid{ grid-template-columns: 1fr; }
  .card-media{ height:180px; }
  .cnorme-single{ grid-template-columns: 1fr; }
}
