/****** RESET & DEFAULT DISPLAY SETTINGS *******/
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  font-family: "Nunito Sans", sans-serif;
}

/****** TYPOGRAPHY & CONTENT *******/
.homepage-header {
  margin-top: 3.375rem;
  margin-bottom: 0.25rem;
}

h2 {
  margin-top: 24px;
}

p {
  margin-top: 0.75rem;
}

hr {
  border: none;
  height: 4px;
  background-color: #dcdcdc;
  margin: 1.5rem 0;
}

a {
  color: #0a0f1c;
  text-decoration: none;
  transition: 0.3s ease;
}

a:hover {
  color: #4f69c4;
  text-decoration: underline;
}

.nav-anchor {
  color: #888;
}

.post-li {
  list-style: none;
  margin-bottom: 44px;
}

.post-ul {
  margin: 1.5rem 2.75rem;
}

/****** LAYOUT *******/
.page-container {
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
}

.content-wrapper {
  max-width: 750px;
  width: 100%;
  min-height: 100vh;
  padding: 44px 8px;
}

.post-list {
  margin: 2.75rem 0.25rem;
}

.date-and-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

/****** POST STYLES *******/
img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 4px;
}

.post-date {
  margin-top: 0;
  font-size: 0.875rem;
  color: #888;
  width: 100px;
}

.content-header {
  color: #888;
  transition: 0.3s ease;
  text-decoration: none;
  font-weight: 400;
}

.content-header:hover {
  color: #4f69c4;
  text-decoration: underline;
}

.link-category {
  display: inline-block;
  padding: 8px 4px;
  text-decoration: none;
  width: 100px;
}

.link {
  color: #888;
}

.header-full-post {
  border-bottom: 1px solid #dcdcdc;
  padding-bottom: 12px;
  margin-top: 44px;
}

/****** LIGHT / DARK MODE *******/
html.default-mode body {
  background-color: #ffffff;
  color: #000;
}

html.default-mode .toggle-wrapper {
  width: 44px;
  height: 22px;
  border-radius: 999px;
  position: relative;
  background-color: #f69c3d;
  cursor: pointer;
}

html.default-mode .toggle-knob {
  position: absolute;
  top: 2px;
  right: 24px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  transition: all 0.3s ease;
}

html.default-mode .header-link,
html.default-mode .full-post-link,
html.default-mode .border-1px-lg {
  color: #000;
  text-decoration: none;
}

html.default-mode .post-link {
  color: #dcdcdc;
  text-decoration: none;
}

html:not(.default-mode) body {
  background-color: #0a0f1c;
  color: #ffffff;
}

html:not(.default-mode) .toggle-wrapper {
  width: 44px;
  height: 22px;
  border-radius: 999px;
  position: relative;
  background-color: #4f69c4;
  cursor: pointer;
}

html:not(.default-mode) .toggle-knob {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  transition: all 0.3s ease;
}

html:not(.default-mode) a {
  color: #fff;
  text-decoration: none;
  transition: 0.3s ease;
}

html:not(.default-mode) a:hover {
  color: #4f69c4;
  text-decoration: underline;
}

/****** TOGGLE ICONS *******/
.toggle-sun,
.toggle-moon {
  width: 18px;
}

.toggle-wrapper:active .toggle-knob {
  width: 36px;
  right: 4px;
  border-radius: 99px;
}

.whole-toggle {
  height: 22px;
}

.light-dark-toggle {
  display: flex;
  justify-content: flex-end;
}

/****** TABLE STYLES *******/
/* keep your centering fix (Option B) */
figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 3.5em auto;
  overflow-x: auto;
}

figure table {
  width: 98%;
  max-width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #ccc;
  border-radius: 4px;
  overflow: hidden;
}

figure th,
figure td {
  padding: 0.5em 1em;
  text-align: center;
  word-break: break-word;
  overflow-wrap: anywhere;
  border-right: 1px solid #ccc;
  border-bottom: 1px solid #ccc;
}

figure tr:last-child td {
  border-bottom: 0;
}
figure th:last-child,
figure td:last-child {
  border-right: 0;
}

figcaption {
  text-align: center;
  font-size: 0.9em;
  color: #555;
  margin-top: 0.5em;
  margin-left: 2.5rem;
  margin-right: 2.5rem;
  font-style: italic;
}

.table-350px {
  max-width: 350px;
  width: 100%;
  align-self: center;
}

/****** RESPONSIVE *******/
@media (max-width: 768px) {
  .content-wrapper {
    width: 98%;
    max-width: 100%;
  }
  h1 {
    font-size: 22px;
    font-weight: 700;
  }
  h2 {
    font-size: 20px;
    font-weight: 600;
  }
  p {
    font-size: 16px;
  }
}

/******* Scrollbar Fix (keep viewport width stable) *******/
:root {
  scrollbar-gutter: stable;
}

@supports not (scrollbar-gutter: stable) {
  html {
    overflow-y: scroll;
  }
}
