/* brand logo maximum height within masthead | global */
@media screen and (min-width: 40rem) {
  #uct-landing-banner-block[id] a img {
    max-height: 90%;
  }
}

/* Images with src of svg, set height to 100% */
#uct-landing-banner-block a img[src$=".svg"] {
  height: min(25vw, 200px)
}

/* Increase min-height of megamenu */
@media screen and (min-width: 67.5rem) {
  .block-uct-domain-menu-active-domain-menu-block.block-region--primary-menu > .menu > .menu-item.mega-menu > .menu[class] {
    min-height: 22.75rem;
  }
}

/* improved calculation on width of page hero pass 90em | global */
@media screen and (min-width: 90em) {
  .section-main #hero[id] {
    width: calc(100% + (50vw - 45em) + 2rem);
  }
}

@media screen and (min-width: 120em) {
  .section-main #hero[id] {
    width: calc(100% + (60rem - 45em) + 2rem);
  }
}

/* page hero title and summary right padding | global */
article.hero {
  padding: 0 1rem;
}

/* Microview filter: hide wrapper with margin as well when filter option is disabled */
[id^="uct-microview--"].no-filters .view-filters {
  display: none;
}

/* Footer social media reset flex 1 to use space better */
.social-media-list-wrapper .social-media-list--inline[class] li {
  flex: 0 1 2rem;
  justify-content: center;
  display: inline-flex;
}

/* Carousel fullwidth title alignment to start at start of content */
.uct-carousel__full-width .rw-paragraph--title {
  max-width: 66rem;
  margin-left: auto;
  margin-right: auto;
}

.card--contact[class] a {
  height: 100%;
}

/* 
---------------------------
|        Spacing          |
---------------------------
*/

/* Article page bottom margin */
.page-node-type-article .node--type-article.full {
  margin-bottom: 2rem;
}

/* Removing margin on home-page random summary field */
:not(#hero) + .main-content .region-content:first-child .node--type-page.full > .node__content > .field--type-text-with-summary {
  margin-bottom: 0;
}

/* Appling paragraph title styling to upcoming event paragraph title | Global */
.field__item > .paragraph--type--upcoming-events > h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

:not(#hero) + .main-content .region-content:first-child .node__content > .field--name-field-components > .field__item:first-child {
  margin-bottom: 2.5rem;
}

/* Mobile fullwidth carousel */
.uct-carousel__full-width, 
.uct-carousel__full-width--slim {
  margin: auto calc(50% - 50vw);
}

/* WYSIWYG Advanced Left and right image spacing */
@media print, screen and (min-width: 64em) {
  .rw-paragraph--wysiwyg--has-image[class] > .cell:first-of-type .field--name-field-image-ref {
    margin-left: 0;
    margin-right: 0;
  }

  /* left */
  .rw-paragraph--wysiwyg--has-image[class] > .cell[style="order: 0"] .field--name-field-image-ref {
    margin-right: 1rem;
  }

  /* right */
  .rw-paragraph--wysiwyg--has-image[class] > .cell[style="order: 1"] .field--name-field-image-ref {
    margin-left: 1rem;
    text-align: right;
  }
  
}

/* Mobile article title spacing */
.node--type-article.full > .node__header > .node__title[class] {
  margin: 1rem auto;
}
@media print, screen and (min-width: 40em) {
  .node--type-article.full > .node__header > .node__title[class] {
    margin: auto auto auto 0;
  }
}

/* 
HTML headings spacing 
- applying default margin-top back to heading
- appling smaller margin-top to smaller preceeding headings
*/
.tex2jax_process[class] > * + *:is(h1,h2,h3,h4,h5,h6) {
  margin-top: 2.5rem;
}

.tex2jax_process[class] > h1 + h2, 
.tex2jax_process[class] > h2 + h3, 
.tex2jax_process[class] > h3 + h4, 
.tex2jax_process[class] > h4 + h5, 
.tex2jax_process[class] > h5 + h6 {
  margin-top: 1rem;
}

.card-grid-item > [class^='h']:first-child {
  margin-top: 0;
}

/* END SPACING */

/* Contact group col override when aside is present */
@media print, screen and (min-width: 64em) {
  .node__section.medium-8 .view-display-id-bk_contacts_teaser_by_pid .view-content > .col {
    width: calc(50% - 1rem);
  }
}

/* Mobile aux menu | Hiding 2 of the duplicate menus */
.global-navigation-menu__list.accordion-menu > .menu > li.menu-item__header-mobile:not(:last-child) {
  display: none;
}

/* Mobile menu height on mobile browsers with utility menus */
@media screen and (max-width: 67.5rem) {
  .global-navigation-menu.is-expanded[class] {
    max-height: 100svh;
  }
}


/* Heading small tag */
.tex2jax_process[class] small {
  font-weight: normal;
  color: #666;
}

/* 
Carousel changes
*/
/*
Casourel classes

.uct-carousel - wrapper

.uct-carousel .uct-carousel__full-width--slim - fullwidth slim
.uct-carousel .count--disabled - count--disabled
.uct-carousel .image-right-text-left - image right

*/
.uct-carousel > div {
  background-color: var(--uct-color--bg--component, var(--uct-color--primary, var(--rw-primary-color, #00243a)));
}

@media print, screen and (min-width: 64em) {
  .uct-carousel > div {
    background-color: transparent;
  }
}

/* Fullwidth carousel component */
@media print, screen and (min-width: 64em) {

  /* Full slim disabled counter image left | text cutting off */
  .uct-carousel[class] .uct-carousel__full-width--slim.image-left-text-right .carousel-slide .node__content, 
  .uct-carousel[class] .uct-carousel__full-width--slim.image-left-text-right .carousel-slide .media__content {
    left: auto;
    padding: 1rem 0 0 2.5rem;
    right: 4rem;
  }

  /* Reduce slim */
  .uct-carousel[class] .uct-carousel__full-width--slim.count--disabled .carousel-slide {
    padding: 2rem 4rem;
  }

  .uct-carousel .uct-carousel__full-width--slim.image-right-text-left.count--disabled .carousel-slide .node__content, 
  .uct-carousel .uct-carousel__full-width--slim.image-right-text-left.count--disabled .carousel-slide .media__content,
  .uct-carousel .uct-carousel__full-width--slim.image-left-text-right.count--disabled .carousel-slide .node__content, 
  .uct-carousel .uct-carousel__full-width--slim.image-left-text-right.count--disabled .carousel-slide .media__content {
    padding: 0;
  }

  /* Alignment of arrows changes */
  .uct-carousel .count--enabled .slick__arrow, 
  .album-carousel-wrapper .count--enabled .slick__arrow {
    top: 3rem;
    font-size: 2.5rem;
  }

  .count--enabled .album-carousel .slick-arrow, 
  .count--enabled .slick--optionset--carousel .slick-arrow,
  .count--enabled .album-carousel .slick-arrow::before, 
  .count--enabled .slick--optionset--carousel .slick-arrow::before {
    width: 2rem;
    height: 2.25rem;
  }

  .count--enabled .album-carousel .slick-prev, 
  .count--enabled .slick--optionset--carousel .slick-prev {
    left: -2.5rem;
  }

  .count--enabled .album-carousel .slick-next, 
  .count--enabled .slick--optionset--carousel .slick-next {
    right: -2.5rem;
  }

  .count--enabled[class].image-right-text-left .slick__arrow, 
  .count--enabled[class].image-right-text-left .slick__arrow {
    left: 8.5rem;
    transform: none;
  }

  .count--enabled[class].image-left-text-right .slick__arrow, 
  .count--enabled[class].image-left-text-right .slick__arrow {
    left: 57.2%;
    transform: none;
  }

  .count--enabled .album-carousel .slick-arrow.slick-prev::before {
    mask-position: left;
  }

  .count--enabled .album-carousel .slick-arrow.slick-next::before {
    mask-position: right;
  }

  /* slide content  */
  .uct-carousel__full-width[class] .image-right-text-left .carousel-slide .node__content, 
  .uct-carousel__full-width[class] .image-right-text-left .carousel-slide .media__content {
    max-width: 50%;
  }

  .uct-carousel__full-width[class] .image-left-text-right .carousel-slide .node__content, 
  .uct-carousel__full-width[class] .image-left-text-right .carousel-slide .media__content {
    max-width: 45.6%;
    margin-left: 0;
  }

  .carousel-slide[class] .node__title,
  .carousel-slide .media__content .field--name-name {
    font-size: 2.5rem;
    line-height: 1.2em;
    margin-bottom: 1.5rem;
  }

  .carousel-slide[class] .field--name-body, 
  .carousel-slide[class] .field--name-body > .lead, 
  .carousel-slide[class] .field--name-field-caption-long, 
  .carousel-slide[class] .field--name-field-caption-long > .lead {
    font-size: 1.125rem;
  }

  .uct-carousel[class] .node__content .field--type-text-with-summary {
    margin-bottom: .5rem;
  }
}

/* Fullwidth Slim arrow alignment */
@media print, screen and (min-width: 64em) {
  .uct-carousel__full-width--slim.count--enabled.image-left-text-right .slick__arrow, 
  .uct-carousel__full-width--slim.count--enabled.image-left-text-right .slick__arrow {
    left: unset;
    right: calc(4rem + (48% * .85));
    transform: translateX( calc(100% + 5rem) );
  }
}

@media print, screen and (min-width: 1680px) {
  .uct-carousel__full-width--slim.count--enabled.image-left-text-right .slick__arrow, 
  .uct-carousel__full-width--slim.count--enabled.image-left-text-right .slick__arrow {
    right: calc(4rem + (50vw - (5% * .85)));
  }
}

@media print, screen and (min-width: 1900px) {
  .uct-carousel__full-width--slim.count--enabled.image-left-text-right .slick__arrow, 
  .uct-carousel__full-width--slim.count--enabled.image-left-text-right .slick__arrow {
    right: calc(4rem + (57% * .85));
  }
}

/* media and audio */
@media print, screen and (min-width: 64em) {
  .uct-carousel__full-width--slim .carousel-slide .field--name-field-media-image[class], 
  .uct-carousel__full-width--slim .carousel-slide .field--name-field-media-audio-file[class], 
  .album-carousel-wrapper__full-width--slim .carousel-slide .field--name-field-media-image[class], 
  .album-carousel-wrapper__full-width--slim .carousel-slide .field--name-field-media-audio-file[class] {
    max-width: 60%;
  }
  
}

@media print, screen and (min-width: 100em) {
  .uct-carousel__full-width--slim .carousel-slide .field--name-field-media-image[class], 
  .uct-carousel__full-width--slim .carousel-slide .field--name-field-media-audio-file[class], 
  .album-carousel-wrapper__full-width--slim .carousel-slide .field--name-field-media-image[class], 
  .album-carousel-wrapper__full-width--slim .carousel-slide .field--name-field-media-audio-file[class] {
    max-width: 60%;
  }
}

/* Font awesome UL icons UL 'reset' */
.text-formatted ul.fa-ul, 
.uct-accordion__content ul.fa-ul {
  margin-left: 0;
}

.text-formatted ul.fa-ul > li::before, 
.uct-accordion__content ul.fa-ul > li::before {
  display: none;
}

.text-formatted ul.fa-ul > li, 
.uct-accordion__content ul.fa-ul > li {
  padding-left: 2em;
}

.fa-ul span.fa-li {
  left: 0;
}

/* Pagination */

nav.pager[class] ul, ul.pager[class], ol.pager[class] {
  margin: 1rem 0;
}

.pagination .current[class] {
  padding: 0;
  background: none;
}

@media print, screen and (min-width: 40em) {
  .node__aside blockquote, 
  .node__aside blockquote > p {
    font-size: 1.25rem;
  }
}

/* -------------------- */
/* Subsite themer fixes */
/* -------------------- */

/* Masthead colour */
html:root {
  --uct-color--bg--masthead: var(--uct--color--background, transparent);
  --uct-color--bg--masthead--mobile: var(--uct--color--background--masthead, var(--uct-color--background, transparent));
}

#page--landing-banner {
  background-color: var(--uct-color--bg--masthead, var(--rw-background-color, transparent));
}

.region-landing-banner[class] {
  background-color: transparent;
}

/* Event hero */
.node--view-mode-hero[class] > .node__header {
  background-color: var(--uct-color--bg--hero, var(--uct-color--secondary, var(--rw-secondary-color, #72808a)));
}

/* Main Nav icons */
@media print, screen and (min-width: 67.5rem) {
  .block-uct-domain-menu-active-domain-menu-block.block-region--primary-menu[class] .menu-item.is-dropdown-submenu-parent > a:hover::after, 
  .block-uct-domain-menu-active-domain-menu-block.block-region--primary-menu[class] .menu-item.is-dropdown-submenu-parent.is-active > a::after, 
  .block-uct-domain-menu-active-domain-menu-block.block-region--primary-menu[class] .menu-item > a[download]:hover::after, 
  .block-uct-domain-menu-active-domain-menu-block.block-region--primary-menu[class] .menu-item > a.is-external:hover::after {
    background-color: currentColor;
  }
}

/* 
Table background and tr even colour and tr hover colours
Adding opacity to tr so it works better with dark page background colours.
Setting table bg to transparent
 */
table thead, table tbody, table tfoot {
  background-color: transparent;
}

body table > tbody tr:nth-child(2n) {
  background: hsl(210 50% 50% / 5%);
}

body table > tbody tr:hover, body table > tbody tr:nth-child(2n):hover {
  background: hsl(230 69% 50% / 5%);
}

/* 
Highlight colours extend | Global
*/
.teaser--contact[class]:hover, 
.teaser--summary--contact[class]:hover {
  border-bottom: 3px var(--uct-color--highlight, var(--rw-link-color, #0076d1)) solid;
}

/* Extend subsite themer colours to breadcrumbs */
@media print, screen and (min-width: 40em) {
  nav.breadcrumb[class] a,
  nav.breadcrumb[class] li {
    font-weight: 400;
    color: var(--uct-color--copy--hero, var(--uct-color--bg, var(--rw-background-color, #fff)));
  }
  nav.breadcrumb[class] li::before {
    background-color: currentColor;
  }
}

/* Mobile footer side background-color */
@media print, screen and (max-width: 39.9375em) {
  .page-footer[class] .footer-first {
    padding: 2rem 0.75rem;
    width: 100vw;
    margin: 0 calc(50% - 50vw);
  }
}

/* Mobile nav colour variable name correction */
@media print, screen and (max-width: 67.5rem) {
  .global-navigation-menu__list.accordion-menu ul[region="primary_menu"] a {
    color: var(--uct-color--copy--primary--nav--hover, var(--rw-background-color, #fff));
  }
  .global-navigation-menu .submenu-toggle[class]:after {
    background-color: var(--uct-color--copy--primary--nav--hover, var(--uct-color--bg, var(--rw-background-color, #fff)));
  }
  .global-navigation-menu__list.accordion-menu .is-submenu-item[class]:first-child > a,
  .global-navigation-menu__list.accordion-menu .is-submenu-item[class] a,
  .global-navigation-menu[class] .submenu-toggle {
    border-color: var(--uct-color--copy--primary--nav--hover, var(--uct-color--bg, var(--rw-background-color, #fff)));
  }
}

h1.node__title.text-light[class] a, 
h2.node__title.text-light[class] a, 
h3.node__title.text-light[class] a, 
h4.node__title.text-light[class] a, 
h5.node__title.text-light[class] a, 
h6.node__title.text-light[class] a {
  background-image: linear-gradient(to right, currentColor, currentColor);
}

/* Accordion component title */
.uct-accordion__title {
  margin-top: 2.5rem;
}

/* Album modal image, video and remote video sizing */
.node--type-album.modal[class] video, 
.node--type-album.modal[class] img {
  width: auto;
  display: block;
  max-width: 100%;
  max-height: 100%;
}

/* remote video */
.node--type-album.modal .media--blazy.media--ratio {
  height: auto;
}

/* Album overlay link colour | undo styling */
.node--type-album.overlay #slide-main[id] a {
  color: inherit;
  text-decoration: underline;
}

.node--type-album.overlay #slide-main[id] a:hover {
  color: inherit;
  opacity: .8;
}

/* Accordion reducing sizes */
.uct-accordion__question[class] {
  font-weight: 400;
  padding: 1rem 1.5rem 1rem 1rem;
  font-family: var(--rw-body-font-family, "Roboto", sans-serif);
  font-size: 1.25rem;
}

/* Webform amendments | global */

/* element descriptions */
.webform-select-other-input + .description {
  margin-top: 0.125rem;
  font-size: 0.75rem;
  font-style: italic;
}

/* Article layout aside fix */
.node--type-article.full > .node__content.full-width > .node__meta[class],
.node--type-article.full > .node__content.full-width > .node__main[class] {
  flex: 1 0 calc(66.66667% - 2rem);
}

/* Global nav set to use primary-colour */
#globalNavSubMenu.is-expanded[class] {
  border-color: var(--uct-color--primary, #0098db);
}

/* Full contact space below content */
@media print, screen and (min-width: 40em) {
  .page-node-type-contact .node--type-contact.full .node__content[class] {
    margin: 0 0 2rem;
  }
}

/* Fontawesome 6 brand icon as a fallback */
.fa-solid[class], .fas[class] {
  font-family: "Font Awesome 6 Free", "Font Awesome 6 brands";
}

/* Alignment class spacing on media */
.align-left.media {
  margin-right: 1rem;
}

.align-right.media {
  margin-left: 1rem;
}

/* Accordion clearfix on content to fix miscalculation of content size */
.uct-accordion__content::after {
  display: table;
  clear: both;
  content: "";
}

/* Accordion heading and media spacing */
.uct-accordion__content .media,
.uct-accordion__content h2,
.uct-accordion__content h3,
.uct-accordion__content h4,
.uct-accordion__content h5,
.uct-accordion__content h6 {
  margin-bottom: 1rem;
}

.uct-accordion__content .caption .media {
  margin-bottom: 0;
}