/* === Post list === */

table.post-list { width: 100%; }
table.post-list td { border: 0; padding: 0; }
table.post-list td:last-child { 
	text-align: right; color: var(--accent-icons); }

/* === Drop Caps === */
.has-dropcap:first-letter {
	font-size: 6rem;
	float: left;
	margin: 0.1em 0.1em 0.1em 0;
	line-height: 0.65;
}

/* === Sidenotes === */
body { counter-reset: sidenote; }
.sidenoted   { counter-increment: sidenote; }
.snc::before { content: counter(sidenote, lower-alpha); }
.sidenoted > aside > p:first-child::before { content: counter(sidenote, lower-alpha) ". "; }

/* Put <aside> then <p> in .sidenoted div */
.sidenoted > aside {
  float: none;
  width: auto;
  margin-inline-start: 0;
}

@media (min-width: 77rem) {
  .sidenoted {
    position: relative;
  }

  .sidenoted > aside {
    position: absolute;
    left: calc(100% + 1.5rem);
    top: 0;
    width: min(20rem, calc((100vw - 100% - 2vw) / 2 - 1.5rem));
    margin: 0;
    padding: 0.4em 0.6em;
    font-size: 0.85rem;
    line-height: 1.4;
    border-radius: 0;
    border: none;
    border-left: 2px solid currentColor;
    background: transparent;
  }

  .sidenoted:nth-of-type(even) > aside {
    left: auto;
	border-left: none;
	text-align: right;
    right: calc(100% + 1.5rem);
    border-right: 2px solid currentColor;
  }

  .sidenoted > aside p {
    margin: 0.4em 0;
  }
}

/* === Header left icon/title === */
body:has(.header-left) > header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-block: 0.75rem;
}

body:has(.header-left):not(:has(.header-right)) > header::after {
  content: '';
  flex: 1;
}

.header-right {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
}

.header-right select {
  margin: 0;
  background-image: none;
  padding-inline-end: 0.5em;
  width: auto;
}

.header-left {
  flex: 1;
  text-align: left;
  margin: 0;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.5rem 0;
}

body:has(.header-left) > header nav {
  flex: 0 1 auto;
  padding: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  row-gap: 0.5rem;
}

body:has(.header-left) > header nav a {
  margin-bottom: 0;
}

@media (max-width: 45rem) {
  body:has(.header-left) > header {
    flex-direction: column;
  }

  body:has(.header-left) > header::after {
    display: none;
  }

  .header-left {
    flex: none;
    text-align: center;
    font-size: 2.5rem;
    padding: 0.5rem 0 0;
  }
}

/* === Arrow-less dropdown === */

select.no-arrow {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	background-image: none;
	padding-inline-end: 0.5em;
}
select.no-arrow::-ms-expand { display: none; }

/* === Hover dropdown === */
/* WARN: Unfinished, only styled for header */

.hoverdrop {
  position: relative;
  display: inline-block;
}

.hoverdrop-content {
  display: none;
  position: absolute;
  top: 100%;
  z-index: 10;
  min-width: 100%;
  padding-top: 0.25rem;
}

.hoverdrop-content a + a { margin-top: 0.25rem; }
.hoverdrop-content a {
  display: block;
  background-color: var(--accent-bg);
}

.hoverdrop:hover .hoverdrop-content { display: block; }

@media (max-width: 45rem) {
  .hoverdrop-content { background-color: var(--accent-bg); }
  .hoverdrop-content a { padding: 0.5rem 1rem; }
}

/* === Banner === */

header .banner {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  margin: 0;
  margin-block-start: 0;
  object-fit: cover;
  grid-column: 1 / -1;
}

body > header > img.banner:first-child {
  display: block;
  width: 100%;
  height: auto;
  margin-block-start: 0 !important;
  margin-block-end: 0;
}

/* === Per-page background overrides === */

:root {
  --body-bg: var(--bg);
  --main-bg: var(--bg);
  --section-bg: var(--bg);
  --comic-bg: white;
  --comic-font: 'Comic Sans MS', 'Comic Neue', sans-serif;
}

body    { background: var(--body-bg); }
main    { background: var(--main-bg); }
section { background: var(--section-bg); }

/* === Comic === */

#comic-description {
  padding-top: 1em;
  padding-bottom: 1em;
}

#comic-container img {
  display: block;
  width: 100%;
}

#comic-container img.full-bleed {
  width: 100vw;
  max-width: none;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

#comic-container img.half-bleed {
  display: block;
  width: 120%;
  max-width: none;
  margin-left: -10%;
  height: auto;
}

/* === Comic navigation === */

.comic-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.comic-navigation .nav-left   { text-align: left; }
.comic-navigation .nav-center { text-align: center; flex: 1; }
.comic-navigation .nav-right  { text-align: right; }
.comic-navigation select      { margin-top: 0.5em; }

#comic-buttons {
  padding: 0.5rem;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  background: var(--comic-bg);
  width: 100%;
  max-width: none;
}

#comic-buttons:empty {
  background: none;
}

#comic-buttons button {
  font-family: var(--comic-font);
  font-size: 1.25rem;
  color: black;
  background-color: #ffb300;
  background-image: radial-gradient(circle, rgba(0,0,0,0.07) 1px, transparent 1px);
  background-size: 4px 4px;
  border: 4px solid #000;
  border-radius: 4% 95% 6% 95%/95% 4% 92% 5%;
  box-shadow: 0.2em 0.2em;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  transition: transform 0.1s ease-in-out;
}

@media only screen and (max-width: 720px) {
  #comic-buttons button {
    font-size: 0.75rem;
    border: 3px solid #000;
  }
}

#comic-buttons button:hover {
  transform: scale(1.05);
  background-color: #FDD835;
}

/* === Comic series archive === */

.series-entry {
  --thumb: clamp(8rem, 20vw, 12rem);
  display: grid;
  grid-template-columns: var(--thumb) 1fr;
  gap: 0 1rem;
}

.series-entry h2 { margin: 0; }

.series-entry img {
  grid-row: 1 / span 2;
  width: 100%;
  height: auto;
}

.series-entry ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.series-entry ul.short-list { display: block; }
.series-entry ul.short-list li + li { margin-top: 0.25rem; }

.series-entry ul.long-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.series-entry:nth-of-type(even) { grid-template-columns: 1fr var(--thumb); }
.series-entry:nth-of-type(even) img { grid-column: 2; }
.series-entry:nth-of-type(even) h2,
.series-entry:nth-of-type(even) ul  { grid-column: 1; }
