:root {
  --deep-slate: #0f111a;
  --sky-paper: #eafcff;
  --dark-cyan: #0F8B8D;
  --highlight-blue: #a6f2ff;
  --blue: #45bec7;
  --monospace: "Berkeley Mono", Monaco, "Cascadia Mono", "Segoe UI Mono", "Roboto Mono", "Oxygen Mono", "Ubuntu Monospace", "Source Code Pro", "Fira Mono", "Droid Sans Mono", "Courier New", monospace;
  --blue-900: #11282a;
  --blue-800: #1f4e4e;
  --blue-700: #2a6468;
  --blue-600: #008a83;
  --blue-500: #69c3bc;
  --blue-400: #94d4c9;
  --blue-300: #bee5df;
  --blue-200: #e8f6f4;
  --blue-100: #fbfdfd;
}

/* Base reset and global structure */
*, *::before, *::after {
  box-sizing: border-box;
}
body, html {
  font-family: var(--monospace);
  background-color: var(--sky-paper);
  color: var(--deep-slate);
  margin: 0;
  line-height: 1.6;
  width: 100%;
  overflow-x: hidden;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
hr {
  border: none;
  border-top: 1px solid var(--dark-cyan);
  margin: 2rem 0;
}

/* Header */
header {
  min-height: 8vh;
  padding: 0;
  background-color: var(--sky-paper);
  border-bottom: 4px solid var(--blue);
}
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
}
.header-title {
  flex: 1;
  text-align: center;
  font-size: 2rem;
  font-weight: bold;
  color: var(--blue-800);
}
.header-title a {
  color: var(--blue-800);
  text-decoration: none;
}
.header-logo {
  flex-shrink: 0;
}
.logo-img {
  height: 40px;
  width: auto;
}
.logo-dark {
  display: none;
}
/* Layout */
.layout {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  width: 100%;
  margin: 0 auto;
  max-width: 1400px;
  padding: 0 1rem;
  gap: 2rem;
}

.main-content {
  flex: 1;
  padding: 2rem 0;
  max-width: 100%;
  margin: 0;
  overflow: visible;
}

.container {
  max-width: 90%;
  margin: 0 auto;
  padding: 1rem;
}

/* Sidebar */

.sidebar {
  width: 250px;
  background-color: var(--sky-paper);
  padding: 1rem 1rem;
  height: fit-content;
  position: sticky;
  top: 8vh; /* stick below the header */
  align-self: flex-start;
}

.sidenav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidenav .section {
  font-weight: bold;
  margin-bottom: 1rem;
  color: var(--blue-800);
}
.sidenav .section ul {
  margin-top: 0.5rem;
  margin-left: 1rem;
}
.sidenav .section ul li {
  margin-bottom: 0.5rem;
}
.sidenav .section ul li a {
  color: var(--blue-600);
  text-decoration: none;
}
.sidenav .section ul li a:hover {
  color: var(--blue);
  text-decoration: underline;
}

/* Dropdown */
.dropdown-toggle {
  all: unset;
  font-family: var(--monospace);
  font-weight: bold;
  font-size: 1rem;
  color: var(--blue-800);
  cursor: pointer;
  display: block;
  width: 100%;
  margin-bottom: 0.5rem;
}
.dropdown-toggle:hover {
  color: var(--blue);
}
.dropdown-toggle .caret {
  float: right;
  font-size: 0.9rem;
}
.dropdown-menu {
  margin-left: 1rem;
  display: none;
}
.dropdown-menu.show {
  display: block;
}

/* Typography */
h1, h2, h3 {
  color: var(--blue-700);
  margin-top: 2rem;
}
a {
  color: var(--blue-600);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Hero Section */
.hero {
  padding: 2rem 1rem;
  background-color: var(--sky-paper);
  text-align: center;
}
.hero h1 {
  font-size: 2.5rem;
  color: var(--blue-800);
}
.hero .subtitle {
  font-size: 1.2rem;
  color: var(--deep-slate);
}


/* Posts */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.post-card {
  border-bottom: 1px solid var(--blue-300);
  padding-bottom: 1rem;
}
.post-thumb {
  max-width: 300px;
  clip-path: polygon(0 0, calc(100% - 60px) 0, 100% 60px, 100% 100%, 0 100%);
  border-radius: 4px;
  object-fit: cover;
  margin-bottom: 1rem;
}
.post-thumb:hover {
  filter: brightness(0.95);
  transform: scale(1.01);
  transition: 0.2s ease;
}
.post-date {
  font-size: 0.9rem;
  color: var(--blue-500);
  margin-bottom: 1.5rem;
}
.post-content img {
  border-radius: 4px;
  margin: 1rem 0;
}

/* Featured Post */
.featured-card {
  display: flex;
  background-color: var(--sky-paper);
  border-left: 6px solid var(--blue);
  border-radius: 6px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}
.featured-card:hover {
  transform: scale(1.01);
}
.featured-img {
  width: 200px;
  object-fit: cover;
}
.featured-text {
  padding: 1rem;
}
.featured-text h2 {
  margin-top: 0;
  font-size: 1.5rem;
}
.featured-text p {
  margin-bottom: 0;
}

/* Category Grid */
.category-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.category-grid li {
  background: var(--sky-paper);
  border-left: 4px solid var(--blue);
  padding: 0.5rem 1rem;
  border-radius: 4px;
}

/* Footer */
footer {
  background-color: var(--sky-paper);
  color: var(--deep-slate);
  font-family: var(--monospace);
  padding: 10px 20px;
  border-top: 2px solid var(--blue);
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.footer-right {
  display: flex;
  list-style-type: none;
  gap: 1rem;
  padding: 0;
  margin: 0;
}
.footer-right a {
  color: var(--dark-cyan);
  font-weight: bold;
}
.footer-right a:hover {
  text-decoration: underline;
}
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  padding: 1rem 0;
}

.image-grid img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 6px;
  transition: transform 0.2s ease;
}

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

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  body, html {
    background-color: var(--deep-slate);
    color: var(--blue-100);
  }
  header {
    background-color: var(--deep-slate);
    border-bottom-color: var(--blue-700);
  }
  .header-title,
  .header-title a {
    color: var(--blue-300);
  }
  .logo-light {
    display: none;
  }
  .logo-dark {
    display: block;
  }
  .sidebar {
    background-color: var(--deep-slate);
  }
  .sidenav .section {
    color: var(--blue-200);
  }
  .sidenav .section ul li a {
    color: var(--blue-400);
  }
  .sidenav .section ul li a:hover {
    color: var(--blue-200);
  }
  a {
    color: var(--blue-300);
  }
  h1, h2, h3 {
    color: var(--blue-300);
  }
  hr {
    border-top: 1px solid var(--blue-700);
  }
  .dropdown-toggle {
    color: var(--blue-200);
  }
  .dropdown-toggle:hover {
    color: var(--blue-100);
  }
  .hero {
    background-color: var(--deep-slate);
  }

  .hero h1 {
    color: var(--blue-200);
  }

  .hero .subtitle {
    color: var(--blue-100);
  }
  footer {
    background-color: var(--blue-900);
    color: var(--blue-100);
    border-top-color: var(--blue-700);
  }
  .featured-card {
    display: flex;
    background-color: var(--deep-slate);
    border-left: 6px solid var(--dark-cyan);
    border-radius: 6px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .layout {
    display: block;
    padding: 0 1rem;
  }

  .main-content {
    padding: 1.5rem 0;
  }

  .sidebar {
    width: 100%;
    position: static;
    padding: 1.5rem 0;
    border-left: none;
    border-top: 1px solid var(--blue-300);
    margin-top: 2rem;
  }
}

