/* --- Base --- */
body {
  font-family: sans-serif;
  background-color: #1e1e1e;
  color: #ccc;
  line-height: 1.5;
  margin: 0;
  padding: 3rem;
}

/* === Navigation Bar === */
.site-nav {
  max-width: 720px;
  border-bottom: 1px solid #2a2a2a;
}

/* Keep full-width background, but align content with posts */
.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;     /* left align */
  gap: 3rem;                       /* space between logo and links */
  max-width: 720px;                /* match post width */
  margin-left: 0;
  margin-right: auto;
  padding: 1rem 0;                 /* same vertical rhythm as body padding */
  position: relative;
}

/* Code Block */
:root {
  --code-bg: #f6f8fa;
  --code-text: #24292f;
  --code-border: #d0d7de;
  --inline-code-bg: rgba(175, 184, 193, 0.2);
}

@media (prefers-color-scheme: dark) {
  :root {
    --code-bg: #161b22;
    --code-text: #c9d1d9;
    --code-border: #30363d;
    --inline-code-bg: rgba(110, 118, 129, 0.4);
  }
}

/* Inline code */
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  background-color: var(--inline-code-bg);
  color: var(--code-text);
  padding: 0.2em 0.4em;
  border-radius: 6px;
}

/* Code blocks */
pre {
  background-color: var(--code-bg);
  color: var(--code-text);
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;
  border: 1px solid var(--code-border);
  line-height: 1.45;
}

/* Prevent double styling */
pre code {
  background: none;
  padding: 0;
  font-size: 0.9em;
  color: inherit;
}


/* Logo */
.nav-logo-img {
  width: 42px;
  height: 42px;
  display: block;
  opacity: 0.9;
  transition: opacity 0.3s ease;
}
.nav-logo-img:hover {
  opacity: 1;
}

/* Links */
.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: #ccc;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-size: 0.9rem;
  transition: color 0.25s ease;
}
.nav-links a:hover {
  color: #fff;
}

/* === Dropdown === */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: #1e1e1e;
  border: 1px solid #333;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  padding: 0.5rem 0;
  margin-top: 0.3rem;
  list-style: none;
  min-width: 200px;
  z-index: 1001;

  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
}


.dropdown-menu li {
  margin: 0;
}

.dropdown-menu a {
  display: block;
  padding: 0.4rem 1rem;
  color: #ccc;
  text-decoration: none;
  font-size: 0.85rem;
}

.dropdown-menu a:hover {
  background-color: #222;
  color: #fff;
}

/* Divider before Travel */
.dropdown-menu .divider {
  border-top: 1px solid #333;
  margin: 0.25rem 0;
}

/* ADD MOBILE DROPDOWN */
/* === Mobile Navigation Toggle (fixed, aligned, animated) === */
.nav-toggle {
  display: none;
}

/* Label wrapper for the icon */
.nav-toggle-label {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 42px; /* matches your logo height */
  width: 32px;
  cursor: pointer;
  position: relative;
}

/* Base line (the middle bar) */
.nav-toggle-label span {
  position: relative;
  display: block;
  width: 22px;
  height: 2px;
  background-color: #ccc;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Top and bottom bars */
.nav-toggle-label span::before,
.nav-toggle-label span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background-color: #ccc;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Offset top and bottom bars */
.nav-toggle-label span::before {
  top: -6px;
}

.nav-toggle-label span::after {
  top: 6px;
}

/* When checked: animate to "X" */
.nav-toggle:checked + .nav-toggle-label span {
  background-color: transparent;
}

.nav-toggle:checked + .nav-toggle-label span::before {
  transform: rotate(45deg);
  top: 0;
}

.nav-toggle:checked + .nav-toggle-label span::after {
  transform: rotate(-45deg);
  top: 0;
}

/* Hide hamburger icon and checkbox on desktop */
.nav-toggle,
.nav-toggle-label {
  display: none;
}


/* === Responsive behavior === */
@media (max-width: 768px) {
  /* Adjust padding and alignment for smaller screens */
  .nav-container {
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.75rem 0;
  }

  /* Show the hamburger icon */
  .nav-toggle-label {
    display: flex;
  }

  /* Hide nav links by default */
  .nav-links {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    background-color: #1e1e1e;
    border-top: 1px solid #2a2a2a;
    padding: 0.5rem 0;
    position: relative;
    z-index: 999;
  }

  .nav-links li {
    width: 100%;
    text-align: left;
  }

  .nav-links a {
    display: block;
    width: 100%;
    padding: 0.75rem 0;
    color: #ccc;
    text-decoration: none;
    border-bottom: 1px solid #2a2a2a;
  }

  .nav-links a:hover {
    background-color: #222;
    color: #fff;
  }

  /* Show menu when checkbox checked */
  .nav-toggle:checked ~ .nav-links {
    display: flex;
  }

  /* Animate hamburger → X */
  .nav-toggle:checked + .nav-toggle-label span {
    background: transparent;
  }

  .nav-toggle:checked + .nav-toggle-label span::before {
    transform: rotate(45deg);
  }

  .nav-toggle:checked + .nav-toggle-label span::after {
    transform: rotate(-45deg);
  }

  /* Dropdown menus: stack instead of hover */
  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
  }

  .dropdown-menu a {
    padding-left: 1.5rem;
    font-size: 0.85rem;
  }

  .dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
  }

  .dropdown .divider {
    display: none;
  }
}


/* Adjust text baseline for perfect balance */
.logo-text {
  font-size: 1.5rem;
  color: #ddd;
  letter-spacing: 0.05em;
  line-height: 1;
  position: relative;
  top: -2px;
  /* 👈 small counter-adjustment for visual centering */
}

/* Headings */
.prose h1 {
  font-size: 2.25rem;         /* ≈ text-4xl */
  font-weight: 700;           /* font-bold */
  color: #f3f4f6;             /* text-gray-100 */
  margin-top: 1.5rem;         /* mt-6 */
  margin-bottom: 1rem;        /* mb-4 */
  letter-spacing: -0.015em;   /* tracking-tight */
  border: none;
}

.prose h2 {
  font-size: 1.5rem;          /* ≈ text-2xl */
  font-weight: 600;           /* font-semibold */
  color: #f3f4f6;
  margin-top: 1.5rem;         /* mt-6 */
  margin-bottom: 0.5rem;      /* mb-2 */
  border: none;
}

.prose h3 {
  font-size: 1.25rem;         /* ≈ text-xl */
  font-weight: 600;
  color: #e5e7eb;             /* text-gray-200 */
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  border: none;
}

.prose h4 {
  font-size: 1.125rem;        /* ≈ text-lg */
  font-weight: 600;
  color: #d1d5db;             /* text-gray-300 */
  margin-top: 1rem;           /* mt-4 */
  margin-bottom: 0.5rem;      /* mb-2 */
  border: none;
}

/* Paragraphs & text */
.prose p {
  font-size: 100%;
  margin-top: 1.2rem;
  margin-bottom: 0.25rem;
  font-weight: 400;
}

a {
  font-size: 1.1rem;
  color: #ccc;
  text-decoration: underline;
}

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

hr {
  max-width: 720px;
  border: none;
  border-bottom: 1px solid #333;
  margin: 1rem 0;
}

/* --- Main Content --- */
.main-content {
  max-width: 720px;
  margin-left: 0;
}

/* --- Journal Feed (Homepage/List View) --- */
.journal {
  display: block;
}

.post {
  margin-bottom: 3rem;
}

.post a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.post a:hover {
  text-decoration: underline;
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.post-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
  margin: 0.5rem 0;
}

.post-date {
  color: #777;
  font-size: 1rem;
  white-space: nowrap;
}

/* Only apply grayscale + hover when inside the journal list */
.journal .post-image {
  width: 100%;
  height: auto;
  margin: 0.5rem 0 0.75rem 0;
  border-radius: 3px;
  filter: grayscale(100%) brightness(85%);
  transition: filter 0.4s ease, transform 0.4s ease;
}

.journal .post-image:hover {
  filter: grayscale(0%) brightness(100%);
  transform: scale(1.02);
}

.post-description {
  margin: 0.25rem 0;
  color: #aaa;
  font-size: 0.9rem;
}

/* --- Pagination --- */
.pagination {
  margin-top: 3rem;
  color: #777;
}

.pagination a {
  color: #999;
  margin-right: 1rem;
}

.pagination a:hover {
  color: #fff;
}

/* --- Footer --- */
footer {
  margin-top: 4rem;
  color: #555;
  font-size: 0.8rem;
  max-width: 720px;
}

/* --- Single Post Page --- */
.post-single {
  max-width: 720px;
  margin-left: 0;
}

/* No grayscale or hover effect on single post images */
.post-single img {
  width: 100%;
  margin: 1rem 0;
  border-radius: 3px;
  filter: none;
  transition: none;
}

/* Post meta and body */
.meta {
  color: #777;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.post-body h2 {
  color: #fff;
  margin-top: 2rem;
  font-size: 1rem;
}

.post-body a {
  color: #ccc;
  text-decoration: underline;
}

.post-body a:hover {
  color: #fff;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  body {
    padding: 1rem;
  }

  .main-content {
    max-width: 100%;
  }

  .post-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }
}

/* 🧭 Seamless dark table styling (matches background) */
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9rem;
  margin: 1.5rem 0;
  background-color: transparent;
  border: 1px solid rgb(38, 38, 38);
  /* subtle thin grid */
  border-radius: 0.5rem;
  overflow: hidden;
}

.prose table img {
  max-width: 150px;
}

.prose th,
.prose td {
  border: 1px solid rgb(38, 38, 38);
  padding: 0.5rem 0.75rem;
  vertical-align: top;
  color: rgb(209, 213, 219);
  /* gray-300 */
  line-height: 1.5;
  background-color: transparent;
  /* blend with page background */
}

.prose th {
  color: rgb(243, 244, 246);
  /* gray-100 */
  font-weight: 600;
  text-align: left;
}

.prose tr:nth-child(even) td {
  background-color: rgba(255, 255, 255, 0.01);
  /* faint row contrast */
}

.prose tr:hover td {
  background-color: rgba(255, 255, 255, 0.03);
  /* subtle hover */
  transition: background-color 0.25s ease-in-out;
}

/* Optional: make links fit table theme */
.prose table a {
  color: rgb(209, 213, 219);
  text-decoration: underline;
}

.prose table a:hover {
  color: rgb(243, 244, 246);
  text-decoration: none;
}

/* 🌟 Support Box Styles */
#support-box {
  margin-top: 5rem;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

#support-box .support-inner {
  border: 1px solid #444;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  color: #ccc;
  font-size: 0.9rem;
  font-family: monospace, monospace;
  background: transparent;
  animation: blink-border 1.2s infinite ease-in-out;
  transition: border-color 0.3s ease;
}

/* link style */
#support-box .link-muted {
  font-size: 100%;
  color: inherit;
  text-decoration: underline;
  margin-left: 4px;
}

#support-box .link-muted:hover {
  background-color: #FFF;
  color: #000;
  text-decoration: underline;
}

/* 💫 Blinking border animation */
@keyframes blink-border {
  0%, 100% {
    border-color: #333;
    box-shadow: 0 0 0px #555;
  }
  50% {
    border-color: #aaa;
    box-shadow: 0 0 6px #888;
  }
}

/* Compact QR Donation Card */
.qr-layout {
  padding-top: 2rem;
  width: 200px;
  text-align: left;
  background: transparent;
  color: #ccc;
}

.qr-layout a {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
}

.qr-layout h3 {
  font-size: 1rem;
  color: #ddd;
  font-weight: 600;
  margin: 0 0 0.3rem 0; /* tighten title spacing */
}

.qr-layout img {
  width: 180px;
  height: auto;
  border-radius: 4px;
  margin: 0 0 0.35rem 0; /* small gap under QR */
  border: 1px solid #333;
}

.qr-layout p {
  font-size: 0.8rem;
  color: #999;
  margin: 0;
  text-decoration: underline;
}

.qr-layout a:hover p {
  color: #fff;
}

/* Post Gallery */
.gallery-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

/* Ensure 1 image per line on narrow screens */
@media (max-width: 599px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* 2 images per row on small tablets */
@media (min-width: 600px) and (max-width: 899px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 3 images per row on medium screens */
@media (min-width: 900px) and (max-width: 1199px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 4 images per row on large screens */
@media (min-width: 1200px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.gallery-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.gallery-grid img:hover {
  transform: scale(1.03);
}

.post-gallery {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #222;
}

.post-gallery h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}


/* === Light Mode: True Monochrome Mirror === */
@media (prefers-color-scheme: light) {

  /* --- Base --- */
body {
  background-color: #FFF;
  color: #222;
}

/* === Navigation Bar === */
.site-nav {
  border-bottom: 1px solid #999;
}

/* Logo */
.nav-logo-img {
  filter: brightness(0); /* make light logo dark on white */
  opacity: 0.9;
  transition: opacity 0.3s ease, filter 0.3s ease;
}
.nav-logo-img:hover {
  opacity: 0.5;
}

/* Links */
.nav-links a {
  color: #444;
}

.nav-links a:hover {
  color: #000;
}

/* === Dropdown === */
.dropdown-menu {
  background-color: #FFF;
}

.dropdown-menu a {
  color: #444;
}

.dropdown-menu a:hover {
  background-color: #f2f2f2;
  color: #000;
}

/* ADD MOBILE DROPDOWN */
/* === Mobile Navigation Toggle (fixed, aligned, animated) === */
.nav-toggle {
  display: none;
}

/* Label wrapper for the icon */
.nav-toggle-label {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 42px; /* matches your logo height */
  width: 32px;
  cursor: pointer;
  position: relative;
}

/* Base line (the middle bar) */
.nav-toggle-label span {
  position: relative;
  display: block;
  width: 22px;
  height: 2px;
  background-color: #000;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Top and bottom bars */
.nav-toggle-label span::before,
.nav-toggle-label span::after {
  background-color: #222;
}

/* Hide hamburger icon and checkbox on desktop */
.nav-toggle,
.nav-toggle-label {
  display: none;
}

/* === Responsive behavior === */
@media (max-width: 768px) {
  /* Adjust padding and alignment for smaller screens */
  .nav-container {
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.75rem 0;
  }

  /* Show the hamburger icon */
  .nav-toggle-label {
    display: flex;
  }

  /* Hide nav links by default */
  .nav-links {
    background-color: #FFF;
    border-top: 1px solid #2a2a2a;
  }

  .nav-links a {
    color: #444;
    text-decoration: none;
    border-bottom: 1px solid #f2f2f2;
  }

  .nav-links a:hover {
    background-color: #f2f2f2;
    color: #000;
  }

  /* Show menu when checkbox checked */
  .nav-toggle:checked ~ .nav-links {
    display: flex;
  }

  /* Animate hamburger → X */
  .nav-toggle:checked + .nav-toggle-label span {
    background: transparent;
  }

  .nav-toggle:checked + .nav-toggle-label span::before {
    transform: rotate(45deg);
  }

  .nav-toggle:checked + .nav-toggle-label span::after {
    transform: rotate(-45deg);
  }

  /* Dropdown menus: stack instead of hover */
  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
  }

  .dropdown-menu a {
    padding-left: 1.5rem;
    font-size: 0.85rem;
  }

  .dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
  }

  .dropdown .divider {
    display: none;
  }
}

/* Adjust text baseline for perfect balance */
.logo-text {
  color: #000;
}

/* Headings */
.prose h1 {
   color: #000;
}

.prose h2 {
  color: #000;
}

.prose h3 {
  color: #000;
}

.prose h4 {
  color: #000;
}

/* Paragraphs & text */
a {
  color: #444;
}

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

hr {
  max-width: 720px;
  border: none;
  border-bottom: 1px solid #333;
  margin: 1rem 0;
}

/* --- Journal Feed (Homepage/List View) --- */
.post-title {
  color: #000;
}

.post-date {
  color: #444;
}

/* Only apply grayscale + hover when inside the journal list */
.post-description {
  color: #444;
}

/* --- Pagination --- */
.pagination {
  margin-top: 3rem;
  color: #444;
}

.pagination a {
  color: #444;
  margin-right: 1rem;
}

.pagination a:hover {
  color: #000;
}

/* --- Footer --- */
footer {
  color: #666;
}

/* Post meta and body */
.meta {
  color: #000;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.post-body h2 {
  color: #000;
}

.post-body a {
  color: #444;
}

.post-body a:hover {
  color: #000;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  body {
    padding: 1rem;
  }

  .main-content {
    max-width: 100%;
  }

  .post-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }
}

/* 🧭 Seamless light table styling (matches background) */
.prose th,
.prose td {
  border: 1px solid #999;
  color: #000;
}

.prose th {
  color: #000;
}

.prose tr:nth-child(even) td {
  background-color: #f9f9f9;
}

.prose tr:hover td {
  background-color: #EEE;
}

/* Optional: make links fit table theme */
.prose table a {
  color: #444;
  text-decoration: underline;
}

.prose table a:hover {
  color: #000;
  text-decoration: none;
}

/* 🌟 Support Box Styles */
#support-box .link-muted:hover {
  background-color: #000;
  color: #FFF;
  text-decoration: underline;
}

#support-box .support-inner {
  border: 1px solid #000;
  color: #444;
}

/* link style */
#support-box .link-muted:hover {
  color: #FFF;
}

/* Compact QR Donation Card */
.qr-layout a {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
}

.qr-layout p {
  color: #444;
}

.qr-layout a:hover p {
  color: #000;
}

}
