MediaWiki:Mobile.css: Difference between revisions

From New wiki
Jump to navigation Jump to search
Content deleted Content added
No edit summary
No edit summary
Line 153: Line 153:


/* ======================================================= */
/* ======================================================= */
/* 2. TRANSPARENT STICKY TOOLBAR (Home - Search - TOC) */
/* 2. TRANSLUCENT BLACK TOOLBAR (Single Line Layout) */
/* ======================================================= */
/* ======================================================= */


/* --- A. READING MODE (Transparent & Sticky) --- */
/* --- A. THE HEADER CONTAINER (The Black Strip) --- */
.header-container.header-chrome {

position: fixed !important;
/* 1. HIDE THE CONTAINER (But keep it technically there) */
top: 0 !important;
/* We make the container invisible so you see the page content behind it. */
left: 0 !important;
body:not(.mw-mf-search-mode) .header-container.header-chrome {
background: transparent !important;
right: 0 !important;
border: none !important;
height: 50px !important;
box-shadow: none !important;
z-index: 1000 !important;
pointer-events: none !important; /* Let clicks pass through empty space */
/* Translucent Black Background */
position: absolute !important; /* Get out of the way */
background-color: rgba(0, 0, 0, 0.85) !important;
border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
backdrop-filter: blur(5px); /* Optional: Adds the "frosted glass" effect */
/* Fixes */
transform: none !important;
transition: none !important;
overflow: visible !important;
}
}


/* 2. HIDE UNWANTED ELEMENTS */
/* Push body content down */
body.skin-minerva { padding-top: 50px !important; }
body:not(.mw-mf-search-mode) .navigation-drawer,
.mw-body { margin-top: 50px !important; }
body:not(.mw-mf-search-mode) .minerva-header .search-box {
display: none !important;
}


/* Hide default elements */
/* --- B. THE 3 STICKY BUTTONS (Pinned to Screen) --- */
.header-container .navigation-drawer { display: none !important; }
/* We use 'position: fixed' on the buttons themselves so they never hide */


/* BUTTON 1: HOME (Top Left) */
/* --- B. BUTTON 1: HOME (Top Left) --- */
body:not(.mw-mf-search-mode) .branding-box {
.branding-box, .branding-box a {
display: flex !important;
position: fixed !important;
position: fixed !important;
top: 5px !important;
top: 0 !important; left: 0 !important;
left: 10px !important;
width: 50px !important; height: 50px !important;
z-index: 1002 !important;
z-index: 1002 !important;
pointer-events: auto !important; /* Re-enable clicking */
display: flex !important; align-items: center; justify-content: center;
}
body:not(.mw-mf-search-mode) .branding-box a {
font-size: 0 !important; color: transparent !important;
}
}
.branding-box a { font-size: 0 !important; color: transparent !important; }
body:not(.mw-mf-search-mode) .branding-box a::before {
.branding-box a::before {
content: "⌂";
content: "⌂";
font-size: 30px;
font-size: 28px; color: #fff; /* White Icon */
font-weight: bold;
margin-top: -4px;
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) */
/* --- C. BUTTON 2: TOC (Top Right - Far Right) --- */
#cps-open-toc {
body:not(.mw-mf-search-mode) #searchIcon {
display: flex !important;
display: flex !important;
align-items: center; justify-content: center;
position: fixed !important;
position: fixed !important;
top: 5px !important;
top: 3px !important;
left: 50% !important;
right: 0 !important; /* Pinned to right edge */
transform: translateX(-50%) !important;
left: auto !important; bottom: auto !important;
width: 44px !important; height: 44px !important;
width: 50px !important; height: 44px !important;
z-index: 1002 !important;
z-index: 1002 !important;
background: transparent !important;
background: transparent !important;
border: none !important;
color: #fff !important; /* White Icon */
box-shadow: 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) */
/* --- D. BUTTON 3: SEARCH TRIGGER (Top Right - Next to TOC) --- */
#searchIcon {
body:not(.mw-mf-search-mode) #cps-open-toc {
display: flex !important;
position: fixed !important;
position: fixed !important;
top: 5px !important;
top: 0 !important;
right: 10px !important;
right: 50px !important; /* Offset by width of TOC button */
bottom: auto !important; left: auto !important;
left: auto !important;
width: 44px !important; height: 44px !important;
width: 50px !important; height: 50px !important;
z-index: 1002 !important;
z-index: 1002 !important;
background: transparent !important;
display: flex !important; align-items: center; justify-content: center;
color: #000 !important;
background: transparent !important; border: none !important;
box-shadow: none !important;
margin: 0 !important; padding: 0 !important; box-shadow: none !important;
pointer-events: auto !important;
}
}
#searchIcon .minerva-icon {
/* Ensure the TOC icon matches the others */
font-size: 24px;
body:not(.mw-mf-search-mode) #cps-open-toc .icon {
color: #fff; /* White Icon */
text-shadow: 0 0 5px rgba(255,255,255, 0.8);
opacity: 1;
}
}


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


/* 1. Hide the Transparent Sticky Buttons */
/* 1. Hide Input when NOT searching */
body.mw-mf-search-mode .branding-box,
body:not(.mw-mf-search-mode) .minerva-header .search-box {
body.mw-mf-search-mode #searchIcon,
body.mw-mf-search-mode #cps-open-toc {
display: none !important;
display: none !important;
}
}


/* 2. Show the Standard White Header */
/* 2. Position Input when SEARCHING */
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 {
body.mw-mf-search-mode .minerva-header .search-box {
display: block !important;
display: block !important;
padding: 8px !important;
position: fixed !important;
opacity: 1 !important;
top: 7px !important; /* Vertically centered */
height: 36px !important;
z-index: 1001 !important;
/* THE PADDING LOGIC: Fit between buttons */
left: 60px !important; /* Clear the Home Button */
right: 110px !important; /* Clear Search (50px) + TOC (50px) + Gap */
background: transparent !important;
padding: 0 !important;
margin: 0 !important;
}
}


/* 4. Style the Input Text */
/* 3. Style the Box itself */
body.mw-mf-search-mode .minerva-header .search-box input {
body.mw-mf-search-mode .minerva-header .search-box input {
background: #fff !important;
width: 100% !important;
color: #000 !important;
border: 1px solid #ccc !important;
border-radius: 4px !important;
height: 36px !important;
height: 36px !important;
opacity: 1 !important;
border-radius: 4px !important;
border: none !important;
/* Visual Style */
background-color: rgba(255, 255, 255, 0.2) !important; /* Semi-transparent white box */
color: #ffffff !important; /* White text */
-webkit-text-fill-color: #ffffff !important;
padding-left: 10px !important; /* Text padding */
}
}

/* 4. REMOVE THE INNER MAGNIFYING GLASS (As requested) */
/* This hides the icon inside the input box */
.minerva-header .search-box .search-box-icon-overlay {
display: none !important;
}

/* 5. Placeholder Text Color */
body.mw-mf-search-mode .minerva-header .search-box input::placeholder {
color: rgba(255, 255, 255, 0.7) !important;
-webkit-text-fill-color: rgba(255, 255, 255, 0.7) !important;
}

/* 6. Hide the Cancel button text if it appears */
.search-box .search-box-cancel { display: none !important; }

Revision as of 13:38, 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. TRANSLUCENT BLACK TOOLBAR (Single Line Layout)       */
/* ======================================================= */

/* --- A. THE HEADER CONTAINER (The Black Strip) --- */
.header-container.header-chrome {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 50px !important;
    z-index: 1000 !important;
    
    /* Translucent Black Background */
    background-color: rgba(0, 0, 0, 0.85) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(5px); /* Optional: Adds the "frosted glass" effect */
    
    /* Fixes */
    transform: none !important;
    transition: none !important;
    overflow: visible !important;
}

/* Push body content down */
body.skin-minerva { padding-top: 50px !important; }
.mw-body { margin-top: 50px !important; }

/* Hide default elements */
.header-container .navigation-drawer { display: none !important; }

/* --- B. BUTTON 1: HOME (Top Left) --- */
.branding-box, .branding-box a {
    position: fixed !important;
    top: 0 !important; left: 0 !important;
    width: 50px !important; height: 50px !important;
    z-index: 1002 !important;
    display: flex !important; align-items: center; justify-content: center;
}
.branding-box a { font-size: 0 !important; color: transparent !important; }
.branding-box a::before {
    content: "⌂"; 
    font-size: 28px; color: #fff; /* White Icon */
    margin-top: -4px;
}

/* --- C. BUTTON 2: TOC (Top Right - Far Right) --- */
#cps-open-toc {
    display: flex !important;
    position: fixed !important;
    top: 3px !important;
    right: 0 !important; /* Pinned to right edge */
    left: auto !important; bottom: auto !important;
    width: 50px !important; height: 44px !important;
    z-index: 1002 !important;
    background: transparent !important;
    color: #fff !important; /* White Icon */
    box-shadow: none !important;
}

/* --- D. BUTTON 3: SEARCH TRIGGER (Top Right - Next to TOC) --- */
#searchIcon {
    position: fixed !important;
    top: 0 !important;
    right: 50px !important; /* Offset by width of TOC button */
    left: auto !important;
    width: 50px !important; height: 50px !important;
    z-index: 1002 !important;
    display: flex !important; align-items: center; justify-content: center;
    background: transparent !important; border: none !important;
    margin: 0 !important; padding: 0 !important; box-shadow: none !important;
}
#searchIcon .minerva-icon {
    font-size: 24px;
    color: #fff; /* White Icon */
    opacity: 1;
}

/* --- E. THE SEARCH INPUT FIELD (FITS IN THE MIDDLE) --- */

/* 1. Hide Input when NOT searching */
body:not(.mw-mf-search-mode) .minerva-header .search-box {
    display: none !important;
}

/* 2. Position Input when SEARCHING */
body.mw-mf-search-mode .minerva-header .search-box {
    display: block !important;
    position: fixed !important;
    top: 7px !important; /* Vertically centered */
    height: 36px !important;
    z-index: 1001 !important;
    
    /* THE PADDING LOGIC: Fit between buttons */
    left: 60px !important;   /* Clear the Home Button */
    right: 110px !important; /* Clear Search (50px) + TOC (50px) + Gap */
    
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* 3. Style the Box itself */
body.mw-mf-search-mode .minerva-header .search-box input {
    width: 100% !important;
    height: 36px !important;
    border-radius: 4px !important;
    border: none !important;
    
    /* Visual Style */
    background-color: rgba(255, 255, 255, 0.2) !important; /* Semi-transparent white box */
    color: #ffffff !important; /* White text */
    -webkit-text-fill-color: #ffffff !important;
    padding-left: 10px !important; /* Text padding */
}

/* 4. REMOVE THE INNER MAGNIFYING GLASS (As requested) */
/* This hides the icon inside the input box */
.minerva-header .search-box .search-box-icon-overlay {
    display: none !important;
}

/* 5. Placeholder Text Color */
body.mw-mf-search-mode .minerva-header .search-box input::placeholder {
    color: rgba(255, 255, 255, 0.7) !important;
    -webkit-text-fill-color: rgba(255, 255, 255, 0.7) !important;
}

/* 6. Hide the Cancel button text if it appears */
.search-box .search-box-cancel { display: none !important; }