/* Modern styling for Apache's built-in directory listing. */
:root {
  color-scheme: light dark;
  --bg: #f3f5f9;
  --panel: #fff;
  --text: #202938;
  --muted: #687487;
  --line: #e3e8f0;
  --accent: #4169e1;
  --hover: #f0f5ff;
  --header: #f8faff;
  --input: #fff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151d; --panel: #1a202b; --text: #edf2fa;
    --muted: #a0adbf; --line: #303949; --accent: #9ab4ff;
    --hover: #222d40; --header: #202838; --input: #151b25;
  }
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0; padding: 34px 20px 24px; background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
.page { width: min(1120px, 100%); margin: 0 auto; }
.hero { padding: 10px 4px 25px; }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
h1 { margin: 8px 0 7px; font-size: clamp(28px, 4vw, 40px); line-height: 1.15; letter-spacing: -.035em; }
.hero p { margin: 0; color: var(--muted); }
.listing { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: 0 12px 32px rgba(22,35,60,.07); }
.listing-heading {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 14px; padding: 16px 20px; background: var(--header); border-bottom: 1px solid var(--line);
}
.listing-title { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.folder-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: var(--accent); background: var(--hover); font-size: 19px; }
.search-box {
  display: flex; align-items: center; gap: 8px; width: min(320px, 100%);
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--input);
}
.search-symbol { color: var(--muted); font-size: 21px; line-height: 1; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--text); background: transparent; font: inherit; }
.search-box button { visibility: hidden; border: 0; padding: 0 3px; color: var(--muted); background: transparent; font-size: 22px; cursor: pointer; }
.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.breadcrumbs a { color: var(--accent); text-decoration: none; overflow-wrap: anywhere; }
.breadcrumbs a:hover { text-decoration: underline; }
.crumb-separator { color: var(--muted); }
.current-crumb { margin-left: auto; font-size: 11px; opacity: .75; }
.search-status { padding: 7px 20px 0; color: var(--muted); font-size: 12px; }

#indexlist { width: 100%; border: 0; border-collapse: separate; border-spacing: 0; margin: 0; color: var(--text); table-layout: auto; }
#indexlist th { padding: 12px 16px; text-align: left; background: var(--panel); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
#indexlist th a { color: var(--muted); text-decoration: none; }

/* Force name column to take up all spare room, and keep metadata compact */
#indexlist th.indexcolname, #indexlist td.indexcolname { width: 100%; }
#indexlist th.indexcollastmod, #indexlist td.indexcollastmod,
#indexlist th.indexcolsize, #indexlist td.indexcolsize { white-space: nowrap; width: 1%; }

/* Hide the unused Description column */
#indexlist th.indexcoldesc, 
#indexlist td.indexcoldesc {
  display: none;
}

#indexlist td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
#indexlist tr:last-child td { border-bottom: 0; }
#indexlist tbody tr:hover td { background: var(--hover); }
#indexlist tr[hidden] { display: none; }
#indexlist td.indexcolicon { width: 44px; padding-right: 0; text-align: center; }
#indexlist td.indexcolicon img, #indexlist td.indexcolicon svg { width: 22px; height: 22px; object-fit: contain; vertical-align: middle; }

#indexlist td.indexcolname { overflow-wrap: break-word; word-break: break-all; }
#indexlist td.indexcolname > a:not(.image-preview) { color: var(--text); font-weight: 600; text-decoration: none; display: inline; }
#indexlist td.indexcolname > a:not(.image-preview):hover { color: var(--accent); text-decoration: underline; }

#indexlist td.indexcollastmod, #indexlist td.indexcolsize { color: var(--muted); font-size: 13px; }

#indexlist img:not(.image-preview img) { width: 20px; height: 20px; object-fit: contain; vertical-align: middle; }
.image-preview { display: inline-flex; width: 42px; height: 42px; margin-right: 10px; vertical-align: middle; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: var(--header); flex-shrink: 0; }
.image-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.footnote { padding: 18px 4px 0; color: var(--muted); font-size: 12px; }

@media (max-width: 640px) {
  body { padding: 18px 10px; }
  .hero { padding: 8px 3px 18px; }
  .listing { border-radius: 12px; }
  .listing-heading { padding: 13px; }
  .search-box { width: 100%; }
  .breadcrumbs { padding: 10px 13px; }
  #indexlist th, #indexlist td { padding: 10px 8px; }
  #indexlist th.indexcolsize, #indexlist td.indexcolsize, #indexlist th.indexcoldesc, #indexlist td.indexcoldesc { display: none; }
  .image-preview { width: 34px; height: 34px; margin-right: 7px; }
}


/* Hide the generic header icon without shifting columns */
#indexlist th.indexcolicon img,
#indexlist th.indexcolicon svg {
    visibility: hidden;
}