/* HGS Files: a shipping-label look. The one loud thing is the yellow tag;
   everything else is quiet navy on cool grey. */

:root {
  --bg: #e8eef3;
  --surface: #ffffff;
  --ink: #13233a;
  --steel: #56677c;
  --line: #cbd5df;
  --signal: #f5c431;
  --signal-ink: #13233a;
  --focus: #1f6feb;
  --alert: #b3261e;
  --font: "Bahnschrift", "DIN Alternate", "Barlow", "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1828;
    --surface: #15233a;
    --ink: #e4eaf1;
    --steel: #93a3b8;
    --line: #26364e;
    --focus: #6ea8ff;
    --alert: #ff8a80;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.5 var(--font);
  font-variant-numeric: tabular-nums;
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
[hidden] { display: none !important; }

/* --- The tag ----------------------------------------------------------- */
.tag {
  --notch: 18px;
  display: inline-flex; align-items: center; gap: 12px;
  padding: 8px 20px 8px calc(var(--notch) + 10px);
  background: var(--signal); color: var(--signal-ink);
  text-decoration: none;
  clip-path: polygon(var(--notch) 0, 100% 0, 100% 100%, var(--notch) 100%, 0 50%);
}
.tag__hole {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--bg); box-shadow: inset 0 0 0 2px rgba(19, 35, 58, .35);
}
.tag__text { font-weight: 700; font-stretch: condensed; font-size: 1.25rem; letter-spacing: .01em; }
.tag--big { --notch: 26px; padding: 14px 30px 14px 40px; }
.tag--big .tag__text { font-size: 2rem; }
.tag--big .tag__hole { width: 14px; height: 14px; }

/* --- Buttons and fields ------------------------------------------------ */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px;
  border: 2px solid var(--ink); border-radius: 6px;
  background: transparent; color: var(--ink);
  font: 600 .95rem var(--font); text-decoration: none; cursor: pointer;
}
.button--primary { background: var(--ink); color: var(--bg); }
.button--primary:hover { background: color-mix(in srgb, var(--ink) 85%, var(--bg)); }
.button--quiet { border-color: transparent; color: var(--steel); min-height: 36px; padding: 0 10px; }
.button--quiet:hover { color: var(--ink); }
.button:disabled { opacity: .45; cursor: not-allowed; }
input {
  width: 100%; min-height: 48px; padding: 0 14px;
  border: 2px solid var(--line); border-radius: 6px;
  background: var(--surface); color: var(--ink);
  font: 1rem var(--font);
}
input:focus { border-color: var(--ink); outline: none; }
input:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }

.alert {
  margin: 0 0 16px; padding: 10px 14px;
  border-left: 4px solid var(--alert); background: var(--surface); color: var(--ink);
}

/* --- Sign in ----------------------------------------------------------- */
.login { max-width: 25rem; margin: 12vh auto 48px; padding: 0 16px; }
.login__title { margin: 28px 0 4px; font-size: 1.6rem; line-height: 1.2; }
.login__lead { margin: 0 0 24px; color: var(--steel); }
.login__form { display: grid; gap: 6px; }
.login__form label { font-weight: 600; font-size: .9rem; margin-top: 10px; }
.login__form .button { margin-top: 22px; }

/* --- Masthead ---------------------------------------------------------- */
.masthead { border-bottom: 2px solid var(--ink); background: var(--bg); }
.masthead__inner {
  max-width: 68rem; margin: 0 auto; padding: 18px 16px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.masthead__count { margin: 0; color: var(--steel); }
.masthead__out { margin-left: auto; }

/* --- Search and tags --------------------------------------------------- */
.shelf { max-width: 68rem; margin: 0 auto; padding: 24px 16px 64px; }
.finder { display: flex; gap: 10px; }
.finder__input { flex: 1; font-size: 1.1rem; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; }
.chip {
  display: inline-block; padding: 4px 12px;
  border: 1.5px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink);
  font-size: .9rem; text-decoration: none;
}
.chip:hover { border-color: var(--ink); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip--small { padding: 1px 9px; font-size: .8rem; color: var(--steel); }

/* --- The list ---------------------------------------------------------- */
.list { margin-top: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.list__head, .row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 6.5rem 7.5rem 6.5rem 8.5rem;
  gap: 16px; align-items: start; padding: 14px 18px;
}
.list__head { border-bottom: 2px solid var(--ink); padding-block: 10px; }
.row + .row, .list__head + .row { border-top: 1px solid var(--line); }
.list__head + .row { border-top: none; }
.num { text-align: right; color: var(--steel); padding-top: 2px; }
.col-size, .col-date, .col-dl { text-align: right; }
.col-get { text-align: right; }

.sorter { color: var(--steel); text-decoration: none; font-weight: 600; font-size: .9rem; white-space: nowrap; }
.sorter:hover { color: var(--ink); }
.sorter.is-on { color: var(--ink); }
.sorter__arrow { margin-left: 4px; }

.row__name { font-weight: 600; font-size: 1.05rem; text-decoration: none; overflow-wrap: anywhere; }
.row__name:hover { text-decoration: underline; text-underline-offset: 3px; }
.row__desc { margin: 4px 0 0; color: var(--steel); max-width: 65ch; white-space: pre-line; }
.row__tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.row__unit { display: none; }
.button--get { min-height: 38px; padding: 0 14px; font-size: .9rem; }
.button--get:hover { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }

/* --- Folders ----------------------------------------------------------- */
.place {
  display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap;
  margin: 18px 0 0; padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 1.05rem; min-width: 0; }
.crumbs a { color: var(--steel); text-underline-offset: 3px; }
.crumbs a:hover { color: var(--ink); }
.crumbs [aria-current] { font-weight: 700; display: inline-flex; align-items: center; overflow-wrap: anywhere; }
.crumbs__sep { color: var(--line); font-weight: 700; }
.place__zip { margin-left: auto; }
.place__size { margin-left: 8px; font-weight: 400; color: var(--steel); }
.button--get:hover .place__size { color: inherit; }

.icon-folder {
  width: 1.15em; height: .92em; margin-right: 9px; flex: none;
  fill: color-mix(in srgb, var(--signal) 30%, var(--surface));
  stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round;
  vertical-align: -.08em;
}
.row--folder .row__name { display: inline-flex; align-items: center; }
.row--folder .col-dl { white-space: nowrap; }
.row__where { display: none; margin: 2px 0 0; font-size: .85rem; color: var(--steel); }
.row__where a { color: inherit; text-underline-offset: 2px; }
.list.is-searching .row__where { display: block; }

.list__empty { margin: 0; padding: 40px 18px; text-align: center; color: var(--steel); }
.list__empty a { color: var(--ink); }

/* --- Narrow screens ---------------------------------------------------- */
@media (max-width: 760px) {
  .list__head { grid-template-columns: repeat(4, auto); justify-content: start; gap: 14px; }
  .list__head .col-size, .list__head .col-date, .list__head .col-dl { text-align: left; }
  .list__head .col-get { display: none; }
  .row {
    grid-template-columns: auto auto auto 1fr;
    grid-template-areas: "name name name name" "size date dl get";
    gap: 6px 14px; align-items: center;
  }
  .row .col-name { grid-area: name; }
  .row .col-size { grid-area: size; }
  .row .col-date { grid-area: date; }
  .row .col-dl { grid-area: dl; }
  .row .col-get { grid-area: get; }
  .row .num { text-align: left; padding-top: 0; font-size: .9rem; }
  .row__unit { display: inline; }
  .finder__go { display: none; }
  .place__zip { margin-left: 0; }
}

@media (prefers-reduced-motion: no-preference) {
  .button, .chip, .sorter { transition: background-color .12s, border-color .12s, color .12s; }
}
