/* 
    Raspberry: #C51557
    Lime: #9DC435
    Slate: #2A3942
*/

@import url('//fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;1,400&display=swap');
@import url('//fonts.googleapis.com/css2?family=Oswald:wght@500&display=swap');

body {
    color: #2A3942;  
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.site-container {
    padding: 1em;
    margin: auto;
    line-height: 2rem;
    font-size: 1.1em;
    font-family: 'Lora', serif;
}

.main-text-wrapper {
    max-width: 45rem;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Oswald', sans-serif;  
}

h2 {
    border-bottom: 0.5em solid #2A3942;
    padding-bottom: 0.25em;
	margin-bottom: 1em;
}

h2, h3, h4 {
	letter-spacing: -0.02em;
}

@media (min-width: 600px) {
    h2 {
        font-size: 2.5em;
    }
}

h3 {
    margin-top: 2em;
    margin-bottom: 1em;
}

h4 {
    margin-top: 2em;
}

.boxout h3 {
    margin-top: 0em;
}

h4 {
    text-transform: uppercase;
    font-size: 1.2em;
}

hr {
    margin-top: 0.5em;
    margin-bottom: 1.5em;
}

a {
    color: #C51557;
}

.btn-primary {
    background-color: #C51557;
    border-color: #C51557;
}

.btn-outline-primary {
    color: #C51557;
    border-color: #C51557;
}

.btn-primary:hover, .btn-outline-primary:hover {
    background-color: #2A3942;
    border-color: #2A3942;
}

sup {
    /* avoid breaking line-height */
    vertical-align: baseline;
    position: relative;
    top: -0.4em;
}

img.img-outline {
    border: 1px solid #2A3942;
}

.boxout {
    border: 1px solid #2A3942;
    padding: 2em;
}

.boxout-lime {
    border: none;
    border-top: 10px solid #9DC435;
	border-bottom: 10px solid #9DC435;
	margin-top: 2em;
    margin-bottom: 2em;
}

.sidebar {
    font-size: 0.9em;
    line-height: 1.5em;
}

.footer {
    font-size: 0.9em;
    line-height: 1.5em;
    background: url('/img/bg.png');
    background-repeat: no-repeat;
    background-position: bottom left;
}

.version1 {
    background: url('/img/bg-rasp.png');
    background-repeat: no-repeat;
    background-position: bottom left;
}

.footer-section {
    max-width: 30em;
}

ul.chapters {
    list-style-type: none;
    padding-left: 0em;
}

.bg-raspberry {
    background-color: #C51557;
    color: white;
    padding: 2em;
}

.bg-slate {
    background-color: #2A3942;
    color: white;
    padding: 2em;
}

.bg-raspberry a, .bg-slate a {
    color: white; 
    text-decoration: underline;
}

.prev-chapter, .next-chapter {
    margin-top: 1em;
    margin-bottom: 2em;
}

.next-chapter {
    text-align: right;
}

@media (max-width: 768px) {
    .prev-chapter, .next-chapter {
        text-align: center;
    }
    .prev-chapter {
        margin-bottom: 0em;
    }
}

.btn-dark {
    background-color: #2A3942;  
}

.btn-outline-dark {
    color: #2A3942;  
    border-color: #2A3942;  
}

.img-chapter {
    margin-bottom: 0.5em;
}

.img-square {
    max-width: 100px;
    margin-bottom: 0.5em;
}

/* ::marker works in Firefox/Safari. not in Chrome yet but coming soon */
ul li::marker {
    color: #C51557;
    font-size: 1.2em;
}
.boxout-lime ul li::marker {
    color: #9DC435;
}
ol li::marker {
    color: #C51557;
    font-weight: bold;
}
ol.footnotes li::marker {
    color: #2A3942;  
}

@media (min-width: 600px) {
    ul {
        padding-inline-start: 1em;
    }
}

ol.footnotes li p {
    display: inline;
}

ol.footnotes li {
    margin-bottom: 1em;
}

ol.footnotes {
	font-size: 0.9em;
	line-height: 1.5em;
}

a:hover svg path {
    fill: white;
}

.chapter-share a:hover svg path {
    fill: #C51557;
}

.intro {
	font-weight: bold;
	font-size: 1.2em;
}

.sidebar ul.chapters li {
	margin-top: 0.25em;
}

/* === Header animation */

.header {
    transform: translateZ(0);
}

@supports (animation: unredact 2s ease-out forwards) {
    #top-animate::after {
        content: '';
        display: block;
        position: absolute;
        top: 0;
        right: 0;
        width: 100%;
        height: 100%;
        background: #2A3942;
        animation: unredact 4s ease-out forwards;    
    }

    @keyframes unredact {
        0% {width: 100%; opacity: 1;}
        50% {width: 100%; opacity: 1;}
        100% {width: 0; opacity: 1;}
    }
}


/* === Navbar/links */


nav.nav .nav-link {
    padding: 0em 0.25em;
    margin-right: 0.5em;
}

nav.nav .nav-link:not(.disabled), .sidebar a, .references a, .chapters a {
    background-size: 250%;
    background-image: linear-gradient(to right, #2A3942 50%, transparent 50%);
    background-position: 90% 0%;
}

nav.nav .nav-link:hover, .sidebar a:hover, .references a:hover, .chapters a:hover {
    background-position: 0% 0%;
    color: white;
    cursor: pointer;
    text-decoration: none;
    transition: background-position 1s;
}

@media (max-width: 768px) {
    .nav-break-sm {
        flex-basis: 100%; 
    }
    a.book-container {
        justify-content: center;
    }
}


/* === Search */

.searchform label {
    position: relative;
    width: 100%;
}
.searchform label:before {
    content: "";
    position: absolute;
    left: 5px;
    top: 0;
    bottom: 0;
    width: 1em;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='18' height='18'%3E%3Cpath fill='none' d='M0 0h24v24H0z'/%3E%3Cpath d='M18.031 16.617l4.283 4.282-1.415 1.415-4.282-4.283A8.96 8.96 0 0 1 11 20c-4.968 0-9-4.032-9-9s4.032-9 9-9 9 4.032 9 9a8.96 8.96 0 0 1-1.969 5.617zm-2.006-.742A6.977 6.977 0 0 0 18 11c0-3.868-3.133-7-7-7-3.868 0-7 3.132-7 7 0 3.867 3.132 7 7 7a6.977 6.977 0 0 0 4.875-1.975l.15-.15z' fill='grey' /%3E%3C/svg%3E") center / contain no-repeat;
}

.searchform input {
    padding-left: 1.5em;
} 

/* === Footnotes */

aside a {
    cursor: pointer;
}

.bigfoot-footnote__wrapper {
    max-width: 1140px; /* match max container width */
    margin: auto;
    padding: 1em;
}

.bigfoot-footnote__wrapper p {
    display: inline;
}

.bigfoot-footnote__button {
    color: #C51557;
    cursor: pointer;
}

.bigfoot-footnote a {
    color: white; 
    text-decoration: underline;
}

.bigfoot-footnote {
    background-color: #2A3942;  
    color: white;
    z-index: 1000;
    position: fixed;
    bottom: 0;
    top: auto;
    left: 0;
    right: auto;
    -webkit-transform: translateY(100%);
    -ms-transform: translateY(100%);
    transform: translateY(100%);
    width: 100%;
    margin: 0;
    border-radius: 0;
    opacity: 1;
    border-width: 1px 0 0;
    -webkit-transition: -webkit-transform 0.3s ease;
    transition: transform 0.3s ease;
}

.bigfoot-footnote.is-active {
    -webkit-transform: translateY(0);
    -ms-transform: translateY(0);
    transform: translateY(0);
}


/* === Book cover, modified from https://3d-book-css.netlify.app/ */

a.book-container {
    background: none;
    display: flex;
    perspective: 600px;
  }
  
  @keyframes initAnimation {
    0% {
      transform: rotateY(0deg);
    }
    100% {
      transform: rotateY(-20deg);
    }
  }
  
  .book {
    width: 160px;
    height: 227px;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateY(-20deg);
    transition: 1s ease;
    animation: 1s ease 0s 1 initAnimation;
  }
  
  .book:hover {
    transform: rotateY(0deg);
  }
  
  .book > :first-child {
    position: absolute;
    top: 0;
    left: 0;
    width: 160px;
    height: 227px;
    transform: translateZ(15px);
    border-radius: 0 2px 2px 0;
    box-shadow: 5px 5px 20px #bbb;
  }
  
  .book::before {
    position: absolute;
    content: ' ';
    left: 0;
    top: 0px;
    width: 28px;
    height: 227px;
    transform: translateX(145px) rotateY(90deg);
    background: linear-gradient(90deg, 
      #fff 0%,
      #f9f9f9 5%,
      #fff 10%,
      #f9f9f9 15%,
      #fff 20%,
      #f9f9f9 25%,
      #fff 30%,
      #f9f9f9 35%,
      #fff 40%,
      #f9f9f9 45%,
      #fff 50%,
      #f9f9f9 55%,
      #fff 60%,
      #f9f9f9 65%,
      #fff 70%,
      #f9f9f9 75%,
      #fff 80%,
      #f9f9f9 85%,
      #fff 90%,
      #f9f9f9 95%,
      #fff 100%
      );
  }
  
  .book::after {
    position: absolute;
    top: 0;
    left: 0;
    content: ' ';
    width: 160px;
    height: 227px;
    transform: translateZ(-15px);
    border-radius: 0 2px 2px 0;
    box-shadow: -10px 0 50px 10px #bbb;
  }
  