مدیاویکی:Common.css

از آیت‌الله گنجی

نکته: پس از انتشار ممکن است برای دیدن تغییرات نیاز باشد که حافظهٔ نهانی مرورگر خود را پاک کنید.

  • فایرفاکس / سافاری: کلید Shift را نگه دارید و روی دکمهٔ Reload کلیک کنید، یا کلید‌های Ctrl-F5 یا Ctrl-R را با هم فشار دهید (در رایانه‌های اپل مکینتاش کلید‌های ⌘-R)
  • گوگل کروم: کلیدهای Ctrl+Shift+R را با هم فشار دهید (در رایانه‌های اپل مکینتاش کلید‌های ⌘-Shift-R)
  • Edge: کلید Ctrl را نگه‌دارید و روی دکمهٔ Refresh کلیک کنید، یا کلید‌های Ctrl-F5 را با هم فشار دهید
/* پایگاه اطلاع‌رسانی آیت‌الله گنجی — MediaWiki:Common.css */

/* فونت محلی؛ فایل‌ها در پوشهٔ /fonts سایت هستند */
@font-face {
  font-family: Vazir;
  src: url('/fonts/Vazir.woff2') format('woff2'),
       url('/fonts/Vazir.woff') format('woff'),
       url('/fonts/Vazir.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --ganji-primary: #145f57;
  --ganji-primary-dark: #0c463f;
  --ganji-link: #075c87;
  --ganji-border: #d9e3e1;
  --ganji-soft: #f7faf9;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  direction: rtl;
}

html,
body,
.mw-body,
.mw-body-content,
.mw-parser-output,
.mw-ui-button,
button,
input,
textarea,
select {
  font-family: Vazir, Tahoma, Arial, sans-serif !important;
}

/* متن و محتوا */
.mw-body-content,
.mw-parser-output {
  font-size: 16px;
  line-height: 2.1;
}

.mw-parser-output p {
  text-align: justify;
  text-justify: inter-word;
  overflow-wrap: break-word;
}

/* عنوان‌ها */
.mw-body h1,
.mw-body h2,
.mw-body h3,
.mw-body h4,
.mw-body h5,
.mw-body h6,
.mw-page-title-main,
.mw-headline {
  font-family: Vazir, Tahoma, Arial, sans-serif !important;
  font-weight: bold;
  color: var(--ganji-primary-dark);
}

.mw-body h2 {
  margin-top: 2em;
  padding-bottom: .35em;
  border-bottom: 1px solid var(--ganji-border);
}

/* کد، آدرس و عبارت لاتین */
pre,
code,
kbd,
samp,
.mw-code {
  direction: ltr;
  text-align: left;
  font-family: Consolas, "Courier New", monospace !important;
}

/* پیوندها */
.mw-parser-output a,
.mw-body a {
  color: var(--ganji-link);
}

.mw-parser-output a:visited {
  color: #5b4382;
}

.mw-parser-output a:hover {
  color: var(--ganji-primary-dark);
}

/* تصاویر */
.mw-parser-output img,
.mw-file-description img,
.thumb img {
  max-width: 100%;
  height: auto !important;
}

.thumbinner,
.mw-default-size img {
  border-radius: 6px;
}

/* نقل‌قول */
.mw-parser-output blockquote {
  margin: 1.25em 0;
  padding: .75em 1.1em;
  border-right: 4px solid var(--ganji-primary);
  background: var(--ganji-soft);
  border-radius: 6px;
}

/* جدول‌های ویکی */
.mw-parser-output .wikitable {
  width: auto;
  max-width: 100%;
  margin: 1.2em auto;
  border: 1px solid var(--ganji-border);
  border-collapse: collapse;
  background: #fff;
}

.mw-parser-output .wikitable th,
.mw-parser-output .wikitable td {
  padding: .55em .8em;
  border: 1px solid var(--ganji-border);
  text-align: right;
  vertical-align: top;
}

.mw-parser-output .wikitable th {
  background: #eaf3f1;
  color: var(--ganji-primary-dark);
  font-weight: bold;
}

.mw-parser-output .wikitable tr:nth-child(even) {
  background: #fbfcfc;
}

/* جعبهٔ اطلاعات */
.infobox {
  float: left;
  clear: left;
  width: 22em;
  max-width: 38%;
  margin: .5em 1.25em 1em 0;
  padding: .25em;
  border: 1px solid var(--ganji-border);
  border-radius: 8px;
  background: var(--ganji-soft);
  color: #1e2928;
  font-size: 92%;
  line-height: 1.8;
}

.infobox th,
.infobox td {
  padding: .4em .55em;
  text-align: right;
  vertical-align: top;
}

.infobox-title,
.infobox-above,
.infobox caption {
  padding: .55em;
  background: #eaf3f1;
  color: var(--ganji-primary-dark);
  font-weight: bold;
  text-align: center;
}

/* جعبه‌های ناوبری */
.navbox {
  width: 100%;
  margin: 1.25em auto;
  border: 1px solid var(--ganji-border);
  border-radius: 8px;
  background: #fff;
  font-size: 92%;
  text-align: center;
  overflow: hidden;
}

.navbox-title,
.navbox-abovebelow,
.navbox-group {
  padding: .45em .75em;
  background: #eaf3f1;
  color: var(--ganji-primary-dark);
  font-weight: bold;
}

.navbox-list {
  padding: .55em;
  line-height: 1.9;
}

/* منابع و متن لاتین */
ol.references {
  font-size: 92%;
  line-height: 1.9;
}

li.mw-cite-dir-ltr,
.mw-content-ltr {
  direction: ltr;
  text-align: left;
}

/* گریدهای قدیمی صفحهٔ اصلی */
.portal-container-2,
.portal-container-3,
.portal-container-4,
.portal-container-5,
.portal-container-6 {
  display: grid;
  gap: 15px;
  width: 100%;
}

.portal-container-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.portal-container-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.portal-container-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.portal-container-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.portal-container-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.portal-column-1-2,
.portal-column-1-3,
.portal-column-1-4,
.portal-column-1-5,
.portal-column-1-6 {
  grid-column: span 1;
}

.portal-column-2-3,
.portal-column-2-4 {
  grid-column: span 2;
}

.portal-column-3-4 {
  grid-column: span 3;
}

/* صفحهٔ اصلی */
body.page-صفحهٔ_اصلی #firstHeading,
body.page-صفحهٔ_اصلی .firstHeading {
  display: none;
}

body.page-صفحهٔ_اصلی .mw-body-content {
  padding-top: 0;
}

/* موبایل */
@media (max-width: 900px) {
  .portal-container-4,
  .portal-container-5,
  .portal-container-6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .infobox {
    float: none;
    width: 100%;
    max-width: 100%;
    margin: 1em 0;
  }
}

@media (max-width: 650px) {
  .mw-body-content,
  .mw-parser-output {
    font-size: 15px;
    line-height: 2;
  }

  .portal-container-2,
  .portal-container-3,
  .portal-container-4,
  .portal-container-5,
  .portal-container-6 {
    display: block;
  }

  .portal-container-2 > *,
  .portal-container-3 > *,
  .portal-container-4 > *,
  .portal-container-5 > *,
  .portal-container-6 > * {
    margin-bottom: 14px;
  }

  .portal-column-2-3,
  .portal-column-2-4,
  .portal-column-3-4 {
    grid-column: auto;
  }

  .mw-parser-output .wikitable {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}