MediaWiki:Common.css: Difference between revisions

From AbhiprayaVedi
No edit summary
No edit summary
Line 1: Line 1:
/* ================================================================
/*BASE TYPOGRAPHY*/
  MediaWiki:CommonTest.css
  Test stylesheet for AbhiprayaVedi
  Cleaned and merged with scoped reset for .article-container
  ================================================================ */


/* ------------------------------------------------
  BASE TYPOGRAPHY
  ------------------------------------------------ */
:lang(en) {
:lang(en) {
   font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
   font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
Line 21: Line 14:
}
}


/* ------------------------------------------------
/*ARTICLE CONTAINER (Scoped Control)*/
  ARTICLE CONTAINER RESET
 
  Scoped reset to avoid affecting global wiki styles
.article-container {
  ------------------------------------------------ */
  max-width: 1100px;
.article-container p,
   margin: 0 auto;
.article-container figure,
   padding: 0 12px;
.article-container figcaption,
.article-container ul,
.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;
}
}


/* Figures and captions */
.article-container * {
.article-container figure {
   box-sizing: border-box;
   display: block;
  float: none;
}
}
.article-container figcaption {
 
   display: block;
/* Basic spacing */
  text-align: center;
.article-container p {
   margin: 0 0 1em 0;
}
}


/* Lists */
.article-container ul,
.article-container ul,
.article-container ol {
.article-container ol {
   list-style-position: inside;
   padding-left: 1.2em;
   padding-left: 1em;
   margin-bottom: 1em;
}
}
.article-container li {
.article-container li {
   margin: 0.25em 0;
   margin: 0.25em 0;
Line 65: Line 45:
.article-container h2,
.article-container h2,
.article-container h3,
.article-container h3,
.article-container h4,
.article-container h4 {
.article-container h5,
  margin: 0.6em 0 0.4em;
.article-container h6 {
  line-height: 1.3;
   font-weight: 600;
   font-weight: 600;
   line-height: 1.3;
}
   margin: 0.5em 0;
/*MEDIAWIKI IMAGE SYSTEM (CRITICAL — FIXED)*/
 
/* MediaWiki figures */
.article-container figure[typeof~='mw:File/Thumb'],
.article-container figure[typeof~='mw:File/Frame'] {
  display: inline-block;      /* shrink to image width */
  max-width: 100%;
  margin: 0 0 1em 0;
  float: none;
  text-align: left;
}
 
/* Ensure internal wrappers don't expand width */
.article-container figure a,
.article-container figure .mw-file-element {
  display: inline-block;
  max-width: 100%;
}
 
/* Image */
.article-container figure img {
  display: block;
  max-width: 100%;
  height: auto;
}
 
/* Caption — locked to image width */
.article-container figure figcaption {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 2px 4px;
  font-size: 0.95em;
  text-align: center;
   line-height: 1.4;
}
 
/*SIMPLE CONTENT LAYOUT*/
 
.article-container .content-wrapper {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
 
.article-container .main-content {
  flex: 3;
   min-width: 0;
}
}


/* ------------------------------------------------
.article-container .right-sidebar {
  ARTICLE CONTAINER LAYOUT AND COMPONENTS
   flex: 1;
  ------------------------------------------------ */
   max-width: 280px;
.article-container {
   max-width: 1200px;
   margin: 0 auto;
}
}


/* Article header and author info */
/*AUTHOR BLOCK (cleaned)*/
 
.article-container .article-header {
.article-container .article-header {
  margin: 0 auto;        /* no extra top/bottom margin */
  padding: 2px 0;        /* slim padding */
   background: #C7D2FE;
   background: #C7D2FE;
   text-align: center;
   text-align: center;
  padding: 4px 0;
}
}


.article-container .author-info {
.article-container .author-info {
  margin: 0;            /* remove auto vertical margin */
   display: flex;
   display: flex;
   justify-content: center;
   justify-content: center;
   align-items: center;
   align-items: center;
   gap: 6px;             /* balanced spacing between items */
   gap: 6px;
   font-size: 1.05em;
   font-size: 1em;
   color: #444;
   color: #444;
}
}
.article-container .author-info span:not(:last-child)::after {
.article-container .author-info span:not(:last-child)::after {
   content: "•";
   content: "•";
   margin-left: 8px;
   margin-left: 6px;
   color: #999;
   color: #999;
}
}
.article-container .author-info p {
 
  margin: 2px 0;        /* small vertical spacing */
  padding: 0;
  text-align: center;
}
.article-container .author-name {
.article-container .author-name {
   font-weight: 600;
   font-weight: 600;
}
}
.article-container .date-info {
.article-container .date-info {
   font-size: 0.9em;
   font-size: 0.9em;
   color: #666;
   color: #666;
}
}
.article-container .category-badge {
  background: #e0e7ff;
  color: #333;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.85em;
}


/* Introduction section */
/*INTRO BLOCK*/
 
.article-container .introduction-section {
.article-container .introduction-section {
   background: #f5f7fa;
   background: #f5f7fa;
   border-left: 4px solid #4a6edb;
   border-left: 4px solid #4a6edb;
   padding: 10px 14px;
   padding: 10px 14px;
   margin: 0 0 14px 0;
   margin-bottom: 14px;
   border-radius: 4px;
   border-radius: 4px;
  font-size: 1.05em;
   line-height: 1.6;
   line-height: 1.6;
  color: #222;
}
.article-container .introduction-section p {
  margin: 0;
  text-indent: 0;
}
}


/* Content layout */
/*SIDEBAR (Author Image)*/
.article-container .content-wrapper {
 
.article-container .author-infobox {
   display: flex;
   display: flex;
   flex-direction: row;
   flex-direction: column;
   align-items: flex-start;
   align-items: center;
  gap: 24px;
}
.article-container .main-content {
  flex: 3;
  min-width: 0;
}
.article-container .right-sidebar {
  flex: 1;
  max-width: 280px;
}
 
figure {
  display: inline-block;
  width: fit-content;
}
 
/* 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 {
.article-container .author-photo {
  margin: 0;
  display: block;
   border: 1px solid #ccc;
   border: 1px solid #ccc;
   padding: 2px;
   padding: 2px;
   max-width: 180px;
   max-width: 180px;
}
}
.article-container .author-photo p {
 
  margin: 0;
.article-container .author-photo img {
  padding: 0;
   display: block;
  text-align: center;
   max-width: 100%;
}
.article-container .author-photo figcaption {
   text-align: center;
   margin-top: 4px;
}
}
.article-container .author-name-box {
.article-container .author-name-box {
   text-align: center;
   text-align: center;
   margin-top: 4px;
   margin-top: 6px;
  max-width: 180px;
}
.article-container .author-infobox {
  display: flex;
  flex-direction: column;
  align-items: center;  /* center photo and name by default */
}
}


/* stronger keypoints block */
/*HIGHLIGHT / KEYPOINT BOXES*/
.article-container .keypoints-float {
  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 {
.article-container .highlight-box {
Line 228: Line 180:
   margin: 12px 0;
   margin: 12px 0;
   border-radius: 6px;
   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;
}
}


/* ------------------------------------------------
.article-container .keypoints-float {
  FEATURED SECTION (Magazine Index)
   background: #fff8e6;
  ------------------------------------------------ */
   padding: 14px;
.av-featured {
   border-left: 4px solid #8ba2e8;
   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;
   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*/
  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; }
}


/* ------------------------------------------------
@media (max-width: 900px) {
  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 {
   .article-container .content-wrapper {
     flex-direction: column;
     flex-direction: column;
    align-items: stretch;
   }
   }


   .article-container .main-content {
   .article-container .right-sidebar {
     width: 100% !important;
     max-width: 100%;
    flex: 1 1 auto;
    min-width: 0;
    margin-right: 0;
   }
   }


   .article-container .right-sidebar {
   .article-container figure {
     width: 100% !important;
     display: block;
     max-width: 100%;
     width: 100%;
    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 {
/*ACCESSIBILITY (keep minimal)*/
   content: "";
 
   display: block;
a:focus-visible,
  clear: both;
button:focus-visible {
   outline: 2px solid #667eea;
   outline-offset: 2px;
}
}

Revision as of 13:44, 23 April 2026

/*BASE TYPOGRAPHY*/

:lang(en) {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

:lang(ml) {
  font-family: 'Manjari', 'Meera', 'Rachana', 'AnjaliOldLipi', 'Noto Sans Malayalam', sans-serif;
  line-height: 1.75;
}

body {
  font-size: 17px;
}

/*ARTICLE CONTAINER (Scoped Control)*/

.article-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 12px;
}

.article-container * {
  box-sizing: border-box;
}

/* Basic spacing */
.article-container p {
  margin: 0 0 1em 0;
}

.article-container ul,
.article-container ol {
  padding-left: 1.2em;
  margin-bottom: 1em;
}

.article-container li {
  margin: 0.25em 0;
}

/* Headings */
.article-container h1,
.article-container h2,
.article-container h3,
.article-container h4 {
  margin: 0.6em 0 0.4em;
  line-height: 1.3;
  font-weight: 600;
}
/*MEDIAWIKI IMAGE SYSTEM (CRITICAL — FIXED)*/

/* MediaWiki figures */
.article-container figure[typeof~='mw:File/Thumb'],
.article-container figure[typeof~='mw:File/Frame'] {
  display: inline-block;      /* shrink to image width */
  max-width: 100%;
  margin: 0 0 1em 0;
  float: none;
  text-align: left;
}

/* Ensure internal wrappers don't expand width */
.article-container figure a,
.article-container figure .mw-file-element {
  display: inline-block;
  max-width: 100%;
}

/* Image */
.article-container figure img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Caption — locked to image width */
.article-container figure figcaption {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 2px 4px;
  font-size: 0.95em;
  text-align: center;
  line-height: 1.4;
}

/*SIMPLE CONTENT LAYOUT*/

.article-container .content-wrapper {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.article-container .main-content {
  flex: 3;
  min-width: 0;
}

.article-container .right-sidebar {
  flex: 1;
  max-width: 280px;
}

/*AUTHOR BLOCK (cleaned)*/

.article-container .article-header {
  background: #C7D2FE;
  text-align: center;
  padding: 4px 0;
}

.article-container .author-info {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  font-size: 1em;
  color: #444;
}

.article-container .author-info span:not(:last-child)::after {
  content: "•";
  margin-left: 6px;
  color: #999;
}

.article-container .author-name {
  font-weight: 600;
}

.article-container .date-info {
  font-size: 0.9em;
  color: #666;
}

/*INTRO BLOCK*/

.article-container .introduction-section {
  background: #f5f7fa;
  border-left: 4px solid #4a6edb;
  padding: 10px 14px;
  margin-bottom: 14px;
  border-radius: 4px;
  line-height: 1.6;
}

/*SIDEBAR (Author Image)*/

.article-container .author-infobox {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.article-container .author-photo {
  border: 1px solid #ccc;
  padding: 2px;
  max-width: 180px;
}

.article-container .author-photo img {
  display: block;
  max-width: 100%;
}

.article-container .author-name-box {
  text-align: center;
  margin-top: 6px;
}

/*HIGHLIGHT / KEYPOINT BOXES*/

.article-container .highlight-box {
  background: #ecfffb;
  border-left: 5px solid #00c49c;
  padding: 12px;
  margin: 12px 0;
  border-radius: 6px;
}

.article-container .keypoints-float {
  background: #fff8e6;
  padding: 14px;
  border-left: 4px solid #8ba2e8;
  border-radius: 6px;
}

/*RESPONSIVE*/

@media (max-width: 900px) {

  .article-container .content-wrapper {
    flex-direction: column;
  }

  .article-container .right-sidebar {
    max-width: 100%;
  }

  .article-container figure {
    display: block;
    width: 100%;
  }


/*ACCESSIBILITY (keep minimal)*/

a:focus-visible,
button:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}