/* Crisis Cloud participant experience */

.csp-participant-home,
.csp-channel-page,
.csp-newsroom-shell {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.csp-participant-home h1,
.csp-participant-home h2,
.csp-participant-home h3,
.csp-channel-page h1,
.csp-channel-page h2,
.csp-channel-page h3,
.csp-newsroom-shell h1,
.csp-newsroom-shell h2,
.csp-newsroom-shell h3 {
  font-family: inherit !important;
}

.csp-participant-home {
  width: min(1100px, calc(100vw - 36px));
  margin: 72px auto 0;
  text-align: center;
}

.csp-participant-home__title {
  margin: 0;
  color: #111827;
  font-size: clamp(38px, 4.2vw, 60px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.025em;
}

.csp-participant-home__kicker {
  margin: 18px 0 14px;
  color: #4b5563;
  font-size: 16px;
}

.csp-participant-home__cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  width: min(900px, 100%);
  margin: 0 auto;
}

.csp-participant-card {
  overflow: hidden;
  display: block;
  color: #111827 !important;
  text-decoration: none !important;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .08);
  transition: transform .16s ease, box-shadow .16s ease;
}

.csp-participant-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 38px rgba(15, 23, 42, .13);
}

.csp-participant-card__image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e5e7eb;
}

.csp-participant-card__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.csp-participant-card__body {
  min-height: 78px;
  padding: 16px 18px;
  text-align: center;
}

.csp-participant-card__label {
  font-size: 18px;
  font-weight: 750;
}

.csp-participant-card__cta {
  margin-top: 8px;
  color: #4b5563;
  font-size: 13px;
}

.csp-channel-page {
  width: min(980px, calc(100vw - 36px));
  margin: 54px auto 0;
}

.csp-channel-banner {
  width: min(100%, 980px);
  margin: 0 auto 28px;
  overflow: hidden;
}

.csp-channel-banner img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 240px;
  object-fit: cover;
}

.csp-channel-page__title {
  margin: 0 0 22px;
  color: #111827;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.1;
  font-weight: 500;
}

.csp-feed-root,
.csp-feed-items,
.csp-feed-items > *,
.csp-inject-card {
  box-sizing: border-box;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
}

.csp-feed-root .csp-feed-items {
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
}

.csp-elapsed-banner {
  margin: 0 0 14px;
  padding: 9px 12px;
  border: 1px solid #dbe3ef;
  border-radius: 9px;
  background: #f8fafc;
  color: #64748b;
  font-size: 13px;
}

.csp-back-link {
  display: inline-flex;
  margin-top: 18px;
  color: #1f2937 !important;
  font-size: 14px;
}

/* --------------------------------------------------------------------------
   Social feed
   -------------------------------------------------------------------------- */

.csp-social-page-shell {
  width: min(780px, calc(100vw - 36px));
}

.csp-social-page-shell .csp-channel-banner {
  width: min(640px, 100%);
}

.csp-feed-root[data-channel="social"] {
  width: min(620px, 100%);
  margin: 0 auto;
}

.csp-feed-root[data-channel="social"] .csp-inject-card {
  position: relative;
  display: grid !important;
  grid-template-columns: 48px minmax(0, 1fr);
  column-gap: 12px;
  margin: 0 !important;
  padding: 16px !important;
  border: 0 !important;
  border-top: 1px solid #eff3f4 !important;
  border-radius: 0 !important;
  background: #fff !important;
  box-shadow: none !important;
  color: #0f1419 !important;
  transition: background .15s ease;
}

.csp-feed-root[data-channel="social"] .csp-inject-card:last-child {
  border-bottom: 1px solid #eff3f4 !important;
}

.csp-feed-root[data-channel="social"] .csp-inject-card:hover {
  background: #f7f9f9 !important;
}

.csp-feed-root[data-channel="social"] .csp-inject-card::before {
  content: attr(data-initial);
  grid-row: 1 / 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1d9bf0, #0d47a1);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

.csp-feed-root[data-channel="social"] .csp-inject-offset {
  display: none;
}

.csp-feed-root[data-channel="social"] .csp-inject-card h3 {
  grid-column: 2;
  margin: 0 0 5px !important;
  color: #0f1419 !important;
  font-size: 15px !important;
  font-weight: 750 !important;
  line-height: 1.35;
}

.csp-feed-root[data-channel="social"] .csp-inject-content {
  grid-column: 2;
  color: #0f1419 !important;
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.csp-feed-root[data-channel="social"] .csp-inject-content::after {
  content: "♡     ◯     ↗";
  display: block;
  margin-top: 12px;
  color: #536471;
  font-size: 14px;
  letter-spacing: 7px;
}

/* --------------------------------------------------------------------------
   WhatsApp-inspired Messages timeline
   -------------------------------------------------------------------------- */

.csp-messages-page-shell {
  width: min(980px, calc(100vw - 36px));
}

.csp-messages-page-shell .csp-feed-root[data-channel="email"] {
  width: min(780px, 100%);
  margin: 0 auto;
}

body:has(.csp-feed-root[data-channel="email"]) .comments-area,
body:has(.csp-feed-root[data-channel="email"]) #comments,
body:has(.csp-feed-root[data-channel="email"]) .wp-block-comments,
body:has(.csp-feed-root[data-channel="email"]) .wp-block-post-comments,
body:has(.csp-feed-root[data-channel="email"]) .wp-block-post-comments-form,
body:has(.csp-feed-root[data-channel="email"]) .comment-respond,
body:has(.csp-feed-root[data-channel="email"]) .wp-block-comment-template {
  display: none !important;
}

.csp-message-timeline {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 260px;
  padding: 22px 20px;
  border: 1px solid #d8d4cd;
  border-radius: 14px 14px 0 0;
  background-color: #efeae2;
  background-image:
    radial-gradient(circle at 20px 20px, rgba(17, 24, 39, .035) 1.5px, transparent 1.6px),
    radial-gradient(circle at 60px 60px, rgba(17, 24, 39, .025) 1.5px, transparent 1.6px);
  background-size: 80px 80px;
}

.csp-timeline-card {
  position: relative;
  width: fit-content;
  max-width: min(78%, 650px);
  padding: 9px 12px 7px;
  border: 0 !important;
  border-radius: 10px !important;
  box-shadow: 0 1px 1px rgba(15, 23, 42, .13) !important;
}

.csp-timeline-card--inject {
  align-self: flex-start;
  margin-right: auto;
  background: #fff !important;
  color: #111827;
}

.csp-timeline-card--inject::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 0;
  border-top: 10px solid #fff;
  border-left: 8px solid transparent;
}

.csp-timeline-card--participant {
  align-self: flex-end;
  margin-left: auto;
  background: #d9fdd3 !important;
  color: #111827;
}

.csp-timeline-card--participant::after {
  content: "";
  position: absolute;
  right: -7px;
  top: 0;
  border-top: 10px solid #d9fdd3;
  border-right: 8px solid transparent;
}

.csp-timeline-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 4px;
  color: #667781;
  font-size: 10px;
}

.csp-timeline-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .02em;
}

.csp-timeline-pill--inject { background: #e7f1ff; color: #1d4ed8; }
.csp-timeline-pill--participant { background: rgba(22, 163, 74, .12); color: #15803d; }

.csp-timeline-title {
  margin: 0 0 5px;
  color: #075e54;
  font-size: 13px;
  font-weight: 750;
}

.csp-timeline-content {
  color: #111827;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.csp-timeline-replyref {
  margin: 5px 0 7px;
  padding: 7px 9px;
  border-left: 3px solid #22c55e;
  border-radius: 5px;
  background: rgba(255, 255, 255, .55);
  color: #166534;
  font-size: 11px;
}

.csp-timeline-replybtn {
  margin-top: 8px;
  padding: 4px 8px;
  border: 0;
  border-radius: 999px;
  background: #eef7ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.csp-message-reply {
  margin: 0;
  padding: 12px;
  border: 1px solid #d8d4cd;
  border-top: 0;
  border-radius: 0 0 14px 14px;
  background: #f0f2f5;
}

.csp-message-reply h3,
.csp-message-reply > p {
  display: none;
}

.csp-message-reply textarea {
  width: 100%;
  min-height: 56px;
  max-height: 160px;
  box-sizing: border-box;
  padding: 14px 16px;
  border: 0;
  border-radius: 24px;
  outline: none;
  background: #fff;
  color: #111827;
  font: inherit;
  resize: vertical;
  box-shadow: inset 0 0 0 1px #e5e7eb;
}

.csp-message-reply > div:last-child {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.csp-message-reply #csp-message-reply-send {
  margin-top: 9px;
  padding: 9px 18px;
  border: 0;
  border-radius: 999px;
  background: #00a884;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.csp-message-reply-context {
  display: none;
  margin: 0 0 9px;
  padding: 8px 10px;
  border-left: 4px solid #00a884;
  border-radius: 7px;
  background: #fff;
  color: #166534;
  font-size: 12px;
}

.csp-message-reply-context button {
  margin-top: 5px;
  padding: 3px 7px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #fff;
  color: #166534;
  font-size: 11px;
}

.csp-message-reply-status {
  color: #64748b;
  font-size: 12px;
}

/* --------------------------------------------------------------------------
   Newsroom
   -------------------------------------------------------------------------- */

body.csp-news-page {
  background: #071227 !important;
}

.csp-newsroom-shell {
  width: 100%;
  margin: 0;
  padding: 34px 0 64px;
  background:
    radial-gradient(1000px 500px at 10% -10%, rgba(86, 195, 255, .13), transparent 60%),
    radial-gradient(800px 460px at 95% 5%, rgba(251, 191, 36, .09), transparent 58%),
    #071227;
  color: #e7edf9;
}

.csp-newsroom-shell__inner {
  width: min(1120px, calc(100vw - 36px));
  margin: 0 auto;
}

.csp-newsroom-shell .csp-channel-banner {
  width: min(100%, 940px);
  margin-bottom: 14px;
}

.csp-news-ticker {
  position: relative;
  overflow: hidden;
  width: min(100%, 940px);
  margin: 0 auto 18px;
  padding: 8px 10px;
  border: 1px solid rgba(231, 237, 249, .16);
  border-radius: 999px;
  background: rgba(0, 0, 0, .16);
}

.csp-news-ticker__track {
  display: flex;
  width: max-content;
  gap: 10px;
  animation: csp-news-scroll 36s linear infinite;
}

.csp-news-ticker:hover .csp-news-ticker__track { animation-play-state: paused; }

.csp-news-ticker__pill {
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 1px solid rgba(231, 237, 249, .15);
  border-radius: 999px;
  background: rgba(255, 255, 255, .035);
  color: #cbd5e1;
  font-size: 12px;
  white-space: nowrap;
}

.csp-news-ticker__pill strong { color: #fff; }

@keyframes csp-news-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.csp-newsroom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: start;
}

.csp-newsroom-main,
.csp-newsroom-sidebar {
  border: 1px solid rgba(231, 237, 249, .14);
  border-radius: 15px;
  background: rgba(0, 0, 0, .11);
}

.csp-newsroom-main { padding: 20px; }
.csp-newsroom-sidebar { padding: 18px; }

.csp-newsroom-main .csp-feed-root[data-channel="news"] h1 {
  margin: 0 0 16px;
  color: #fff;
  font-size: 34px;
  font-weight: 500;
}

.csp-feed-root[data-channel="news"] .csp-elapsed-banner {
  border-color: rgba(231, 237, 249, .28);
  background: transparent;
  color: #cbd5e1;
}

.csp-feed-root[data-channel="news"] .csp-inject-card {
  margin: 0 0 14px !important;
  padding: 17px !important;
  border: 1px solid rgba(231, 237, 249, .17) !important;
  border-radius: 12px !important;
  background: linear-gradient(180deg, rgba(17, 34, 65, .82), rgba(8, 20, 43, .82)) !important;
  color: #e7edf9 !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .18) !important;
}

.csp-feed-root[data-channel="news"] .csp-inject-offset {
  color: #94a3b8;
  font-size: 11px;
}

.csp-feed-root[data-channel="news"] .csp-inject-card h3 {
  margin: 7px 0;
  color: #fff !important;
  font-size: 20px;
  line-height: 1.25;
}

.csp-feed-root[data-channel="news"] .csp-inject-content {
  color: #cbd5e1 !important;
  line-height: 1.6;
  white-space: pre-wrap;
}

.csp-feed-root[data-channel="news"] .csp-back-link { color: #e7edf9 !important; }

.csp-newsroom-sidebar h2 {
  margin: 0 0 14px;
  color: #fff;
  font-size: 27px;
  line-height: 1.1;
  font-weight: 500;
}

.csp-business-news {
  margin: 0;
  padding: 0;
  list-style: none;
}

.csp-business-news li {
  padding: 10px 0;
  border-top: 1px solid rgba(231, 237, 249, .12);
}

.csp-business-news li:first-child { border-top: 0; padding-top: 0; }
.csp-business-news a { color: #f8fafc !important; text-decoration: none !important; font-size: 13px; line-height: 1.35; }
.csp-business-news a:hover { color: #86d8ff !important; }
.csp-business-news time { display: block; margin-top: 4px; color: #94a3b8; font-size: 10px; }
.csp-business-news p { margin: 4px 0 0; color: #cbd5e1; font-size: 11px; line-height: 1.4; }
.csp-business-news__empty { color: #cbd5e1; font-size: 12px; }

#csp-global-banner {
  position: sticky;
  top: 0;
  z-index: 9999;
  overflow: hidden;
  padding: 8px 0;
  background: #d63638;
  color: #fff;
  font-weight: 750;
}

.csp-banner-scroll {
  display: inline-block;
  min-width: 100%;
  padding-left: 100%;
  white-space: nowrap;
  animation: csp-banner-scroll 25s linear infinite;
}

@keyframes csp-banner-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-200%); }
}

@media (prefers-reduced-motion: reduce) {
  .csp-news-ticker__track,
  .csp-banner-scroll { animation: none; padding-left: 0; }
}

@media (max-width: 900px) {
  .csp-participant-home__cards { grid-template-columns: 1fr; width: min(560px, 100%); }
  .csp-newsroom-grid { grid-template-columns: 1fr; }
  .csp-newsroom-sidebar { order: 2; }
}

@media (max-width: 680px) {
  .csp-participant-home { margin-top: 42px; }
  .csp-participant-home__title { font-size: 39px; }
  .csp-channel-page { margin-top: 34px; }
  .csp-channel-banner { margin-bottom: 20px; }
  .csp-channel-page__title { font-size: 34px; }
  .csp-timeline-card { max-width: 88%; }
  .csp-message-timeline { padding: 16px 12px; }
  .csp-newsroom-main { padding: 14px; }
}

/*
 * Centre application components against the browser viewport, not the active
 * block-theme content column. JavaScript calculates the exact correction
 * because some themes place post content asymmetrically.
 */
.csp-participant-home,
.csp-channel-page,
.csp-newsroom-shell {
  position: relative;
  left: auto;
  max-width: none !important;
  transform: translateX(var(--csp-participant-viewport-shift, 0px));
}

.csp-newsroom-shell {
  width: 100vw;
}
