/**
 * @file
 * Inner-page paragraph styles for the Save Mo Lives theme.
 *
 * Covers page summaries, elemental/savemolives rows, body text, stats
 * cards, and embeds used on /mcrs content pages.
 */

/* ---------------------------------------------------------------------------
 * Page summary.
 * ------------------------------------------------------------------------- */
.sml-page-summary {
  margin-block-end: 1.75rem;
  color: var(--sml-black);
  font-family: var(--sml-font-jost);
}

.sml-page-summary__subtitle {
  margin: 0 0 0.75rem;
  color: var(--sml-gray-dark);
  font-size: 1.125rem;
  font-weight: 600;
}

.sml-page-summary__text,
.sml-page-summary__text .text-content {
  color: var(--sml-black);
  font-family: var(--sml-font-jost);
  font-size: 1.0625rem;
  line-height: 1.6;
}

/* ---------------------------------------------------------------------------
 * Section / row spacing.
 * ------------------------------------------------------------------------- */
.elemental-section,
.savemolives-section {
  margin-block-end: 1.5rem;
}

.field__item:last-child > .elemental-section,
.field__item:last-child > .savemolives-section {
  margin-block-end: 0;
}

.elemental-row,
.savemolives-row {
  align-items: flex-start;
  margin-block-end: 1.5rem;
}

.elemental-row:last-child,
.savemolives-row:last-child,
.field__item:last-child > .elemental-row,
.field__item:last-child > .savemolives-row {
  margin-block-end: 0;
}

/* ---------------------------------------------------------------------------
 * Body text (element_text).
 * ------------------------------------------------------------------------- */
.sml-element-text {
  color: var(--sml-black);
  font-family: var(--sml-font-jost);
}

.sml-element-text__body,
.sml-element-text__body .text-content {
  color: var(--sml-black);
  font-family: var(--sml-font-jost);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.sml-element-text__body .text-content a:where(:not(.button, .btn)) {
  color: var(--sml-purple);
  box-shadow: none;
  text-decoration: underline;
}

.sml-element-text__body .text-content a:where(:not(.button, .btn)):hover,
.sml-element-text__body .text-content a:where(:not(.button, .btn)):focus {
  color: var(--sml-purple);
}

.sml-element-text img {
  max-width: 100%;
  height: auto;
}

.sml-element-text__body h2,
.sml-element-text__body h3,
.sml-element-text__body h4 {
  margin-block: 1.25rem 0.5rem;
  color: var(--sml-black);
  font-family: var(--sml-font-code-pro-bold);
  font-weight: 700;
}

.sml-element-text__body h2 {
  font-size: 1.375rem;
}

.sml-element-text__body h3 {
  font-size: 1.1875rem;
}

.sml-element-text__body ul,
.sml-element-text__body ol {
  margin-block: 0.75rem;
  padding-inline-start: 1.25rem;
}

/* Event / content tables inside body copy. */
.sml-element-text table,
.sml-element-text .text-content table {
  width: 100%;
  margin-block: 1.25rem;
  border-collapse: collapse;
  color: var(--sml-black);
  font-family: var(--sml-font-jost);
  font-size: 0.9375rem;
  line-height: 1.4;
}

.sml-element-text table th,
.sml-element-text .text-content table th {
  padding: 0.65rem 0.75rem;
  border-bottom: 2px solid var(--sml-orange);
  color: var(--sml-black);
  font-weight: 700;
  text-align: start;
  vertical-align: top;
}

.sml-element-text table td,
.sml-element-text .text-content table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--sml-border);
  vertical-align: top;
}

.sml-element-text table tr:last-child td,
.sml-element-text .text-content table tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 991px) {
  .sml-element-text__body {
    overflow-x: auto;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .sml-col--33 .sml-element-text table th,
  .sml-col--33 .sml-element-text .text-content table th {
    height: 5.875rem;
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .sml-col--33 .sml-element-text table th,
  .sml-col--33 .sml-element-text .text-content table th {
    height: 3.625rem;
  }
}

/* ---------------------------------------------------------------------------
 * Stats & Facts (stat_element / stat).
 * Figma: SML Design Refresh, outer card 2483:2369 + sibling tiles.
 * ------------------------------------------------------------------------- */
.sml-stat-block {
  padding: 2.25rem 1.5rem 2rem;
  border: 3px solid var(--sml-black);
  border-radius: 10px;
  background: var(--sml-white);
  color: var(--sml-black);
}

.sml-stat-block--wide,
.sml-stat-block--wide .sml-stat-block__grid,
.sml-stat-block--wide .sml-stat {
  min-width: 0;
  max-width: 100%;
}

.sml-stat-block__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.5rem;
  text-align: center;
}

.sml-stat-block__icon {
  margin-bottom: 0.5rem;
}

.sml-stat-block__icon img,
.sml-stat-block__icon svg {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
}

.sml-stat-block__title {
  margin: 0;
  color: var(--sml-black);
  font-family: var(--sml-font-code-pro-bold);
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.4375;
}

.sml-stat-block__description {
  margin-top: 0.75rem;
  font-family: var(--sml-font-jost);
  font-size: 1.125rem;
  line-height: 1.45;
}

.sml-stat-block__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.sml-stat-block__caption {
  margin-top: 1.25rem;
  color: var(--sml-gray-dark);
  font-family: var(--sml-font-jost);
  font-size: 0.875rem;
  font-style: italic;
  text-align: center;
}

.sml-stat-block__link {
  margin-top: 1rem;
  text-align: center;
}

.sml-stat-block__link a {
  color: var(--sml-purple);
  font-weight: 700;
  text-decoration: underline;
}

.sml-stat-block__link a:hover,
.sml-stat-block__link a:focus {
  color: var(--sml-purple);
}

.sml-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.25rem 1.5625rem 2rem;
  border: 3px solid var(--sml-black);
  border-radius: 5px;
  background: var(--sml-gray);
  text-align: center;
}

.sml-stat__headline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: baseline;
  justify-content: center;
  margin: 0;
}

.sml-stat__value,
.sml-stat__label {
  color: var(--sml-purple);
  font-family: var(--sml-font-code-pro-bold);
  font-size: 2.5rem;
  font-weight: 400;
  line-height: 1.2;
}

.sml-stat__descriptor {
  margin-top: 0.25rem;
  color: var(--sml-black);
  font-family: var(--sml-font-jost);
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.29;
}

.sml-stat__value > .field,
.sml-stat__label > .field,
.sml-stat__descriptor > .field,
.sml-stat-block__icon > .field,
.sml-stat-block__caption > .field,
.sml-stat-block__link > .field {
  display: contents;
}

.sml-stat-block__grid > .field,
.sml-stat-block__grid > .field > .field__item {
  display: contents;
}

@media (min-width: 768px) {
  .sml-stat-block--wide .sml-stat-block__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: center;
  }

  /*
   * Subgrid so each card spans two parent rows (headline + descriptor).
   * Titles in the same visual row share the tallest title height.
   */
  .sml-stat-block--wide .sml-stat {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 2;
    align-items: start;
    justify-items: center;
    row-gap: 0.25rem;
  }

  .sml-stat-block--wide .sml-stat__descriptor {
    margin-top: 0;
  }

  .sml-stat-block--wide .sml-stat__value,
  .sml-stat-block--wide .sml-stat__label {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: break-word;
  }

  .sml-stat-block--wide .sml-stat__value {
    font-size: clamp(2.25rem, 4.5vw, 3.75rem);
    line-height: 1.15;
  }

  .sml-stat-block--wide .sml-stat__label {
    font-size: clamp(1.75rem, 3.2vw, 2.75rem);
    line-height: 1.15;
  }
}

@media (min-width: 768px) and (max-width: 74.9375rem) {
  .sml-stat-block--wide .sml-stat-block__grid > .sml-stat:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc((100% - 1.5rem) / 2);
  }
}

@media (min-width: 75rem) {
  .sml-stat-block--wide {
    padding: 2.5rem 1.75rem 2.25rem;
  }

  .sml-stat-block--wide .sml-stat-block__grid {
    grid-template-columns: repeat(
      auto-fit,
      minmax(calc((100% - 4.5rem) / 4), calc((100% - 4.5rem) / 4))
    );
    justify-content: center;
  }
}

/*
 * Compact / skinny stats (field_element_width <= 50).
 * Matches production stacked label-then-value boxes used in 25%
 * columns on /mcrs. Inner grid stays a single column at every
 * breakpoint so tiles cannot overflow the parent column.
 */
.sml-stat-block--compact {
  min-width: 0;
  padding: 1.25rem 0.25rem;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.sml-stat-block--compact .sml-stat-block__header {
  margin-bottom: 0.75rem;
}

.sml-stat-block--compact .sml-stat-block__icon img,
.sml-stat-block--compact .sml-stat-block__icon svg {
  width: 4rem;
  height: 4rem;
}

.sml-stat-block--compact .sml-stat-block__title {
  font-size: 1.125rem;
  line-height: 1.25;
}

.sml-stat-block--compact .sml-stat-block__grid {
  width: 100%;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.625rem;
}

.sml-stat-block--compact .sml-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  grid-row: auto;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 1.25rem 0.75rem;
  border: 1px solid var(--sml-black);
  border-radius: 0;
  background: var(--sml-white);
  text-align: center;
}

.sml-stat-block--compact .sml-stat__headline {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 0.25rem;
  text-align: center;
}

.sml-stat-block--compact .sml-stat__label {
  order: -1;
  max-width: 100%;
  color: var(--sml-black);
  font-family: var(--sml-font-jost);
  font-size: clamp(0.8125rem, 2.4vw, 1.125rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.25;
  text-transform: uppercase;
  overflow-wrap: break-word;
}

.sml-stat-block--compact .sml-stat__value {
  align-self: center;
  max-width: 100%;
  color: var(--sml-purple);
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  line-height: 1.1;
  text-align: center;
}

/* ---------------------------------------------------------------------------
 * Embeds.
 * ------------------------------------------------------------------------- */
.sml-embed {
  margin-block: 1rem;
}

.sml-embed__title {
  margin: 0 0 0.75rem;
  font-family: var(--sml-font-code-pro-bold);
  font-size: 1.25rem;
}

.sml-embed video,
.sml-embed img {
  max-width: 100%;
  height: auto;
}

.sml-embed iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  border: 0;
}

.sml-embed__item + .sml-embed__item {
  margin-top: 1.25rem;
}

/* ---------------------------------------------------------------------------
 * Closed webform notice.
 * Production uses a full-width gray status bar with a left accent.
 * Same shape, Save MO Lives warning yellow + orange accent.
 * ------------------------------------------------------------------------- */
.sml-webform--closed {
  box-sizing: border-box;
  width: 100%;
  margin-block: 1.5rem;
  padding: 1rem 1.25rem;
  color: var(--sml-near-black);
  background-color: var(--sml-warning-bg);
  box-shadow: -4px 0 0 0 var(--sml-orange);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.5;
}

.sml-webform--closed p {
  margin: 0;
}

/* ---------------------------------------------------------------------------
 * Feature block (promo card in a row column).
 * Wide (element width > 50): image | text at 768px+, like production.
 * ------------------------------------------------------------------------- */
.sml-feature-block {
  padding: 1.1rem 1.2rem 1.25rem;
  border-top: 4px solid var(--sml-orange);
  background: var(--sml-gray-light);
  color: var(--sml-black);
}

.sml-feature-block__image {
  margin-bottom: 0.75rem;
}

.sml-feature-block__image img {
  display: block;
  width: 100%;
  height: auto;
}

.sml-feature-block__title {
  margin: 0 0 0.65rem;
  color: var(--sml-black);
  font-family: var(--sml-font-code-pro-bold);
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.3;
}

.sml-feature-block__text,
.sml-feature-block__text .text-content {
  margin-bottom: 0.75rem;
  color: var(--sml-black);
  font-family: var(--sml-font-jost);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.sml-feature-block__link {
  margin-top: 0.5rem;
}

.sml-feature-block--wide {
  padding: 0;
  overflow: hidden;
  border-top: 0;
  border-radius: 20px;
  background: var(--sml-gray);
  color: var(--sml-black);
}

.sml-feature-block--wide .sml-feature-block__body {
  padding: 1.1rem 1.2rem 1.25rem;
}

@media (min-width: 768px) {
  .sml-feature-block--wide {
    display: flex;
    flex-direction: row;
    align-items: stretch;
  }

  .sml-feature-block--wide .sml-feature-block__image {
    flex: 0 0 41.6667%;
    max-width: 41.6667%;
    margin-bottom: 0;
    overflow: hidden;
  }

  .sml-feature-block--wide .sml-feature-block__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .sml-feature-block--wide .sml-feature-block__body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.5rem 1.75rem;
  }
}
