:root {
  --bg-color: #fffff8;
  --text-color: #000000;
  --nav-bg-color: #f0f0f0;
  --nav-bg-hover-color: #e0e0e0;
  --nav-bg-active-color: #d8e2f0;
  --highlight-bar-color: #000080;
  --border-color: #cccccc;
  --meta-text-color: #666;
  --content-text-size: 1.4rem;
  --table-bg-color: #fffef8;
  --table-header-bg-color: #f5f4ef;
  --quote-bg-color: #fffef8;
}

.dark-theme {
  --bg-color: #1a1a1b;
  --text-color: #f1f1f1;
  --nav-bg-color: #333333;
  --nav-bg-hover-color: #444444;
  --nav-bg-active-color: #555555;
  --highlight-bar-color: var(--text-color);
  --border-color: #555555;
  --meta-text-color: #aaa;
  --table-bg-color: #2a2a28;
  --table-header-bg-color: #383836;
  --quote-bg-color: #2a2a28;
}

body {
  font-family: 'EB Garamond', serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 0rem;
  padding-bottom: 8rem;
  font-size: 1.1rem;
  line-height: 1.7;
  transition: background-color 0.3s, color 0.3s;
  -webkit-text-stroke-width: 0.0125rem;
  font-optical-sizing: auto;
  font-style: normal;
}

.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 0.5rem;
}

header {
  margin-bottom: 2rem;
}

/* Default screen size; limiting case as well. */
header h1 {
  font-size: 3.5rem;
  /*white-space: nowrap;*/
  margin: 0 0 1rem 0;
  font-weight: 400;
}

/* Smaller screens. */
@media (max-width: 600px) {
  header h1 {
    font-size: 10vw;
  }
}

.site-title-link {
  text-decoration: none;
}
.site-title-link:hover {
  text-decoration: none;
}

nav {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: flex-end;

}

.nav-link {
  background-color: transparent;
  border: none;
  padding: 0.0rem 0.5rem;
  text-decoration: none;
  color: var(--text-color);
  position: relative;
  cursor: pointer;
  transition: background-color 0.3s, border-color 0.3s;
  border-radius: 4px;
}

.nav-link:hover {
  text-decoration: underline;
}

#nav-radio-blog:checked ~ header #nav-blog:hover {
  text-decoration: none;
}

.nav-radio {
  display: none;
}

#nav-radio-blog:checked ~ header #nav-blog {
  background-color: transparent;
  border-color: var(--border-color);
}

#nav-radio-blog:checked ~ header #nav-blog::after {
  content: '';
  position: absolute;
  bottom: -0.3rem;
  left: 5%;
  width: 90%;
  height: 2.5px;
  background-color: var(--highlight-bar-color);
  border-radius: 3px;
}

.theme-switch-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-icon-label {
  font-size: 16px;
  line-height: 1;
}

.theme-toggler {
  background-color: var(--nav-bg-color);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  position: relative;
  width: 40px;
  height: 20px;
  transition: background-color 0.3s;
}

.theme-toggler .ball {
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  position: absolute;
  top: 1.25px;
  left: 2px;
  height: 14px;
  width: 14px;
  transition: transform 0.2s linear;
}

.dark-theme .theme-toggler .ball {
  transform: translateX(20px);
}

.post-entry h2 {
  margin-bottom: 0.5rem;
}

.post-summary {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.post-meta p {
  margin: 0;
  font-size: 1rem;
  color: var(--meta-text-color);
}

.post-details > p {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.category-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.category-label {
  background-color: var(--nav-bg-color);
  border: none;
  padding: 0.2rem 0.6rem;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--text-color);
  border-radius: 3px;
  transition: background-color 0.3s;
}

.category-label:hover {
  background-color: var(--nav-bg-hover-color);
  text-decoration: none;
}

.category-list {
  font-size: var(--content-text-size);
}

hr {
  border: none;
  height: 1px;
  background-color: var(--border-color);
  margin: 1.25rem 0;
}

main h1, main h2 {
  margin-top: 0;
}

a {
  color: var(--text-color);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.about-content p {
  font-size: var(--content-text-size);
  line-height: 1.45;
}

.about-content a {
  text-decoration: underline;
}

.post-content img {
  width: 100%;
  height: auto;
  margin-bottom: 2rem;
  border-radius: 4px;
}

.post-content p {
  font-size: var(--content-text-size);
  line-height: 1.45;
}

.post-meta-container {
  margin-bottom: 1.5rem;
}

/* Table Styles */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 1.1rem;
  border-radius: 12px;
  overflow: hidden;
}

.post-content th, .post-content td {
  padding: 0.75rem;
  text-align: left;
  border: none;
}

.post-content thead th {
  background-color: var(--table-header-bg-color);
  font-weight: 700;
}

.post-content tbody td {
  background-color: var(--table-bg-color);
}

/* Chart Styles */
.post-content figure {
  max-width: 80%;
  margin: 1rem auto 2.5rem;
}

.post-content figure img {
  padding: 0;
  margin: 0;
  /* Set the initial state and transition for the image filter */
  filter: invert(0);
  transition: filter 0.3s ease-in-out;
}

/* Invert the figure image colors when dark theme is active */
.dark-theme .post-content figure img {
  filter: invert(1);
}

.post-content figcaption {
  font-size: 1.1rem;
  color: var(--meta-text-color);
  text-align: center;
  margin-top: 0rem;
  line-height: 1.5;
}

.chart {
  width: 100%;
  height: auto;
  font-family: sans-serif;
  font-size: 10px;
}

.chart .axis,
.chart .grid-line {
  stroke: var(--text-color);
  stroke-width: 1;
}

.chart .label,
.chart .axis-label {
  fill: var(--text-color);
}

.chart .bar {
  stroke: var(--text-color);
  stroke-width: 1.5;
}

/* Blockquote Styles */
.post-content blockquote {
  margin: 2rem 2.5rem;
  padding: 1rem 1.5rem;
  background-color: var(--quote-bg-color);
  border-left: 4px solid var(--highlight-bar-color);
  font-style: italic;
}

.post-content blockquote p {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.post-content blockquote footer {
  font-style: normal;
  text-align: right;
  font-size: 1rem;
  color: var(--meta-text-color);
}

/* Code Block Styles */
.post-content .code-block {
  background-color: var(--table-bg-color);
  border-radius: 8px;
  padding: 1rem;
  margin: 2rem 0;
  overflow-x: auto;
  font-size: 1rem;
  line-height: 1.5;
}

.post-content .code-block code {
  font-family: 'Roboto Mono', monospace;
  color: var(--text-color);
}

.post-content .code-block .code-keyword {
  font-weight: bold;
}

.post-content .code-block .code-comment {
  color: var(--meta-text-color);
  font-style: italic;
}

.related-posts-container {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.related-posts-container h3 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.4rem;
}

.related-posts-list {
  margin: 0;
  padding-left: 20px;
}

.related-posts-list li:not(:last-child) {
  margin-bottom: 1rem;
}

.related-post-item {
  text-decoration: none;
  color: var(--text-color);
}

.related-post-item:hover .related-post-title {
  text-decoration: underline;
}

.related-post-title {
  font-weight: normal;

}

.post-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.post-nav-button {
  background-color: var(--nav-bg-color);
  border: none;
  padding: 0.2rem 0.6rem;
  font-size: 0.9rem;
  font-weight: bold;
  text-decoration: none;
  color: var(--text-color);
  border-radius: 3px;
  transition: background-color 0.3s;
}

.post-nav-button:hover {
  background-color: var(--nav-bg-hover-color);
}

ol, li {
  font-size: var(--content-text-size);
}
