/*
  This file is part of the Comical Template (https://comicaltemplate.euxane.eu)
  Version: 1.0
  License: MIT

  This file is the stylesheet that determines how the elements are presented on the site.
*/


/*
  Custom font

  Free comic font from: https://www.peppercarrot.com/en/fonts/
  Font license: SIL Open Font License, Version 1.1
*/

@font-face {
  font-family: 'PepperCarrot';
  src: url('PepperCarrot.font.woff2') format('woff2');
}

body {
  font-family: 'PepperCarrot', sans-serif;
}


/*
  Responsive sizing for big and small viewports
*/

html {
  font-size: 1.4rem;
}

body {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 0.4em;
}

img,
object {
  max-width: 100%;
}

@media screen and (width <=768px) {
  html {
    font-size: 1rem;
  }

  ul,
  ol {
    padding-left: 1.4rem;
  }

  blockquote {
    margin: 0.8rem;
  }

  .split {
    display: block;
  }
}

@media screen and (width >768px) {
  .split {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.4em 1em;
  }

  .split>* {
    text-align: left !important;
    margin: 0 !important;
  }
}


/*
  Page header and page footer
*/

header {
  border-bottom: 1px solid gray;
  text-align: center;
}

header hgroup {
  margin: 1rem 0 0.6rem 0;
}

footer {
  border-top: 1px solid gray;
}

header>*,
footer>* {
  margin: 1rem;
}

hgroup>* {
  margin: 0;
}

main hgroup {
  margin: 1.6rem 0;
}

/*
  Inline navigation links, separated by "|"
*/

header,
footer {
  nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0;
    margin: 0;
  }

  ul li+li::before {
    content: "|";
    padding: 0.6em;
  }
}


main>h2,
item-view>div.split>hgroup {
  text-align: center;

  margin: 2rem 1rem 1.6rem 1rem;

  @media screen and (width <=768px) {
    margin: 1rem 1rem 0.8rem 1rem;
  }
}

section,
item-view>* {
  display: flow-root;

  margin: 1.6rem 0 1.6rem 0;

  @media screen and (width <=768px) {
    margin: 0.8rem 0 0.8rem 0;
  }
}

section {
  padding: 0 1rem 0 1rem;
  background-color: #ececec;
  border-radius: 6px;
}

error-pane {
  color: red;
}


item-view {
  >div.split {
    align-items: flex-end;
    padding: 0 1rem;
  }

  >object {
    margin-inline: auto;
  }
}

paginator-arrows {
  >nav {
    list-style: none;
    display: flex;
    gap: 1.2em;
    justify-content: center;
    user-select: none;
  }

  a svg {
    display: block;
    width: 2.8em;
    height: 2.8em;
  }

  a[href=""] {
    color: lightgrey;
    pointer-events: none;
  }
}

/*
  Comics archive lists
*/

ul:has(>for-each-item) {
  & {
    list-style: none;
    padding: 0 1em 1em 1em;
    display: flex;
    flex-direction: column;
    gap: 1em;
  }

  li a {
    display: flex;
    align-items: center;
    text-decoration: none;
  }

  li a:hover {
    background-color: #e0e0e0;
  }

  div {
    margin: 0.4em 1em;
  }

  div>* {
    margin: 0;
  }

  div>h4 {
    text-decoration: underline;
    margin-bottom: 0.2em;
  }

  div>date-time {
    font-size: 0.8em;
  }

  img {
    display: block;
    width: 6em;
    height: 6em;
    object-fit: cover;
  }

  a,
  a img {
    border-radius: 6px;
  }
}

section.character img {
  float: right;
  border-radius: 6px;
  margin: 1em 0 1em 1em;
}