/* =========================
   CleanBit — Initiatives
   Single-source styles (no duplicates)
   ========================= */

:root{
  --cb-bg: lavender;
  --cb-card: rgba(255,255,255,0.96);
  --cb-stroke: rgba(17,24,39,0.10);
  --cb-soft: rgba(17,24,39,0.06);
  --cb-text: #111827;
  --cb-muted: rgba(17,24,39,0.72);
  --cb-muted2: rgba(17,24,39,0.60);
  --cb-accent: #0b6cff;
  --cb-accent2: rgba(11,108,255,0.18);
  --cb-shadow: 0 10px 26px rgba(0,0,0,0.10);
  --cb-radius: 16px;
}

body{
  background: var(--cb-bg);
}

/* page container */
.initiatives-wrap{
  max-width: 1200px;
  margin: 0 auto;
  padding: 5px 20px 20px 20px;
}

/* loading state for ajax container */
#initContainer.is-loading{
  opacity: .65;
  pointer-events: none;
  transition: opacity .12s ease;
}

/* =========================
   Hero (H1 + subtitle)
   ========================= */
.init-hero{
  text-align: center;
  /* padding: 28px 0 14px; */
}


.init-title {
  background: linear-gradient(
	90deg,
	#0f0f0f,   /* почти чёрный */
	#1e293b,   /* тёмно-синий */
	#22c55e,   /* зелёный */
	#eab308,   /* жёлтый */
	#dc2626,   /* красный */
	#0f0f0f    /* опять почти чёрный — закрывает «петлю» */
  );
  background-size: 300% 100%;         /* фон шире текста */
  background-position: 0% 50%;

  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;

  animation: gradient-flow 12s linear infinite alternate;
  font-size: clamp(8px, 6vw, 38px);
  font-weight: 700;
  letter-spacing: .03em;
  margin: 0;
}

@keyframes gradient-flow {
  0%   { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

.init-title::after{
  content: "";
  display: block;
  width: 80%;
  height: 4px;
  margin: 14px auto 0;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(60,120,255,0),
    rgba(60,120,255,.55),
    rgba(60,120,255,0)
  );
}

.init-sub{
  margin: 9px auto;
  max-width: 740px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--cb-muted);
  text-indent: 0; /* убираем красную строку */
}

/* =========================
   Featured section
   ========================= */
.featured-wrap{
  margin: 18px 0 22px;
  padding: 18px 16px 20px;
  border: 1px solid var(--cb-accent2);
  border-radius: 18px;
  background: aquamarine;
  box-shadow: 0 12px 28px rgba(0,0,0,0.08);
  backdrop-filter: blur(6px);
}

.featured-head{
  text-align: center;
  margin-bottom: 14px;
}

.featured-title{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid mediumaquamarine;
  background: beige;
  box-shadow: 0 10px 22px rgba(0,0,0,0.06);
}

.featured-icon{
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(11,108,255,0.16);
  font-size: 16px;
  line-height: 1;
}

.featured-text{
  font-weight: 900;
  font-size: 20px;
  color: var(--cb-text);
  letter-spacing: .2px;
}

.featured-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

/* =========================
   List wrapper (New initiatives)
   ========================= */
.list-wrap{
  background: rgba(255,255,255,0.92);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 12px 30px rgba(0,0,0,.10);
  margin: 0 auto 22px;
  border: 1px solid rgba(17,24,39,0.06);
}

.list-head{
  margin-bottom: 14px;
}

.list-title{
  font-weight: 900;
  font-size: 22px;
  text-align: center;
  color: var(--cb-text);
}

/* =========================
   Controls: search / sort / chips
   ========================= */
.list-controls{
  margin: 8px 0 14px;
}

.controls-row{
  display: flex;
  gap: 12px;
  align-items: center;
}

.ctrl-search{
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(245,246,251,0.85);
  border: 1px solid var(--cb-stroke);
  border-radius: 12px;
  padding: 10px 12px;
}

.ctrl-ico{ opacity: .6; }

.ctrl-search input{
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: 15px;
  color: var(--cb-text);
  text-indent: 0;
}

.ctrl-sort{
  min-width: 190px;
  background: rgba(245,246,251,0.85);
  border: 1px solid var(--cb-stroke);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 800;
  color: var(--cb-text);
}

.ctrl-clear{
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 8px;
  opacity: .55;
}

.ctrl-clear:hover{
  opacity: .9;
  background: rgba(0,0,0,.05);
}

.ctrl-clear.is-hidden{ display: none; }

.chips-row{
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.chip{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(245,246,251,0.85);
  border: 1px solid var(--cb-stroke);
  font-weight: 900;
  color: var(--cb-text);
  cursor: pointer;
}

.chip:hover{
  background: rgba(255,255,255,0.92);
  border-color: rgba(11,108,255,0.22);
}

.chip.active{
  background: rgba(11,108,255,0.12);
  border-color: rgba(11,108,255,0.40);
  color: var(--cb-text);
}

/* =========================
   Cards grid
   ========================= */
.initiatives-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 14px;
}

.initiative-card{
  background: var(--cb-card);
  border-radius: var(--cb-radius);
  box-shadow: var(--cb-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
  border: 1px solid rgba(17,24,39,0.10);
}

.initiative-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(0,0,0,0.14);
}

.initiative-cover{
  position: relative;
}

.initiative-cover img{
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.initiative-card.featured .initiative-cover img{
  height: 170px;
}

.cat-badge{
  position: absolute;
  bottom: 12px;
  left: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .3px;
  box-shadow: 0 10px 18px rgba(0,0,0,.18);
  background: rgba(11,108,255,0.85);
  color: #fff;
}

.initiative-body{
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.initiative-title{
  font-size: 20px;
  font-weight: 900;
  margin: 0;
  color: var(--cb-text);
  text-indent: 0;
}

.initiative-desc{
  font-size: 15px;
  line-height: 1.5;
  color: rgba(17,24,39,0.88);
  text-indent: 0;
}

.initiative-geo{
  font-size: 14px;
  color: var(--cb-muted2);
  margin-top: auto;
}

/* actions */
.initiative-actions{
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.btn{
  flex: 1;
  padding: 10px 14px;
  border-radius: 12px;
  text-align: center;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  border: none;
}

.btn-primary{
  background: var(--cb-accent);
  color: #fff;
}

.btn-primary:hover{
  filter: brightness(0.92);
}

/* =========================
   Pager
   ========================= */
.pager{
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  padding: 16px 0 6px;
}

.pg-btn, .pg-num{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  background: rgba(243,244,246,0.92);
  text-decoration: none;
  font-weight: 900;
  color: var(--cb-text);
  box-shadow: 0 6px 14px rgba(0,0,0,.08);
  border: 1px solid rgba(17,24,39,0.08);
  cursor: pointer;
}

.pg-num.active{
  background: var(--cb-accent);
  color: #fff;
  border-color: rgba(11,108,255,0.35);
}

.pg-btn.disabled{
  pointer-events: none;
  opacity: .45;
}

/* =========================
   Category badge colors (only keys you actually use)
   category_key -> lower + replace(' ','_')
   ========================= */
.cat-water{ background: rgba(59,130,246,0.92); }
.cat-animals{ background: rgba(245,158,11,0.92); }
.cat-cleanup{ background: rgba(34,197,94,0.92); }
.cat-recycling{ background: rgba(14,165,233,0.92); }
.cat-clean_energy{ background: rgba(99,102,241,0.92); }
.cat-nature{ background: rgba(34,197,94,0.92); }

/* =========================
   Responsive
   ========================= */
@media (max-width: 980px){
  .featured-grid{ grid-template-columns: 1fr; }
  .controls-row{ flex-direction: column; align-items: stretch; }
  .ctrl-sort{ width: 100%; }
}

@media (max-width: 560px){
  .initiatives-wrap{ padding: 0 14px 14px 14px; }
  .init-title{ font-size: 28px; }
  .init-sub{ font-size: 16px; }
  .initiative-cover img{ height: 190px; }
}
