/* ==========================================================================
   RESET & BOX-SIZING
========================================================================== */
html,
body,
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ==========================================================================
      BASE TYPOGRAPHY & LAYOUT
========================================================================== */
body {
  font-family: Georgia, 'Noto Serif', serif;
  max-width: 800px;
  margin: auto;
  padding: 2rem;
  background-color: #f9f9f9;
  color: #333333;
  line-height: 1.8;
  scroll-behavior: smooth;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: #000000;
  margin-bottom: 0.75rem;
  font-weight: normal;
}

p {
  margin-bottom: 1rem;
}

/* ==========================================================================
      LINKS
========================================================================== */
a {
  color: #0055aa;
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

/* ==========================================================================
      HEADER & NAVIGATION
========================================================================== */
.header-title {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: #000000;
}

nav {
  margin-bottom: 1.5rem;
}

nav a {
  font-size: 1.1rem;
  margin-right: 0.5rem;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.header-row p {
  font-size: 1.2rem;
  color: #555555;
}

/* ==========================================================================
      BUTTONS & TOGGLES
========================================================================== */
button,
#theme-toggle,
.tag-button {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 15px;
  background-color: #ccddee;
  color: #0055aa;
  cursor: pointer;
}

button:hover,
#theme-toggle:hover,
.tag-button:hover {
  background-color: #88bbff;
}

/* ==========================================================================
      TAGS & FILTERS (GENERAL)
========================================================================== */
.post-tag {
  display: inline-block;
  background-color: #eeeeee;
  color: #555555;
  font-size: 0.85rem;
  border: none;
  padding: 0.3rem 0.7rem;
  margin: 0.2rem 0.3rem 0.2rem 0;
}

#tag-filter {
  margin-top: 2rem;
  margin-bottom: 2rem;
}

#tag-buttons {
  margin-top: 0.5rem;
}

/* ==========================================================================
      BACK LINK
========================================================================== */
.back-link {
  display: inline-block;
  margin-top: 2rem;
  font-size: 0.9rem;
  color: #666666;
}

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

/* ==========================================================================
      FORM CONTROLS
========================================================================== */
input[type="text"],
textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 0.8rem;
  border: none;
  margin-bottom: 1rem;
  background-color: #eeeeee;
  color: #666666;
}

textarea {
  resize: vertical;
}

/* ==========================================================================
      DARK MODE (GLOBAL)
========================================================================== */
.dark-mode,
.dark-mode body {
  background-color: #0e0e0e;
  color: #cccccc;
}

.dark-mode a {
  color: #88aaff;
}

.dark-mode button {
  background-color: #333333;
  color: #eeeeee;
  border: none;
}

.dark-mode button:hover {
  background-color: #666666;
}

.dark-mode #theme-toggle {
  background-color: #333333;
  color: #eeeeee;
  border: none;
}

.dark-mode #theme-toggle:hover {
  background-color: #555555;
}

.dark-mode .tag-button {
  background-color: #555555;
  color: #eeeeee;
  border: none;
}

.dark-mode .tag-button:hover {
  background-color: #555555;
}

.dark-mode input[type="text"],
.dark-mode textarea {
  background-color: #555555;
  color: #eeeeee;
}

.dark-mode h1,
.dark-mode h2,
.dark-mode h3,
.dark-mode h4,
.dark-mode h5,
.dark-mode h6 {
  color: #eeeeee;
}

.dark-mode .header-title {
  color: #ffffff;
}

.dark-mode .header-row p {
  font-size: 1.2rem;
  color: #bbbbbb;
}

.dark-mode .post-tag {
  background-color: #555555;
  color: #eeeeee;
}

.dark-mode .post-tag:hover {
  background-color: #555555;
}

.dark-mode .back-link {
  color: #bbbbbb;
}

.dark-mode .back-link:hover {
  text-decoration: underline;
}


/* ==========================================================================
   BLOCKQUOTES
   Styled to stand out with same background color as the theme toggle button
========================================================================== */
blockquote {
  background-color: #ccddee; /* light-mode uses theme toggle background */
  padding: 0.75rem 1rem;
  margin: 1.25rem 0;
  border-left: 4px solid #88bbff; /* subtle accent matches hover tone */
  border-radius: 8px;
}

/* Remove excessive spacing inside blockquote */
blockquote p {
  margin: 0.5rem 0 0.5rem;
}
blockquote p:first-child { margin-top: 0; }
blockquote p:last-child { margin-bottom: 0; }

/* Dark mode adaptation */
.dark-mode blockquote {
  background-color: #333333; /* dark-mode theme toggle background */
  border-left: 4px solid #555555; /* hover shade as accent */
  color: #dddddd;
}

/* Nested blockquotes */
blockquote blockquote {
  background-color: #bbccdd;
  border-left-color: #669fdc;
}

.dark-mode blockquote blockquote {
  background-color: #444444;
  border-left-color: #dedede;
}

/* Temporary highlight class when navigating via TOC */
.toc-highlight {
  animation: tocPulse 1s ease-in-out;
}

@keyframes tocPulse {
  0% { background-color: #bbddff; }
  60% { background-color: #88bbff; }
  100% { background-color: transparent; }
}

/* ==========================================================================
   TEXT SELECTION HIGHLIGHT
========================================================================== */

/* Light mode selection */
::selection {
  background-color: #bbddff;
  color: #000000;
}

::-moz-selection {
  background-color: #bbddff;
  color: #000000;
}

.dark-mode ::selection {
  background-color: #555555;
  color: #ffffff;
}

.dark-mode ::-moz-selection {
  background-color: #555555;
  color: #ffffff;
}