/* Copyright 2019 Bananamoji Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

:root {
  --description-width: 15em;
  --sticker-preview-size: 4em;
  --sticker-details-image-size: 16em;
}

html, body {
  background-color: #60a4b5;
  padding: 0;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
}

#header {
  --message-padding: 1em;
  margin: 0;
  padding: var(--message-padding);
  width: calc(100% - var(--message-padding) * 2);
  background-color: white;
}

#instructions {
  font-size: 110%;
  margin-bottom: 0;
}

footer {
  padding: 2em 1em 0.5em 1em;
  font-size: 80%;
}

footer a {
  color: black;
}

h1 a {
  color: black;
}

.sticker-collection {
  margin-left: auto;
  margin-right: auto;
  width: intrinsic;           /* Safari/WebKit uses a non-standard name */
  width: -moz-fit-content;    /* Firefox/Gecko */
  width: fit-content;
  max-width: 100%;
  vertical-align: top;
}

.sticker-collection-details {
  margin-left: auto;
  margin-right: auto;
  width: intrinsic;           /* Safari/WebKit uses a non-standard name */
  width: -moz-fit-content;    /* Firefox/Gecko */
  width: fit-content;
  max-width: 100%;
  vertical-align: top;
}

.sticker-collection img {
  margin-right: 2em;
  display: inline-block;
  width: var(--sticker-details-image-size);
}

.sticker-collection-description {
  display: inline-block;
  vertical-align: top;
  width: var(--description-width);
  max-width: 100%;
}

.sticker-collection-shops {
  margin-top: 2em;
}

.shop-badge img {
  height: 4em;
  padding: 0;
  margin: 0;
}

.sticker-downloads {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
}

.sticker-download {
  min-width: 5em;
  margin: 0.4em;
}

a.button {
  width: calc(100% - 2em);
  display: inline-block;
  padding: 0.5em 1em;
  background-color: #60a4b5;
  color: white;
}

.sticker-details {
  margin-left: auto;
  margin-right: auto;
  width: intrinsic;           /* Safari/WebKit uses a non-standard name */
  width: -moz-fit-content;    /* Firefox/Gecko */
  width: fit-content;
  max-width: 100%;
}

.sticker-details-info {
  margin-left: auto;
  margin-right: auto;
  width: intrinsic;           /* Safari/WebKit uses a non-standard name */
  width: -moz-fit-content;    /* Firefox/Gecko */
  width: fit-content;
  max-width: 100%;
}

.sticker-details-description {
  display: inline-block;
  vertical-align: top;
  width: var(--description-width);
  max-width: 100%;
}

.sticker-details-description h2 {
  margin-bottom: 0;
  padding-bottom: 0;
}

.sticker-details-label {
  padding-right: 0.5em;
  font-weight: bold;
}

.sticker-details-label::after {
  content: ":";
}

/* Make pixel art look more pixel-ly
 * See:
 * http://stackoverflow.com/questions/7615009/disable-interpolation-when-scaling-a-canvas
 * http://jsfiddle.net/VAXrL/21/
 *
 * image-rendering: optimize-contrast; is the only line specified in the CSS3 standard
 * working draft.
 */
.pixel-art {
  image-rendering: optimizeSpeed;
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: optimize-contrast;
  image-rendering: pixelated;
  -ms-interpolation-mode: nearest-neighbor;
}

#not-found-message {
  width: intrinsic;           /* Safari/WebKit uses a non-standard name */
  width: -moz-fit-content;    /* Firefox/Gecko */
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  font-size: 200%;
}

#sticker-picker {
  --sticker-margin: 4px;
  max-width: calc(var(--sticker-preview-size) * 8 + var(--sticker-margin) * 7);
  padding: 1em 2px;
  margin-left: auto;
  margin-right: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--sticker-preview-size), 1fr));
  grid-gap: var(--sticker-margin);
  justify-items: center;
}

.sticker-preview img {
  width: var(--sticker-preview-size);
}
