/*
 * Download page styles, laid out like the 7-Zip download page: grey menu column
 * on the left, content in the middle, version boxes on the right. Below 900px
 * the three columns stack.
 *
 * Author: Trinh Van Phuc
 * Task-ID: #3954
 */
:root {
  --text: #000;
  --muted: #555;
  --link: #00c;
  --menu: #000080;
  --side: #e0e0e0;
  --rule: #a0a0a0;
  --th: #99dd99;
  --td: #eeeeee;
  --box-head: #7f7fdf;
  --box-body: #fdf6f6;
}

/* Every text has a .ja and an .en version; lang.js sets lang-ja / lang-en on
   <html>. Without JavaScript neither class is set and Japanese is shown. */
html:not(.lang-en) .en,
html.lang-en .ja { display: none !important; }

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font: 13px/1.5 Tahoma, Verdana, "Meiryo", "Yu Gothic", sans-serif;
}

a { color: var(--link); }

.muted { color: var(--muted); }

.page {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 230px;
  gap: 0 24px;
  max-width: 1500px;
  margin: 0 auto;
  padding: 12px 16px;
}

/* --- left column --- */
.side {
  grid-row: span 2;
  background: var(--side);
  padding: 12px;
  align-self: start;
  min-height: 420px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: bold;
  font-size: 12px;
  line-height: 1.25;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}
.logo img { flex: none; }
.menu, .langs {
  list-style: none;
  margin: 12px 0;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--rule);
}
.menu li { margin: 2px 0; }
.menu a {
  color: var(--menu);
  font-weight: bold;
  text-decoration: none;
}
.menu a:hover { text-decoration: underline; }

/* Language list as on 7-Zip: the current language is bold plain text, not
   underlined; the other one is a link. */
.langs li { margin: 1px 0; }
html:not(.lang-en) .langs a[data-lang="ja"],
html.lang-en .langs a[data-lang="en"] {
  color: var(--text);
  font-weight: bold;
  text-decoration: none;
  cursor: default;
}

/* --- middle column --- */
.content { min-width: 0; }
h1 {
  text-align: center;
  font-size: 20px;
  margin: 8px 0 16px;
}
h2 {
  text-align: center;
  font-size: 16px;
  margin: 24px 0 8px;
}
.dl-title { font-weight: bold; margin: 16px 0 8px; }

.table-wrap { max-width: 100%; overflow-x: auto; }

table.dl {
  border-collapse: separate;
  border-spacing: 2px;
  margin: 0 0 8px;
}
table.dl th {
  background: var(--th);
  padding: 5px 14px;
  font-weight: bold;
  white-space: nowrap;
}
table.dl td {
  background: var(--td);
  padding: 5px 14px;
  text-align: center;
  white-space: nowrap;
}
table.dl td.scope { text-align: left; white-space: normal; min-width: 180px; }

.notes { margin: 8px 0 0; }
.notes-label { font-weight: bold; }

#history-list dt { font-weight: bold; margin-top: 8px; }
#history-list dd { margin: 0 0 0 16px; white-space: pre-line; }

/* The footer is its own grid cell: on desktop it sits under the middle column
   like 7-Zip; on phones it comes last (after the version boxes) instead of in
   the middle. */
footer {
  grid-column: 2;
  margin-top: 28px;
  border-top: 1px solid var(--rule);
  padding-top: 6px;
  font-size: 12px;
}
footer p { margin: 2px 0; }

.error { color: #b3261e; font-weight: bold; }

/* --- right column --- */
.versions { align-self: start; padding-top: 16px; }
.vbox {
  border: 1px solid #c8c8f0;
  margin-bottom: 16px;
}
.vbox-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  background: var(--box-head);
  color: #fff;
  font-weight: bold;
  padding: 3px 6px;
}
.vbox-body {
  background: var(--box-body);
  padding: 3px 6px;
  font-size: 12px;
}

/* --- narrow screens: stack the columns --- */
@media (max-width: 900px) {
  .page {
    grid-template-columns: minmax(0, 1fr);
    padding: 8px 16px;
  }
  .side { grid-row: auto; min-height: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
  .logo { border-bottom: 0; padding-bottom: 0; }
  .menu, .langs { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 0; border-bottom: 0; }
  .versions { padding-top: 0; }
  footer { grid-column: 1; margin-top: 8px; }
}
