body {
  margin: 0;
  font-family: "Lato", sans-serif;
  line-height: 1.8;
  background-color: #eee;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  padding-top: 1em;
  padding-bottom: 1em;
  margin: 0em 1em 1em 1em;
  color: #444;
  flex: 1;
}

div.content > aside {
  display: none;
}

header {
  border-bottom: solid thin black;
  background-color: #fff;
}

header > .container {
  display: grid;
  grid-template-columns: 0fr 1fr 1fr;
  padding-top: 0.5em;
  padding-bottom: 0.5em;
  max-width: 80em;
}

header .navigation {
  text-align: right;
}

header .navigation li {
  float: right;
}

header .navigation li a {
  margin: 0.5em;
}

.navigation li:hover {
  background-color: #ffbd52;
}

aside.navigation ol ol li:hover {
  background-color: #ffd48f;
}

@media (min-width: 70em) {
  .navigation {
    margin-right: 1em;
  }
  header .navigation li {
    padding: 0.5em;
  }
  header > .container {
  }
}

.brand {
  margin-left: 1em;
  margin-top: 1em;
}

.brand .strapline {
  font-size: 0.8em;
  color: #666;
  margin-left: 1em;
  font-style: italic;
}

div.content {
  background-color: #fff;
  max-width: 80em;
  flex: 1;
  display: flex;
  flex-direction: column;
}

header > div.container > aside {
  display: block;
  width: 0em;
  margin-left: auto;
}

@media (min-width: 70em) {
  div.content > aside,
  header > div.container > aside {
    display: block;
    width: 20em;
    margin-left: auto;
  }
  main {
    padding-right: 1em;
  }

  header > div.container {
    grid-template-columns: 1fr 25em 25em 1fr;
    margin: auto;
  }

  div.content {
    display: grid;
    margin: auto;
    grid-template-columns: 1fr 55em 1fr;
  }

  div.content > main {
    font-size: 115%;
  }

  .brand {
    text-align: left;
  }

  div.content > aside > section {
    position: sticky;
    width: 20em;
    top: 0;
    margin-left: auto;
    margin-right: 2em;
    text-align: right;
  }

  .post h1 {
    background-color: #fff;
  }

  .message {
    display: grid;
    grid-template-columns: 50% 1fr;
    height: 30em;
    max-width: 60em;
    margin: auto;
  }

  .message .strapline,
  .message .contact {
    align-self: center;
    padding-right: 2em;
  }

  .splash {
    min-height: 60vh;
  }
}

.splash {
  padding: 2em;
}

.strapline {
  text-align: right;
}

.message .strapline {
  font-size: 370%;
  line-height: 1.3em;
  text-align: right;
}

.phrase {
  position: relative;
}

.hide-by-default {
  display: none;
}

.phrase .letters {
  position: absolute;
  right: -0em;
  text-wrap: right;
}

.message .contact {
  font-size: 170%;
  line-height: 1.3em;
  max-width: 15em;
}

.message .moreline {
  width: 70%;
  align-self: center;
  font-size: 200%;
}

aside.navigation ul,
header ul,
aside.navigation ol {
  list-style-type: none;
}

main a,
.navigation a,
.home a {
  text-decoration: none;
  padding-bottom: 1px;
  color: #333;
  border-bottom: 1px dashed #000;
}

header a {
  text-decoration: none;
  padding-bottom: 1px;
  color: #000;
}

main a:hover,
.navigation a:hover,
.home a:hover {
  border-bottom: 1px solid #ffbd52;
}

div.content > aside a {
  font-size: 90%;
}

h2 a,
h2 a:hover,
h3 a,
h3 a:hover {
  border-bottom-width: 0px;
}

h1,
h2 {
  font-size: 1.5em;
}

h1 {
  text-align: center;
  margin-top: 0;
}

h2 {
  margin-top: 0;
}

.guide h1 {
  padding-left: 1.5em;
}

main.blog section.content {
  text-align: right;
  color: #222;
  font-weight: bold;
}

h1,
h2:first-child {
  margin-bottom: 0;
  padding-bottom: 0;
}

main.post h2::before {
  opacity: 0;
  transition: opacity 0.5s ease;
  content: "#";
  position: absolute;
  margin-left: -1em;
}

main.post h2:hover::before {
  color: #888;
  opacity: 1;
  transition: none;
}

.date {
  color: #444;
  font-size: 80%;
  margin-bottom: 2em;
}

.excerpt .date {
  text-align: left;
}

div.excerpt {
  padding: 0em 0.5em 0.5em 0.5em;
  margin-bottom: 2em;
  transition: box-shadow 0.8s ease;
}

div.excerpt p {
  font-size: 90%;
}

div.excerpt:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.read-more {
  position: relative;
  margin-top: 1em;
  display: inline-block;
}

.loading-dots {
  display: inline-block;
  margin-left: 10px;
  opacity: 0;
  transition: opacity 1s ease;
}

.excerpt:hover .loading-dots {
  opacity: 1;
}

.loading-dots span {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #333;
  margin: 0 2px;
  opacity: 0;
}

.excerpt:hover .loading-dots span:nth-child(1) {
  animation: fadeInDot 1s ease-in-out forwards;
  animation-delay: 0s;
}

.excerpt:hover .loading-dots span:nth-child(2) {
  animation: fadeInDot 1s ease-in-out forwards;
  animation-delay: 1s;
}

.excerpt:hover .loading-dots span:nth-child(3) {
  animation: fadeInDot 1s ease-in-out forwards;
  animation-delay: 2s;
}

@keyframes fadeInDot {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

main.post .date {
  text-align: center;
}

main img {
  display: block;
  width: 80%;
  margin: auto;
}

header .navigation {
  color: #999;
  font-size: 80%;
  text-align: right;
}

ul.categories > li {
  display: inline-block;
}

main .navigation {
  margin: 4em 0em;
}

.navigation .previous {
  text-align: left;
}

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

footer {
  padding: 2em 1em 1em 1em;
  font-size: 70%;
  color: #eee;
  background: #000;
  margin: 0;
}

footer > div.container {
  margin-bottom: 2em;
  max-width: 60em;
  margin-left: auto;
  margin-right: auto;
}

footer a {
  color: #eee;
}

footer img {
  float: right;
  margin-top: 1em;
}

footer div.blurb {
  vertical-align: middle;
  padding-left: 1em;
}

@media (max-width: 40em) {
  footer div.blurb span.registered {
    display: block;
  }
  .brand {
    display: flex;
    align-items: flex-end;
    white-space: nowrap;
  }
  .brand .strapline {
    font-size: 0.6em;
    margin-left: 0.5em;
  }
}

table {
  margin: auto;
  border-collapse: collapse;
}

td,
th {
  padding: 0.1em 1em;
  border: 1px solid #ccc;
}

th {
  background-color: #eee;
}

p code {
  font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
  font-size: 80%;
  background-color: #c7c8c2;
  padding: 0.3em 0.5em;
  border-radius: 0.3em;
  color: #111;
}

pre code {
  font-size: 80% !important;
}

section.snacks {
  max-width: 80em;
  margin: auto;
}

section.snacks h2,
section.snacks > p {
  margin-right: 1em;
}

article.snack {
  max-width: 40em;
  padding: 1em;
  margin-top: 1em;
}

.post aside {
  margin: 2em 0em 0em 2em;
  padding: 0em 1em 1em 2em;
  border: 1px dashed #000;
  font-size: 75%;
}

div.title {
  position: relative;
}

div.type {
  z-index: 999;
  background-color: #ff6160;
  color: #fff;
  padding: 4px;
  border-radius: 5px;
  position: absolute;
  top: 0px;
  left: 0px;
  display: inline;
}

div.type.hidden {
  background-color: #9e3938;
}

blockquote {
  line-height: 150%;
  border-left: 5px solid black;
  margin-left: 0px;
  padding-top: 1.5em;
  padding-left: 1em;
  padding-bottom: 0em;
  padding-right: 1em;
  quotes: "\201c" "\201d";
  background-color: #ffe7e7;
}

blockquote > p {
  display: inline;
}

blockquote:before {
  font-size: 400%;
  content: open-quote;
  display: block;
}

blockquote:after {
  font-size: 400%;
  padding-top: 0.5em;
  content: close-quote;
  display: block;
}

/* Search styles */
#search-container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  position: relative;
  margin-top: 0.5em;
}

.search-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: background-color 0.2s;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: right;
  justify-content: right;
}

.search-toggle:hover {
  background-color: #f0f0f0;
}

.search-icon {
  width: 16px;
  height: 16px;
  position: relative;
}

.search-icon::before {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border: 3px solid #666;
  border-radius: 50%;
  top: 0;
  left: 0;
}

.search-icon::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 6px;
  background-color: #666;
  transform: rotate(135deg);
  bottom: 0;
  right: 0;
}

.search-box {
  right: 0;
}

#search-input {
  padding: 8px 12px;
  border: 2px solid #ddd;
  border-radius: 4px;
  font-family: "Lato", sans-serif;
  outline: none;
  transition: border-color 0.2s;
}

#search-input:focus {
  border-color: #ffbd52;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.search-result {
  display: block;
  padding: 12px;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.2s;
}

.search-result:hover,
.search-result-selected {
  background-color: #f8f8f8;
}

.search-result:last-child {
  border-bottom: none;
}

.search-result-title {
  font-weight: bold;
  color: #333;
  margin-bottom: 4px;
  font-size: 14px;
}

.search-result-meta {
  font-size: 11px;
  color: #999;
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-result-category {
  background-color: #ffbd52;
  color: white;
  padding: 2px 6px;
  border-radius: 2px;
  font-size: 10px;
  text-transform: uppercase;
}

.search-no-results {
  padding: 12px;
  color: #666;
  font-style: italic;
  text-align: center;
}

/* Category sidebar styles */
.categories-sidebar {
  padding: 1em;
  position: sticky;
  top: 0;
}

.categories-sidebar h3 {
  margin-top: 0;
  margin-bottom: 1em;
  font-size: 1.1em;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: right;
}

.category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  flex-direction: row-reverse;
}

.category-tag {
  display: inline-block;
  padding: 0.5em 1em;
  background-color: #e6f3ff;
  color: #333;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9em;
  transition:
    background-color 0.2s,
    transform 0.2s;
}

.category-tag:hover {
  background-color: #cce7ff;
  transform: translateY(-1px);
}

.category-tag.active {
  background-color: #1e3a8a;
  color: white;
}

.category-tag.active:hover {
  background-color: #1e40af;
  transform: translateY(-1px);
}

.contact-link {
  margin-top: 1.5em;
  text-align: right;
}

.contact-link a {
  color: #666;
  text-decoration: none;
  font-size: 0.9em;
  border-bottom: 1px dashed #666;
}

.contact-link a:hover {
  color: #333;
  border-bottom: 1px solid #ffbd52;
}

@media (max-width: 768px) {
  .categories-sidebar {
    margin-bottom: 1em;
  }
}
