@media screen {                                                       
  .sticky {
    display: block;
  }

  .post,
  .page {
    margin: 0;
  }

  .updated:not(.published) {
    display: none;
  }

  .page-content,
  //.entry-content,
  .entry-summary {
    margin: 1.5em 0 0;
  }
  .site-main {
    .entry-title {
      margin: 0.5em 0 0 0;
    }
  }
  .page-links {
    clear: both;
    margin: 0 0 1.5em;
  }
  .home-featured {
      padding: 0 1rem;
    }

    /*
     * big lletters block below titles
     * */

    .xarxaprod-intro {
      line-height: 1.2;
      margin-top: 0;
      margin-bottom: 0;
      //font-weight: 100;
    }
   /*
    * blocks columns with line below each block
    * see Que oferim?
    * */

   .ratlla-abaix,.border-bottom {
     .wp-block-column {
         position:relative;
     }
      .wp-block-heading {
          padding-top: 1em;
          padding-bottom: 2em;
          display:inline-grid;
        &:after {
          content: "";
          border-bottom:0.05em solid $color__black;
          width: 100%;
          position: absolute;
          bottom: 0;
        }
      }
   }
   
   /*
    * download files 
    * line and icon to show download
    *
    * * * * * * * */
   .descarregar-fitxers,.descarga-fichero,.download-files {
     a {
       display: inline-block;
       width: 100%;
       border-bottom: $border__line;
       &:after {
         content: "";
         display:inline-block;
         float: right;
         width: 1em;
         height: 1em;
         background-image: url(./assets/img/icon-download.svg);
         background-repeat: none;
         background-size: contain;
       }
     }
   }

  /* used in 
   * ./template-parts/section-eachpost.php 
   * */
  .xarxaprod-card-each {
    display: flex;
    flex-direction: column;
    .entry-title,h6 {
      margin: 0;
      padding: 0.5rem 1em 0.5em 0;
      border-bottom: 1px solid $color__black;
    }
    .xarxaprod-deadline {
      text-transform: uppercase;
    }
    p {
      padding: 0.5rem 0;
      margin:0;
    }
    .excerpt {
      border-bottom: 1px solid $color__black;
      margin-bottom: 0.5em;
      padding: 0.5em 0;
    }
    .more-link {
     margin-top: 1rem;
    }
  }

  /* used in 
   * ./template-parts/content-xarxaprod-ajut.php 
   * ./template-parts/content-xarxaprod-convo.php 
   * ./template-parts/section-eachpost.php 
   * */
  .xarxaprod-fund-info-fields, 
  .xarxaprod-fund-info-contact-fields {
    display: grid;
    .xarxaprod-fund-info-field {
      padding-bottom: 1rem;
      border-bottom: 1px solid $color__black;
    }
    h6 {
      font-size: $font__size-body*2.4;
      font-variant: all-petite-caps;
    }
    p {
      margin: 0.5rem 0 0 0;
    }
    li {
      font-size: $font__size-body*1.3;
    }
  }
  .xarxaprod-fund-info-contact-fields {
    .xarxaprod-fund-info-field {
      margin: 0;
    }
  }
  .xarxaprod-fund-info-fields {
    .xarxaprod-fund-info-field {
      margin: 1rem 0 0.5rem 0;
    }
  }
  .xarxaprod-funder-name,
  .xarxaprod-fund-contact-name,
  .xarxaprod-fund-web {
    display: flex;
    margin:0;
    padding: 0;
    font-variant: all-petite-caps;
    font-size: $font__size-body*1.1;
    line-height: 0.9;
    align-items: center;
    a {
      text-decoration: none;
      font-size: $font__size-body*0.8;
    }
  }

  .xarxaprod-convo-info-fields,
  .xarxaprod-agenda-info {
    margin-bottom: 2em;
    li {
      display:grid;
      grid-template-columns: 0.75fr 2.25fr;
      padding: 0.2em 0;
      border-top: 0.05em solid $color__black;
      font-size: $font__size-body*1;
      &:last-of-type{
        border-bottom: 0.05em solid $color__black;
      }
      .xarxaprod-label li {
        display: inherit;
        margin: 0;
        padding: 0;
        color: inherit;
        border: none;
        background-color: none;
        font-size: inherit;
        &:nth-child(n+2):before {
          content:", ";
          display:inline-block;
        }
      }
    }
    dt {
      grid-row: 1 / 1;
      font-weight: 100;
     }
    dd {
      grid-row: 1 / 2;
      margin: 0;
      font-weight: 700;
    }
    p {
      grid-row: 1 / 2;
      margin: 0;
    }
  }

  /* used in 
   * template-parts/content-xarxaprod-associat.php 
   * * * * * * * * * */
  .single-xarxaprod-associat {
    .xarxaprod-associat {
      > section {
        margin-top: 4em;
      }
    }
    .xarxaprod-associat-info {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      grid-template-columns: 1fr;
      gap: $grid__gap * 2;
      .xarxaprod-associat-contact,
      .xarxaprod-associat-services {
        dt {
          height: $font__size-body*1.5;
        }
        li {
          display: grid;
          font-size: $font__size-body*1;
          border: none;
          border-top: $border__line;
          margin: 0;
          padding: 0.5em 0;
        }
        h6,p {
          font-size: $font__size-body*1;
          margin: 0;
          padding: 0;
        }
      }
      .xarxaprod-associat-contact li {
        grid-template-columns: 1fr 2.5fr;
      }
      .xarxaprod-associat-services li {
      }
      .xarxaprod-associat-logo {
        max-height: 11rem;
        img {
          object-fit: contain;
        }
      }
    }
    .xarxaprod-associat-convos {
    }
    .xarxaprod-associat-location {
      .xarxaprod-associat-osm-map {
      }
      .xarxaprod-associat-osm-link {
        display: grid;
        grid-template-columns: auto;
        align-items: center;
        h6,p,a {
          margin: 0.5em ;
          font-size: $font__size-body*1;
        }
      }
    }
  }
  /*
   * used in 
   * archive-xarxaprod-associat.php
   * page-templates/associats-search.php
   *
   * */
  .xarxaprod-associat {
  }
  .xarxaprod-associat-contact {
    font-size: $font__size-body*0.9;
    h6 {
      font-size: $font__size-body*0.9;
      border: none;
    }
    li {
      display:grid;
      grid-template-columns: 1fr 2fr;
    }
  }
  /*
   * categories:
   *
   * convocatorias pre 2024
   * agenda, activitats, agenda-es
   *
   * * * * * * * * * * * * * * * */
  .xarxaprod-cards,.category-convocatories,
  .category-activitats,.category-agenda,.category-agenda-es {
    display: flex;
    flex-flow: column;
    justify-content: flex-end;
    padding-bottom: 4em;
    .wp-block-post-title {
      text-transform: lowercase;
      font-size: $font__size-body*1.5;
      margin-bottom: 0.5em;
      padding-bottom: 0.5em;
      border-bottom: 0.05em solid $color__black;
    }
    .wp-block-post-excerpt {
      margin: 0.5em 0;
      border-bottom: 0.05em solid $color__black;
    }
    .wp-block-read-more {
      margin: 1em 0;
    }
  }

  /* used in 
   * ./template-parts/section-agenda.php 
   * */
  .xarxaprod-agenda {
    .xarxaprod-card-each {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      padding: 0.2em 0;
      border-bottom: 0.1em solid $color__black;
      &:first-of-type {
        border-top: 0.1em solid $color__black;
      }
      > * {
        display: inline-flex;
        align-items: center;
      }
      header,.entry-header {
      }
      .entry-title,h6 {
        border-bottom: none;
      }
      p {
        //font-size: $font__size-body * 1.5;
      }
      .activity-organizer, .organiza-activitat {
      }
      .agenda-date, .agenda-data {
      }
    }
  }
  li.category-activitats,
  li[class*='category-agenda'] {
    position: relative;
    display: flex;
    align-content: space-between;
    .wp-block-post-featured-image {
      position: absolute;
      top: 0;
      margin: 0;
      aspect-ratio: 16/9;
      overflow: hidden;
    }
    .wp-block-post-title {
    }
    .wp-block-post-title:before {
      content: "";
      display: inline-block;
      min-width: 100%;
      height: auto;
      aspect-ratio: 16/9;
      margin-bottom: 2em;
      background-color: rgba(230,230,230,0.4);
      border-radius: 0.3em;
    }
  }


  /* filters form custom fields
   */
  .xarxaprod-filtered-content {
    display: grid;
    grid-template-columns: 1fr;
    .archive-posts {
      grid-template-columns: repeat(1 , minmax(0,1fr));
    }
  }
  .xarxaprod-filters {
    section {
      margin: 1em 0;
      .filter {
        display: none;
      }
    }
  }
  .archive-posts {
    // https://stackoverflow.com/questions/47601564/equal-width-columns-in-css-grid#61240964
    grid-template-columns: repeat(1 , minmax(0,1fr));
  }

  .xarxaprod-titol-opcions {
    // applied in forms and contactforms
    display: inline-block;
    width: 100%;
    max-width: 13em;
    margin-bottom: 0;
    margin-bottom: 1rem;
    padding: 0.6em 1em 0.4em;
    clear: both;
    cursor: pointer;
    font-weight: 900;
    font-size: $font__size-body*0.9;
    border: $border__line;
    &:after {
      content: ">";
      display: inline;
      float:right; 
    }
    &:hover {
      &:after {
        transform: rotate(90deg);
        animation: rotate 0.5s;
      }
    }
    @keyframes rotate {
      0% {
        transform: rotate(0);
      }
      100% {
        transform: rotate(90deg);
      }
    }
  }
}

@media screen and (max-width: 48em) {
  //only smaller than 48em

  .post,
  .page {
    margin: 0;
  }

  .xarxaprod-filters {
    section {
      display: block;
      h5 {
        display: block;
        width: 100%;
      }
      .filter {
        width: 45%;
        margin-top: 0.5rem;
        margin-right: 0.3em;
        float: left;
        &:last-of-type {
          margin-bottom: 2rem;
        }
      }
      &:last-of-type:after {
        content: "";
        display: inline-block;
        width: 100%;
      }
    }
  }
}
@media screen and (min-width: 48em) {
  //only bigger than 48em
  .xarxaprod-filters {
    padding-right: 2em;
    section {
      margin: 1em 0;
    }
  }
  .xarxaprod-filtered-content {
    grid-template-columns: 1fr 2fr;
  }
  .archive-posts {
    grid-template-columns: repeat(2 , minmax(0,1fr));
  }
  .xarxaprod-convo-info-fields,
  .xarxaprod-agenda-info {
    li {
      font-size: $font__size-body*1.5;
    }
  }
  
  .single-xarxaprod-associat {
    .xarxaprod-associat {
      .xarxaprod-associat-info {
        grid-template-columns: 1fr 1fr 1fr;
      }
      .xarxaprod-associat-location { 
        .xarxaprod-associat-osm-link {
          grid-template-columns: min-content auto;
        }
      }
    }
  }
  .xarxaprod-agenda {
    .xarxaprod-card-each {
      flex-direction: row-reverse;
      header,.entry-header {
        width: 50%;
      }
      .activity-organizer, .organiza-activitat {
        width: 30%;
      }
      .agenda-date, .agenda-data {
        width: 17%;
      }
    }
  }
}
@media screen and (min-width: 80em) {
  //only bigger than 80rem
    .xarxaprod-filtered-content {
      grid-template-columns: 1fr 3fr;
      .archive-posts {
        grid-template-columns: repeat(2 , minmax(0,1fr));
        &.archive-xarxaprod-associats,&.archive-custom-post-type-associat {
         grid-template-columns: repeat(1 , minmax(0,1fr));
        }
      }
    }
    .archive-posts {
      grid-template-columns: repeat(3 , minmax(0,1fr));
    }

}
