/* Use an even softer black for light mode */
:root {
  --bg-color: #fafafa;
  --text-color: #333; /* darker text color for light mode */
}

.dark-mode {
  --bg-color: #1e1e1e;
  --text-color: #e0e0e0;
}

/* Use Libre Baskerville for body text */
body {
  font-family: 'Instrument Sans', sans-serif;
  margin: 10px auto;
  max-width: 700px;
  line-height: 1.6;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background 0.3s, color 0.3s;
}

/* Use Open Sans for headings */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Libre Baskerville', serif; 
  font-weight: bold;
}

/* Use Instrument Sans (body's font) for navigation links and controls */
#nav-links a,
.nav-controls button {
  font-family: 'Instrument Sans', sans-serif;
}

/* Theme Toggle */
#theme-toggle {
  cursor: pointer;
  border: none;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
}

#theme-toggle img {
  width: 20px;
  height: 20px;
}

/* Hide the sun/moon icon */
html.dark-mode img#sun-icon {
  filter: invert(1);
  display: inline;
}
html.dark-mode img#moon-icon {
  display: none;
}
html:not(.dark-mode) img#moon-icon {
  display: inline;
}
html:not(.dark-mode) img#sun-icon {
  display: none;
}

/* Align navigation links and theme toggle button inline */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  gap: 10px;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

#nav-links {
  display: flex;
  flex-direction: row;
  gap: 15px;
}

#nav-links a {
  display: flex;
  align-items: center; /* centers the icon and text vertically */
  font-size: 1.1em;
  padding: 12px 8px;
  margin: 0;
  text-align: left;
  text-decoration: none;
  color: inherit;
  font-weight: bold;            /* Ensure nav links are bold */
}

.nav-icon {
  width: 30px;      /* Adjust the size as needed */
  height: 30px;
  border-radius: 50%; /* Makes the image round */
  margin-right: 8px;  /* Spacing between the image and "Home" text */
  object-fit: cover;  /* Ensures the image fills the container neatly */
}

/* General link style */
a {
  font-family: inherit;
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover, a:focus {
  text-decoration: underline;
  color: #4f8cff;
}

/* Pagination Navigation */
.pagination-nav {
  display: flex;
  justify-content: space-between;
  margin: 2em 0;
}

.pagination-nav .prev {
  text-align: left;
}

.pagination-nav .next {
  text-align: right;
}

/* Footer styles */
.site-footer {
  text-align: center;
   /* padding: 1em 0; */
  font-size: 0.8em;
  color: inherit;
}

/* Post title styling */
.post-title {
  font-size: 2rem;          /* Main title stays large */
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* Make H1s in post content smaller and more proportional */
.post-content h1 {
  font-size: 1.5rem;        /* Smaller than default H1 */
  font-weight: 600;         /* Medium weight */
  margin-top: 2rem;         /* Space above */
  margin-bottom: 1rem;      /* Space below */
  color: #333;              /* Slightly lighter than black */
  line-height: 1.3;
}

/* Adjust other headings proportionally */
.post-content h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.post-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

/* Make subtitle even smaller */
.post-subtitle {
  font-size: 1.1rem;        /* Smaller subtitle */
  font-weight: 400;
  color: #666;
  margin-bottom: 1rem;
  font-style: italic;
}

/* Responsive styles for mobile devices */
@media (max-width: 600px) {
  body {
    font-size: 16px;
    line-height: 1.8;
    margin: 0;
    max-width: 100vw;
    width: 100vw;
    padding: 0 10px;
    box-sizing: border-box;
  }

  nav {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  #nav-links, .nav-controls {
    flex-direction: row;
    align-items: center;
  }
  #nav-links {
    flex-direction: row;
    gap: 10px;
    width: auto;
  }
  #nav-links a {
    font-size: 1.1em;
  }
  .nav-icon {
    width: 20px;      /* Adjust the size as needed */
    height: 20px;
    border-radius: 50%; /* Makes the image round */
    margin-right: 8px;  /* Spacing between the image and "Home" text */
    object-fit: cover;  /* Ensures the image fills the container neatly */
  }

  #theme-toggle {
    font-size: 1.1em;      /* Match nav link font size */
    width: auto;
    height: auto;
    padding: 0 8px;
  }
  #theme-toggle img {
    width: 1.1em;          /* Match icon size to text */
    height: 1.1em;
  }
}

/* Desktop styles */
@media (min-width: 601px) {
  #nav-links {
    display: flex !important;
    flex-direction: row;
    position: static;
    background: none;
    box-shadow: none;
    width: auto;
    padding: 0;
  }
  #nav-links a {
    border-bottom: none;
    padding: 0;
    margin-right: 15px;
  }
}

@media (min-width: 601px) and (max-width: 740px) {
  body {
    margin-left: 20px;
    margin-right: 20px;
  }
}