/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Base */
html {
  font-size: 16px;
  line-height: 1.6;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial,
    sans-serif;
  color: #333;
  background: #fff;
}

a {
  color: #0066cc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

h1 { font-size: 1.8rem;  }
h2 { font-size: 1.4rem;  }
h3 { font-size: 1.2rem; }

p {
  margin-bottom: 1em;
}

ul, ol {
  margin-bottom: 1em;
  padding-left: 1.5em;
}

img {
  max-width: 100%;
  height: auto;
}

/* Wrapper — sidebar layout */
.wrapper-sidebar {
  display: grid;
  grid-template-columns: 16rem 1fr;
  min-height: 100vh;
}

/* Wrapper — topnav layout */
.wrapper-topnav {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrapper-topnav .content {
  flex: 1;
}

/* Sidebar */
.sidebar {
  background: #f5f5f5;
  border-right: 1px solid #e0e0e0;
  padding: 1.5rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar .site-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #333;
  display: block;
  margin-bottom: 1.5rem;
}

.sidebar .site-title:hover {
  text-decoration: none;
  color: #0066cc;
}

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

.nav-item {
  margin-bottom: 0.25rem;
}

.nav-item > a {
  display: block;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  color: #555;
}

.nav-item > a:hover {
  background: #e8e8e8;
  text-decoration: none;
  color: #0066cc;
}

.nav-item > a.active {
  background: #0066cc;
  color: #fff;
}

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

.nav-children li a {
  display: block;
  padding: 0.25rem 0.5rem;
  font-size: 0.9rem;
  color: #666;
  border-radius: 4px;
}

.nav-children li a:hover {
  background: #e8e8e8;
  text-decoration: none;
  color: #0066cc;
}

.nav-children li a.active {
  background: #0066cc;
  color: #fff;
}

/* Main area */
.main-area {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.content {
  max-width: 42rem;
  padding: 2rem;
  flex: 1;
}

/* Top nav */
.topnav {
  background: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.topnav .site-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #333;
}

.topnav .site-title:hover {
  text-decoration: none;
  color: #0066cc;
}

.topnav-list {
  list-style: none;
  display: flex;
  gap: 0.25rem;
  padding: 0;
  margin: 0;
}

.topnav-item {
  position: relative;
}

.topnav-item > a {
  display: block;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  color: #555;
}

.topnav-item > a:hover {
  background: #e8e8e8;
  text-decoration: none;
  color: #0066cc;
}

.topnav-item > a.active {
  background: #0066cc;
  color: #fff;
}

.topnav-children {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  list-style: none;
  padding: 0.25rem 0;
  margin: 0;
  min-width: 10rem;
  z-index: 10;
}

.topnav-item:hover .topnav-children {
  display: block;
}

.topnav-children li a {
  display: block;
  padding: 0.35rem 0.75rem;
  color: #555;
  white-space: nowrap;
}

.topnav-children li a:hover {
  background: #e8e8e8;
  text-decoration: none;
  color: #0066cc;
}

.topnav-children li a.active {
  background: #0066cc;
  color: #fff;
}

.wrapper-topnav .content {
  max-width: 42rem;
  padding: 2rem;
  margin: 0 auto;
}

/* Post */
.post-header {
  margin-bottom: 2rem;
}

.post-header h1 {
  margin-top: 0;
}

.post-meta {
  color: #888;
  font-size: 0.9rem;
}

.post-tags {
  font-size: 0.9rem;
  color: #666;
}

.post-tags a {
  background: #eef;
  padding: 0.1em 0.4em;
  border-radius: 3px;
}

/* Post list */
.post-list {
  list-style: none;
  padding: 0;
}

.post-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.post-list time {
  color: #888;
  font-size: 0.85rem;
  white-space: nowrap;
}

/* Collection item */
.item-meta {
  background: #f9f9f9;
  border: 1px solid #eee;
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

.item-meta p {
  margin: 0.25rem 0;
}

.ingredients {
  margin-bottom: 1.5rem;
}

/* Two columns */
.two-columns .columns {
  column-count: 2;
  column-gap: 2rem;
}

/* Sidebar tags */
.sidebar-tags {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e0e0e0;
}

.sidebar-tags h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  margin: 0 0 0.5rem 0;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag-pill {
  display: inline-block;
  padding: 0.15em 0.5em;
  background: #e8e8e8;
  color: #555;
  border-radius: 999px;
  font-size: 0.8rem;
}

.tag-pill:hover {
  background: #0066cc;
  color: #fff;
  text-decoration: none;
}

.tag-pill.active {
  background: #0066cc;
  color: #fff;
  text-decoration: none;
}

/* Page tags */
.page-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.5rem;
}

/* Code blocks */
pre {
  background: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 4px;
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1em;
  font-size: 0.875rem;
  line-height: 1.45;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier,
    monospace;
  font-size: 0.875em;
}

p code, li code {
  background: #f6f8fa;
  padding: 0.15em 0.3em;
  border-radius: 3px;
}

/* Footer */
.site-footer {
  border-top: 1px solid #e0e0e0;
  padding: 1.5rem 2rem;
  font-size: 0.85rem;
  color: #888;
  margin-top: auto;
}

/* Page */
.page h1,
.collection-item h1 {
  margin-top: 0;
}

/* Dark theme — DEV: uncomment to re-enable (remove wrapping comment before deploy) */
 @media (prefers-color-scheme: dark) {
  body {
    color: #c9cdd1;
    background: #1a1d21;
  }

  a {
    color: #6cb4ee;
  }

  .sidebar {
    background: #16191d;
    border-right-color: #2a2e33;
  }

  .sidebar .site-title {
    color: #c9cdd1;
  }

  .sidebar .site-title:hover {
    color: #6cb4ee;
  }

  .nav-item > a {
    color: #9ba1a8;
  }

  .nav-item > a:hover {
    background: #252a30;
    color: #6cb4ee;
  }

  .nav-item > a.active {
    background: #2d5a8c;
    color: #e0e4e8;
  }

  .nav-children li a {
    color: #808890;
  }

  .nav-children li a:hover {
    background: #252a30;
    color: #6cb4ee;
  }

  .nav-children li a.active {
    background: #2d5a8c;
    color: #e0e4e8;
  }

  .topnav {
    background: #16191d;
    border-bottom-color: #2a2e33;
  }

  .topnav .site-title {
    color: #c9cdd1;
  }

  .topnav .site-title:hover {
    color: #6cb4ee;
  }

  .topnav-item > a {
    color: #9ba1a8;
  }

  .topnav-item > a:hover {
    background: #252a30;
    color: #6cb4ee;
  }

  .topnav-item > a.active {
    background: #2d5a8c;
    color: #e0e4e8;
  }

  .topnav-children {
    background: #1e2228;
    border-color: #2a2e33;
  }

  .topnav-children li a {
    color: #9ba1a8;
  }

  .topnav-children li a:hover {
    background: #252a30;
    color: #6cb4ee;
  }

  .topnav-children li a.active {
    background: #2d5a8c;
    color: #e0e4e8;
  }

  .post-meta {
    color: #707880;
  }

  .post-tags {
    color: #808890;
  }

  .post-tags a {
    background: #1e2640;
    color: #6cb4ee;
  }

  .post-list li {
    border-bottom-color: #2a2e33;
  }

  .post-list time {
    color: #707880;
  }

  .item-meta {
    background: #1e2228;
    border-color: #2a2e33;
  }

  .sidebar-tags {
    border-top-color: #2a2e33;
  }

  .sidebar-tags h3 {
    color: #707880;
  }

  .tag-pill {
    background: #252a30;
    color: #9ba1a8;
  }

  .tag-pill:hover {
    background: #2d5a8c;
    color: #e0e4e8;
  }

  .tag-pill.active {
    background: #2d5a8c;
    color: #e0e4e8;
    text-decoration: none;
  }

  pre {
    background: #1e2228;
    border-color: #2a2e33;
  }

  p code, li code {
    background: #1e2228;
  }

  .site-footer {
    border-top-color: #2a2e33;
    color: #606870;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .wrapper-sidebar {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #e0e0e0;
  }

  .topnav {
    flex-wrap: wrap;
  }

  .topnav-list {
    flex-wrap: wrap;
  }

  .two-columns .columns {
    column-count: 1;
  }

  .post-list li {
    flex-direction: column;
    gap: 0.15rem;
  }
}
