/* colours */
:root {
  --space-indigo: #22223bff;
  --dusty-grape: #4a4e69ff;
  --lilac-ash: #9a8c98ff;
  --almond-silk: #c9ada7ff;
  --parchment: #f2e9e4ff;
}

/* headings */
h1,
h2,
h3 {
  margin: 0;
  text-align: center;
}

h1 {
  font-weight: bold;
  padding: 0.75em;
}

h2 {
  background: var(--parchment);
  border-radius: 7px;
  display: inline-block;
  margin: 2px 0;
  padding: 0.75em;
  text-align: center;
}

h4 {
  font-size: 1.3rem;
  margin-bottom: 0;
}

h5 {
  font-size: 1.1rem;
  margin-bottom: 0;
}

.no-center {
  text-align: left;
}

/* links */
a {
  color: var(--dusty-grape);
  font-weight: bold;
  text-decoration: 2px dotted underline var(--space-indigo);
}

h2 a {
  color: inherit;
  font-weight: inherit;
  /*text-decoration: 2px dotted underline var(--almond-silk);*/
}

h1 a {
  color: var(--parchment);
  font-weight: inherit;
  text-decoration: 2px dotted underline var(--almond-silk);
}

/* images */
img {
  border-radius: 7px;
}

/* list items */
ul {
  padding: 0;
}

li {
  list-style: none;
  margin: 2px 0;
}

/* disc for lists */
.list-disc {
  margin-left: 2em;
}

.list-disc > li {
  list-style: disc;
  margin: 2px 0;
}

/* grid stuff */
.main-head {
  grid-area: header;
}
.content {
  grid-area: content;
}
.main-nav {
  grid-area: nav;
}
.nav-pin {
  grid-area: nav-pin;
}
.nav-unpinned {
  grid-area: nav-unpinned;
}
.main-aside {
  grid-area: aside;
}
.main-footer {
  grid-area: footer;
}

.main-wrapper,
.content-wrapper,
.blog-wrapper {
  display: grid;
  gap: 20px;
  grid-template-areas:
    "header"
    "nav"
    "content"
    "aside"
    "footer";
}

@media (width < 500px) {
  .main-wrapper {
    grid-template-areas:
      "header"
      "nav-pin"
      "content"
      "aside"
      "nav-unpinned"
      "footer";
  }
  .content-wrapper {
    grid-template-areas:
      "header"
      "nav-pin"
      "content"
      "nav-unpinned"
      "footer";
  }
  .blog-wrapper {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "header"
      "nav"
      "content"
      "footer";
  }
  nav {
    display: contents;
  }
  nav ul {
    display: flex;
    justify-content: space-evenly;
    flex-wrap: wrap;
    gap: 10px;
  }
  h2 {
    padding: 0.25em;
  }
}

/* grid layout for header, nav, content, aside and footer */
@media (width < 700px) and (width >= 500px) {
  .main-wrapper {
    grid-template-columns: 1fr 3fr;
    grid-template-areas:
      "header  header"
      "nav-pin     nav-pin"
      "aside content"
      "nav-unpinned nav-unpinned"
      "footer      footer";
  }
  .content-wrapper {
    grid-template-columns: 1fr 3fr;
    grid-template-areas:
      "header  header"
      "nav-pin     nav-pin"
      "content content"
      "nav-unpinned nav-unpinned"
      "footer      footer";
  }
  .blog-wrapper {
    grid-template-areas:
      "header"
      "nav"
      "content"
      "footer";
  }
  nav {
    display: contents;
  }
  nav ul {
    display: flex;
    justify-content: space-evenly;
  }
}

@media (width >= 700px) {
  .main-wrapper {
    grid-template-columns: 1fr 4fr 1fr;
    grid-template-areas:
      "header header  header"
      "nav    content aside"
      "nav    content aside"
      "footer footer  footer";
  }
  .content-wrapper {
    grid-template-columns: 1fr 4fr 1fr;
    grid-template-areas:
      "header header  header"
      "nav    content content"
      "nav    content content"
      "footer footer  footer";
  }
  .blog-wrapper {
    grid-template-columns: 1fr 4fr 1fr;
    grid-template-areas:
      "header header  header"
      "nav    content content"
      "nav    content content"
      "footer footer  footer";
  }
  nav ul {
    flex-direction: column;
  }
}

/* header */
.banner {
  object-fit: contain;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 7px;
}

.main-head h1 {
  text-align: left;
  padding: 0;
  a {
  }
}

/* body */
body {
  margin: 0 auto;
  max-width: 1200px;
  background-color: var(--space-indigo);
}

body.pattern {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='100%25' width='100%25'%3E%3Cdefs%3E%3Cpattern id='doodad' width='46' height='46' viewBox='0 0 40 40' patternUnits='userSpaceOnUse' patternTransform=''%3E%3Crect width='100%25' height='100%25' fill='rgba(74, 85, 104,1)'/%3E%3Cpath d='M0 40h-10v-60h60L40 0L39 1h-38v38z' fill='rgba(113, 128, 150,1)'/%3E%3Cpath d='M40 0v10h60v60L0 40L1 39h38v-38z' fill='rgba(45, 55, 72,1)'/%3E%3Cpath d='M40 0v10h60v60L0 40L0 40h40v-40z' fill='rgba(113, 128, 150,1)'/%3E%3Cpath d='M0 40h-10v-60h60L40 0L40 0h-40v40z' fill='rgba(45, 55, 72,1)'/%3E%3C/pattern%3E%3C/defs%3E%3Crect fill='url(%23doodad)' height='200%25' width='200%25'/%3E%3C/svg%3E ");
}

body.blog {
  font-size: 16px;
  margin: 55px auto;
  max-width: 1000px;
}

main,
section,
nav section,
aside section {
  background: #fff;
  border-radius: 7px;
  padding: 0.5em;
}

main,
nav,
aside {
  align-self: start;
}

main {
  padding: 1em;
}

main article,
main footer {
  clear: both;
  display: block;
  width: 100%;
}

nav section,
aside section,
main article,
main footer {
  margin-bottom: 5px;
  h2 {
    display: block;
  }
}

main footer p {
  margin: 0 0;
}

/* nav */
nav ul,
aside ul {
  padding: 0;
  gap: 0.5rem;
  margin: 0 0;
}

nav section {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
}

/* aside */
aside section {
  text-align: center;
  ul {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
  }
}

/* footer */
footer {
  text-align: center;
  a {
    color: var(--almond-silk);
  }
}

.main-footer {
  p {
    color: var(--parchment);
  }
}

/* quote */
div:has(> blockquote) {
  background-color: #ededed;
  margin: 10px auto;
  padding: 15px;
  border-radius: 5px;
  max-width: 500px;
}

blockquote p::before {
  content: "\201C";
}

blockquote p::after {
  content: "\201D";
}

blockquote + p {
  text-align: right;
}

/* figure */
figure {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 1em 0;
  width: 100%;
  max-width: 100%;
}

figure audio {
  margin: 0.5em;
  width: 100%;
  max-width: 300px;
}

figcaption {
  padding: 10px;
  text-align: center;
  word-wrap: break-word;
}

.push-left {
  padding: 10px;
  margin: 1em auto 1em auto;
  max-width: 100%;
}

@media (min-width: 700px) {
  .push-left {
    float: left;
    clear: both;
    padding: 10px;
    max-width: 400px;
  }
}

/* center elements side by side centered */
@media (min-width: 450px) {
  .center-vertical {
    display: flex;
    align-items: center;
    gap: 15px;
  }
}

/* details and summary boxes */
details {
  border: 1px solid #aaaaaa;
  border-radius: 4px;
  padding: 0.5em 0.5em 0;
}

summary {
  font-weight: bold;
  margin: -0.5em -0.5em 0;
  padding: 0.5em;
}

details[open] {
  padding: 0.5em;
}

details[open] summary {
  border-bottom: 1px solid #aaaaaa;
  margin-bottom: 0.5em;
}

/* Links listing */
.listing {
  list-style: none;
  margin: 2em;
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  grid-auto-rows: 1fr;
  align-items: center;
}

.listing > li {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.listing .body {
  padding: 10px;
  ul {
    margin-left: 1em;
  }
  li {
    list-style: disc;
  }
}

/* hgroup center */
hgroup {
  text-align: center;
  align-items: center;
  p {
    margin: 0.5em;
  }
}

/* horizontal rule */
hr {
  border: none;
  border-top: 3px double #333333;
  color: #333333;
  overflow: visible;
  text-align: center;
  height: 5px;
  max-width: 66%;
}

hr::after {
  background: white;
  content: "§";
  padding: 0 4px;
  position: relative;
  top: -13px;
}

/* code */
code {
  background-color: #eeeeee;
  border-radius: 3px;
  font-family:
    ui-monospace,
    SFMono-Regular,
    SF Mono,
    Menlo,
    Consolas,
    "Liberation Mono",
    monospace;
  /* font-family: "Courier New", monospace; */
  padding: 0 3px;
}

.code-block {
  background-color: #eeeeee;
  border-radius: 3px;
  /* font-family: "Courier New", monospace; */
  padding: 0.5em 0.5em;
  overflow: scroll;
}

video {
  display: block;
  width: 80%;
  height: auto;
  margin: 1em;
}
