/*
 * Estilos base de las etiquetas (normalize.css 3.0.3 y la base de Bootstrap 3.3.6, que traía el tema
 * hijo). Sustituye bootstrap.min.css (legado-1.css).
 *
 * Va al principio de la capa `legado`, con su propio <link> antes de legado-1.css (components/legado/
 * EstilosLegado.astro): las reglas heredadas le siguen ganando como cuando Bootstrap se cargaba antes que
 * Betheme, y el CSS propio, fuera de la capa, gana sin más. No va en una capa aparte porque ALTCHA usa
 * `all: revert-layer`: revertiría a esa capa en lugar de a los estilos del navegador.
 *
 * Se conservan las reglas de etiquetas que hoy no usa ninguna página (sub, blockquote, code…) porque el
 * contenido que llega de WorkHub puede usarlas; los componentes de Bootstrap que nadie usa (.table,
 * .panel, .label, .media, .checkbox, .close) ya no están. Donde una regla pisaba a otra anterior del
 * mismo selector, queda solo el resultado.
 */
/* stylelint-disable number-max-precision -- el interlineado de Bootstrap (20/14 px) */
@layer legado {
  /* Impresión: va antes que el resto, como en Bootstrap (p. ej., `a { text-decoration: none }` le gana). */
  @media print {
    a,
    a:visited {
      text-decoration: underline;
    }

    a[href]::after {
      content: " (" attr(href) ")";
    }

    abbr[title]::after {
      content: " (" attr(title) ")";
    }

    a[href^="#"]::after {
      content: "";
    }

    blockquote,
    pre {
      border: 1px solid #999;
      break-inside: avoid;
    }

    thead {
      display: table-header-group;
    }

    img,
    tr {
      break-inside: avoid;
    }

    h2,
    h3,
    p {
      orphans: 3;
      widows: 3;
    }

    h2,
    h3 {
      break-after: avoid;
    }
  }

  html {
    font-family: sans-serif;
    font-size: 10px;
    /* stylelint-disable-next-line property-no-vendor-prefix -- sin prefijo no lo admiten todos */
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: rgb(0 0 0 / 0%);
  }

  body {
    margin: 0;
    color: #333;
    background-color: #fff;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.42857143;
  }

  figcaption,
  figure,
  footer,
  header,
  menu,
  section,
  summary {
    display: block;
  }

  audio,
  video {
    display: inline-block;
    vertical-align: baseline;
  }

  audio:not([controls]) {
    display: none;
    height: 0;
  }

  a {
    color: #337ab7;
    background-color: transparent;
    text-decoration: none;
  }

  a:active,
  a:hover {
    outline: 0;
  }

  b,
  strong {
    font-weight: 700;
  }

  sub,
  sup {
    position: relative;
    font-size: 75%;
    line-height: 0;
    vertical-align: baseline;
  }

  sup {
    top: -0.5em;
  }

  sub {
    bottom: -0.25em;
  }

  img {
    border: 0;
    vertical-align: middle;
  }

  hr {
    box-sizing: content-box;
    height: 0;
    margin-top: 20px;
    margin-bottom: 20px;
    border: 0;
    border-top: 1px solid #eee;
  }

  button,
  input,
  select,
  textarea {
    margin: 0;
    color: inherit;
    font: inherit;
  }

  button {
    overflow: visible;
  }

  button,
  select {
    text-transform: none;
  }

  button,
  input[type="submit"] {
    /* stylelint-disable-next-line declaration-property-value-keyword-no-deprecated -- igual que Bootstrap */
    appearance: button;
    cursor: pointer;
  }

  button::-moz-focus-inner,
  input::-moz-focus-inner {
    padding: 0;
    border: 0;
  }

  input {
    line-height: normal;
  }

  input[type="checkbox"] {
    box-sizing: border-box;
    margin: 4px 0 0;
    padding: 0;
    line-height: normal;
  }

  input[type="number"]::-webkit-inner-spin-button,
  input[type="number"]::-webkit-outer-spin-button {
    height: auto;
  }

  input[type="search"] {
    box-sizing: border-box;
    appearance: none;
  }

  input[type="search"]::-webkit-search-cancel-button,
  input[type="search"]::-webkit-search-decoration {
    appearance: none;
  }

  textarea {
    overflow: auto;
  }

  table {
    border-collapse: collapse;
    border-spacing: 0;
    background-color: transparent;
  }

  td,
  th {
    padding: 0;
  }

  th {
    text-align: left;
  }

  caption {
    padding-top: 8px;
    padding-bottom: 8px;
    color: #777;
    text-align: left;
  }

  * {
    box-sizing: border-box;
  }

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

  /* Va después de `input { line-height: normal }`: los campos heredan el interlineado. */
  /* stylelint-disable-next-line no-duplicate-selectors */
  button,
  input,
  select,
  textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
  }

  a:focus,
  a:hover {
    color: #23527c;
    text-decoration: underline;
  }

  a:focus {
    outline: 5px auto -webkit-focus-ring-color;
    outline-offset: -2px;
  }

  figure {
    margin: 0;
  }

  [role="button"] {
    cursor: pointer;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    color: inherit;
    font-family: inherit;
    font-weight: 500;
    line-height: 1.1;
  }

  h1 .small,
  h1 small,
  h2 .small,
  h2 small,
  h3 .small,
  h3 small,
  h4 .small,
  h4 small,
  h5 .small,
  h5 small,
  h6 .small,
  h6 small {
    color: #777;
    font-weight: 400;
    line-height: 1;
  }

  h1,
  h2,
  h3 {
    margin-top: 20px;
    margin-bottom: 10px;
  }

  h1 .small,
  h1 small,
  h2 .small,
  h2 small,
  h3 .small,
  h3 small {
    font-size: 65%;
  }

  h4,
  h5,
  h6 {
    margin-top: 10px;
    margin-bottom: 10px;
  }

  h4 .small,
  h4 small,
  h5 .small,
  h5 small,
  h6 .small,
  h6 small {
    font-size: 75%;
  }

  h1 {
    font-size: 36px;
  }

  h2 {
    font-size: 30px;
  }

  h3 {
    font-size: 24px;
  }

  h4 {
    font-size: 18px;
  }

  h5 {
    font-size: 14px;
  }

  h6 {
    font-size: 12px;
  }

  p {
    margin: 0 0 10px;
  }

  small {
    font-size: 85%;
  }

  mark {
    padding: 0.2em;
    color: #000;
    background: #fcf8e3;
  }

  ol,
  ul {
    margin-top: 0;
    margin-bottom: 10px;
  }

  ol ol,
  ol ul,
  ul ol,
  ul ul {
    margin-bottom: 0;
  }

  dl {
    margin-top: 0;
    margin-bottom: 20px;
  }

  dd,
  dt {
    line-height: 1.42857143;
  }

  dt {
    font-weight: 700;
  }

  dd {
    margin-left: 0;
  }

  abbr[title] {
    border-bottom: 1px dotted #777;
    cursor: help;
  }

  blockquote {
    margin: 0 0 20px;
    padding: 10px 20px;
    border-left: 5px solid #eee;
    font-size: 17.5px;
  }

  blockquote ol:last-child,
  blockquote p:last-child,
  blockquote ul:last-child {
    margin-bottom: 0;
  }

  blockquote .small,
  blockquote footer,
  blockquote small {
    display: block;
    color: #777;
    font-size: 80%;
    line-height: 1.42857143;
  }

  blockquote .small::before,
  blockquote footer::before,
  blockquote small::before {
    content: "\2014 \00A0";
  }

  address {
    margin-bottom: 20px;
    font-style: normal;
    line-height: 1.42857143;
  }

  code,
  kbd,
  pre {
    font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
    font-size: 1em;
  }

  code {
    padding: 2px 4px;
    border-radius: 4px;
    color: #c7254e;
    background-color: #f9f2f4;
    font-size: 90%;
  }

  kbd {
    padding: 2px 4px;
    border-radius: 3px;
    color: #fff;
    background-color: #333;
    box-shadow: inset 0 -1px 0 rgb(0 0 0 / 25%);
    font-size: 90%;
  }

  kbd kbd {
    padding: 0;
    box-shadow: none;
    font-size: 100%;
    font-weight: 700;
  }

  pre {
    display: block;
    overflow: auto;
    margin: 0 0 10px;
    padding: 9.5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    color: #333;
    background-color: #f5f5f5;
    font-size: 13px;
    line-height: 1.42857143;
    word-break: break-all;
    overflow-wrap: break-word;
  }

  pre code {
    padding: 0;
    border-radius: 0;
    color: inherit;
    background-color: transparent;
    font-size: inherit;
    white-space: pre-wrap;
  }

  .container {
    margin-right: auto;
    margin-left: auto;
    padding-right: 15px;
    padding-left: 15px;
  }

  fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
  }

  legend {
    display: block;
    width: 100%;
    margin-bottom: 20px;
    padding: 0;
    border: 0;
    border-bottom: 1px solid #e5e5e5;
    color: #333;
    font-size: 21px;
    line-height: inherit;
  }

  label {
    display: inline-block;
    max-width: 100%;
    margin-bottom: 5px;
    font-weight: 700;
  }

  select[size] {
    height: auto;
  }

  input[type="checkbox"]:focus {
    outline: 5px auto -webkit-focus-ring-color;
    outline-offset: -2px;
  }

  .clearfix::after,
  .clearfix::before,
  .container::after,
  .container::before {
    display: table;
    content: " ";
  }

  .clearfix::after,
  .container::after {
    clear: both;
  }

  @media (min-width: 768px) {
    .container {
      width: 750px;
    }
  }

  @media (min-width: 992px) {
    .container {
      width: 970px;
    }
  }

  @media (min-width: 1200px) {
    .container {
      width: 1170px;
    }
  }
}

/*
 * Los !important de impresión, fuera de la capa: así pierden contra los !important heredados y les ganan a
 * todas las reglas normales, como cuando estaban dentro de la capa antes que Betheme.
 */
@media print {
  *,
  ::after,
  ::before {
    color: #000 !important;
    background: transparent !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  img {
    max-width: 100% !important;
  }
}
