/* Third visual pass from browser QA: fix empty media, tighten detail flow, enrich trust cues. */

/* --- Branded media fallbacks: no more empty white rectangles --- */
.card-media {
  min-height: 220px;
}

.card-media-fallback,
.campaign-cover-fallback {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100%;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 78% 20%, rgba(255,255,255,.16) 0 52px, transparent 53px),
    radial-gradient(circle at 78% 20%, transparent 0 82px, rgba(255,255,255,.085) 83px 102px, transparent 103px),
    linear-gradient(145deg, #4f7f61 0%, #365f47 50%, #244c37 100%) !important;
}

.card-media-fallback {
  display: grid !important;
  min-height: 220px;
  padding: 24px;
  align-content: end;
}

.card-media-fallback::before,
.campaign-cover-fallback::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 126px;
  height: 126px;
  right: 13%;
  top: 18%;
  border-radius: 48% 52% 44% 56% / 55% 43% 57% 45%;
  background:
    radial-gradient(circle at 35% 35%, #f63a40 0 9%, transparent 10%),
    radial-gradient(circle at 62% 30%, #ed0b14 0 15%, transparent 16%),
    radial-gradient(circle at 72% 58%, #c70a18 0 20%, transparent 21%),
    radial-gradient(circle at 38% 70%, #dd0c15 0 18%, transparent 19%),
    radial-gradient(circle at 48% 48%, #ed0b14 0 42%, #b5162b 43% 57%, transparent 58%);
  transform: rotate(-8deg);
  filter: drop-shadow(0 14px 26px rgba(47,15,21,.18));
  opacity: .94;
}

.card-media-fallback::after,
.campaign-cover-fallback::after {
  content: "";
  position: absolute;
  z-index: -2;
  width: 10px;
  height: 190px;
  right: calc(13% + 55px);
  top: calc(18% + 92px);
  border-radius: 99px;
  background: linear-gradient(#315c43, #1f4632);
  transform: rotate(19deg);
  transform-origin: top center;
  opacity: .9;
}

.card-media-fallback__kicker {
  display: block;
  margin-bottom: 8px;
  color: rgba(255,255,255,.72);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.card-media-fallback__title {
  display: block;
  max-width: 80%;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.08;
  text-wrap: balance;
}

/* If an uploaded image fails to load, JS can add this class and we retain a graceful surface. */
.card-media.is-broken img,
.campaign-cover-wrap.is-broken img {
  display: none;
}

/* --- Detail media becomes an actual campaign hero, not a blank placeholder --- */
.campaign-cover-wrap {
  position: relative;
}

.campaign-cover-fallback {
  display: flex !important;
  min-height: 470px;
  padding: clamp(30px, 5vw, 56px);
  align-items: flex-end;
  border-radius: 24px;
}

.campaign-cover-fallback::before {
  width: clamp(170px, 26vw, 260px);
  height: clamp(170px, 26vw, 260px);
  right: 9%;
  top: 12%;
}

.campaign-cover-fallback::after {
  width: 14px;
  height: 340px;
  right: 22%;
  top: 40%;
}

.campaign-cover-fallback__copy {
  position: relative;
  z-index: 2;
  max-width: 520px;
}

.campaign-cover-fallback__kicker {
  display: block;
  margin-bottom: 10px;
  color: rgba(255,255,255,.72);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.campaign-cover-fallback__title {
  display: block;
  max-width: 90%;
  font-size: clamp(38px, 6vw, 66px);
  font-weight: 700;
  line-height: .95;
  text-wrap: balance;
}

.campaign-cover-fallback__tag {
  display: inline-flex;
  margin-top: 20px;
  padding: 9px 13px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  color: rgba(255,255,255,.9);
  font-size: 12px;
  font-weight: 500;
  backdrop-filter: blur(8px);
}

/* --- Story rhythm --- */
.campaign-story__content {
  max-width: 760px;
}

.campaign-story__content h2 {
  margin-bottom: 18px !important;
}

.description p:first-child {
  font-size: 19px;
  line-height: 1.65;
}

.share-panel {
  margin-top: 24px !important;
  padding: 16px 18px !important;
  border-radius: 16px !important;
}

.campaign-detail + .section {
  padding-top: 30px !important;
}

/* --- Donation authority / reassurance --- */
.donation-panel {
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, rgba(237,11,20,.22), rgba(65,108,79,.20)) border-box !important;
}

.donation-panel .target {
  margin: 12px 0 20px !important;
  font-size: 15px;
}

.donation-prompt {
  margin-bottom: 12px !important;
  font-size: 16px !important;
}

.donation-submit {
  min-height: 48px !important;
  margin-top: 4px;
  font-size: 14px !important;
}

.donation-trust {
  display: grid;
  gap: 9px;
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid #edf0ed;
}

.donation-trust__item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 9px;
  align-items: start;
  color: #5f6561;
  font-size: 11px;
  line-height: 1.4;
}

.donation-trust__icon {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: #eef5f0;
  color: #416c4f;
  font-size: 10px;
  font-weight: 700;
}

/* --- Dashboard feels like a product, not admin scaffolding --- */
.dashboard-card {
  transition: transform .2s cubic-bezier(.22,1,.36,1), box-shadow .2s ease, border-color .2s ease;
}

.dashboard-card:hover {
  transform: translateY(-2px);
  border-color: rgba(65,108,79,.24) !important;
  box-shadow: 0 16px 38px rgba(27,48,35,.07) !important;
}

.dashboard-meta > div {
  min-height: 74px;
}

/* --- Carnation helper: subtle personality without distracting from donations --- */
.carnation-assistant__trigger::after {
  content: "";
  position: absolute;
  inset: -5px;
  z-index: -1;
  border: 1px solid rgba(65,108,79,.16);
  border-radius: 999px;
  opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .carnation-assistant__trigger::after {
    animation: carnation-pulse 4.8s ease-out infinite;
  }

  @keyframes carnation-pulse {
    0%, 72% { transform: scale(.96); opacity: 0; }
    78% { opacity: .55; }
    100% { transform: scale(1.13); opacity: 0; }
  }
}

@media (max-width: 900px) {
  .campaign-cover-fallback {
    min-height: 390px;
  }

  .campaign-cover-fallback::after {
    height: 260px;
  }
}

@media (max-width: 620px) {
  .card-media,
  .card-media-fallback {
    min-height: 190px;
  }

  .campaign-cover-fallback {
    min-height: 330px;
    padding: 26px;
  }

  .campaign-cover-fallback__title {
    font-size: clamp(34px, 12vw, 48px);
  }

  .campaign-cover-fallback::before {
    opacity: .76;
  }
}
