/* Color variables */
:root {
  --blank: #fff;
  --offblank: #eee;
  --canvas: #ccc;
  --offcanvas: #aaa;
  --ink: #444;
  --offink: #666;
  --neutral: #66c;
  --active: #99f;
  --highlight: #b55;
  --offhighlight: #faa;
  --real-vh: 100vh;
  --bar: 4rem;
  --input: 3rem;
  --invert: 1;
  --noinvert: 0;
  --shadow: rgba(0,0,0,0.5);
}

@media (prefers-color-scheme: dark) {
  :root {
    --blank: #222;
    --offblank: #333;
    --canvas: #444;
    --offcanvas: #555;
    --ink: #ddd;
    --offink: #888;
    --invert: 0;
    --noinvert: 1;
    --shadow: rgba(0,0,0,0.75);
  }
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  /*
  overflow: hidden;
  */
  color: var(--offink);
  background-color: var(--blank);
}

#menu {
  transition: top 0.3s;
}

/* Typography */
@font-face {
  font-family: 'Lucida Grande';
  src: url('../fonts/LucidaGrande.eot');
  src: url('../fonts/LucidaGrande.eot?#iefix') format('embedded-opentype'),
    url('../fonts/LucidaGrande.woff2') format('woff2'),
    url('../fonts/LucidaGrande.woff') format('woff'),
    url('../fonts/LucidaGrande.ttf') format('truetype'),
    url('../fonts/LucidaGrande.svg#LucidaGrande') format('svg');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Lucida Grande';
  src: url('../fonts/LucidaGrande-Bold.eot');
  src: url('../fonts/LucidaGrande-Bold.eot?#iefix') format('embedded-opentype'),
    url('../fonts/LucidaGrande-Bold.woff2') format('woff2'),
    url('../fonts/LucidaGrande-Bold.woff') format('woff'),
    url('../fonts/LucidaGrande-Bold.ttf') format('truetype'),
    url('../fonts/LucidaGrande-Bold.svg#LucidaGrande-Bold') format('svg');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

body, input, textarea, select, option, button, .button {
  /*font-family: 'Lucida Sans Unicode', 'Lucida Grande', sans-serif;*/
  font-family: 'Lucida Grande', sans-serif;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink);
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  padding: 0.5em 0 0.5em;
  line-height: 1.2;
  color: var(--ink);
  font-weight: normal;
}

h1, .upper {
  text-transform: uppercase;
}

h1 {
  font-size: 2em;
}

h2 {
  font-size: 1.75em;
}

h3 {
  font-size: 1.4em;
}

h4 {
  font-size: 1.3em;
}

h5 {
  font-size: 1.2em;
}

h6 {
  font-size: 1.1em;
}

img {
  max-width: 100%;
  height: auto;
}

a:link, a:visited {
  color: var(--off);
  text-decoration: none;
}

a:hover, article a:hover {
  color: var(--active);
  text-decoration: none;
  cursor: pointer;
}

tr.link:hover, td.link:hover, .link.selected, .link:hover {
  opacity: 0.5;
  cursor: pointer;
}

article p a:link, article label a:link {
  text-decoration: underline;
}

iframe {
  border: none;
}

/* Source code, tables, indexes */
pre, .pre {
  max-height: 24rem;
  min-height: 8rem;
  overflow-x: hidden;
  overflow-y: auto;
  font-family: monospace;
  background-color: var(--canvas);
  padding: 1rem;
  margin: .5em 0;
  font-family: monospace;
}

pre.wrap, .wrap, .wrap * {
  overflow: visible;
  white-space: pre-wrap;
  word-wrap: break-word;
  /*display: block;*/
}

/* Navigation */
header {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--bar);
  background: linear-gradient(to right, rgba(0,0,255,.75), rgba(0,0,255,0) 100%),
    linear-gradient(to bottom, rgba(255,255,0,1), rgba(255,0,0,1) 100%);
  box-shadow: 0 .5rem 1rem 0 var(--shadow);
  z-index: 100;
}

footer {
  opacity: 0.75;
  font-size: .8rem;
  line-height: 2rem;
  padding: .5rem;
  /*border-top: 1px solid #000;*/
  margin-top: 1rem;
}

nav {
  height: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  
  /*max-width: 95rem;*/
  max-width: 1500px;
  margin: auto;
}

nav > * {
  display: flex;
  justify-content: center;
  align-items: center;
}

nav .logo {
  flex: 1;
  line-height: 0;
}

nav .logo img {
  max-height: 4rem;
  -webkit-filter: drop-shadow(0 0 .25rem #fff);
  filter: drop-shadow(0 0 .25rem #fff);
}

nav ul {
  display: none;
  /*position: fixed;*/
  position: absolute;
  top: var(--bar);
  margin: 0;
  padding: 0;
  width: 100%;
  list-style: none;
  background-color: var(--blank);

  box-shadow: 0 .5rem 1rem 0 var(--shadow);
  z-index: 101;
  
  max-height: 100vh;
  overflow: hidden;
}

nav a.toggle:focus, nav a.toggle:hover {
  color: var(--ink) !important;
  background-color: var(--blank);
  z-index: 103;
}

nav a.toggle img {
  filter: invert(1);
  padding: 0.25rem;
}

nav a.toggle:hover img, nav a.toggle:focus img {
  filter: none;
}

nav a.toggle:focus + ul {
  display: block;
}

nav a.toggle:hover + ul, nav ul:hover {
  display: block;
  z-index: 102;
}

.toggle {
  position: relative;
}

.cartitems {
  background-color: var(--neutral);
  color: var(--ink);
  font-weight: bold;
  text-align:center;
  font-size: 1rem;
  line-height: 1.75rem;
  top: .25rem;
  right:.25rem;
  position:absolute;
  width:1.5rem;
  height:1.5rem;
  border-radius:50%;
}

nav ul li {
  width: 100%;
  margin: 0;
  font-weight: bold;
  font-size: 1.25rem;
  height: 4rem;
  line-height: 4rem;
}

nav ul li img, .icon, .thumb {
  height: 1.75em;
  width: 1.75em;
  object-fit: contain;
  vertical-align: middle;
  min-width: 30px;
}

nav ul li a {
  white-space: nowrap;
  display: block;
  height: 4rem;
  padding: 0 1rem;
}

nav ul li a:hover {
  background-color: var(--neutral);
  color: var(--blank);
}

nav ul li img {
  filter: invert(var(--noinvert));
}

nav ul li a:hover img {
  filter: invert(var(--invert));
}

.grayscale {
  filter: grayscale(1);
}

.icon, .feature {
  filter: invert(var(--noinvert));
  opacity: 0.8;
}

.thumb {
  min-height: 3em;
  min-width: 3em;
  cursor: pointer;
}

.feature {
  width: 50%;
  padding: 1em
}

.fadeout {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 80%, transparent);
}

/* Detailed icons */
nav a.toggle {
  color: var(--canvas);
  background-color: transparent;
  border: none;
  width: 4rem;
  height: 4rem;
}

/* Inputs */
textarea, input, select, button, .button {
  padding: 0 1rem;
  margin: 0;
  border: none;
}

input, select, button, .button {
  display: inline-block;
  vertical-align: top;
  height: var(--input);
  line-height: var(--input);
}

input.nobg, .nobg:disabled {
  background: none !important;
  padding: 0;
  height: 1.2em;
}

button > *:not(img), .button > *:not(img) {
  display: none;
}

/* styling for numeric input */
input[type='number']::-webkit-outer-spin-button,
input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type='number'] {
  -moz-appearance:textfield;
}

input, textarea, select, .input {
  background-color: var(--offblank);
  width: 100%;
}

input:focus, textarea:focus, select:focus {
  /* rectangle highlight around text inputs */
  outline: none;
  background-color: var(--canvas);
}

input:disabled, textarea:disabled, select:disabled {
  background-color: var(--offcanvas) !important;
}

/* background color during auto-complete */
input:-webkit-autofill,
input:-webkit-autofill:hover:enabled, 
input:-webkit-autofill:active:enabled, 
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 30px var(--canvas) inset !important;
}

button, .button {
  background-color: var(--neutral);
  color: var(--blank) !important;
  white-space: nowrap;
  font-weight: bold;
}

button img, .button img {
  max-width: none;
  height: 1.5em;
  vertical-align: middle;
  filter: invert(var(--invert));
}

button:hover:enabled, button:active:enabled, button:focus,
.button:hover, .button:active, .button:focus {
  background-color: var(--active);
}

button:disabled, .button:disabled, button.disabled {
  background-color: var(--offink) !important;
}

.nobg, .nobg:hover, .nobg:active, .nobg:focus {
  background: none;
}

/* Radio and check boxes */
fieldset {
  margin: 0;
  padding: .5rem;
  border: none;
}

legend {
  /*margin-left: 2.5rem;*/
  font-size: 1.3em;
}

input[type='radio'], input[type='checkbox'] {
  vertical-align: middle;
  -webkit-appearance: none;
  appearance: none;

  margin: .5rem .25rem .25rem 0;
  width: 2rem;
  height: 2rem;
  position: relative;
}

td input[type='radio'], td input[type='checkbox'] {
  margin: 0;
}

input[type='radio']:checked::before,
input[type='checkbox']:checked::before {
  content: '';
  width: 1.5rem;
  height: 1.5rem;
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  background-color: var(--neutral);
}

input[type='radio'][disabled]:checked::before,
input[type='checkbox'][disabled]:checked::before {
  background-color: var(--offink) !important;
}

/* Hide legacy file upload controls */
input[type='file'] {
  display: none;
}

input[type='file']:enabled ~ label:hover {
  opacity: 0.5;
}

input[type='file']:disabled + label {
  background-color: var(--offink) !important;
}

/* Prevent manual resizing */
textarea {
  /*resize: none;*/
  padding: 1rem;
  max-width: 100%;
}

table {
  /*width: 100%;*/
  border-collapse: collapse;
}

td, th {
  padding: .25em .5em;
}

table img {
  min-width: 1em;
}

table tr {
  vertical-align: top;
}

table.middle, tr.middle, td.middle {
  vertical-align: middle;
}

hr, .hr {
  border-bottom: 1px solid var(--ink);
}

.vr {
  margin-left: 1.15rem;
  border-left: 2px solid var(--ink);
}

form {
  padding: 0;
  margin: 0;
}

aside {
  position: fixed;
  left: 50%;
  top: 50%;
  /*top: 5%;*/
  -webkit-transform: translate(-50%, -50%);
  -moz-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  -o-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);

  width: 100%;
  height: 100%;
  max-width: 600px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: .5rem .5rem 3rem .5rem;
  z-index: 1000;

  background-color: #fff;
  background-color: var(--blank);
  outline: max(100vw, 100vh) solid var(--shadow);
  box-shadow: 0 .5rem 1rem 0 rgba(0,0,0,0.5);
  box-shadow: 0 .5rem 1rem 0 var(--shadow);
}

aside:not(:last-child) {
  display: none;
}

article {
  top: 0;
  color: var(--off);
  margin: var(--bar) 0 0 0;
  width: 100%;
  padding: 1rem 1rem 3rem 1rem;
  background-color: var(--blank);
  min-height: calc(var(--real-vh) - var(--bar));
}

strike, .strike {
  text-decoration: line-through;
}

/* Generic utilities */
.row, .row-wrap, .row-flex, .row-two, .row-three, .row-four {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  width: 100%;
  clear: both;
}

.row-horizontal {
  display: inline-block;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  background-color: var(--offblank);
  height: 28em;
}

.row-horizontal > * {
  max-width: unset;
  width: auto;
  height: 100%;
  padding: 1em 1em 1em 0;
}

.row-horizontal > *:first-child {
  padding-left: 1em;
}

.row-flex {
  align-items: end;
}

.row-flex label, .flex {
  flex: 1;
}

.row-wrap, .row-two, .row-three, .row-four {
  flex-wrap: wrap !important;
}

.row-four > *, .row-two > *, .row-three > * {
  width: 100%;
}

.columns {
  column-count: 2;
}

.padded {
  padding: .5rem;
}

.padded-right {
  padding-right: .5rem;
}

.padded-left {
  padding-left: .5rem;
}

.center {
  text-align: center;
}

.left {
  text-align: left;
}

.right {
  text-align: right;
}

.circle {
  border-radius: 50%;
}

.debug {
  border: 1px solid red;
}

.honeypot {
  position:absolute;
  left: -200vw;
}

.nowrap, .nowrap * {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.noshow, .controls {
  display: none;
}

.hide {
  display: hidden;
}

.seventh {
  width: 14.28%;
}

.fifth {
  width: 20%;
}

.quarter {
  width: 25%;
}

.three-sevenths {
  width: 42.85%;
}

.third {
  width: 33.33%;
}

.half {
  width: 50%;
}

.four-sevenths {
  width: 57.14%;
}

.two-thirds {
  width: 66.66%;
}

.three-quarters {
  width: 75%;
}

.min {
  width: 2rem;
}

.full {
  width: 100%;
}

.small {
  font-size: 0.9em;
}

.medium {
  font-size: 1.2em;
}

.large {
  font-size: 2em;
}

.transparent {
  opacity: 0.25;
}

.countdown:before{
  content: url('../svg/clock.svg');
  position: absolute;
  height: 1.5em;
  width: 1.5em;
  transform: translate(-125%, 0%);
}

.countdown {
  display: inline-block;
  padding: .5em .5em .5em 2.5em;
  background-color: var(--ink);
  color: var(--blank);
  border-radius: .4em;
  font-weight: bold;
  font-family: sans-serif;
  opacity: 0;
}

.hidden {
  display: none;
}

.float-right {
  float: right;
}

.float-left {
  float: left;
}

.neutral-bg {
  background-color: var(--neutral);
  color: var(--blank);
  font-weight: bold;
}

.highlight {
  color: var(--highlight);
  font-weight: bold;
}

.highlight-bg, select.highlight-bg > * {
  background-color: var(--highlight);
  color: var(--blank);
  font-weight: bold;
}

.highlight-bg img, .neutral-bg img {
  filter: invert(var(--invert));
}

.highlight-bg:hover:enabled,
.highlight-bg:active:enabled,
.highlight-bg:focus {
  background-color: var(--offhighlight) !important;
}

.avatar {
  filter: none !important;
}

.stack {
  position: relative;
}

.stack > *:not(:first-child) {
  position: absolute;
  left: 0;
  top: 0;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  z-index: 1000;
}

.qrcode {
  border: 8px solid #fff;
}

.mono {
  font-family: monospace, monospace;
}

.page, footer, .module {
  max-width: 90rem;
  margin: 0 auto;  
  /*overflow: hidden;*/
  clear: both;
}

.page {
  width: 100%;
  /*min-height: 100vh;*/
}

.module {
  max-width: 35rem;
}

.pagination {
  display: inline-block;
}

.pagination a {
  display: table-cell;
  min-width: 3rem;
  text-align: center;
  font-size: 1.5rem;
  padding: .5rem;
}

.pagination a.disabled {
  opacity: 0.25;
  pointer-events: none;
}

.pgn {
  font-size: .75em;
  /*opacity: 0.5;*/
}

/*
h1 .pgn, h2 .pgn {
  display: none;
}
*/

progress {
  border-radius: 0; 
  width: 100%;
  height: 16px;
  padding: 4px;
  background-color: var(--offblank);
  color: var(--neutral);
}

progress::-moz-progress-bar {
  background: var(--neutral);
}

progress::-webkit-progress-value {
  background: var(--neutral);
}

#block {
  /*position: absolute;*/
  position: fixed;
  background-color: var(--shadow);
  filter: invert(1);
  z-index: 1001;
}

.product {
  margin: 0 -1rem 1rem -1rem;
  width: 100vw;
}

.product > .meta {
  padding: 0 1rem;
}

#chatbox {
  width: 100%;
  height: 100vh;
  right: 0em;
  bottom: 0em;
  background-color: var(--blank);
}

#chatcta {
  border-radius: 50%;
  background-color: var(--neutral);
  width: 6em;
  height: 6em;
  line-height: 6em;
  text-align: center;
  right: 2em;
  bottom: 2em;
}

#chatbox, #chatcta {
  position: fixed;
  box-shadow: 0 .5rem 1rem 0 var(--shadow);
  overflow: hidden;
  padding: 1em;
  z-index: 200;
}

.chat {
  max-height: 80vh;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.chat .conversation {
  width: 100%;
  height: calc(100vh - 6em);
  overflow-y: scroll;
  padding: 1em;
  border-bottom: none;
  background-color: var(--offblank);
}

.chat .conversation .message {
  white-space: pre-line;
  padding: .5em;
  margin: 0 .25em;
  background-color: var(--canvas);
}

.chat .conversation .poster {
  margin-top: 2em;
  margin-bottom: .5em;
}

.chat .inputs {
  height: 6em;
}

.chat .inputs * {
  height: 100%;
}

.chat textarea {
  width: 100%;
  height: 100%;
  min-height: 6em;
  resize: none;
  border-top: 1px solid var(--offcanvas);
}

/* Phone in landscape */
@media (max-height: 429px) and (max-width: 1280px) and (orientation: landscape) {
  .row-four > * {
    width: 50%;
  }

  button > *:not(img),
  .button > *:not(img) {
    display: inline-block;
  }

  .product {
    padding: 0;
    margin: 0 0 1rem 0;
  }

  .product > .image {
    float: left;
    display: block;
    width: 30%;
  }

  .product > .meta {
    float: left;
    display: block;
    width: 70%;
  }
}

/* Tablet in portrait */
@media (min-height: 430px) and (min-width: 600px) and (max-width: 1280px) {
  body {
    font-size: 0.9rem;
  }

  nav ul {
    width: 20rem;
  }

  nav .menu.rhs {
    right: 0;
  }

  aside {
    max-height: 500px;
    height: auto;
  }

  .row-four > * {
    width: 33.33%;
  }

  button > *:not(img),
  .button > *:not(img) {
    display: inline-block;
  }

  .row-three > * {
    width: 33.33%;
  }

  .product {
    margin: 0;
    padding: .5rem;
  }
}

@media (max-width: 799px) {
  .full-on-mobile {
    width: 100% !important;
  }
  
  .hide-on-mobile {
    display: none;
  }
}

@media (min-width: 800px) {
  #chatbox {
    width: 30em;
    height: auto;
    right: 2em;
    bottom: 2em;
  }

  #chatbox, #chatcta {
    z-index: 1;
  }

  #chatbox .chat {
    max-height: 60vh;
  }
}

/* Tablet in landscape */
@media (min-width: 1280px) and (orientation: landscape) {
  .row-four > * {
    width: 25%;
  }

  .row-three > * {
    width: 33.33%;
  }
  
  .row-two > * {
    width: 50%;
  }
 
  .columns {
    column-count:4;
  }

  nav .menu.rhs {
    right: 0;
  }

  button > *:not(img),
  .button > *:not(img) {
    display: inline-block;
  }
  
  .product {
    margin: 0;
    padding: .5rem;
  }
}

/* Laptop */
@media (min-height: 600px) and (min-width: 900px) {
  aside {
    padding: 1rem;
    top: 40%;
    max-height: 500px;
    height: auto;
  }

  .padded {
    padding: 1em;
  }
  
  .padded-right {
    padding-right: 1em;
  }
  
  .product {
    margin: 0;
    padding: .5rem;
  }
}

@media (min-width: 95rem) {
  nav .menu.rhs {
    margin-right: calc((100vw - 1500px - 1em)/2);
  }
  
  .product {
    margin: 0;
    padding: .5rem;
  }
}

/* Desktop */
@media (min-width: 1281px) {
  :root {
    --bar: 6rem;
  }

  body {
    font-size: 1rem;
  }

  nav {
    align-items: end;
  }

  nav .logo {
    justify-content: start;
  }

  nav ul {
    width: 20rem;
  }

  nav a.toggle.main {
    display: none;
  }

  nav .menu.main {
    display: flex !important;
    flex: 1;
    position: static;
    color: var(--blank);
    background-color: transparent;
    box-shadow: none;
    text-align: center;
    align-items: end;
  }

  nav .menu.main li img {
    display: none;
  }

  nav .menu.main li a:hover {
    background-color: var(--blank);
    color: var(--ink);
  }

  article {
    padding: 2rem 2rem 6rem 2rem;
  }
}

@media print {
  header, footer, aside, input, button, select, label, .noprint, .button, .admin {
    display: none !important;
  }

  ul {
    break-inside: avoid;
  }

  pre, textarea {
    overflow: visible;
    white-space: pre-wrap;
    white-space: -moz-pre-wrap;
    white-space: -pre-wrap;
    white-space: -o-pre-wrap;
    word-wrap: break-word;
    display: block;
  }

  body, article {
    background: none;
    margin: 0;
    padding: 0;
    overflow: visible;
    color: #000;
    background-color: #fff;
  }

  .pgn {
    display: inline !important;
    font-size: 1em !important;
  }
}
