/*
Namn: Fredrik Falk
Personnr: 20000524-8158
ideal: frefal-9
*/

/*! HTML5 Boilerplate v8.0.0 | MIT License | https://html5boilerplate.com/ */

/* main.css 2.1.0 | MIT License | https://github.com/h5bp/main.css#readme */
/*
 * What follows is the result of much research on cross-browser styling.
 * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
 * Kroc Camen, and the H5BP dev community and team.
 */

/* ==========================================================================
   Base styles: opinionated defaults
   ========================================================================== */

html {
  color: #222;
  font-size: 1em;
  line-height: 1.4;
}

/*
 * Remove text-shadow in selection highlight:
 * https://twitter.com/miketaylr/status/12228805301
 *
 * Vendor-prefixed and regular ::selection selectors cannot be combined:
 * https://stackoverflow.com/a/16982510/7133471
 *
 * Customize the background color to match your design.
 */

::-moz-selection {
  background: #b3d4fc;
  text-shadow: none;
}

::selection {
  background: #b3d4fc;
  text-shadow: none;
}

/*
 * A better looking default horizontal rule
 */

hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid #ccc;
  margin: 1em 0;
  padding: 0;
}

/*
 * Remove the gap between audio, canvas, iframes,
 * images, videos and the bottom of their containers:
 * https://github.com/h5bp/html5-boilerplate/issues/440
 */

audio,
canvas,
iframe,
img,
svg,
video {
  vertical-align: middle;
}

/*
 * Remove default fieldset styles.
 */

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

/*
 * Allow only vertical resizing of textareas.
 */

textarea {
  resize: vertical;
}

/* ==========================================================================
   Author's custom styles
   ========================================================================== */

/* Define custom  fonts */
@font-face {
  font-family: minecraft;
  src: url("/font/MinecraftRegular-Bmg3.otf");
}

@font-face {
  font-family: minecraft-bold;
  src: url("/font/MinecraftBold-nMK1.otf");
}

/* Set document to use custom font, revert to serif if not available */
html * {
  font-family: minecraft, serif;
}

/* Define the grid that makes up the site */
.grid {
  width: 100vw;
  display: grid;
  justify-items: center;
}

/*
  The header is a grid within a grid,
  that contains the title image,
  a few buttons, and background
*/
.header_grid {
  background-image: url("https://static.wikia.nocookie.net/minecraft_gamepedia/images/5/51/Spruce_Trapdoor_%28texture%29_JE2_BE2.png");
  background-repeat: repeat;
  background-size: auto 100%;
  grid-gap: 10px;
  grid-template-columns: auto auto auto auto;
}

/* Title grid container, spans three columns */
.header_title {
  margin: 10px;
  grid-column: 1/ span 4;
}

/* The header image itself*/
.header_image {
  width: auto;
  height: 100%;
  max-height: 50px;
}

/* Add a background for the actual game */
.game {
  background-image: url("https://static.wikia.nocookie.net/minecraft_gamepedia/images/e/e6/Oak_Planks_%28texture%29_JE6_BE3.png");
  background-size: 100px;
  padding: 50px;
  color: white;
}

/* Add background for the entire page */
body {
  background-image: url("https://static.wikia.nocookie.net/minecraft_gamepedia/images/b/be/Stone_Bricks_%28texture%29_JE3_BE2.png");
  background-repeat: repeat;
  background-size: 100px;
  margin: 0;
}

/* Add bold font to year display */
#year {
  font-family: minecraft-bold, serif;
}

/* Disable list dots */
li {
  list-style: none;
}

/* CSS included from original Hammurabi game, disabled */
/*
#people {
  display: block;
  padding-left: 0;
  border: black 1px solid;
  list-style: none;
}

#people li {
  display: inline;
  margin-right: 10px;
  border: black 1px solid;
}

#economy {
  display: block;
  padding-left: 0;
  border: black 1px solid;
  list-style: none;
}

#economy li {
  margin-bottom: 1px;
}

.fieldset {
  border-style: none;
}

button {
  margin: 30px 25px 0 0;
  padding: 10px 15px;
}
*/

/* Stat icons */
#starved {
  background: url("https://static.wikia.nocookie.net/minecraft_gamepedia/images/b/b3/Wither_%28effect%29_JE2_BE2.png") no-repeat left;
  padding-left: 20px;
  background-size: auto 13px;
}

#population {
  background: url("https://static.wikia.nocookie.net/minecraft_gamepedia/images/5/53/Angry_Villager_%28texture%29_JE0_BE0.png") no-repeat left;
  padding-left: 20px;
  background-size: auto 13px;
}

#newcomers {
  background: url("https://static.wikia.nocookie.net/minecraft_gamepedia/images/4/43/Heart_%28texture%29_JE1_BE1.png") no-repeat left;
  padding-left: 20px;
  background-size: auto 13px;
}

#acres {
  background: url("https://static.wikia.nocookie.net/minecraft_gamepedia/images/2/27/Empty_Map_JE2_BE2.png") no-repeat left;
  padding-left: 20px;
  background-size: auto 13px;
}

#bushels {
  background: url("https://static.wikia.nocookie.net/minecraft_gamepedia/images/4/44/Bread_JE3_BE3.png") no-repeat left;
  padding-left: 20px;
  background-size: auto 13px;
}

#harvest {
  background: url("https://static.wikia.nocookie.net/minecraft_gamepedia/images/7/75/Wheat_JE2_BE2.png") no-repeat left;
  padding-left: 20px;
  background-size: auto 13px;
}

#rats {
  background: url("https://static.wikia.nocookie.net/minecraft_gamepedia/images/3/3e/Rabbit_Hide_JE3_BE2.png") no-repeat left;
  padding-left: 20px;
  background-size: auto 13px;
}

#price {
  background: url("https://static.wikia.nocookie.net/minecraft_gamepedia/images/2/26/Emerald_JE3_BE3.png") no-repeat left;
  padding-left: 20px;
  background-size: auto 13px;
}

/* https://codeconvey.com/pure-css-popup-window-with-close-button/ */
.pop {
  margin: auto;
  height: 100%;
  width: 100%;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  text-align: center;
}
.pop:hover {
  background-color: #ffffff2f;
}
@media (max-width: 640px) {
  .pop {
    position: relative;
    width: 100%;
  }
}

.pop .modal {
  z-index: 2;
  opacity: 0;
  visibility: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  -webkit-transition: opacity 500ms ease-in-out;
  transition: opacity 500ms ease-in-out;
}

.pop .modal__inner {
  -webkit-transform: translate(-50%, -50%) scale(0.75);
  transform: translate(-50%, -50%) scale(0.75);
  top: 50%;
  left: 50%;
  width: 75%;
  background: white;
  padding: 30px;
  position: absolute;
  color: black;
  text-align: left;
}
@media (max-width: 640px) {
  .pop .modal__inner {
    width: 100%;
  }
}

.btn-close{
  color: #fff;
  text-align: center;
}

.pop label {
  display: inline-block;
  cursor: pointer;
}
.pop label.open {
  color: turquoise;
  -webkit-transition: color 200ms ease-in-out;
  transition: color 200ms ease-in-out;
  text-decoration: underline;
}
.pop label.open:hover {
  color: paleturquoise;
}

.pop input {
  display: none;
}
.pop input:checked + .modal {
  opacity: 1;
  visibility: visible;
}
.pop input:checked + .modal .modal__inner {
  -webkit-transform: translate(-50%, -50%) scale(1);
  transform: translate(-50%, -50%) scale(1);
  -webkit-transition: all 200ms ease-in-out;
  transition: all 200ms ease-in-out;
}
.pop input:checked + .modal .modal__inner p {
  font-size: 1.25rem;
  line-height: 125%;
}
.pop input:checked + .modal label {
  position: absolute;
  top: 0;
  right: 0;
  height: 30px;
  width: 30px;
  background: #666666;
  -webkit-transition: all 200ms ease-in-out;
  transition: all 200ms ease-in-out;
}
.pop input:checked + .modal label:hover {
  background: #333333;
}
/* end of https://codeconvey.com/pure-css-popup-window-with-close-button/ */

/* ==========================================================================
   Helper classes
   ========================================================================== */

/*
 * Hide visually and from screen readers
 */

.hidden,
[hidden] {
  display: none !important;
}

/*
 * Hide only visually, but have it available for screen readers:
 * https://snook.ca/archives/html_and_css/hiding-content-for-accessibility
 *
 * 1. For long content, line feeds are not interpreted as spaces and small width
 *    causes content to wrap 1 word per line:
 *    https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
 */

.sr-only {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
  /* 1 */
}

/*
 * Extends the .sr-only class to allow the element
 * to be focusable when navigated to via the keyboard:
 * https://www.drupal.org/node/897638
 */

.sr-only.focusable:active,
.sr-only.focusable:focus {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  white-space: inherit;
  width: auto;
}

/*
 * Hide visually and from screen readers, but maintain layout
 */

.invisible {
  visibility: hidden;
}

/*
 * Clearfix: contain floats
 *
 * For modern browsers
 * 1. The space content is one way to avoid an Opera bug when the
 *    `contenteditable` attribute is included anywhere else in the document.
 *    Otherwise it causes space to appear at the top and bottom of elements
 *    that receive the `clearfix` class.
 * 2. The use of `table` rather than `block` is only necessary if using
 *    `:before` to contain the top-margins of child elements.
 */

.clearfix::before,
.clearfix::after {
  content: " ";
  display: table;
}

.clearfix::after {
  clear: both;
}

/* ==========================================================================
   EXAMPLE Media Queries for Responsive Design.
   These examples override the primary ('mobile first') styles.
   Modify as content requires.
   ========================================================================== */

@media only screen and (min-width: 35em) {
  /* Style adjustments for viewports that meet the condition */
}

@media print,
  (-webkit-min-device-pixel-ratio: 1.25),
  (min-resolution: 1.25dppx),
  (min-resolution: 120dpi) {
  /* Style adjustments for high resolution devices */
}

/* ==========================================================================
   Print styles.
   Inlined to avoid the additional HTTP request:
   https://www.phpied.com/delay-loading-your-print-css/
   ========================================================================== */

@media print {
  *,
  *::before,
  *::after {
    background: #fff !important;
    color: #000 !important;
    /* Black prints faster */
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  abbr[title]::after {
    content: " (" attr(title) ")";
  }

  /*
   * Don't show links that are fragment identifiers,
   * or use the `javascript:` pseudo protocol
   */
  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  pre {
    white-space: pre-wrap !important;
  }

  pre,
  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid;
  }

  /*
   * Printing Tables:
   * https://web.archive.org/web/20180815150934/http://css-discuss.incutio.com/wiki/Printing_Tables
   */
  thead {
    display: table-header-group;
  }

  tr,
  img {
    page-break-inside: avoid;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}

