/* V5 typography only: preserve every inherited color, surface, spacing,
   grid, card and illustration. V1–V4 never load this stylesheet. */

/* 1. A stronger editorial title, still a single line on narrow phones. */
body[data-design-edition="v5"] header.site-header h1::before{
  font-size:clamp(35px,5.3vw,66px);
  font-weight:700;
  letter-spacing:-.012em;
  line-height:1.1;
}

/* 2. Composer is secondary; the work title carries the card hierarchy. */
body[data-design-edition="v5"] #results>.result h3 .composer{
  font-size:15px;
  font-weight:550;
  line-height:1.35;
}
body[data-design-edition="v5"] #results>.result h3 .composer-life{
  font-size:12px;
  font-weight:400;
  line-height:1.35;
}
body[data-design-edition="v5"] #results>.result h3 .piece-title{
  font-size:23px;
  font-weight:600;
  line-height:1.24;
}

/* 3. Four overview rows use the same label/value scale and weight. */
body[data-design-edition="v5"] #results>.result .meta-epoch,
body[data-design-edition="v5"] #results>.result .meta-ensemble,
body[data-design-edition="v5"] #results>.result .chips>.chip-difficulty,
body[data-design-edition="v5"] #results>.result .chips>.chip-duration{
  font-size:14px;
  font-weight:450;
  line-height:1.35;
}
body[data-design-edition="v5"] #results>.result .meta-epoch::before,
body[data-design-edition="v5"] #results>.result .meta-ensemble::before,
body[data-design-edition="v5"] #results>.result .v5-chip-label{
  font-size:12px;
  font-weight:600;
  line-height:1.35;
}
body[data-design-edition="v5"] #results>.result .v5-chip-value{
  font-size:14px;
  font-weight:450;
  line-height:1.35;
}
/* Carry the same reading pattern through expanded information. */
body[data-design-edition="v5"] #results>.result .result-details-content .detail-item,
body[data-design-edition="v5"] #results>.result .result-details .detail-item{
  font-size:14px;
  font-weight:450;
  line-height:1.35;
}
body[data-design-edition="v5"] #results>.result .result-details-content .detail-item strong,
body[data-design-edition="v5"] #results>.result .result-details .detail-item strong{
  font-size:12px;
  font-weight:600;
  line-height:1.35;
}

/* 4. A recognisable result section; keep sort and auxiliary text quiet. */
body[data-design-edition="v5"] .results-panel #count::before{
  font-size:19px;
  font-weight:700;
  line-height:1.35;
}
body[data-design-edition="v5"] .v4-sort select{
  font-size:13px;
  font-weight:500;
}

@media(max-width:700px){
  body[data-design-edition="v5"] header.site-header h1::before{
    font-size:clamp(23px,7.05vw,35px);
    font-weight:700;
    letter-spacing:-.012em;
  }
  body[data-design-edition="v5"] #results>.result h3 .composer{
    font-size:14px;
    font-weight:550;
  }
  body[data-design-edition="v5"] #results>.result h3 .composer-life{font-size:12px}
  body[data-design-edition="v5"] #results>.result h3 .piece-title{
    font-size:21px;
    font-weight:600;
    line-height:1.28;
  }
  body[data-design-edition="v5"] .results-panel #count::before{font-size:17px}
  body[data-design-edition="v5"] .v4-sort select{font-size:12px}
}

/* iOS Safari zooms into focused controls whose text is smaller than 16px.
   Keep the layout tied to the device width and the page height content-driven.
   Deliberately do not disable the user's manual pinch-to-zoom. */
@media (hover:none) and (pointer:coarse){
  body[data-design-edition="v5"]{
    width:100%;
    max-width:100%;
    overflow-x:clip;
  }
  body[data-design-edition="v5"] input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
  body[data-design-edition="v5"] select,
  body[data-design-edition="v5"] textarea{
    font-size:16px!important;
  }
}

/* iPhone: the 16px sort labels need more room than V4's 125px dropdown.
   Keep the sort on the right and reserve its actual width beside the count. */
@media(max-width:700px){
  body[data-design-edition="v5"] .results-panel #count{
    margin-right:200px;
  }
  body[data-design-edition="v5"] .results-panel .v4-sort{
    width:190px;
    max-width:calc(100% - 2px);
  }
  body[data-design-edition="v5"] .results-panel .v4-sort select{
    width:100%;
    min-width:0;
    box-sizing:border-box;
    padding:5px 30px 5px 6px;
  }
}
/* On very narrow phones, place the sort below the result count instead
   of squeezing either label or allowing horizontal overflow. */
@media(max-width:359px){
  body[data-design-edition="v5"] .results-panel #count{
    margin-right:0;
    margin-bottom:3px;
  }
  body[data-design-edition="v5"] .results-panel .v4-sort{
    position:static;
    width:190px;
    margin:0 0 9px auto;
  }
}
