/*
  From package.elm-lang.org's assets/style.css, Copyright (c) 2014-present, Evan
  Czaplicki, BSD-3-Clause (see LICENSE-package.elm-lang.org). Changed: fluid widths for
  phones, the Lamdera notes (.lamdera-note) and tables at the end, and the look: the
  Lamdera dashboard's colours (its Colors.elm themes, light and dark), Inter, and its
  header and footer bars.
*/

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/assets/fonts/InterVariable.woff2) format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url(/assets/fonts/InterVariable-Italic.woff2) format('woff2');
}

/* The dashboard's themeLight. --link is its teal darkened to read as text on white. */
:root {
  --bg: #ffffff;
  --bg2: #fbfbfb;
  --bg3: #f5f7f9;
  --bg4: #ebebeb;
  --text: #303943;
  --text-strong: #040404;
  --text-muted: #888888;
  --text-faint: #aaaaaa;
  --border: #ebebeb;
  --border-dark: #cccccc;
  --primary: #61b6cd;
  --primary-dark: #4196ad;
  --link: #2c7f96;
  --special: #9f54e9;
  --code-bg: #f5f7f9;
  --code-inline: rgba(48, 57, 67, 0.06);
  --target: rgba(97, 182, 205, 0.15);
  --warn-bar: #fce6cb;
  --warn-text: #7a3e00;
  --ok: #2f7a3a;
  --ok-bg: #f1f8ec;
  --ok-line: #98c37a;
  --ask: #8a5300;
  --ask-bg: #fdf6ec;
  --ask-line: #e0a24a;
  --bad: #b03a45;
  --bad-bg: #f6f4f9;
  --bad-line: #e06c75;
  --note-bg: #f5f7f9;
  --logo: url(/assets/lamdera-logo-dark.png);
  color-scheme: light;
}

/* The dashboard's themeDark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1b26;
    --bg2: #1f2335;
    --bg3: #24283b;
    --bg4: #292e42;
    --text: #c0caf5;
    --text-strong: #d5daf5;
    --text-muted: #7982a9;
    --text-faint: #565f89;
    --border: #2a2e42;
    --border-dark: #3b4261;
    --link: #61b6cd;
    --code-bg: #1f2335;
    --code-inline: rgba(192, 202, 245, 0.08);
    --target: rgba(97, 182, 205, 0.18);
    --warn-bar: #3a3024;
    --warn-text: #fce6cb;
    --ok: #a6d98a;
    --ok-bg: #1f2b25;
    --ok-line: #98c37a;
    --ask: #f2c27a;
    --ask-bg: #2e2920;
    --ask-line: #e0a24a;
    --bad: #f0a0a7;
    --bad-bg: #3b2733;
    --bad-line: #e06c75;
    --note-bg: #24283b;
    --logo: url(/assets/lamdera-logo-white.png);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #1a1b26;
  --bg2: #1f2335;
  --bg3: #24283b;
  --bg4: #292e42;
  --text: #c0caf5;
  --text-strong: #d5daf5;
  --text-muted: #7982a9;
  --text-faint: #565f89;
  --border: #2a2e42;
  --border-dark: #3b4261;
  --link: #61b6cd;
  --code-bg: #1f2335;
  --code-inline: rgba(192, 202, 245, 0.08);
  --target: rgba(97, 182, 205, 0.18);
  --warn-bar: #3a3024;
  --warn-text: #fce6cb;
  --ok: #a6d98a;
  --ok-bg: #1f2b25;
  --ok-line: #98c37a;
  --ask: #f2c27a;
  --ask-bg: #2e2920;
  --ask-line: #e0a24a;
  --bad: #f0a0a7;
  --bad-bg: #3b2733;
  --bad-line: #e06c75;
  --note-bg: #24283b;
  --logo: url(/assets/lamdera-logo-white.png);
  color-scheme: dark;
}

html, head, body {
  margin: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-size: 15px;
  font-feature-settings: 'cv11', 'ss01';
  color: var(--text);
  background: var(--bg);
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  overflow-wrap: break-word;
}

h1, h2, h3, h4 {
  font-weight: 600;
  color: var(--text-strong);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

p, li {
  line-height: 1.6em;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
a .light { color: var(--primary); }

a:focus-visible, input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

pre {
  margin: 0;
  padding: 12px;
  background-color: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow-x: auto;
}

img {
  max-width: 100%;
}



/* CENTER */

.center {
  width: 100%;
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 16px;
  box-sizing: border-box;
}

.main {
  flex: 1;
}



/* HEADER: the dashboard's bar (bg2, a 2px rule under it, nav links with a teal edge) */

.bar {
  background-color: var(--bg2);
  border-bottom: 2px solid var(--border);
  padding-left: 16px;
  padding-right: 16px;
}

.nav {
  max-width: 920px;
  min-height: 60px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 32px;
}

.logo {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  text-decoration: none;
  margin-right: auto;
}
.logo:hover { text-decoration: none; }

.logo-img {
  display: block;
  width: 124px;
  height: 20px;
  background-image: var(--logo);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: left center;
}

.logo-packages {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  padding-bottom: 1px;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
}

.nav-link {
  color: var(--text);
  border-left: 2px solid var(--primary);
  padding-left: 4px;
  line-height: 1.2;
}
.nav-link:hover { color: var(--text-strong); text-decoration: none; }
.nav-link-dashboard { border-left-color: var(--special); }

.crumbs {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}

.crumbs h1 {
  font-size: 22px;
  font-weight: 500;
  margin: 20px 0 4px;
  overflow-wrap: anywhere;
}
.crumbs a { color: var(--text-strong); }
.crumbs .segment:last-child { font-weight: 600; }
.spacey-char { margin: 0 8px; color: var(--text-faint); font-weight: 400; }

.header-underbar {
  background-color: var(--warn-bar);
  margin: 0;
}

.version-warning {
  max-width: 920px;
  margin: 0 auto;
  padding: 8px 16px;
  box-sizing: border-box;
  color: var(--warn-text);
}

.version-warning a {
  color: var(--warn-text);
  text-decoration: underline;
}



/* FOOTER: the dashboard's footer bar */

.footer {
  margin-top: 4em;
  background: var(--bg2);
  border-top: 2px solid var(--border);
  padding: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.footer-inner {
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.footer a { color: var(--text-muted); }
.footer a:hover { color: var(--text); }


.grey-link {
  color: var(--text-muted);
  text-decoration: underline;
  cursor: pointer;
}

.grey-link:hover {
  color: var(--text);
}


/* DOCUMENTATION */

.pkg-page {
  display: flex;
  align-items: flex-start;
}

.block-list {
  width: 600px;
  max-width: 100%;
  min-width: 0;
  flex: 0 1 600px;
}

.block-list-title {
  font-size: 3em;
  margin-bottom: 16px;
  overflow-wrap: anywhere;
}

.markdown-block h1 {
  margin-top: 2em;
  margin-bottom: 0.5em;
}

.docs-block {
  border-top: 1px solid var(--border);
  margin-top: 1em;
  margin-bottom: 2em;
}


.docs-header {
  white-space: pre;
  font-family: 'Source Code Pro', Consolas, "Liberation Mono", Menlo, Courier, monospace;
  padding-top: 10px;
  padding-bottom: 10px;
  overflow-x: auto;
}


.docs-comment {
  overflow: hidden;
  padding-left: 36px;
}

.docs-comment img {
  max-width: 500px;
}

.docs-unknown {
  color: var(--bad);
}

.problem {
  padding: 20px;
  background-color: var(--bg3);
  border-radius: 8px;
}

.markdown table {
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
}

.markdown th, .markdown td {
  border: 1px solid var(--border-dark);
  padding: 4px 8px;
}



/* ABOUT */


.pkg-about table {
  font-family: 'Source Code Pro', Consolas, "Liberation Mono", Menlo, Courier, monospace;
  width: 100%;
}

.pkg-about td {
  padding: 4px 0;
}

.about-section {
  margin-top: 2em;
  margin-bottom: 0.5em;
}



/* PACKAGE NAVIGATION */

.pkg-mobile-nav {
  display: none;
}


.pkg-nav {
  width: 200px;
  flex: 0 0 200px;
  padding: 20px;
  margin: 20px 0 20px 40px;
  border-left: 1px solid var(--border);
}

.pkg-nav h2 {
  margin-bottom: 0;
}

.pkg-nav h3.module-group {
  font-size: 1em;
  margin: 10px 0 4px;
  color: var(--text-muted);
}

.pkg-nav input {
  width: 100%;
  box-sizing: border-box;
  font-size: 1em;
  padding: 4px;
  margin: 10px 0;
  border: 1px solid var(--border-dark);
  border-radius: 6px;
}

.pkg-nav ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

.pkg-nav ul ul {
  list-style-type: none;
  margin: 0;
  padding-left: 20px;
}

.pkg-nav-module {
  font-family: 'Source Code Pro', Consolas, "Liberation Mono", Menlo, Courier, monospace;
  text-overflow: ellipsis;
}

.pkg-nav-module.selected {
  font-weight: bold;
  text-decoration: underline;
}

.pkg-nav-value {
  font-family: 'Source Code Pro', Consolas, "Liberation Mono", Menlo, Courier, monospace;
  text-overflow: ellipsis;
}

.pkg-nav-search-chunk {
  padding-bottom: 10px;
}



/* CATALOG */

.catalog-page {
  display: flex;
  align-items: flex-start;
}

.catalog {
  width: 600px;
  max-width: 100%;
  min-width: 0;
  flex: 0 1 600px;
}

.catalog input, .pkg-nav input, .list-filter {
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}

.catalog input {
  width: 100%;
  box-sizing: border-box;
  font-size: 1.5em;
  padding: 10px;
  outline: none;
  border: 1px solid var(--border-dark);
  border-radius: 8px;
  margin-top: 40px;
  margin-bottom: 10px;
}

.catalog input:focus {
  border-color: var(--primary);
}

.pkg-hint {
  padding: 20px;
  background-color: var(--bg3);
  border-radius: 8px;
}

.pkg-summary {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.pkg-summary h1 {
  margin: 0;
  font-size: 1.5em;
  display: inline-block;
  overflow-wrap: anywhere;
}

.pkg-summary-desc {
  margin: 0.5em 0;
}

.pkg-summary-alias {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9em;
}

.pkg-summary-hints {
  float: right;
  font-size: 1em;
  padding-top: 0.5em;
  color: var(--text-faint);
}

.pkg-summary-hints a {
  color: var(--text-faint);
}

.old-results h2 {
  margin-top: 2em;
}

[hidden] {
  display: none !important;
}



/* CATALOG SIDEBAR */


.catalog-sidebar {
  width: 200px;
  flex: 0 0 200px;
  padding: 20px;
  margin: 20px 0 20px 40px;
  border-left: 1px solid var(--border);
}

.catalog-sidebar h2 {
  font-size: 1.5em;
  padding: 10px;
  margin: 0;
}

.catalog-sidebar ul {
  list-style-type: none;
  margin: 0;
  padding-left: 20px;
  padding-bottom: 10px;
}



/* VERSIONS */

.pkg-overview table.versions {
  border-collapse: collapse;
  width: 100%;
  max-width: 600px;
}

.pkg-overview th {
  text-align: left;
  font-weight: normal;
  color: var(--text-muted);
  padding: 4px 16px 4px 0;
}

.pkg-overview td {
  padding: 4px 16px 4px 0;
  font-family: 'Source Code Pro', Consolas, "Liberation Mono", Menlo, Courier, monospace;
}

.pkg-overview tr.major td:first-child a {
  font-weight: bold;
}

.pkg-overview tr.major td {
  border-top: 1px solid var(--border);
}

.light-cell {
  color: var(--text-muted);
}

.status {
  font-family: inherit;
  font-size: 0.9em;
  color: var(--text-muted);
}

.status-verified, .status-verified a { color: var(--ok); }
.status-prompt, .status-prompt a { color: var(--ask); }
.status-unavailable, .status-unavailable a { color: var(--bad); }



/* LAMDERA NOTES */

.lamdera-notes {
  margin-top: 16px;
}

.lamdera-note {
  border-left: 4px solid var(--primary);
  background: var(--note-bg);
  padding: 8px 16px;
  margin-bottom: 12px;
  border-radius: 0 6px 6px 0;
}

.lamdera-note p {
  margin: 6px 0;
}

.lamdera-note-reroute-verified { border-left-color: var(--ok-line); background: var(--ok-bg); }
.lamdera-note-reroute-prompt { border-left-color: var(--ask-line); background: var(--ask-bg); }
.lamdera-note-unavailable { border-left-color: var(--bad-line); background: var(--bad-bg); }
.lamdera-note-missing { border-left-color: var(--border-dark); background: var(--bg3); }

.lamdera-note-details {
  font-size: 0.9em;
  color: var(--text-muted);
}

.lamdera-note code, .prose code, .flags code {
  overflow-wrap: anywhere;
}

ul.flags {
  margin: 6px 0;
  padding-left: 20px;
}



/* PROSE PAGES (about, reroutes, help) */

.prose {
  max-width: 700px;
}

.prose h1 {
  font-size: 2.5em;
  margin-bottom: 16px;
}

.prose h2 {
  margin-top: 2em;
}

.plain-list {
  padding-left: 0;
  list-style-type: none;
}

.plain-list li {
  margin: 4px 0;
}

.list-filter {
  width: 100%;
  box-sizing: border-box;
  font-size: 1.1em;
  padding: 8px;
  border: 1px solid var(--border-dark);
  border-radius: 6px;
  margin: 16px 0 0;
}

.reroute-entry {
  border-top: 1px solid var(--border);
  padding: 8px 0;
}

.reroute-entry h3 {
  margin: 8px 0 4px;
  font-size: 1.1em;
}

.reroute-entry dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 2px 12px;
  margin: 4px 0;
  font-size: 0.9em;
}

.reroute-entry dt {
  color: var(--text-muted);
}

.reroute-entry dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

:target {
  background: var(--target);
}



/* CODE */


code {
  font-family: 'Source Code Pro', Consolas, "Liberation Mono", Menlo, Courier, monospace;
}

/* I heard using :not() is slow for reflows.
Not really any of those on the website though AFAIK.
*/
:not(pre) > code {
  padding: 0;
  padding-top: 0.2em;
  padding-bottom: 0.2em;
  margin: 0;
  font-size: 85%;
  background-color: var(--code-inline);
  border-radius: 3px;
}

:not(pre) > code::before, :not(pre) > code::after {
  letter-spacing: -0.2em;
  content: "\00a0";
}



/* PHONES */

/* Highlighted code: Solarized's token colours from highlight/default.css, on our ground
   (pre .hljs, as highlight/default.css loads after this file). */
pre .hljs, pre code {
  padding: 0;
  background: var(--code-bg);
  color: var(--text);
}

@media (max-width: 760px) {
  .pkg-page, .catalog-page {
    flex-direction: column;
    align-items: stretch;
  }

  .block-list, .catalog {
    width: 100%;
    flex: none;
  }

  .pkg-nav, .catalog-sidebar {
    width: auto;
    flex: none;
    margin: 24px 0 0;
    padding: 12px 0 0;
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .pkg-nav > ul:first-child {
    display: none;
  }

  .pkg-mobile-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-top: 16px;
  }

  .catalog input {
    margin-top: 20px;
  }

  .block-list-title {
    font-size: 2em;
  }

  .docs-comment {
    padding-left: 12px;
  }

  .docs-comment img {
    max-width: 100%;
  }

  .crumbs h1 {
    font-size: 18px;
  }

  .nav {
    padding: 12px 0;
    gap: 12px;
  }

  .logo {
    width: 100%;
  }

  .nav-links {
    gap: 8px 20px;
  }

  .spacey-char {
    margin: 0 4px;
  }
}

/* A lamdera/* package: the dashboard's purple, as on its admin link. */
.lamdera-note-lamdera { border-left-color: var(--special); }
