/* ===== phone: guide pages (/guides/<slug>/) =====
   Loaded on guide pages only (build_site.py phone_guide_css), with the phone order from phone-guide.js
   (.gpage[data-pg]). Every rule sits in the phone query below; desktop and tablet do not change. */
@media (max-width: 600px) and (scripting: enabled) {
  /* one line under the title: host · date · licence (the full lines are in "About this guide") */
  #pagebody .gpage[data-pg] p.gmeta-m { margin: 2px 0 12px; font-size: 15px; line-height: 1.4; color: #9aa3b2; }

  /* folds */
  #pagebody .gpage[data-pg] .pg-fold { margin: 20px 0 0; border: 1px solid var(--line, rgba(255,255,255,.12)); border-radius: 14px; background: #0f1630; }
  #pagebody .gpage[data-pg] .pg-fold > summary { position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 56px;
    padding: 10px 44px 10px 16px; cursor: pointer; list-style: none; border-radius: 14px; }
  #pagebody .gpage[data-pg] .pg-fold > summary::-webkit-details-marker { display: none; }
  #pagebody .gpage[data-pg] .pg-fold > summary::after { content: "⌄"; position: absolute; right: 16px; top: 50%; transform: translateY(-60%); font-size: 20px; color: #9aa3b2; }
  #pagebody .gpage[data-pg] .pg-fold[open] > summary { border-radius: 14px 14px 0 0; border-bottom: 1px solid rgba(255,255,255,.08); }
  #pagebody .gpage[data-pg] .pg-fold[open] > summary::after { content: "⌃"; transform: translateY(-30%); }
  #pagebody .gpage[data-pg] .pg-fl { font-size: 17px; font-weight: 600; line-height: 1.3; color: var(--fg, #e8ecf3); }
  #pagebody .gpage[data-pg] .pg-gist { margin-top: 2px; font-size: 14px; line-height: 1.35; color: #9aa3b2; }
  #pagebody .gpage[data-pg] .pg-fold > :not(summary) { margin-left: 16px; margin-right: 16px; }
  #pagebody .gpage[data-pg] .pg-fold > .tablewrap { margin-left: 16px; margin-right: 16px; }
  #pagebody .gpage[data-pg] .pg-fold > :last-child { margin-bottom: 16px; }

  /* About this guide: the fact lines as label and value; the opening words of each line repeat its label, so they hide here */
  #pagebody .gpage[data-pg] #pg-about .gfacts { display: block; list-style: none; margin: 14px 16px 6px; padding: 0; border: 0; }
  #pagebody .gpage[data-pg] #pg-about .gfacts li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; margin: 0; padding: 4px 0;
    font-size: 15px; line-height: 1.45; color: #c7cde3; overflow-wrap: anywhere; }
  #pagebody .gpage[data-pg] #pg-about .gfacts li::before { content: attr(data-k); padding-top: 2px; font-size: 13px; font-weight: 600; letter-spacing: .08em;
    text-transform: uppercase; line-height: 1.4; color: rgb(139,150,194); }
  #pagebody .gpage[data-pg] #pg-about .gfacts li:not([data-k]) { display: block; padding-left: 102px; }
  #pagebody .gpage[data-pg] #pg-about .gfacts li:not([data-k])::before { content: none; }
  #pagebody .gpage[data-pg] #pg-about .gfacts li > .gfk { display: none; }
  #pagebody .gpage[data-pg] #pg-about ul.rows { margin: 0 16px; padding: 0; background: none; border: 0; box-shadow: none; }
  #pagebody .gpage[data-pg] #pg-about ul.rows li { padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; }
  #pagebody .gpage[data-pg] #pg-about ul.rows a { display: flex; align-items: center; min-height: 44px; }
  #pagebody .gpage[data-pg] #pg-about .gcredit { margin-top: 14px; font-size: 13px; opacity: .8; }

  /* footer: a left-aligned two-column list with 44 px rows */
  body:has(.gpage[data-pg]) .sitefoot { text-align: left; }
  body:has(.gpage[data-pg]) .sitefoot nav { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 16px; row-gap: 0;
    justify-items: start; margin: 0 0 16px; padding: 0; text-align: left; }
  body:has(.gpage[data-pg]) .sitefoot nav a { display: flex; align-items: center; min-height: 44px; min-width: 0; max-width: 100%; margin: 0; padding: 0;
    font-size: 14px; line-height: 1.25; color: #c7cde3; white-space: normal; overflow-wrap: anywhere; }
  body:has(.gpage[data-pg]) .sitefoot p, body:has(.gpage[data-pg]) .sitefoot p a { font-size: 14px; }

  /* a solid band behind the bottom action bar, so text does not show through around it */
  body.mpg-guide:has(.gpage[data-pg])::after { content: ""; position: fixed; z-index: 31; left: 0; right: 0; bottom: 0; height: calc(84px + var(--map-bottom, 0px));
    background: linear-gradient(to top, #070b1c calc(100% - 8px), #070b1c00); pointer-events: none; }
  body.mpg-guide:has(.gpage[data-pg]):has(#site-menu[open])::after { display: none; }
}
