/* GSR auto-index theming. Wraps Apache mod_autoindex's <table id="indexlist">
   output in portal-styled chrome so directory pages below the per-PI page
   feel "in family". Loaded in addition to portal.css.
   Activated by IndexOptions/IndexStyleSheet/HeaderName/ReadmeName in each
   per-PI .htaccess. */

body.portal.autoindex {
  background: var(--paper-200);
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  color: var(--ink-900);
}

.autoindex-main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 28px 48px;
}

/* Breadcrumb bar — JS-built from window.location.pathname */
.crumbs {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-500);
  margin: 0 0 16px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--border-200);
  border-radius: 4px;
  word-break: break-all;
}
.crumbs a {
  color: var(--pine-700);
  text-decoration: none;
}
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep { color: var(--ink-300); margin: 0 4px; }
.crumbs .last { color: var(--ink-900); font-weight: 600; }

/* Apache table */
table#indexlist {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--border-200);
  border-radius: 4px;
  overflow: hidden;
  font-size: 13px;
  table-layout: auto;
}
table#indexlist tr.indexhead {
  background: var(--paper-300);
  color: var(--ink-700);
}
table#indexlist tr.indexhead th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-display);
  border-bottom: 1px solid var(--border-200);
  white-space: nowrap;
}
/* Hide Apache's <hr>-divider row (we already have border-bottom on the head) */
table#indexlist tr.indexbreakrow { display: none; }

table#indexlist tr.even { background: #fff; }
table#indexlist tr.odd  { background: var(--paper-100); }
table#indexlist tr.even:hover,
table#indexlist tr.odd:hover {
  background: var(--pine-50);
}

table#indexlist td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-100);
  vertical-align: middle;
}
table#indexlist tr:last-child td { border-bottom: 0; }

table#indexlist td.indexcolicon {
  width: 32px;
  padding-right: 0;
  color: var(--ink-300);
  font-family: var(--font-mono);
  font-size: 11px;
}
/* Apache emits an <img> when SuppressIcon is off; we use SuppressIcon
   so the cell is empty — keep narrow column for layout consistency. */
table#indexlist td.indexcolicon img { display: none; }

table#indexlist td.indexcolname {
  font-family: var(--font-mono);
  font-size: 12.5px;
  word-break: break-all;
}
table#indexlist td.indexcolname a {
  color: var(--ink-900);
  text-decoration: none;
}
table#indexlist td.indexcolname a:hover {
  color: var(--pine-700);
  text-decoration: underline;
}

table#indexlist td.indexcollastmod,
table#indexlist td.indexcolsize {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-500);
  white-space: nowrap;
}
table#indexlist td.indexcolsize { text-align: right; }

/* Description column — we don't surface anything here, hide it */
table#indexlist th.indexcoldesc,
table#indexlist td.indexcoldesc { display: none; }

/* Footer help block */
.autoindex-help {
  margin: 24px 0 0;
  font-size: 12.5px;
  color: var(--ink-500);
  text-align: center;
  padding: 12px;
  background: var(--paper-100);
  border: 1px solid var(--border-100);
  border-radius: 4px;
}
.autoindex-help a {
  color: var(--pine-700);
  text-decoration: none;
}
.autoindex-help a:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .autoindex-main { padding: 16px 12px 32px; }
  table#indexlist td.indexcollastmod,
  table#indexlist th.indexcollastmod { display: none; }
}
