mobile.css 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. /* ===== Mobile Experience Upgrade ===== */
  2. /* Import this file in all articles: <link rel="stylesheet" href="../css/mobile.css"> */
  3. /* === Base Mobile Reset === */
  4. @media (max-width: 768px) {
  5. :root {
  6. --mobile-padding: 1rem;
  7. --mobile-radius: 12px;
  8. --touch-target: 44px; /* Apple HIG minimum */
  9. }
  10. /* Improve text readability */
  11. body {
  12. font-size: 16px; /* Prevent iOS zoom */
  13. line-height: 1.7;
  14. -webkit-text-size-adjust: 100%;
  15. }
  16. /* Hero optimizations */
  17. .hero {
  18. padding: 5rem var(--mobile-padding) 2.5rem !important;
  19. min-height: auto !important;
  20. }
  21. .hero h1 {
  22. font-size: 1.75rem !important;
  23. line-height: 1.3 !important;
  24. }
  25. .hero p {
  26. font-size: 0.95rem !important;
  27. }
  28. .hero-stats {
  29. flex-direction: column;
  30. gap: 0.75rem !important;
  31. }
  32. .hero-stat {
  33. min-width: 100% !important;
  34. padding: 0.75rem !important;
  35. }
  36. .hero-stat .num {
  37. font-size: 1.5rem !important;
  38. }
  39. /* Section padding */
  40. section {
  41. padding: 2rem var(--mobile-padding) !important;
  42. }
  43. /* Card optimizations */
  44. .info-card,
  45. .card {
  46. padding: 1.25rem !important;
  47. border-radius: var(--mobile-radius) !important;
  48. margin-bottom: 1rem !important;
  49. }
  50. .info-card h2,
  51. .card h3 {
  52. font-size: 1.25rem !important;
  53. }
  54. /* Grid → Single column */
  55. .grid-2,
  56. .grid-3,
  57. .infographic,
  58. .pathway-grid {
  59. grid-template-columns: 1fr !important;
  60. gap: 1rem !important;
  61. }
  62. /* Table horizontal scroll */
  63. .data-table-wrap {
  64. overflow-x: auto;
  65. -webkit-overflow-scrolling: touch;
  66. margin: 1rem calc(-1 * var(--mobile-padding)) !important;
  67. padding: 0 var(--mobile-padding);
  68. }
  69. .data-table {
  70. min-width: 600px; /* Force scroll on narrow screens */
  71. font-size: 0.85rem !important;
  72. }
  73. .data-table th,
  74. .data-table td {
  75. padding: 0.6rem 0.75rem !important;
  76. white-space: nowrap;
  77. }
  78. /* Screenshot responsive */
  79. .screenshot-block {
  80. margin: 1rem calc(-1 * var(--mobile-padding)) !important;
  81. border-radius: 0 !important;
  82. }
  83. .screenshot-block img {
  84. max-width: 100%;
  85. height: auto;
  86. }
  87. /* Evidence links */
  88. .evidence-link {
  89. padding: 1rem !important;
  90. flex-direction: column;
  91. gap: 0.75rem !important;
  92. }
  93. .evidence-link .link-icon {
  94. font-size: 1.25rem !important;
  95. }
  96. /* Highlight boxes */
  97. .highlight-box {
  98. padding: 1rem 1.25rem !important;
  99. margin: 1rem 0 !important;
  100. }
  101. /* TOC navigation */
  102. .toc-inner {
  103. padding: 0.5rem var(--mobile-padding) !important;
  104. gap: 0.5rem !important;
  105. }
  106. .toc-inner a {
  107. padding: 0.5rem 0.75rem !important;
  108. font-size: 0.8rem !important;
  109. white-space: nowrap;
  110. }
  111. /* Reference list */
  112. .ref-list {
  113. padding-left: 1.25rem !important;
  114. }
  115. .ref-list li {
  116. font-size: 0.85rem !important;
  117. line-height: 1.6 !important;
  118. }
  119. /* Section nav */
  120. .section-nav {
  121. gap: 0.5rem !important;
  122. }
  123. .section-nav a {
  124. padding: 0.5rem 0.75rem !important;
  125. font-size: 0.8rem !important;
  126. }
  127. /* Footer */
  128. .footer-inner {
  129. flex-direction: column;
  130. gap: 2rem !important;
  131. }
  132. .footer-links {
  133. flex-direction: column;
  134. gap: 1.5rem !important;
  135. }
  136. /* Pathway cards */
  137. .pathway-card {
  138. border-top-width: 3px !important;
  139. padding: 1.25rem !important;
  140. }
  141. .pathway-card h4 {
  142. font-size: 0.95rem !important;
  143. }
  144. /* Warning boxes */
  145. .warning {
  146. padding: 0.875rem 1rem !important;
  147. font-size: 0.875rem !important;
  148. }
  149. /* Infographic items */
  150. .info-item {
  151. padding: 1.25rem !important;
  152. }
  153. .info-item .icon {
  154. font-size: 1.75rem !important;
  155. }
  156. .info-item h4 {
  157. font-size: 0.9rem !important;
  158. }
  159. .info-item p {
  160. font-size: 0.82rem !important;
  161. }
  162. }
  163. /* === Small phones (≤480px) === */
  164. @media (max-width: 480px) {
  165. .hero h1 {
  166. font-size: 1.5rem !important;
  167. }
  168. .hero-stat .num {
  169. font-size: 1.25rem !important;
  170. }
  171. .info-card h2,
  172. .card h3 {
  173. font-size: 1.15rem !important;
  174. }
  175. .data-table {
  176. min-width: 500px;
  177. }
  178. }
  179. /* === Touch target sizing === */
  180. @media (hover: none) and (pointer: coarse) {
  181. a, button, .toc-inner a, .section-nav a {
  182. min-height: var(--touch-target);
  183. min-width: var(--touch-target);
  184. }
  185. /* Increase tap area for links in text */
  186. p a {
  187. padding: 0.125rem 0;
  188. border-bottom: 1px solid currentColor;
  189. }
  190. }
  191. /* === Safe area for notched phones === */
  192. @supports (padding: env(safe-area-inset-bottom)) {
  193. .site-footer {
  194. padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
  195. }
  196. }