*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  font-weight: 300;
  color: #404040;
  background: white;
}

/* ---------- En-tête ---------- */
#page-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0 0.625rem;
}

#page-header h1 {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0.67em 0;
  overflow-wrap: anywhere;
}

#search {
  display: block;
  width: 16rem;
  max-width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  line-height: 1.25;
  color: #464a4c;
  background-color: #fff;
  background-image: none;
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 0.25rem;
  -webkit-appearance: textfield;
}

#search:focus {
  border-color: #3498db;
  outline: 0;
}

/* ---------- Tableau ---------- */
table {
  width: 100%;
  background: white;
  border: 0;
  border-collapse: collapse;
  table-layout: auto;
}

table thead { background: #efefef; }

table tr th,
table tr td {
  padding: 0.5625rem 0.625rem;
  font-size: 0.875rem;
  color: #222222;
  text-align: left;
  line-height: 1.125rem;
  vertical-align: middle;
}

table thead tr th {
  padding: 0.5rem 0.625rem 0.625rem;
  font-weight: bold;
}

table tr.even { background: whitesmoke; }

/* Les noms longs passent à la ligne au lieu d'élargir la page */
.indexcolname {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.indexcollastmod, .indexcolsize { white-space: nowrap; }

a {
  text-decoration: none;
  color: #3498db;
}

a:hover { text-decoration: underline; }
a:visited { color: #8e44ad; }

.img-wrap {
  vertical-align: middle;
  display: inline-block;
  margin-right: 8px;
  width: 16px;
  height: 16px;
}

.img-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
}

.img-wrap + a {
  display: inline;
  vertical-align: middle;
}

.hidden { display: none; }

/* ---------- Pied de page ---------- */
#site-footer {
  margin-top: auto;
  padding: 1.25rem 1rem;
  border-top: 1px solid #e5e5e5;
  background: #fafafa;
  color: #6b6b6b;
  font-size: 0.8125rem;
  line-height: 1.5;
  text-align: center;
}

#site-footer p {
  max-width: 60rem;
  margin: 0 auto;
}

/* ---------- Tablette ---------- */
@media (max-width: 800px) {
  .indexcoldesc { display: none; }
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  .indexcollastmod, .indexcoldesc { display: none; }

  h1 { font-size: 1.5em; }

  #page-header {
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 1em;
  }

  #page-header h1 { margin-bottom: 0; }

  #search {
    width: 100%;
    font-size: 16px; /* évite le zoom automatique sur iOS */
  }

  /* Lignes plus hautes : plus faciles à toucher */
  table tr td {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    font-size: 0.9375rem;
  }

  .indexcolsize {
    text-align: right;
    color: #777;
  }

  #site-footer { font-size: 0.75rem; }
}

@media (max-width: 400px) {
  h1 { font-size: 1.375em; }
}
