MediaWiki:Common.css: Difference between revisions

From AbhiprayaVedi
No edit summary
mNo edit summary
 
(43 intermediate revisions by the same user not shown)
Line 1: Line 1:
/* ================================================================
/* Load Malayalam Google Fonts */
  MediaWiki:CommonTest.css
@import url('https://fonts.googleapis.com/css2?family=Manjari:wght@400;700&family=Meera:wght@400;700&display=swap');
  Test stylesheet for AbhiprayaVedi
  Cleaned and merged with scoped reset for .article-container
  ================================================================ */


/* ------------------------------------------------
:lang(ml),
  BASE TYPOGRAPHY
:lang(ml) * {
  ------------------------------------------------ */
    font-family: 'Manjari', 'Meera', 'Rachana', 'Noto Sans Malayalam', sans-serif !important;
:lang(en) {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
}


:lang(ml) {
/* Hide namespace subtitle for published articles */
  font-family: 'Manjari', 'Meera', 'Rachana', 'AnjaliOldLipi', 'Noto Sans Malayalam', sans-serif;
.mw-displaytitle-subtitle {
  line-height: 1.75;
    display: none !important;
}
}


/* Global minor tweaks only */
body {
body {
   font-size: 17px;
   line-height: 1.7;
}
}


/* ------------------------------------------------
/* Main Article Title (Skin H1) */
  ARTICLE CONTAINER RESET
#firstHeading,
  Scoped reset to avoid affecting global wiki styles
.mw-first-heading {
  ------------------------------------------------ */
    font-size: 2.4em !important;
.article-container p,
    font-weight: bold !important;
.article-container figure,
    margin-bottom: 0.4em !important;
.article-container figcaption,
    color: #222;
.article-container ul,
    border-bottom: solid 4px #36c;
.article-container ol,
.article-container li,
.article-container h1,
.article-container h2,
.article-container h3,
.article-container h4,
.article-container h5,
.article-container h6 {
  margin: 0;
  padding: 0;
}
}
/* ================ FORCE MALAYALAM FONTS - HIGHEST PRIORITY ================ */


/* Figures and captions */
body:lang(ml),
.article-container figure {
.mw-body:lang(ml),
  display: block;
.mw-body-content:lang(ml),
  float: none;
#content:lang(ml),
}
.mw-parser-output:lang(ml),
.article-container figcaption {
.article-content:lang(ml),
  display: block;
.intro-box:lang(ml),
  text-align: center;
p:lang(ml),
span:lang(ml),
div:lang(ml) {
    font-family: 'Manjari', 'Meera', 'Rachana', 'Noto Sans Malayalam', 'Nirmala UI', sans-serif !important;
    line-height: 1.85 !important;
}
}


/* Lists */
/* Extra force for article body */
.article-container ul,
.article-content * {
.article-container ol {
    font-family: 'Manjari', 'Meera', 'Rachana', 'Noto Sans Malayalam', sans-serif !important;
  list-style-position: inside;
  padding-left: 1em;
}
.article-container li {
  margin: 0.25em 0;
}
}


/* Headings */
/* Malayalam Headings */
.article-container h1,
h1:lang(ml), h2:lang(ml), h3:lang(ml), h4:lang(ml) {
.article-container h2,
    font-family: 'Manjari', 'Meera', 'Rachana', 'Noto Sans Malayalam', sans-serif !important;
.article-container h3,
.article-container h4,
.article-container h5,
.article-container h6 {
  font-weight: 600;
  line-height: 1.3;
  margin: 0.5em 0;
}
 
/* ------------------------------------------------
  ARTICLE CONTAINER LAYOUT AND COMPONENTS
  ------------------------------------------------ */
.article-container {
  max-width: 1200px;
  margin: 0 auto;
}
 
/* Article header and author info */
.article-container .article-header {
  margin: 0 auto;        /* no extra top/bottom margin */
  padding: 2px 0;        /* slim padding */
  background: #C7D2FE;
  text-align: center;
}
 
.article-container .author-info {
  margin: 0;            /* remove auto vertical margin */
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;              /* balanced spacing between items */
  font-size: 1.05em;
  color: #444;
}
.article-container .author-info span:not(:last-child)::after {
  content: "•";
  margin-left: 8px;
  color: #999;
}
.article-container .author-info p {
  margin: 2px 0;        /* small vertical spacing */
  padding: 0;
  text-align: center;
}
.article-container .author-name {
  font-weight: 600;
}
.article-container .date-info {
  font-size: 0.9em;
  color: #666;
}
.article-container .category-badge {
  background: #e0e7ff;
  color: #333;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.85em;
}
}


/* Introduction section */
/* Force Malayalam Font on Main Article Title */
.article-container .introduction-section {
#firstHeading,
  background: #f5f7fa;
.mw-first-heading,
  border-left: 4px solid #4a6edb;
.firstHeading {
  padding: 10px 14px;
    font-family: 'Manjari', 'Meera', 'Rachana', 'Noto Sans Malayalam', sans-serif !important;
  margin: 0 0 14px 0;
    font-weight: bold !important;
  border-radius: 4px;
  font-size: 1.05em;
  line-height: 1.6;
  color: #222;
}
.article-container .introduction-section p {
  margin: 0;
  text-indent: 0;
}
}


/* Content layout */
/* Also for Malayalam in general headings */
.article-container .content-wrapper {
:lang(ml) h1,
  display: flex;
:lang(ml) h2,
  flex-direction: row;
:lang(ml) h3 {
  align-items: flex-start;
    font-family: 'Manjari', 'Meera', 'Rachana', 'Noto Sans Malayalam', sans-serif !important;
  gap: 24px;
}
.article-container .main-content {
  flex: 3;
  min-width: 0;
}
.article-container .right-sidebar {
  flex: 1;
  max-width: 280px;
}
}


/* 1. Ensure thumbnail figures shrink to the image and are not positioned by skin */
/* Hide top tabs (Submissions, Discussion, Edit, etc.) for anonymous users */
.article-container figure[typeof~='mw:File/Thumb'],
.anon .mw-indicators,
.article-container figure[typeof~='mw:File/Frame'] {
.anon #mw-content-subtitle,
  display: inline-block !important;
.anon .vector-page-toolbar,
  width: auto !important;
.anon .mw-editsection,
  max-width: 100%;
.anon #ca-edit,
  box-sizing: border-box;
.anon #ca-edit-source,
  float: none !important;
.anon #ca-history,
  margin: 0 0 1em 0;
.anon #ca-view {
  vertical-align: top;
    display: none !important;
  position: static !important; /* cancel any relative/absolute positioning from skin */
}
}


/* 2. Make the inner file wrapper and link shrink to the image width */
/* Force Malayalam on Main Title */
.article-container figure[typeof~='mw:File/Thumb'] .mw-file-element,
#firstHeading,
.article-container figure[typeof~='mw:File/Thumb'] a.mw-file-description,
.mw-first-heading,
.article-container figure[typeof~='mw:File/Thumb'] a {
.firstHeading {
  display: inline-block !important;
    font-family: 'Manjari', 'Meera', 'Rachana', 'Noto Sans Malayalam', sans-serif !important;
  width: auto !important;
    font-size: 2.35em !important;
  max-width: 100%;
    font-weight: 700 !important;
  box-sizing: border-box;
  vertical-align: top;
}
}


/* 3. Ensure the image uses its intrinsic width but remains responsive */
/* English Title Size */
.article-container figure[typeof~='mw:File/Thumb'] img {
:lang(en) #firstHeading,
  display: block;
:lang(en) .mw-first-heading {
  width: auto;
    font-size: 2.45em !important;
  max-width: 100%;
  height: auto;
}
}


/* 4. Force caption to be a normal block under the image (no absolute positioning) */
/* ================ HIDE SIDE PANELS FOR ANONYMOUS USERS ================ */
.article-container figure[typeof~='mw:File/Thumb'] figcaption,
.article-container figure[typeof~='mw:File/Thumb'] figcaption::before,
.article-container figure[typeof~='mw:File/Thumb'] figcaption::after {
  position: static !important;  /* cancel absolute/relative positioning */
  display: block !important;
  width: 100% !important;        /* match the figure width */
  box-sizing: border-box;
  text-align: center;
  margin-top: 6px;
  padding: 2px 4px;
  content: inherit;              /* keep text; does not remove ::before unless you want to */
}


/* 5. If a pseudo-element (::before) is adding an icon/label and you want to remove it */
/* വായനക്കാർ ലോഗിൻ ചെയ്തിട്ടില്ലെങ്കിൽ (Anonymous) മാത്രം ഈ സ്റ്റൈലുകൾ ബാധകമാകും */
.article-container figure[typeof~='mw:File/Thumb'] figcaption::before {
body.user-anonymous .article-sidebar,
  content: none !important;
body.user-anonymous #mw-panel,
  display: none !important;
body.user-anonymous .mw-sidebar,
body.user-anonymous #sidebar,
body.user-anonymous .right-sidebar {
    display: none !important; /* സൈഡ് പാനലുകൾ പൂർണ്ണമായി മറയ്ക്കുന്നു */
    width: 0 !important;
    visibility: hidden !important;
}
}


/* 6. Mobile safety: clear floats and stack */
/*  
@media (max-width: 960px) {
* സൈഡ് പാനൽ മറയ്ക്കുമ്പോൾ പ്രധാന ലേഖന ഭാഗം (Main Content Area)
  .article-container figure[typeof~='mw:File/Thumb'],
* പേജിന്റെ മുഴുവൻ വീതിയിലേക്കും (Full Width) മനോഹരമായി വ്യാപിച്ചു നിൽക്കാൻ താഴെ പറയുന്നവ സഹായിക്കും.
  .article-container .image-left,
*/
  .article-container .image-right {
body.user-anonymous #content,
     float: none !important;
body.user-anonymous #mw-content-text,
     display: block !important;
body.user-anonymous .article-content,
body.user-anonymous .mw-body {
     margin-left: 0 !important;
     margin-right: 0 !important;
     width: 100% !important;
     width: 100% !important;
     margin: 0 0 12px 0 !important;
     max-width: 100% !important;
  }
}
 
 
 
/* Fit-content caption (modern browsers) */
.article-container .image-left figure[typeof~='mw:File/Thumb'] figcaption {
  width: -moz-fit-content;
  width: fit-content;
  max-width: 100%;
  display: inline-block;
  text-align: center;
  margin-top: 6px;
  padding: 2px 4px;
  box-sizing: border-box;
  vertical-align: top;
}
 
/* Fallback: make caption inline-block and align with image */
.article-container .image-left figure[typeof~='mw:File/Thumb'] img,
.article-container .image-left figure[typeof~='mw:File/Thumb'] figcaption {
  display: inline-block;
  vertical-align: top;
}
.article-container .image-left figure[typeof~='mw:File/Thumb'] figcaption {
  width: auto;
}
 
 
/* Sidebar author photo and name */
.article-container .author-photo {
  margin: 0;
  display: block;
  border: 1px solid #ccc;
  padding: 2px;
  max-width: 180px;
}
.article-container .author-photo p {
  margin: 0;
  padding: 0;
  text-align: center;
}
.article-container .author-photo figcaption {
  text-align: center;
  margin-top: 4px;
}
.article-container .author-name-box {
  text-align: center;
  margin-top: 4px;
  max-width: 180px;
}
.article-container .author-infobox {
  display: flex;
  flex-direction: column;
  align-items: center;  /* center photo and name by default */
}
}


/* stronger keypoints block */
/* ആർട്ടിക്കിൾ പേജിനുള്ളിലെ മെയിൻ കണ്ടെന്റ് ഏരിയയുടെ വീതി ക്രമീകരണം */
.article-container .keypoints-float {
body.user-anonymous .article-main-wrapper {
  background: #fff8e6;          /* warmer, higher-contrast background */
  padding: 14px;
  border-left: 4px solid #8ba2e8;/* keep accent */
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.03); /* subtle separation */
  color: #1f2937;              /* slightly darker text for contrast */
}
 
.article-container .highlight-box {
  background: #ecfffb;
  border-left: 5px solid #00c49c;
  padding: 12px;
  margin: 12px 0;
  border-radius: 6px;
}
.article-container .highlight-title {
  background: #00c49c;
  color: #333;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 4px 4px 0 0;
  margin-bottom: 6px;
}
.article-container .highlight-text {
  color: #333;
  font-size: 0.95em;
  line-height: 1.5;
}
.article-container .keypoints-header {
  background: #8ba2e8;
  color: #dde4f8;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 4px 4px 0 0;
  margin-bottom: 6px;
}
 
/* ------------------------------------------------
  FEATURED SECTION (Magazine Index)
  ------------------------------------------------ */
.av-featured {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: #f8f9fa;
  border-left: 5px solid #667eea;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 8px;
}
.av-featured-image {
  flex: 0 0 260px;
  max-width: 260px;
}
.av-featured-image img {
  width: 260px;
  height: auto;
  border-radius: 6px;
  display: block;
}
.av-featured-body {
  flex: 1 1 auto;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 8;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
.av-featured-title {
  font-size: 1.45em;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 10px;
}
.av-featured-intro {
  font-size: 1.05em;
  line-height: 1.75;
  color: #495057;
  margin-bottom: 12px;
  max-height: 200px;
  overflow: hidden;
}
 
/* ------------------------------------------------
  RESPONSIVE BREAKPOINTS
  ------------------------------------------------ */
@media (max-width: 960px) {
  .content-wrapper { flex-direction: column; }
  .right-sidebar { max-width: 100%; }
  .av-cards-row { flex-direction: column; }
  .av-latest-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .av-featured { flex-direction: column; }
  .av-featured-image img { max-width: 100%; }
  .av-latest-grid { grid-template-columns: 1fr; }
}
 
/* ------------------------------------------------
  ACCESSIBILITY
  ------------------------------------------------ */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}
.highlight-title::before {
  content: "Highlight ";
  position: absolute;
  left: -9999px;
}
.keypoints-header::before {
  content: "Key Points ";
  position: absolute;
  left: -9999px;
}
 
/* 1. Make thumbnail figures shrink to the image instead of stretching */
.article-container figure[typeof~='mw:File/Thumb'],
.article-container figure[typeof~='mw:File/Frame'] {
  display: inline-block !important;  /* shrink to content */
  width: auto !important;
  max-width: 100%;
  box-sizing: border-box;
  float: none !important;            /* cancel skin float when inside article-container */
  margin: 0 0 1em 0;                  /* controlled margin; adjust as needed */
  vertical-align: top;
}
 
/* 2. Make the inner file wrapper and link shrink to the image width */
.article-container figure[typeof~='mw:File/Thumb'] .mw-file-element,
.article-container figure[typeof~='mw:File/Thumb'] a.mw-file-description,
.article-container figure[typeof~='mw:File/Thumb'] a {
  display: inline-block !important;
  width: auto !important;
  max-width: 100%;
  box-sizing: border-box;
  vertical-align: top;
}
 
/* 3. Ensure the image itself is responsive but uses its intrinsic width */
.article-container figure[typeof~='mw:File/Thumb'] img {
  display: block;
  width: auto;        /* natural width */
  max-width: 100%;    /* never exceed container */
  height: auto;
}
 
/* 4. Make caption match the figure width (and not the full column) */
.article-container figure[typeof~='mw:File/Thumb'] figcaption {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  margin-top: 6px;
  padding: 2px 4px;
}
 
/* 5. If a stubborn ancestor still forces a large width, use fit-content for caption */
.article-container figure[typeof~='mw:File/Thumb'] figcaption.fit-to-image {
  display: inline-block;
  width: -moz-fit-content;
  width: fit-content;
  max-width: 100%;
}
 
/* 6. Prevent floated images from creating a persistent narrow column on small screens */
@media (max-width: 960px) {
  .article-container .image-left,
  .article-container .image-right,
  .article-container figure[typeof~='mw:File/Thumb'],
  .article-container figure[typeof~='mw:File/Frame'] {
    float: none !important;
    display: block !important;
    width: 100% !important;
    margin: 0 0 12px 0 !important;
  }
 
  .article-container .content-wrapper {
    flex-direction: column;
    align-items: stretch;
  }
 
  .article-container .main-content {
    width: 100% !important;
    flex: 1 1 auto;
    min-width: 0;
    margin-right: 0;
  }
 
  .article-container .right-sidebar {
     width: 100% !important;
     width: 100% !important;
    max-width: 100%;
     float: none !important;
     float: none !important;
    margin: 0 0 16px 0;
  }
}
/* 7. Clear floats inside main-content so text flows normally after figures */
.article-container .main-content::after {
  content: "";
  display: block;
  clear: both;
}
}

Latest revision as of 22:40, 11 June 2026

/* Load Malayalam Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Manjari:wght@400;700&family=Meera:wght@400;700&display=swap');

:lang(ml),
:lang(ml) * {
    font-family: 'Manjari', 'Meera', 'Rachana', 'Noto Sans Malayalam', sans-serif !important;
}

/* Hide namespace subtitle for published articles */
.mw-displaytitle-subtitle {
    display: none !important;
}

/* Global minor tweaks only */
body {
  line-height: 1.7;
}

/* Main Article Title (Skin H1) */
#firstHeading,
.mw-first-heading {
    font-size: 2.4em !important;
    font-weight: bold !important;
    margin-bottom: 0.4em !important;
    color: #222;
    border-bottom: solid 4px #36c;
}
/* ================ FORCE MALAYALAM FONTS - HIGHEST PRIORITY ================ */

body:lang(ml),
.mw-body:lang(ml),
.mw-body-content:lang(ml),
#content:lang(ml),
.mw-parser-output:lang(ml),
.article-content:lang(ml),
.intro-box:lang(ml),
p:lang(ml),
span:lang(ml),
div:lang(ml) {
    font-family: 'Manjari', 'Meera', 'Rachana', 'Noto Sans Malayalam', 'Nirmala UI', sans-serif !important;
    line-height: 1.85 !important;
}

/* Extra force for article body */
.article-content * {
    font-family: 'Manjari', 'Meera', 'Rachana', 'Noto Sans Malayalam', sans-serif !important;
}

/* Malayalam Headings */
h1:lang(ml), h2:lang(ml), h3:lang(ml), h4:lang(ml) {
    font-family: 'Manjari', 'Meera', 'Rachana', 'Noto Sans Malayalam', sans-serif !important;
}

/* Force Malayalam Font on Main Article Title */
#firstHeading,
.mw-first-heading,
.firstHeading {
    font-family: 'Manjari', 'Meera', 'Rachana', 'Noto Sans Malayalam', sans-serif !important;
    font-weight: bold !important;
}

/* Also for Malayalam in general headings */
:lang(ml) h1,
:lang(ml) h2,
:lang(ml) h3 {
    font-family: 'Manjari', 'Meera', 'Rachana', 'Noto Sans Malayalam', sans-serif !important;
}

/* Hide top tabs (Submissions, Discussion, Edit, etc.) for anonymous users */
.anon .mw-indicators,
.anon #mw-content-subtitle,
.anon .vector-page-toolbar,
.anon .mw-editsection,
.anon #ca-edit,
.anon #ca-edit-source,
.anon #ca-history,
.anon #ca-view {
    display: none !important;
}

/* Force Malayalam on Main Title */
#firstHeading,
.mw-first-heading,
.firstHeading {
    font-family: 'Manjari', 'Meera', 'Rachana', 'Noto Sans Malayalam', sans-serif !important;
    font-size: 2.35em !important;
    font-weight: 700 !important;
}

/* English Title Size */
:lang(en) #firstHeading,
:lang(en) .mw-first-heading {
    font-size: 2.45em !important;
}

/* ================ HIDE SIDE PANELS FOR ANONYMOUS USERS ================ */

/* വായനക്കാർ ലോഗിൻ ചെയ്തിട്ടില്ലെങ്കിൽ (Anonymous) മാത്രം ഈ സ്റ്റൈലുകൾ ബാധകമാകും */
body.user-anonymous .article-sidebar,
body.user-anonymous #mw-panel, 
body.user-anonymous .mw-sidebar,
body.user-anonymous #sidebar,
body.user-anonymous .right-sidebar {
    display: none !important; /* സൈഡ് പാനലുകൾ പൂർണ്ണമായി മറയ്ക്കുന്നു */
    width: 0 !important;
    visibility: hidden !important;
}

/* 
 * സൈഡ് പാനൽ മറയ്ക്കുമ്പോൾ പ്രധാന ലേഖന ഭാഗം (Main Content Area) 
 * പേജിന്റെ മുഴുവൻ വീതിയിലേക്കും (Full Width) മനോഹരമായി വ്യാപിച്ചു നിൽക്കാൻ താഴെ പറയുന്നവ സഹായിക്കും.
 */
body.user-anonymous #content,
body.user-anonymous #mw-content-text,
body.user-anonymous .article-content,
body.user-anonymous .mw-body {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* ആർട്ടിക്കിൾ പേജിനുള്ളിലെ മെയിൻ കണ്ടെന്റ് ഏരിയയുടെ വീതി ക്രമീകരണം */
body.user-anonymous .article-main-wrapper {
    width: 100% !important;
    float: none !important;
}