/* 3 columns */
:root {
	--columns-setup: 1fr 1fr 1fr;
  --item-grid-column: auto;
  --item-grid-row: auto;
  --columns-image-text-direction: row;

  --item-spacing: 16px;
  --column-flex-basis: calc(33.333% - (var(--item-spacing) / 1.5));
}

.columns-two {
	--columns-setup: 1fr 1fr;
  --item-grid-column: auto;
  --item-grid-row: auto;

  --column-flex-basis: calc(50% - (var(--item-spacing) / 2));
}

.columns-one {
	--columns-setup: 1fr;
  --item-grid-column: auto;
  --item-grid-row: auto;

  --column-flex-basis: 100%; 
}

.columns-three li:has(.post-condensed) {
  --item-grid-column: 3 / 4;
}

.columns-three li:has(.post-featured),
.columns-three li:has(.post-featured-reverse) {
  --item-grid-column: 1 / 3;
  --item-grid-row: 1 / 3;
}

.columns-two li:has(.post-featured), 
.columns-two li:has(.post-featured-reverse) {
  --item-grid-column: 1 / -1;
}

.post-image .columns-image-text {
  --columns-image-text-direction: column-reverse;
}

.post-featured-reverse .columns-image-text,
.post-image-across .columns-image-text {
  --columns-image-text-direction: row-reverse;
}





  body.post-type-archive .post-image-across .columns-image-text,
  body.post-type-archive .post-image-across .columns-image-text {
    --columns-image-text-direction: row;
  }

@media screen and (min-width: 1130px) and (max-width: 1232px)
  {
    body.category-magazine .post-image-across .columns-image-text,
    body.category-event .post-image-across .columns-image-text {
      --columns-image-text-direction: column;
  }
}

@media screen and (min-width: 657px) and (max-width: 880px)
{
    body.category-magazine .post-image-across .columns-image-text,
    body.category-event .post-image-across .columns-image-text {
      --columns-image-text-direction: column;
  }
}

@media screen and (min-width: 657px) {
  .columns-one ul.query-grid > li:has(.post-featured) .columns-image-text, 
  .columns-one ul.query-grid > li:has(.post-featured-reverse) .columns-image-text {
    --columns-image-text-direction: column-reverse;
  }  
}

body.category-magazine .wp-block-post-featured-image img {
  max-height: unset;
}
 

ul.query-grid {
  display: grid !important;
  grid-template-columns: var(--columns-setup);
  grid-column-gap: var(--item-spacing);
  grid-row-gap: var(--item-spacing);
}

ul.query-flex {
  gap: var(--item-spacing) !important;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
}


ul.query > li {
  margin-block-start: 0px;
	border-top: solid 1px var(--wp--preset--color--primary);
	background-color: white;
}

ul.query-grid > li {
  grid-column: var(--item-grid-column);
  grid-row: var(--item-grid-row);
}

ul.query-flex > li {
  flex-basis: var(--column-flex-basis) !important;
}

ul.query-single > li {
  margin-block-start: 16px;
}



.column-item-text {
  display: flex !important;
  flex-direction: column;
}

.column-item-text .container-post-text {
  flex-grow: 1;
}

ul.query > li .columns-image-text {
  flex-direction: var(--columns-image-text-direction) !important;
  height: 100%;
  row-gap: 0px;
}

ul.query > li .columns-image-text > div {
  align-self: stretch !important;
}

.wp-block-query .wp-block-post-featured-image {
	overflow-y: hidden;
}

div.post-featured,
div.post-featured .wp-block-post-featured-image {
	height: 100%;
}

li .wp-block-post-featured-image {
  aspect-ratio: 16 / 9;
}

li div.post-featured .wp-block-post-featured-image {
  aspect-ratio: unset !important;
}


.wp-block-query .wp-block-post-featured-image a {
	height: 100%;
}

.wp-block-query .wp-block-post-featured-image img {
	aspect-ratio: 16 / 9;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;  
}


.columns-one ul .post-featured,
.columns-one ul .post-featured div:has(.wp-block-post-featured-image),
.columns-one ul .post-featured .wp-block-post-featured-image
{
  height: auto;
}



.post-condensed .column-item-text,
.post-text .column-item-text {
  flex-basis: 100% !important;
}

.columns-two .post-text-columns-two .column-item-image,
.columns-two .post-text-columns-two figure.wp-block-post-featured-image,
.post-condensed .column-item-image,
.post-text .column-item-image {
  display: none !important;
}





body .is-layout-constrained.container-post-text,
.container-post-text {
	margin: 8px !important;
}

.container-post-text > * {
  margin-top: 8px !important
}

.container-post-text .wp-block-post-excerpt p {
  margin: 0px !important;
}


.post-featured  .wp-block-post-title,
.post-featured-reverse  .wp-block-post-title {  font-size: var(--featured-title-font-size) !important; }
.post-condensed .wp-block-post-title {  font-size: var(--digest-title-font-size); display: -webkit-box !important; -webkit-line-clamp: 2 !important; -webkit-box-orient: vertical; overflow: hidden !important;}
.post-image .wp-block-post-title,
.post-image-across .wp-block-post-title     {  font-size: var(--image-title-font-size) !important; }
.post-text .wp-block-post-title      {  font-size: var(--text-title-font-size) !important; }

.post-featured  .wp-block-post-excerpt,
.post-featured-reverse  .wp-block-post-excerpt {  font-size: var(--featured-excerpt-font-size) !important; }
.post-condensed .wp-block-post-excerpt {  display: none  !important}
.post-image .wp-block-post-excerpt,
.post-image-across .wp-block-post-excerpt     {  font-size: var(--image-excerpt-font-size) !important; }
.post-text .wp-block-post-excerpt      {  font-size: var(--text-excerpt-font-size) !important; }

.post-featured  .wp-block-post-date,
.post-featured-reverse  .wp-block-post-date {  font-size: var(--featured-date-font-size) !important; }
.post-condensed .wp-block-post-date {  font-size: var(--digest-date-font-size) !important; }
.post-image .wp-block-post-date,
.post-image-across .wp-block-post-date     {  font-size: var(--image-date-font-size) !important; }
.post-text .wp-block-post-date      {  font-size: var(--text-date-font-size) !important; }




.post-featured .wp-block-post-title a {
  -webkit-line-clamp: 3;  
}

.hide-first-6 > ul > li:nth-child(-n+5) {
  display: none;
}

.hide-last-6 > ul > li:nth-child(n+7) {
  display: none;
}



.wp-block-query-pagination-numbers {
  display: flex;
}
.page-numbers {
    color: white;
    background: var(--wp--preset--color--primary) !important;
    border-color: #c8d6d6 #9EADAD #9EADAD #c8d6d6;
    margin: 0 5px 5px 0;
    padding: 6px 9px 5px 9px;
    display: block;
    text-align: center;
}

.page-numbers.current {
    background: var(--wp--preset--color--secondary) !important;
    text-shadow: unset !important;
    -webkit-box-shadow: unset !important;
    -moz-box-shadow: unset !important;
    box-shadow: unset !important;
}


/* GADS POSITIONING */
@media (max-width: 656px) {
  body.home .query-grid div.widget-search {
    grid-row: 2 / 3;
  }

  body.home .query-grid #MFM_PA_ADVISER_HPU_HPU_1 {
    grid-row: 11 / 12;
  }

  body.home .query-grid #MFM_PA_ADVISER_HPU_HPU_2 {
    grid-row: 5 / 6;
  }

  body.archive .query-flex div.widget-search {
    order: 25;
  }

  body.archive .query-flex #MFM_PA_ADVISER_HPU_HPU_1 {
    order: 85;
    margin-left: auto;
    margin-right: auto;
  }      

  ul.query-flex > li:nth-of-type(1)  { order: 10; }
  ul.query-flex > li:nth-of-type(2)  { order: 20; }
  ul.query-flex > li:nth-of-type(3)  { order: 30; }
  ul.query-flex > li:nth-of-type(4)  { order: 40; }
  ul.query-flex > li:nth-of-type(5)  { order: 50; }
  ul.query-flex > li:nth-of-type(6)  { order: 60; }
  ul.query-flex > li:nth-of-type(7)  { order: 70; }
  ul.query-flex > li:nth-of-type(8)  { order: 80; }
  ul.query-flex > li:nth-of-type(9)  { order: 90; }
  ul.query-flex > li:nth-of-type(10)  { order: 100; }
  ul.query-flex > li:nth-of-type(11)  { order: 110; }
  ul.query-flex > li:nth-of-type(12)  { order: 120; }
}