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

/* =====================================================================
   Typography and generic mark-up
   ================================================================== */
html,
button,
input,
select,
textarea {
  font-family: Verdana, Geneva, sans-serif;
}

html {
  background: url('../img/bg-paper-grey.jpg') repeat scroll 0 0 #A7AA9F;
  height: 100%;
}

a {
  color: #3030C0; /* desaturate & darken default link colour of #0000EE */
  text-decoration: none;
}

a:visited {
  color: #404080; /* desaturate & darken even further */
}

a:hover {
  text-decoration: underline;
}

p {
  margin: 0;
}

/* indent successive paragraphs */
p + p {
  text-indent: 1em;
}

/* force indent if there's another element before the paragraph that
   doesn't create vertical whitespace */
p.indent {
  text-indent: 1em;
}

/* indent lists */
dl {
  margin: 0;
  padding-left: 1em;
}

dt {
  display: list-item;
  list-style-type: disc;
}

dd {
  padding: 0;
  margin: 0 0 0 1em;
}

ol {
  margin: 0;
  padding-left: 2em;
}

ul {
  margin: 0;
  padding-left: 1em;
}

/* un-italise italics when in an italic paragraph */
i i {
  font-style: normal;
}

/* table formatting */
th,
td {
  text-align: left;
  padding: 0.25em 0.5em;
}

thead th,
thead td {
  vertical-align: bottom;
}

tbody th,
tbody td {
  vertical-align: top;
}

th.number,
td.number {
  text-align: right;
}

table.full {
  width: 100%;
}

/* dark colour for table heading */
thead tr {
  background-color: transparent;
  background-color: rgba(50%, 50%, 50%, 0.5);
}

/* zebrastripe even rows */
tbody tr:nth-child(even) {
  background-color: transparent;
  background-color: rgba(80%, 80%, 80%, 0.5);
}

hr {
  border-top: 1px solid #666;
  clear: both;
}
hr.third {
  width: 33%;
  margin: 1em auto;
}

article blockquote,
article aside,
.lyrics {
  background-color: transparent;
  background-color: rgba(80%, 80%, 80%, 0.5);
  margin: 0.5em 0;
  padding: 0.25em 0.5em;
}

@media only screen and (min-width: 32rem) {
  article blockquote,
  article aside,
  .lyrics {
    padding: 0.5em 1em;
  }

  .blockquote--with-marks,
  .lyrics--with-marks {
    padding: 0.5em 0.5em 0.5em 3em;
  }
  .blockquote--with-marks::before,
  .lyrics--with-marks::before {
    content: "\201C";
    position: absolute;
    font-size: 3rem;
    line-height: 1;
    color: #666;
    margin-left: -2rem;
  }
}

article aside.half {
  float: right;
  margin: 0.5em 0 0.5em 1em;
  padding: 0.25em 0.5em;
  text-align: center;
  width: 14em;
}

@media only screen and (min-width: 32rem) {
  article aside.half {
    padding: 0.5em 1em;
  }
}

article aside.half.left {
  text-align: left;
}

.opening {
  font-weight: bold;
  letter-spacing: -0.5px;
}

/* in-article navigation */
article nav {
  border-top: 1px solid #666;
  float: left;
  margin-top: 1em;
  padding-top: 1em;
}

article nav ol li.prev {
  float: left;
  list-style: circle inside url('../img/li-arrowback.png');
}

article nav ol li.next {
  float: right;
  list-style: circle inside url('../img/li-arrowforward.png');
  text-align: right;
}

article nav.center {
  border: none;
  margin: 1rem auto;
  padding: 0;
  text-align: center;
}

/* =====================================================================
   Rules for page layout
   ================================================================== */

body {
  margin: 0 auto;
  display: grid;
  width: 100%;
  min-width: 14rem;
  min-height: 100vh; /* needed for 'sticky' footer -- https://codepen.io/elanie_benes/pen/mppaxz */
  grid-template-columns: 1fr;
  grid-template-rows: auto auto auto auto 1fr;
  grid-template-areas:
    "head"
    "main"
    "navi"
    "sign"
    "foot";
  gap: 0.5rem;
}

@media only screen and (min-width: 32rem) {
  body {
    max-width: min(calc(100vw - 2rem), 82rem);
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto 1fr;
    grid-template-areas:
      "head head"
      "main main"
      "navi sign"
      "foot foot";
    gap: 0.5rem;
  }
}

@media only screen and (min-width: 50rem) {
  body {
    grid-template-columns: 1fr 14rem;
    grid-template-rows: auto auto auto 1fr;
    gap: 1rem;
    grid-template-areas:
      "head head"
      "main navi"
      "sign navi"
      "foot foot";
  }
}

@media only screen and (min-width: 68rem) {
  body {
    grid-template-columns: 14rem 1fr 14rem;
    grid-template-rows: auto 1fr auto;
    gap: 1rem;
    grid-template-areas:
      "head head head"
      "navi main sign"
      "foot foot foot";
  }
}

@media only screen and (min-width: 78rem) {
  body {
    grid-template-columns: 16rem 1fr 16rem;
    gap: 1rem 2rem;
  }
}

/**
 * Overwrite all the responsive stuff we just defined
 * if the user wants a wider page (for example, an art gallery)
 * For now we support one layout option:
 * - "semi-wide": wider layout that sacrifices the "signature" box
 *   for pages that need more space
 * The corresponding classes are exclusive.
 */
/**
 * Semi-wide layout
 * - 1 column until 68rem,
 * - only 2 columns after
 */
@media only screen and (min-width: 50rem) {
  body.semi-wide {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto 1fr;
    gap: 1rem;
    grid-template-areas:
      "head head"
      "main main"
      "navi sign"
      "foot foot";
  }
}

@media only screen and (min-width: 68rem) {
  body.semi-wide {
    grid-template-columns: 14rem 1fr;
    grid-template-rows: auto auto auto 1fr;
    gap: 1rem;
    grid-template-areas:
      "head head"
      "navi main"
      ".    sign"
      "foot foot";
  }
}

@media only screen and (min-width: 78rem) {
  body.semi-wide {
    grid-template-columns: 16rem 1fr;
    gap: 1rem 2rem;
  }
}


/* =====================================================================
   Other rules
   ================================================================== */

nav ul,
nav ol {
  list-style: none;
  list-style-image: none;
}

body > header {
  background: url('../img/tiling02.jpg') repeat scroll 0 0 #292929;
  grid-area: head;
  align-self: start;
  width: 100%;
}


body > footer {
  grid-area: foot;
  align-self: end;
  background: url('../img/tiling02.jpg') repeat scroll 0 0 #292929;
  color: #a7aaa0;
  padding: 0.5rem;
  text-align: center;
  font-size: 0.8em;
}

body > footer a,
body > footer a:visited {
  color: #cacec1;
}


/* main content block */
article {
  grid-area: main;
  align-self: start;
  background: url('../img/bg-paper-rice.jpg') repeat scroll 0 0 #f5f5f5;
  padding: 0 0.5rem 1rem;
}

@media only screen and (min-width: 32rem) {
  article {
    padding: 0 1rem 1rem;
  }
}

/* Theme-specific styling */
h1,
h2,
h3,
h4 {
  clear: both;
  font-family: 'Fredericka the Great', cursive;
}

/* the article's header needs to adjust for article's padding */
h1 {
  background: url('../img/tiling02.jpg') repeat scroll 0 0 #292929;
  color: #FFFFFF;
  font-size: 1.5em;
  margin: 0 -0.5rem 1rem;
  padding: 0 1rem;
}

@media only screen and (min-width: 32rem) {
  h1 {
    font-size: 2em;
    margin: 0 -1rem 1rem;
  }
}

h2,
h3,
h4,
h5,
h6 {
  padding: 0;
}


h1.masthead {
  clear: left;
  font-size: 1.5em;
  float: left;
  margin: 0;
}

h2.masthead {
  clear: left;
  color: #FFFFFF;
  font-size: 1.1em;
  float: left;
  font-family: 'Nothing You Could Do', cursive;
  margin: 0 0 0 1rem;
}

#portraitlogo {
  display: none;
  float: right;
  height: 4em;
  width: 4em;
}

#logininfo {
  color: #FFFFFF;
  float: right;
  margin-right: 1rem;
  text-align: right;
}

#logininfo a {
  color: #A7AA9F;
}

.navprim {
  background: url('../img/bg-paper-rice.jpg') repeat scroll 0 0 #f5f5f5;
  float: left;
  font-family: 'Nothing You Could Do', cursive;
  width: 100%;
}

.navprim > ul > li {
  float: left;
  padding: 0 1rem;
}

.navsec {
  background: url('../img/bg-paper-rice.jpg') repeat scroll 0 0 #f5f5f5;
  grid-area: navi;
  align-self: start;
  border: none;
  margin: 0;
  padding: 0 1rem 1rem;
}

.navsec > ul {
  list-style: circle inside url('../img/li-circle.png');
}

.navsec > ul.backlink {
  list-style: circle inside url('../img/li-arrowback.png');
  margin-top: 1rem;
}

nav ul,
nav ol {
  margin: 0;
  padding: 0;
}

.publishing-info {
  color: #666;
  font-style: italic;
  margin-bottom: 1rem;
}

.signature {
  grid-area: sign;
  align-self: start;
  background: url('../img/bg-paper-rice.jpg') repeat scroll 0 0 #f5f5f5;
  border: none;
  padding: 0 1rem 1rem;
}

nav.navsec h2,
aside.signature h2 {
  background: url('../img/tiling02.jpg') repeat scroll 0 0 #292929;
  color: #ffffff;
  margin: 0 -1rem 1rem;
  padding: 0 1rem;
}

.signature blockquote {
  margin: 0em;
}


blockquote > footer {
  margin: 1em 0 0;
}

figure {
  margin: 0.5em 0 0.5em;
}

figcaption {
  color: #666;
}



/* =====================================================================
   embedding Youtube videos in a responsive way,
   source: http://demosthenes.info/blog/649/Responsive-Design-Create-Fluid-YouTube-and-Vimeo-Content
   ================================================================== */

.responsive-container {
  position: relative;
  padding-bottom: 56.25%;
  padding-top: 30px;
  height: 0;
  overflow: hidden;
  max-width: 100%;
  height: auto;
}

/* if the container is placed in a list, make sure we claim the entire width
   by reclaiming the left margin from the li element */
.responsive-container--in-list {
  margin: 0.5rem 0 0.5rem -1rem;
  max-width: calc(100% + 1rem);
}

.responsive-container iframe {
  border: 0;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* if the container is directly in the main flow,
   add some margins to make it feel less cramped */
article > .responsive-container {
  margin: 0.5em 0;
}

/* =====================================================================
   Styles for "Best Of" series
   ================================================================== */
.entry {
  width: 100%;
  clear: both;
  margin-bottom: 0.5em;
}
.entry .pict {
  width: 200px;
  margin: 0.25em;
  padding: 0.25em;
}
.entry .left {
  float: left;
}
.entry .right {
  float: right;
}

.pict.left {
  margin-left: 0;
  padding-left: 0;
}
.pict.right {
  margin-right: 0;
  padding-right: 0;
}
.half {
  width: 50%;
}

/* two-column lists need a bit of extra spacing to breathe */
.half.left {
  width: 49%;
}

.half.left + .half.left {
  margin-left: 2%;
}

.entry ul {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

ul.horizontal {
  float: left;
  list-style: none outside none;
  padding: 0;
  width: 100%;
}

ul.horizontal li {
  border: 1px solid #190202;
  border-width: 0 1px 0 0;
  float: left;
  padding: 0 1em;
}

ul.horizontal li:last-child {
  border: 0;
}

img.flagicon {
  border: 0;
  height: 15px;
  margin-right: 0.5em;
  width: 16px;
}
/* =====================================================================
   Rules for Movies, Music articles
   ================================================================== */
.imdb-box,
.allmusic-box {
  background-color: rgba(100%, 100%, 100%, 0.5);
  box-shadow: 0 0 5px 1px rgba(102,102,102,0.5);
  border-radius: 2px;
  color: #666;
  float: right;
  padding: 0.5rem 0.5rem;
  margin: 0.5rem -0.5rem 0.5rem 0.5rem;
  text-align: center;
  width: 14em;
  max-width: 40vw;
}

.imdb-box hr,
.allmusic-box hr {
  margin: 0.5em 0;
}

.imdb-poster,
.album-cover {
  margin-bottom: 0.25em;
  width: 100%;
}

/* create "polaroid" effect on all but the smallest viewport */
@media only screen and (min-width: 32rem) {
  .imdb-box,
  .allmusic-box {
    background: url('../img/bg-paper-rice.jpg') repeat scroll 0 0 rgba(100%, 100%, 100%, 0.5);
    margin-right: -1.5rem;
    margin-left: 1rem;
  }
}

@media only screen and (min-width: 78rem) {
  .imdb-box,
  .allmusic-box {
    padding: 1rem 1rem;
    margin-right: -2rem;
  }
}


figure.full {
  background-color: transparent;
  background-color: rgba(100%, 100%, 100%, 0.5);
  padding: 0.5rem;
  margin: 0.5rem -0.5rem;
  text-align: center;
  width: 100%;
}

figure.full img {
  border: 1px solid #666;
  max-width: 100%;
}

figure.full figcaption {
  text-align: left;
}

/* create "polaroid" effect on all but smallest viewport */
@media only screen and (min-width: 32rem) {
  figure.full {
    background: url('../img/bg-paper-rice.jpg') repeat scroll 0 0 #f5f5f5;
    border-radius: 2px;
    box-shadow: 0 0 3px 2px rgba(102,102,102,0.5);
    margin: 1rem -1.5rem;
    padding: 0.5rem;
    width: calc(100% + 2rem);
  }

  /* let caption breathe */
  figure.full figcaption {
    margin-top: 0.5rem;
    text-align: center;
  }
}

@media only screen and (min-width: 78rem) {
  figure.full {
    padding: 1rem;
    margin: 1rem -2rem;
  }
}

.spoiler-warning {
  color: #903030;
  background-color: transparent;
  background-color: rgba(50%, 50%, 50%, 0.25);
  display: block;
  margin: 1em 0;
  padding: 1em;
}

ul.toc-horizontal {
  margin: 0 auto;
  padding: 0;
}
ul.toc-horizontal li {
  display: inline-block;

}
ul.toc-horizontal li:not(:last-child):after {
  content: "|";
  margin: 0 .5em;
}

ol.list--verbose li,
ul.list--verbose li {
  margin-bottom: 0.25rem;
}

/* =====================================================================
   Rules for Music articles
   ================================================================== */
.album-cover-gallery {
  width: 100%;
}

.album-cover-gallery a {
  display: block;
  float: left;
  height: 12em;
  width: 12em;
}
.album-cover-gallery a img {
  background-color: transparent;
  background-color: rgba(100%, 100%, 100%, 0.5);
  display: block;
  float: left;
  opacity: 0.9;
  padding: 5%;
  width: 90%;
  transition: all 2s;
}

.album-cover-gallery a:hover img {
  padding: 0;
  opacity: 1;
  width: 100%;
  transition: width 1s, height 1s, padding 1s;
}

/* =====================================================================
   Rules for games list
   ================================================================== */
.label {
  color: #777;
  font-size: 0.6em;
}
.label:before {
  content: "[";
}
.label:after {
  content: "]";
}

.finished {
  background: #9f9;
}

.free {
  color: #777;
}

.sufficient {
  background: #cfc;
}

/* =====================================================================
   Rules for artwork collections
   ================================================================== */
.artwork__directions {
  color: #666;
  font-style: italic;
  margin-bottom: 1rem;
}
.artwork__cards {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-evenly;
  align-items: flex-start;
  align-content: flex-start;
  gap: 0.5rem;
}
@media only screen and (min-width: 32rem) {
  .artwork__cards {
    gap: 1rem;
  }
}
@media only screen and (min-width: 42rem) {
  .artwork__cards {
    gap: 1.5rem;
  }
}

.artwork__card {
  border-radius: 2px;
  background-color: rgba(100%, 100%, 100%, 0.5);
  box-shadow: 0 0 2px 0 rgba(102, 102, 102, 0.5);
  padding: 0.25rem;
  text-align: center;
}
/* Create break in flexbox row,
   see https://tobiasahlin.com/blog/flexbox-break-to-new-row/ */
.artwork__break {
  flex-basis: 100%;
  height: 0;
}

@media only screen and (min-width: 32rem) {
  .artwork__card {
    padding: 0.5rem;
  }
}


.artwork__image {
  /* remove page padding and tile padding */
  max-width: calc(100vw - (2 * 0.5rem) - (2 * 0.25rem));
}

.lightgallery .artwork__card,
.lightgallery .artwork__image {
  cursor: zoom-in;
}

.artwork__info {
  max-width: 400px;
  text-align: left;
}

.artwork__title {
  color: #333333;
  margin: 0.25rem 0;
  text-decoration: underline;
  font-size: 1.1em;
}

.artwork__date,
.artwork__description,
.artwork__materials {
  color: #666666;
}

.artwork__date {
  color: #666666;
  font-style: italic;
}

/* ---------------------------------------------------------------------
   Lightgallery
   ------------------------------------------------------------------ */
.lg-backdrop {
  background-color: #444444;
  background-image: url('../img/bg-paper-grey-dark.jpg');
}

.lg-toolbar .lg-icon {
  transition: background-color 0.2s ease-in-out;
  border-radius: 1px;
}

.lg-toolbar .lg-icon:hover {
  background-color: rgba(0, 0, 0, 0.45);
}

.lg-next,
.lg-prev {
  background-color: rgba(0, 0, 0, 0.25);
  transition: background-color 0.2s ease-in-out,
    color 0.2s ease-in-out;
  border-radius: 1px;
}

.lg-next:hover,
.lg-prev:hover {
  background-color: rgba(0, 0, 0, 0.45);
}

.lg-icon::before,
.lg-icon::after {
  text-shadow: 1px 1px 3px #333333;
}

.lg-sub-html .artwork__title {
  color: #CCCCCC;
  text-shadow: 1px 1px 3px #333333;
}

.lg-sub-html .artwork__date,
.lg-sub-html .artwork__description,
.lg-sub-html .artwork__materials {
  color: #CCCCCC;
  text-shadow: 1px 1px 3px #333333;
}

/* =====================================================================
   Media Queries for Responsive Design.
   ================================================================== */
@media only screen and (min-width: 28rem) {
  #portraitlogo {
    display: block;
  }
}

@media only screen and (min-width: 32rem) {
  #portraitlogo {
    height: 6em;
    width: 6em;
  }
}
@media only screen and (min-width: 42rem) {
  /* make main & subtitle larger,
     introduce portrait logo,
     make primary navigation larger
   */
  h1.masthead {
    font-size: 2.4em;
  }
  h2.masthead {
    font-size: 1.5em;
  }

  #portraitlogo {
    height: 8em;
    width: 8em;
  }
  .navprim {
    font-size: 1.2em;
  }
}

@media only screen and (min-width: 50rem) {
  #portraitlogo {
    width: 9.6em;
    height: 9.6em;
  }
}

@media only screen and (min-width: 58rem) {
  #portraitlogo {
    width: 11.2em;
    height: 11.2em;
  }
}

@media only screen and (min-width: 68rem) {
  nav.navsec h2,
  aside.signature h2 {
    margin-bottom: 1rem;
  }
}

