.Volunteer {
  /* min-height: 100vh; */
  display: block;
  position: relative;

  .List {
    padding: 52px 0 89px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    width: 100%;
    justify-content: space-evenly;

    a {
      flex: 0 1 31%;
      text-decoration: none;

      .Card {
        position: relative;

        .VolunteerImage {
          position: relative;
          width: 100%;
          aspect-ratio: 16 / 9;

          img {
            object-fit: cover;
            position: absolute;
            width: 100%;
            height: 100%;
          }
        }

        /* The structural layout container (Kept naked & un-styled) */
        .Title {
          position: absolute;
          bottom: 8px;
          left: 8px;
          max-width: 90%;
          background: transparent !important;
          padding: 0 !important;
          margin: 0 !important;
          box-shadow: none !important;
        }

        /* The actual typography element (Shrink-wraps line by line) */
        .Title .TitleText {
          font-size: 18px;
          color: #181818;
          text-transform: uppercase;
          font-weight: 700;
          display: inline;

          /* 1. Tweak opacity down slightly (from b6 to a0) so text contrast stays sharp */
          background-color: rgba(255, 255, 255, 0.65) !important;

          /* 2. Tighten vertical padding (0.15rem -> 0.08rem) to reduce layout bleeding */
          padding: 0.08rem 0.5rem;

          /* 3. Open up line-height slightly so the text lines don't mash their paddings together */
          line-height: 1.65;

          box-decoration-break: clone;
          -webkit-box-decoration-break: clone;
        }
      }
    }
  }
}

.VolunteerSingle {
  padding: 89px 0 0 0;

  .SingleImage {
    width: 100%;
    aspect-ratio: 16 / 6;
    object-fit: cover;
    object-position: center;
  }

  .topInfo {
    margin: 1.5rem auto;
    font-size: 16px;
    color: #181818;
    line-height: 2;
    max-width: 550px;

    .label {
      font-weight: 700;
    }

    /* Target the element context normally */
    .frequency-text {
      display: inline-block; /* Helps inline fragments handle typographic transformations cleanly */
    }

    /* Target just the very first character of the string to capitalize it */
    .frequency-text::first-letter {
      text-transform: uppercase;
    }
  }

  .description {
    font-size: 16px;
    max-width: 550px;
    margin: auto auto 6rem auto;
    color: #181818;

    & > * {
      color: #181818;
    }
    p {
      margin-bottom: 0;
    }
    ol {
      list-style-position: inside;
      margin-bottom: 0;
    }
  }

  .form {
    /* background-color: #f5f5f5; */
    margin: 6rem auto;
    padding: 2rem 1rem;
    max-width: 550px;
    font-size: 16px;
    color: #181818;
    min-height: 648.2px;

    form {
      margin-top: 50px;

      /* Rule 1: Apply margin to all groups except the absolute last element wrapper */
      .formGroup:not(:last-of-type) {
        margin-bottom: 1.5rem;
      }

      /* Rule 2: Compress and completely erase the Honeypot layout wrapper */
      .formGroup.el-trap {
        position: absolute !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        visibility: hidden !important;
        opacity: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        z-index: -1 !important;
      }

      input {
        font-family: inherit;
        color: inherit;
        padding: 0.25rem 0.5rem;
        border: solid 1px #ccc;
        width: 100%;
        display: block;
        transition: all 0.3s;

        &:focus {
          outline: none;
          box-shadow: 0 0 2rem #18181816;
          border-bottom: 3px solid #327091;

          &:focus:invalid {
            border-bottom: 3px solid rgb(177, 17, 17);
          }
        }

        /* Animated Input Floating Label Control */
        &:placeholder-shown + label {
          opacity: 0;
          visibility: hidden;
          transform: translateY(-4rem);
        }
      }

      label {
        font-size: 14px;
        font-weight: 700;
        margin-left: 0.5rem;
        margin-top: 0.5rem;
        display: block;
        transition: all 0.3s;
      }

      /* Rule 3: Protect Textarea label from adjacent selector bugs */
      textarea {
        padding: 0.25rem 0.5rem;
        width: 100%;
        font-family: inherit;
        color: inherit;
        border: solid 1px #ccc;

        &:focus {
          outline: none;
          box-shadow: 0 0 2rem #18181816;
          border-bottom: 3px solid #327091;
        }
      }

      /* Ensure Textarea's static preceding label stays visible */
      .formGroup:has(textarea) label {
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
      }

      button {
        width: 170px;
        height: 40px;
        cursor: pointer;
        background: #327091;
        color: #ffffff;
        font-size: 14px;
        font-weight: 700;
        text-transform: uppercase;
        border: none;
        outline: none;
        border-radius: 3px;
        margin-top: 1rem;
      }
    }
  }
}

/*****************************************
* VOLUNTEER RESPONSIVE OVERRIDES
* Integrated from events_responsive rules
*****************************************/

@media only screen and (max-width: 1199px) {
  /* Prevent clipping on medium desktop screens */
  .Volunteer .List {
    padding-left: 15px;
    padding-right: 15px;
  }
}

@media only screen and (max-width: 991px) {
  /* Force grid containers into a single vertical stack */
  .Volunteer .List {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  /* Emulate .events_item width rules for a uniform dashboard flow */
  .Volunteer .List a {
    width: 100%;
    max-width: 690px;
    margin-bottom: 30px; /* Space cards out vertically */
  }

  .Volunteer .List a .Card {
    width: 100%;
  }
}

@media only screen and (max-width: 767px) {
  /* Scale card widths down smoothly alongside smaller viewport parameters */
  .Volunteer .List a {
    max-width: 510px;
  }
}

@media only screen and (max-width: 575px) {
  /* Full fluid screen width for true mobile phones */
  .Volunteer .List {
    padding-left: 15px;
    padding-right: 15px;
  }

  .Volunteer .List a {
    max-width: 100%;
    margin-bottom: 20px;
  }

  /* Slightly scale down titles for tight mobile screens if needed */
  .Volunteer .List a .Card .Title .TitleText {
    font-size: 16px;
    padding: 0.05rem 0.4rem;
  }
}
