:root {
  color-scheme: light;
  --page-padding: 8px;
  --link: #0000ee;
  --line: #9a9a9a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #fff;
  color: #000;
  font-family: "Times New Roman", Times, serif;
}

a {
  color: var(--link);
}

.hover-image {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: none;
  pointer-events: none;
}

.hover-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.has-preview .hover-image {
  display: block;
}

.index-page {
  position: relative;
  z-index: 1;
  width: fit-content;
  min-width: min(100vw, 640px);
  padding: var(--page-padding);
}

h1 {
  margin: 0 0 28px;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1;
}

.directory {
  border-collapse: collapse;
  font-size: 16px;
}

.directory thead {
  border-bottom: 1px solid var(--line);
}

.directory th,
.directory td {
  padding: 3px 10px;
  text-align: left;
  white-space: nowrap;
}

.directory th {
  padding-bottom: 10px;
  font-weight: 700;
}

.directory th:first-child,
.directory td:first-child {
  padding-left: 0;
}

.directory-row {
  position: relative;
}

.directory-row:hover {
  background: #fff;
}

.has-preview .directory thead,
.has-preview h1,
.has-preview hr,
.has-preview address {
  visibility: hidden;
}

.has-preview .directory-row {
  opacity: .0;
}

.has-preview .directory-row:hover {
  opacity: 1;
  background: #fff;
}

.file-icon {
  display: inline-block;
  width: 1ch;
  height: 1em;
  margin-right: 4px;
  vertical-align: baseline;
}

.file-icon::before {
  content: "+";
}

hr {
  margin: 12px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

address {
  font-size: 16px;
}

@media (max-width: 640px) {
  .index-page {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .directory {
    width: 100%;
    table-layout: fixed;
    font-size: 14px;
  }

  .directory th,
  .directory td {
    padding-right: 6px;
    font-size: inherit;
    line-height: 1.2;
    vertical-align: top;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .directory th:nth-child(1),
  .directory td:nth-child(1) {
    width: 34%;
  }

  .directory th:nth-child(2),
  .directory td:nth-child(2) {
    width: 24%;
  }

  .directory th:nth-child(3),
  .directory td:nth-child(3) {
    width: 42%;
  }
}
