/* Hide empty root heading (-> `#`) */
h1#_1 {
  display: none;
}

/* Increase logo size in header */
.md-header__button.md-logo {
  width: auto;
  height: 2.5rem; /* Increase from default ~1.6rem to make it more prominent */
  display: flex;
  align-items: center;
}

.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  height: 100%;
  width: auto;
  max-height: 2.5rem;
}

/* Floating image with text wrap - reusable class */
.float-container .float-left-image {
  float: left;
  margin: -2px 0.4rem 0 0;
  max-width: 32px;
  width: 32px;
  height: auto;
}

/* Container for floating content */
.float-container {
  overflow: hidden; /* Clears floats */
}

/* Custom acknowledgment admonition */
.md-typeset .admonition.bai,
.md-typeset details.bai {
  border-color: #18a5a7;
}

.md-typeset .bai > .admonition-title,
.md-typeset .bai > summary {
  background-color: rgba(24, 165, 167, 0.1);
  border-color: #18a5a7;
}

.md-typeset .bai > .admonition-title::before,
.md-typeset .bai > summary::before {
  background-color: #18a5a7;
}

.hero-logo {
  /* No wider than the screen on smaller screens */
  max-width: min(75%, 75vw) !important;
  max-height: 196px;

  /* Horizontally centered */
  display: block;
  margin: 0 auto 2rem;
}

table {
  display: block;
  max-width: -moz-fit-content;
  max-width: fit-content;
  margin: 0 auto;
  overflow-x: auto;
  white-space: nowrap;
}

/* References to the AI Act generated by custom Markdown extension */
.aia-ref {
  text-decoration: underline dotted;
}

.aia-ref-unparsed {
  padding: 2px;
  border: 1px red solid;
  background-color: rgba(255, 0, 0, 0.1);
}

.aia-ref-unparsed::after {
  content: " (invalid ref!)";
  color: red;
}

/* Footer */
.md-footer-meta__inner {
  flex-wrap: nowrap;
  align-items: center;
}

.copyright {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 0 0.4rem;
}

.copyright p {
  font-size: 0.6rem;
}

.copyright .logo {
  max-height: 96px;
}

.copyright .aai-logo {
  padding: 14px;
}

.copyright .logo-container {
  display: flex;
  flex-direction: row;
  align-items: center;
}

@media (max-width: 720px) {
  .md-footer-meta__inner {
    flex-direction: column;
    justify-content: center;
  }

  .copyright {
    width: 100%;
    flex-direction: column;
  }

  .copyright p {
    margin-bottom: 0;
  }

  .copyright .logo {
    max-height: 64px;
  }
}

.backlinks {
  /* Aligned with .md-tags */
  display: flex !important;
  flex-direction: column;
  margin: 0.75em 0 -0.125em 0;
  padding: 0;
  gap: 0.25rem;

  li {
    font-size: min(0.8em, 0.64rem);

    display: inline;
    list-style: none;
    margin: 0 !important;

    a {
      color: grey;
    }
    :before {
      content: "↙";
      margin-right: 1ch;
    }
  }
}

.engineering-practice-table table tr {
  /* First column: Name of the practice */
  td:nth-child(1) {
    font-weight: bold;
  }

  /* Second column: Links to articles, wrapped in <a> */
  td:nth-child(2) {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
}

.conformity-table table tr {
  td:nth-child(1) {
    /* First column: Name of the practice */
    font-weight: bold;
    max-width: 30ch;
    text-wrap: wrap;
  }
  /* Second column: Links to articles, wrapped in <a> */
  td:nth-child(2) {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Third column: Automation feasibility */
  td:nth-child(3) {
    max-width: 50ch;
    text-wrap: wrap;
  }
}
