/* Small additions on top of Material for MkDocs. No external resources. */

.dmp-hero {
  display: grid;
  gap: 1.5rem;
  align-items: center;
  margin: 0.5rem 0 2rem;
}

@media screen and (min-width: 60em) {
  .dmp-hero {
    grid-template-columns: 1.1fr 1fr;
  }
}

.dmp-hero h1 {
  margin-bottom: 0.4rem;
  font-weight: 700;
  color: var(--md-default-fg-color);
}

.dmp-hero .dmp-tagline {
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--md-default-fg-color--light);
}

.dmp-hero img {
  width: 100%;
  height: auto;
  max-width: 40rem;
}

.dmp-hero .md-button {
  margin: 0.3rem 0.4rem 0.3rem 0;
}

/* "Planned" badge for features that are not available yet. */
.dmp-badge {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
  color: #4a3500;
  background: #ffd54f;
}

.dmp-badge--now {
  color: #ffffff;
  background: #2e7d32;
}

/* Wide tables scroll inside themselves, never the page. */
.md-typeset__table {
  max-width: 100%;
}

.md-typeset table:not([class]) th {
  white-space: nowrap;
}

.dmp-cta {
  margin: 2rem 0 1rem;
  padding: 1.2rem 1.4rem;
  border-radius: 0.6rem;
  background: var(--md-code-bg-color);
}

.dmp-cta p {
  margin: 0.3rem 0;
}

/* Edition comparison: centre every column except the first. */
.dmp-matrix th:not(:first-child),
.dmp-matrix td:not(:first-child) {
  text-align: center;
}

/* Dark scheme: lighten links and outline buttons so they keep enough contrast. */
[data-md-color-scheme="slate"] {
  --md-typeset-a-color: #9fa8da;
}

[data-md-color-scheme="slate"] .md-typeset .md-button:not(.md-button--primary) {
  color: #c5cae9;
  border-color: #9fa8da;
}

/* ---------------------------------------------------------------------------
   Before / after comparison: always two equal columns, one on phones.
   --------------------------------------------------------------------------- */
.dmp-compare {
  display: grid;
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

@media screen and (min-width: 45em) {
  .dmp-compare {
    grid-template-columns: 1fr 1fr;
  }
}

.dmp-compare > div {
  padding: 0.2rem 1.2rem 0.6rem;
  border-radius: 0.6rem;
  border: 0.05rem solid var(--md-default-fg-color--lightest);
}

.dmp-compare h3 {
  margin-top: 0.8rem;
}

.dmp-compare__before {
  background: var(--md-code-bg-color);
}

.dmp-compare__before h3 {
  color: #c62828;
}

.dmp-compare__after {
  border-color: #2e7d32 !important;
}

.dmp-compare__after h3 {
  color: #2e7d32;
}

[data-md-color-scheme="slate"] .dmp-compare__before h3 {
  color: #ef9a9a;
}

[data-md-color-scheme="slate"] .dmp-compare__after h3 {
  color: #a5d6a7;
}

[data-md-color-scheme="slate"] .dmp-compare__after {
  border-color: #66bb6a !important;
}

/* ---------------------------------------------------------------------------
   Measured numbers.
   --------------------------------------------------------------------------- */
.dmp-stats {
  display: grid;
  gap: 1rem;
  margin: 1rem 0 0.5rem;
}

@media screen and (min-width: 45em) {
  .dmp-stats {
    grid-template-columns: repeat(3, 1fr);
  }
}

.dmp-stats > div {
  padding: 0.8rem 1rem;
  border-radius: 0.6rem;
  background: var(--md-code-bg-color);
}

.dmp-stats__num {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--md-primary-fg-color);
}

[data-md-color-scheme="slate"] .dmp-stats__num {
  color: #9fa8da;
}

.dmp-stats__label {
  display: block;
  font-size: 0.75rem;
  color: var(--md-default-fg-color--light);
}

.md-typeset .dmp-note {
  font-size: 0.7rem;
  color: var(--md-default-fg-color--light);
}

/* Short facts strip (platforms, support). */
.md-typeset .dmp-facts ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.6rem;
  margin: 1rem 0;
  padding: 0;
  list-style: none;
}

.md-typeset .dmp-facts li {
  margin: 0;
}

/* ---------------------------------------------------------------------------
   Request dialog: hidden until #request is the URL fragment (CSS :target), so it
   needs no JavaScript. Full screen with its own scrolling on narrow screens.
   --------------------------------------------------------------------------- */
.dmp-modal {
  display: none;
}

.dmp-modal:target {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.dmp-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  cursor: default;
}

.dmp-modal__card {
  position: relative;
  width: 100%;
  max-width: 34rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding: 1.4rem 1.6rem 1rem;
  border-radius: 0.6rem;
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  box-shadow: 0 0.4rem 2rem rgba(0, 0, 0, 0.4);
}

.md-typeset .dmp-modal__card h2 {
  margin: 0 2rem 0.6rem 0;
  font-weight: 700;
}

.md-typeset .dmp-modal__lead {
  margin-top: 0;
  font-size: 0.75rem;
  color: var(--md-default-fg-color--light);
}

.md-typeset .dmp-modal__close {
  position: absolute;
  top: 0.4rem;
  right: 0.6rem;
  width: 2.2rem;
  height: 2.2rem;
  font-size: 1.6rem;
  line-height: 2.2rem;
  text-align: center;
  color: var(--md-default-fg-color--light);
  border-radius: 50%;
}

.md-typeset .dmp-modal__close:hover,
.md-typeset .dmp-modal__close:focus {
  color: var(--md-default-fg-color);
  background: var(--md-default-fg-color--lightest);
}

@media screen and (max-width: 37.5em) {
  .dmp-modal:target {
    padding: 0;
    align-items: stretch;
  }

  .dmp-modal__card {
    max-width: none;
    max-height: none;
    height: 100%;
    border-radius: 0;
    padding: 1rem 1rem 1.5rem;
  }
}

/* ---------------------------------------------------------------------------
   Request form (dialog and request page).
   --------------------------------------------------------------------------- */
.dmp-form-page {
  max-width: 34rem;
  margin: 1rem 0 2rem;
}

.dmp-form__row {
  margin: 0 0 0.8rem;
}

.dmp-form label {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.7rem;
  font-weight: 700;
}

.dmp-form__req,
.dmp-form__hint {
  font-weight: 400;
  color: var(--md-default-fg-color--light);
}

.dmp-form__req::before,
.dmp-form__hint::before {
  content: "· ";
}

.dmp-form input[type="text"],
.dmp-form input[type="email"],
.dmp-form input[type="tel"],
.dmp-form select,
.dmp-form textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 0.45rem 0.6rem;
  font: inherit;
  font-size: 0.8rem;
  color: var(--md-default-fg-color);
  background: var(--md-default-bg-color);
  border: 0.05rem solid var(--md-default-fg-color--lighter);
  border-radius: 0.25rem;
}

.dmp-form textarea {
  min-height: 7rem;
  resize: vertical;
}

.dmp-form input:focus,
.dmp-form select:focus,
.dmp-form textarea:focus {
  outline: none;
  border-color: var(--md-accent-fg-color);
  box-shadow: 0 0 0 0.1rem var(--md-accent-fg-color--transparent);
}

.dmp-form ::placeholder {
  color: var(--md-default-fg-color--light);
  opacity: 0.8;
}

/* Bot trap: off-screen for people, still a normal text field for bots. */
.dmp-form__trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.dmp-form__altcha {
  display: block;
  margin: 0.4rem 0 0.8rem;
}

.md-typeset .dmp-form__privacy,
.md-typeset .dmp-form__noscript {
  font-size: 0.65rem;
  color: var(--md-default-fg-color--light);
}

.md-typeset .dmp-form__noscript {
  color: var(--md-default-fg-color);
}

.md-typeset .dmp-form__submit {
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

/* ALTCHA widget colours follow the theme (variables from altcha.css). */
.dmp-form altcha-widget {
  --altcha-max-width: 100%;
  --altcha-color-base: var(--md-default-bg-color);
  --altcha-color-text: var(--md-default-fg-color);
  --altcha-color-border: var(--md-default-fg-color--lighter);
  --altcha-color-border-focus: var(--md-accent-fg-color);
}

/* Card grid with exactly two columns on wide screens (four cards, no gap). */
.md-typeset .grid.dmp-grid-2 {
  grid-template-columns: 1fr;
}

@media screen and (min-width: 45em) {
  .md-typeset .grid.dmp-grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Planned databases: a compact multi-column list. */
.md-typeset .dmp-db-list ul {
  columns: 2;
  column-gap: 2rem;
}

@media screen and (min-width: 45em) {
  .md-typeset .dmp-db-list ul {
    columns: 3;
  }
}

.md-typeset .dmp-db-list li {
  break-inside: avoid;
}

/* Request error reasons: the server redirects to request-error.html#<reason>,
   and the matching item is highlighted with :target (no JavaScript). */
.md-typeset ul.dmp-reasons li {
  margin: 0.4rem 0;
  padding: 0.3rem 0.6rem;
  border-left: 0.2rem solid transparent;
  border-radius: 0.2rem;
}

.md-typeset ul.dmp-reasons li:target {
  border-left-color: var(--md-accent-fg-color);
  background: var(--md-accent-fg-color--transparent);
}

/* Second line under the hero tagline: which databases. */
.md-typeset .dmp-tagline-sub {
  margin-top: -0.4rem;
  font-size: 0.8rem;
  color: var(--md-default-fg-color--light);
}

/* ---------------------------------------------------------------------------
   Header logo: the program's own icon (a photo on white), rounded so it sits
   cleanly on the coloured header in both themes.
   --------------------------------------------------------------------------- */
.md-header__button.md-logo img {
  border-radius: 6px;
  height: 1.8rem;
  width: 1.8rem;
}

/* ---------------------------------------------------------------------------
   Contrast (WCAG AA 4.5:1) and recognisable links.
   --------------------------------------------------------------------------- */
.md-tabs__link {
  opacity: 1;
  color: #ffffff;
}

.md-tabs__link--active,
.md-tabs__link:hover {
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

[data-md-color-scheme="default"] .dmp-stats__label {
  color: #5f5f5f;
}

[data-md-color-scheme="default"] .md-typeset .highlight .c1,
[data-md-color-scheme="default"] .md-typeset .highlight .c {
  color: #616161;
}

.md-typeset p a,
.md-typeset li a,
.md-typeset td a {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.md-typeset li a.md-button,
.md-typeset p a.md-button {
  text-decoration: none;
}

/* Footer: the company details link and the privacy link. */
.md-copyright__highlight a {
  color: inherit;
  text-decoration: underline;
}

/* Badge on its own line under a heading. */
.md-typeset h1 + p > .dmp-badge:only-child,
.md-typeset h2 + p > .dmp-badge:only-child {
  margin-top: -0.6rem;
}

/* Red "problem" labels on the use-cases page: the same colours as the red
   blocks in assets/flow.svg, filled, so they read in both themes. */
.md-typeset .dmp-chip {
  display: inline-block;
  margin: 0.1rem 0.25rem 0.1rem 0;
  padding: 0.05rem 0.55rem;
  border: 1px solid #e53935;
  border-radius: 0.4rem;
  background: #ffebee;
  color: #b71c1c;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Neutral label for jobs that are not a problem, only a kind of work. */
.md-typeset .dmp-chip--plain {
  border-color: #5c6bc0;
  background: #e8eaf6;
  color: #283593;
}
