/* Phone layer for every college review page (/uni/ /osu/ /vt/ /unc/ /ncstate/ /nebraska/ /purdue/).
   Shared on purpose: the pages all use the same skeleton (header, nav.tabs > .wrap > .tab, .panel > .grid > .card > .acts),
   so one file fixes all of them and a rebuild of any page keeps it. Desktop is untouched: everything lives in the query.
   Paired with review-mobile.js, which moves the non-tab controls out of the sticky bar into .mtools on phones. */

/* the intro toggle only exists on phones; if a device rotates past the breakpoint it must not linger */
.m-more { display: none; }

@media (max-width: 760px), (max-height: 520px) {
  html { -webkit-text-size-adjust: 100%; }
  body { overflow-x: hidden; }
  .act, .tab, button, a.card { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

  /* Header: one screen was all header. Keep the identity, lose the height. */
  header .wrap { padding: 20px 16px 18px !important; }
  header .kick { font-size: 10px !important; letter-spacing: .14em !important; line-height: 1.5; }
  header h1 { font-size: clamp(26px, 8.2vw, 34px) !important; line-height: 1 !important; margin-top: 8px !important; text-wrap: balance; }
  header .dek { margin-top: 12px !important; font-size: 14px !important; line-height: 1.55 !important; }
  header .dek.m-clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .m-more { display: inline-block; margin-top: 6px; padding: 8px 0; background: none; border: 0; color: inherit; opacity: .75;
            font: 700 11px/1 Archivo, Helvetica, Arial, sans-serif; letter-spacing: .12em; text-transform: uppercase;
            text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
  header.m-collapsed .rules { display: none !important; }
  header .rules { flex-wrap: nowrap !important; overflow-x: auto; gap: 8px !important; margin: 14px -16px 0 !important;
                  padding: 0 16px 2px; scrollbar-width: none; }
  header .rules::-webkit-scrollbar { display: none; }
  header .rules span { flex: none; white-space: nowrap; font-size: 10px !important; padding: 6px 10px !important; }

  /* Sticky bar: ONE swipeable row of rounds instead of 4-6 wrapped rows covering 60% of the screen. */
  nav.tabs .wrap { flex-wrap: nowrap !important; overflow-x: auto; overscroll-behavior-x: contain;
                   scroll-snap-type: x proximity; scroll-padding: 0 16px; -webkit-overflow-scrolling: touch;
                   scrollbar-width: none; gap: 6px !important; padding: 8px 16px !important;
                   -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
                           mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); }
  nav.tabs .wrap::-webkit-scrollbar { display: none; }
  nav.tabs .tab { flex: none; white-space: nowrap; scroll-snap-align: start; min-height: 40px;
                  display: inline-flex; align-items: center; padding: 0 12px !important;
                  font-size: 12px !important; letter-spacing: .1em !important; }
  nav.tabs .tab i { margin-left: 6px !important; }

  /* Controls that used to ride in the sticky bar now sit once, under it, and scroll away. */
  .mtools { border-bottom: 1px solid var(--line, #2a2a2a); }
  .mtools-in { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 16px; max-width: 1360px; margin: 0 auto; }
  .mtools .spacer { display: none !important; }
  .mtools .dlbtn { flex: 1 1 calc(50% - 4px); min-height: 44px; display: inline-flex !important; align-items: center;
                   justify-content: center; text-align: center; padding: 0 10px !important; font-size: 11px !important;
                   letter-spacing: .1em !important; white-space: normal; line-height: 1.2 !important; }
  .mtools .copy, .mtools .who { font-size: 12px !important; padding: 10px 4px !important; min-height: 40px; }
  .mtools .saveflag, .mtools #savestate { order: -1; flex-basis: 100%; margin: 0 !important; font-size: 12px !important; }

  /* Rounds and cards */
  .panel { padding-top: 18px !important; }
  .panel > .wrap { padding-left: 16px !important; padding-right: 16px !important; }
  .rnote { font-size: 13px !important; line-height: 1.55 !important; margin-bottom: 14px !important; }
  .rnote .drive { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important; gap: 14px !important; }   /* 1 column upright, 2-3 in landscape */
  .card img { display: block; width: 100%; height: auto; }
  .meta { padding: 12px !important; }
  .meta p { font-size: 14px !important; }
  .meta em { font-size: 12px !important; line-height: 1.45; }
  .card .byline, .card .note, .card .shownote { font-size: 13px !important; }

  /* Card actions: thumb-sized, one even row, never 26px buttons that wrap at random. */
  .card .acts { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(68px, 1fr)); gap: 6px !important; margin-top: 12px !important; }
  .copyof .acts { display: none !important; }
  .card .act { min-height: 44px; display: flex !important; align-items: center; justify-content: center; text-align: center;
               padding: 0 6px !important; font-size: 10.5px !important; letter-spacing: .1em !important; }
  .card textarea { font-size: 16px !important; min-height: 76px; }    /* <16px makes iOS zoom the page on focus */
  input, select, textarea { font-size: 16px !important; }

  /* Name bar: a bottom sheet the thumb can reach, not a floating pill with a 13px field. */
  #namebar { left: 0 !important; right: 0 !important; bottom: 0 !important; transform: none !important; width: auto !important;
             max-width: none !important; border-radius: 0 !important; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)) !important; }
  #namebar input { flex: 1 1 100%; width: auto !important; min-height: 44px; }
  #namebar button { flex: 1 1 0; min-height: 44px; }
  #toast { bottom: calc(16px + env(safe-area-inset-bottom)) !important; max-width: calc(100vw - 32px); }

  footer .wrap { padding: 24px 16px calc(24px + env(safe-area-inset-bottom)) !important; }
}
