/* MEN'S LAB 6.0 - mobile-first private library experience */
.ml-library-stage__scene-picture,
.ml-article-masthead__scene-picture {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.ml-library-stage__scene-picture > img,
.ml-article-masthead__scene-picture > img {
  width: 100%;
  height: 100%;
}

.ml-mobile-shelf-directory,
.ml-mobile-archive-portal,
.ml-mobile-entry-cue {
  display: none;
}

@media (max-width: 780px) {
  body {
    background: #0b1d16;
  }

  .gentlestyle-site-header {
    min-height: 62px;
    padding: 0 16px !important;
    box-shadow: 0 8px 24px rgba(17, 12, 8, 0.14);
  }

  .gentlestyle-site-header__inner {
    min-height: 62px;
  }

  .gentlestyle-logo-lockup {
    width: 170px !important;
    max-height: 44px;
  }

  .gentlestyle-menu-button {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    margin: 0 !important;
    border: 0 !important;
    background: transparent !important;
  }

  .gentlestyle-mobile-category-strip {
    display: grid;
    min-height: 80px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    overflow: visible;
    background: #f1e9da;
  }

  .gentlestyle-mobile-category-strip__link,
  .gentlestyle-mobile-category-strip__link:nth-child(n + 4) {
    min-width: 0;
    min-height: 40px;
    grid-column: span 2;
    padding: 0 5px;
    color: #302d27;
    font-size: 10px;
    white-space: nowrap;
  }

  .gentlestyle-mobile-category-strip__link:nth-child(n + 4) {
    grid-column: span 3;
  }

  .gentlestyle-mobile-category-strip__link[aria-current='page'],
  .gentlestyle-mobile-category-strip__link:nth-child(n + 4)[aria-current='page'] {
    color: #7d302d;
    box-shadow: inset 0 -3px #8d3933;
  }

  .gentlestyle-mobile-menu {
    top: 142px;
  }

  /* Entrance: a portrait scene rather than a cropped desktop hero. */
  .ml-premium-stage {
    height: 1080px !important;
    min-height: 1080px !important;
    background: #0b1c15;
  }

  .ml-premium-stage .ml-library-stage__scene {
    object-position: center center;
    filter: saturate(0.86) contrast(1.03) brightness(0.9);
  }

  .ml-premium-stage .ml-library-stage__veil {
    background:
      linear-gradient(180deg, rgba(5, 15, 11, 0.74) 0%, rgba(5, 15, 11, 0.22) 25%, rgba(5, 15, 11, 0.12) 48%, rgba(5, 15, 11, 0.62) 73%, rgba(4, 15, 11, 0.94) 100%),
      linear-gradient(90deg, rgba(4, 12, 9, 0.3), transparent 35%, transparent 65%, rgba(4, 12, 9, 0.28));
  }

  .ml-premium-stage__intro {
    top: 22px !important;
    left: 18px !important;
    width: calc(100% - 36px) !important;
    text-align: center;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.7);
  }

  .ml-premium-stage__intro p {
    margin-bottom: 6px;
    color: #e1c583 !important;
    font-size: 8px !important;
  }

  .ml-premium-stage__intro h1 {
    margin-bottom: 9px;
    font-size: 21px !important;
  }

  .ml-premium-stage__intro strong {
    margin-bottom: 0;
    font-size: 29px !important;
    line-height: 1.48 !important;
  }

  .ml-premium-stage__intro span {
    display: none;
  }

  .ml-open-book--material {
    top: 176px !important;
    width: min(88vw, 344px) !important;
    transform: translateX(-50%);
    transform-origin: 50% 100%;
  }

  .ml-js .ml-open-book--material {
    animation: ml-mobile-book-arrival 700ms cubic-bezier(0.2, 0.78, 0.24, 1) both;
  }

  .ml-open-book__mobile-shell {
    filter: drop-shadow(0 28px 30px rgba(0, 0, 0, 0.58));
  }

  .ml-open-book--material::after {
    position: absolute;
    right: 18%;
    bottom: 6%;
    left: 24%;
    z-index: -1;
    height: 9%;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.42);
    filter: blur(15px);
    content: '';
  }

  .ml-open-book--material .ml-open-book__page--copy h2 {
    font-size: 15px !important;
    line-height: 1.58 !important;
  }

  .ml-open-book--material .ml-open-book__read {
    min-height: 38px;
    font-size: 11px !important;
  }

  .ml-premium-reader .ml-library-controls {
    top: 704px !important;
    min-height: 48px;
    gap: 7px;
    padding: 4px 8px;
    border-color: rgba(222, 192, 126, 0.5) !important;
    background: rgba(5, 26, 18, 0.93) !important;
  }

  .ml-premium-reader .ml-library-controls button {
    width: 42px !important;
    height: 42px !important;
  }

  .ml-mobile-entry-cue {
    position: absolute;
    top: 768px;
    left: 50%;
    z-index: 14;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #f2d79c;
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    transform: translateX(-50%);
    white-space: nowrap;
  }

  .ml-mobile-entry-cue::before {
    width: 34px;
    height: 1px;
    background: currentColor;
    content: '';
    opacity: 0.7;
  }

  .ml-volume-selector {
    top: 808px;
    bottom: auto;
    height: 250px;
    border-bottom: 12px solid #4a2b1b;
    box-shadow: inset 0 -2px #b28344, 0 20px 30px rgba(0, 0, 0, 0.32);
  }

  .ml-volume-selector::after {
    width: 780px;
  }

  .ml-volume-selector__books {
    bottom: -4px;
    left: 8px;
    width: 780px;
  }

  .ml-volume-selector__grid {
    bottom: 23px;
    left: 38px;
    width: 722px;
    height: 173px;
  }

  .ml-volume-selector__book::after {
    height: 5px;
  }

  .ml-stage-categories--premium {
    display: none !important;
  }

  /* A real shelf is the mobile category directory. */
  .ml-mobile-shelf-directory {
    position: relative;
    display: block;
    min-height: 820px;
    overflow: hidden;
    background: #21140e;
    isolation: isolate;
  }

  .ml-mobile-shelf-directory__scene,
  .ml-mobile-shelf-directory__veil {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .ml-mobile-shelf-directory__scene {
    z-index: 0;
    object-fit: cover;
    object-position: center;
    filter: saturate(0.82) brightness(0.72) contrast(1.06);
  }

  .ml-mobile-shelf-directory__veil {
    z-index: 1;
    background:
      linear-gradient(180deg, rgba(7, 18, 13, 0.82), rgba(7, 18, 13, 0.16) 22%, rgba(7, 18, 13, 0.2) 72%, rgba(7, 18, 13, 0.88)),
      linear-gradient(90deg, rgba(7, 13, 10, 0.55), transparent 45%, rgba(7, 13, 10, 0.3));
  }

  .ml-mobile-shelf-directory__inner {
    position: relative;
    z-index: 2;
    width: min(100% - 36px, 430px);
    margin: 0 auto;
    padding: 34px 0 42px;
  }

  .ml-mobile-shelf-directory__heading {
    color: #fff6e5;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.58);
  }

  .ml-mobile-shelf-directory__heading p {
    margin: 0 0 7px;
    color: #d9bc7a;
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.14em;
  }

  .ml-mobile-shelf-directory__heading h2 {
    margin: 0;
    color: inherit;
    font-family: 'Yu Mincho', 'Hiragino Mincho ProN', serif;
    font-size: 30px;
    font-weight: 600;
    letter-spacing: 0;
  }

  .ml-mobile-shelf-directory__nav {
    display: grid;
    gap: 12px;
    margin-top: 104px;
  }

  .ml-mobile-shelf-directory__nav a {
    position: relative;
    display: grid;
    min-height: 72px;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 0 16px 0 12px;
    border: 1px solid rgba(218, 184, 112, 0.48);
    border-right: 0;
    border-left: 0;
    background: rgba(7, 28, 20, 0.9);
    color: #fff7e7;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(7px);
  }

  .ml-mobile-shelf-directory__nav b {
    display: grid;
    min-height: 36px;
    place-items: center;
    border: 1px solid rgba(218, 184, 112, 0.58);
    color: #e8cd91;
    font-family: Georgia, serif;
    font-size: 10px;
  }

  .ml-mobile-shelf-directory__nav span {
    min-width: 0;
    font-family: 'Yu Mincho', 'Hiragino Mincho ProN', serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0;
  }

  .ml-mobile-shelf-directory__nav em {
    color: #d9bc7a;
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-size: 10px;
    font-style: normal;
  }

  .ml-mobile-shelf-directory__nav a::after {
    color: #e8cd91;
    content: '\2192';
    font-size: 16px;
  }

  .ml-js .ml-mobile-shelf-directory__nav a {
    opacity: 1;
    transform: none;
    transition: opacity 460ms ease, transform 520ms cubic-bezier(0.2, 0.78, 0.24, 1);
  }

  .ml-js .ml-mobile-shelf-directory.is-in-view .ml-mobile-shelf-directory__nav a {
    opacity: 1;
    transform: none;
  }

  .ml-js .ml-mobile-shelf-directory.is-in-view .ml-mobile-shelf-directory__nav a:nth-child(2) { transition-delay: 55ms; }
  .ml-js .ml-mobile-shelf-directory.is-in-view .ml-mobile-shelf-directory__nav a:nth-child(3) { transition-delay: 110ms; }
  .ml-js .ml-mobile-shelf-directory.is-in-view .ml-mobile-shelf-directory__nav a:nth-child(4) { transition-delay: 165ms; }
  .ml-js .ml-mobile-shelf-directory.is-in-view .ml-mobile-shelf-directory__nav a:nth-child(5) { transition-delay: 220ms; }

  /* A large, snap-scrolling volume rail gives each article room to read. */
  .ml-new-arrivals {
    padding: 54px 0 76px !important;
    border-top: 10px solid #5b341f;
    background: #092219 !important;
    box-shadow: inset 0 2px #b48748;
  }

  .ml-new-arrivals .ml-section-heading {
    padding: 0 18px;
  }

  .ml-new-arrivals .ml-section-heading h2,
  .ml-new-arrivals .ml-section-heading a {
    color: #fff6e5 !important;
  }

  .ml-new-arrivals .ml-section-heading p {
    color: #d9bc7a !important;
  }

  .ml-volume-rail {
    gap: 12px !important;
    padding: 8px 18px 26px !important;
    scroll-padding-inline: 18px;
    scroll-snap-type: x mandatory;
  }

  .ml-new-volume {
    width: min(74vw, 286px) !important;
    min-width: min(74vw, 286px) !important;
    scroll-snap-align: center;
  }

  .ml-new-volume__book {
    transform-origin: 50% 100%;
    transition: transform 220ms ease;
  }

  .ml-new-volume:active .ml-new-volume__book {
    transform: translateY(-5px) rotate(-0.6deg);
  }

  .ml-new-volume__copy {
    padding: 12px 8px 0;
  }

  .ml-new-volume__copy strong {
    color: #fff5e2 !important;
    font-size: 16px !important;
    line-height: 1.65 !important;
  }

  .ml-new-volume__copy > span {
    color: rgba(255, 244, 223, 0.65) !important;
  }

  .ml-category-library {
    padding-top: 58px !important;
    background: #eee4d4 !important;
  }

  /* Archive pages begin at the shelf they belong to. */
  .ml-mobile-archive-portal {
    position: relative;
    display: block;
    height: 390px;
    overflow: hidden;
    background: #21140e;
    isolation: isolate;
  }

  .ml-mobile-archive-portal__scene,
  .ml-mobile-archive-portal__veil {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .ml-mobile-archive-portal__scene {
    z-index: 0;
    object-fit: cover;
    object-position: center 22%;
    filter: saturate(0.82) brightness(0.68) contrast(1.05);
  }

  .ml-mobile-archive-portal__veil {
    z-index: 1;
    background: linear-gradient(180deg, rgba(5, 16, 11, 0.12), rgba(5, 16, 11, 0.86));
  }

  .ml-mobile-archive-portal__copy {
    position: absolute;
    right: 20px;
    bottom: 28px;
    left: 20px;
    z-index: 2;
    color: #fff6e4;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.62);
  }

  .ml-mobile-archive-portal__copy p {
    margin: 0 0 8px;
    color: #e0c27f;
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .ml-mobile-archive-portal__copy h1 {
    margin: 0;
    color: inherit;
    font-family: 'Yu Mincho', 'Hiragino Mincho ProN', serif;
    font-size: 34px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0;
    overflow-wrap: anywhere;
  }

  .ml-mobile-archive-portal__copy span {
    display: -webkit-box;
    margin-top: 12px;
    overflow: hidden;
    color: rgba(255, 246, 228, 0.82);
    font-size: 12px;
    line-height: 1.8;
    text-shadow: none;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .ml-mobile-archive-portal + .gentlestyle-listing-page {
    padding: 34px 14px 72px !important;
    background: #eee4d4 !important;
  }

  .ml-mobile-archive-portal + .gentlestyle-listing-page .gentlestyle-listing-intro {
    display: none;
  }

  .ml-mobile-archive-portal + .gentlestyle-listing-page .gentlestyle-arrivals-grid {
    gap: 0 !important;
  }

  /* Article pages open on a portrait reading desk. */
  .ml-article-masthead {
    height: calc(100svh - 108px);
    min-height: 710px;
    max-height: 790px;
  }

  .ml-article-masthead__scene {
    object-position: center center;
    filter: saturate(0.88) contrast(1.03) brightness(0.9);
  }

  .ml-article-masthead__veil {
    background:
      linear-gradient(180deg, rgba(4, 14, 10, 0.78) 0%, rgba(4, 14, 10, 0.12) 28%, rgba(4, 14, 10, 0.06) 73%, rgba(4, 14, 10, 0.44) 100%);
  }

  .ml-article-masthead__inner {
    width: min(100% - 28px, 430px);
    height: 100%;
    padding: 20px 0 0;
  }

  .ml-article-masthead__breadcrumb {
    margin-bottom: 0 !important;
    font-size: 8px;
  }

  .ml-article-opening--material {
    position: absolute;
    top: 45%;
    right: 0;
    left: 0;
    display: grid !important;
    grid-template-columns: minmax(0, 43%) minmax(0, 57%) !important;
    gap: 12px !important;
    align-items: start !important;
    padding: 0 10px !important;
  }

  .ml-article-volume {
    width: 100% !important;
    aspect-ratio: auto !important;
    min-height: 230px;
  }

  .ml-article-volume__shell,
  .ml-article-volume__plate,
  .ml-article-volume__title,
  .ml-article-volume figcaption {
    display: none !important;
  }

  .ml-article-volume__art {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    margin-top: 56px;
    border: 1px solid rgba(90, 67, 42, 0.3);
    box-shadow: 0 8px 16px rgba(40, 27, 16, 0.12);
  }

  .ml-article-opening--material .gentlestyle-single-header {
    min-width: 0;
    padding-top: 8px !important;
    color: #201d18;
    text-shadow: none;
  }

  .ml-article-opening--material .gentlestyle-single-kicker {
    color: #7d342f !important;
    font-size: 7px !important;
    line-height: 1.4;
  }

  .ml-article-opening--material .gentlestyle-single-header h1 {
    display: -webkit-box;
    max-height: 8em;
    margin: 5px 0 7px !important;
    overflow: hidden;
    color: #201d18 !important;
    font-size: 18px !important;
    line-height: 1.55 !important;
    text-shadow: none;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
  }

  .ml-article-opening--material.is-title-long .gentlestyle-single-header h1 {
    max-height: 10.5em;
    font-size: 15px !important;
    line-height: 1.5 !important;
    -webkit-line-clamp: 7;
  }

  .ml-article-opening--material .gentlestyle-single-dates {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 5px;
    margin: 7px 0 0 !important;
    padding: 0 !important;
    color: #6d6253 !important;
    font-size: 6px !important;
    line-height: 1.4;
    white-space: nowrap;
  }

  .ml-article-opening--material .gentlestyle-single-dates > :first-child,
  .ml-article-opening--material .gentlestyle-single-editor {
    display: none;
  }

  .ml-article-opening--material .ml-article-opening__reading {
    min-height: 26px;
    margin-top: 7px;
    padding: 0 9px;
    border-color: rgba(92, 65, 37, 0.35);
    background: rgba(250, 243, 229, 0.72);
    color: #214333;
    font-size: 7px;
  }

  .ml-reader-layout {
    width: min(100% - 20px, 720px);
    padding: 28px 0 72px;
  }

  .ml-reader-paper {
    margin-top: 20px;
    padding: 32px 20px !important;
    border-right: 0;
    border-left: 0;
    box-shadow: 0 16px 34px rgba(54, 37, 21, 0.11);
  }

  .ml-reader-paper > .sm\:pl-6 > p:first-child,
  .ml-reader-paper .gentlestyle-content {
    font-size: 16px !important;
    line-height: 2.05 !important;
  }

  .ml-reader-paper .gentlestyle-content h2 {
    font-size: 23px !important;
    line-height: 1.6 !important;
  }

  .ml-reader-paper .gentlestyle-content h3 {
    padding-left: 12px;
    font-size: 19px !important;
  }
}

@media (max-width: 420px) {
  .ml-premium-stage__intro strong {
    font-size: 27px !important;
  }

  .ml-open-book--material {
    width: min(90vw, 350px) !important;
  }

  .ml-mobile-shelf-directory__nav {
    margin-top: 96px;
  }

  .ml-article-opening--material {
    top: 44%;
    grid-template-columns: minmax(0, 42%) minmax(0, 58%) !important;
    gap: 10px !important;
    padding: 0 8px !important;
  }

  .ml-article-volume__art {
    margin-top: 53px;
  }
}

@keyframes ml-mobile-book-arrival {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(26px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ml-js .ml-open-book--material {
    animation: none !important;
  }

  .ml-js .ml-mobile-shelf-directory__nav a {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
