:root {
  /* Text - Container */
  --text--container--margin: 0;
  --text--container--padding: 0;
  --text--container--text_colour: var(--dark_2, #61615f);
  --text--container--font_family: 'Roboto';
  --text--container--font_size: 1.375rem;
  --text--container--font_weight: 400;
  --text--container--font_style: normal;
  --text--container--line_height: 160%;
  /* Text - Text Styles */
  --text--bold--text_colour: var(--dark_2, #61615f);
  --text--underline--text_colour: var(--dark_2, #61615f);
  --text--underline--background_colour: var(--light_1, #FFFFFF);
  --text--italic--text_colour: var(--dark_2, #61615f);
  /* Text - Link */
  --text--link--text_colour: var(--dark_1, #1d42a6);
  --text--link--font_family: 'Roboto';
  --text--link--font_weight: 500;
  --text--link--font_style: normal;
  /* Text - List */
  --text--list--text_colour: var(--dark_2, #61615F);
  --text--list--bullet_colour: var(--dark_accent, #1d42a6);
  --text--list--font_family: 'Roboto';
  --text--list--font_weight: 500;
  --text--list--font_style: normal;
  --text--list--font_size: 1.375rem;
  --text--list--line_height: 120%;
  --text--list--bullet_spacing: 33px;
  --text--list--bullet_text_spacing: 13px;
  --text--list--ol_bullet_spacing: 0 13px 0 6px;
  /* Text - Table */
  --text--table--text_colour: var(--dark_2, #61615F);
  --text--table--background_colour: var(--light_1, #FFFFFF);
  --text--table--header_text_colour: var(--dark_3, #002147);
  --text--table--header_background_colour: var(--light_3, #B9D6F2);
  --text--table--alternate_text_colour: var(--dark_3, #002147);
  --text--table--alternate_background_colour: var(--light_2, #F2F0F0);
  /* Text - Line */
  --text--horizontal-line--text_colour: var(--dark_2, #61615F);
  /* Text - Intro paragraph */
  --text--intro-paragraph--font_size: 1.75rem;
  --text--intro-paragraph--line_height: 2.875rem;
  /* Heading styling */
  --text--heading--text_colour: var(--dark_3, #002147);
  --text--heading--h2--font_family: var(--oxfcms-heading--h2--font_family, 'Noto Serif');
  --text--heading--h2--font_size: var(--oxfcms-heading--h2--font_size, 2.75rem);
  --text--heading--h2--font_weight: var(--oxfcms-heading--h2--font_weight, 400);
  --text--heading--h2--font_style: var(--oxfcms-heading--h2--font_style, normal);
  --text--heading--h2--line_height: var(--oxfcms-heading--h2--line_height, 120%);
  --text--heading--h3--font_family: var(--oxfcms-heading--h3--font_family, 'Noto Serif');
  --text--heading--h3--font_size: var(--oxfcms-heading--h3--font_size, 2.125rem);
  --text--heading--h3--font_weight: var(--oxfcms-heading--h3--font_weight, 400);
  --text--heading--h3--font_style: var(--oxfcms-heading--h3--font_style, normal);
  --text--heading--h3--line_height: var(--oxfcms-heading--h3--line_height, 120%);
  --text--heading--h4--font_family: var(--oxfcms-heading--h4--font_family, 'Noto Serif');
  --text--heading--h4--font_size: var(--oxfcms-heading--h4--font_size, 1.75rem);
  --text--heading--h4--font_weight: var(--oxfcms-heading--h4--font_weight, 400);
  --text--heading--h4--font_style: var(--oxfcms-heading--h4--font_style, normal);
  --text--heading--h4--line_height: var(--oxfcms-heading--h4--line_height, 120%);
  --text--heading--h5--font_family: var(--oxfcms-heading--h5--font_family, 'Noto Serif');
  --text--heading--h5--font_size: var(--oxfcms-heading--h5--font_size, 1.5rem);
  --text--heading--h5--font_weight: var(--oxfcms-heading--h5--font_weight, 400);
  --text--heading--h5--font_style: var(--oxfcms-heading--h5--font_style, normal);
  --text--heading--h5--line_height: var(--oxfcms-heading--h5--line_height, 120%);
  --text--heading--h6--font_family: var(--oxfcms-heading--h6--font_family, 'Noto Serif');
  --text--heading--h6--font_size: var(--oxfcms-heading--h6--font_size, 1.375rem);
  --text--heading--h6--font_weight: var(--oxfcms-heading--h6--font_weight, 400);
  --text--heading--h6--font_style: var(--oxfcms-heading--h6--font_style, normal);
  --text--heading--h6--line_height: var(--oxfcms-heading--h6--line_height, 120%);
  /* Text - Caption */
  --text--caption--background_colour: var(--caption--background_colour, #002147);
  --text--caption--text_colour: var(--caption--text_colour, #FFFFFF);
  /* Text - Caption - Text */
  --text--caption--text--font_family: var(--caption--text--font_family, 'Roboto');
  --text--caption--text--font_size: var(--caption--text--font_size, 0.8em);
  --text--caption--text--font_style: var(--caption--text--font_style, normal);
  --text--caption--text--line_height: var(--caption--text--line_height, 1em);
  /* Text - Caption - Prefix */
  --text--caption--prefix--text_colour: var(--caption--prefix--text_colour, #49B6FF);
  --text--caption--prefix--font_size: var(--caption--prefix--font_size, 0.7em);
  --text--caption--prefix--line_height: var(--caption--prefix--line_height, 160%);
}
/* Main styling */
[data-component-id="oxfcms_components:oxfcms_text"],
.oxfcms-text {
  color: var(--text--container--text_colour);
  font-family: var(--text--container--font_family);
  font-size: var(--text--container--font_size);
  font-weight: var(--text--container--font_weight);
  font-style: var(--text--container--font_style);
  line-height: var(--text--container--line_height);
  letter-spacing: var(--core--body-font_letter_spacing);
  .field--name-field-wysiwyg-content {
    color: var(--text--container--text_colour);
    padding: var(--text--container--padding);
    /* Paragraphs */
    p {
      /* Intro text */
      & .intro {
        font-size: var(--text--intro-paragraph--font_size);
        line-height: var(--text--intro-paragraph--line_height);
      }
      > * {
        padding: 0;
      }
    }
    /* Lists */
    ol,
    ul {
      margin: clamp(1.25rem, 1.25rem + 0.5vw, 1.75rem) 0;
      padding-left: var(--text--list--bullet_spacing);
      li {
        color: var(--text--list--text_colour);
        font-family: var(--text--list--font_family);
        font-weight: var(--text--list--font_weight);
        font-style: var(--text--list--font_style);
        font-size: var(--text--list--font_size);
        line-height: var(--text--list--line_height);
        &::marker {
          color: var(--text--list--bullet_colour);
        }
      }
      ol, ul {
        margin-top: clamp(.5rem, .375rem + 0.5vw, .875rem);
      }
    }
    ul {
      li {
        &::before {
          content: "";
        }
      }
    }
    ol {
      list-style: none;
      counter-reset: orderedList;
      > li {
        counter-increment: orderedList;
        position: relative;;
        > ol {
            counter-reset: orderedList2;
          > li {
            counter-increment: orderedList2;
            > ol {
              counter-reset: orderedList3;
              > li {
                counter-increment: orderedList3;
                > ol {
                  counter-reset: orderedList4;
                  > li {
                    counter-increment: orderedList4;
                  }
                  > li::before {
                    content: counter(orderedList) '.' counter(orderedList2) '.' counter(orderedList3) '.' counter(orderedList4) '.';
                  }
                }
              }
              > li::before {
                content: counter(orderedList) '.' counter(orderedList2) '.' counter(orderedList3) '.';
              }
            }
          }
          > li::before {
            content: counter(orderedList) '.' counter(orderedList2) '.';
          }
        }
      }
      > li::before {
        content: counter(orderedList) '.';
        color: var(--text--list--bullet_colour);
        padding: var(--text--list--ol_bullet_spacing);
        position: absolute;
        right: 100%;
      }
    }
    &.text-formatted > ol,
    &.text-formatted > ul {
      > li {
        margin-bottom: 22px;
        li {
          margin-bottom: 6px;
          &:first-of-type {
            margin-top: 6px;
          }
        }
      }
    }
    /* Links */
    a {
      color: var(--text--link--text_colour);
      background-color: var(--text--link--background_colour);
      font-family: var(--text--link--font_family);
      font-weight: var(--text--link--font_weight);
      font-style: var(--text--link--font_style);
    }
    /* Headings */
    h2 {
      font-family: var(--text--heading--h2--font_family);
      font-size: var(--text--heading--h2--font_size);
      font-weight: var(--text--heading--h2--font_weight);
      font-style: var(--text--heading--h2--font_style);
      line-height: var(--text--heading--h2--line_height);
    }
    h3 {
      font-family: var(--text--heading--h3--font_family);
      font-size: var(--text--heading--h3--font_size);
      font-weight: var(--text--heading--h3--font_weight);
      font-style: var(--text--heading--h3--font_style);
      line-height: var(--text--heading--h3--line_height);
    }
    h4 {
      font-family: var(--text--heading--h4--font_family);
      font-size: var(--text--heading--h4--font_size);
      font-weight: var(--text--heading--h4--font_weight);
      font-style: var(--text--heading--h4--font_style);
      line-height: var(--text--heading--h4--line_height);
    }
    h5 {
      font-family: var(--text--heading--h5--font_family);
      font-size: var(--text--heading--h5--font_size);
      font-weight: var(--text--heading--h5--font_weight);
      font-style: var(--text--heading--h5--font_style);
      line-height: var(--text--heading--h5--line_height);
    }
    h6 {
      font-family: var(--text--heading--h6--font_family);
      font-size: var(--text--heading--h6--font_size);
      font-weight: var(--text--heading--h6--font_weight);
      font-style: var(--text--heading--h6--font_style);
      line-height: var(--text--heading--h6--line_height);
    }
    /* Embedded image */
    figure {
      margin-left: 0;
      &:has(+ *) {
        margin-bottom: clamp(3rem, 2rem + 2vw, 3.75rem);
      }
      article.media {
        font-size: 0;
        line-height: 0;
        img {
          border-radius: 10px;
        }
      }
    }
    /* With captions */
    .caption-drupal-media {
      article.media {
        font-size: 0;
        line-height: 0;
        img {
          border-top-left-radius: 10px;
          border-top-right-radius: 10px;
          border-bottom-left-radius: 0;
          border-bottom-right-radius: 0;
        }
      }
      figcaption {
        background-color: var(--text--caption--background_colour);
        color: var(--text--caption--text_colour);
        font-family: var(--text--caption--text--font_family);
        font-size: var(--text--caption--text--font_size);
        font-style: var(--text--caption--text--font_style);
        line-height: var(--text--caption--text--line_height);
        display: block;
        width: auto;
        padding: var(--space-2xs);
        overflow: hidden;
        border-bottom-left-radius: 10px;
        border-bottom-right-radius: 10px;
        &::before {
          content: 'info_outline';
          color: var(--text--caption--prefix--text_colour);
          font-family: 'Material Icons';
          font-weight: normal;
          font-style: normal;
          font-size: var(--text--caption--prefix--font_size);
          line-height: var(--text--caption--prefix--line_height);
          margin-right: 5px;
          letter-spacing: normal;
          text-transform: none;
          display: inline-block;
          white-space: nowrap;
          word-wrap: normal;
          direction: ltr;
          -webkit-font-feature-settings: 'liga';
          -webkit-font-smoothing: antialiased;
          top: 1px;
          position: relative;
        }
      }
    }
  }
}
/* Narrowing logic */
.l--layout-onecolumn {
  .l__main {
    .l__primary {
      > .paragraph--type--text {
        .oxfcms-text {
          width: var(--oxfcms-component--small-width);
          margin: auto;
        }
      }
      > .paragraph--type--oxfcms-tabs {
        .me-tabs__tab-content {
         .paragraph--type--text {
            .oxfcms-text {
              width: var(--oxfcms-component--small-width);
              margin: auto;
            }
          }
        }
      }
    }
  }
}
/* HEADINGS SPACING — only those that are direct children in .l__region (not cards etc) */
.l__main > .l__region > .paragraph--type--text :is(h1, h2, h3, h4, h5, h6),
.l__main > .l__region > .paragraph--type--oxfcms-heading :is(h1, h2, h3, h4, h5, h6) {
  color: var(--text--heading--text_colour);
  margin-top: clamp(3rem, 2.5rem + 0.5vw, 3.75rem); /* 48px–60px */
  margin-bottom: clamp(1rem, 0.75rem + 0.5vw, 1.25rem); /* 16px–20px */
}
/* Breakpoint - Small Desktop */

@media (width < 1280px) {
  .oxfcms-text {
    --text--container--font_size: 1.25rem;
    --text--heading--h1--font_size: 2.625rem;
    --text--heading--h2--font_size: 2.25rem;
    --text--heading--h3--font_size: 1.875rem;
    --text--heading--h4--font_size: 1.625rem;
    --text--heading--h5--font_size: 1.375rem;
    --text--heading--h6--font_size: 1.25rem;
    --text--intro-paragraph--font_size: 1.5rem;
    --text--intro-paragraph--line_height: 2.375rem;
  }
}
/* Breakpoint - Tablet */

@media (width < 768px) {
  .oxfcms-text {
    --text--container--font_size: 1.125rem;
    --text--heading--h1--font_size: 2.125rem;
    --text--heading--h2--font_size: 1.75rem;
    --text--heading--h3--font_size: 1.5rem;
    --text--heading--h4--font_size: 1.25rem;
    --text--heading--h5--font_size: 1.125rem;
    --text--heading--h6--font_size: 1.125rem;
    --text--intro-paragraph--font_size: 1.25rem;
    --text--intro-paragraph--line_height: 2rem;
  }
}
