.header-bloc-marque {
  height: 80px !important;
  width: auto !important;
  max-height: none !important;
}

/* Changement du logo si dark-mode */
[data-fr-theme="dark"] .header-bloc-marque {
  content: url("../icons/logo/bloc-marque-dark.svg");
}

/* Bouton RSS dans le bloc réseaux sociaux */
.fr-btn--rss::before {
  -webkit-mask-image: url(../dsfr/icons/device/rss-fill.svg);
  mask-image: url(../dsfr/icons/device/rss-fill.svg);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  background-color: currentColor;
  background-image: none;
}

/* Bandeau d'alerte – centrage du contenu */
.fr-notice .fr-notice__body {
  justify-content: center;
}

/* Header – masquer titre/desc sur petits mobiles, réduire logos */
@media (max-width: 61.99em) {
  .fr-header__top {
    display: none !important;
  }
}
@media (max-width: 61.99em) {
  .fr-header__service {
    display: none !important;
  }
}
@media (min-width: 768px) and (max-width: 61.99em) {
  .fr-header__operator img {
    height: 50px !important;
    max-height: 50px !important;
  }
}
@media (max-width: 61.99em) {
  .fr-header__operator img {
    height: 40px !important;
    width: auto !important;
    max-height: 40px !important;
  }
}

/* Header – réduire espacement en mobile */
@media (max-width: 61.99em) {
  .fr-header__brand-top {
    gap: 0.25rem !important;
  }
  .fr-header__operator {
    margin: 0 !important;
    padding: 0 !important;
  }
}

/* Header – très petits écrans (<320px) */
@media (max-width: 320px) {
  .fr-header__brand-top {
    gap: 0.125rem !important;
  }
  .fr-header__logo .fr-logo {
    font-size: 0.6rem !important;
  }
  .fr-header__operator img {
    height: 28px !important;
    max-height: 28px !important;
  }
  .fr-header__operator {
    margin: 0 !important;
    padding: 0 !important;
  }
  .fr-header__navbar .fr-btn--menu {
    font-size: 0 !important;
    min-height: 2rem !important;
    padding: 0.25rem 0.5rem !important;
  }
  .fr-header__navbar .fr-btn--menu::before {
    --icon-size: 1rem !important;
    margin-right: 0 !important;
  }
}

/* Masquer la duplication automatique des tools dans le menu burger */
.fr-header__menu .fr-header__menu-links .fr-btn--incident {
  display: none !important;
}

/* Masquer la duplication du choix de thème dans le menu burger */
.fr-header__menu .fr-header__menu-links {
  display: none !important;
}

/* Bouton Incident dans le menu burger – visible uniquement en mobile */
.header-menu-incident-row {
  display: none !important;
}
@media (max-width: 61.99em) {
  .header-menu-incident-row {
    display: flex !important;
  }
  .header-menu-incident-row .fr-btn--incident {
    width: 100%;
    justify-content: center;
  }
}

/* Bouton Paramètres d'affichage dans le menu burger – visible uniquement en mobile */
.header-menu-display-row {
  display: none !important;
}
@media (max-width: 61.99em) {
  .header-menu-display-row {
    display: flex !important;
  }
}

/* Page flux RSS — liste de liens sans soulignement au repos */
.fr-raw-list .fr-link:not(:hover):not(:active) {
  --underline-idle-width: 0;
}

/* Bouton Incident rouge marianne */
.fr-btn--incident {
  background-color: var(--background-action-high-red-marianne) !important;
  color: var(--text-inverted-grey) !important;
}
.fr-btn--incident:hover,
.fr-btn--incident:focus-visible {
    text-decoration: underline;
}

@media (min-width: 62em) {
  .fr-btn--incident {
    font-size: 0.9rem !important;
    line-height: 1.5rem !important;
    min-height: 2.5rem !important;
    padding: 0.5rem 1rem !important;
  }
}

/* Boutons colorés par section – page d'accueil */

.fr-btn--pink-tuile {
  background-color: var(--background-action-high-pink-tuile) !important;
  color: var(--text-inverted-pink-tuile) !important;
}
.fr-btn--pink-tuile:hover {
  background-color: var(--background-action-high-pink-tuile-hover) !important;
}
.fr-btn--pink-tuile:active {
  background-color: var(--background-action-high-pink-tuile-active) !important;
}

.fr-btn--green-archipel {
  background-color: var(--background-action-high-green-archipel) !important;
  color: var(--text-inverted-green-archipel) !important;
}
.fr-btn--green-archipel:hover {
  background-color: var(--background-action-high-green-archipel-hover) !important;
}
.fr-btn--green-archipel:active {
  background-color: var(--background-action-high-green-archipel-active) !important;
}

.fr-btn--purple-glycine {
  background-color: var(--background-action-high-purple-glycine) !important;
  color: var(--text-inverted-purple-glycine) !important;
}
.fr-btn--purple-glycine:hover {
  background-color: var(--background-action-high-purple-glycine-hover) !important;
}
.fr-btn--purple-glycine:active {
  background-color: var(--background-action-high-purple-glycine-active) !important;
}

.fr-btn--yellow-tournesol {
  background-color: var(--background-action-high-yellow-tournesol) !important;
  color: var(--text-inverted-yellow-tournesol) !important;
}
.fr-btn--yellow-tournesol:hover {
  background-color: var(--background-action-high-yellow-tournesol-hover) !important;
}
.fr-btn--yellow-tournesol:active {
  background-color: var(--background-action-high-yellow-tournesol-active) !important;
}

.fr-btn--blue-ecume {
  background-color: var(--background-action-high-blue-ecume) !important;
  color: var(--text-inverted-blue-ecume) !important;
}
.fr-btn--blue-ecume:hover {
  background-color: var(--background-action-high-blue-ecume-hover) !important;
}
.fr-btn--blue-ecume:active {
  background-color: var(--background-action-high-blue-ecume-active) !important;
}

.fr-btn--green-menthe {
  background-color: var(--background-action-high-green-menthe) !important;
  color: var(--text-inverted-green-menthe) !important;
}
.fr-btn--green-menthe:hover {
  background-color: var(--background-action-high-green-menthe-hover) !important;
}
.fr-btn--green-menthe:active {
  background-color: var(--background-action-high-green-menthe-active) !important;
}

/* Liste d'alertes */
.alert-list-container {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.alert-item {
  border: 1px solid var(--border-default-grey);
  background-color: var(--background-default-grey);
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  padding: 1.5rem;
}

.alert-item__content {
  flex: 1;
  min-width: 0;
}

.alert-item__title {
  margin-bottom: 0.25rem;
}

.alert-item__excerpt {
  color: var(--text-mention-grey);
  display: -webkit-box;
  -webkit-line-clamp: 5;
  line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 700px;
  margin-bottom: 0.5rem;
}

.alert-item__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  flex-shrink: 0;
}

@media (max-width: 61.99em) {
  .alert-item {
    flex-direction: column;
    gap: 0.5rem;
  }

  .alert-item__meta {
    order: 1;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    width: 100%;
  }

  .alert-item__content {
    order: 2;
  }

  .alert-item__date {
    margin-top: 0;
  }
}

.alert-item__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
}

.alert-item__date {
  color: var(--text-mention-grey);
  margin-top: 0.9rem;
}

/* Liste des bulletins d'actualités */
@media (max-width: 61.99em) {
  .bulletin-list__description {
    display: none;
  }
}

.bulletin-list-container {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.bulletin-item {
  border: 1px solid var(--border-default-grey);
  background-color: var(--background-default-grey);
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  padding: 1.5rem;
}

.bulletin-list-container .fr-col-12 + .fr-col-12 .bulletin-item {
  border-top: none;
}

.bulletin-item__content {
  flex: 1;
  min-width: 0;
}

.bulletin-item__title {
  margin-bottom: 0.5rem;
}

.bulletin-item__date {
  color: var(--text-mention-grey);
  flex-shrink: 0;
}

@media (max-width: 61.99em) {
  .bulletin-item {
    flex-direction: column;
    gap: 0.75rem;
  }

  .bulletin-item__date {
    order: 1;
    width: 100%;
  }

  .bulletin-item__content {
    order: 2;
  }
}

/* Page de contenu statique (contact, etc.) */
.static-page-content h2 {
  font-size: 1.375rem;
  line-height: 1.75rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.static-page-content h2 strong {
  font-weight: inherit;
}

.static-page-content h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.static-page-content .quoted {
  border-left: 4px solid var(--border-default-blue-france);
  margin: 0.75rem 0 0.75rem 1.5rem;
  padding: 0.75rem 1rem;
}

.static-page-content .quoted p:last-child,
.static-page-content .quoted ul:last-child {
  margin-bottom: 0;
}

.static-page-content table[role="presentation"] {
  border: 0;
  width: 100%;
}

/* Tableaux dans le contenu markdown des publications (fiches réflexes, avis, alertes…) */
.article section table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.article section table thead th {
  background-color: var(--background-alt-grey);
  border: 1px solid var(--border-default-grey);
  padding: 0.625rem;
  font-weight: 700;
  text-align: left;
  vertical-align: middle;
}

.article section table tbody td {
  border-bottom: 1px solid var(--border-default-grey);
  padding: 0.625rem;
  vertical-align: middle;
}

/* Tableaux de données des pages CSIRT (ministériels, sectoriels, territoriaux) */
.csirt-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  border: 1px solid var(--border-default-grey);
}

.csirt-table th,
.csirt-table td {
  border: 1px solid var(--border-default-grey);
  padding: 0.75rem;
  vertical-align: middle;
  text-align: left;
}

.csirt-table thead th {
  background-color: var(--background-alt-grey);
  font-weight: 700;
}

/* Tableau 30/70 – première colonne étroite (libellés), seconde large */
table.table-30-70 td:nth-child(1) {
  width: 30%;
}

table.table-30-70 td:nth-child(2) {
  width: 70%;
}

.static-page-content a {
  color: var(--text-action-high-blue-france);
}

.static-page-content a[style] {
  color: var(--text-action-high-blue-france) !important;
}

.static-page-content a[style] span[style] {
  color: var(--text-action-high-blue-france) !important;
}

.static-page-content p {
  margin-bottom: 0.75rem;
}

.static-page-content ul {
  padding-left: 1.5rem;
}

.static-page-content ul li {
  margin-bottom: 0.5rem;
}

.static-page-content .fr-alert {
  margin-top: 2rem;
}

/* Pages de publications (advisory, alert, factsheet, etc.) – liens dans le contenu */
.article section a:not([class]) {
  color: var(--text-action-high-blue-france);
}

/* Notices "Mise à jour" dans le contenu des publications */
.article .important-content {
  color: var(--text-default-warning);
}

/* Code inline <code> dans le contenu des publications — style "encadré" inspiré de <pre> */
.article :not(pre) > code {
  background-color: var(--background-contrast-grey);
  border: 1px solid var(--border-default-grey);
  padding: 0.1em 0.35em;
  font-family: monospace;
  font-size: 0.8125rem;
  border-radius: 2px;
  white-space: nowrap;
}

/* Blocs de code <pre> dans le contenu des publications */
.article pre {
  background-color: var(--background-contrast-grey);
  border-left: 4px solid var(--border-default-grey);
  padding: 1rem;
  overflow-x: auto;
  font-family: monospace;
  font-size: 0.8125rem;
  line-height: 1.5;
  white-space: pre;
  word-break: normal;
}

/* Listes dans le contenu markdown des publications :
   - padding aligné sur le site d'origine (2.5rem ≈ 40px navigateur)
   - les fr-list restent inchangées (elles redéfinissent --ul-start elles-mêmes) */
.article section ul:not(.fr-list),
.article section ol:not(.fr-list) {
  padding-inline-start: 2.5rem;
}

/* Indentation des listes Systèmes affectés / Risques (fr-list dans article) */
.article section .fr-list {
  padding-inline-start: 2.5rem;
}

/* Sous-puces du contenu markdown : <ul> frères d'un <ol> ou après un <pre>
   (marko génère des <ul> frères au lieu de les imbriquer quand les puces
   sont à la colonne 0 dans la source) */
.publication-content ol + ul:not(.fr-list),
.publication-content pre + ul:not(.fr-list) {
  margin-inline-start: 2rem;
}

/* Center the download buttons of publications */
.publication-content p:has(> a.fr-btn--incident) {
  text-align: center;
}

/* Restrict size of images and center them in publications */
.publication-content p > img {
  max-width: 100%;
  display: block;
  margin-inline: auto
}

/* Removes the default bullet if a li has a checkbox */
.publication-content li:has(> input[type="checkbox"]) {
  list-style: none;
}

/* Style download button */
.publication-content a.download_report {
    background-color: #c4322c;
    padding: 0.5em;
    color: #ffffff;
    background-image: none;
    text-decoration: none;
    transition: background-color 0.2s ease;
}
.publication-content a.download_report:hover,
.publication-content a.download_report:focus-visible {
    background-color: #a32822;
    text-decoration: underline;
}
.publication-content a.download_report:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
}

.publication-content .encart-gris {
    border: 2px solid black;
    background-color: lightgray;
    margin-left: 1em;
    padding: 1em;
}

ul.documentation-links li > p {
  margin-bottom: 0.1rem;
}

ul.documentation-links li > a::after {
  content: none !important;
}

/* Tableau Gestion du document – séparateurs horizontaux entre lignes */
.meta-table {
  overflow-x: auto;
}

.meta-table table {
  border-collapse: collapse;
  width: 100%;
}

.meta-table table tbody tr {
  border-bottom: 1px solid var(--border-default-grey);
}

.meta-table table tbody tr:first-child {
  border-top: 1px solid var(--border-default-grey);
}

.meta-table table tbody tr th {
    font-weight: normal;
    text-align: left;
}

.meta-table table tbody tr td {
  padding: 0.75rem 0.5rem;
  vertical-align: top;
}

.meta-table table tbody tr td:last-child {
  font-weight: 700;
}

/* Tableau de vulnérabilités (bulletin item) */
.vuln-table {
  border-top: 1px solid var(--border-default-grey);
  margin-bottom: 2rem;
}

.vuln-entry {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border-default-grey);
  background-color: var(--background-default-grey);
}

.vuln-entry__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.vuln-entry__left,
.vuln-entry__right {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin: 0;
  padding: 0;
}

/* Badge et colonne droite partagent la même cellule de grille */
.vuln-entry__right {
  grid-column: 2;
  grid-row: 1;
}

.vuln-entry__field {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.vuln-entry__field dt {
  color: var(--text-mention-grey);
  font-size: 0.875rem;
  min-width: 9rem;
  flex-shrink: 0;
}

.vuln-entry__field dd {
  margin: 0;
  font-size: 0.875rem;
  word-break: break-word;
}

.vuln-entry__badge {
  display: flex;
  align-items: flex-start;
  pointer-events: none;
}

.vuln-entry__badge:empty {
  display: none;
}

.vuln-entry__badge .fr-badge {
  text-transform: none;
}

.vuln-entry__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.vuln-entry__toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--text-action-high-blue-france);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.vuln-entry__toggle .fr-icon-arrow-right-s-line {
  display: inline-block;
  transition: transform 0.2s ease;
}

.vuln-entry__toggle[aria-expanded="true"] .fr-icon-arrow-right-s-line {
  transform: rotate(90deg);
}

.vuln-entry__preview {
  display: none;
}

.vuln-entry--collapsed .vuln-entry__preview {
  display: block;
}

.vuln-entry--collapsed .vuln-entry__body {
  display: none;
}

.vuln-entry__field--editeur {
  align-items: flex-start;
}

.vuln-entry__field--editeur .vuln-entry__editeur-links {
  flex: 1 1 0;
  min-width: 0;
}

.vuln-entry__editeur-links {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1rem;
  padding: 0;
}

.vuln-entry__editeur-links a::after {
  display: none !important;
}

@media (max-width: 62em) {
  .vuln-table {
    border-top: none;
  }

  .vuln-entry {
    border-bottom: none;
    background-color: var(--background-default-grey);
    border: 1px solid var(--border-default-grey);
    border-radius: 0.25rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
  }

  .vuln-entry__grid {
    grid-template-columns: 1fr;
  }

  .vuln-entry__right {
    grid-column: auto;
    grid-row: auto;
  }
}

.static-page-content {
  /* Labels TLP/PAP — fond noir, couleur selon niveau */
  .tlp-label {
    display: inline-block;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.8em;
    font-weight: 700;
    padding: 0.1em 0.4em;
    background-color: #000;
    border-radius: 2px;
    line-height: 1.5;
    white-space: nowrap;
    letter-spacing: 0.02em;
  }
  .tlp-clear { color: #ffffff; }
  .tlp-green { color: #00b050; }
  .tlp-amber { color: #ffc000; }
  .tlp-red   { color: #ff2b2b; }

  .pap-clear { color: #ffffff; }
  .pap-green { color: #00b050; }
  .pap-amber { color: #ffc000; }
  .pap-red   { color: #ff2b2b; }

  .tlp-label-small {
    font-size: 0.7em;
  }
  .table-td-grey {
    background-color: lightgray;
  }
}

/* Home — CTA sections : bouton en desktop, lien en mobile (< 48em) */
.home-cta-link { display: none; }

@media (max-width: 47.9375em) {
  .home-cta-btn { display: none; }
  .home-cta-link {
    display: inline-flex;
    width: 100%;
    justify-content: center;
    --underline-idle-width: 0;
  }
}
