/* Front UI commun — socle institutionnel ADHA
   Utiliser ces classes progressivement sur les pages publiques.
   Objectif : titres, cartes, boutons, badges et états homogènes sans casser style.css/pages.css. */
:root{
  --front-green: var(--vert-fonce, #1A7346);
  --front-green-dark: var(--vert-tres-fonce, #0D1F1C);
  --front-green-light: var(--vert-clair, #85BB64);
  --front-bg: #f7faf7;
  --front-card-bg: #ffffff;
  --front-soft: #f1f7f2;
  --front-border: rgba(13,31,28,.12);
  --front-border-green: rgba(26,115,70,.20);
  --front-text: #183b34;
  --front-muted: #64746f;
  --front-shadow: none;
  --front-radius-lg: 18px;
  --front-radius-md: 14px;
}

.front-page{
  padding-top: 2rem;
  padding-bottom: 3.5rem;
}

.front-intro{
  max-width: 1040px;
  margin: 0 0 2rem;
  padding: 1.25rem 1.35rem 1.15rem;
  border: 1px solid var(--front-border);
  border-top: 4px solid var(--front-green);
  border-radius: 14px;
  background: #fff;
  box-shadow: none;
}

.front-intro h1,
.front-intro h2{
  position: relative;
  margin: 0 0 .65rem;
  padding-bottom: .7rem;
  color: var(--front-text);
  font-size: clamp(1.65rem, 2.5vw, 2.25rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -.02em;
  border-bottom: 1px solid var(--front-border);
}

.front-intro h1::after,
.front-intro h2::after{
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 86px;
  height: 3px;
  background: var(--front-green);
}

.front-intro p{
  max-width: 780px;
  margin-bottom: 0;
  color: var(--front-muted);
  line-height: 1.75;
}

.front-section{
  margin-top: 2.05rem;
}

.front-section-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: .75rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--front-border);
}

.front-section-head h2,
.front-section-head h3{
  position: relative;
  margin: 0;
  padding-left: .85rem;
  color: var(--front-text);
  font-size: 1.18rem;
  line-height: 1.35;
}

.front-section-head h2::before,
.front-section-head h3::before{
  content: "";
  position: absolute;
  left: 0;
  top: .24rem;
  bottom: .24rem;
  width: 4px;
  border-radius: 99px;
  background: var(--front-green);
}

.front-count,
.front-chip{
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 28px;
  padding: .25rem .65rem;
  border: 1px solid var(--front-border-green);
  border-radius: 999px;
  color: var(--front-green);
  background: var(--front-soft);
  font-size: .86rem;
  font-weight: 700;
  white-space: nowrap;
}

.front-grid{
  display: grid;
  gap: 1rem;
}

.front-grid--two{
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.front-grid--three{
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.front-card{
  position: relative;
  overflow: hidden;
  border: 1px solid var(--front-border);
  border-radius: var(--front-radius-lg);
  background: var(--front-card-bg);
  padding: 1.1rem 1.15rem;
  box-shadow: none;
}

.front-card::before{
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--front-green);
  opacity: .78;
}

.front-card-head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .75rem;
}

.front-card-title-wrap{
  min-width: 0;
  display: grid;
  gap: .4rem;
}

.front-card h3,
.front-card-title{
  margin: 0;
  color: var(--front-text);
  font-size: 1.04rem;
  line-height: 1.35;
}

.front-card-text{
  margin: 0 0 1rem;
  color: #4f6460;
  line-height: 1.65;
}

.front-meta{
  display: flex;
  flex-wrap: wrap;
  gap: .55rem 1rem;
  color: var(--front-muted);
  font-size: .9rem;
  margin-bottom: .85rem;
}

.front-ref{
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-size: .78rem;
  color: #49655d;
  border: 1px solid var(--front-border);
  border-radius: 999px;
  padding: .28rem .62rem;
  background: #fff;
}

.front-actions{
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}

.front-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--front-border-green);
  border-radius: 999px;
  background: #fff;
  color: var(--front-green);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.2;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.front-btn:hover{
  color: #fff;
  border-color: var(--front-green);
  background: var(--front-green);
}

.front-btn--primary{
  color: #fff;
  background: var(--front-green);
  border-color: var(--front-green);
}

.front-btn--primary:hover{
  background: var(--front-green-dark);
  border-color: var(--front-green-dark);
}

.front-btn--muted{
  color: var(--front-text);
  border-color: var(--front-border);
  background: #fff;
}

.front-badge{
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .18rem .55rem;
  border-radius: 999px;
  border: 1px solid var(--front-border-green);
  color: var(--front-green);
  background: var(--front-soft);
  font-size: .72rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: .02em;
}

.front-badge::before{
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}

.front-badge--success{
  color: #5f812c;
  background: #f2f8e9;
  border-color: rgba(95,129,44,.18);
}

.front-badge--muted{
  color: #68746b;
  background: #f4f7f3;
  border-color: rgba(104,116,107,.18);
}

.front-badge--warning{
  color: #8a5a10;
  background: #fff8e6;
  border-color: rgba(138,90,16,.18);
}

.front-empty{
  border: 1px dashed var(--front-border-green);
  border-radius: var(--front-radius-md);
  padding: 1rem 1.1rem;
  color: var(--front-muted);
  background: #f8fcf9;
}

html[dir="rtl"] .front-intro{
  border-left: 1px solid var(--front-border);
  border-right: 1px solid var(--front-border);
}

html[dir="rtl"] .front-intro h1::after,
html[dir="rtl"] .front-intro h2::after{
  left: auto;
  right: 0;
}

html[dir="rtl"] .front-card::before{
  inset: 0 0 0 auto;
}

html[dir="rtl"] .front-card-head,
html[dir="rtl"] .front-section-head{
  direction: rtl;
}

html[dir="rtl"] .front-section-head h2,
html[dir="rtl"] .front-section-head h3{
  padding-left: 0;
  padding-right: .85rem;
}

html[dir="rtl"] .front-section-head h2::before,
html[dir="rtl"] .front-section-head h3::before{
  left: auto;
  right: 0;
}

@media (max-width: 900px){
  .front-grid--two,
  .front-grid--three{
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px){
  .front-page{
    padding-top: 1.4rem;
  }

  .front-intro{
    padding: 1rem;
  }

  .front-card-head,
  .front-section-head{
    align-items: flex-start;
    flex-direction: column;
  }

  .front-ref,
  .front-count,
  .front-chip{
    white-space: normal;
  }
}
