/*-------------------------------------
	GENERAL
-------------------------------------*/

.agi_cargando {
  position: absolute;
  top: 50%;
  left: 50%;
  display: inline-block;
  transform: translateX(-50%);
  padding: 12px 20px;
  background-color: #FFE62D;
  border-radius: 2px;
  color: #333;
  font-family: var(--secondary-font);
  font-size: 13px;
  font-weight: 500;
  z-index: 10;
  box-shadow: var(--material-shadow);
  border-radius: 8px;

  @media (max-width: 767px) {
    padding: 10px 15px;
    font-size: 13px;
  }
}


#agenda_icomem {
  --primary-font: 'Open Sans', sans-serif;
  --secondary-font: 'Open Sans', sans-serif;

  /* Tamaños de fuente */
  --extralarge-font-size: 22px;
  --large-font-size: 18px;
  --medium-font-size: 14px;
  --small-font-size: 12px;

  --material-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.05), 0 8px 10px 1px rgba(0, 0, 0, 0.025), 0 3px 14px 2px rgba(0, 0, 0, 0.025);

  position: relative;
  width: 100%;
  min-height: 353px;
  height: auto;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  background: #fff;
  padding-bottom: 2px;
  font-family: var(--primary-font);
  border-radius: 10px;
  box-shadow: var(--material-shadow);

  container-type: inline-size;
  container-name: agenda-icomem;

  * {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
  }

  &:has(.agi_cargando) {
    .agi_dias {
      opacity: 0;
      transition: opacity .2s;
    }
  }


  /* Header */

  .agi_mes {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    overflow: hidden;
    width: 100%;
    background-color: #FFE62D;
    border-radius: 10px 10px 0 0;

    .agi_nombre_mes {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      font-size: var(--medium-font-size);
      font-weight: 700;
      text-align: center;
      width: 100%;
      padding: 0 30px;
      color: #333;
      text-transform: uppercase;
    }

    .agi_link_anterior,
    .agi_link_siguiente {
      position: absolute;
      display: inline-block;
      font-size: 1.5rem;
      cursor: pointer;
      background-color: transparent;
      color: #333;
      width: 32px;
      height: 32px;
      padding: 8px;
      text-align: center;
      top: 50%;
      transform: translateY(-50%);
      border-radius: 50%;
      background-color: transparent;
    }

    .agi_link_anterior {
      left: 10px;
    }

    .agi_link_siguiente {
      right: 10px;
    }

    .agi_link_anterior:hover,
    .agi_link_siguiente:hover {
      background-color: #273666;
      color: #FFE62D;
      transition: background-color .2s ease-in-out;
    }
  }

  .agi_header {
    width: 100%;
    padding: 0 12px;
    font-size: 0;

    .agi_nombre_dia {
      display: inline-block;
      color: #ccc;
      font-size: var(--medium-font-size);
      font-weight: 700 !important;
      width: calc(100% / 7);
      text-align: center;
      padding: 15px 0;
      -webkit-box-sizing: border-box;
      -moz-box-sizing: border-box;
      box-sizing: border-box;

      &:last-child {
        border-right: none;
      }

      @container agenda-icomem (max-width: 1200px) {
        font-size: var(--medium-font-size);
      }

      @container agenda-icomem (max-width: 600px) {
        font-size: var(--small-font-size);
      }
    }
  }


  /* Dias */

  .agi_dias {
    padding: 0 12px 24px 12px;
    transition: opacity .2s;

    .agi_semana {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      align-items: center;
      justify-items: center;
    }

    .agi_dia {
      position: relative;
      display: inline-block;
      width: 100%;
      height: 54px;
      font-weight: 500;
      text-align: center;

      &:not(.con_evento) {
        pointer-events: none;
      }

      @media(max-width: 1280px) {
        height: 48px;
      }

      @media(max-width: 768px) {
        height: 42px;
      }

      &:nth-child(7n) {
        border-right: none;
      }

      &.otro_mes {
        color: transparent;
        text-indent: -9999px;
      }

      &.hoy {
        font-weight: 700 !important;
      }

      &.con_evento {
        box-sizing: border-box;
        -moz-box-sizing: border-box;
        -webkit-box-sizing: border-box;
        cursor: pointer;

        .agi_marca_evento {
          position: absolute;
          top: calc(50%);
          left: 50%;
          width: 36px;
          height: auto;
          aspect-ratio: 1;
          transform: translate(-50%, -50%);
          border-radius: 50%;
          z-index: 1;
        }

        .agi_categorias {
          position: relative;
          bottom: -90%;
          width: 100%;
          margin: 0 auto;
          display: flex;
          align-items: center;
          justify-content: center;
          gap: 2px;

          .agi_categoria {
            width: 6px;
            height: 6px;
            border-radius: 6px;
            background: #ccc;
          }
        }
      }

      .agi_numero {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 2;
        font-size: var(--large-font-size);
        line-height: var(--large-font-size);

        @container agenda-icomem (max-width: 600px) {
          font-size: var(--medium-font-size);
          line-height: var(--medium-font-size);
        }
      }

    }
  }
}

/*-------------------------------------
	EVENTOS
-------------------------------------*/

#agenda_icomem {

  container-type: inline-size;
  container-name: agenda-icomem;

  .agi_eventos {
    position: absolute;
    top: 52px;
    width: 300%;
    z-index: 20;
    background-color: #fff;
    padding: 8px;
    border-radius: 5px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, .05);
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;

    &.agi_oculto {
      visibility: hidden;
    }

    &.agi_eventos_left {
      left: 0;

      .agi_evento_arrow_borde {
        left: calc(100% / 6 - 10px);
      }

      .agi_evento_arrow {
        left: calc(100% / 6 - 10px);
      }
    }

    &.agi_eventos_center {
      left: 50%;
      transform: translateX(-50%);

      .agi_evento_arrow_borde {
        left: calc(50% - 10px);
      }

      .agi_evento_arrow {
        left: calc(50% - 10px);
      }
    }

    &.agi_eventos_right {
      right: 0;

      .agi_evento_arrow_borde {
        right: calc(100% / 6 - 10px);
      }

      .agi_evento_arrow {
        right: calc(100% / 6 - 10px);
      }
    }

    .agi_evento_arrow_borde {
      position: absolute;
      top: -20px;
      border-style: solid;
      border-width: 10px;
      border-color: transparent transparent #d0d0d0 transparent;
    }

    .agi_evento_arrow {
      position: absolute;
      top: -18px;
      border-style: solid;
      border-width: 9px;
      border-color: transparent transparent #fff transparent;
    }

    .agi_evento {
      display: block;
      text-align: center;
      padding: 8px;
      color: #333;
      font-size: 13px;
      font-weight: 600;
      font-family: var(--secondary-font);
      color: inherit;
      text-decoration: none;
      border-radius: 5px;

      @media(max-width: 600px) {
        font-size: 11px;
      }

      &:hover {
        position: relative;
        transform: scale(1.02);
        box-shadow: var(--material-shadow);
        transition: transform .2s ease-in-out;
        background-image: linear-gradient(rgba(0, 0, 0, 0.05), rgba(255, 255, 255, 0.2), rgba(0, 0, 0, 0.05));
      }
    }

    /** En resoluciones menores, los eventos ocupan más ancho (el espacio de 6 días) **/
    @container agenda-icomem (max-width: 450px) {
      width: 600%;

      &.agi_eventos_left {
        .agi_evento_arrow_borde {
          left: calc(100% / 12 - 10px);
        }

        .agi_evento_arrow {
          left: calc(100% / 12 - 10px);
        }
      }

      &.agi_eventos_right {
        .agi_evento_arrow_borde {
          right: calc(100% / 12 - 10px);
        }

        .agi_evento_arrow {
          right: calc(100% / 12 - 10px);
        }
      }
    }
  }


  #enlace:link,
  #enlace:active {
    text-decoration: none;
  }

  #enlace:visited,
  #enlace:hover {
    text-decoration: none;
  }

  #enlace:link .panel-heading p,
  #enlace:active .panel-heading p {
    color: #ffffff;
    font-weight: normal;
    border-radius: 0;
    font-size: var(--medium-font-size);
    font-weight: 500;
  }

  #enlace:visited .panel-heading p,
  #enlace:hover .panel-heading p {
    text-decoration: underline;
  }

  .titulo {
    font-size: 16px;
    color: inherit;
  }
}



/*-------------------------------------
	FILTRO DE CATEGORIAS
-------------------------------------*/

.agi_evento {
  &.agi_filtrado {
    display: none !important;
  }
}

.agi_categoria {
  &.agi_filtrado {
    display: none !important;
  }
}

.agi_dia {
  &.agi_dia_filtrado {
    pointer-events: none;

    .agi_marca_evento {
      background-color: transparent !important;
    }

    .agi_numero {
      color: #333 !important;
    }
  }
}