Jump to content

MediaWiki:Mobile.css: Difference between revisions

From Insurer Brain
Content deleted Content added
No edit summary
Tag: Manual revert
No edit summary
Line 153: Line 153:


/* ======================================================= */
/* ======================================================= */
/* 2. FIXED TOP COMMAND BAR (Home - Search - TOC) - FIXED */
/* 2. TRANSPARENT STICKY TOOLBAR (Home - Search - TOC) */
/* ======================================================= */
/* ======================================================= */


/* --- A. THE WHITE BACKGROUND STRIP --- */
/* --- A. READING MODE (Transparent & Sticky) --- */
.header-container.header-chrome {
position: fixed !important;
top: 0 !important;
left: 0 !important;
right: 0 !important;
height: 50px !important;
z-index: 1000 !important;
background-color: #ffffff !important;
border-bottom: 1px solid #eaecf0 !important;
/* CRITICAL FIXES: */
transform: none !important; /* Stop scrolling logic */
transition: none !important;
overflow: visible !important; /* Allow search drawer to hang out the bottom */
}


/* 1. HIDE THE CONTAINER (But keep it technically there) */
/* Push page content down */
/* We make the container invisible so you see the page content behind it. */
body.skin-minerva {
body:not(.mw-mf-search-mode) .header-container.header-chrome {
padding-top: 50px !important;
background: transparent !important;
}
border: none !important;
.mw-body {
margin-top: 50px !important;
box-shadow: none !important;
pointer-events: none !important; /* Let clicks pass through empty space */
position: absolute !important; /* Get out of the way */
}
}


/* Hide unwanted elements */
/* 2. HIDE UNWANTED ELEMENTS */
.header-container .navigation-drawer,
body:not(.mw-mf-search-mode) .navigation-drawer,
body:not(.mw-mf-search-mode) .minerva-header .search-box {
body:not(.mw-mf-search-mode) .minerva-header .search-box {
display: none !important;
display: none !important;
}
}


/* --- B. BUTTON 1: HOME (Fixed Left) --- */
/* --- B. THE 3 STICKY BUTTONS (Pinned to Screen) --- */
/* We use 'position: fixed' on the buttons themselves so they never hide */
.branding-box, .branding-box a {

position: fixed !important;
/* BUTTON 1: HOME (Top Left) */
top: 0 !important;
body:not(.mw-mf-search-mode) .branding-box {
left: 0 !important;
width: 60px !important;
height: 50px !important;
z-index: 1002 !important; /* Above the strip */
display: flex !important;
display: flex !important;
align-items: center;
position: fixed !important;
top: 5px !important;
justify-content: center;
left: 10px !important;
z-index: 1002 !important;
pointer-events: auto !important; /* Re-enable clicking */
}
body:not(.mw-mf-search-mode) .branding-box a {
font-size: 0 !important; color: transparent !important;
}
}
body:not(.mw-mf-search-mode) .branding-box a::before {
.branding-box a { font-size: 0 !important; color: transparent !important; }
.branding-box a::before {
content: "⌂";
content: "⌂";
font-size: 28px;
font-size: 30px;
font-weight: bold;
color: #000;
color: #000;
/* White glow to ensure visibility on dark images */
margin-top: -4px;
text-shadow: 0 0 5px rgba(255,255,255, 0.8);
}
}


/* --- C. BUTTON 2: SEARCH TRIGGER (Fixed Center) --- */
/* BUTTON 2: SEARCH (Top Center) */
#searchIcon {
body:not(.mw-mf-search-mode) #searchIcon {
display: flex !important;
align-items: center; justify-content: center;
position: fixed !important;
position: fixed !important;
top: 0 !important;
top: 5px !important;
left: 50% !important;
left: 50% !important;
transform: translateX(-50%) !important;
transform: translateX(-50%) !important;
width: 60px !important;
width: 44px !important; height: 44px !important;
height: 50px !important;
z-index: 1002 !important;
z-index: 1002 !important;
display: flex !important;
align-items: center;
justify-content: center;
background: transparent !important;
background: transparent !important;
border: none !important;
border: none !important;
box-shadow: none !important;
pointer-events: auto !important;
margin: 0 !important; padding: 0 !important;
margin: 0 !important; padding: 0 !important;
box-shadow: none !important;
}
}
#searchIcon .minerva-icon {
body:not(.mw-mf-search-mode) #searchIcon .minerva-icon {
font-size: 24px;
font-size: 24px;
color: #000;
color: #000;
opacity: 0.7;
opacity: 0.8;
text-shadow: 0 0 5px rgba(255,255,255, 0.8);
}
}


/* --- D. BUTTON 3: TOC (Fixed Right) --- */
/* BUTTON 3: TOC (Top Right) */
#cps-open-toc {
body:not(.mw-mf-search-mode) #cps-open-toc {
display: flex !important;
display: flex !important;
position: fixed !important;
position: fixed !important;
top: 3px !important;
top: 5px !important;
right: 5px !important;
right: 10px !important;
bottom: auto !important;
bottom: auto !important; left: auto !important;
left: auto !important;
width: 44px !important; height: 44px !important;
width: 44px !important;
height: 44px !important;
z-index: 1002 !important;
z-index: 1002 !important;
background: transparent !important;
background: transparent !important;
color: #000 !important;
color: #000 !important;
box-shadow: none !important;
box-shadow: none !important;
pointer-events: auto !important;
}
/* Ensure the TOC icon matches the others */
body:not(.mw-mf-search-mode) #cps-open-toc .icon {
text-shadow: 0 0 5px rgba(255,255,255, 0.8);
}
}


/* --- E. THE REAL SEARCH BAR (The Drawer) --- */
/* --- C. SEARCH MODE (The Clean Switch) --- */
/* When you click Search, we hide the sticky buttons and show a clean white bar. */


/* 1. Target the FORM container, not just the input */
/* 1. Hide the Transparent Sticky Buttons */
body.mw-mf-search-mode .branding-box,
/* We force the entire form wrapper to drop down below the header */
body.mw-mf-search-mode .minerva-search-form {
body.mw-mf-search-mode #searchIcon,
body.mw-mf-search-mode #cps-open-toc {
display: block !important;
display: none !important;
}

/* 2. Show the Standard White Header */
body.mw-mf-search-mode .header-container.header-chrome {
position: fixed !important;
position: fixed !important;
top: 50px !important; /* Pushes it exactly below the toolbar */
top: 0 !important;
left: 0 !important;
left: 0 !important; right: 0 !important;
right: 0 !important;
background: #ffffff !important;
z-index: 999 !important; /* Below the toolbar buttons */
border-bottom: 1px solid #ccc !important;
margin: 0 !important;
padding: 0 !important;
height: auto !important;
height: auto !important;
pointer-events: auto !important;
z-index: 1000 !important;
display: block !important;
}
}


/* 2. Target the inner Box */
/* 3. Show the Input Field */
body.mw-mf-search-mode .minerva-header .search-box {
body.mw-mf-search-mode .minerva-header .search-box {
display: block !important;
display: block !important;
position: relative !important; /* Relative to the form above */
padding: 8px !important;
top: 0 !important;
opacity: 1 !important;
width: 100% !important;
padding: 10px !important;
background-color: #f0f0f0 !important; /* Grey drawer background */
border-bottom: 1px solid #ccc;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
box-sizing: border-box !important;
}
}


/* 3. Style the Input Field */
/* 4. Style the Input Text */
body.mw-mf-search-mode .minerva-header .search-box input {
body.mw-mf-search-mode .minerva-header .search-box input {
display: block !important;
width: 100% !important;
height: 40px !important;
padding-left: 10px !important;
background: #fff !important;
background: #fff !important;
color: #000 !important;
color: #000 !important;
border: 1px solid #ccc !important;
border: 1px solid #ccc !important;
border-radius: 4px !important;
border-radius: 4px !important;
-webkit-appearance: none !important;
height: 36px !important;
opacity: 1 !important;
opacity: 1 !important;
}

/* 4. Hide duplicate icons inside the drawer */
body.mw-mf-search-mode .minerva-header .search-box .search-box-icon-overlay {
display: none !important;
}

/* 5. Dim the Search Trigger Button while searching */
body.mw-mf-search-mode #searchIcon {
opacity: 0.2 !important;
pointer-events: none;
}
}

Revision as of 21:30, 6 December 2025

/* All CSS here will be loaded for users of the mobile site */

/* Standard <youtube> (no lazy-load) */
.mw-parser-output iframe[data-extension="youtube"] {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9;
  display: block;
}

/* Lazy-load wrapper + its thumbnail image */
.mw-parser-output .ext-YouTube-video {
  width: 100% !important;   /* override inline width="560px" etc. */
  height: auto !important;  /* override inline height */
}
.mw-parser-output .ext-YouTube-video img {
  width: 100% !important;   /* scale preview to screen */
  height: auto !important;
  aspect-ratio: 16 / 9;
  display: block;
}

/* Optional: cap on very large screens (adjust 720px to taste) */
@media (min-width: 992px) {
  .mw-parser-output iframe[data-extension="youtube"],
  .mw-parser-output .ext-YouTube-video {
    max-width: 720px;
    margin: 0 auto;
  }
}

/* CapSach — Mobile TOC overlay (all skins) */
#cps-open-toc {
  position: fixed;
  
  /* POSITION: Right side */
  right: 16px;             /* Changed from left: 16px */
  left: auto;              /* Safety: ensures left is unset */
  
  /* POSITION: Lifted (to clear Google Anchor Ads) */
  bottom: calc(120px + env(safe-area-inset-bottom, 0px));
  
  /* SHAPE: Smaller Size (40px) */
  width: 44px;             /* Changed from 48px */
  height: 44px;            /* Changed from 48px */
  
  border: 0; border-radius: 999px;
  display: none; 
  align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
  color: #fff; background: rgba(0,0,0,.1);
  /* box-shadow: 0 2px 8px rgba(0,0,0,.0);*/
  z-index: 1000; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

#cps-open-toc:focus { outline: 2px solid #36c; outline-offset: 2px; }
#cps-open-toc .label { display: none; } /* icon-only by default */
#cps-open-toc .icon { font-size: 20px; line-height: 1; }

/* Full-screen scrim */
#cps-toc-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.1);
  display: none; z-index: 1001;
}
#cps-toc-overlay.is-open { display: block; }

/* Bottom sheet panel */
#cps-toc-panel {
  position: fixed; left: 0; right: 0; bottom: 0;
  max-height: 85vh;
  border-radius: 12px 12px 0 0;
  background: #fff; color: #202122;
  /* box-shadow: 0 -8px 20px rgba(0,0,0,.0);*/
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px)) 12px;
}

/* Header row */
#cps-toc-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
#cps-toc-title { font-size: 16px; font-weight: 600; margin: 0; }
#cps-toc-close {
  background: transparent; border: 0; font-size: 22px; line-height: 1;
}

/* List */
#cps-toc-list {
  list-style: none; margin: 0; padding: 4px 2px 6px;
  max-height: 70vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
#cps-toc-list li { margin: 2px 0; }
#cps-toc-list a {
  display: block; padding: 8px 10px; border-radius: 8px;
  text-decoration: none; color: inherit;
}
#cps-toc-list a:focus, #cps-toc-list a:active {
  outline: 2px solid #36c; background: #f5f6f7;
}

/* Indentation by heading level */
#cps-toc-list li[data-level="3"] { padding-left: 12px; }
#cps-toc-list li[data-level="4"] { padding-left: 24px; }
#cps-toc-list li[data-level="5"] { padding-left: 36px; }
#cps-toc-list li[data-level="6"] { padding-left: 48px; }

/* Only show on phone-ish widths; tablet/desktop keep native TOC */
@media (min-width: 768px) {
  #cps-open-toc, #cps-toc-overlay { display: none !important; }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ======================================================= */
/* FIX: HIDE DUPLICATE "CONTENTS" TITLE IN MOBILE TOC      */
/* ======================================================= */

/* This hides the original MediaWiki header inside your custom panel */
#cps-toc-panel .toctitle,
#cps-toc-panel #mw-toc-heading,
#cps-toc-panel h2 {
    display: none !important;
}

/* ======================================================= */
/* 1. DESKTOP STICKY HEADER (Vector 2022 Skin)             */
/* ======================================================= */
/* This part works perfectly, as confirmed. */

.vector-header-container {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Pushes article content down so it isn't hidden behind the fixed header */
body.skin-vector-2022 {
    padding-top: 60px;
}
.mw-page-container {
    margin-top: 10px;
}

/* ======================================================= */
/* 2. TRANSPARENT STICKY TOOLBAR (Home - Search - TOC)     */
/* ======================================================= */

/* --- A. READING MODE (Transparent & Sticky) --- */

/* 1. HIDE THE CONTAINER (But keep it technically there) */
/* We make the container invisible so you see the page content behind it. */
body:not(.mw-mf-search-mode) .header-container.header-chrome {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    pointer-events: none !important; /* Let clicks pass through empty space */
    position: absolute !important;   /* Get out of the way */
}

/* 2. HIDE UNWANTED ELEMENTS */
body:not(.mw-mf-search-mode) .navigation-drawer,
body:not(.mw-mf-search-mode) .minerva-header .search-box {
    display: none !important;
}

/* --- B. THE 3 STICKY BUTTONS (Pinned to Screen) --- */
/* We use 'position: fixed' on the buttons themselves so they never hide */

/* BUTTON 1: HOME (Top Left) */
body:not(.mw-mf-search-mode) .branding-box {
    display: flex !important;
    position: fixed !important;
    top: 5px !important;
    left: 10px !important;
    z-index: 1002 !important;
    pointer-events: auto !important; /* Re-enable clicking */
}
body:not(.mw-mf-search-mode) .branding-box a {
    font-size: 0 !important; color: transparent !important;
}
body:not(.mw-mf-search-mode) .branding-box a::before {
    content: "⌂"; 
    font-size: 30px;
    font-weight: bold;
    color: #000;
    /* White glow to ensure visibility on dark images */
    text-shadow: 0 0 5px rgba(255,255,255, 0.8); 
}

/* BUTTON 2: SEARCH (Top Center) */
body:not(.mw-mf-search-mode) #searchIcon {
    display: flex !important;
    align-items: center; justify-content: center;
    position: fixed !important;
    top: 5px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 44px !important; height: 44px !important;
    z-index: 1002 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    pointer-events: auto !important;
    margin: 0 !important; padding: 0 !important;
}
body:not(.mw-mf-search-mode) #searchIcon .minerva-icon {
    font-size: 24px;
    color: #000;
    opacity: 0.8;
    text-shadow: 0 0 5px rgba(255,255,255, 0.8);
}

/* BUTTON 3: TOC (Top Right) */
body:not(.mw-mf-search-mode) #cps-open-toc {
    display: flex !important;
    position: fixed !important;
    top: 5px !important;
    right: 10px !important;
    bottom: auto !important; left: auto !important;
    width: 44px !important; height: 44px !important;
    z-index: 1002 !important;
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    pointer-events: auto !important;
}
/* Ensure the TOC icon matches the others */
body:not(.mw-mf-search-mode) #cps-open-toc .icon {
    text-shadow: 0 0 5px rgba(255,255,255, 0.8);
}

/* --- C. SEARCH MODE (The Clean Switch) --- */
/* When you click Search, we hide the sticky buttons and show a clean white bar. */

/* 1. Hide the Transparent Sticky Buttons */
body.mw-mf-search-mode .branding-box,
body.mw-mf-search-mode #searchIcon,
body.mw-mf-search-mode #cps-open-toc {
    display: none !important;
}

/* 2. Show the Standard White Header */
body.mw-mf-search-mode .header-container.header-chrome {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important; right: 0 !important;
    background: #ffffff !important;
    border-bottom: 1px solid #ccc !important;
    height: auto !important;
    pointer-events: auto !important;
    z-index: 1000 !important;
    display: block !important;
}

/* 3. Show the Input Field */
body.mw-mf-search-mode .minerva-header .search-box {
    display: block !important;
    padding: 8px !important;
    opacity: 1 !important;
}

/* 4. Style the Input Text */
body.mw-mf-search-mode .minerva-header .search-box input {
    background: #fff !important;
    color: #000 !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    height: 36px !important;
    opacity: 1 !important;
}