/**
 * LUAP related-content rhythm v20
 * 20 September 2026
 *
 * IMPORTANT:
 * News is deliberately NOT styled here any more.
 *
 * Tags are now visually correct and remain untouched.
 * The main Exhibitions listing retains 50px card gaps. Individual Case Study
 * related cards use 70px card gaps on phones for more generous spacing.
 *
 * News is owned solely by luap_news_refresh v4.24 so it cannot fight a
 * second late override layer.
 */

@media (max-width: 699px) {

  /* =========================================================
     TAGS — KEEP THE APPROVED MOBILE RESULT
     ========================================================= */

  body.tag-landing-page #page {
    height: auto !important;
    min-height: 0 !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  body.tag-landing-page #main.width {
    box-sizing: border-box !important;
    margin-bottom: 0 !important;
    padding-bottom: 50px !important;
  }

  body.tag-landing-page #content,
  body.tag-landing-page #content > .inner,
  body.tag-landing-page #page-content,
  body.tag-landing-page #node-content {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    min-height: 0 !important;
  }

  body.tag-landing-page .tag-explore-footer .tag-project-list {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-auto-flow: row !important;
    column-gap: 0 !important;
    row-gap: 50px !important;
    gap: 50px 0 !important;
    width: 100% !important;
    max-width: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  body.tag-landing-page .tag-explore-footer .tag-project-list > * {
    box-sizing: border-box !important;
    float: none !important;
    clear: none !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  body.tag-landing-page .tag-explore-footer .tag-project-list .box {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  body.tag-landing-page .tag-footer-project:not(:last-child) {
    margin-bottom: 50px !important;
  }

  body.tag-landing-page .tag-footer-nav {
    margin-bottom: 0 !important;
  }

  body.tag-landing-page .tag-explore-footer .tag-suggestions-section {
    margin-top: 50px !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  body.tag-landing-page .tag-explore-footer {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }


  /* =========================================================
     MAIN EXHIBITIONS & PROJECTS LISTING
     ========================================================= */

  body.luap-motion-exhibitions #page {
    height: auto !important;
    min-height: 0 !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  body.luap-motion-exhibitions #main.width {
    box-sizing: border-box !important;
    margin-bottom: 0 !important;
    padding-bottom: 50px !important;
  }

  body.luap-motion-exhibitions #content,
  body.luap-motion-exhibitions #content > .inner,
  body.luap-motion-exhibitions #page-content,
  body.luap-motion-exhibitions #node-content {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    min-height: 0 !important;
  }

  body.luap-motion-exhibitions .listing.case-studies {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-auto-flow: row !important;
    column-gap: 0 !important;
    row-gap: 50px !important;
    gap: 50px 0 !important;
    width: 100% !important;
    max-width: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  body.luap-motion-exhibitions .listing.case-studies > *,
  body.luap-motion-exhibitions .listing.case-studies .box {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }


  /* =========================================================
     INDIVIDUAL EXHIBITION / PROJECT PAGE
     ========================================================= */

  /* Versioned path guarantees a fresh load after the former v19 asset.
     This also wins over the shared legacy related-card component if its
     runtime class is present, without altering tag or archive cards. */
  body.node-type-case-study .case-studies-more .listing.case-studies,
  body.node-type-case-study.luap-related-components-ready
    .case-studies-more .listing.case-studies.luap-related-card-list {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-auto-flow: row !important;
    column-gap: 0 !important;
    row-gap: 70px !important;
    gap: 70px 0 !important;
    width: 100% !important;
    max-width: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  body.node-type-case-study .case-studies-more .listing.case-studies > *,
  body.node-type-case-study .case-studies-more .listing.case-studies .box {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  body.node-type-case-study .case-studies-more {
    margin-bottom: 0 !important;
    padding-bottom: 50px !important;
  }
}
