:root {
  --char-bg: var(--navy, #32363f);
  --char-card-bg: rgba(255, 255, 255, 0.92);
  --char-card-border: rgba(255, 255, 255, 0.22);
  --char-ink: var(--ink, #f2f6f9);
  --char-muted: var(--muted, #b5bec9);
  --char-dark: #273041;
  --char-accent: #00bfff;
  --char-accent-dark: #00a8d8;
  --char-green: #00d200;
  --char-radius-xl: 24px;
  --char-radius-lg: 16px;
  --char-radius-md: 12px;
  --char-shadow: var(--shadow, 0 18px 44px rgba(0, 0, 0, 0.28));
}

.char-hero {
  position: relative;
  margin: 22px auto 28px;
  width: min(1320px, calc(100% - 40px));
  border-radius: var(--char-radius-xl);
  overflow: hidden;
  min-height: 240px;}

.char-hero__image {
  width: 100px;
  height: 100px;
  object-fit: contain;
  display: block;
  margin: 36px auto 0;
}

.char-hero__content {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  padding: 24px 32px 32px;
  text-align: center;
}

.char-hero__eyebrow {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  color: var(--char-green);
}

.char-hero__title {
  margin: 0;
  font-size: clamp(1.8rem, 3.4vw, 3rem);
  line-height: 1.04;
  color: #fff;
}

.char-hero__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0;
  color: var(--char-muted);
  font-size: 0.88rem;
  letter-spacing: 0.04em;
}

.char-main {
  width: min(1280px, calc(100% - 40px));
  margin: 72px auto;
  padding-top: 72px;
}

.char-breadcrumb {
  width: min(1280px, calc(100% - 40px));
  margin: 18px auto 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--char-muted);
  font-size: 0.84rem;
  letter-spacing: 0.04em;
}

.char-breadcrumb a {
  color: var(--char-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.char-breadcrumb a:hover {
  color: var(--char-accent);
}

.char-breadcrumb__sep {
  color: rgba(255, 255, 255, 0.55);
}

.char-breadcrumb__current {
  color: #fff;
}

.char-empty {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--char-radius-lg);
  box-shadow: var(--char-shadow);
  padding: 32px;
  text-align: center;
}

.char-empty h2 {
  margin: 0 0 10px;
  font-size: 1.2rem;
  color: #fff;
}

.char-empty p {
  margin: 0 0 18px;
  color: var(--char-muted);
  text-transform: none;
}

.char-empty__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 12px 24px;
  border-radius: 4px;
  border: none;
  background: var(--char-accent);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.3s ease;
}

.char-empty__back:hover {
  background: var(--char-accent-dark);
  box-shadow: 0 0 15px rgba(0, 191, 255, 0.3);
}

.char-grid {
  display: grid;
  gap: 72px;
}

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

.char-grid--3, .char-grid--4, .char-grid--many { 
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.char-card--featured { grid-column: span 2; }

.char-card__link {
  display: flex;
  flex-direction: column;
  background: var(--char-card-bg);
  border-radius: 32px;
  overflow: hidden;
  text-decoration: none;
  color: var(--char-dark);
  box-shadow: 0 10px 24px rgba(10, 28, 44, 0.07);
  min-height: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.char-card__link:hover {
  border: none;
  box-shadow: 0 10px 24px rgba(10, 28, 44, 0.14);
}

.char-card__media-wrap {
  position: relative;
  height: 220px;
  background: #d6dde9;
}

.char-card__media-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 48%, rgba(0, 0, 0, 0.75) 100%);
  pointer-events: none;
}

.char-card--featured .char-card__media-wrap { height: 280px; }

.char-card__media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.char-card__media--fallback {
  object-fit: contain;
  padding: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(236, 244, 248, 0.96));
}

.char-card__owner {
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  position: absolute;
  z-index: 9;
  top: 12px;
  right: 12px;
  overflow: hidden;
  background: #fff;
  border: solid 2px #00bfff;
}

.char-card__owner-avatar {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.char-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--char-green);
  color: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.24);
}

.char-card__badge--live {
  background: rgba(0, 0, 0, 0.6);
  color: #00D200;
}

.char-card__badge--live::after {
  background: #00D200;
  background-size: 14px;
  display: inline-block;
  vertical-align: middle;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  animation: pulse2 1.5s infinite;
  color: #00D200;
  line-height: 1;
  text-transform: uppercase;
  margin: -4px 0 0 7px;
  content: '.';
  font-size: 0;
}

.char-card__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
}

.char-card__eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: #2a2a2a;
  font-weight: 700;
}

.char-card__title {
  margin: 0;
  color: #2a2a2a;
  text-transform: uppercase;
  font-weight: 300;
  line-height: 1.2;
  font-size: clamp(20px, 5.2vw, 2rem);
  min-height: 78px;
}

.char-card__desc {
  height: 64px;
  margin: 0;
  color: #2a2a2a;
  line-height: 1.5;
  text-transform: none;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body#charity-page .p2-stage-progress--card {
  position: relative;
  left: auto;
  right: auto;
  z-index: auto;
  padding: 0;
  margin-top: -64px;
}

body#charity-page .p2-chart-bar-wrapper--card {
  width: 100%;
  height: 48px;
  overflow: hidden;
}

body#charity-page .p2-chart-bar-inside {
  width: 100%;
  height: 24px;
  border-bottom: solid 1px rgba(255,255,255,.5);
}

body#charity-page .p2-chart-bar {
  height: 24px;
  min-width: 24px;
  background: transparent;
  opacity: 1;
  transform: translateX(-100%);
  animation: p2SlideIn 2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  border-bottom: solid 1px #00bfff;
}

body#charity-page .p2-chart-bar.p2-restart {
  animation: none;
}

body#charity-page .p2-chart-bar.p2-restart.p2-animate {
  animation: p2SlideIn 2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

body#charity-page .p2-chart-bar__badge {
  display: block;
  width:48px;
  padding: 8px 0;
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: .12em;
  color: #000;
  margin-right: 0;
  line-height: 1;
  text-align: center;
  top: 10px;
  position: absolute;
  background: #00bfff;
}

.char-card__stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.char-card__stat {
  background: #f0f8ff;
  color: #2a2a2a;
  border-radius: 9px;
  padding: 10px;
  display: grid;
  gap: 6px;
  text-align: center;
}

.char-card__stat-icon-wrapper {
  display: block;
  margin: 4px auto 0;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(8, 31, 51, 0.12);
}

.char-card__stat-icon {
  width: 40px;
  margin: 16px;
}

.char-card__stat-label {
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.char-card__stat strong {
  color: #2a2a2a;
  font-size: 18px;
  font-weight: 500;
}

.char-card__meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.char-card__meta-item {
  background: rgba(0,0,0,.35);
  padding: 0 18px;
  font-size: 0.777rem;
  letter-spacing: 0.04em;
  position: relative;
  top: -24px;
  height: 24px;
  line-height: 24px;
  color: rgba(255,255,255,.777);
  text-transform: uppercase;
  z-index: 9;
}

.char-card__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin: 32px 0;
}

.char-card__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 32px;
  text-transform: uppercase;
  color: #fff;
  background-color: #00bfff;
  border-radius: 48px;
  font-weight: 600;
  font-size: 16px;
  height: 60px;
  line-height: 60px;
  letter-spacing: .02rem;
  animation: buyButton 1.5s infinite;
  transition: all .3s ease;
  opacity: 1;
  background-image: url("/assets/icons/ffffff/donation.svg");
  background-repeat: no-repeat;
  background-position: right -48px center;
  background-size: 32px;
  overflow: hidden;
  white-space: nowrap;
}

.char-card__link:hover .char-card__cta {
  padding: 0 80px 0 32px;
  background-position: right 32px center;
  animation: none;
  background-color: #00aaff; 
}

@media (max-width: 1160px) {
  .char-grid--3,
  .char-grid--4,
  .char-grid--many { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .char-card--featured { grid-column: span 2; }
}

@media (max-width: 860px) {
  .char-hero {
    width: calc(100% - 20px);
    margin: 14px auto 18px;
  }
  .char-main {
    width: calc(100% - 20px);
    margin-bottom: 30px;
  }
  .char-breadcrumb {
    width: calc(100% - 20px);
    margin-top: 12px;
    font-size: 0.78rem;
  }
  .char-grid,
  .char-grid--2,
  .char-grid--3,
  .char-grid--4,
  .char-grid--many { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .char-card--featured { grid-column: span 1; }
  .char-card__media-wrap,
  .char-card--featured .char-card__media-wrap { height: 210px; }
  .char-card__owner {
    width: 46px;
    height: 46px;
    left: 12px;
    bottom: 10px;
  }
  .char-card__stats { grid-template-columns: 1fr; }
}

/* ── Mini Leaflet map cutout on each charity card ────────────────────── */
.char-card__map {
  height: 140px;
  border-radius: 12px;
  overflow: hidden;
  background: #d6dde9;
  border: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.char-card__map--no-location {
  display: none;
}

.char-card__map--default-location {
  border: 1px dashed rgba(255, 152, 0, 0.65);
  position: relative;
}

.char-card__map--default-location::after {
  content: 'BSL777 Berlin · Default location';
  position: absolute;
  bottom: 6px;
  left: 6px;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 10px;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 4px;
  pointer-events: none;
  white-space: nowrap;
}

#charity-page .leaflet-marker-icon.charity-marker--default {
  border-color: #ff9800;
}

#charity-page .leaflet-marker-icon {
  width: 32px !important;
  height: 32px !important;
  object-fit: contain;
  border: solid 2px #ff0000;
  padding: 2px;
  background: #fff;
  border-radius: 50%;
}

@media (max-width: 860px) {
  .char-card__map { height: 120px; }
}
