/* ===================================================================
   Modern Blog CSS System - Inspired by Hugo Texify3 Theme
   Features: Gruvbox colors, Academic typography, Dark mode support
   =================================================================== */

/* ===================================================================
   CSS Variables - Gruvbox Color Scheme
   =================================================================== */
:root {
  /* Light mode colors (Gruvbox Light) */
  --bg_h: #f9f5d7;
  --bg: #fbf1c7;
  --bg_s: #f2e5bc;
  --bg1: #ebdbb2;
  --bg2: #d5c4a1;
  --bg3: #bdae93;
  --bg4: #a89984;

  --fg: #282828;
  --fg1: #3c3836;
  --fg2: #504945;
  --fg3: #665c54;
  --fg4: #7c6f64;

  --red: #9d0006;
  --green: #79740e;
  --yellow: #b57614;
  --blue: #076678;
  --purple: #8f3f71;
  --aqua: #427b58;
  --orange: #af3a03;
  --gray: #928374;

  --red-dim: #cc2412;
  --green-dim: #98971a;
  --yellow-dim: #d79921;
  --blue-dim: #458598;
  --purple-dim: #b16286;
  --aqua-dim: #689d6a;
  --orange-dim: #d65d0e;
  --gray-dim: #7c6f64;

  /* Layout variables */
  --phi: 1.618033988749895;
  --f: 1.5rem;
  --radius: 0.25rem;
  --margin: 1rem;
  --max-width: 70vw;
  --padding: calc((100vw - var(--max-width)) / 2);
  --border: 2px;
  --mobile-breakpoint: 768px;
}

/* Dark mode colors (Gruvbox Dark) */
.darkmode {
  --bg_h: #1d2021;
  --bg: #282828;
  --bg_s: #32302f;
  --bg1: #3c3836;
  --bg2: #504945;
  --bg3: #665c54;
  --bg4: #7c6f64;

  --fg: #fbf1c7;
  --fg1: #ebdbb2;
  --fg2: #d5c4a1;
  --fg3: #bdae93;
  --fg4: #a89984;

  --red: #fb4934;
  --green: #b8bb26;
  --yellow: #fabd2f;
  --blue: #83a598;
  --purple: #d3869b;
  --aqua: #8ec07c;
  --gray: #928374;
  --orange: #fe8019;

  --red-dim: #cc2412;
  --green-dim: #98971a;
  --yellow-dim: #d79921;
  --blue-dim: #458588;
  --purple-dim: #b16286;
  --aqua-dim: #689d6a;
  --gray-dim: #a89984;
  --orange-dim: #d65d0e;
}

/* ===================================================================
   Font Definitions
   =================================================================== */
@font-face {
    font-family: "EB Garamond";
    font-style: normal;
    font-weight: 400;
    font-display: auto;
    src: url("fonts/eb-garamond-v9-latin-regular.woff2") format("woff2"),
         url("fonts/eb-garamond-v9-latin-regular.woff") format("woff");
}

/* ===================================================================
   Global Reset and Base Styles
   =================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: "EB Garamond", "Latin Modern Roman", "Times New Roman", serif;
  font-size: 1.125rem;
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  text-decoration: none;
  transition: color 0.2s ease;
}

a:link {
  color: var(--blue);
}

a:hover,
a:visited {
  color: var(--blue-dim);
}

::selection {
  background-color: var(--blue);
  color: white;
}

hr {
  background-color: var(--fg4);
  margin-top: var(--margin);
  margin-bottom: var(--margin);
  border: 0;
  height: var(--border);
}

/* ===================================================================
   Layout Structure
   =================================================================== */
#wrapper {
  background-color: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-wrap: break-word;
  padding: 1rem var(--padding);
}

@media screen and (max-width: 768px) {
  #wrapper {
    padding-left: calc(var(--padding) / 3);
    padding-right: calc(var(--padding) / 3);
  }
}

/* ===================================================================
   Header Styles
   =================================================================== */
#header {
  align-items: center;
  display: flex;
  flex-direction: column;
  margin-bottom: 2rem;
}

#header > h1 {
  text-align: center;
  font-size: 2.8rem;
  margin-bottom: 1rem;
  position: relative;
}

@media screen and (max-width: 768px) {
  #header > h1 {
    font-size: 2.2rem;
  }
}

#header > h1 > a {
  color: var(--fg1);
  text-decoration: none;
}

#header > h1 > a:hover,
#header > h1 > a:visited {
  color: var(--fg1);
}

#header > nav {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  flex-wrap: wrap;
  max-width: 768px;
  margin-top: 10px;
  width: 100%;
  gap: 1rem;
}

#header > nav > .nav-bar-item > a {
  font-size: 1.2rem;
  color: var(--fg1);
  text-decoration: none;
  display: inline-block;
  position: relative;
  padding: 0.5rem 1rem;
  transition: all 0.25s ease-out;
}

#header > nav > .nav-bar-item > a:after {
  background-color: var(--fg1);
  content: "";
  position: absolute;
  width: 100%;
  transform: scaleX(0);
  height: var(--border);
  bottom: 0;
  left: 0;
  transform-origin: bottom right;
  transition: transform 0.25s ease-out;
}

#header > nav > .nav-bar-item > a:hover:after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

.head-rule {
  margin: 1rem 0 2rem 0;
  background-color: var(--fg4);
}

/* ===================================================================
   Dark Mode Toggle
   =================================================================== */
.dark-mode-toggle {
  background-color: var(--bg);
  color: var(--fg);
  position: absolute;
  top: calc(((4px + var(--margin)) / 2) + 12.55px);
  right: var(--padding);
  border: none;
  padding: 0.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.3s, color 0.3s;
}

.dark-mode-toggle:hover {
  color: var(--fg1);
}

@media screen and (max-width: 768px) {
  .dark-mode-toggle {
    position: fixed;
    top: 1rem;
    left: 1rem;
    right: auto;
    z-index: 1000;
    background-color: var(--bg);
    color: white;
    border-radius: 50%;
    padding: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  }
  
  .dark-mode-toggle:hover {
    color: var(--fg1);
  }
}

/* ===================================================================
   Main Content Area
   =================================================================== */
main {
  margin: 0 var(--margin);
}

#main {
  align-self: center;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  max-width: 100%;
  padding: 0;
  width: calc(100% - 2rem);
}

@media screen and (max-width: 768px) {
  #main {
    width: 100%;
  }
}

/* ===================================================================
   Index Page Layout (Grid with Sidebar)
   =================================================================== */
.grid-container {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto;
}

@media screen and (max-width: 768px) {
  .grid-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.main-content {
  min-width: 0; /* Prevents grid overflow */
}

.sidebar {
  background-color: var(--bg_s);
  padding: 1.5rem;
  border-radius: var(--radius);
  height: fit-content;
  position: sticky;
  top: 2rem;
}

@media screen and (max-width: 768px) {
  .sidebar {
    position: static;
    order: -1;
  }
}

/* ===================================================================
   Welcome Content
   =================================================================== */
.welcome-content {
  margin-bottom: 3rem;
  text-align: center;
}

.welcome-content h2 {
  font-size: calc(var(--f) * var(--phi));
  margin-bottom: 1rem;
  color: var(--fg1);
}

.welcome-content p {
  font-size: 1.1rem;
  color: var(--fg2);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ===================================================================
   Post Lists
   =================================================================== */
.recent-posts {
  margin-bottom: 2rem;
}

.recent-posts h3 {
  font-size: calc(var(--f) * 1.2);
  margin-bottom: 1.5rem;
  color: var(--fg1);
  border-bottom: 2px solid var(--fg4);
  padding-bottom: 0.5rem;
}

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

.post-list-item {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background-color: var(--bg_s);
  border-radius: var(--radius);
  border-left: 4px solid var(--blue);
  transition: all 0.2s ease;
}

.post-list-item:hover {
  background-color: var(--bg1);
  transform: translateX(4px);
}

.post-title {
  font-size: 1.3rem;
  margin: 0 0 0.5rem 0;
  line-height: 1.4;
}

.post-title a {
  color: var(--fg);
  text-decoration: none;
  font-weight: 600;
}

.post-title a:hover {
  color: var(--blue);
  text-decoration: underline;
}

.post-meta {
  color: var(--fg3);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.post-meta time {
  margin-left: 0;
  min-width: auto;
}

.post-excerpt {
  color: var(--fg2);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-top: 0.5rem;
}

/* ===================================================================
   Sidebar Components
   =================================================================== */
.taxonomy-section {
  margin-bottom: 2rem;
}

.taxonomy {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  color: var(--fg1);
}

.taxonomy .icon {
  margin-right: 0.5rem;
}

.taxonomy .icon svg {
  fill: var(--fg);
  width: 1.2em;
  height: 1.2em;
}

.taxonomy a {
  color: var(--fg1);
  text-decoration: none;
  font-weight: 600;
}

.taxonomy a:hover {
  color: var(--blue);
}

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

.nav-list li {
  margin-bottom: 0.5rem;
}

.nav-list li a {
  color: var(--fg2);
  text-decoration: none;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius);
  display: block;
  transition: all 0.2s ease;
}

.nav-list li a:hover {
  background-color: var(--bg1);
  color: var(--blue);
}

/* ===================================================================
   Search Section
   =================================================================== */
.search-section {
  margin-bottom: 2rem;
}

.search-section h3 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  color: var(--fg1);
}

.search-container {
  position: relative;
}

#search-input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--fg4);
  border-radius: var(--radius);
  background-color: var(--bg);
  color: var(--fg);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s ease;
}

#search-input:focus {
  outline: none;
  border-color: var(--blue);
}

#search-input::placeholder {
  color: var(--fg3);
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: var(--bg);
  border: 2px solid var(--fg4);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

.search-results.show {
  display: block;
}

.search-result-item {
  padding: 0.75rem;
  border-bottom: 1px solid var(--fg4);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.search-result-item:hover {
  background-color: var(--bg_s);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-title {
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.25rem;
}

.search-result-excerpt {
  font-size: 0.85rem;
  color: var(--fg3);
  line-height: 1.4;
}

/* ===================================================================
   Post Content Styles
   =================================================================== */
.post {
  max-width: 800px;
  margin: 0 auto;
}

.post-heading {
  margin-bottom: 2rem;
  text-align: center;
}

.post-heading h1 {
  font-size: calc(var(--f) * var(--phi) * var(--phi));
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--fg);
}

.publish-metadata {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  color: var(--fg3);
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.publish-metadata svg {
  width: 0.75em;
  height: 0.75em;
  fill: currentColor;
}

.post-tags {
  margin-bottom: 2rem;
  text-align: center;
}

.post-tags .tag {
  display: inline-block;
  background-color: var(--bg_s);
  color: var(--fg2);
  padding: 0.3rem 0.8rem;
  margin: 0.2rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.post-tags .tag:hover {
  background-color: var(--blue);
  color: white;
}

.post-toc {
  margin-bottom: 2rem;
}

.post-toc details {
  background-color: var(--bg_s);
  padding: 1rem;
  border-radius: var(--radius);
  border-left: 4px solid var(--blue);
}

.post-toc summary {
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 0.5rem;
  color: var(--fg1);
}

.post-toc .toc {
  margin-top: 1rem;
}

.post-toc .toc ul {
  list-style: none;
  padding-left: 1rem;
}

.post-toc .toc li {
  margin-bottom: 0.3rem;
}

.post-toc .toc a {
  color: var(--fg2);
  text-decoration: none;
  font-size: 0.9rem;
}

.post-toc .toc a:hover {
  color: var(--blue);
  text-decoration: underline;
}

/* ===================================================================
   Content Typography
   =================================================================== */
.content {
  line-height: 1.7;
  font-size: 1.1rem;
}

.content :last-child {
  margin-bottom: 0;
}

.content a {
  text-decoration: underline;
  color: var(--blue);
}

.content a:hover {
  text-decoration: none;
  color: var(--blue-dim);
}

.content blockquote,
.content div,
.content h1,
.content h2,
.content h3,
.content h4,
.content h5,
.content h6,
.content p,
.content pre,
.content ol,
.content table,
.content ul,
.content dl,
.content video {
  margin-bottom: var(--margin);
}

.content h1,
.content h2,
.content h3,
.content h4,
.content h5,
.content h6 {
  line-height: 1.3;
  color: var(--fg1);
  font-weight: 600;
}

.content h1 {
  font-size: calc(var(--f) * var(--phi) * var(--phi));
}

.content h2 {
  font-size: calc(var(--f) * var(--phi) * 1.2);
}

.content h3 {
  font-size: calc(var(--f) * var(--phi));
}

.content h4 {
  font-size: calc(var(--f) * 1.2);
}

.content h5 {
  font-size: var(--f);
}

.content h6 {
  font-size: calc(var(--f) * 0.9);
}

.content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 1rem 0;
}

.content p {
  text-align: justify;
  margin-bottom: 1.2rem;
}

.content blockquote {
  background-color: var(--bg_s);
  border-left: var(--fg) var(--border) solid;
  border-radius: var(--radius);
  font-style: italic;
  padding: 1rem 2rem;
  margin: 1.5rem 0;
}

.content blockquote blockquote {
  background-color: var(--bg1);
}

.content pre {
  background-color: var(--bg_s) !important;
  border-radius: var(--radius);
  font-family: "Fira Code", "Source Code Pro", Consolas, monospace;
  position: relative;
  overflow-x: auto;
  padding: 1rem;
  margin: 1.5rem 0;
  border: 1px solid var(--fg4);
}

.content pre code {
  padding: 0;
  background: none;
  font-size: 0.9rem;
}

.content code {
  background-color: var(--bg_s);
  border-radius: var(--radius);
  font-family: "Fira Code", "Source Code Pro", Consolas, monospace;
  padding: 0.2rem 0.4rem;
  font-size: 0.9rem;
  color: var(--fg1);
}

.content mark {
  background-color: var(--yellow);
  color: var(--fg);
  border-radius: var(--radius);
  padding: 0.1rem 0.3rem;
}

.content kbd {
  background-color: var(--bg_s);
  color: var(--fg1);
  border-radius: var(--radius);
  padding: 0.2rem 0.4rem;
  font-family: monospace;
  border: 1px solid var(--fg4);
}

.content table {
  display: block;
  overflow-x: auto;
  margin: 1.5rem auto;
  background-color: var(--bg);
  border-collapse: collapse;
  border: none;
  width: 100%;
  max-width: 100%;
}

.content table td,
.content table th {
  border: var(--fg4) 1px solid;
  padding: 0.5rem 1rem;
  text-align: left;
}

.content table th {
  background-color: var(--bg_s);
  font-weight: 600;
  color: var(--fg1);
}

.content table tr:nth-child(even) {
  background-color: var(--bg_s);
}

.content ol,
.content ul {
  margin-left: var(--margin);
  padding-left: 1rem;
}

.content ol li,
.content ul li {
  margin-bottom: 0.5rem;
}

.content dt {
  font-weight: 600;
  color: var(--fg1);
}

.content dd {
  margin-left: var(--margin);
  margin-bottom: 0.5rem;
}

/* ===================================================================
   Copy Button for Code Blocks
   =================================================================== */
.copy-button {
  background-color: var(--bg1);
  color: var(--fg1);
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  opacity: 0.7;
  border: none;
  padding: 0.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.3s, background-color 0.3s;
  font-size: 0.8rem;
}

.copy-button:hover {
  opacity: 1;
  background-color: var(--bg);
}

.copy-button .octicon-check {
  color: var(--green);
}

/* ===================================================================
   Navigation and Pagination
   =================================================================== */
.paginator {
  align-items: flex-end;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--fg4);
}

.paginator a {
  color: var(--blue);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  transition: all 0.2s ease;
}

.paginator a:hover {
  background-color: var(--bg_s);
  color: var(--blue-dim);
}

/* ===================================================================
   Back to Top Button
   =================================================================== */
#back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: var(--blue);
  color: white;
  border: none;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#back-to-top:hover {
  background-color: var(--blue-dim);
  transform: translateY(-2px);
}

/* ===================================================================
   Footer
   =================================================================== */
#footer {
  color: var(--fg4);
  align-items: center;
  display: flex;
  font-size: 0.9rem;
  flex-direction: column;
  margin-top: var(--margin);
  padding: 2rem 0;
  border-top: 1px solid var(--fg4);
  gap: 0.5rem;
}

#footer a {
  color: var(--fg3);
  text-decoration: none;
}

#footer a:hover {
  color: var(--blue);
  text-decoration: underline;
}

/* ===================================================================
   Scrollbar Styling
   =================================================================== */
::-webkit-scrollbar {
  background-color: var(--bg);
  height: 8px;
  width: 8px;
}

::-webkit-scrollbar-thumb {
  background-color: var(--fg4);
  border-radius: var(--radius);
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--fg1);
}

/* ===================================================================
   Utility Classes
   =================================================================== */
.icon svg {
  fill: var(--fg);
  margin-right: 0.3em;
  margin-left: 0.3em;
}

.taxonomy-svg {
  padding: 0;
  top: 0.125em;
  position: relative;
}

.link {
  color: var(--blue);
  text-decoration: none;
}

.link:hover {
  color: var(--blue-dim);
  text-decoration: underline;
}

/* ===================================================================
   Responsive Design
   =================================================================== */
@media screen and (max-width: 1024px) {
  :root {
    --max-width: 85vw;
  }

  .grid-container {
    grid-template-columns: 1fr 250px;
    gap: 2rem;
  }
}

@media screen and (max-width: 768px) {
  :root {
    --max-width: 95vw;
    --f: 1.3rem;
  }

  #header > h1 {
    font-size: 2rem;
  }

  #header > nav {
    flex-direction: column;
    gap: 0.5rem;
  }

  .grid-container {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: -1;
    position: static;
  }

  .post-heading h1 {
    font-size: calc(var(--f) * var(--phi));
  }

  .publish-metadata {
    flex-direction: column;
    gap: 0.5rem;
  }

  #back-to-top {
    bottom: 1rem;
    right: 1rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }
}

@media screen and (max-width: 480px) {
  #wrapper {
    padding: 0.5rem;
  }

  #header > h1 {
    font-size: 1.8rem;
  }

  .content {
    font-size: 1rem;
  }

  .post-list-item {
    padding: 0.75rem;
  }

  .sidebar {
    padding: 1rem;
  }
}

/* ===================================================================
   Print Styles
   =================================================================== */
@media print {
  .dark-mode-toggle,
  #back-to-top,
  .search-section,
  .sidebar {
    display: none !important;
  }

  .grid-container {
    grid-template-columns: 1fr;
  }

  body {
    background: white !important;
    color: black !important;
  }

  a {
    color: black !important;
    text-decoration: underline !important;
  }
}

/* ===================================================================
   Animation Classes
   =================================================================== */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

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

.slide-in {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(-20px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ===================================================================
   Focus Styles for Accessibility
   =================================================================== */
button:focus,
input:focus,
a:focus {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ===================================================================
   High Contrast Mode Support
   =================================================================== */
@media (prefers-contrast: high) {
  :root {
    --bg: #ffffff;
    --fg: #000000;
    --blue: #0000ff;
    --blue-dim: #000080;
  }

  .darkmode {
    --bg: #000000;
    --fg: #ffffff;
    --blue: #00ffff;
    --blue-dim: #0080ff;
  }
}

/* ===================================================================
   Media and Image Handling
   =================================================================== */
.responsive-image {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: block;
  margin: 1rem auto;
}

.responsive-image:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  cursor: pointer;
}

.image-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  cursor: default;
}

.image-modal-content img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius);
}

.image-modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.5);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.image-modal-close:hover {
  background: rgba(0, 0, 0, 0.8);
}

.image-modal-caption {
  color: white;
  text-align: center;
  margin-top: 1rem;
  font-style: italic;
}

/* Media gallery in posts */
.media-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.media-gallery img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.media-gallery img:hover {
  transform: scale(1.05);
}

/* Video handling */
.content video {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 1rem auto;
  display: block;
}

/* ===================================================================
   Post Status Indicators
   =================================================================== */
.post-status {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.8rem;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.post-status:hover {
  opacity: 1;
}

.status-draft {
  color: var(--yellow);
}

.status-archive {
  color: var(--gray);
}

/* Status indicators in post lists */
.post-list-item .post-status {
  font-size: 0.9rem;
  margin-left: 0.75rem;
}

/* Status management interface */
.status-selector {
  display: inline-flex;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.status-option {
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--fg4);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.8rem;
}

.status-option:hover {
  background: var(--bg_s);
  border-color: var(--blue);
}

.status-option.active {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

.status-option.draft {
  border-color: var(--yellow);
  color: var(--yellow);
}

.status-option.draft.active {
  background: var(--yellow);
  color: white;
}

.status-option.archive {
  border-color: var(--gray);
  color: var(--gray);
}

.status-option.archive.active {
  background: var(--gray);
  color: white;
}

/* Status notices for posts */
.status-notice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  border-radius: var(--radius);
  border-left: 4px solid;
  font-size: 0.9rem;
  line-height: 1.4;
}

.status-notice-draft {
  background: rgba(181, 118, 20, 0.1);
  border-left-color: var(--yellow);
  color: var(--yellow-dim);
}

.status-notice-archive {
  background: rgba(146, 131, 116, 0.1);
  border-left-color: var(--gray);
  color: var(--gray-dim);
}

.status-notice-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.status-notice-message {
  flex: 1;
}

/* Dark mode adjustments for status notices */
.darkmode .status-notice-draft {
  background: rgba(215, 153, 33, 0.15);
  color: var(--yellow);
}

.darkmode .status-notice-archive {
  background: rgba(168, 153, 132, 0.15);
  color: var(--gray);
}