/* autoindex.css - mobile-friendly nginx autoindex */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
  background: #fafafa;
  color: #222;
  line-height: 1.5;
}

h1 {
  font-size: 1.25rem;
  font-weight: 600;
  word-break: break-all;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #ddd;
  margin: 0 0 0.5rem;
}

hr {
  display: none;
}

pre {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 1rem;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
}

/* The big one: make links huge tap targets */
pre a {
  display: block;
  padding: 1rem 0.75rem;
  margin: 0.25rem 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  color: #0066cc;
  text-decoration: none;
  font-size: 1.0625rem;
  min-height: 44px;          /* Apple's recommended tap target */
  box-sizing: border-box;
  word-break: break-all;
  transition: background 0.1s;
}

pre a:active {
  background: #e6f0ff;
}

pre a:hover {
  background: #f0f7ff;
}

/* Parent dir link gets a visual cue */
pre a[href="../"]::before {
  content: "↰ ";
  font-weight: bold;
}

/* Hide the date/size text that follows each link in the <pre> */
/* (Optional - comment out if you want timestamps visible) */
@media (max-width: 600px) {
  pre {
    font-size: 0.95rem;
  }
}

@media (prefers-color-scheme: dark) {
  body {
    background: #1a1a1a;
    color: #e0e0e0;
  }
  h1 {
    border-color: #333;
  }
  pre a {
    background: #252525;
    border-color: #383838;
    color: #6db3ff;
  }
  pre a:active {
    background: #2d3a4f;
  }
  pre a:hover {
    background: #2a3142;
  }
}

pre {
  display: flex;
  flex-direction: column;
}
