* { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: 'Fira Code', monospace; color: #c9d1d9; background: #0d1117; } a { text-decoration: none; color: #58a6ff; } ul { list-style: none; } .container { display: grid; grid-template-areas: "header header" "sidebar main" "footer footer"; grid-template-columns: 250px 1fr; grid-template-rows: auto 1fr auto; min-height: 100vh; } header { grid-area: header; background: #161b22; border-bottom: 1px solid #30363d; display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 1rem; position: sticky; top: 0; z-index: 10; height: 50px; } header .logo { font-size: 1.5rem; font-weight: bold; color: #ffffff; } .header-toggle-button { background-color: #58a6ff; color: #fff; border: none; border-radius: 0.25rem; padding: 0.5rem 1rem; font-size: 1rem; cursor: pointer; display: none; } .header-toggle-button:hover { background-color: #79c0ff; } nav.top-nav ul { display: flex; gap: 1rem; } aside.sidebar { grid-area: sidebar; background: #161b22; border-right: 1px solid #30363d; padding: 1rem; position: sticky; top: 50px; max-height: calc(100vh - 50px); overflow-y: auto; z-index: 5; display: block; transition: transform 0.3s ease-out; position: relative; } .sidebar h2 { font-size: 1.1rem; margin-bottom: 0.5rem; color: #58a6ff; } .sidebar ul li + li { margin-top: 0.75rem; } .sidebar ul li a:hover { color: #79c0ff; } .close-sidebar-button { background: none; border: none; color: #c9d1d9; font-size: 1.5rem; position: absolute; top: 0.5rem; right: 0.5rem; cursor: pointer; z-index: 101; padding: 0.5rem; line-height: 1; display: none; } .close-sidebar-button:hover { color: #58a6ff; } main { grid-area: main; padding: 1.5rem; overflow-y: auto; /* Changed from 'scroll' to 'auto' for better control with JS */ max-height: calc(100vh - 50px); position: relative; /* Added for positioning the scroll-to-top button within main */ } main { scrollbar-width: none; -ms-overflow-style: none; } main::-webkit-scrollbar { display: none; } .card { background: #161b22; border-radius: 0.5rem; border: 1px solid #30363d; padding: 1rem; margin-bottom: 1.5rem; box-shadow: 0 1px 3px rgba(0,0,0,0.2); } .card h3 { margin-bottom: 0.5rem; color: #ffffff; } .card p { line-height: 1.6; } #blog-viewer { margin-top: 2rem; padding: 1rem; background: #161b22; border: 1px solid #30363d; border-radius: 0.5rem; overflow: hidden; transition: opacity 0.5s ease, transform 0.5s ease; opacity: 0; transform: translateY(10px); } #blog-viewer.visible { opacity: 1; transform: translateY(0); } #recent-posts { display: flex; flex-wrap: wrap; gap: 0.75rem; border-top: 1px solid #30363d; padding-top: 0.75rem; } #recent-posts li { white-space: nowrap; border-right: 1px solid #30363d; padding-right: 0.75rem; margin-right: 0.75rem; } #recent-posts li:last-child { border-right: none; margin-right: 0; padding-right: 0; } footer { grid-area: footer; background: #161b22; border-top: 1px solid #30363d; text-align: center; padding: 1rem; font-size: 0.9rem; align-self: end; } @media (max-width: 768px) { .container { grid-template-areas: "header" "main" "footer"; grid-template-columns: 1fr; } header { position: relative; justify-content: center; } header .logo { margin: 0 auto; } .header-toggle-button { display: block; position: absolute; left: 1rem; margin-left: 0; } nav.top-nav { position: absolute; top: 50px; left: 0; width: 100%; background: #161b22; border-top: 1px solid #30363d; padding: 1rem; display: none; z-index: 9; } nav.top-nav.show { display: block; } nav.top-nav ul { flex-direction: column; gap: 0.5rem; } aside.sidebar { position: fixed; top: 0; left: -50vw; width: 50vw; height: 100vh; border-right: none; border-top: none; z-index: 100; transition: transform 0.3s ease-out; padding-top: 60px; display: block; max-height: 100vh; border-top-right-radius: 0.5rem; border-bottom-right-radius: 0.5rem; } aside.sidebar.open { transform: translateX(100%); } .close-sidebar-button { display: block; } #recent-posts { flex-direction: column; gap: 0.5rem; } #recent-posts li { border-right: none; padding-right: 0; margin-right: 0; } } .search-box { margin: 1rem 0; } .search-box input { width: 100%; padding: 0.5rem; background: #0d1117; border: 1px solid #30363d; color: #c9d1d9; border-radius: 0.25rem; } #scrollToTopBtn { position: absolute; /* Changed from fixed to absolute */ bottom: 20px; right: 20px; background-color: #58a6ff; color: #fff; border: none; border-radius: 50%; width: 40px; height: 40px; font-size: 1.5rem; cursor: pointer; display: none; z-index: 100; } * { scrollbar-width: none; -ms-overflow-style: none; } *::-webkit-scrollbar { display: none; }