/* Romagna Podismo - responsive mobile layout v2 */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media screen and (max-width: 800px) {
  html,
  body {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  body {
    margin: 0 !important;
    padding: 8px !important;
    box-sizing: border-box !important;
  }

  body > div[align="center"] {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  img,
  video,
  object,
  embed,
  svg {
    max-width: 100% !important;
    height: auto !important;
  }

  iframe,
  input,
  select,
  textarea,
  button {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  a,
  td,
  th {
    overflow-wrap: anywhere;
    word-break: normal;
  }

  td[nowrap],
  th[nowrap] {
    white-space: normal !important;
  }

  /* Le grand tableau historique devient un flux vertical de blocs. */
  table[id]:not(table table):not([width="10"]) {
    display: contents !important;
  }

  table[id]:not(table table):not([width="10"]) > tbody {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  table[id]:not(table table):not([width="10"]) > tbody > tr {
    display: contents !important;
  }

  table[id]:not(table table):not([width="10"]) > tbody > tr > td {
    display: block !important;
    order: 10;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 0 10px !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    white-space: normal !important;
  }

  /* Supprime les cellules utilisées uniquement comme cales. */
  table[id]:not(table table):not([width="10"]) > tbody > tr > td:not(:has(*)),
  table[id]:not(table table):not([width="10"]) > tbody > tr > td:has(> p:only-child):not(:has(a, img, table, script, font, b, span)),
  table[id]:not(table table):not([width="10"]) > tbody > tr > td[width="0"],
  table[id]:not(table table):not([width="10"]) > tbody > tr > td[width="5"],
  table[id]:not(table table):not([width="10"]) > tbody > tr > td[width="13"],
  table[id]:not(table table):not([width="10"]) > tbody > tr > td[width="15"],
  table[id]:not(table table):not([width="10"]) > tbody > tr > td[width="19"],
  table[id]:not(table table):not([width="10"]) > tbody > tr > td[width="20"],
  table[id]:not(table table):not([width="10"]) > tbody > tr > td[width="25"] {
    display: none !important;
    margin: 0 !important;
  }

  /* Éléments décoratifs et menu graphique desktop. */
  table[id]:not(table table):not([width="10"]) > tbody > tr > td:has(img[alt="Runners"]),
  table[id]:not(table table):not([width="10"]) > tbody > tr > td:has(script[src*="xaramenu"]) {
    display: none !important;
  }

  /* Logo puis navigation textuelle. */
  table[id]:not(table table):not([width="10"]) > tbody > tr > td:has(img[alt="Logo"]) {
    order: 1 !important;
    text-align: center !important;
    margin-bottom: 12px !important;
  }

  table[id]:not(table table):not([width="10"]) > tbody > tr > td:has(table#table11) {
    order: 2 !important;
  }

  /* La colonne des dernières mises à jour passe après le contenu. */
  table[id]:not(table table):not([width="10"]) > tbody > tr > td:has(table#table111[width="175"]) {
    order: 50 !important;
  }

  /* Navigation et listes latérales en grille lisible. */
  table#table11[width="150"],
  table#table11[width="175"],
  table#table111[width="175"] {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 8px !important;
    box-sizing: border-box !important;
    background: #99ccff !important;
    table-layout: auto !important;
  }

  table#table11[width="150"] > tbody,
  table#table11[width="175"] > tbody,
  table#table111[width="175"] > tbody {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
    width: 100% !important;
  }

  table#table11[width="150"] > tbody > tr,
  table#table11[width="175"] > tbody > tr,
  table#table111[width="175"] > tbody > tr {
    display: contents !important;
  }

  table#table11[width="150"] td,
  table#table11[width="175"] td,
  table#table111[width="175"] td {
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    padding: 7px 4px !important;
    box-sizing: border-box !important;
    text-align: center !important;
    white-space: normal !important;
  }

  /* Les autres tableaux internes restent des blocs autonomes. */
  table[id]:not(table table):not([width="10"]) table:not(#table11):not(#table111[width="175"]) {
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: auto !important;
  }

  table[id]:not(table table):not([width="10"]) table:not(#table11):not(#table111[width="175"]) td,
  table[id]:not(table table):not([width="10"]) table:not(#table11):not(#table111[width="175"]) th {
    min-width: 0 !important;
    max-width: 100% !important;
    white-space: normal !important;
  }

  /* Blocs internes de contenu, publicités et images larges. */
  table[id]:not(table table):not([width="10"]) table[width="200"],
  table[id]:not(table table):not([width="10"]) table[width="278"],
  table[id]:not(table table):not([width="10"]) table[width="320"],
  table[id]:not(table table):not([width="10"]) table[width="330"],
  table[id]:not(table table):not([width="10"]) table[width="368"],
  table[id]:not(table table):not([width="10"]) table[width="400"],
  table[id]:not(table table):not([width="10"]) table[width="503"],
  table[id]:not(table table):not([width="10"]) table[width="530"],
  table[id]:not(table table):not([width="10"]) table[width="550"],
  table[id]:not(table table):not([width="10"]) table[width="600"] {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
  }

  img[width="950"],
  img[width="728"],
  img[width="550"],
  img[width="500"],
  img[width="400"],
  img[width="364"],
  img[width="350"] {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }

  /* Les GIF transparents servaient uniquement à fabriquer des espacements. */
  img[src*="trasparente"] {
    display: none !important;
  }

  /* Les anciens widgets sociaux imposent une largeur fixe de 550 px. */
  table table:has(iframe[src*="facebook"]),
  table table:has(#fb-root) {
    display: none !important;
  }

  /* Le calendrier reste lisible avec un défilement limité à son bloc. */
  #table130 > tbody > tr > td:has(> table[width="600"]) {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
  }

  #table130 table[width="600"] {
    display: table !important;
    width: 720px !important;
    min-width: 720px !important;
    max-width: none !important;
    table-layout: auto !important;
  }

  #table130 table[width="600"] > tbody {
    display: table-row-group !important;
    width: auto !important;
    min-width: 0 !important;
  }

  /* Pied de page historique en lignes flexibles. */
  table[width="980"]:not([id]):not(table table) {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  table[width="980"]:not([id]):not(table table) > tbody {
    display: block !important;
  }

  table[width="980"]:not([id]):not(table table) > tbody > tr {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 8px !important;
  }

  table[width="980"]:not([id]):not(table table) > tbody > tr > td {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    text-align: center !important;
  }

  table[width="10"]:not(table table),
  #cookieChoiceInfo + table[width="10"] {
    display: none !important;
  }

  #cookieChoiceInfo {
    left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}
