/**
 * Style Parsoid HTML+RDFa output consistent with wikitext from PHP parser.
 */
/*
 * Auto-numbered external links
 * Parsoid renders those as link without content, and lets CSS do the
 * counting. This way the counting style can be customized, and counts update
 * automatically when content is modified.
 */
.mw-parser-output {
  counter-reset: mw-numbered-ext-link;
}
.mw-parser-output a[rel~='mw:ExtLink']:empty::after {
  content: '[' counter(mw-numbered-ext-link) ']';
  counter-increment: mw-numbered-ext-link;
}

/**
 * Block media items
 */
figure[typeof~='mw:File'],
figure[typeof~='mw:File/Frameless'] {
  margin: 0;
  /* Hide the caption for frameless and plain floated images */
}
.mw-body-content figure[typeof~='mw:File'] > a,
.mw-body-content figure[typeof~='mw:File/Frameless'] > a {
  border: 0;
}
figure[typeof~='mw:File'].mw-halign-right,
figure[typeof~='mw:File/Frameless'].mw-halign-right {
  /* @noflip */
  margin: 0 0 0.5em 0.5em;
  /* @noflip */
  clear: right;
  /* @noflip */
  float: right;
}
figure[typeof~='mw:File'].mw-halign-left,
figure[typeof~='mw:File/Frameless'].mw-halign-left {
  /* @noflip */
  margin: 0 0.5em 0.5em 0;
  /* @noflip */
  clear: left;
  /* @noflip */
  float: left;
}
figure[typeof~='mw:File'].mw-halign-none,
figure[typeof~='mw:File/Frameless'].mw-halign-none {
  clear: none;
  float: none;
}
figure[typeof~='mw:File'].mw-halign-center,
figure[typeof~='mw:File/Frameless'].mw-halign-center {
  /* Matches *.center * in element.css */
  margin: 0 auto;
  display: table;
  border-collapse: collapse;
  clear: none;
  float: none;
}
figure[typeof~='mw:File'] > figcaption,
figure[typeof~='mw:File/Frameless'] > figcaption {
  display: none;
}
figure[typeof~='mw:File/Thumb'],
figure[typeof~='mw:File/Frame'] {
  display: table;
  text-align: center;
  border-collapse: collapse;
  line-height: 0;
  margin: 0.5em 0 1.3em 1.4em;
  clear: right;
  float: right;
}
.mw-body-content figure[typeof~='mw:File/Thumb'] > a,
.mw-body-content figure[typeof~='mw:File/Frame'] > a {
  border: 0;
}
.mw-content-ltr figure[typeof~='mw:File/Thumb'],
.mw-content-ltr figure[typeof~='mw:File/Frame'] {
  /* @noflip */
  margin: 0.5em 0 1.3em 1.4em;
  /* @noflip */
  clear: right;
  /* @noflip */
  float: right;
}
.mw-content-rtl figure[typeof~='mw:File/Thumb'],
.mw-content-rtl figure[typeof~='mw:File/Frame'] {
  /* @noflip */
  margin: 0.5em 1.4em 1.3em 0;
  /* @noflip */
  clear: left;
  /* @noflip */
  float: left;
}
figure[typeof~='mw:File/Thumb'].mw-halign-right,
figure[typeof~='mw:File/Frame'].mw-halign-right {
  /* @noflip */
  margin: 0.5em 0 1.3em 1.4em;
  /* @noflip */
  clear: right;
  /* @noflip */
  float: right;
}
figure[typeof~='mw:File/Thumb'].mw-halign-left,
figure[typeof~='mw:File/Frame'].mw-halign-left {
  /* @noflip */
  margin: 0.5em 1.4em 1.3em 0;
  /* @noflip */
  clear: left;
  /* @noflip */
  float: left;
}
figure[typeof~='mw:File/Thumb'].mw-halign-none,
figure[typeof~='mw:File/Frame'].mw-halign-none {
  /* Override the default margin from mw-content-xxx above */
  margin: 0;
  margin-bottom: 0.5em;
  clear: none;
  float: none;
}
figure[typeof~='mw:File/Thumb'].mw-halign-center,
figure[typeof~='mw:File/Frame'].mw-halign-center {
  /* Override the default margin from mw-content-xxx above
		 * And, matches *.center * in element.css
		 */
  margin: 0 auto 0.5em auto;
  clear: none;
  float: none;
}
figure[typeof~='mw:File/Thumb'] > :not( figcaption ),
figure[typeof~='mw:File/Frame'] > :not( figcaption ) {
  /**
		 * Broken media get a span instead.
		 */
}
figure[typeof~='mw:File/Thumb'] > :not( figcaption ) .mw-file-element,
figure[typeof~='mw:File/Frame'] > :not( figcaption ) .mw-file-element {
  margin: 3px;
}
figure[typeof~='mw:File/Thumb'] > :not( figcaption ) .mw-broken-media,
figure[typeof~='mw:File/Frame'] > :not( figcaption ) .mw-broken-media {
  display: inline-block;
  line-height: 1.6em;
  word-break: break-word;
  /* This is hardcoded in Linker::makeThumbLink2 for broken media */
  width: 180px;
  /* Styles the text of broken media */
  font-size: 94%;
}
figure[typeof~='mw:File/Thumb'] > figcaption,
figure[typeof~='mw:File/Frame'] > figcaption {
  display: table-caption;
  caption-side: bottom;
  line-height: 1.4em;
  /**
		 * The "break-word" value is deprecated, however, it's well supported
		 * at 94.73%
		 * https://caniuse.com/mdn-css_properties_word-break_break-word
		 *
		 * The spec suggests it has the same effect as,
		 *
		 *   word-break: normal;
		 *   overflow-wrap: anywhere;
		 *
		 * https://drafts.csswg.org/css-text-3/#word-break-property
		 *
		 * So, we should use that.  However, support for "anywhere" is lagging
		 * at just 72.39%, with Safari being a notable miss.
		 * https://caniuse.com/mdn-css_properties_overflow-wrap_anywhere
		 *
		 * "Soft wrap opportunities introduced by the word break are considered
		 * when calculating min-content intrinsic sizes."
		 * From https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap
		 */
  word-break: break-word;
  text-align: left;
  /* taken from .thumbcaption, plus .thumbinner */
  padding: 0 6px 6px 6px;
}
.mw-content-ltr figure[typeof~='mw:File/Thumb'] > figcaption,
.mw-content-ltr figure[typeof~='mw:File/Frame'] > figcaption {
  /* @noflip */
  text-align: left;
}
.mw-content-rtl figure[typeof~='mw:File/Thumb'] > figcaption,
.mw-content-rtl figure[typeof~='mw:File/Frame'] > figcaption {
  /* @noflip */
  text-align: right;
}
figure[typeof~='mw:File/Frame'] > figcaption:empty {
  padding-bottom: 0;
}
figure[typeof~='mw:File/Thumb'] > figcaption:empty {
  padding-bottom: 3px;
}
/**
 * Inline media items
 */
.mw-valign-middle .mw-file-element {
  vertical-align: middle;
}
.mw-valign-baseline .mw-file-element {
  vertical-align: baseline;
}
.mw-valign-sub .mw-file-element {
  vertical-align: sub;
}
.mw-valign-super .mw-file-element {
  vertical-align: super;
}
.mw-valign-top .mw-file-element {
  vertical-align: top;
}
.mw-valign-text-top .mw-file-element {
  vertical-align: text-top;
}
.mw-valign-bottom .mw-file-element {
  vertical-align: bottom;
}
.mw-valign-text-bottom .mw-file-element {
  vertical-align: text-bottom;
}

figure[typeof~='mw:File/Thumb'],
figure[typeof~='mw:File/Frame'] {
  border: 1px solid #c8ccd1;
  border-bottom: 0;
  background-color: #f8f9fa;
}
figure[typeof~='mw:File/Thumb'] > :not( figcaption ) .mw-file-element,
figure[typeof~='mw:File/Frame'] > :not( figcaption ) .mw-file-element {
  border: 1px solid #c8ccd1;
  background: #ffffff;
}
figure[typeof~='mw:File/Thumb'] > figcaption,
figure[typeof~='mw:File/Frame'] > figcaption {
  border: 1px solid #c8ccd1;
  border-top: 0;
  background-color: #f8f9fa;
  /* In mw-core the font-size is duplicated, 94% in thumbinner
		 * and again 94% in thumbcaption. 88.4% for font size of the
		 * caption results in the same behavior. */
  font-size: 88.4%;
}
.mw-image-border .mw-file-element {
  border: 1px solid #eaecf0;
}
figure[typeof~='mw:File/Thumb'] > figcaption::before {
  content: '';
  width: 15px;
  height: 11px;
  margin: 0 0 0 3px;
  float: right;
}
.mw-content-ltr figure[typeof~='mw:File/Thumb'] > figcaption::before {
  /* @noflip */
  margin: 0 0 0 3px;
  /* @noflip */
  float: right;
}
.mw-content-rtl figure[typeof~='mw:File/Thumb'] > figcaption::before {
  /* @noflip */
  margin: 0 3px 0 0;
  /* @noflip */
  float: left;
}
figure[typeof~='mw:File/Thumb'] > .mw-file-description,
figure[typeof~='mw:File/Thumb'] > .mw-file-magnify {
  display: block;
  position: relative;
}
figure[typeof~='mw:File/Thumb'] > .mw-file-description::after,
figure[typeof~='mw:File/Thumb'] > .mw-file-magnify::after {
  content: '';
  width: 15px;
  height: 11px;
  position: absolute;
  bottom: -11px;
  right: 6px;
  background-image: url(/w/resources/src/mediawiki.skinning/images/magnify-clip-ltr.svg?8330e);
}
.mw-content-ltr figure[typeof~='mw:File/Thumb'] > .mw-file-description::after,
.mw-content-ltr figure[typeof~='mw:File/Thumb'] > .mw-file-magnify::after {
  /* @noflip */
  right: 6px;
  /* @noflip */
  left: auto;
  /* @noflip */
  background-image: url(/w/resources/src/mediawiki.skinning/images/magnify-clip-ltr.svg?8330e);
}
.mw-content-rtl figure[typeof~='mw:File/Thumb'] > .mw-file-description::after,
.mw-content-rtl figure[typeof~='mw:File/Thumb'] > .mw-file-magnify::after {
  /* @noflip */
  right: auto;
  /* @noflip */
  left: 6px;
  /* @noflip */
  background-image: url(/w/resources/src/mediawiki.skinning/images/magnify-clip-rtl.svg?38fd5);
}

/* stylelint-disable selector-class-pattern */
/**
 * Avoid the need to calculate paddings individually
 * https://stackoverflow.com/a/7310398
 */
.mw-gallery-traditional .gallerybox > .thumb::before {
  content: '';
  vertical-align: middle;
  display: inline-block;
  height: 100%;
}
.mw-gallery-traditional .gallerybox > .thumb > * {
  vertical-align: middle;
  display: inline-block;
}
