/*
 * DBC / BIOTEN homepage V7.31.8 detail governance — R1
 *
 * Scope is deliberately narrow:
 * - keep the third packaging card full-width throughout the two-column layout;
 * - fit the platform spacing and application releases to tablet content;
 * - simplify the 700–860px header to logos + language + menu;
 * - restore readable 2 × 2 platform and business-group grids on tablets;
 * - raise the smallest mobile evidence and Observer title type.
 *
 * The locked hero, particle runtime, homepage copy, routes and section order
 * are outside this stylesheet's scope.
 */

@media (min-width: 640px) and (max-width: 1023px) {
  html[data-v7318-home-detail="responsive-clarity-accessibility-r1"]
    body.dbc-home-page #main-content #bioten[data-v793-section]
    .v703-domain-group__grid > .v311-domain[data-v793-card] {
    /* Reset the sizing from the older swipe layout. */
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  html[data-v7318-home-detail="responsive-clarity-accessibility-r1"]
    body.dbc-home-page #main-content #bioten[data-v793-section]
    .v703-domain-group__grid > .v311-domain[data-v793-card]:nth-child(3) {
    grid-column: 1 / -1 !important;
  }
}

@media (min-width: 40rem) and (max-width: 53.75rem) {
  html[data-v7318-home-detail="responsive-clarity-accessibility-r1"]
    body.dbc-home-page
    #main-content
    #bioten[data-v793-section]
    [data-v793-card-system]
    .v703-domain-group__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.72rem !important;
  }

  html[data-v7318-home-detail="responsive-clarity-accessibility-r1"]
    body.dbc-home-page
    #main-content
    #bioten[data-v793-section]
    .v703-domain-group__grid
    .v311-domain[data-v793-card]:nth-child(3) {
    height: clamp(12.25rem, 26vw, 13rem) !important;
    min-height: clamp(12.25rem, 26vw, 13rem) !important;
    block-size: clamp(12.25rem, 26vw, 13rem) !important;
    min-block-size: clamp(12.25rem, 26vw, 13rem) !important;
  }

  html[data-v7318-home-detail="responsive-clarity-accessibility-r1"]
    body.dbc-home-page
    #bioten[data-v793-section]
    .v703-domain-group__grid
    .v311-domain[data-v793-card]:nth-child(3)
    .v311-domain__media {
    inset: 0 42% 0 0 !important;
    width: auto !important;
    height: 100% !important;
  }

  html[data-v7318-home-detail="responsive-clarity-accessibility-r1"]
    body.dbc-home-page
    #bioten[data-v793-section]
    .v703-domain-group__grid
    .v311-domain[data-v793-card]:nth-child(3)
    .v287-domain__wash {
    background:
      linear-gradient(90deg, rgb(3 18 28 / 0.02) 0%, rgb(3 18 28 / 0.1) 38%, rgb(4 24 35 / 0.91) 61%, #071f2c 100%),
      linear-gradient(180deg, transparent 0%, rgb(3 18 28 / 0.12) 64%, rgb(3 18 28 / 0.45) 100%);
  }

  html[data-v7318-home-detail="responsive-clarity-accessibility-r1"]
    body.dbc-home-page
    #bioten[data-v793-section]
    .v703-domain-group__grid
    .v311-domain[data-v793-card]:nth-child(3)
    .v311-domain__link {
    justify-content: center;
    padding: 1rem 3rem 1rem 62% !important;
  }
}

@media (min-width: 661px) and (max-width: 1376px) {
  #main-content #platform.v704-platform,
  #main-content #platform .v704-platform__stage {
    block-size: auto !important;
    height: auto !important;
    min-block-size: 0 !important;
    min-height: 0 !important;
  }

  #main-content #platform .v704-platform__stage {
    padding-bottom: clamp(1.5rem, 2.8vw, 2rem) !important;
  }

  #main-content #observer.observer-home {
    padding-top: clamp(1.5rem, 2.8vw, 2rem);
  }

  /* Size the update strip to its longest item so rotating titles do not move the page. */
  #main-content #collaboration [data-bp7151-release-ticker] {
    min-height: 0 !important;
  }

  #main-content #collaboration [data-bp7151-ticker-track] {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    height: auto !important;
    min-height: 0 !important;
  }

  #main-content #collaboration [data-bp7151-ticker-item] {
    position: relative !important;
    inset: auto !important;
    display: grid !important;
    grid-area: 1 / 1;
    grid-template-columns: auto minmax(0, 1fr);
    align-self: center;
    gap: 0.15rem 0.45rem !important;
  }

  #main-content #collaboration [data-bp7151-ticker-item][aria-hidden="true"]:not(.is-leaving) {
    visibility: hidden;
  }

  #main-content #collaboration [data-bp7151-ticker-item] :is(.bp7151-release-ticker__type, strong) {
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  #main-content #collaboration [data-bp7151-ticker-item] strong {
    grid-column: 1 / -1;
  }
}

@media (min-width: 661px) and (max-width: 1100px) {
  /* The featured release shares two rows with the list. The last card spans the grid. */
  body.dbc-home-page #main-content #collaboration .bp7140-release-rail
    .bp7140-release-rail__grid[data-basf-dbc-release-grid] {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr) !important;
    grid-template-rows: repeat(3, auto) !important;
    min-height: 0 !important;
  }

  body.dbc-home-page #main-content #collaboration .bp7140-release-rail
    .bp7140-release-rail__grid[data-basf-dbc-release-grid] > .bp7140-release-mini {
    min-height: 5rem !important;
  }

  body.dbc-home-page #main-content #collaboration .bp7140-release-rail
    .bp7140-release-rail__grid[data-basf-dbc-release-grid] > .bp7140-release-mini:not([data-home-release-featured]) > img {
    min-height: 0 !important;
  }

  body.dbc-home-page #main-content #collaboration .bp7140-release-rail
    .bp7140-release-rail__grid[data-basf-dbc-release-grid] .bp7140-release-mini__copy strong {
    -webkit-line-clamp: unset !important;
  }

  body.dbc-home-page #main-content #collaboration .bp7140-release-rail
    .bp7140-release-rail__grid[data-basf-dbc-release-grid] > [data-home-release-featured] {
    grid-row: 1 / span 2 !important;
    grid-template-rows: auto minmax(min-content, 1fr) !important;
    align-self: stretch !important;
  }

  /* Reserve the TDS cover's proportions when rotating or resizing the viewport. */
  #main-content #collaboration #basf-dbc-solution.basf-release-entry[data-home-release-featured] .basf-release-entry__media {
    aspect-ratio: 1160 / 500 !important;
    align-self: start !important;
  }

  #main-content #collaboration #basf-dbc-solution.basf-release-entry[data-home-release-featured] .basf-release-entry__media img {
    height: 100% !important;
    object-fit: contain;
  }

  body.dbc-home-page #main-content #collaboration .bp7140-release-rail
    .bp7140-release-rail__grid[data-basf-dbc-release-grid] > [data-home-release-featured] .bp7140-release-mini__copy {
    align-self: stretch !important;
    justify-content: center !important;
  }

  body.dbc-home-page #main-content #collaboration .bp7140-release-rail
    .bp7140-release-rail__grid[data-basf-dbc-release-grid] > .bp7140-release-mini:nth-child(4):last-child {
    grid-column: 1 / -1 !important;
    grid-template-columns: minmax(76px, 14%) minmax(0, 1fr) !important;
  }
}

@media (min-width: 700px) and (max-width: 860px) {
  html[data-v7318-home-detail="responsive-clarity-accessibility-r1"]
    body.dbc-home-page
    #platform
    .v704-bioten__routes,
  html[data-v7318-home-detail="responsive-clarity-accessibility-r1"]
    body.dbc-home-page
    #platform
    .v704-brand-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: auto !important;
    gap: 0.72rem !important;
  }

  html[data-v7318-home-detail="responsive-clarity-accessibility-r1"]
    body.dbc-home-page
    #platform
    .v704-bioten__routes
    > .v704-route {
    min-height: 9.25rem !important;
    grid-column: auto !important;
    grid-row: auto !important;
  }

  html[data-v7318-home-detail="responsive-clarity-accessibility-r1"]
    body.dbc-home-page
    #platform
    .v704-brand-grid
    > .v704-brand-card {
    min-height: 9rem !important;
  }

  html[data-v7318-home-detail="responsive-clarity-accessibility-r1"]
    body.dbc-home-page
    #main-content
    #platform[data-v791-section]
    [data-v791-route]
    .v704-route__copy
    h3 {
    font-size: 0.92rem !important;
    line-height: 1.25 !important;
  }

  html[data-v7318-home-detail="responsive-clarity-accessibility-r1"]
    body.dbc-home-page
    #platform[data-v791-section]
    [data-v791-route]
    .v704-route__copy
    p {
    font-size: 0.75rem !important;
    line-height: 1.4 !important;
  }

  html[data-v7318-home-detail="responsive-clarity-accessibility-r1"]
    body.dbc-home-page
    #platform
    .v704-brand-card__mark
    strong {
    font-size: 1rem !important;
  }

  html[data-v7318-home-detail="responsive-clarity-accessibility-r1"]
    body.dbc-home-page
    #platform
    .v704-brand-card__mark
    small {
    font-size: 0.625rem !important;
    line-height: 1.3 !important;
  }

  html[data-v7318-home-detail="responsive-clarity-accessibility-r1"]
    body.dbc-home-page
    #main-content
    #platform
    .v704-brand-card__copy
    h3 {
    font-size: 0.84rem !important;
    line-height: 1.3 !important;
  }

  html:is([lang="en"], [data-lang="en"])[data-v7318-home-detail="responsive-clarity-accessibility-r1"][data-v7202-home-governance]
    body.dbc-home-page
    #main-content
    #platform[data-v791-section]
    .v704-brand-grid
    .v704-brand-card
    .v704-brand-card__copy
    h3 {
    font-size: 0.84rem !important;
    line-height: 1.3 !important;
    letter-spacing: -0.01em !important;
  }
}

@media (max-width: 430px) {
  html[data-v7318-home-detail="responsive-clarity-accessibility-r1"]
    body.dbc-home-page
    #bioten
    [data-v790-evidence-summary] {
    color: rgb(16 47 67 / 0.82) !important;
    font-size: 0.875rem !important;
    line-height: 1.7 !important;
  }

  html[data-v7318-home-detail="responsive-clarity-accessibility-r1"]
    body.dbc-home-page
    main#main-content
    .observer-home-card[data-v7202-card="compact-editorial-rail-r37"]
    .observer-home-card__glass
    h3 {
    font-size: 0.8rem !important;
    line-height: 1.3 !important;
    -webkit-line-clamp: 4;
  }

  html:is([lang="en"], [data-lang="en"])[data-v7318-home-detail="responsive-clarity-accessibility-r1"][data-v7202-home-governance]
    body.dbc-home-page
    main#main-content
    .observer-home-card[data-v7202-card="compact-editorial-rail-r37"]
    .observer-home-card__glass
    h3 {
    font-size: 0.8rem !important;
    line-height: 1.3 !important;
    letter-spacing: -0.012em !important;
    -webkit-line-clamp: 4;
  }

  html:is([lang="en"], [data-lang="en"])[data-v7318-home-detail="responsive-clarity-accessibility-r1"]
    body.dbc-home-page
    #main-content
    #platform
    .v704-brand-grid
    .v704-brand-card
    .v704-brand-card__copy
    h3 {
    font-size: 0.72rem !important;
    line-height: 1.28 !important;
    letter-spacing: -0.012em !important;
  }
}

@media (max-width: 367px) {
  html[data-v7318-home-detail="responsive-clarity-accessibility-r1"]
    body.dbc-home-page
    main#main-content
    .observer-home-card[data-v7202-card="compact-editorial-rail-r37"]
    .observer-home-card__glass
    h3 {
    font-size: 0.8rem !important;
    line-height: 1.28 !important;
    -webkit-line-clamp: 3;
  }

  html:is([lang="en"], [data-lang="en"])[data-v7318-home-detail="responsive-clarity-accessibility-r1"][data-v7202-home-governance]
    body.dbc-home-page
    main#main-content
    .observer-home-card[data-v7202-card="compact-editorial-rail-r37"]
    .observer-home-card__glass
    h3 {
    font-size: 0.8rem !important;
    line-height: 1.28 !important;
    -webkit-line-clamp: 3;
  }
}

/* Let the legal row sit directly on the footer on mobile. */
@media screen and (max-width: 720px) {
  footer.v410-home-footer[data-v7160-footer-closure] .v410-home-footer__bottom {
    border-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
}
