.grievance-flowchart {
  --gf-red: #c1272d;
  --gf-orange: #f06523;
  --gf-tint: #fef2ed;

  font-family: var(--body-font-family);
  color: var(--body-font-color);
}

/* Keep an empty block clickable in the Universal Editor */
.grievance-flowchart:empty {
  min-height: 48px;
}

.grievance-flowchart-intro {
  display: none;
  align-items: center;
  /* justify-content: space-between; */
  gap: 24px;
  margin-bottom: 32px;
}

.grievance-flowchart-intro-icon {
  flex-shrink: 0;
}

.grievance-flowchart-intro-icon img {
  display: none;
}

.grievance-flowchart-intro :is(h1, h2, h3, h4, h5, h6) {
  margin: 0;
  color: var(--gf-red);
  font-family: var(--body-font-family-bold);
  font-size: 32px;
  line-height: 1.15;
  text-transform: uppercase;
}

.grievance-flowchart-intro p {
  margin: 16px 0 0;
  font-size: 16px;
  line-height: 1.4;
}

.grievance-flowchart-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--gf-red);
  margin: 0 0 32px;
  font-family: var(--body-font-family-bold);
  font-size: 24px;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
  margin-top: 20px;
}

/* Side lines, each with a dot on its outer end */
.grievance-flowchart-heading::before,
.grievance-flowchart-heading::after {
  content: '';
  flex: 1;
  height: 8px;
  background:
    radial-gradient(circle, var(--gf-red) 3px, transparent 3.5px) left center / 8px 8px no-repeat,
    linear-gradient(var(--gf-red), var(--gf-red)) center / 100% 2px no-repeat;
}

.grievance-flowchart-heading::after {
  background:
    radial-gradient(circle, var(--gf-red) 3px, transparent 3.5px) right center / 8px 8px no-repeat,
    linear-gradient(var(--gf-red), var(--gf-red)) center / 100% 2px no-repeat;
}

.grievance-flowchart-levels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 0;
  padding: 16px 0 56px;
  list-style: none;
}

/* Levels alternate red / orange */
.grievance-flowchart-level {
  --gf-accent: var(--gf-red);

  position: relative;

  /* Share row tracks with sibling cards so each section lines up across levels */
  display: grid;
  grid-row: span 6;
  grid-template-rows: subgrid;
  row-gap: 0;
  justify-items: center;
  align-content: start;
  box-sizing: border-box; 
  padding: 20px 10px 64px;
  border: 1.5px solid var(--gf-accent);
  border-radius: 12px;
  background: var(--color-white);
  text-align: center;
}

.grievance-flowchart-level:nth-child(even) {
  --gf-accent: var(--gf-orange);
}

.grievance-flowchart-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 28px;
  border-radius: 6px;
  background: var(--gf-accent);
  color: var(--color-white);
  font-family: var(--body-font-family-bold);
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.grievance-flowchart-number {
  grid-row: 1;
  margin: 0;
  color: var(--gf-accent);
  font-family: var(--body-font-family-bold);
  font-size: 30px;
  line-height: 1.1;
}

.grievance-flowchart-icon {
  grid-row: 2;
  margin: 0;
}

.grievance-flowchart-icon img {
  width: 100px;
  height: 100px;
  object-fit: contain;

  /* #c1272d */
  filter: brightness(0) saturate(100%) invert(23%) sepia(64%) saturate(2451%) hue-rotate(337deg) brightness(90%) contrast(100%);
}

.grievance-flowchart-level:nth-child(even) .grievance-flowchart-icon img {
  /* #f06523 */
  filter: brightness(0) saturate(100%) invert(45%) sepia(58%) saturate(1805%) hue-rotate(347deg) brightness(97%) contrast(94%);
}

.grievance-flowchart-title {
  grid-row: 3;
  /* align-self: end; */
  margin: 0;
  color: var(--gf-accent);
  font-family: var(--body-font-family-bold);
  font-size: 16px;
  text-transform: uppercase;
}

.grievance-flowchart-subtitle {
  grid-row: 4;
  margin: 0;
  color: var(--gf-accent);
  font-size: 13px;
}

.grievance-flowchart-desc {
  grid-row: 5;
  justify-self: stretch;
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
  border-top: 1px solid black;
}

.grievance-flowchart-desc p {
  margin: 0;
}

.grievance-flowchart-desc ol,
.grievance-flowchart-desc ul {
  margin: 0;
  padding-left: 18px;
  font-size: 16px;
}

.grievance-flowchart-desc li {
  margin-block: 8px;
}

/* Paragraphs after a list (e.g. Level 4's website / letter) align with list text */
.grievance-flowchart-desc :is(ol, ul) ~ p {
  padding-left: 18px;
  font-size: 16px;
}

/* Icons hang in the 18px list gutter, under the "1." numbers, so text stays aligned */
.grievance-flowchart-desc .icon,
.grievance-flowchart-level .grievance-flowchart-desc-icon {
  display: inline-block;
  flex-shrink: 0;
  width: 14px;
  margin: 0 4px 0 -18px;
  text-align: center;
  /* vertical-align: -3px; */
}

.grievance-flowchart-level .grievance-flowchart-desc :is(.icon img, img.grievance-flowchart-desc-icon) {
  width: 14px;
  height: 14px;
}

.grievance-flowchart-desc a {
  color: inherit;
  text-decoration: underline;
  overflow-wrap: anywhere;
  display: flex;
}

.grievance-flowchart-cta,
.grievance-flowchart-form-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 10px 20px;
  border-radius: 8px;
  background: linear-gradient(to right, #f06523, #e64e0e);
  color: var(--color-white);
  font-family: var(--body-font-family);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

.grievance-flowchart-cta {
  grid-row: 6;
  align-self: start;
  margin-top: 0;
}

.grievance-flowchart-form-cta {
  margin-top: 8px;
}

/* Drop the global 20px !important padding under this section's default content only */
.grievance-flowchart-container > .default-content-wrapper {
  padding-bottom: 0 !important;
}

/* Section heading + form CTA moved beside it by the block's JS */
.grievance-flowchart-heading-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.grievance-flowchart-heading-row > :is(h1, h2, h3) {
  margin: 0;
}

.grievance-flowchart-heading-row .grievance-flowchart-form-cta {
  flex-shrink: 0;
  margin-top: 0;
}

.grievance-flowchart-cta:hover,
.grievance-flowchart-form-cta:hover {
  background: linear-gradient(to right, #e64e0e, #f06523);
  color: var(--color-white);
  box-shadow: 0 4px 12px rgb(0 0 0 / 20%);
}

.grievance-flowchart-tat {
  position: absolute;
  bottom: -48px;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100px;
  height: 100px;
  padding: 0 10px;
  transform: translateX(-50%);
  border: 1px solid var(--gf-accent);
  border-radius: 50%;
  background: var(--gf-tint);
  color: var(--gf-accent);
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
}

.grievance-flowchart-tat strong {
  font-family: var(--body-font-family-bold);
  font-size: 28px;
  line-height: 1.1;
}

.grievance-flowchart-tat span{
  font-size: 15px;
  line-height: inherit;
}

/* Unit sits in the narrower lower half of the circle, so keep it inside the curve */
.grievance-flowchart-tat span:last-child {
  font-size: 12px;
}

@media (width <= 1024px) {
  .grievance-flowchart-levels {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 72px;
  }
}

@media (width <= 600px) {
  .grievance-flowchart-intro :is(h1, h2, h3, h4, h5, h6) {
    font-size: 24px;
  }

  .grievance-flowchart-intro{
    align-items: flex-start;
  }

  .grievance-flowchart-intro p {
    font-size: 16px;
  }

  .grievance-flowchart-intro-icon img {
    width: 58px;
    height: 59px;
  }

  .grievance-flowchart-heading {
    gap: 8px;
    font-size: 18px;
  }

  .grievance-flowchart-levels {
    grid-template-columns: 1fr;
  }

  /* Single column: no cross-card alignment needed, and subgrid would pull the
     list's 72px row-gap in between each card's sections */
  .grievance-flowchart-level {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .grievance-flowchart-desc {
    align-self: stretch;
    margin-top: 8px;
  }

  .grievance-flowchart-form-cta {
    width: 100%;
  }
}
