Jump to content

MediaWiki:Mobile.css: Difference between revisions

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


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


/* --- A. THE TOOLBAR CONTAINER --- */
/* --- A. THE WHITE BACKGROUND STRIP --- */
/* We turn the header into a fixed, 50px tall white bar */
/* We freeze the header container to act as the white background */
.header-container.header-chrome {
.header-container.header-chrome {
position: fixed !important;
position: fixed !important;
top: 0;
top: 0 !important;
left: 0;
left: 0 !important;
right: 0;
right: 0 !important;
height: 50px !important;
height: 50px !important;
z-index: 1000;
z-index: 1000 !important;
background-color: #ffffff !important;
background-color: #ffffff !important;
border-bottom: 1px solid #eaecf0;
border-bottom: 1px solid #eaecf0 !important;
transform: none !important; /* STOP MediaWiki from hiding it on scroll */
box-shadow: 0 1px 2px rgba(0,0,0,0.05);
transition: none !important;
/* Flex layout to arrange our 3 buttons */
display: flex !important;
align-items: center;
justify-content: center; /* Center the middle elements */
}
}


/* Ensure content doesn't get hidden behind the toolbar */
/* Push page content down so it starts below the bar */
body.skin-minerva {
body.skin-minerva {
padding-top: 50px !important;
padding-top: 50px !important;
}
}
.mw-body {

margin-top: 50px !important;
/* --- B. HIDE UNWANTED ELEMENTS --- */
/* Hide the Hamburger Menu */
.header-container .navigation-drawer {
display: none !important;
}
}


/* Hide the Text Input initially (we only want the icon) */
/* Hide the default Hamburger Menu and Search Input */
.header-container .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;
}
}


/* --- C. BUTTON 1: HOME (Left) --- */
/* --- B. BUTTON 1: HOME (Fixed Left) --- */
/* We repurpose the Logo (.branding-box) to be the Home Button */
/* We detach the logo and pin it to the screen */
.header-container .branding-box {
.branding-box,
.branding-box a {
position: absolute !important;
left: 0 !important;
position: fixed !important; /* Pin to Viewport */
top: 0 !important;
top: 0 !important;
left: 0 !important;
width: 60px !important;
height: 50px !important;
height: 50px !important;
width: 60px !important;
z-index: 1002 !important; /* Above the white strip */
display: flex !important;
display: flex !important;
align-items: center;
align-items: center;
Line 204: Line 201:
}
}


/* Hide text, show Icon */
.header-container .branding-box a {
.branding-box a {
/* Hide the text "bizslash.com" */
font-size: 0 !important;
font-size: 0 !important;
color: transparent !important;
color: transparent !important;
text-decoration: none !important;
}
}
.branding-box a::before {

/* Add the House Icon */
content: "⌂"; /* House Icon */
.header-container .branding-box a::before {
content: "⌂"; /* Unicode House */
font-size: 28px;
font-size: 28px;
color: #000;
color: #000;
display: block;
margin-top: -4px;
line-height: 50px;
margin-top: -5px;
}
}


/* --- D. BUTTON 2: SEARCH (Center) --- */
/* --- C. BUTTON 2: SEARCH TRIGGER (Fixed Center) --- */
/* Position the existing search icon in the middle */
/* We detach the search icon and pin it to the center */
#searchIcon {
#searchIcon {
position: fixed !important; /* Pin to Viewport */
top: 0 !important;
left: 50% !important;
transform: translateX(-50%) !important; /* Perfect Center */
width: 60px !important;
height: 50px !important;
z-index: 1002 !important;
display: flex !important;
display: flex !important;
align-items: center;
align-items: center;
justify-content: center;
justify-content: center;
height: 50px !important;
width: 60px !important;
background: transparent !important;
background: transparent !important;
border: none !important;
border: none !important;
Line 234: Line 233:
margin: 0 !important;
margin: 0 !important;
padding: 0 !important;
padding: 0 !important;
/* Center it absolutely if flex fails */
position: absolute !important;
left: 50%;
transform: translateX(-50%);
}
}


/* Icon Style */
#searchIcon .minerva-icon {
#searchIcon .minerva-icon {
font-size: 24px;
font-size: 24px;
Line 247: Line 242:
}
}


/* --- E. BUTTON 3: TABLE OF CONTENTS (Right) --- */
/* --- D. BUTTON 3: TOC (Fixed Right) --- */
/* We move your custom TOC button from bottom-right to top-right */
/* We pin your TOC button to the top right */
#cps-open-toc {
#cps-open-toc {
display: flex !important; /* Ensure it is visible */
display: flex !important;
position: absolute !important;
position: fixed !important; /* Pin to Viewport */
top: 3px !important; /* Center vertically in 50px bar */
top: 3px !important;
right: 10px !important; /* Pin to right */
right: 5px !important;
bottom: auto !important; /* Remove bottom positioning */
bottom: auto !important; /* Override old bottom setting */
left: auto !important;
left: auto !important;
width: 44px !important;
width: 44px !important;
height: 44px !important;
height: 44px !important;
background: transparent !important; /* Make it blend in */
z-index: 1002 !important;
color: #000 !important;
background: transparent !important;
color: #000 !important; /* Black icon */
box-shadow: none !important;
box-shadow: none !important;
}
}


/* Style the TOC icon to look like a standard list icon */
/* --- E. THE REAL SEARCH BAR (The Drawer) --- */
/* When search is clicked, the input box appears BELOW the header */
#cps-open-toc .icon {
font-size: 24px !important;
font-weight: bold;
}


/* 1. Reset the container visibility */
/* --- F. THE INTERACTION: SEARCH BAR DRAWER --- */
/* When Search is clicked (.mw-mf-search-mode), show the input bar BELOW the header */
body.mw-mf-search-mode .minerva-header .search-box {
display: block !important;

visibility: visible !important;
/* 1. Reset the Header to ensure it stays fixed */
opacity: 1 !important;
body.mw-mf-search-mode .header-container.header-chrome {
position: fixed !important;
z-index: 1000;
}
}


/* 2. Position the Input Box */
/* 2. Position the Drawer */
body.mw-mf-search-mode .minerva-header .search-box {
body.mw-mf-search-mode .minerva-header .search-box {
display: block !important;
position: fixed !important;
position: fixed !important;
top: 50px !important; /* Starts exactly where header ends */
/* Put it exactly below the 50px header */
top: 50px !important;
left: 0 !important;
left: 0 !important;
right: 0 !important;
right: 0 !important;
height: auto !important;
padding: 10px !important;
/* Style the drawer */
background-color: #f0f0f0 !important; /* Light grey drawer background */
background-color: #f8f9fa !important;
padding: 10px !important;
border-bottom: 1px solid #ccc;
border-bottom: 1px solid #ccc;
z-index: 999 !important; /* Just below the header */
z-index: 999 !important; /* Below the buttons, but above content */
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
height: auto !important;
}
}


/* 3. Style the Input Field inside the drawer */
/* 3. Style the Input Field */
body.mw-mf-search-mode .minerva-header .search-box input {
body.mw-mf-search-mode .min
width: 100% !important;
height: 36px !important;
border: 1px solid #a2a9b1 !important;
border-radius: 4px !important;
padding-left: 10px !important;
background: #fff !important;
color: #000 !important;
-webkit-text-fill-color: #000 !important;
opacity: 1 !important;
}

/* 4. Hide the "Search" button while searching (Optional, avoids confusion) */
body.mw-mf-search-mode #searchIcon {
opacity: 0.3 !important; /* Dim it to show it's active */
pointer-events: none;
}

Revision as of 21:17, 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. FIXED TOP COMMAND BAR (Home - Search - TOC)          */
/* ======================================================= */

/* --- A. THE WHITE BACKGROUND STRIP --- */
/* We freeze the header container to act as the white background */
.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;
    transform: none !important; /* STOP MediaWiki from hiding it on scroll */
    transition: none !important;
}

/* Push page content down so it starts below the bar */
body.skin-minerva {
    padding-top: 50px !important;
}
.mw-body {
    margin-top: 50px !important;
}

/* Hide the default Hamburger Menu and Search Input */
.header-container .navigation-drawer,
body:not(.mw-mf-search-mode) .minerva-header .search-box {
    display: none !important;
}

/* --- B. BUTTON 1: HOME (Fixed Left) --- */
/* We detach the logo and pin it to the screen */
.branding-box,
.branding-box a {
    position: fixed !important; /* Pin to Viewport */
    top: 0 !important;
    left: 0 !important;
    width: 60px !important;
    height: 50px !important;
    z-index: 1002 !important; /* Above the white strip */
    
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* Hide text, show Icon */
.branding-box a {
    font-size: 0 !important;
    color: transparent !important;
}
.branding-box a::before {
    content: "⌂"; /* House Icon */
    font-size: 28px;
    color: #000;
    margin-top: -4px;
}

/* --- C. BUTTON 2: SEARCH TRIGGER (Fixed Center) --- */
/* We detach the search icon and pin it to the center */
#searchIcon {
    position: fixed !important; /* Pin to Viewport */
    top: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) !important; /* Perfect Center */
    
    width: 60px !important;
    height: 50px !important;
    z-index: 1002 !important;
    
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Icon Style */
#searchIcon .minerva-icon {
    font-size: 24px;
    color: #000;
    opacity: 0.7;
}

/* --- D. BUTTON 3: TOC (Fixed Right) --- */
/* We pin your TOC button to the top right */
#cps-open-toc {
    display: flex !important;
    position: fixed !important; /* Pin to Viewport */
    top: 3px !important;
    right: 5px !important;
    bottom: auto !important; /* Override old bottom setting */
    left: auto !important;
    
    width: 44px !important;
    height: 44px !important;
    z-index: 1002 !important;
    
    background: transparent !important;
    color: #000 !important; /* Black icon */
    box-shadow: none !important;
}

/* --- E. THE REAL SEARCH BAR (The Drawer) --- */
/* When search is clicked, the input box appears BELOW the header */

/* 1. Reset the container visibility */
body.mw-mf-search-mode .minerva-header .search-box {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* 2. Position the Drawer */
body.mw-mf-search-mode .minerva-header .search-box {
    position: fixed !important;
    top: 50px !important; /* Starts exactly where header ends */
    left: 0 !important;
    right: 0 !important;
    height: auto !important;
    padding: 10px !important;
    
    background-color: #f0f0f0 !important; /* Light grey drawer background */
    border-bottom: 1px solid #ccc;
    z-index: 999 !important; /* Below the buttons, but above content */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* 3. Style the Input Field */
body.mw-mf-search-mode .min