/* Base styles */

body.dark-mode {
  background: #181a1b;
  color: #f1f1f1;
}

html.dark-mode {
  background: #181a1b;
  color: #f1f1f1;
}

body.dark-mode a,
body.dark-mode button {
  color: #e0e0e0;
}

body.dark-mode .container,
body.dark-mode .public-footer {
  background: #181a1b;
  color: #f1f1f1;
}

.dark-mode-svg svg,
body.dark-mode .dark-mode-svg svg {
  transition: filter 0.2s;
}

/* body.dark-mode .dark-mode-svg svg {
  filter: invert(1) hue-rotate(180deg);
} */

/* Share widget responsive layout */
#floating-share-widget {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5em;
}

@media (max-width: 600px) {
  #floating-share-widget {
    flex-direction: row !important;
    align-items: flex-end !important;
    gap: 0.5em;
    bottom: 7vh;
    padding: 0% 32%;
  }
}

html,
body {
  height: 100%;
  min-height: 100vh;
  width: 100%;
  margin: 0;
  padding: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
}

body {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  flex: 1 0 auto;
}

figcaption.attachment__caption {
  display: none;
}

.public-footer {
  font-family: "Inter", Arial, Helvetica, sans-serif;
  color: #23272f;
  font-size: 0.97rem;
  text-align: center;
  margin-top: auto;
  padding: 1rem 0 0.7rem 0;
  background: #fff;
  letter-spacing: 0.01em;
  box-shadow: 0 -1px 8px 0 rgba(60, 60, 60, 0.04);
  position: relative;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 10;
  min-height: 48px;
}

.public-footer a {
  color: #23272f;
  text-decoration: none;
  font-weight: 500;
}

.public-footer a:hover,
.public-footer a:focus {
  color: #2b72ff;
  text-decoration: underline;
}

@media (max-width: 650px) {
  .public-footer {
    font-size: 0.93rem;
    padding: 0.7rem 0 0.5rem 0;
  }
}

/* NAVIGATION BAR */
.navbar {
  width: 100vw;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 24px;
  margin-bottom: 50px;
  font-family: "Inter", Arial, Helvetica, sans-serif;
}

/* Equal spacing for navigation elements */
.navbar-content {
  background: #fff;
  border-radius: 32px;
  box-shadow: 0 4px 32px 0 rgba(60, 60, 60, 0.11);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 28px 7px 18px;
  height: 56px;
  min-width: 440px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  margin-right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: bold;
  color: #2b72ff;
  background: #f5f7fa;
  border: 2px solid #fff;
  box-shadow: 0 2px 10px rgba(60, 60, 60, 0.08);
}
.avatar-initial {
  object-fit: none;
  font-family: "Inter", Arial, Helvetica, sans-serif;
}

a.avatar.avatar-initial {
  color: #000000;
  text-decoration: none;
}

a.navbar-link {
  color: #000000;
  text-decoration: none;
}

.navbar-link {
  padding: 8px 18px;
  border-radius: 20px;
  text-decoration: none;
  color: #222;
  font-weight: 500;
  font-size: 1.05rem;
  background: none;
  transition: background 0.2s, color 0.2s;
  letter-spacing: 0.01em;
  position: relative;
  outline: none;
  font-family: "Inter", Arial, Helvetica, sans-serif;
}

.navbar-link.active {
  background: #f5f7fa;
  color: #222;
  font-weight: 500;
}

.navbar-link.external:after {
  content: "";
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  background: url('data:image/svg+xml;utf8,<svg fill="none" stroke="black" stroke-width="2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M18 13v6a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg>')
    no-repeat center center/1em;
  position: relative;
  top: 2px;
  margin-left: 3px;
  opacity: 0.6;
  vertical-align: middle;
}

.navbar-icons {
  display: flex;
  gap: 6px;
  margin-left: 14px;
}

.icon-btn {
  background: none;
  border: none;
  padding: 7px;
  border-radius: 50%;
  color: #999;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background 0.15s;
  font-size: 1.08em;
  margin-right: 2px;
  outline: none;
}

.icon-btn:hover,
.icon-btn:focus {
  background: #f5f7fa;
  color: #434343;
}

/* BLOG MAIN CONTENT */
.container {
  width: 96%;
  max-width: 680px;
  margin: 0 auto;
  /* margin-left: 13vw; */
  min-width: 300px;
  font-family: "IBM Plex Mono", "Menlo", "Courier New", monospace;
}

.blog-title {
  font-size: 3rem;
  font-weight: 400;
  margin: 0 0 38px 0;
  letter-spacing: -3px;
  line-height: 1.1;
  margin-top: 14px;
  font-family: "IBM Plex Mono", "Menlo", "Courier New", monospace;
}

.rss-link {
  float: right;
  font-size: 1.07rem;
  text-decoration: none;
  color: #333;
  margin-top: 24px;
  margin-right: 12px;
  letter-spacing: 0;
  font-weight: 400;
  opacity: 0.9;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: "IBM Plex Mono", "Menlo", "Courier New", monospace;
}

.rss-link svg {
  margin-left: 3px;
  margin-top: 1px;
  width: 18px;
  height: 18px;
  opacity: 0.7;
}

.blog-list {
  list-style: none;
  padding: 0;
  margin: 0 0 30px 0;
}

.blog-item {
  margin-bottom: 34px;
}

.blog-link {
  font-size: 1.26rem;
  font-weight: 400;
  color: #212529;
  text-decoration: none;
  letter-spacing: -0.01em;
  line-height: 1.3;
  display: inline-block;
  margin-bottom: 4px;
  font-family: "IBM Plex Mono", "Menlo", "Courier New", monospace;
}

.blog-link:hover {
  color: #2b72ff;
  text-decoration: underline;
}

.blog-meta {
  color: #636d7e;
  font-size: 1rem;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  font-family: "IBM Plex Mono", "Menlo", "Courier New", monospace;
  opacity: 0.93;
}

.blog-meta span {
  margin: 0 6px;
  opacity: 0.5;
}

/* Blog Show Page */
.blog-show-meta {
  color: #636d7e;
  font-size: 1.1rem;
  margin: 24px 0;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  font-family: "IBM Plex Mono", "Menlo", "Courier New", monospace;
  display: flex;
  align-items: center;
  gap: 12px;
}

.blog-show-meta span {
  opacity: 0.5;
}

.blog-show-content {
  font-size: 1.15rem;
  line-height: 1.7;
  color: #2c353d;
  margin: 32px 0;
  font-family: "IBM Plex Mono", "Menlo", "Courier New", monospace;
}

.blog-show-content p {
  margin: 1.5em 0;
}

.blog-show-content h2 {
  font-size: 1.8rem;
  font-weight: 500;
  margin: 2em 0 1em;
  letter-spacing: -0.02em;
}

.blog-show-content h3 {
  font-size: 1.4rem;
  font-weight: 500;
  margin: 1.8em 0 0.8em;
  letter-spacing: -0.01em;
}

.blog-show-content pre {
  background: #f6f8fa;
  padding: 16px 20px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.95rem;
  line-height: 1.5;
}

.blog-show-content code {
  background: #f6f8fa;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

.blog-show-content pre code {
  padding: 0;
  background: none;
}

.blog-show-content blockquote {
  border-left: 4px solid #e0e4e9;
  margin: 1.5em 0;
  padding-left: 20px;
  color: #4a5561;
  font-style: italic;
}

.blog-show-content ul,
.blog-show-content ol {
  padding-left: 24px;
  margin: 1.5em 0;
}

.blog-show-content li {
  margin: 0.5em 0;
}

.blog-show-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 2em 0;
}

.blog-show-content a {
  color: #2b72ff;
  text-decoration: none;
}

.blog-show-content a:hover {
  text-decoration: underline;
}

.blog-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #636d7e;
  text-decoration: none;
  font-family: "IBM Plex Mono", "Menlo", "Courier New", monospace;
  font-size: 1.05rem;
  margin-bottom: 24px;
}

.blog-back-link:hover {
  color: #2b72ff;
}

.blog-back-link svg {
  width: 20px;
  height: 20px;
}

/* --- Dark mode styles for all elements inside .trix-content --- */
html.dark-mode .trix-content,
html.dark-mode .trix-content h1,
html.dark-mode .trix-content h2,
html.dark-mode .trix-content h3,
html.dark-mode .trix-content h4,
html.dark-mode .trix-content h5,
html.dark-mode .trix-content h6,
html.dark-mode .trix-content p,
html.dark-mode .trix-content ul,
html.dark-mode .trix-content ol,
html.dark-mode .trix-content li,
html.dark-mode .trix-content blockquote,
html.dark-mode .trix-content pre,
html.dark-mode .trix-content code,
html.dark-mode .trix-content a,
html.dark-mode .trix-content strong,
html.dark-mode .trix-content em,
html.dark-mode .trix-content del,
html.dark-mode .trix-content img,
html.dark-mode .trix-content figure,
html.dark-mode .trix-content figcaption,
html.dark-mode .trix-content table,
html.dark-mode .trix-content th,
html.dark-mode .trix-content td {
  color: #f1f1f1;
  background: transparent;
  border-color: #333;
}

html.dark-mode .trix-content a {
  color: #6fa8ff;
}

html.dark-mode .trix-content blockquote {
  background: #222326;
  border-left: 4px solid #444;
}

html.dark-mode .trix-content pre,
html.dark-mode .trix-content code {
  background: #232527;
  color: #e0e0e0;
}

/* --- Spacing for elements inside .trix-content (blog content) --- */
.trix-content h1,
.trix-content h2,
.trix-content h3,
.trix-content h4,
.trix-content h5,
.trix-content h6 {
  margin-top: 1.7em;
  margin-bottom: 0.8em;
  line-height: 1.2;
}

.trix-content p {
  margin-top: 1.1em;
  margin-bottom: 1.1em;
}

.trix-content ul,
.trix-content ol {
  margin-top: 1.1em;
  margin-bottom: 1.1em;
  padding-left: 2.2em;
}

.trix-content li {
  margin-bottom: 0.5em;
}

.trix-content blockquote {
  margin: 1.4em 0;
  padding: 0.7em 1.2em;
  border-left: 3px solid #e0e4ea;
  background: #f9fafb;
}

.trix-content img {
  display: block;
  margin: 1.7em auto;
  max-width: 100%;
  border-radius: 8px;
}

.trix-content pre {
  margin: 1.2em 0;
  padding: 1em;
  background: #f5f7fa;
  border-radius: 6px;
  overflow-x: auto;
}

.trix-content code {
  padding: 0.15em 0.4em;
  background: #f0f2f5;
  border-radius: 4px;
  font-size: 0.97em;
}

@media (max-width: 650px) {
  .trix-content h1,
  .trix-content h2,
  .trix-content h3,
  .trix-content h4,
  .trix-content h5,
  .trix-content h6 {
    margin-top: 1em;
    margin-bottom: 0.5em;
  }
  .trix-content p,
  .trix-content ul,
  .trix-content ol {
    margin-top: 0.7em;
    margin-bottom: 0.7em;
  }
  .trix-content blockquote {
    margin: 0.9em 0;
    padding: 0.5em 0.7em;
  }
  .trix-content img {
    margin: 1em 0;
  }
  .trix-content pre {
    margin: 0.8em 0;
    padding: 0.6em;
  }
}

/* Responsive Design */
@media (max-width: 900px) {
  .container {
    margin-left: 2vw;
    margin-right: 2vw;
  }
  .blog-title {
    font-size: 3.2rem;
  }
  .navbar-content {
    min-width: 0;
    padding: 6px 8px;
  }
}
.trix-content div {
  margin-top: 1.1em;
  margin-bottom: 1.1em;
}
@media (max-width: 650px) {
  .container {
    max-width: 99vw;
    margin-left: 4vw;
  }
  .blog-title {
    font-size: 2.2rem;
  }
  .navbar-content {
    min-width: 0;
    padding: 4px 3px;
  }
}

/* --- Floating Share Widget --- */
#floating-share-widget {
  position: fixed;
  left: 24px;
  top: 44vh;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: left 0.2s, bottom 0.2s;
}
#floating-share-widget #share-toggle {
  background: #fff;
  border: 1.5px solid #e0e4ea;
  border-radius: 50%;
  box-shadow: 0 4px 18px 0 rgba(60, 60, 60, 0.08);
  padding: 8px;
  cursor: pointer;
  outline: none;
  transition: box-shadow 0.18s;
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#floating-share-widget #share-toggle:hover {
  box-shadow: 0 6px 28px 0 rgba(60, 60, 60, 0.13);
  background: #f5f7fa;
}
#floating-share-widget #dark-mode-toggle {
  background: #fff;
  border: 1.5px solid #e0e4ea;
  border-radius: 50%;
  box-shadow: 0 4px 18px 0 rgba(60, 60, 60, 0.08);
  padding: 8px;
  cursor: pointer;
  outline: none;
  transition: box-shadow 0.18s;
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#floating-share-widget #dark-mode-toggle:hover {
  box-shadow: 0 6px 28px 0 rgba(60, 60, 60, 0.13);
  background: #f5f7fa;
}
#floating-share-widget #share-options {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 6px 32px 0 rgba(60, 60, 60, 0.16);
  padding: 1.1em 1.2em 0.8em 1.2em;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeIn 0.23s;
  position: absolute;
  left: 60px; /* Position to the right of the widget */
  top: 50%;
  transform: translateY(-50%);
}
#floating-share-widget #share-options.hidden {
  display: none;
}
#floating-share-widget .share-title {
  font-size: 1.07em;
  font-weight: 500;
  color: #23272f;
  margin-bottom: 0.5em;
  font-family: "Inter", Arial, Helvetica, sans-serif;
}
#floating-share-widget .share-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
}
#floating-share-widget .share-icon {
  background: #f5f7fa;
  border: none;
  border-radius: 50%;
  padding: 7px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.14s, box-shadow 0.14s;
  box-shadow: 0 2px 8px 0 rgba(60, 60, 60, 0.05);
}
#floating-share-widget .share-icon:hover,
#floating-share-widget .share-icon:focus {
  background: #e0e4ea;
  box-shadow: 0 4px 16px 0 rgba(60, 60, 60, 0.1);
}
#floating-share-widget .share-icon svg,
#floating-share-widget .share-icon img,
#floating-share-widget .share-icon .dark-mode-svg svg {
  width: 24px;
  height: 24px;
  display: block;
  margin: 0 auto;
  pointer-events: none;
}

#floating-share-widget .share-icon .dark-mode-svg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

#floating-share-widget .share-icon {
  background: #f5f7fa;
  border: none;
  border-radius: 50%;
  padding: 7px;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.14s, box-shadow 0.14s;
  box-shadow: 0 2px 8px 0 rgba(60, 60, 60, 0.05);
}

@media (max-width: 650px) {
  #floating-share-widget {
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    bottom: 16px;
    display: flex;
    flex-direction: row;
    align-items: center !important;
    width: 100%;
    bottom: 8vh;
  }
  #floating-share-widget #share-toggle,
  #floating-share-widget #dark-mode-toggle {
    margin: 0 5px;
    pointer-events: auto;
  }
  #floating-share-widget #share-options {
    position: absolute;
    bottom: 60px;
    left: 22vh;
    transform: translateX(-50%);
    margin: 0;
    max-width: 150px;
    pointer-events: auto;
    top: auto;
}
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
