/* Threat pages: the "menace" card block rendered by theme/menace.html.
   Mirrors intro.css, which does the same for tutorials. */

.menace {
  gap: 0.5em;
}

.menace .grid.cards ul {
  list-style: none;
  padding-left: 0;
}

.menace ul li {
  padding-left: 0;
}

.menace .twemoji {
  vertical-align: middle;
}

/* Fréquence de la menace / moyens qu'elle demande à l'attaquant, de 1 à 5 */
.menace .meta {
  color: gray;
  font-size: 0.75em;
}

.menace .meta > span + span {
  margin-left: 1.2em;
}

.menace .twemoji.niveau-0 {
  color: lightgray;
}

.menace .twemoji.niveau-1 {
  color: var(--md-accent-fg-color);
}

/* Summary: same shape as the tutorial "objectif" card */
.menace .resume {
  background-color: var(--md-accent-fg-color--transparent);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1em;
  align-items: start;
  min-width: 0;
  margin: 0;
}

.menace .resume .infos {
  float: right;
  flex-direction: column;
  align-items: flex-end;
  max-width: 30%;
}

.menace .resume .infos .twemoji.logo {
  --md-icon-size: 4em;
  display: inline-flex;
}

.menace .resume .infos .twemoji.logo svg {
  width: var(--md-icon-size);
  height: var(--md-icon-size);
}

/* Who can carry out the threat: one badge per entity */
.menace .entites {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em 1.2em;
}

.menace .entites li {
  display: flex;
  align-items: center;
  gap: 0.35em;
  margin: 0;
}

.menace .entites a {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
}

.menace .entites a:hover {
  text-decoration: underline;
}

.menace .entites img,
.menace .entites .twemoji svg {
  width: 1.5em;
  height: 1.5em;
}

/* Tutorials that reduce the threat: one badge per tutorial, icon included */
.menace .contre-mesures a {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
}

.menace .contre-mesures a:hover {
  text-decoration: underline;
}

.menace .contre-mesures .twemoji svg {
  width: 1.5em;
  height: 1.5em;
}

/* Entity pages: the reverse list of threat pages, injected by
   hooks/threat_cross_links.py. The card's link is stretched over the whole
   card, so the icon, the title and the description all behave as one link. */
.entite-menaces > ul > li {
  position: relative;
  transition:
    border-color 125ms,
    background-color 125ms;
}

.entite-menaces > ul > li:hover {
  border-color: var(--md-accent-fg-color);
  background-color: var(--md-accent-fg-color--transparent);
}

.entite-menaces > ul > li a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.entite-menaces > ul > li a {
  font-weight: 600;
}
