.main {
  width: min(1200px, 95vw);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.33rem;
  gap: 0;
  /* gap: var(--gap); */
  --gap:1rem;

    --border: 1px solid rgba(0,0,0,0.1);
    --border-radius: 3px;
}
.content-body{
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  gap: 0;

}
.content-border {
    border: var(--border);
    border-radius: var(--border-radius);
  padding: var(--gap);
  margin-bottom: var(--gap);

}
/* .content-body:not(:has(.masonry)) { */
/*   & .content-border { */
/*     border: var(--border); */
/*     border-radius: var(--border-radius); */
/*   padding: 1rem; */
/*   }  */
/* } */
   .content-header {
  background: var(--surface);
  box-shadow: var(--shadow); 
    border-radius: var(--border-radius);
  padding: 1rem;
  }

#media-modal :is(#spinner, .main-header, .main-footer){
  display: none;
}

.layouts {
  z-index: 1000;
  position: fixed;
  bottom: 3px;
  right: 3px;
  /* width: 100%; */
  display: flex;
  justify-content: end;
  align-items:center;
  gap: 3px;
  & button {
    background: none;
    border: none;
    width: 33px;
    height: 33px;
    transition: 250ms;
    padding: 3px;
    border: var(--border);
    border-radius: var(--border-radius);
    & img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      object-position: center;
    }
  }
  & button:hover {
    filter: brightness(0.5);
    background: rgba(0,0,0,0.3);
  }
}
#media-modal:not( :has(.main) ){
  z-index: 0;
  position: relative;
  inset: 0;
  background: transparent;
  transition: 333ms;
  pointer-events: none;

}
#media-modal:has(.main){
  z-index: 6;
  position: fixed;
  inset: 0;
  background: var(--surface);
  transition: 150ms;
  pointer-events: auto;
}
#media-modal .main {

  overflow-y: auto;
  margin: 33px auto;
  min-width: min( 800px, 95vw);
  max-height: calc(100vh - 66px);
  box-shadow: var(--shadow);
}
.gallery {
  border: var(--border);
  border-radius: var(--border-radius);
  padding: var(--gap);
}

.gallery:not(.masonry) {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--gap);
  & .masonry-column {
    display: none;
  }
}
.gallery-item {
  border: 3px solid rgb(var(--always-light));
  /* border: var(--border); */
  border-radius: var(--border-radius);
  aspect-ratio: 1 / 1;
  position: relative;
  background: rgba(var(--always-light), 0.7);
  /* background: var(--surface); */
  overflow: hidden;
  box-shadow: var(--shadow); 
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.gallery-item :is( img, svg ){
  display: block;
  transition:  0.15s ease-out;
}
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.gallery svg {
  margin: 0 auto;
  width: 75%;
  height: 75%;
  object-fit: contain;
  object-position: top;
}

.gallery.featured .gallery-item:nth-child(7n  ){
  grid-column: span 2;
  grid-row: span 2;
  & img , svg{

    filter: saturate(2);
  }
}
.gallery-item:has(img) .gallery-item-title {
  opacity: 0;
}
.gallery-item-title {
  transition:  0.15s ease-out;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  padding: 1rem;
  flex: 1;
}
.gallery-item:hover  {
  & img {
    filter: saturate(1);
    transform: scale(1.1);
  }
  & .gallery-item-title {

    opacity: 1;
  }
}
/* .gallery-grid:has(.masonry-column) { */
.gallery.masonry {

  /* padding: 1rem; */
  display: flex;
  gap: var(--gap);
  & .gallery-item {
    display: none;
  }
}
/* .masonry { */
/*   display: flex; */
/*   gap: 1rem; */
/**/
/* } */
.masonry-column {
  flex: 1;
  display: flex;
  flex-direction: column;

  gap: var(--gap);
}
.masonry-item {

  /* border: 3px solid rgb(var(--always-light)); */
  border: var(--border);
  border-radius: var(--border-radius);
  position: relative;
  background: rgba(var(--always-light), 0.7);
  /* background: var(--surface); */
  overflow: hidden;
  box-shadow: var(--shadow); 
  transition:  0.15s ease-out;
  transform-origin: bottom;
  /* filter: saturate(0); */
}
.masonry-item :is( img, svg ) {
  object-position: top;
  display: block;
  transition:  0.15s ease-out;
}

.masonry-item  img ) {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.masonry-item:has(svg) {
  display: grid;
  place-items: center;
  /* margin: 0 auto; */
  & svg {
  width: 75%;
  height: 75%;
  object-fit: contain;
  }
}
/* .gallery-item:nth-child(13n + 7 ){ */

.masonry-item:hover  {
  transform: scale(1.1);
  & .masonry-item-title {
    opacity: 1;
  }
}
.masonry-item-title {
  transition:  0.15s ease-out;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  padding: 1rem;
  flex: 1;
}
.masonry-item:not(:has(svg)) .masonry-item-title {

  opacity: 0;
}
.content-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.gallery-background {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 63px;
  background: var( --surface );
  border: var(--border);
}
.gallery-title {
  height: 63px;
  /* width: 100%; */
  /* text-align: right; */
  /* display: grid; */
  /* padding: 0; */
  align-self: center;
  display: inline-flex;
  padding: 0 1rem;
  
  place-items: center;
  margin: 0;
  position: sticky;
  top: 0;
  z-index: 3;
  /* background: var( --surface ); */
  /* border: var(--border); */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.content-body .content-header  {
  display: grid;
  gap: 1rem;
    grid-template-columns:  1fr;
  /* flex-wrap: wrap; */

}
.description-container {
  grid-column: span 2;
  border-bottom: var(--border);
}
.submitted-by {
  font-size: 0.9rem;
  & :first-child {
    font-style: italic;
   padding-right: 0.5rem; 
   padding-right: 1ch; 
  }
  & :last-child {
    font-weight: bold;
  }
}
/* @media screen and (min-width: 777px) { */
/*   .content-body .content-header  { */
/*     grid-template-columns: 3fr 1fr; */
/**/
/*   } */
/* } */
/* @media screen and (max-width: 777px) { */
/*   .content-body .content-header  { */
/*     grid-template-columns:  1fr; */
/**/
/*   } */
/* } */

/* .gallery-description { */
/*   grid-column: span 2; */
/* } */
.related-resources {
  /* grid-column: span 1; */
  text-align: right;
}
.related-resources-header, .related-resources-list {
  --gap: 0.25rem;
}
.related-resources-header   {
  margin: 0 0 var(--gap) 0;
  /* margin-block: 1rem; */
  font-size: 0.75rem;
  font-family: 'signifier';
  text-transform: uppercase;
  opacity: 0.87;
}
.related-resources-list {
  list-style-type: none;
  display: flex;
  flex-direction:column;
  gap: var(--gap); 
  & li  a {
  font-size: 0.9rem;
    /* padding: 0.5rem 0; */
  }
}
.related-resources-list dt {
  font-weight: bold;
  /* margin-top: 1rem; */
}

.gallery-description {
  font-size: 1.13rem;
  padding-block: 1rem;
}
.description-container {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.gallery-title {
  max-width: 100%;
  transition: 300ms;
}
.narrow-gallery-scrolled {
    max-width: calc(100vw - 50px - 1rem);
    padding: 0 0 0 calc(50px + 1.5rem);
    padding: 0 0 0 30px;
    padding: 0 0 0 1rem;
    align-self: end;

}
@media screen and (max-width: 777px){
  .gallery-title {
  }
 /* html { */
 /*    font-size: 20px; */
 /*  } */
}
