/* Ribbon Masthead Styles */
.RibbonMasthead {
  position: relative;
  width: 100%;
  /*overflow: hidden;*/
  margin-bottom: 150px; /* Space for the ribbon at the bottom */
}

.RibbonMasthead figure {
  position: relative;
  margin: 0;
  width: 100%;
  height: 100%;
}

.RibbonMasthead figure img,
.RibbonMasthead figure video {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Titles section (heading and subheading) */
.RibbonMasthead-titles {
  position: absolute;
  left: 50%;
  top: 50%; /* Center vertically */
  transform: translate(-50%, -50%); /* Center both horizontally and vertically */
  z-index: 10;
  width: 100%; /* Match container width */
  max-width: 1148px; /* Match container max-width */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 0 auto;
}

.RibbonMasthead-heading,
.RibbonMasthead-subheading {
  display: block;
  /*margin-bottom: 15px;*/
  width: 100%;
  line-height: 1.3;
}

.RibbonMasthead-heading h1 {
  color: #fff;
  margin: 0;
  /*font-weight: bold;*/
  font-size: 48px;
  font-family: "HelveticaNowDisplayBold", sans-serif;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.RibbonMasthead-heading h1 span {
  background-color: #2774AE; /* Blue background */
  padding: 0 15px; /* Matches the padding in the mockup */
  box-decoration-break: clone; /* Ensures padding on wrapped lines */
  -webkit-box-decoration-break: clone;
  line-height: 1.45; /* Better line height for the text */
  display: inline-block;
  box-shadow: 10px 0 0 #2774AE, -10px 0 0 #2774AE; /* Extends background */
}

.RibbonMasthead-heading h1 .first-line {
  margin-bottom: 5px; /* Space between the heading lines */
  display: block; /* Force onto its own line */
}

.RibbonMasthead-heading h1 .second-line {
  display: block; /* Force onto its own line */
  margin-top: 7px; /* Space between the heading lines */
}

/* Description section at the bottom */
.RibbonMasthead-container {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -130px; /* 50px above the bottom of the image */
  width: 100%; /* Width to match the mockup - not full width */
  max-width: 1168px;
  z-index: 10;
}

.RibbonMasthead-ribbon {
  background-color: #2774AE; /* UCLA blue - exact color from mockup */
  color: #fff;
  padding: 40px 0; /* Exact padding from mockup */
  width: 100%;
  position: relative;
  border-radius: 1px; /* Slight rounding to match mockup */
}

.RibbonMasthead-content {
  max-width: 920px;
  margin: 0 auto;
  padding: 0; /* Inner padding */
  text-align: left; /* Center text as shown in mockup */
}

.RibbonMasthead-content p {
  color: #fff;
  margin: 0;
  font-size: 31px; /* Exact size from mockup */
  line-height: 1.45;
  font-family: "HelveticaNowDisplayRegular", Arial, sans-serif;
  font-weight: normal;
}

/* Styles for light theme */
.RibbonMasthead.RibbonMasthead-light .RibbonMasthead-heading h1 span {
  background-color: rgba(255, 255, 255, 0.9);
  box-shadow: 10px 0 0 rgba(255, 255, 255, 0.9), -10px 0 0 rgba(255, 255, 255, 0.9);
  color: #2774AE; /* UCLA blue */
}

.RibbonMasthead.RibbonMasthead-light .RibbonMasthead-ribbon {
  background-color: rgba(255, 255, 255, 0.9);
}

.RibbonMasthead.RibbonMasthead-light .RibbonMasthead-content p {
  color: #2774AE; /* UCLA blue */
}

.RibbonMasthead.RibbonMasthead-light2 .RibbonMasthead-heading h1 span {
  background-color: rgba(255, 209, 0, 0.9); /* UCLA gold with opacity */
  box-shadow: 10px 0 0 rgba(255, 209, 0, 0.9), -10px 0 0 rgba(255, 209, 0, 0.9);
  color: #2774AE; /* UCLA blue */
}

.RibbonMasthead.RibbonMasthead-light2 .RibbonMasthead-ribbon {
  background-color: rgba(255, 209, 0, 0.9); /* UCLA gold with opacity */
}

.RibbonMasthead.RibbonMasthead-light2 .RibbonMasthead-content p {
  color: #2774AE; /* UCLA blue */
}

/* Mobile styles */
@media (max-width: 1300px) {
  .RibbonMasthead {
    margin-bottom: 220px;
  }
  .RibbonMasthead-titles {
    padding: 0 30px;
  }
  .RibbonMasthead-container {
    padding: 0 20px;
    bottom: -200px;
  }
  .RibbonMasthead-content {
    padding: 0 30px;
  }
}

@media (max-width: 991px) {
  .RibbonMasthead {
    margin-bottom: 150px;
  }
  .RibbonMasthead-container {
    bottom: -130px;
  }
  .RibbonMasthead-heading h1 {
    font-size: 28px;
  }
  .RibbonMasthead-content p {
    font-size: 24px;
    line-height: 1.2;
  }
  .RibbonMasthead-ribbon {
    padding: 30px 0;
  }
}

@media (max-width: 767px) {
  .RibbonMasthead-content {
    padding: 0 1rem;
  }

  .RibbonMasthead-ribbon {
    padding: 1.5rem 0;
  }

  .RibbonMasthead-titles {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    padding: 0 30px;
  }

  .RibbonMasthead-heading h1 {
    font-size: 1.5rem;
  }

  .RibbonMasthead-heading h1 span {
    padding: 5px 10px;
    line-height: 1.3;
    margin-bottom: 5px;
    box-shadow: 6px 0 0 #2774AE, -6px 0 0 #2774AE;
  }

  .RibbonMasthead.RibbonMasthead-light .RibbonMasthead-heading h1 span {
    box-shadow: 6px 0 0 rgba(255, 255, 255, 0.9), -6px 0 0 rgba(255, 255, 255, 0.9);
  }

  .RibbonMasthead.RibbonMasthead-light2 .RibbonMasthead-heading h1 span {
    box-shadow: 6px 0 0 rgba(255, 209, 0, 0.9), -6px 0 0 rgba(255, 209, 0, 0.9);
  }

  .RibbonMasthead {
    margin-bottom: 120px;
  }
  .RibbonMasthead-container {
    padding: 0 30px;
    bottom: -100px;
  }

  .RibbonMasthead-content p {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .RibbonMasthead-heading h1 .first-line {
    margin-bottom: 0;
  }
  .RibbonMasthead-container {
    bottom: -130px;
  }
  .RibbonMasthead-heading h1 {
    font-size: 24px;
  }
  .RibbonMasthead-content p {
    font-size: 18px;
    line-height: 1.1;
  }
  .RibbonMasthead-ribbon {
    padding: 15px 0;
  }
}

@media (max-width: 430px) {
  .RibbonMasthead {
    margin-bottom: 130px;
  }
  .RibbonMasthead-container {
    bottom: -110px;
  }
}

@media (max-width: 424px) {
  .RibbonMasthead {
    margin-bottom: 150px;
  }
  .RibbonMasthead-container {
    bottom: -130px;
  }
}


@media (max-width: 392px) {
  .RibbonMasthead {
    margin-bottom: 170px;
  }
  .RibbonMasthead-container {
    bottom: -150px;
  }
}

@media (max-width: 360px) {
  .RibbonMasthead {
    margin-bottom: 130px;
  }
  .RibbonMasthead-container {
    bottom: -110px;
  }
  .RibbonMasthead-ribbon {
    padding: 10px 0;
  }
  .RibbonMasthead-heading h1 {
    font-size: 20px;
  }
  .RibbonMasthead-content p {
    font-size: 16px;
    line-height: 1.1;
  }
  .RibbonMasthead-heading h1 span {
    padding: 5px;
  }
  .RibbonMasthead-content {
    padding: 0 10px;
  }
}

@media (max-width: 347px) {
  .RibbonMasthead {
    margin-bottom: 150px;
  }
  .RibbonMasthead-container {
    bottom: -130px;
  }
}
