/* Dark mode for Google login button */
.dark-mode .google-login-btn {
  background: #23272f !important;
  color: #F6E05E !important;
  border: 1px solid #FF6B00 !important;
  box-shadow: 0 2px 8px #FF6B0022 !important;
}

.dark-mode .google-login-btn:hover {
  background: #FF6B00 !important;
  color: #23272f !important;
  border-color: #F6E05E !important;
}
/* Palette: */
/* Vibrant Orange #FF6B00 */
/* Dark Gray #4A5568 */
/* White #FFFFFF */
/* Yellow #F6E05E */
/* Very Light Gray #F7FAFC */
::selection {
  background-color: #F6E05E; /* Your chosen yellow color */
  color: #2D3748;           /* A dark text color for good readability */
}

body {
    font-family: "Roboto Condensed", sans-serif;
    margin: 0;
    padding: 0;
    background-color: #F3F4F6; 
    background-image:
        url("data:image/svg+xml;utf8,<svg width='30' height='30' xmlns='http://www.w3.org/2000/svg'><g stroke='rgba(74,85,104,0.28)' stroke-width='1.2'><line x1='8' y1='8' x2='22' y2='22'/><line x1='22' y1='8' x2='8' y2='22'/></g></svg>"),
        linear-gradient(120deg, #222 0%, #bbb 50%, #f7fafc 100%);
    background-size: auto, 200% 200%;
    background-repeat: repeat, no-repeat;
    background-attachment: local, scroll;
    background-position: top left, 0% 50%;
    animation: animated-bg-gradient-gray 20s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    color: #1A202C;
    display: flex;
    max-width: 75%;
    flex-direction: column;
    min-height: 100vh;
    letter-spacing: 0.015em;
    /* Remove body-fadein animation */
    padding-top: 0 !important; /* Ensure content is not hidden behind fixed header */
}
.main-header, footer {
    width: 100vw !important;
    box-sizing: border-box !important;
}
@keyframes animated-bg-gradient-gray {
    0% {
        background-position: top left, 0% 50%;
    }
    50% {
        background-position: top left, 100% 50%;
    }
    100% {
        background-position: top left, 0% 50%;
    }
}

@keyframes body-fadein {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Text Selection Styling */
::selection {
    background: #F6E05E;
    color: #4A5568;
    text-shadow: none;
}

::-moz-selection {
    background: #F6E05E;
    color: #4A5568;
    text-shadow: none;
}

.main-header {
    position: sticky !important;
    top: 0;
    left: 0;
    width: 100vw;
    z-index: 1000;
    background: linear-gradient(90deg, #FF6B00 96%, #F6E05E 100%);
    box-shadow: 0 4px 24px 0 rgba(74,85,104,0.10);
}

.logo {
    display: block;
    width: 200px; 
    height: auto;
    margin-left: 1%;
    margin-top: 0.5%;
    position: absolute;
    filter: drop-shadow(0 2px 8px rgba(74,85,104,0.13));
    transition: width 0.3s, min-width 0.3s;
}

header,
.main-header {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1200 !important;
    border-bottom-left-radius: 1.5rem;
    border-bottom-right-radius: 1.5rem;
    background: linear-gradient(90deg, #FF6B00 96%, #F6E05E 100%);
    box-shadow: 0 4px 24px 0 rgba(74,85,104,0.10);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 40px;
    border-radius: 0;
    padding: 0;
}

header {
    background-color: #FF6B00;
    padding: 0;
    text-align: left;
    color: white;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between; 
    gap: 1rem;
    min-height: 40px;
    border-radius: 0;
    box-shadow: 0 4px 24px 0 rgba(74,85,104,0.10);
    z-index: 1000;
    position: sticky !important;
    top: 0;
    left: 0;
    width: 100vw;
    border-bottom-left-radius: 1.5rem;
    border-bottom-right-radius: 1.5rem;
    /* Subtle gradient for header */
    background: linear-gradient(90deg, #FF6B00 96%, #F6E05E 100%);
    overflow: visible;
    transition: min-height 0.3s, padding 0.3s, font-size 0.3s;
}

header h1 {
    font-size: 3rem; 
    margin: 0;
    margin-left: 15%;
    text-align: left;
    flex: 1;
    line-height: 1; 
    transition: font-size 0.3s, margin-left 0.3s;
}

nav ul,
nav li {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
    list-style: none;
}

nav {
    margin-top: -0.5rem;
    width: auto;
    height: 100px;
    flex-grow: 0;
    align-self: flex-end;
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    background: linear-gradient(90deg, #4A5568 80%, #222 100%);
    border-radius: 1.2rem 1.2rem 1.2rem 1.2rem;
    box-shadow: 0 4px 24px 0 rgba(74,85,104,0.10);
    margin: 0;
    margin-right: 2rem;
    margin-top: 0;
    overflow: visible;
    /* Add a subtle label above the menu */
    position: relative;
    /* Extend nav background to top of header */
    min-height: 100%;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

nav::before {
    content: "Menu";
    position: absolute;
    top: -1.8rem;
    right: 1.5rem;
    left: 1.5rem;
    color: #4A5568;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.7;
    pointer-events: none;
    text-align: right;
}

nav > ul {
    display: flex;
    align-items: stretch; 
    height: auto;
    justify-content: flex-end; 
    flex: 1 1 auto;
    align-items: stretch;
    height: 100%;
    /* Ensure menu fills nav background */
}

nav > ul > li {
    display: flex;
    align-items: stretch;
    margin: 0 0.5rem;
}

nav > ul > li > a {
    display: flex;
    align-items: center;
    height: 70%;
    padding: 1.0rem 2.5rem; 
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.6rem;
    background-color: #4A5568; 
    border: 2px solid transparent;
    border-radius: 1.2rem;
    margin: 0.3rem 0;
    box-shadow: 0 1px 6px rgba(74,85,104,0.07);
    transition: 
        background-color 0.3s ease,
        color 0.3s ease,
        box-shadow 0.3s,
        border-color 0.3s;
    letter-spacing: 0.02em;
    outline: none;
}

nav > ul > li > a:hover,
nav > ul > li > a:focus {
    background-color: #E55D00;
    color: #F6E05E;
    box-shadow: 0 4px 16px rgba(255,107,0,0.13);
    border-color: #FF6B00;
}

nav > ul > li > a:active {
    background-color: #E55D00;
    color: #F6E05E;
    border-color: #FF6B00;
}

nav > ul > li > a:focus {
    border-color: #F6E05E;
    box-shadow: 0 0 0 3px #F6E05E55;
}

.dropdown-content {
    display: none;
    background: rgba(74,85,104,0.98);
    min-width: 180px;
    box-shadow: 0px 8px 24px 0px rgba(0, 0, 0, 0.13);
    z-index: 1;
    border-radius: 1rem;
    top: 100%;
    left: 0;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    position: absolute;
    margin-top: 0.3rem;
    overflow: hidden;
}

nav ul li:hover .dropdown-content,
nav ul li:focus-within .dropdown-content {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-content a {
    color: white;
    padding: 1rem 1.5rem;
    display: block;
    text-align: left;
    text-decoration: none;
    border-bottom: 1px solid #F6E05E22;
    border-radius: 0;
    background: none;
    transition: background 0.2s, color 0.2s;
    font-size: 1.1rem;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover,
.dropdown-content a:focus {
    background-color: #E55D00;
    color: #F6E05E;
    border-radius: 0.7rem;
}

.dropdown-content a:focus {
    background: #F6E05E;
    color: #4A5568;
    outline: none;
}

nav ul li.dropdown {
    position: relative;
    display: block;
}

/* Dropdown Arrow Styling */
nav ul li.dropdown > a::after {
    content: '\25BC'; 
    font-size: 0.8em;
    margin-left: 0.5em;
    transition: transform 0.3s ease;
    display: inline-block; 
}

nav ul li.dropdown:hover > a::after {
    transform: rotate(180deg); 
}

.content-layout {
    display: flex;
    flex-direction: row;
    max-width: 1200px;
    margin: 0 auto;
    flex: 1;
    width: 100%;
    padding-left: 260px; /* match sidebar width */
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: rgba(247,250,252,0.85);
    border-right: 2px solid #e2e8f0;
    padding: 2rem 1rem;
    box-sizing: border-box;
    z-index: 100;
    overflow-y: auto;
    backdrop-filter: blur(6px);
    border-radius: 0; /* Remove rounding */
    box-shadow: 0 8px 32px 0 rgba(74,85,104,0.10);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar:hover {
    transform: translateX(4px) scale(1.01);
    box-shadow: 0 12px 32px 0 rgba(74,85,104,0.18);
}

.sidebar h2 {
    font-size: 1.5rem;
    color: #FF6B00;
    margin-bottom: 1rem;
    border-bottom: 2px solid #FF6B00;
    padding-bottom: 0.5rem;
}

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

.sidebar ul li {
    margin-bottom: 1rem;
}

.sidebar ul li a {
    color: #4A5568;
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.2s;
    border-radius: 0.8rem;
}

.sidebar ul li a:hover {
    color: #FF6B00;
    text-decoration: underline;
}

.sidebar ul li a:focus {
    outline: 2px solid #F6E05E;
    outline-offset: 2px;
}

.sidebar ul li .sidebar-btn {
    display: block;
    width: 100%;
    background: #FF6B00;
    color: #fff;
    font-weight: bold;
    font-size: 1.1rem;
    border: none;
    border-radius: 0.8rem;
    padding: 0.8em 1.2em;
    margin: 0.2em 0;
    box-shadow: 0 2px 8px rgba(255,107,0,0.08);
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: 
        background 0.2s,
        color 0.2s,
        box-shadow 0.2s,
        transform 0.1s;
}

.sidebar ul li .sidebar-btn:hover,
.sidebar ul li .sidebar-btn:focus {
    background: #E55D00;
    color: #F6E05E;
    box-shadow: 0 4px 16px rgba(255,107,0,0.15);
    outline: none;
    transform: translateY(-2px) scale(1.03);
}

.sidebar ul li .sidebar-btn:focus {
    outline: 2px solid #F6E05E;
    outline-offset: 2px;
}

.sidebar ul li .sidebar-latest-project {
    display: block;
    width: 90%;
    background: #FF6B00;
    color: #F6E05E;
    font-weight: bold;
    font-size: 1.08rem;
    border: none;
    border-radius: 0.8rem;
    padding: 0.5em 0.8em;
    margin: 0.2em auto 0.8em auto;
    box-shadow: 0 2px 8px rgba(255,107,0,0.10);
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: 
        background 0.2s,
        color 0.2s,
        box-shadow 0.2s,
        transform 0.1s;
    letter-spacing: 0.01em;
}

.sidebar ul li .sidebar-latest-project:hover,
.sidebar ul li .sidebar-latest-project:focus {
    background: #E55D00;
    color: #fff;
    box-shadow: 0 4px 16px rgba(255,107,0,0.18);
    outline: none;
    transform: translateY(-2px) scale(1.03);
}

.sidebar ul li .sidebar-latest-project:focus {
    outline: 2px solid #F6E05E;
    outline-offset: 2px;
}

.sidebar ul li a:not(.sidebar-latest-project):before {
    content: "→";
    margin-right: 0.5em;
    color: #FF6B00;
    font-weight: bold;
    display: inline-block;
    transform: scale(1.2);
    transition: transform 0.2s ease;
}

.sidebar ul li a:not(.sidebar-latest-project):hover:before {
    transform: scale(1.2) translateX(2px);
}

.sidebar ul li a:not(.sidebar-latest-project) {
    display: flex;
    align-items: center;
    padding: 0.3em 0.5em;
}

main {
    padding: 2rem;
    flex: 1;
    margin: 0 auto; 
    width: 800px; 
    min-width: 0;
    border-radius: 1.2rem;
    background: rgba(255,255,255,0.04);
    box-shadow: 0 2px 24px 0 rgba(74,85,104,0.07);
}

.section {
    padding: 2rem;
    margin-bottom: 10px;
    background: rgba(255,255,255,0.92);
    border-radius: 1.2rem;
    box-shadow: 0 8px 32px 0 rgba(74,85,104,0.08);
    transition: 
        box-shadow 0.3s cubic-bezier(.4,0,.2,1),
        transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        background 0.2s,
        margin 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        width 0.3s,
        font-size 0.3s;
    max-width: 900px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    font-size: 1.12rem;
}

.section:first-of-type {
    margin-top: 20px; /* Add margin to the first section */
}
.section:first-of-type:not(:hover){
    margin-top: 8px;
    transition: margin-top 0.3s ease; 
}
.section:hover{
    box-shadow: 0 20px 48px -12px rgba(74,85,104,0.25);
    transform: translateY(-4px) scale(1.01);
    background: rgba(255,255,255,0.97);
}
.section:not(:hover){
    box-shadow: 0 5px 16px rgba(0,0,0,0.2);
    transition: box-shadow 0.3s ease ease-out;
    margin-bottom: 10px;
    transition: margin-bottom 0.5s ease;
    margin-top: 0px;
    transition: margin-top 0.5s ease; 
}

/* h3 Styling */
.section h3, h3 {
    color: #FF6B00;
    font-size: 1.35rem;
    margin-top: 1.5em;
    margin-bottom: 0.7em;
    font-weight: 700;
    letter-spacing: 0.01em;
    border-left: 4px solid #F6E05E;
    padding-left: 0.7em;
    background: linear-gradient(90deg, #fff 80%, #f7fafc 100%);
    border-radius: 0.3em;
    box-shadow: 0 1px 6px 0 rgba(255,107,0,0.04);
    transition: color 0.3s, background 0.3s;
}

.section h2 {
    color: #4A5568;
    font-size: 2rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #FF6B00;
    padding-bottom: 0.5rem;
}
/* Dark mode for h3 */
.dark-mode .section h3, .dark-mode h3 {
    color: #F6E05E !important;
    background: linear-gradient(90deg, #23272f 80%, #181a20 100%) !important;
    border-left: 4px solid #FF6B00 !important;
    box-shadow: 0 1px 8px 0 rgba(246,224,94,0.08);
}

.section p {
    font-size: 1.1rem;
    line-height: 1.7;
}

.section ul {
    list-style-type: square; /* Style the list */
    margin-left: 2rem; /* Indent the list */
    margin-bottom: 1rem;
}

.section ul li {
    font-size: 1.1rem;
    line-height: 1.7;
}

/* General paragraph styling */
p, .section p {
    font-size: 1.12rem;
    line-height: 1.8;
    margin-bottom: 1.2em;
    color: #2D3748;
    text-shadow: 0 1px 1px rgba(255,255,255,0.1);
}

/* h3 Styling */
h3 {
    color: #FF6B00;
    background: linear-gradient(90deg, #FFF6E5 80%, #F6E05E 100%);
    border-left: 6px solid #FF6B00;
    border-radius: 0.7em 0.2em 0.2em 0.7em;
    padding: 0.3em 1em;
    margin: 1.5em 0 1em 0;
    font-size: 1.45em;
    font-weight: 700;
    box-shadow: 0 2px 12px 0 rgba(255,107,0,0.07);
    letter-spacing: 0.01em;
    transition: background 0.3s, color 0.3s;
}

/* h3 Styling for Dark Mode */
.dark-mode h3 {
    color: #F6E05E;
    background: linear-gradient(90deg, #23272f 80%, #4A5568 100%);
    border-left: 6px solid #F6E05E;
    box-shadow: 0 2px 12px 0 rgba(246,224,94,0.10);
}

/* General image styling */
img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1em auto;
    border-radius: 0.4em;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

img[src^="/Assets/"], img[src^="Assets/"] {
    /* No changes needed if served from root/static, but this selector ensures styling applies */
    display: block;
    max-width: 100%;
    height: auto;
}

.float-img {
    float: right;
    margin: 0 0 1em 2em;
    max-width: 320px;
    width: 40%;
    height: auto;
    border-radius: 0.4em;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.float-img:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 24px -8px rgba(74,85,104,0.25);
}

.float-img-container {
    float: right;
    margin: 0 0 1em 2em;
    max-width: 320px;
    width: 40%;
    position: relative;
    overflow: hidden;
    border-radius: 0.4em;
}

.float-img-container img {
    margin: 0;
    display: block;
    width: 100%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.float-img-container figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(74,85,104,0.9);
    color: #F6E05E;
    padding: 0.8em;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9em;
    text-align: center;
}

.float-img-container:hover figcaption {
    transform: translateY(0);
}

float-img-container:hover img {
    transform: scale(1.05);
}

footer {
    background-color: #4A5568;
    color: #F7FAFC;
    padding: 2rem 1rem 1.5rem 1rem;
    font-size: 1.05rem;
    line-height: 1.7;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7em;
    text-align: center;
    margin-top: auto;
    border-top-left-radius: 1.2rem;
    border-top-right-radius: 1.2rem;
    box-shadow: 0 -2px 16px 0 rgba(74,85,104,0.08);
    background: linear-gradient(90deg, #4A5568 85%, #222 100%);
}

footer p {
    margin: 0;
    font-size: 0.9rem;
}

footer a {
    color: #F6E05E;
    text-decoration: underline;
}

footer a:hover {
    color: white;
}

footer .footer-details {
    margin-top: 0.7em;
    color: #F6E05E;
    font-size: 0.98em;
    opacity: 0.85;
    text-align: center;
}

footer .footer-links {
    margin-top: 0.3em;
    font-size: 0.98em;
    color: #F6E05E;
    display: flex;
    gap: 1.2em;
    flex-wrap: wrap;
    justify-content: center;
}

footer .footer-links a {
    color: #F6E05E;
    text-decoration: underline;
    transition: color 0.2s;
}

footer .footer-links a:hover {
    color: #fff;
}

/* --- Comments Section Styles (moved from post HTML) --- */
.comments-section {
  background: var(--background, #f7fafc);
  border-radius: 1em;
  box-shadow: 0 2px 8px #0001;
  margin: 2em auto 3em auto;
  padding: 1em 2em;
  max-width: 700px;
  min-width: 240px;
  width: 100%;
  align-self: flex-start;
  z-index: 10;
  position: static;
}
.comment {
  margin-bottom: 1em;
  padding-bottom: 0.5em;
  border-bottom: 1px solid #eee;
}
.comment-meta {
  color: var(--primary, #222);
  font-size: 1em;
  margin-bottom: 0.2em;
}
.comment-name {
  color: #F6E05E;
  font-weight: bold;
}
.comment-date {
  color: #888;
  font-size: 0.9em;
  margin-left: 0.5em;
}
.comment-edited {
  color: #888;
  font-size: 0.85em;
  margin-left: 0.5em;
  font-style: italic;
}
.comment-body {
  white-space: pre-line;
  color: var(--text, #222);
  font-size: 1.3em;
  margin: 0.2em 0 0.5em 0;
  font-family: inherit;
  font-weight: 600;
}
.comment-actions button {
  background: #FF6B00;
  color: #fff;
  border: none;
  border-radius: 0.5em;
  padding: 0.2em 0.8em;
  margin-right: 0.5em;
  font-size: 1em;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s;
}
.comment-actions button:hover {
  background: #e65c00;
}
.comment-empty {
  color: #888;
  font-style: italic;
  margin: 1em 0;
}
.google-login-btn {
  display: inline-block;
  background: #fff;
  color: #444;
  border: 1px solid #ccc;
  border-radius: 0.5em;
  padding: 0.5em 1.2em;
  font-weight: bold;
  text-decoration: none;
  box-shadow: 0 2px 4px #0001;
  transition: background 0.2s;
}
.google-login-btn:hover {
  background: #f6f6f6;
  color: #222;
  border-color: #888;
}
@media (max-width: 1200px) {
  .comments-section {
    max-width: 98vw;
    min-width: 0;
  }
}

@media (max-width: 1200px) {
    .content-layout {
        max-width: 1000px;
        padding-left: 200px;
    }
    .sidebar {
        width: 200px;
    }
    main {
        width: 90vw;
        max-width: 700px;
    }
    .section {
        max-width: 700px;
        font-size: 1.05rem;
        padding: 1.5rem;
    }
}

@media (max-width: 900px) {
    html {
        font-size: 16px;
    }
    .content-layout {
        flex-direction: column;
        padding-left: 0;
        max-width: 100vw;
    }
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 2px solid #e2e8f0;
        padding: 1rem 0.5rem;
        z-index: 10;
        overflow-y: visible;
    }
    main {
        width: 98vw;
        max-width: 100vw;
        padding: 1rem 0.5rem;
        margin: 0;
    }
    .section {
        padding: 1rem;
        max-width: 98vw;
        font-size: 0.98rem;
    }
    #body, textarea#body {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
        font-size: 1em;
    }
    #body-preview {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
        font-size: 1em;
    }
    header {
        min-height: 48px;
        padding: 0.3em 0.5em;
    }
    header h1 {
        font-size: 1.7rem;
        margin-left: 1.5rem;
    }
    nav {
        height: auto;
        margin-right: 0.5rem;
        border-radius: 1rem;
    }
    .logo {
        width: 110px;
        min-width: 70px;
        margin-left: 0.5em;
    }
    body {
        padding-top: 60px !important;
    }
    header,
    .main-header {
        min-height: 48px;
    }
}

@media (max-width: 600px) {
    .section:first-of-type {
    margin-top: 6% !important;
  }
    html {
        font-size: 13px;
    }
    header {
        min-height: 32px;
        padding: 0.2em 0.2em;
    }
    header h1 {
        font-size: 1.1rem;
        margin-left: 1rem;
    }
    nav > ul > li > a {
        padding: 0.4rem 0.7rem;
        font-size: 1rem;
    }
    .sidebar h2 {
        font-size: 1rem;
    }
    .sidebar {
        padding: 0.3rem 0.1rem;
    }
    .section {
        padding: 0.3rem;
        max-width: 99vw;
        font-size: 1.08rem;
    }
    .logo {
        width: 70px;
        min-width: 50px;
    }
    .post-form {
        padding: 0.3rem;
    }
    #body, textarea#body {
        font-size: 0.92em;
    }
    #body-preview {
        font-size: 0.92em;
    }
    body {
        padding-top: 38px !important;
    }
    header,
    .main-header {
        min-height: 32px;
    }
}

@media (max-width: 450px) {
    html {
        font-size: 11px;
    }
    header {
        min-height: 24px;
        padding: 0.1em 0.1em;
    }
    header h1 {
        font-size: 0.9rem;
        margin-left: 0.5rem;
    }
    .logo {
        width: 45px;
        min-width: 35px;
    }
    .section {
        padding: 0.15rem;
        max-width: 100vw;
        font-size: 1rem;
    }
    .post-form {
        padding: 0.1rem;
    }
    #body, textarea#body {
        font-size: 0.85em;
    }
    #body-preview {
        font-size: 0.85em;
    }
    body {
        padding-top: 28px !important;
    }
    header,
    .main-header {
        min-height: 24px;
    }
}

@media (max-width: 600px) {
  .comments-section {
    margin-left: 0.2em;
    margin-right: 0.2em;
    padding-left: 0.5em;
    padding-right: 0.5em;
  }
  main > .section:first-of-type {
    margin-top: 2.5em;
  }
}

@media (max-width: 450px) {
  .comments-section {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0.2em;
    padding-right: 0.2em;
  }
}

pre {
    background-color: #f4f4f4; /* Light grey background */
    padding: 1em;
    border-radius: 8px; /* Rounded corners */
    overflow-x: auto; /* Horizontal scroll for long lines */
    font-family: 'Courier New', Courier, monospace; /* Monospace font */
    font-size: 0.9em;
    line-height: 1.5;
    border: 1px solid #ddd;
    color: #222;
    transition: background 0.3s, color 0.3s;
}
.dark-mode pre {

    background-color: rgba(119, 72, 39,0.8) !important; /* Semi-transparent dark orange */
    color: #F6E05E !important;
    border: 1px solid #FF6B00 !important;
    box-shadow: 0 1px 8px 0 rgba(255,107,0,0.10);
}

.dark-mode pre code {
    color: #d8cbc2 !important;
}

pre code {
    /* Ensures code inside pre doesn't break formatting */
    display: block;
    white-space: pre-wrap; /* Keeps long lines from overflowing */
    word-wrap: break-word; /* Breaks words if necessary */
}
/* === DARK MODE SECTION STYLES === */
.dark-mode .section,
.dark-mode .sidebar,
.dark-mode .sidebar *,
.dark-mode .comments-section {
  background: #23272f !important;
  color: #f7fafc !important;
}
.dark-mode .section h2,
.dark-mode .section p,
.dark-mode .section ul,
.dark-mode .section li {
  color: #f7fafc !important;
}
.dark-mode .comments-section .comment-name {
  color: #F6E05E !important;
}
.dark-mode .comments-section .comment-date,
.dark-mode .comments-section .comment-edited {
  color: #bbb !important;
}
.dark-mode .comments-section .comment-body {
  color: #f7fafc !important;
}
.dark-mode .all-posts-container {
  background: none !important;
}
.dark-mode .posts-col {
  background: #23272f !important;
  color: #f7fafc !important;
  box-shadow: 0 8px 32px 0 rgba(0,0,0,0.45);
}
.dark-mode .posts-col h2,
.dark-mode .posts-group-year,
.dark-mode .posts-group-month,
.dark-mode .post-link-list a,
.dark-mode .post-date {
  color: #f7fafc !important;
}
.dark-mode .post-link-list li:hover {
  background: #333a44 !important;
}
.dark-mode .all-posts-title {
  background: linear-gradient(90deg, #23272f 80%, #181a20 100%) !important;
  color: #F6E05E !important;
}

/* Math styling for dark mode */
.dark-mode math {
  background: #23272f;
  color: #F6E05E;
  border: 1px solid #444;
  box-shadow: 0 1px 4px #0008;
}
.dark-mode math .frac .num,
.dark-mode math .frac .den {
  border-color: #F6E05E;
  color: #F6E05E;
}
.dark-mode math .frac .frac-line {
  border-top: 2px solid #F6E05E;
}

::-webkit-scrollbar {
    width: 10px;
    background: #e2e8f0;
}
::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
    background: #FF6B00;
}

.dark-mode ::-webkit-scrollbar {
  background: #181a20 !important;
}
.dark-mode ::-webkit-scrollbar-thumb {
  background: #23272f !important;
}
.dark-mode ::-webkit-scrollbar-thumb:hover {
  background: #444 !important;
}

.post-form {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    background: rgba(255,255,255,0.92);
    border-radius: 1.2rem;
    box-shadow: 0 8px 32px 0 rgba(74,85,104,0.08);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.post-form label {
    font-weight: bold;
    color: #FF6B00;
    font-size: 1.1rem;
}

.post-form input[type="text"],
.post-form input[type="date"],
.post-form select,
.post-form textarea {
    padding: 0.7rem;
    border-radius: 0.7rem;
    border: 1px solid #4A5568;
    background: #F7FAFC;
    color: #1A202C;
    font-size: 1.1rem;
    font-family: inherit;
    resize: none;
}

.post-form textarea {
    min-height: 140px;
    resize: vertical;
}

.post-form button[type="submit"] {
    background: #FF6B00;
    color: #fff;
    border: none;
    border-radius: 0.7rem;
    padding: 0.9rem 1.5rem;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    margin-top: 1rem;
}

.post-form button[type="submit"]:hover,
.post-form button[type="submit"]:focus {
    background: #F6E05E;
    color: #23272f;
}

@media (max-width: 900px) {
  .comments-section {
    margin-left: 0.5em;
    margin-right: 0.5em;
    padding-left: 0.7em;
    padding-right: 0.7em;
  }
}

@media (max-width: 600px) {
  .comments-section {
    margin-left: 0.2em;
    margin-right: 0.2em;
    padding-left: 0.5em;
    padding-right: 0.5em;
  }

}

@media (max-width: 450px) {
  .comments-section {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0.2em;
    padding-right: 0.2em;
  }
}

@media (max-width: 800px) {
  #mobile-darkmode-label {
    color: #222;
    font-weight: bold;
    font-size: 1.1em;
    padding-bottom: 0.5em;
    padding-top: 0.5em;
    margin-bottom: 0.5em;
    margin-top: 0.5em;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.7em;
  }
}
.frac { display: inline-block; vertical-align: middle; }
.frac .num { display: inline-block; border-bottom: 1px solid #333; padding: 0 2px; }
.frac .den { display: inline-block; padding: 0 2px; font-size: 0.9em; }
math .frac {
    display: inline-block;
    vertical-align: middle;
    text-align: center;
    margin: 0 0.15em;
}
math .frac .num {
    display: block;
    padding: 0 0.2em;
}
math .frac .frac-line {
    display: block;
    border-top: 2px solid #333;
    height: 0;
    margin: 0.1em 0;
}
math .frac .den {
    display: block;
    padding: 0 0.2em;
}
math {
  font-family: 'Cambria Math', 'STIX Math', 'Latin Modern Math', 'Times New Roman', serif;
  font-size: 1.18em;
  font-style: italic;
  color: #2D3748;
  background: #f6e05e33;
  padding: 0.12em 0.5em;
  border-radius: 0.4em;
  margin: 0 0.1em;
  letter-spacing: 0.02em;
  vertical-align: middle;
  box-shadow: 0 1px 4px #ff6b0011;
  border: 1px solid #f6e05e99;
  display: inline-block;
}

h1:not(.header-title-desktop) {
  font-family: 'Roboto Condensed', Arial, sans-serif;
  color: #F6E05E;
  font-size: 2.3em;
  font-weight: 900;
  margin-top: 0.5em;
  margin-bottom: 0.6em;
  letter-spacing: 0.01em;
  line-height: 1.1;
  text-shadow: 0 2px 8px rgba(246, 224, 94, 0.08);
  border-bottom: 2.5px solid #F6E05E;
  padding-bottom: 0.18em;
  background: linear-gradient(90deg, #FFF6E5 0%, #FFF3E0 100%); /* Very light orange gradient */
  border-radius: 0.3em 0.3em 0 0;
}

.dark-mode h1:not(.header-title-desktop) {
  color: #F6E05E;
  background: linear-gradient(90deg, #23272f 0%, #181a20 100%);
  border-bottom: 2.5px solid #FF6B00;
  text-shadow: 0 2px 8px rgba(255, 107, 0, 0.13);
}

