/* Phone layout for /portfolio/ (chosen 2026-10-09: design B, one scrolling page).
   Same breakpoint as main.js and the homepage: narrower than 760px, or portrait (width/height < 0.9). */

#m-app { display: none; }

@media (max-width: 759px), (max-aspect-ratio: 9/10) {
  #app, #lightbox { display: none !important; }
  #m-app {
    display: block;
    position: fixed;
    inset: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    background: var(--ink);
    color: var(--green);
    font-family: var(--font-display);
    -webkit-tap-highlight-color: transparent;
  }
}

:where(#m-app) a { color: inherit; }
:where(#m-app) button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.m-header {
  display: flex; align-items: baseline; gap: .35em;
  padding: 18px 16px 14px; font-size: 22px;
  border-bottom: 2px solid var(--green);
}
.m-header a { text-decoration: underline; text-underline-offset: 3px; }

/* project bars */
.m-item { border-bottom: 2px solid var(--green); }
.m-item__head {
  position: sticky; top: 0; z-index: 3;
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 16px; text-align: left; background: var(--ink);
  font-size: 24px; line-height: 1.15;
}
.m-item__label { flex: 1; min-width: 0; }
.m-item__year { font-size: 15px; opacity: .75; margin-left: .45em; white-space: nowrap; }
.m-item__close { display: none; flex: none; font-size: 30px; line-height: 1; width: 1em; text-align: center; color: var(--ink); }
.m-item.is-open .m-item__head { background: var(--green); color: var(--ink); }
.m-item.is-open .m-item__close { display: block; }
.m-item.is-open .m-item__year { opacity: .8; }

.m-item__body { display: grid; gap: 14px; padding: 0 0 24px; }
.m-item:not(.is-open) .m-item__body { display: none; }
.m-item__body > .m-pad { padding: 0 16px; }

.m-meta { font-size: 14px; line-height: 1.5; opacity: .9; }
.m-desc p { font-size: 16px; line-height: 1.6; margin-bottom: 12px; }
.m-meta a, .m-desc a, .m-visit { text-decoration: underline; text-underline-offset: 3px; }
.m-meta a:active, .m-desc a:active, .m-visit:active { background: var(--green); color: var(--ink); }

.m-video { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: #0f0909; }
.m-video--mp4 { aspect-ratio: auto; }

/* swipeable images (native scroll-snap) */
.m-swipe { position: relative; }
.m-swipe__track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.m-swipe__track::-webkit-scrollbar { display: none; }
.m-swipe__track img {
  flex: none; width: 100%; aspect-ratio: 4 / 3; object-fit: contain;
  scroll-snap-align: center; display: block; background: #0f0909;
}
.m-swipe__count { position: absolute; right: 10px; top: 10px; font-size: 12px; padding: 2px 6px; background: var(--ink); }
.m-swipe__dots { display: flex; justify-content: center; gap: 6px; padding: 10px 0 0; }
.m-swipe__dots span { width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--green); }
.m-swipe__dots span.is-on { background: var(--green); }

/* full-screen image viewer */
.m-viewer { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .94); display: flex; flex-direction: column; justify-content: center; }
.m-viewer .m-swipe__track img { aspect-ratio: auto; height: 78vh; height: 78dvh; background: none; }
.m-viewer__close { position: absolute; top: 10px; right: 10px; z-index: 2; width: 44px; height: 44px; font-size: 30px; color: #fff !important; }

/* several videos with titles: player + title buttons (same highlight as elsewhere: green when selected) */
.m-vidlist { display: grid; gap: 10px; }
.m-vids { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px; }
.m-vid {
  font-size: 15px; line-height: 1.2; text-align: left;
  padding: 8px 10px; border: 1px solid var(--green);
  min-height: 40px;
}
.m-vid.is-on { background: var(--green); color: var(--ink); }
