/* The classic presentation of opencode native's site (classic/): a page about one screen across, a nav line of plain
   links, a column of text with the news beside it, Verdana for the text and Trebuchet for the headings, blue underlined
   links that turn purple once visited, thin grey rules; light and dark. The pages are made by occtools site changelog
   from the modern ones, so the modern classes that carry their content are made plain here. */

/* tokens */
:root {
  --bg: #ffffff;
  --fg: #1b1b1b;
  --muted: #5a5650;
  --rule: #b9b3aa;
  --link: #0645ad;
  --link-visited: #5b2a86;
  --accent: #c2560f;
  --code-bg: #f3f1ee;
  --box-bg: #f8f7f5;
  --font-body: Verdana, Geneva, "DejaVu Sans", sans-serif;
  --font-head: "Trebuchet MS", "Lucida Grande", "DejaVu Sans", sans-serif;
  --font-mono: "Courier New", "DejaVu Sans Mono", monospace;
  --gutter: 16px;
  --column: 62rem;
  --measure: 68ch;
  --news-width: 17rem;   /* the columns stack under 760px (a media query cannot read a variable) */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161514; --fg: #e8e4de; --muted: #a59f96; --rule: #4a4640;
    --link: #8ab4f8; --link-visited: #c58af9; --accent: #f08a3c; --code-bg: #24221f; --box-bg: #1d1c1a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #161514; --fg: #e8e4de; --muted: #a59f96; --rule: #4a4640;
  --link: #8ab4f8; --link-visited: #c58af9; --accent: #f08a3c; --code-bg: #24221f; --box-bg: #1d1c1a;
  color-scheme: dark;
}

/* the page */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 13px/1.5 var(--font-body);
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
  padding-block: 18px 28px;
  overflow-wrap: break-word;
}
.page { max-width: var(--column); margin: 0 auto; }
a { color: var(--link); }
a:visited { color: var(--link-visited); }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
img { max-width: 100%; height: auto; }
code { font-family: var(--font-mono); font-size: 0.95em; background: var(--code-bg); padding: 0 0.2em; overflow-wrap: anywhere; }
em { font-style: normal; color: var(--accent); }
.dim { color: var(--muted); }
.small { color: var(--muted); font-size: 0.92em; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: var(--gutter); top: 4px; background: var(--bg); padding: 0.2rem 0.5rem; z-index: 10; }

/* the masthead, the nav line and the footer */
.masthead { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
.masthead img { width: 48px; height: 48px; }
.masthead .name { font: bold 2.1rem/1 var(--font-head); letter-spacing: -0.01em; color: var(--fg); text-decoration: none; }
.masthead .tagline { font-style: italic; color: var(--muted); }
nav.site { margin-top: 0.6rem; padding-block: 0.35rem; border-block: 1px solid var(--rule); }
nav.site a { white-space: nowrap; }
nav.site a[aria-current="page"] { color: var(--fg); font-weight: bold; text-decoration: none; }
nav.site .sep { color: var(--muted); padding-inline: 0.25rem; }
.foot { margin-top: 1.4rem; padding-top: 0.4rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.92em; }
.foot p { margin: 0; max-width: none; }

/* text */
main { display: block; min-width: 0; margin-top: 1.1rem; }
h1, h2, h3 { font-family: var(--font-head); text-wrap: balance; }
h1 { font-size: 1.45rem; font-weight: normal; margin: 0 0 0.5rem; }
h2 { font-size: 1.15rem; margin: 1.4rem 0 0.35rem; }
h3 { font-size: 1rem; margin: 1rem 0 0.3rem; }
p { margin: 0 0 0.7rem; max-width: var(--measure); }
ul { margin: 0 0 0.7rem; padding-left: 1.3rem; max-width: var(--measure); }
li + li { margin-top: 0.2rem; }

/* the home: a text column and a news column */
.columns { display: grid; grid-template-columns: minmax(0, 1fr) var(--news-width); gap: 2rem; margin-top: 1.1rem; }
.columns main { margin-top: 0; }
.columns aside { border-left: 1px solid var(--rule); padding-left: 1.2rem; min-width: 0; }
.columns aside h2 { font-size: 1.35rem; margin-top: 0; letter-spacing: 0.04em; text-transform: uppercase; }
.columns aside ul { padding-left: 1.1rem; margin: 0.2rem 0 0; }
p.download a { font-weight: bold; }
.item { margin-bottom: 0.9rem; }
.date { font-family: var(--font-mono); color: var(--accent); font-weight: bold; }
.all { color: var(--muted); }
section.download h2 { border-bottom: 1px solid var(--rule); padding-bottom: 0.15rem; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0 1.5rem; }
.well h3 { margin-top: 0.4rem; }
.well p { margin-bottom: 0.3rem; }
a.btn { font-weight: bold; }
a.btn::after { content: " \00bb"; }
@media (max-width: 760px) {
  .columns { grid-template-columns: minmax(0, 1fr); }
  .columns aside { border-left: 0; border-top: 1px solid var(--rule); padding-left: 0; padding-top: 0.6rem; }
}

/* the features */
.card { margin: 0 0 0.9rem; max-width: var(--measure); }
.card h2 { border-bottom: 1px solid var(--rule); padding-bottom: 0.15rem; }

/* the screenshots: captures in a grid, the caption under each */
.shot { margin: 0 0 1rem; }
.shot .frame { display: block; border: 1px solid var(--rule); }
.shot .frame img { display: block; width: 100%; height: auto; }
.shot figcaption { margin-top: 0.3rem; font-size: 0.92em; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1rem; }
.gallery .shot { margin: 0; }

/* the screenshots' viewer (../gallery.js) */
button {
  font: inherit;
  color: var(--fg);
  background: var(--box-bg);
  border: 1px solid var(--rule);
  padding: 0.2rem 0.7rem;
  cursor: pointer;
}
.lightbox { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: var(--gutter); box-sizing: border-box; border: 0; background: var(--bg); color: var(--fg); }
.lightbox[open] { display: flex; flex-direction: column; gap: 0.6rem; }
html.lightbox-open { overflow: hidden; }
.lightbox-stage { position: relative; flex: 1 1 auto; min-height: 0; cursor: zoom-out; }
.lightbox-stage img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; max-width: none; object-fit: contain; }
.lightbox-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; border-top: 1px solid var(--rule); padding-top: 0.4rem; }
.lightbox-caption { flex: 1 1 20rem; margin: 0; }
.lightbox-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.lightbox-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.lightbox a.btn::after { content: none; }

/* the changelog's versions */
.filter { display: flex; align-items: center; gap: 0.8rem; margin: 0 0 0.6rem; max-width: var(--measure); }
.filter input { flex: 1; min-width: 0; font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--rule); padding: 0.15rem 0.3rem; }
.filter .small { white-space: nowrap; }
.release { border-top: 1px solid var(--rule); padding: 0.3rem 0 0.2rem; max-width: var(--measure); }
.release > summary { cursor: pointer; font-family: var(--font-head); }
.release .ver { font-weight: bold; font-size: 1.1rem; }
.release .date { margin-left: 0.6rem; }
.release .rel { margin-left: 0.6rem; font-family: var(--font-body); }
.release h3 { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0.6rem 0 0.2rem; }
.release li { overflow-wrap: anywhere; }
