/**
 * 20261025island1
 * Mobile-only jump island + collapsed secondary sections.
 * Loaded before wdhc-ui-locks.css. Desktop (>768px) is unchanged.
 * Critical padding that must beat lock !important lives in the ADD block
 * at the end of wdhc-ui-locks.css.
 */

@media (min-width: 769px) {
  #wdhc-island {
    display: none !important;
  }
  .wdhc-fold {
    max-height: none !important;
    overflow: visible !important;
  }
  .wdhc-fold::after,
  .wdhc-fold__toggle {
    display: none !important;
  }
}

@media (max-width: 768px) {
  #wdhc-island {
    --wdhc-gold: #d4af37;
    position: fixed;
    z-index: 420;
    left: 50%;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 1px;
    width: max-content;
    max-width: calc(100vw - 12px);
    height: 62px;
    margin: 0;
    padding: 5px;
    box-sizing: border-box;
    background: #0b0b0b;
    color: #f4f4f4;
    border: 1px solid rgba(212, 175, 55, 0.72);
    border-radius: 999px;
    box-shadow:
      0 10px 28px rgba(0, 0, 0, 0.55),
      inset 0 0 0 1px rgba(212, 175, 55, 0.18);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }

  #wdhc-island.is-raised {
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }

  #wdhc-island.is-suppressed,
  body:has(.wdhc-reels-modal.is-open) #wdhc-island,
  body:has(dialog[open]) #wdhc-island,
  body:has(.wdhc-reels-sheet.is-open) #wdhc-island,
  html:fullscreen #wdhc-island {
    display: none !important;
  }

  .wdhc-island__btn {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    min-width: 58px;
    max-width: 74px;
    height: 52px;
    margin: 0;
    padding: 3px 6px 4px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #fff;
    font-family: Oswald, 'Arial Narrow', sans-serif;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.03em;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .wdhc-island__btn svg {
    width: 18px;
    height: 18px;
    display: block;
    stroke: #d4af37;
    fill: none;
  }

  .wdhc-island__btn.is-active {
    background: rgba(212, 175, 55, 0.16);
    color: #f0d78c;
    box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.45);
  }

  .wdhc-island__btn:focus-visible {
    outline: 2px solid #d4af37;
    outline-offset: 1px;
  }

  a, button, summary, .nav-menu-toggle, .wdhc-fold__toggle {
    touch-action: manipulation;
  }

  #wdhc-recent,
  #hang-type-boards,
  #grip-age-calculator,
  #home-rules,
  .leaderboard,
  .home-lower-band {
    scroll-margin-top: calc(var(--wdhc-nav-h, 64px) + 8px);
  }

  .wdhc-fold {
    /* Beats .sidebar-card { position: static !important } in wdhc-home.css.
       Without this, Show more anchors to the 100dvh body and covers Watch Reels Feed. */
    position: relative !important;
  }

  #wdhc-recent .wdhc-fold__toggle,
  #wdhc-recent.wdhc-fold::after {
    display: none !important;
  }

  .wdhc-fold:not(.is-open):not(.is-measuring) {
    max-height: 168px;
    overflow: hidden;
  }

  .wdhc-fold.is-measuring {
    max-height: none !important;
    overflow: visible !important;
  }

  .wdhc-fold:not(.is-open)::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 72px;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(5, 5, 5, 0), #050505 70%);
    z-index: 2;
  }

  .wdhc-fold__toggle {
    position: relative;
    z-index: 3;
    display: block;
    margin: 8px auto 4px;
    padding: 6px 14px;
    min-height: 32px;
    border-radius: 999px;
    border: 1px solid rgba(212, 175, 55, 0.7);
    background: #0b0b0b;
    color: #d4af37;
    font-family: Oswald, 'Arial Narrow', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .wdhc-fold:not(.is-open) > .wdhc-fold__toggle {
    position: absolute;
    left: 50%;
    bottom: 8px;
    transform: translateX(-50%);
    margin: 0;
  }

  .wdhc-fold.is-open > .wdhc-fold__toggle {
    order: 99;
    align-self: center;
    margin: 12px auto 8px;
  }

  .video-submission-frame,
  img.carousel-poster {
    aspect-ratio: 9 / 16;
    background: #0a0a0a;
  }

  img.carousel-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .details-film-room__media,
  .details-film-room__video {
    aspect-ratio: 16 / 9;
    background: #0a0a0a;
  }

  .portal-promo-dashboard-img {
    aspect-ratio: 960 / 560;
    width: 100%;
    height: auto;
    background: #0a0a0a;
  }

  video,
  .video-submission-frame,
  .video-carousel,
  .details-film-room,
  .lb-row-wrapper {
    overflow-anchor: none;
  }

  video {
    max-width: 100%;
  }
}

/* 20261027mfold1 (Milo 10/27): one clean expander for folded reference
   sections, kept inside the card, plus even spacing between mobile sections.
   Desktop (>768px) untouched. */
@media (max-width: 768px) {
  html body .wdhc-fold:not(.is-open):not(.is-measuring) {
    max-height: 210px !important;
    overflow: hidden !important;
    padding-bottom: 56px !important;
  }
  html body .wdhc-fold:not(.is-open)::after {
    bottom: 0 !important;
    height: 130px !important;
    z-index: 5 !important;
    border-radius: inherit;
    background: linear-gradient(to bottom, rgba(11, 11, 11, 0) 0%, rgba(11, 11, 11, 0.92) 45%, #0b0b0b 58%) !important;
  }
  html body .wdhc-fold > .wdhc-fold__toggle,
  html body .wdhc-fold:not(.is-open) > .wdhc-fold__toggle,
  html body .wdhc-fold.is-open > .wdhc-fold__toggle {
    position: absolute !important;
    left: 12px !important;
    right: 12px !important;
    bottom: 10px !important;
    transform: none !important;
    width: auto !important;
    margin: 0 !important;
    min-height: 36px !important;
    padding: 8px 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    border-radius: 999px !important;
    border: 1px solid rgba(212, 175, 55, 0.7) !important;
    background: #0b0b0b !important;
    z-index: 6 !important;
    color: #d4af37 !important;
    font-size: 13px !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
  }
  html body .wdhc-fold > .wdhc-fold__toggle::after {
    content: "";
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
  }
  html body .wdhc-fold.is-open {
    padding-bottom: 58px !important;
  }
  html body .wdhc-fold.is-open > .wdhc-fold__toggle::after {
    transform: translateY(2px) rotate(-135deg);
  }

  /* Even 32px rhythm between homepage sections. */
  html body .sidebar-card--tiers,
  html body .home-challenges-block > .home-challenges-hero,
  html body #home-challenges-winners,
  html body .sidebar-card--leaders,
  html body .icon-legend-card,
  html body .grip-calc-card,
  html body .cta-section--under-submissions,
  html body .wdhc-friend-share--home,
  html body #home-rules,
  html body .portal-promo-section,
  html body #hang-type-boards,
  html body #pick-a-board {
    margin-top: 32px !important;
  }
  html body .icon-legend-card.sidebar-card--collapsible {
    margin-top: 12px !important;
  }
}
