/**
 * Treehouse FSJS Techdegree
 * Random Quote Generator - CSS
 */

body {
  background-color: #36b55c;
  transition: background-color 1s ease-out; /* Added a transition to bg color chng */
  color: white;
  font-family: 'Playfair Display', serif;
}

#quote-box {
  position: absolute;
  top: 20%;
  left: 10%;
  right: 10%;
  width: 80%;
  line-height: .5;
}

.quote {
  font-size: 2.5rem;
  font-weight: 400;
  line-height: 1.1;
  position: relative;
  margin: 0;
}

.quote:before, .quote:after {
  font-size: 3rem;
  line-height: 2.5rem;
  position: absolute;
}

.quote:before {
  content: "“";
  top: .25em;
  left: -.5em;
}

.quote:after {
  content: "”";
  bottom: -.1em;
  margin-left: .1em;
  position: absolute;
}

.source {
  font-size: 1rem;
  letter-spacing: 0.05em;
  line-height: 1.1;
  text-align: right;
  margin-right: 4em;
/* ========= The code below fades the part of the HTML_string not equal to the quote ======== */

 -webkit-animation: fadein 2s; /* Safari, Chrome and Opera > 12.1 */
 -moz-animation: fadein 2s; /* Firefox < 16 */
 -ms-animation: fadein 2s; /* Internet Explorer */
  -o-animation: fadein 2s; /* Opera < 12.1 */
     animation: fadein 2s;
}

@keyframes fadein {
from { opacity: 0; }
to   { opacity: 2; }
}

/* Firefox < 16 */
@-moz-keyframes fadein {
from { opacity: 0; }
to   { opacity: 2; }
}

/* Safari, Chrome and Opera > 12.1 */
@-webkit-keyframes fadein {
from { opacity: 0; }
to   { opacity: 2; }
}

/* Internet Explorer */
@-ms-keyframes fadein {
from { opacity: 0; }
to   { opacity: 2; }
}

/* Opera < 12.1 */
@-o-keyframes fadein {
from { opacity: 0; }
to   { opacity: 2; }
}
/* ============================= END OF code to fade HTML_string =============================== */

.source:before {
  content: "—";
}

.citation {
  font-style: italic;
}

.citation:before {
  content: ", ";
  font-style: normal;
}

.year:before {
  content: ", ";
  font-style: normal;
}

#load-quote {
  position: fixed;
  width: 12em;
  display: inline-block;
  left: 50%;
  margin-left: -6em;
  bottom: 150px;
  border-radius: 4px;
  border: 2px solid #fff;
  color: #fff;
  background-color: #36b55c;
  transition: background-color 2s ease-in-out; /* Added a transition to bg color chng */
  padding: 15px 0;
  transition: .5s ;
}
#load-quote:hover {
  background-color: rgba(255,255,255,.25);
}

#load-quote:focus {
  outline: none;
}

@media (min-width: 420px) {
  .quote {
    font-size: 4rem;
  }
  .quote:before, .quote:after {
    font-size: 6rem;
  }
  .source {
    font-size: 1.25rem;
  }
}
