/* The pages' one stylesheet: the look of https://magentron.codeberg.page/, the dark banner header included; every image it names is a file of this folder */

/* The page colours as variables, light by default; the theme choice (data-theme) or the reader's system picks the dark set */
:root {
  --card-background: #ffffff;
  --card-border: #e0e0e0;
  --card-border-hover: #c9c9c9;
  --heading: #1a1d21;
  --link: #313131;
  --muted: #51585f;
  --page-background: #f5f5f5;
  --rule: #d6d6d6;
  --text: #51585f;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --card-background: #25232a;
  --card-border: #444746;
  --card-border-hover: #6c6f70;
  --heading: #e6e1e5;
  --link: #a8c7fa;
  --muted: #c9c5ca;
  --page-background: #1c1b1f;
  --rule: #444746;
  --text: #c9c5ca;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --card-background: #25232a;
    --card-border: #444746;
    --card-border-hover: #6c6f70;
    --heading: #e6e1e5;
    --link: #a8c7fa;
    --muted: #c9c5ca;
    --page-background: #1c1b1f;
    --rule: #444746;
    --text: #c9c5ca;
    color-scheme: dark;
  }
}

/* The page: the reference's soft grey, Tahoma and Helvetica text and a top strip that continues the banner */
body {
  background: url(assets/images/background-top-bg.jpg) repeat-x var(--page-background);
  color: var(--text);
  font-family: Tahoma, Helvetica, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0;
  padding: 0;
}

/* Links stay underlined so they read as links in either scheme */
a {
  color: var(--link);
  text-decoration: underline;
}

/* A visible focus ring for keyboard users */
a:focus-visible {
  border-radius: 2px;
  outline: 2px solid #16a34a;
  outline-offset: 3px;
}

/* The page's own content stays a modest column, with a gutter, under the full-width banner; the wrapper holds the whole page so the banner image runs to its full height */
.page > header,
.page > main,
.page > footer {
  box-sizing: border-box;
  margin-left: auto;
  margin-right: auto;
  max-width: 42rem;
  width: calc(100% - 2rem);
}

/* header-container begin: the same text in style.css and in the home page's home.css, held so by tool/test/website_test.dart */

/* The banner behind the header: the reference's dark strip, centred at the top of the page */
.page-wrapper {
  background: url(assets/images/background-top.jpg) no-repeat center 0;
}

/* The header: the Magentron logo on the left, the subtitle on the right */
.header-container {
  box-sizing: border-box;
  margin: 0 auto;
  max-width: 100%;
  padding: 50px 0 10px 0;
  width: 950px;
}

.header {
  margin: 0 auto;
  padding: 0 0 25px 0;
  position: relative;
  text-align: right;
  width: 100%;
  z-index: 10;
}

/* The logo is positioned by its own image, as on the reference, so the link is drawn around the image */
.header a.logo {
  display: block;
  float: left;
  height: 54px;
  margin: 18px 0 0 24px;
  text-decoration: none;
  width: 0;
}

.header a.logo img {
  display: block;
  height: 54px;
  left: 0;
  position: absolute;
  top: 0;
  width: 229px;
}

.header a.logo:focus-visible {
  outline: none;
}

.header a.logo:focus-visible img {
  outline: 2px solid #16a34a;
  outline-offset: 3px;
}

/* The subtitle keeps the reference's 14px text size, line height and top padding, which place its image 94px down at 1300px wide */
.header .subtitle {
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 6px;
  padding: 15px 0 0;
  position: absolute;
  right: 30px;
  top: 20px;
}

.header .subtitle img {
  height: 10px;
  max-width: none;
  width: 453px;
}

.header-container::after,
.header::after {
  clear: both;
  content: "";
  display: block;
  height: 0;
}

/* The page is the positioning context of the theme button, which sits in the top right corner of the page itself */
.page {
  position: relative;
}

/* The theme button: one button cycling automatic, light and dark, shown only when the page's script runs */
.theme-toggle {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(159, 208, 255, 0.45);
  border-radius: 6px;
  color: #9fd0ff;
  cursor: pointer;
  display: none;
  height: 28px;
  padding: 4px;
  position: absolute;
  right: 30px;
  top: 12px;
  width: 28px;
  z-index: 20;
}

html.js .theme-toggle {
  display: block;
}

.theme-toggle:hover {
  background: rgba(159, 208, 255, 0.2);
}

.theme-toggle:focus-visible {
  outline: 2px solid #16a34a;
  outline-offset: 2px;
}

/* Only the icon of the current state shows: automatic unless the html element says light or dark */
.theme-toggle svg {
  display: none;
  height: 100%;
  width: 100%;
}

.theme-toggle .icon-auto,
html[data-theme="light"] .theme-toggle .icon-light,
html[data-theme="dark"] .theme-toggle .icon-dark {
  display: block;
}

html[data-theme] .theme-toggle .icon-auto {
  display: none;
}

@media all and (max-width: 949px) {
  .header-container {
    overflow-x: hidden;
    width: 100%;
  }

  .header {
    width: 80%;
  }
}

@media all and (max-width: 919px) {
  .header .subtitle {
    left: 24px;
    right: auto;
    top: 64px;
  }

  .header .subtitle img {
    max-width: 100%;
    width: auto;
  }
}

/* header-container end */

/* The product header: the bundled logo above the product name, centred, every page; a one-cell grid, so the language row and the logo link share the cell and the row adds no height of its own */
.page > header {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  margin-bottom: 1.5rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  position: relative;
  text-align: center;
}

/* The logo, drawn from the bundled mark with the rounded corners of the reference */
.page > header > a img {
  border-radius: 0.8rem;
  height: 4rem;
  width: 4rem;
  margin-top: 10px;
}

/* The product name under the logo, in the reference's monospace title face */
.page > header > a p {
  color: var(--heading);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
}

/* The logo and the product name are one link to the app home page of the page's language, laid out as the header was before it was a link, in the grid cell it shares with the language row */
.page > header > a {
  align-items: center;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  grid-area: 1 / 1;
  text-decoration: none;
}

/* A subtle hover, a lighter link with no change of size or position */
.page > header > a:hover {
  opacity: 0.8;
}

/* The language row comes before the logo in the page and shares its grid cell: right aligned at the top, level with the logo, and above it in the stacking order so the logo link never covers the control or its panel */
.language-bar {
  align-self: start;
  display: flex;
  grid-area: 1 / 1;
  justify-content: flex-end;
  justify-self: stretch;
  z-index: 1;
}

/* The selector: a small bordered control, the positioning context of its panel */
.language-select {
  font-size: 0.9rem;
  line-height: 1.4;
  position: relative;
  text-align: left;
}

/* The control itself: the current language and a caret drawn by CSS, no script */
.language-select summary {
  background-color: var(--card-background);
  border: 1px solid var(--rule);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  padding: 0.25rem 0.75rem;
}

.language-select summary::-webkit-details-marker {
  display: none;
}

.language-select summary::after {
  border-bottom: 2px solid currentColor;
  border-right: 2px solid currentColor;
  content: "";
  display: inline-block;
  height: 0.4rem;
  margin-left: 0.5rem;
  transform: translateY(-0.15rem) rotate(45deg);
  width: 0.4rem;
}

.language-select[open] summary::after {
  transform: translateY(0.1rem) rotate(225deg);
}

/* Keyboard focus is visible on the control as on the links */
.language-select summary:focus-visible {
  outline: 2px solid #16a34a;
  outline-offset: 3px;
}

/* The opened list: a small panel below the control with the same border and background */
.language-select ul {
  background-color: var(--card-background);
  border: 1px solid var(--rule);
  border-radius: 6px;
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0.25rem 0.75rem;
  position: absolute;
  right: 0;
  white-space: nowrap;
  z-index: 20;
}

.language-select li {
  padding: 0.15rem 0;
}

/* The content: the card with the thin border of the reference's primary link */
main {
  background-color: var(--card-background);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  box-sizing: border-box;
  padding: 1rem 1.5rem 1.5rem;
}

/* The page's one heading */
h1 {
  color: var(--heading);
  font-size: 1.6rem;
  line-height: 1.25;
}

/* Section headings on the support page */
h2 {
  color: var(--heading);
  font-size: 1.2rem;
  margin-top: 1.5rem;
}

/* The store badges of the landing pages: unmodified official artwork in a centred row that wraps on a narrow screen, no filter and no opacity */
.store-badges {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: center;
  margin: 1rem 0 0;
}

.store-badges img {
  display: block;
  max-width: 100%;
  width: auto;
}

/* The Apple badge has no clear space of its own, so its height is the one the Google badge is matched to */
.store-badges .badge-app-store {
  height: 3rem;
}

/* The Google Play files carry clear space that differs by language: about 34% of the height in English, about 23% in Dutch and Spanish, so each is sized to show a badge as tall as the Apple one */
.store-badges .badge-google-play {
  height: 3.9rem;
}

html[lang="en-GB"] .store-badges .badge-google-play {
  height: 4.5rem;
}

/* The owner and effective date at the foot of a page */
footer {
  border-top: 1px solid var(--rule);
  font-size: 0.9rem;
  margin-top: 3rem;
  padding-top: 0rem;
  text-align: center;
  line-height: 1.2;
}

/* The app version in the footer is set in the monospace stack of the product name, at the footer's own size */
footer .version {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: inherit;
}

/* A visible email address is set in italics */
.email {
  font-style: italic;
}

/* The screenshots: a row that wraps, each picture at a phone's own proportions, with a hairline so a light screenshot is still a shape on a light page */
.screenshots {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  margin: 1rem 0;
}

.screenshots figure {
  margin: 0;
  max-width: 14rem;
  text-align: center;
}

.screenshots img {
  border: 1px solid var(--rule);
  border-radius: 0.75rem;
  display: block;
  height: auto;
  max-width: 100%;
  width: 100%;
}

.screenshots figcaption {
  font-size: 0.9rem;
  line-height: 1.3;
  margin-top: 0.5rem;
}
