.media {
  display: flex;
  flex-direction: column;
  gap: 40px;
  margin-top: 120px;

  .media-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    h2 {
      font-weight: 700;
      font-size: 56px;
      line-height: 100%;
      letter-spacing: 0%;
      color: #080a12;
    }

    .media-filters {
      display: flex;
      align-items: center;
      gap: 18px;

      .selection-container {
        position: relative;
        width: 250px;
        font-family: sans-serif;
        user-select: none;

        &.active {
          .selection-header img:last-child {
            transform: rotate(180deg);
          }
          .selection-options {
            display: block;
          }
        }

        .selection-header {
          display: flex;
          align-items: center;
          justify-content: space-between;
          padding: 12px 20px;
          border: 2px solid #000;
          border-radius: 60px;
          background: #fff;
          cursor: pointer;

          font-weight: 700;
          font-size: 20px;
          line-height: 34px;
          letter-spacing: 0%;
          color: #000000;

          img {
            width: 20px;
            height: 20px;
          }
        }

        .selection-options {
          position: absolute;
          top: calc(100% + 8px);
          left: 0;
          right: 0;
          background: #fff;
          border: 2px solid #000;
          border-radius: 20px;
          overflow: hidden;
          display: none;
          z-index: 10;

          .option {
            display: flex;
            align-items: center;
            padding: 12px 20px;
            gap: 12px;
            cursor: pointer;

            &:hover {
              background: #f0f0f0;
            }

            input[type='checkbox'],
            input[type='radio'] {
              accent-color: #000;
              cursor: pointer;
            }

            label {
              flex: 1;
              cursor: pointer;
              font-weight: 500;
            }
          }
        }
      }
    }
  }

  .media-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 80px;

    .media-elements {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 24px;

      .media-element {
        width: 100%;
        max-width: 100%;
        height: 488px;
        max-height: 488px;
        box-shadow: 2px 6px 17px 0px #0000001a;
        border-radius: 16px;
        display: flex;
        flex-direction: column;
        overflow: hidden;

        .media-image {
          width: 100%;
          height: 300px;
          flex-shrink: 0;
          border-top-left-radius: 16px;
          border-top-right-radius: 16px;

          img {
            width: 100%;
            height: 100%;
            border-top-left-radius: 16px;
            border-top-right-radius: 16px;
            object-fit: cover;
            display: block;
          }
        }

        .media-element-content {
          flex: 1;
          display: flex;
          flex-direction: column;
          gap: 10px;
          padding: 16px 20px;
          overflow: hidden;

          h3 {
            overflow: hidden;

            a {
              display: -webkit-box;
              -webkit-line-clamp: 2;
              -webkit-box-orient: vertical;
              overflow: hidden;
              text-overflow: ellipsis;
              font-weight: 600;
              font-size: 20px;
              line-height: 26px;
              letter-spacing: 0%;
              color: #121212;
              text-decoration: none;
            }
          }

          p {
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
            text-overflow: ellipsis;
            font-weight: 400;
            font-size: 15px;
            line-height: 22px;
            letter-spacing: 0%;
            color: #484848;
          }
        }
      }
    }

    .event {
      width: 383px;
      height: 622px;
      max-width: 383px;
      max-height: 622px;
      border: 1px solid #ebe5db;
      border-radius: 20px;

      &:hover {
        .event-header {
          .date {
            background-color: #d63832;
          }
        }
      }

      .event-header {
        position: relative;
        width: 383px;
        height: 317px;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        overflow: hidden;

        img {
          width: 100%;
          height: 100%;
          border-top-left-radius: 20px;
          border-top-right-radius: 20px;
          object-fit: cover;
          display: block;
          position: relative;
          z-index: 10;
        }

        .date {
          width: 141px;
          height: 74px;
          border-radius: 6px;
          background: #000000;
          position: absolute;
          z-index: 12;

          bottom: 0;
          left: 0;

          display: flex;
          align-items: center;
          justify-content: space-between;
          gap: 30px;
          padding: 12px;
          transition: 0.5s all;

          .date-content {
            h2 {
              font-weight: 700;
              font-size: 28px;
              line-height: 28px;
              letter-spacing: 0%;
              color: #ffffff;
            }

            p {
              font-weight: 600;
              font-size: 12px;
              line-height: 28px;
              letter-spacing: 0%;
              color: #ffffff70;
            }
          }

          .save {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: #ffffff;

            display: flex;
            align-items: center;
            justify-content: center;

            img {
              width: 11px;
              height: auto;
            }
          }
        }
      }

      .event-content {
        display: flex;
        flex-direction: column;
        gap: 7px;
        padding: 29px 22px;

        span {
          font-weight: 600;
          font-size: 18px;
          line-height: 28px;
          letter-spacing: 2px;
          color: #2b6956;
        }

        h3 {
          a {
            font-weight: 700;
            font-size: 20px;
            line-height: 100%;
            letter-spacing: 0%;
            color: #363848;
            text-decoration: none;
          }
        }

        p {
          font-weight: 400;
          font-size: 16px;
          line-height: 28px;
          letter-spacing: 0%;
          color: #5a524c;

          display: -webkit-box;
          -webkit-line-clamp: 4;
          -webkit-box-orient: vertical;
          overflow: hidden;
          text-overflow: ellipsis;
        }
      }
    }

    .media-learn-more {
      width: 201px;
      height: 62px;
      border-radius: 60px;
      background: #d63832;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      font-size: 20px;
      line-height: 34px;
      letter-spacing: 0%;
      color: #ebe5db;
      text-decoration: none;
      align-self: center;
      position: relative;
      z-index: 1;
      margin-top: 20px;
      cursor: pointer;
      transition: background 0.3s ease, transform 0.2s ease;

      &:hover {
        background: #b8302b;
        transform: scale(1.03);
      }
    }
  }
}

@media screen and (max-width: 450px) {
  .media {
    margin-top: 60px !important;

    .media-header {
      h2 {
        font-size: 28px !important;
        line-height: 38px !important;
      }

      .media-filters {
        display: none !important;
      }
    }

    .media-content {
      .media-elements {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px !important;

        .media-element {
          width: 100% !important;
          min-width: 0 !important;
          height: auto !important;

          .media-image {
            height: 120px !important;
          }

          .media-element-content {
            padding: 8px;
            gap: 8px;
            h3 a {
              font-size: 14px !important;
              line-height: 18px !important;
            }
            p {
              font-size: 10px !important;
              line-height: 14px !important;
            }
          }
        }
      }
    }
  }
}

@media screen and (min-width: 768px) and (max-width: 1024px) {
  .media {
    margin-top: 100px;
    gap: 32px;

    .media-header {
      align-items: flex-start;

      h2 {
        font-size: 44px;
        line-height: 64px;
      }

      .media-filters {
        gap: 12px;

        .selection-container {
          width: 220px;
        }
      }
    }

    .media-content {
      gap: 64px;

      .media-elements {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;

        .media-element {
          width: 100%;
          max-width: none;
          height: auto;
          max-height: none;
        }
      }

      .event {
        width: 100%;
        max-width: 360px;
        height: auto;
        max-height: none;
        margin-inline: auto;

        .event-header {
          width: 100%;
          height: 260px;
        }
      }
    }
  }
}
.media-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    gap: 20px !important;
}
