/* Keep the original phone masthead above the shared homepage content. */
@media (max-width: 900px) {
  body:has(#content) .mobile-header-brand img { object-fit: contain; }

  #content #hm-mobile-top:has(.hm-mobile-slides > a) { display: block; width: 100%; min-width: 0; }
  html #content:has(#hm-mobile-top .hm-mobile-slides > a) #hero.hero { display: none !important; }
  #hm-mobile-top *, #hm-mobile-top *::before, #hm-mobile-top *::after { box-sizing: border-box; }
  #hm-mobile-top .hm-mobile-new-hero { position: relative; margin: 0; padding: 0; }
  #hm-mobile-top .hm-mobile-slides { display: flex; width: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; }
  #hm-mobile-top .hm-mobile-slides > a { position: relative; flex: 0 0 100%; min-width: 0; aspect-ratio: 2 / 3; scroll-snap-align: start; background: #ddd; }
  #hm-mobile-top .hm-mobile-slides img { display: block; width: 100%; height: 100%; max-width: 100%; object-fit: cover; }
  #hm-mobile-top .hm-mobile-slides a > span, #hm-mobile-top .hm-mobile-hero-cta { display: none !important; }
  #hm-mobile-top .hm-mobile-controls { position: absolute; right: 0; bottom: 1.6%; left: 0; z-index: 3; display: flex; justify-content: center; gap: 6px; }
  #hm-mobile-top .hm-mobile-controls button { width: 42px; height: 24px; padding: 10px 0; border: 0; background: transparent; cursor: pointer; }
  #hm-mobile-top .hm-mobile-controls button::after { content: ""; display: block; height: 3px; border-radius: 3px; background: #ccc; }
  #hm-mobile-top .hm-mobile-controls button[aria-current="true"]::after { background: #777; }
  #hm-mobile-top :is(a, button):focus-visible { outline: 2px solid #865834; outline-offset: 3px; }

  #content {
    --home-gutter: clamp(18px, 4.8vw, 32px);
    width: 100%;
    min-width: 0;
    padding-top: 0;
    background: #fff;
    color: #171719;
  }

  #content > section { min-width: 0; }
  #content .section { padding: 0; }
  #content .section > .container,
  #content .popular .container,
  #content .celebrity-section > .container {
    width: calc(100% - 2 * var(--home-gutter));
    max-width: none;
    margin-inline: auto;
  }

  html #content #hero.hero {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 2560 / 1311;
  }
  #content #hero .hero-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
  }
  #content #hero .banner-controls {
    top: auto;
    right: var(--home-gutter);
    bottom: 2px;
    max-width: calc(100% - 2 * var(--home-gutter));
  }
  #content #hero .banner-bars { gap: 6px; }
  #content #hero .banner-controls .banner-step {
    width: 26px;
    height: 32px;
    min-height: 32px;
    padding: 14px 0;
  }
  #content #hero .banner-step span,
  #content #hero .banner-step[aria-current="true"] span {
    height: 3px;
    border-radius: 0;
  }

  #content .section-head,
  #content .section[aria-labelledby="matrix-title"] .section-head {
    display: block;
    padding: 34px 0 22px;
    margin: 0;
    text-align: left;
  }
  #content :is(#matrix-title, #popular-title, #listening-title, #artist-title) {
    margin: 0;
    font-size: clamp(23px, 5.5vw, 30px);
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: .02em;
    overflow-wrap: anywhere;
    text-wrap: balance;
  }
  #content .section-head p { max-width: 38em; line-height: 1.6; }
  #content .section[aria-labelledby="matrix-title"] > .section-head { margin-inline: auto; }

  /* Keep portrait category artwork intact and expose the next entry. */
  html #content .section .category-grid {
    display: flex;
    gap: 10px;
    padding: 0 var(--home-gutter) 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--home-gutter);
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }
  #content .category-grid .media-card {
    flex: 0 0 45%;
    min-width: 0;
    aspect-ratio: 1539 / 2259;
    border: 0;
    scroll-snap-align: start;
  }
  #content .media-card img { height: 100%; object-fit: cover; }
  #content .media-card-copy { inset: auto 0 0; padding: 42px 10px 18px; }
  #content .media-card-copy strong { font-size: clamp(14px, 3.5vw, 19px); line-height: 1.35; }

  #content .popular { padding: 30px 0 38px; }
  #content .popular .section-head { padding: 0; margin-bottom: 22px; }
  #content .popular .popular-shell { width: 100%; max-width: none; padding: 0; }
  #content .popular .popular-track { display: flex; gap: 10px; border: 0; }
  /* --item-width and transform are calculated together by home-fixes.js. */
  #content .popular .popular-track .product-card { flex: 0 0 var(--item-width); border: 1px solid #e4e4e4; }
  #content .popular .product-view { background: #fff; }
  #content .popular .product-view img { aspect-ratio: 1; object-fit: contain; transform: none; }
  #content .popular .product-copy { min-height: 0; padding: 12px 10px 22px; }
  #content .popular .product-copy h3 { font-size: 15px; line-height: 1.4; font-weight: 400; overflow-wrap: anywhere; }
  #content .popular .price, #content .popular .add-button { display: none; }
  #content .popular .carousel-button { display: none; }

  /* The collection banner contains its own heading and product lettering. */
  #content .feature-series { height: auto; min-height: 0; aspect-ratio: 2400 / 1161; }
  #content .feature-series > img { width: 100%; height: 100%; object-fit: contain; }
  #content .feature-series::after { background: none; }
  #content .feature-series .banner-controls { right: var(--home-gutter); bottom: 0; }
  #content .feature-series .banner-bars { gap: 6px; }
  #content .feature-series .banner-controls .banner-step { width: 24px; height: 32px; min-height: 32px; padding: 14px 0; }
  #content .feature-series .banner-step span,
  #content .feature-series .banner-step[aria-current="true"] span { height: 3px; border-radius: 0; }

  #content .listening-section,
  #content .celebrity-section { padding: 36px var(--home-gutter) 0 !important; }
  #content .celebrity-section > .container { width: 100%; }
  #content .listening-head,
  #content .celebrity-section .section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px 18px;
    width: 100%;
    margin: 0 0 22px;
    padding: 0;
    text-align: left;
  }
  #content .listening-head a,
  #content .celebrity-section .artist-more { position: static; display: block; width: auto; margin: 0; transform: none; font-size: 13px; line-height: 1.6; }
  #content .listening-grid,
  #content .celebrity-section .artist-grid { display: flex; width: 100%; gap: 14px; margin: 0; }
  #content .listening-grid > .listening-card,
  #content .celebrity-section .artist-grid > .artist-card { min-width: 0; border-radius: 0; }
  #content .listening-card { min-height: 0; aspect-ratio: 5 / 7; }
  #content .listening-card > img { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; object-fit: cover; }
  #content .listening-caption { padding: 16px 12px 14px; }
  #content .listening-title-line { font-size: 14px; }
  #content .celebrity-section .artist-card img { aspect-ratio: .84; }
  #content .celebrity-section .artist-caption { padding: 48px 12px 18px; }
  #content .celebrity-section .artist-card .artist-name { font-size: 23px; overflow-wrap: anywhere; }
  #content .celebrity-section .artist-card .artist-title { font-size: 12px; }

  #content .visit { margin-top: 34px; padding: 32px var(--home-gutter) 38px; background: #fff; color: #111; }
  #content .visit .visit-grid { width: 100%; grid-template-columns: minmax(0, 1fr); gap: 24px; }
  #content .visit .visit-image { width: 100%; height: auto; aspect-ratio: 2503 / 1267; object-fit: cover; }
  #content .visit .visit-info h2,
  #content .visit .events h3 { margin: 0 0 20px; color: #111; font-size: 22px; line-height: 1.3; }
  #content .visit .facts { grid-template-columns: auto minmax(0, 1fr); gap: 10px 18px; margin: 0 0 20px; font-size: 14px; }
  #content .visit .facts dd { min-width: 0; overflow-wrap: anywhere; }
  #content .visit .text-link,
  #content .visit .events-more { font-size: 14px; line-height: 1.6; }
  #content .visit .events { grid-column: auto; padding: 24px 0 0; border-top: 1px solid #dedede; border-left: 0; }
  #content .visit .event-list { gap: 20px; }
  #content .visit .event-item,
  #content .visit .event-item[href] { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 4px 16px; font-size: 13px; }
  #content .visit .event-date { white-space: normal; }
  #content .visit .event-place { grid-column: 2; }
  #content .visit .events-more { padding-top: 24px; }

  body:has(#content) footer.official-footer { padding: 36px 0 28px !important; border-top: 1px solid #dedede; background: #fff; color: #171719; }
  body:has(#content) footer.official-footer .footer-container,
  body:has(#content) footer.official-footer .international-footer-inner { width: calc(100% - 2 * clamp(18px, 4.8vw, 32px)); max-width: none; }
  body:has(#content) footer.official-footer .footer-psd-cols,
  body:has(#content) footer.official-footer .international-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 20px; min-height: 0; }
  body:has(#content) footer.official-footer .international-footer-grid > section { grid-column: 1 / -1; }
  body:has(#content) footer.official-footer .footer-psd-col h2,
  body:has(#content) footer.official-footer.international-footer h2 { margin-bottom: 16px; color: #171719; font-size: 19px; line-height: 1.35; overflow-wrap: anywhere; }
  body:has(#content) footer.official-footer .footer-psd-col > a,
  body:has(#content) footer.official-footer .international-footer-grid > nav > a { width: auto; margin-bottom: 12px; color: #444; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
  body:has(#content) footer.official-footer .footer-follow > p,
  body:has(#content) footer.official-footer .international-footer-grid > section > p { min-height: 0; margin: 0 0 18px; color: #444; font-size: 14px; }
  body:has(#content) footer.official-footer .international-newsletter { grid-template-columns: minmax(0, 1fr) auto; border-color: #bbb; }
  body:has(#content) footer.official-footer .international-newsletter input,
  body:has(#content) footer.official-footer .international-newsletter button { min-height: 48px; height: auto; padding: 12px; background: #fff; color: #171719; font-size: 12px; }
  body:has(#content) footer.official-footer .international-newsletter button { border-top: 0; border-left: 1px solid #bbb; }
  body:has(#content) footer.official-footer [data-newsletter-status] { color: #333; }
  body:has(#content) footer.official-footer .international-socials,
  body:has(#content) footer.official-footer .footer-cn-social { gap: 14px; margin-top: 18px; }
  body:has(#content) footer.official-footer .international-socials img,
  body:has(#content) footer.official-footer .footer-cn-social img.social-logo { filter: brightness(0); }
  body:has(#content) footer.official-footer .social-control,
  body:has(#content) footer.official-footer .social-word { color: #171719; }
  body:has(#content) footer.official-footer .footer-region,
  body:has(#content) footer.official-footer .footer-psd-links a,
  body:has(#content) footer.official-footer .international-footer-meta > nav a { color: #444; }
  body:has(#content) footer.official-footer .footer-psd-legal,
  body:has(#content) footer.official-footer .international-footer-meta { margin-top: 30px; flex-direction: column; align-items: flex-start; gap: 14px; }
  body:has(#content) footer.official-footer .footer-psd-links,
  body:has(#content) footer.official-footer .international-footer-meta > nav { gap: 12px 20px; }
  body:has(#content) footer.official-footer .footer-psd-copy,
  body:has(#content) footer.official-footer .international-footer-copy { margin-top: 28px; color: #555; text-align: left; font-size: 12px; }
  body:has(#content) footer.official-footer .footer-psd-reg { color: #666; text-align: left; }
  body:has(#content) footer.official-footer :is(a, input, button, summary):focus-visible { outline: 2px solid #171719; outline-offset: 3px; }
}

@media (max-width: 760px) {
  #content .listening-grid,
  #content .celebrity-section .artist-grid {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 14px;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 0;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y pinch-zoom;
    scrollbar-width: thin;
  }
  #content .listening-grid > .listening-card,
  #content .celebrity-section .artist-grid > .artist-card { flex: 0 0 86%; scroll-snap-align: start; }
  #content .listening-arrow, #content .artist-arrow { display: none; }
}

@media (min-width: 761px) and (max-width: 900px) {
  #content .listening-grid > .listening-card,
  #content .celebrity-section .artist-grid > .artist-card { flex: 0 0 calc((100% - 14px) / 2); }
  #content .listening-arrow.previous, #content .artist-arrow.previous { left: 0; }
  #content .listening-arrow.next, #content .artist-arrow.next { right: 0; }
  #content .listening-arrow, #content .artist-arrow { width: 28px; padding-inline: 4px; }
}
