/* Universal base styles */
*,
::after,
::before {
  box-sizing: border-box;
}

* {
  margin: 0;
}

body {
  line-height: 1.8rem;
  -webkit-font-smoothing: antialiased;
  font-family:
    InterVariable, Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.1rem;
  font-weight: 400;
  padding: 2rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

a {
  color: #2563eb;
}

a:focus,
a:hover {
  color: #3b82f680;
}

header {
  max-width: 90%;
  width: 100%;
  margin: 0 auto;
}

section {
  max-width: 85%;
  width: 100%;
  margin: 0 auto;
  padding: 1rem;
  text-align: center;
}

main {
  max-width: 75%;
  width: 100%;
  margin: 0 auto;
  padding: 1rem 0;
  text-align: left;
}

.banner {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  background: #caddff;
  padding: 2rem 1rem;
  border-radius: 1rem;
}

.title {
  font-size: 1.5rem;
  line-height: 2.5rem;
}

.description {
  margin-bottom: 30px;
}

.description > a {
  margin-left: 10px;
  text-decoration: none;
}

.posts {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.posts__post {
  margin: 2rem 0;
}

.post__title {
  font-family: "Nunito Sans", Arial, Helvetica, sans-serif;
  font-size: 22px;
  line-height: 36px;
}

.post_details {
  margin-left: 0.2rem;
}

.post__more {
  margin-left: 0.3rem;
}

.cta {
  margin-top: 50px;
}

/* Toggle switch styles */
.theme-toggle-container {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: flex-end;
  padding: 1rem 0;
  min-width: 14rem;
}

.theme-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #abbcd8;
  transition: 0.4s;
  border-radius: 34px;
  overflow: hidden;
  /* Ensure icons don't overflow */
}

.slider:before,
.slider:after {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  bottom: 4px;
  background-color: #3c424d;
  border-radius: 50%;
  text-align: center;
  line-height: 26px;
  font-size: 16px;
}

input:checked + .slider {
  background-color: #2196f3;
}

/* Sun icon */
.slider:before {
  content: "🔆";
  left: 4px;
  opacity: 1;
}

input:checked + .slider:before {
  opacity: 0;
  transition: all 0.2s ease;
}

/* Moon icon */
.slider:after {
  content: "🌙";
  right: 4px;
  opacity: 0;
}

input:checked + .slider:after {
  opacity: 1;
  transition: all 0.2s ease;
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before,
.slider.round:after {
  border-radius: 50%;
}

/* Light mode specific styles */
body.light-mode {
  color: #1f2937;
  /* Dark grey text on light background */
  background-color: #ffffff;
  /* White background */
}

/* Dark mode specific styles */
body.dark {
  color: #cbd5e1;
  /* Light grey text on dark background */
  background-color: #111827;
  /* Dark navy background */
}

body.dark header {
  background: #1f2937;
  /* Darker blue for header background */
}

body.dark a,
body.dark .post__link,
body.dark .post__more,
body.dark .cta__link {
  color: #93c5fd;
  /* Lighter blue links for dark mode */
}

body.dark a:focus,
body.dark a:hover {
  color: #bfdbfe80;
  /* Lighter blue on hover in dark mode */
}

@media (max-width: 968px) {
  body {
    padding: 1rem;
  }

  header {
    max-width: 100%;
  }

  section {
    max-width: 90%;
  }

  main {
    max-width: 90%;
  }

  .banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem;
  }

  .theme-toggle-container {
    width: 100%;
    justify-content: center;
  }
}
