/* Phone Browse page (home.html), OWNER ONLY. Everything here applies only when <html class="gal-ok"> (js/auth.js sets it for the owner)
   and the screen is a phone/tablet width, so nobody else sees any of it. It is one file on purpose, so a piece can be taken out or
   switched off without touching the rest. The page still contains the old pieces (heading text, link arrow, category rail);
   this file only decides which are shown.

   1. Heading "Generate Images and Videos." (no line under it); Create is the button between the pictures; the footer links sit under them
   2. The prompt box (with the typing animation, js/home.js) between the two pictures, and the pictures resized to make room
   3. The category rail ("All categories" and the carousel): HIDDEN -- see the note at that part to bring it back
   4. The Gallery, titled "Browse" (js/gallery.js runs it), in the rail's place
*/

/* hidden for everyone, shown below only for the owner on a phone */
.mp-t-owner, .mp-prompt, .mp-links, .gal-embed, .mp-go-in { display: none; }

@media (max-width: 1023px) {

  /* ---------- 1. heading and Create button ---------- */
  html.gal-ok .mp-t-all { display: none; }
  html.gal-ok .mp-t-owner { display: inline; }
  html.gal-ok .mp-go { display: none; }                          /* the wide button under the pictures: replaced by the one between them */
  html.gal-ok .mp-go-in { display: flex; align-items: center; justify-content: center; height: 38px; padding: 0 22px; border-radius: 12px; background: #1471b5; color: #ffffff; font-weight: 700; font-size: 14.5px; text-decoration: none; box-shadow: 0 6px 16px rgba(20, 113, 181, .3); }   /* Create, in the middle column under the Prompt box, as wide as its text plus a little room */
  html.gal-ok .mp-sub { display: none; }                      /* the line under the heading is gone: the pictures now sit right under the heading */
  html.gal-ok .mp-demo { margin-top: 14px; }
  html.gal-ok .mp-links { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 12px; font-size: 11.5px; color: #666670; }   /* About / Terms & Privacy / Blog, under the pictures */
  html.gal-ok .mp-links a { color: inherit; text-decoration: none; }
  html.gal-ok .mp-links a:hover { text-decoration: underline; }
  body:not(.light-theme) .mp-links { color: #9a9aa5; }
  html.gal-ok .browse-foot { display: none; }                  /* its links moved up under the Create button */

  /* the Terms and Blog buttons are gone from the top right (only Settings stays), so the search bar can run almost the full width */
  html.gal-ok .terms-fab, html.gal-ok .blog-fab { display: none !important; }
  html.gal-ok .search-bubble { margin-right: 52px; }

  /* ---------- 2. prompt box between the pictures ---------- */
  html.gal-ok .mp-link { display: none; }                      /* the small "Prompt" label and arrow it replaces */
  html.gal-ok .mp-prompt { display: flex; flex-direction: column; align-items: center; gap: 10px; align-self: center; min-width: 0; }
  html.gal-ok .mp-prompt > svg { display: none; }                /* the arrow: the Create button takes its place */
  /* one neat column: the prompt box with the Create button under it, then the video still ("Your video"). The "Your image" picture and the
     "Get your video back" caption are hidden. To bring the old three-across row back, delete this part and put the grid-template-columns line back:
     html.gal-ok .mp-demo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr); gap: 8px; align-items: center; } */
  html.gal-ok .mp-in, html.gal-ok .mp-out figcaption { display: none; }
  html.gal-ok .mp-demo { display: flex; flex-direction: column; align-items: center; gap: 18px; margin-top: 16px; }
  html.gal-ok .mp-prompt { width: min(100%, 320px); margin-bottom: 0; }
  html.gal-ok .mp-ptxt { font-size: 13px; }
  html.gal-ok .mp-plbl { font-size: 10.5px; }
  html.gal-ok .mp-fig.mp-out { width: min(52%, 170px); flex: none; }
  html.gal-ok .mp-fig { flex: none; width: 100%; min-width: 0; }
  html.gal-ok .mp-card { border-width: 3px; border-radius: 16px; }
  html.gal-ok .mp-tag { top: 6px; left: 6px; padding: 3px 7px; font-size: 9.5px; }
  html.gal-ok .mp-fig figcaption { margin-top: 8px; font-size: 11.5px; }
  html.gal-ok .mp-fig figcaption b { width: 17px; height: 17px; margin-right: 4px; font-size: 10px; }

  .mp-pbox { width: 100%; box-sizing: border-box; padding: 9px 9px 11px; border-radius: 14px; background: #ffffff; border: 1px solid rgba(31, 143, 220, .28); box-shadow: 0 8px 22px rgba(11, 58, 92, .18); text-align: left; }
  .mp-plbl { display: block; margin-bottom: 5px; text-align: center; font-size: 9.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: #136fb0; }
  .mp-ptxt { position: relative; margin: 0; font-size: 11.5px; line-height: 1.42; color: #3b3b44; word-break: break-word; }
  .mp-pghost { visibility: hidden; }                            /* the full text, invisible, so the box keeps its size while the text types */
  .mp-ptyped { position: absolute; inset: 0; }
  .mp-ptyped::after { content: ''; display: inline-block; width: 2px; height: 1.05em; margin-left: 1px; vertical-align: text-bottom; background: #1471b5; animation: mpBlink 1s steps(1) infinite; }
  @keyframes mpBlink { 50% { opacity: 0; } }
  .mp-prompt svg { width: 28px; height: 19px; stroke: #1471b5; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  body:not(.light-theme) .mp-pbox { background: #1b1b1f; border-color: rgba(143, 211, 255, .22); box-shadow: 0 8px 22px rgba(0, 0, 0, .5); }
  body:not(.light-theme) .mp-plbl { color: #7ec3f3; }
  body:not(.light-theme) .mp-ptxt { color: #d4d4db; }
  @media (prefers-reduced-motion: reduce) { .mp-ptyped::after { animation: none; } }

  /* ---------- 3. category rail: hidden ----------
     To bring "All categories" and the carousel back for the owner: delete this one rule (or this whole part). Nothing else was removed:
     the markup is still in home.html and js/home.js still fills it. (Everyone else always sees it.) */
  html.gal-ok .rail-head, html.gal-ok .rail-prog, html.gal-ok .category-rail { display: none !important; }
  html.gal-ok .browse-head > p { display: none; }                 /* the "Pick a category to explore" line under the search bar */

  /* ---------- 4. the Gallery, titled Browse ---------- */
  html.gal-ok .browse-wrap { justify-content: flex-start; }      /* the page is taller than the screen: start at the top (css/feed-off.css centres it, which would cut the top off) */
  html.gal-ok .gal-embed { display: block; padding-bottom: 8px; }
  html.gal-ok .gal-embed.gal-embed-off { display: none; }        /* the Gallery said no (not the owner): the section goes away */
  .gal-embed .gal-head { display: flex; align-items: center; justify-content: flex-start; gap: 14px; padding: 18px 16px 4px; position: static; }
  .gal-embed-title { margin: 0; font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 24px; letter-spacing: -.5px; color: #0b3a5c; }
  body:not(.light-theme) .gal-embed-title { color: #e8f4fd; }
}

/* ---------- 2b. Two columns (the current phone layout) ----------
   Left: the title, the prompt box, then Create. Right: the video still in its own portrait shape. About / Terms & Privacy / Blog sit below
   the video, across the bottom. This overrides the one-column layout in parts 1 and 2 above. To go back to the single column, delete this whole part. */
@media (max-width: 1023px) {
  html.gal-ok .mp { display: grid; grid-template-columns: minmax(0, 1fr) 44%; grid-template-rows: auto 1fr auto; column-gap: 12px; row-gap: 12px; align-items: start; }   /* the middle row takes the video's extra height, so the prompt sits right under the title */
  html.gal-ok .mp-demo { display: contents; }                       /* the prompt and the video become cells of the grid above */
  html.gal-ok #mpTitle { grid-column: 1; grid-row: 1; margin: 0; min-height: 0; text-align: left; font-size: 22px; line-height: 1.12; letter-spacing: -.6px; }
  html.gal-ok .mp-prompt { grid-column: 1; grid-row: 2; width: 100%; margin: 0; align-items: stretch; align-self: start; gap: 10px; }
  html.gal-ok .mp-ptxt { font-size: 12px; }
  html.gal-ok .mp-go-in { width: 100%; padding: 0; box-sizing: border-box; }
  html.gal-ok .mp-fig.mp-out { grid-column: 2; grid-row: 1 / span 2; width: 100%; align-self: start; }
  html.gal-ok .mp-links { grid-column: 2; grid-row: 3; justify-self: center; width: max-content; margin-top: 2px; }   /* centred right under the video (a touch wider than it, so it spills evenly each side) */
  html.gal-ok .mp-pbox { min-height: 100px; }   /* the prompt box a little longer */
}

/* Signed in (html.wt-in, set by js/auth.js from Clerk's cookie and confirmed in home.html): no "Any image can become a video" promo on the phone either.
   The Browse gallery starts right under the search bar, and the footer links (hidden above because the promo carried them) come back at the bottom. */
@media (max-width: 1023px) {
  html.wt-in .promo-slot { display: none; }
  html.wt-in.gal-ok .browse-foot { display: flex; }
}
