/* Portrait-mobile layout corrections for the Blood Donation page. */

@media (max-width: 820px) and (orientation: portrait) {
  .blood-shell .event-header .header-inner {
    width: calc(100% - 24px) !important;
    min-height: 54px !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 10px !important;
  }

  .blood-shell .event-header .brand {
    min-width: 0 !important;
    max-width: calc(100vw - 86px) !important;
    overflow: hidden !important;
  }

  .blood-shell .event-header .brand img {
    flex: 0 0 auto !important;
    width: 43px !important;
    height: 41px !important;
  }

  .blood-shell .event-header .brand span {
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .blood-shell .event-header .brand small,
  .blood-shell .event-header .brand strong {
    display: block !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .blood-shell .event-header .brand small {
    font-size: 9px !important;
  }

  .blood-shell .event-header .brand strong {
    font-size: 15px !important;
  }

  .blood-shell .event-header .desktop-nav,
  .blood-shell .event-header .community-link {
    display: none !important;
  }

  .blood-shell .event-header .menu-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 42px !important;
    height: 42px !important;
    padding: 0 !important;
    border: 1px solid rgba(241, 202, 112, .6) !important;
    border-radius: 7px !important;
    background: rgba(255, 255, 255, .05) !important;
    color: #fff7e8 !important;
    font-size: 22px !important;
  }

  .blood-shell .event-header .mobile-nav {
    width: 100% !important;
    padding: 6px 12px 12px !important;
    box-sizing: border-box !important;
  }

  .blood-shell .event-header .mobile-nav a {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 12px 14px !important;
    border-radius: 6px !important;
  }

  /*
   * Portrait hero fix:
   * Keep the hero artwork as an absolute, cropped background just like the
   * production homepage. The previous mobile patch changed the image to
   * width:100% / height:auto and put it in normal flow. Because the source
   * artwork is a wide 1780x883 composition, that collapsed it to a very short
   * strip on a portrait screen and visually crushed the Rajbari composition.
   * object-fit:cover preserves the artwork's aspect ratio and crops only the
   * left/right edges, while giving the central logo and arch real vertical room.
   */
  .blood-shell .hero {
    position: relative !important;
    height: clamp(700px, 178vw, 780px) !important;
    min-height: 700px !important;
    max-height: 780px !important;
    overflow: hidden !important;
    background: #fff5dc !important;
    border-bottom: 1px solid #dba755 !important;
  }

  .blood-shell .hero-art {
    position: absolute !important;
    inset: 0 !important;
    left: 0 !important;
    top: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
    object-fit: cover !important;
    object-position: 50% 0% !important;
    transform: none !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: -3 !important;
  }

  .blood-shell .hero-soften {
    display: block !important;
    position: absolute !important;
    inset: 0 !important;
    z-index: -2 !important;
    background: linear-gradient(
      180deg,
      rgba(255, 246, 230, 0) 0 42%,
      rgba(255, 247, 231, .18) 48%,
      rgba(255, 248, 232, .74) 59%,
      rgba(255, 248, 232, .96) 78%,
      #fff8e8 100%
    ) !important;
  }

  .blood-shell .hero-copy {
    position: absolute !important;
    left: 50% !important;
    top: 55.5% !important;
    transform: translateX(-50%) !important;
    z-index: 2 !important;
    width: min(90%, 390px) !important;
    max-width: 390px !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }

  .blood-shell .hero h1 {
    margin: 0 !important;
    font-size: clamp(34px, 10vw, 44px) !important;
    line-height: .9 !important;
    letter-spacing: -.035em !important;
  }

  .blood-shell .hero-rule {
    width: min(250px, 70%) !important;
    margin: 4px auto 2px !important;
  }

  .blood-shell .event-line {
    margin: 2px auto 0 !important;
    max-width: 330px !important;
    font-size: 11.5px !important;
    line-height: 1.18 !important;
    white-space: normal !important;
  }

  .blood-shell .save-line {
    margin-top: 4px !important;
    font-size: 15px !important;
    line-height: 1.05 !important;
  }

  .blood-shell .together {
    margin-top: 2px !important;
    padding: 0 8px !important;
    font-size: 9.5px !important;
    line-height: 1.18 !important;
  }

  .blood-shell .partner-card {
    width: min(100%, 340px) !important;
    margin: 8px auto 0 !important;
    padding: 7px 9px !important;
    box-sizing: border-box !important;
    gap: 8px !important;
    text-align: left !important;
  }

  .blood-shell .partner-symbol {
    flex: 0 0 32px !important;
    width: 32px !important;
    height: 32px !important;
    font-size: 13px !important;
  }

  .blood-shell .partner-card span:last-child {
    min-width: 0 !important;
  }

  .blood-shell .partner-card small,
  .blood-shell .partner-card strong,
  .blood-shell .partner-card em {
    white-space: normal !important;
  }

  .blood-shell .partner-card small {
    font-size: 8px !important;
  }

  .blood-shell .partner-card strong {
    font-size: 12.5px !important;
    line-height: 1.05 !important;
  }

  .blood-shell .partner-card em {
    font-size: 7.5px !important;
  }

  .blood-shell .hero-actions {
    width: min(100%, 340px) !important;
    margin: 7px auto 0 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }

  .blood-shell .hero-actions .btn {
    width: 100% !important;
    min-height: 38px !important;
    padding: 6px 12px !important;
    box-sizing: border-box !important;
    justify-content: center !important;
    font-size: 11.5px !important;
  }

  .blood-shell .hero-note {
    display: none !important;
  }

  /* Keep the rest of the page from creating horizontal overflow. */
  .blood-shell main,
  .blood-shell .paper-section,
  .blood-shell .detail-grid,
  .blood-shell .why-layout,
  .blood-shell .why-grid,
  .blood-shell .dual-panels,
  .blood-shell .mini-grid,
  .blood-shell .prereg-card {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .blood-shell img,
  .blood-shell svg {
    max-width: 100% !important;
  }
}

@media (max-width: 520px) and (orientation: portrait) {
  .blood-shell .hero {
    height: clamp(690px, 184vw, 760px) !important;
    min-height: 690px !important;
    max-height: 760px !important;
  }

  .blood-shell .hero-copy {
    top: 54.5% !important;
    width: min(92%, 360px) !important;
  }

  .blood-shell .hero h1 {
    font-size: clamp(32px, 10vw, 40px) !important;
  }

  .blood-shell .event-line {
    max-width: 292px !important;
    font-size: 10.5px !important;
  }

  .blood-shell .save-line {
    font-size: 14px !important;
  }

  .blood-shell .partner-card,
  .blood-shell .hero-actions {
    width: min(100%, 320px) !important;
  }
}

@media (max-width: 380px) and (orientation: portrait) {
  .blood-shell .hero {
    height: 710px !important;
    min-height: 710px !important;
    max-height: 710px !important;
  }

  .blood-shell .hero-copy {
    top: 53.5% !important;
    width: 92% !important;
  }

  .blood-shell .hero h1 {
    font-size: 34px !important;
  }
}
